@yoopta/code 2.0.0 → 4.0.0-rc.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.
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/plugin/index.d.ts +14 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/Code.d.ts +4 -0
- package/dist/ui/Code.d.ts.map +1 -0
- package/dist/ui/CodeBlockOptions.d.ts +10 -0
- package/dist/ui/CodeBlockOptions.d.ts.map +1 -0
- package/dist/ui/Select.d.ts +28 -0
- package/dist/ui/Select.d.ts.map +1 -0
- package/dist/utils/element.d.ts +4 -0
- package/dist/utils/element.d.ts.map +1 -0
- package/dist/utils/languages.d.ts +19 -0
- package/dist/utils/languages.d.ts.map +1 -0
- package/dist/utils/themes.d.ts +15 -0
- package/dist/utils/themes.d.ts.map +1 -0
- package/package.json +23 -10
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}>;
|
|
13
|
+
export { Code };
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;EAoBR,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SlateElement } from '@yoopta/editor';
|
|
2
|
+
export type CodePluginElements = 'code';
|
|
3
|
+
export type CodeElementProps = {
|
|
4
|
+
language?: string;
|
|
5
|
+
theme?: string;
|
|
6
|
+
};
|
|
7
|
+
export type CodeElement = SlateElement<'code', CodeElementProps>;
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/ui/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAkD,MAAM,gBAAgB,CAAC;AAkB1G,QAAA,MAAM,UAAU,sCAAuC,wBAAwB,4CAsC9E,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { YooEditor, YooptaBlockData } from '@yoopta/editor';
|
|
2
|
+
import { CodeElement } from '../types';
|
|
3
|
+
type Props = {
|
|
4
|
+
editor: YooEditor;
|
|
5
|
+
block: YooptaBlockData;
|
|
6
|
+
element: CodeElement;
|
|
7
|
+
};
|
|
8
|
+
export declare const CodeBlockOptions: ({ block, editor, element }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=CodeBlockOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/CodeBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAShE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAOvC,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+BAAgC,KAAK,4CA4DjE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
|
+
declare const SelectRoot: import("react").FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
declare const SelectValue: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const SelectTrigger: ({ children, className }: {
|
|
6
|
+
children: any;
|
|
7
|
+
className: any;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const SelectContent: ({ children }: {
|
|
10
|
+
children: any;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const SelectItem: ({ value, children }: {
|
|
13
|
+
value: any;
|
|
14
|
+
children: any;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
type SelectProps = {
|
|
17
|
+
options: {
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
}[];
|
|
21
|
+
onChange: (value: string) => void;
|
|
22
|
+
value: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
};
|
|
26
|
+
declare const Select: ({ options, onChange, value, children, className }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { Select, SelectTrigger, SelectRoot, SelectValue, SelectContent, SelectItem };
|
|
28
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/ui/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,QAAA,MAAM,UAAU,iDAAuB,CAAC;AACxC,QAAA,MAAM,WAAW,8HAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa;;;6CAWlB,CAAC;AAEF,QAAA,MAAM,aAAa;;6CAiBlB,CAAC;AAEF,QAAA,MAAM,UAAU;;;6CASf,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,QAAA,MAAM,MAAM,sDAAuD,WAAW,4CAe7E,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { YooptaBlockData } from '@yoopta/editor';
|
|
2
|
+
export declare const getCodeElement: (block: YooptaBlockData) => import("slate").Descendant | import("@yoopta/editor").SlateElement<string, any>;
|
|
3
|
+
export declare const getCodeElementText: (block: YooptaBlockData) => any;
|
|
4
|
+
//# sourceMappingURL=element.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const LANGUAGES: {
|
|
2
|
+
HTML: any;
|
|
3
|
+
CSS: any;
|
|
4
|
+
JavaScript: import("@codemirror/language").LanguageSupport;
|
|
5
|
+
PHP: any;
|
|
6
|
+
'C++': any;
|
|
7
|
+
Java: any;
|
|
8
|
+
Python: any;
|
|
9
|
+
Markdown: any;
|
|
10
|
+
Rust: any;
|
|
11
|
+
Vue: any;
|
|
12
|
+
SQL: any;
|
|
13
|
+
Angular: any;
|
|
14
|
+
JSON: any;
|
|
15
|
+
XML: any;
|
|
16
|
+
YAML: any;
|
|
17
|
+
};
|
|
18
|
+
export { LANGUAGES };
|
|
19
|
+
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../src/utils/languages.tsx"],"names":[],"mappings":"AAgBA,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;CAgBd,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const themes: {
|
|
2
|
+
BasicLight: import("@codemirror/state").Extension;
|
|
3
|
+
BasicDark: import("@codemirror/state").Extension;
|
|
4
|
+
VSCode: import("@codemirror/state").Extension;
|
|
5
|
+
Sublime: import("@codemirror/state").Extension;
|
|
6
|
+
Okaidia: import("@codemirror/state").Extension;
|
|
7
|
+
Monokai: import("@codemirror/state").Extension;
|
|
8
|
+
MaterialDark: import("@codemirror/state").Extension;
|
|
9
|
+
MaterialLight: import("@codemirror/state").Extension;
|
|
10
|
+
GithubDark: import("@codemirror/state").Extension;
|
|
11
|
+
GithubLight: import("@codemirror/state").Extension;
|
|
12
|
+
Dracula: import("@codemirror/state").Extension;
|
|
13
|
+
Copilot: import("@codemirror/state").Extension;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/utils/themes.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAalB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/code",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-rc.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
|
|
@@ -14,11 +14,9 @@
|
|
|
14
14
|
"dist/"
|
|
15
15
|
],
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@yoopta/editor": ">=
|
|
17
|
+
"@yoopta/editor": ">=4.0.0-rc.0",
|
|
18
18
|
"react": ">=17.0.2",
|
|
19
|
-
"react-dom": ">=17.0.2"
|
|
20
|
-
"slate": ">=0.72.3",
|
|
21
|
-
"slate-react": ">=0.95.0"
|
|
19
|
+
"react-dom": ">=17.0.2"
|
|
22
20
|
},
|
|
23
21
|
"publishConfig": {
|
|
24
22
|
"registry": "https://registry.yarnpkg.com"
|
|
@@ -28,13 +26,28 @@
|
|
|
28
26
|
"url": "git+https://github.com/Darginec05/Editor-Yoopta.git"
|
|
29
27
|
},
|
|
30
28
|
"scripts": {
|
|
31
|
-
"test": "node ./__tests__/yoopta-
|
|
29
|
+
"test": "node ./__tests__/yoopta-callout.test.js",
|
|
30
|
+
"start": "rollup --config rollup.config.js --watch --bundleConfigAsCjs --environment NODE_ENV:development",
|
|
31
|
+
"prepublishOnly": "yarn build",
|
|
32
|
+
"build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production"
|
|
32
33
|
},
|
|
33
34
|
"bugs": {
|
|
34
35
|
"url": "https://github.com/Darginec05/Editor-Yoopta/issues"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
"@codemirror/lang-javascript": "^6.2.2",
|
|
39
|
+
"@radix-ui/react-select": "^2.0.0",
|
|
40
|
+
"@uiw/codemirror-theme-basic": "^4.21.24",
|
|
41
|
+
"@uiw/codemirror-theme-copilot": "^4.21.24",
|
|
42
|
+
"@uiw/codemirror-theme-dracula": "^4.21.24",
|
|
43
|
+
"@uiw/codemirror-theme-github": "^4.21.24",
|
|
44
|
+
"@uiw/codemirror-theme-material": "^4.21.24",
|
|
45
|
+
"@uiw/codemirror-theme-monokai-dimmed": "^4.21.24",
|
|
46
|
+
"@uiw/codemirror-theme-okaidia": "^4.21.24",
|
|
47
|
+
"@uiw/codemirror-theme-sublime": "^4.21.24",
|
|
48
|
+
"@uiw/codemirror-theme-vscode": "^4.21.24",
|
|
49
|
+
"@uiw/react-codemirror": "^4.21.24",
|
|
50
|
+
"copy-to-clipboard": "^3.3.3"
|
|
51
|
+
},
|
|
52
|
+
"gitHead": "7e5c32bd4c48dd21d84359a3fe87ed82cdaf964f"
|
|
53
|
+
}
|