@yoopta/code 4.0.0-rc.15 → 4.0.0-rc.17

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,15 +1,6 @@
1
- import { EditorState } from '@codemirror/state';
2
- import { EditorView } from '@codemirror/view';
3
- import { ReactCodeMirrorProps } from './types';
4
- export interface UseCodeMirror extends ReactCodeMirrorProps {
5
- container?: HTMLDivElement | null;
6
- }
7
- export declare function useCodeMirror(props: UseCodeMirror): {
8
- state: EditorState | undefined;
9
- setState: import("react").Dispatch<import("react").SetStateAction<EditorState | undefined>>;
10
- view: EditorView | undefined;
11
- setView: import("react").Dispatch<import("react").SetStateAction<EditorView | undefined>>;
12
- container: HTMLDivElement | null | undefined;
13
- setContainer: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
1
+ export declare const useCodeMirror: ({ extensions }: {
2
+ extensions: any;
3
+ }) => {
4
+ ref: (node: HTMLElement | null) => void;
14
5
  };
15
6
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/library/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,WAAW,EAA+B,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAmB,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IACzD,SAAS,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CACnC;AAID,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa;;;;;;;EA0JjD"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/library/hooks.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;gBAGO,WAAW,GAAG,IAAI;CAoBlD,CAAC"}
@@ -1,3 +1,5 @@
1
- declare const Code: any;
1
+ import { YooptaPlugin } from '@yoopta/editor';
2
+ import { CodeElementProps } from '../types';
3
+ declare const Code: YooptaPlugin<"code", CodeElementProps, Record<string, unknown>>;
2
4
  export { Code };
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,IAAI,KA8CR,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAsB,MAAM,UAAU,CAAC;AAGhE,QAAA,MAAM,IAAI,iEA8CR,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/ui/Code.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { PluginCustomEditorRenderProps } from '@yoopta/editor';
1
2
  declare const CodeEditor: ({ blockId }: PluginCustomEditorRenderProps) => import("react/jsx-runtime").JSX.Element;
2
3
  export { CodeEditor };
3
4
  //# sourceMappingURL=Code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/ui/Code.tsx"],"names":[],"mappings":"AAsFA,QAAA,MAAM,UAAU,yFAgEf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/ui/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,6BAA6B,EAI9B,MAAM,gBAAgB,CAAC;AAuBxB,QAAA,MAAM,UAAU,gBAAiB,6BAA6B,4CA2D7D,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,3 +1,4 @@
1
- export declare const getCodeElement: (block: YooptaBlockData) => any;
1
+ import { YooptaBlockData } from '@yoopta/editor';
2
+ export declare const getCodeElement: (block: YooptaBlockData) => import("slate").Descendant | import("@yoopta/editor").SlateElement<string, any>;
2
3
  export declare const getCodeElementText: (block: YooptaBlockData) => string;
3
4
  //# sourceMappingURL=element.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/utils/element.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,iCAE1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,oCAS9B,CAAC"}
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../src/utils/element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,cAAc,UAAW,eAAe,oFAEpD,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAAW,eAAe,WASxD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/code",
3
- "version": "4.0.0-rc.15",
3
+ "version": "4.0.0-rc.17",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -35,6 +35,7 @@
35
35
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
36
36
  },
37
37
  "dependencies": {
38
+ "@codemirror/basic-setup": "^0.20.0",
38
39
  "@codemirror/lang-angular": "^0.1.3",
39
40
  "@codemirror/lang-cpp": "^6.0.2",
40
41
  "@codemirror/lang-css": "^6.2.1",
@@ -64,13 +65,11 @@
64
65
  "@uiw/codemirror-theme-okaidia": "^4.21.24",
65
66
  "@uiw/codemirror-theme-sublime": "^4.21.24",
66
67
  "@uiw/codemirror-theme-vscode": "^4.21.24",
67
- "@uiw/react-textarea-code-editor": "^3.0.2",
68
68
  "codemirror": "^6.0.1",
69
- "copy-to-clipboard": "^3.3.3",
70
- "react-error-boundary": "^4.0.13"
69
+ "copy-to-clipboard": "^3.3.3"
71
70
  },
72
71
  "devDependencies": {
73
72
  "check-peer-dependencies": "^4.3.0"
74
73
  },
75
- "gitHead": "a6b657b54c22fb184e3dfabc06226b72ee1c980a"
74
+ "gitHead": "719a4c11b6bd47c6d511c7db12e86c3ee111527f"
76
75
  }
@@ -1,13 +0,0 @@
1
- import { type Extension } from '@codemirror/state';
2
- import { type BasicSetupOptions } from '@uiw/codemirror-extensions-basic-setup';
3
- export declare const defaultLightThemeOption: Extension;
4
- export interface DefaultExtensionsOptions {
5
- indentWithTab?: boolean;
6
- basicSetup?: boolean | BasicSetupOptions;
7
- placeholder?: string | HTMLElement;
8
- theme?: 'light' | 'dark' | 'none' | Extension;
9
- readOnly?: boolean;
10
- editable?: boolean;
11
- }
12
- export declare const getDefaultExtensions: (optios?: DefaultExtensionsOptions) => Extension[];
13
- //# sourceMappingURL=extenstions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extenstions.d.ts","sourceRoot":"","sources":["../../src/library/extenstions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAK5F,eAAO,MAAM,uBAAuB,WASnC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,oBAAoB,YAAY,wBAAwB,KAAQ,SAAS,EA4CrF,CAAC"}
@@ -1,36 +0,0 @@
1
- /// <reference types="react" />
2
- import { EditorState, EditorStateConfig, Extension, StateField } from '@codemirror/state';
3
- import { EditorView, ViewUpdate } from '@codemirror/view';
4
- import { type BasicSetupOptions } from '@uiw/codemirror-extensions-basic-setup';
5
- export interface ReactCodeMirrorProps extends Omit<EditorStateConfig, 'doc' | 'extensions'>, Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'placeholder'> {
6
- value?: string;
7
- height?: string;
8
- minHeight?: string;
9
- maxHeight?: string;
10
- width?: string;
11
- minWidth?: string;
12
- maxWidth?: string;
13
- autoFocus?: boolean;
14
- placeholder?: string | HTMLElement;
15
- theme?: 'light' | 'dark' | 'none' | Extension;
16
- basicSetup?: boolean | BasicSetupOptions;
17
- editable?: boolean;
18
- readOnly?: boolean;
19
- indentWithTab?: boolean;
20
- onChange?(value: string, viewUpdate: ViewUpdate): void;
21
- onStatistics?(data: any): void;
22
- onUpdate?(viewUpdate: ViewUpdate): void;
23
- onCreateEditor?(view: EditorView, state: EditorState): void;
24
- extensions?: Extension[];
25
- root?: ShadowRoot | Document;
26
- initialState?: {
27
- json: any;
28
- fields?: Record<string, StateField<any>>;
29
- };
30
- }
31
- export interface ReactCodeMirrorRef {
32
- editor?: HTMLDivElement | null;
33
- state?: EditorState;
34
- view?: EditorView;
35
- }
36
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/library/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,YAAY,CAAC,EACnD,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAA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