temp
This commit is contained in:
2
packages/codemirror/.npmrc
Normal file
2
packages/codemirror/.npmrc
Normal file
@@ -0,0 +1,2 @@
|
||||
//npm.xiongxiao.me/:_authToken=${ME_NPM_TOKEN}
|
||||
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
||||
19
packages/codemirror/dist/editor.d.ts
vendored
Normal file
19
packages/codemirror/dist/editor.d.ts
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { EditorView } from 'codemirror';
|
||||
declare let editor: EditorView;
|
||||
type CreateOpts = {
|
||||
jsx?: boolean;
|
||||
typescript?: boolean;
|
||||
};
|
||||
/**
|
||||
* 创建单例
|
||||
* @param el
|
||||
* @returns
|
||||
*/
|
||||
declare const createEditorInstance: (el?: HTMLDivElement, opts?: CreateOpts) => EditorView;
|
||||
/**
|
||||
* 每次都创建新的实例
|
||||
* @param el
|
||||
* @returns
|
||||
*/
|
||||
export declare const createEditor: (el: HTMLDivElement, opts?: CreateOpts) => EditorView;
|
||||
export { editor, createEditorInstance };
|
||||
27136
packages/codemirror/dist/editor.js
vendored
Normal file
27136
packages/codemirror/dist/editor.js
vendored
Normal file
File diff suppressed because one or more lines are too long
15
packages/codemirror/dist/editor.json.d.ts
vendored
Normal file
15
packages/codemirror/dist/editor.json.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { EditorView } from 'codemirror';
|
||||
declare let editor: EditorView;
|
||||
/**
|
||||
* 创建单例
|
||||
* @param el
|
||||
* @returns
|
||||
*/
|
||||
declare const createEditorInstance: (el?: HTMLDivElement) => EditorView;
|
||||
/**
|
||||
* 每次都创建新的实例
|
||||
* @param el
|
||||
* @returns
|
||||
*/
|
||||
export declare const createEditor: (el: HTMLDivElement) => EditorView;
|
||||
export { editor, createEditorInstance };
|
||||
26271
packages/codemirror/dist/editor.json.js
vendored
Normal file
26271
packages/codemirror/dist/editor.json.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
# kevisual codemirror
|
||||
|
||||
```ts
|
||||
import { createEditorInstance } from '@kevisual/codemirror';
|
||||
const editor = createEditorInstance(ref.current!, { typescript: false });
|
||||
editor.dom.style.height = '100%';
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user