@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.
@@ -1,7 +1,7 @@
1
- import { EditorProps, EditorRef } from '../../../types';
2
- import { ThemeType } from '../../../extensions';
1
+ import { EditorProps, EditorRef } from '../types';
2
+ import { ThemeType } from '../extensions';
3
3
 
4
- declare const _default: import('../../react').ForwardRefExoticComponent<EditorProps & {
4
+ declare const _default: import('react').ForwardRefExoticComponent<EditorProps & {
5
5
  theme?: ThemeType;
6
- } & import('../../react').RefAttributes<EditorRef>>;
6
+ } & import('react').RefAttributes<EditorRef>>;
7
7
  export default _default;
@@ -1,9 +1,9 @@
1
- import { EditorProps, EditorRef } from '../../../types';
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('../../react').ForwardRefExoticComponent<EditorProps & import('../../react').RefAttributes<EditorRef>>;
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 '../../react';
2
- import { JSONEditorProps, EditorRef } from '../../../types';
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 '../../../types';
1
+ import { SQLEditorProps, EditorRef } from '../types';
2
2
 
3
- declare const _default: import('../../react').ForwardRefExoticComponent<SQLEditorProps & import('../../react').RefAttributes<EditorRef>>;
3
+ declare const _default: import('react').ForwardRefExoticComponent<SQLEditorProps & import('react').RefAttributes<EditorRef>>;
4
4
  export default _default;
@@ -1,4 +1,4 @@
1
- import { Extension } from '../../@codemirror/state';
1
+ import { Extension } from '@codemirror/state';
2
2
 
3
3
  /**
4
4
  * 创建自动补全扩展
@@ -1,6 +1,6 @@
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
+ 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 '../../@codemirror/state';
2
- import { JSONHighlightMatch } from '../../../types';
3
- import { DecorationSet } from '../../@codemirror/view';
4
- import { CSSProperties } from '../../react';
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('../../@codemirror/state').Extension;
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('../../@codemirror/state').Extension | StateField<DecorationSet>)[];
32
+ export declare function createJSONHighlightExtension(matches: JSONHighlightMatch[], className?: string, style?: CSSProperties): (import('@codemirror/state').Extension | StateField<DecorationSet>)[];
@@ -1,4 +1,4 @@
1
- import { Extension } from '../../@codemirror/state';
1
+ import { Extension } from '@codemirror/state';
2
2
 
3
3
  /**
4
4
  * 支持的语言类型
@@ -1,5 +1,5 @@
1
- import { Extension } from '../../@codemirror/state';
2
- import { EditorView } from '../../@codemirror/view';
1
+ import { Extension } from '@codemirror/state';
2
+ import { EditorView } from '@codemirror/view';
3
3
 
4
4
  /**
5
5
  * 只读区域范围接口
@@ -1,5 +1,5 @@
1
- import { Extension } from '../../@codemirror/state';
2
- import { searchKeymap, highlightSelectionMatches, search } from '../../@codemirror/search';
1
+ import { Extension } from '@codemirror/state';
2
+ import { searchKeymap, highlightSelectionMatches, search } from '@codemirror/search';
3
3
 
4
4
  /**
5
5
  * 创建搜索扩展(中文版)
@@ -1,4 +1,4 @@
1
- import { Extension } from '../../@codemirror/state';
1
+ import { Extension } from '@codemirror/state';
2
2
 
3
3
  /**
4
4
  * 编辑器主题类型
@@ -1,5 +1,5 @@
1
- import { EditorState } from '../../@codemirror/state';
2
- import { JSONHighlightMatch } from '../types';
1
+ import { EditorState } from '@codemirror/state';
2
+ import { JSONHighlightMatch } from 'src/types';
3
3
 
4
4
  /**
5
5
  * 区块内容项接口
@@ -1 +1 @@
1
- export * from '../../search-zh-cn';
1
+ export * from './search-zh-cn';
@@ -1,5 +1,5 @@
1
- import { Extension } from '../../@codemirror/state';
2
- import { EditorView } from '../../@codemirror/view';
1
+ import { Extension } from '@codemirror/state';
2
+ import { EditorView } from '@codemirror/view';
3
3
 
4
4
  /**
5
5
  * CodeMirror 6 中文翻译
@@ -1,5 +1,5 @@
1
- import { Extension } from '../../@codemirror/state';
2
- import { EditorView } from '../../@codemirror/view';
1
+ import { Extension } from '@codemirror/state';
2
+ import { EditorView } from '@codemirror/view';
3
3
 
4
4
  /**
5
5
  * CodeMirror 搜索面板中文翻译
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
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';
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';