@senyao-design-system/editor 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Editor.d.ts +4 -4
- package/dist/components/GenericEditor.d.ts +2 -2
- package/dist/components/JSONEditor.d.ts +2 -2
- package/dist/components/SQLEditor.d.ts +2 -2
- package/dist/extensions/features.d.ts +1 -1
- package/dist/extensions/index.d.ts +6 -6
- package/dist/extensions/jsonHighlight.d.ts +14 -6
- package/dist/extensions/language.d.ts +1 -1
- package/dist/extensions/readOnlyRanges.d.ts +2 -2
- package/dist/extensions/search.d.ts +2 -2
- package/dist/extensions/theme.d.ts +1 -1
- package/dist/extensions/utils.d.ts +2 -2
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/search-zh-cn-v2.d.ts +2 -2
- package/dist/i18n/search-zh-cn.d.ts +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +16 -16
- package/dist/index.mjs +1052 -970
- package/dist/types.d.ts +8 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EditorProps, EditorRef } from '
|
|
2
|
-
import { ThemeType } from '
|
|
1
|
+
import { EditorProps, EditorRef } from '../types';
|
|
2
|
+
import { ThemeType } from '../extensions';
|
|
3
3
|
|
|
4
|
-
declare const _default: import('
|
|
4
|
+
declare const _default: import('react').ForwardRefExoticComponent<EditorProps & {
|
|
5
5
|
theme?: ThemeType;
|
|
6
|
-
} & import('
|
|
6
|
+
} & import('react').RefAttributes<EditorRef>>;
|
|
7
7
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EditorProps, EditorRef } from '
|
|
1
|
+
import { EditorProps, EditorRef } from '../types';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* 通用编辑器组件
|
|
5
5
|
* 作为所有特定编辑器的基础组件
|
|
6
6
|
*/
|
|
7
7
|
export declare const GenericEditor: ({ value, onChange, extensions, height, disabled, readOnly, className, style, placeholder: placeholderText, showLineNumbers, onEditorViewCreated, locale, }: EditorProps, ref: React.Ref<EditorRef>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare const _default: import('
|
|
8
|
+
declare const _default: import('react').ForwardRefExoticComponent<EditorProps & import('react').RefAttributes<EditorRef>>;
|
|
9
9
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as React } from '
|
|
2
|
-
import { JSONEditorProps, EditorRef } from '
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { JSONEditorProps, EditorRef } from '../types';
|
|
3
3
|
|
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<JSONEditorProps & React.RefAttributes<EditorRef>>;
|
|
5
5
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SQLEditorProps, EditorRef } from '
|
|
1
|
+
import { SQLEditorProps, EditorRef } from '../types';
|
|
2
2
|
|
|
3
|
-
declare const _default: import('
|
|
3
|
+
declare const _default: import('react').ForwardRefExoticComponent<SQLEditorProps & import('react').RefAttributes<EditorRef>>;
|
|
4
4
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
1
|
+
export * from './language';
|
|
2
|
+
export * from './features';
|
|
3
|
+
export * from './theme';
|
|
4
|
+
export * from './utils';
|
|
5
|
+
export * from './readOnlyRanges';
|
|
6
|
+
export * from './search';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EditorState, StateField } from '
|
|
2
|
-
import { JSONHighlightMatch } from '
|
|
3
|
-
import { DecorationSet } from '
|
|
4
|
-
import { CSSProperties } from '
|
|
1
|
+
import { EditorState, StateField } from '@codemirror/state';
|
|
2
|
+
import { JSONHighlightMatch } from '../types';
|
|
3
|
+
import { DecorationSet } from '@codemirror/view';
|
|
4
|
+
import { CSSProperties } from 'react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 查找匹配的 JSON 节点范围
|
|
@@ -10,10 +10,18 @@ export declare function findMatchingRanges(state: EditorState, matches: JSONHigh
|
|
|
10
10
|
from: number;
|
|
11
11
|
to: number;
|
|
12
12
|
}>;
|
|
13
|
+
/**
|
|
14
|
+
* 查找匹配的 JSON 节点范围(包含匹配信息)
|
|
15
|
+
*/
|
|
16
|
+
export declare function findMatchingRangesWithMatch(state: EditorState, matches: JSONHighlightMatch[]): Array<{
|
|
17
|
+
from: number;
|
|
18
|
+
to: number;
|
|
19
|
+
match: JSONHighlightMatch;
|
|
20
|
+
}>;
|
|
13
21
|
/**
|
|
14
22
|
* 创建 JSON 高亮主题
|
|
15
23
|
*/
|
|
16
|
-
export declare function createJSONHighlightTheme(className?: string, style?: CSSProperties): import('
|
|
24
|
+
export declare function createJSONHighlightTheme(className?: string, style?: CSSProperties): import('@codemirror/state').Extension;
|
|
17
25
|
/**
|
|
18
26
|
* 创建 JSON 高亮装饰
|
|
19
27
|
*/
|
|
@@ -21,4 +29,4 @@ export declare function createJSONHighlightPlugin(matches: JSONHighlightMatch[],
|
|
|
21
29
|
/**
|
|
22
30
|
* 创建完整的 JSON 高亮扩展(主题 + 插件)
|
|
23
31
|
*/
|
|
24
|
-
export declare function createJSONHighlightExtension(matches: JSONHighlightMatch[], className?: string, style?: CSSProperties): (import('
|
|
32
|
+
export declare function createJSONHighlightExtension(matches: JSONHighlightMatch[], className?: string, style?: CSSProperties): (import('@codemirror/state').Extension | StateField<DecorationSet>)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Extension } from '
|
|
2
|
-
import { searchKeymap, highlightSelectionMatches, search } from '
|
|
1
|
+
import { Extension } from '@codemirror/state';
|
|
2
|
+
import { searchKeymap, highlightSelectionMatches, search } from '@codemirror/search';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 创建搜索扩展(中文版)
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from './search-zh-cn';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { default as Editor } from '
|
|
2
|
-
export { default as SQLEditor } from '
|
|
3
|
-
export { default as JSONEditor } from '
|
|
4
|
-
export { default as GenericEditor } from '
|
|
5
|
-
export { blocksToEditorData, findMatchingRanges } from '
|
|
6
|
-
export type { ContentBlock, EditorData } from '
|
|
7
|
-
export type { EditorChangeEvent, ReadOnlyRange, EditorProps, EditorRef, SQLEditorProps, JSONEditorProps, } from '
|
|
8
|
-
export * from '
|
|
9
|
-
export { openSearchPanel, closeSearchPanel } from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
1
|
+
export { default as Editor } from './components/Editor';
|
|
2
|
+
export { default as SQLEditor } from './components/SQLEditor';
|
|
3
|
+
export { default as JSONEditor } from './components/JSONEditor';
|
|
4
|
+
export { default as GenericEditor } from './components/GenericEditor';
|
|
5
|
+
export { blocksToEditorData, findMatchingRanges } from './extensions/utils';
|
|
6
|
+
export type { ContentBlock, EditorData } from './extensions/utils';
|
|
7
|
+
export type { EditorChangeEvent, ReadOnlyRange, EditorProps, EditorRef, SQLEditorProps, JSONEditorProps, } from './types';
|
|
8
|
+
export * from './extensions';
|
|
9
|
+
export { openSearchPanel, closeSearchPanel } from '@codemirror/search';
|
|
10
|
+
export * from './i18n';
|
|
11
|
+
export * from './types';
|