@yoopta/code 4.0.0-rc.9 → 4.0.0-y.0

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.
@@ -0,0 +1,13 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { EditorState } from '@codemirror/state';
3
+ import { EditorView } from '@codemirror/view';
4
+ import { ReactCodeMirrorProps } from './types';
5
+ export interface UseCodeMirror extends ReactCodeMirrorProps {
6
+ container?: HTMLDivElement | null;
7
+ }
8
+ export declare function useCodeMirror(props: UseCodeMirror): {
9
+ state: EditorState | undefined;
10
+ setState: import("react").Dispatch<import("react").SetStateAction<EditorState | undefined>>;
11
+ view: EditorView | undefined;
12
+ setView: import("react").Dispatch<import("react").SetStateAction<EditorView | undefined>>;
13
+ container: HTMLDivElement | null | undefined;
14
+ setContainer: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null | undefined>>;
15
+ };
16
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,36 @@
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
@@ -0,0 +1 @@
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,CAAC,EAAE,UAAU,GAAG,aAAa,CAAC;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9C,UAAU,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IACvD,YAAY,CAAC,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IACxC,cAAc,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5D,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC7B,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,GAAG,CAAC;QACV,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;KAC1C,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB"}
@@ -1,14 +1,3 @@
1
- import { YooptaPlugin } from '@yoopta/editor';
2
- declare const Code: YooptaPlugin<"code", {
3
- nodeType: "void";
4
- language: string;
5
- theme: string;
6
- }, {
7
- display: {
8
- title: string;
9
- description: string;
10
- };
11
- shortcuts: string[];
12
- }>;
1
+ declare const Code: any;
13
2
  export { Code };
14
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,QAAA,MAAM,IAAI;;;;;;;;;;EAuBR,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,IAAI,KAuBR,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/ui/Code.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { PluginCustomEditorRenderProps } from '@yoopta/editor';
2
1
  declare const CodeEditor: ({ blockId }: PluginCustomEditorRenderProps) => import("react/jsx-runtime").JSX.Element;
3
2
  export { CodeEditor };
4
3
  //# sourceMappingURL=Code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/ui/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,6BAA6B,EAAqB,MAAM,gBAAgB,CAAC;AAkBjH,QAAA,MAAM,UAAU,gBAAiB,6BAA6B,4CAgD7D,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/ui/Code.tsx"],"names":[],"mappings":"AAiFA,QAAA,MAAM,UAAU,yFAkDf,CAAC;AAMF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,4 +1,3 @@
1
- import { YooptaBlockData } from '@yoopta/editor';
2
- export declare const getCodeElement: (block: YooptaBlockData) => import("slate").Descendant | import("@yoopta/editor").SlateElement<string, any>;
1
+ export declare const getCodeElement: (block: YooptaBlockData) => any;
3
2
  export declare const getCodeElementText: (block: YooptaBlockData) => any;
4
3
  //# sourceMappingURL=element.d.ts.map
@@ -1 +1 @@
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,QAGxD,CAAC"}
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,iCAG9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/code",
3
- "version": "4.0.0-rc.9",
3
+ "version": "4.0.0-y.0",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -35,7 +35,6 @@
35
35
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
36
36
  },
37
37
  "dependencies": {
38
- "@babel/runtime": "^7.24.1",
39
38
  "@codemirror/lang-angular": "^0.1.3",
40
39
  "@codemirror/lang-cpp": "^6.0.2",
41
40
  "@codemirror/lang-css": "^6.2.1",
@@ -55,6 +54,7 @@
55
54
  "@codemirror/theme-one-dark": "^6.1.2",
56
55
  "@codemirror/view": "^6.26.0",
57
56
  "@radix-ui/react-select": "^2.0.0",
57
+ "@uiw/codemirror-extensions-basic-setup": "^4.21.24",
58
58
  "@uiw/codemirror-theme-basic": "^4.21.24",
59
59
  "@uiw/codemirror-theme-copilot": "^4.21.24",
60
60
  "@uiw/codemirror-theme-dracula": "^4.21.24",
@@ -64,12 +64,12 @@
64
64
  "@uiw/codemirror-theme-okaidia": "^4.21.24",
65
65
  "@uiw/codemirror-theme-sublime": "^4.21.24",
66
66
  "@uiw/codemirror-theme-vscode": "^4.21.24",
67
- "@uiw/react-codemirror": "^4.21.24",
68
67
  "codemirror": "^6.0.1",
69
- "copy-to-clipboard": "^3.3.3"
68
+ "copy-to-clipboard": "^3.3.3",
69
+ "react-error-boundary": "^4.0.13"
70
70
  },
71
71
  "devDependencies": {
72
72
  "check-peer-dependencies": "^4.3.0"
73
73
  },
74
- "gitHead": "cc62077c55822e5134845eb0a43a0dd5432512b8"
74
+ "gitHead": "88cf755f353743fea2a1a89dbd466c59009c7988"
75
75
  }