@lotte-innovate/ui-component-test 0.1.102 → 0.1.104
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/_virtual/_commonjsHelpers.mjs +2 -0
- package/dist/lib/_virtual/_commonjsHelpers.mjs.map +1 -0
- package/dist/lib/_virtual/icons.mjs +2 -0
- package/dist/lib/_virtual/icons.mjs.map +1 -0
- package/dist/lib/_virtual/index.mjs +1 -1
- package/dist/lib/_virtual/index10.mjs +2 -0
- package/dist/lib/_virtual/index10.mjs.map +1 -0
- package/dist/lib/_virtual/index11.mjs +2 -0
- package/dist/lib/_virtual/index11.mjs.map +1 -0
- package/dist/lib/_virtual/index12.mjs +2 -0
- package/dist/lib/_virtual/index12.mjs.map +1 -0
- package/dist/lib/_virtual/index13.mjs +2 -0
- package/dist/lib/_virtual/index13.mjs.map +1 -0
- package/dist/lib/_virtual/index14.mjs +2 -0
- package/dist/lib/_virtual/index14.mjs.map +1 -0
- package/dist/lib/_virtual/index15.mjs +2 -0
- package/dist/lib/_virtual/index15.mjs.map +1 -0
- package/dist/lib/_virtual/index16.mjs +2 -0
- package/dist/lib/_virtual/index16.mjs.map +1 -0
- package/dist/lib/_virtual/index17.mjs +2 -0
- package/dist/lib/_virtual/index17.mjs.map +1 -0
- package/dist/lib/_virtual/index18.mjs +2 -0
- package/dist/lib/_virtual/index18.mjs.map +1 -0
- package/dist/lib/_virtual/index2.mjs +1 -1
- package/dist/lib/_virtual/index3.mjs +1 -1
- package/dist/lib/_virtual/index4.mjs +2 -0
- package/dist/lib/_virtual/index4.mjs.map +1 -0
- package/dist/lib/_virtual/index5.mjs +2 -0
- package/dist/lib/_virtual/index5.mjs.map +1 -0
- package/dist/lib/_virtual/index6.mjs +2 -0
- package/dist/lib/_virtual/index6.mjs.map +1 -0
- package/dist/lib/_virtual/index7.mjs +2 -0
- package/dist/lib/_virtual/index7.mjs.map +1 -0
- package/dist/lib/_virtual/index8.mjs +2 -0
- package/dist/lib/_virtual/index8.mjs.map +1 -0
- package/dist/lib/_virtual/index9.mjs +2 -0
- package/dist/lib/_virtual/index9.mjs.map +1 -0
- package/dist/lib/_virtual/model.mjs +2 -0
- package/dist/lib/_virtual/model.mjs.map +1 -0
- package/dist/lib/_virtual/plugin.mjs +2 -0
- package/dist/lib/_virtual/plugin.mjs.map +1 -0
- package/dist/lib/_virtual/plugin2.mjs +2 -0
- package/dist/lib/_virtual/plugin2.mjs.map +1 -0
- package/dist/lib/_virtual/plugin3.mjs +2 -0
- package/dist/lib/_virtual/plugin3.mjs.map +1 -0
- package/dist/lib/_virtual/plugin4.mjs +2 -0
- package/dist/lib/_virtual/plugin4.mjs.map +1 -0
- package/dist/lib/_virtual/plugin5.mjs +2 -0
- package/dist/lib/_virtual/plugin5.mjs.map +1 -0
- package/dist/lib/_virtual/plugin6.mjs +2 -0
- package/dist/lib/_virtual/plugin6.mjs.map +1 -0
- package/dist/lib/_virtual/theme.mjs +2 -0
- package/dist/lib/_virtual/theme.mjs.map +1 -0
- package/dist/lib/_virtual/tinymce.mjs +1 -1
- package/dist/lib/components/Editor/index copy.d.ts +12 -0
- package/dist/lib/components/Editor/index copy.js +77 -0
- package/dist/lib/components/Editor/index.d.ts +14 -1
- package/dist/lib/components/Editor/index.js +33 -39
- package/dist/lib/dist/lib/components/Editor/index.mjs +1 -1
- package/dist/lib/index.css +3749 -0
- package/dist/lib/node_modules/tinymce/icons/default/icons.mjs +2 -0
- package/dist/lib/node_modules/tinymce/icons/default/icons.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/icons/default/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/icons/default/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/models/dom/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/models/dom/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/models/dom/model.mjs +2 -0
- package/dist/lib/node_modules/tinymce/models/dom/model.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/advlist/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/advlist/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/advlist/plugin.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/advlist/plugin.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/code/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/code/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/code/plugin.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/code/plugin.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/emoticons/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/emoticons/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/emoticons/js/emojis.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/emoticons/js/emojis.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/emoticons/plugin.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/emoticons/plugin.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/link/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/link/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/link/plugin.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/link/plugin.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/lists/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/lists/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/lists/plugin.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/lists/plugin.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/table/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/table/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/plugins/table/plugin.mjs +2 -0
- package/dist/lib/node_modules/tinymce/plugins/table/plugin.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/themes/silver/index.mjs +2 -0
- package/dist/lib/node_modules/tinymce/themes/silver/index.mjs.map +1 -0
- package/dist/lib/node_modules/tinymce/themes/silver/theme.mjs +2 -0
- package/dist/lib/node_modules/tinymce/themes/silver/theme.mjs.map +1 -0
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/lib/_virtual/react-is.development.mjs +0 -2
- package/dist/lib/_virtual/react-is.development.mjs.map +0 -1
- package/dist/lib/_virtual/react-is.production.min.mjs +0 -2
- package/dist/lib/_virtual/react-is.production.min.mjs.map +0 -1
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/ScriptLoader2.mjs +0 -2
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/ScriptLoader2.mjs.map +0 -1
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/TinyMCE.mjs +0 -2
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/TinyMCE.mjs.map +0 -1
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/Utils.mjs +0 -2
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/Utils.mjs.map +0 -1
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/Editor.mjs +0 -2
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/Editor.mjs.map +0 -1
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/EditorPropTypes.mjs +0 -2
- package/dist/lib/node_modules/@tinymce/tinymce-react/lib/es2015/main/ts/components/EditorPropTypes.mjs.map +0 -1
- package/dist/lib/node_modules/marked/lib/marked.esm.mjs +0 -2
- package/dist/lib/node_modules/marked/lib/marked.esm.mjs.map +0 -1
- package/dist/lib/node_modules/object-assign/index.mjs +0 -7
- package/dist/lib/node_modules/object-assign/index.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/checkPropTypes.mjs +0 -2
- package/dist/lib/node_modules/prop-types/checkPropTypes.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/factoryWithThrowingShims.mjs +0 -2
- package/dist/lib/node_modules/prop-types/factoryWithThrowingShims.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/factoryWithTypeCheckers.mjs +0 -2
- package/dist/lib/node_modules/prop-types/factoryWithTypeCheckers.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/index.mjs +0 -2
- package/dist/lib/node_modules/prop-types/index.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/lib/ReactPropTypesSecret.mjs +0 -2
- package/dist/lib/node_modules/prop-types/lib/ReactPropTypesSecret.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/lib/has.mjs +0 -2
- package/dist/lib/node_modules/prop-types/lib/has.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.mjs +0 -10
- package/dist/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.mjs +0 -10
- package/dist/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.mjs.map +0 -1
- package/dist/lib/node_modules/prop-types/node_modules/react-is/index.mjs +0 -2
- package/dist/lib/node_modules/prop-types/node_modules/react-is/index.mjs.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"icons.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__require as e}from"../node_modules/
|
1
|
+
import{__require as e}from"../node_modules/tinymce/plugins/advlist/index.mjs";e();
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index10.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index11.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index12.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index13.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index14.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index15.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index16.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index17.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index18.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
var
|
1
|
+
var r={};export{r as __exports};
|
2
2
|
//# sourceMappingURL=index2.mjs.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
import{__require as e}from"../node_modules/tinymce/plugins/emoticons/index.mjs";e();
|
2
2
|
//# sourceMappingURL=index3.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index4.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index5.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index6.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index7.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index8.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index9.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"model.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin3.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin4.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin5.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"plugin6.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"theme.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{__require as e}from"../node_modules/tinymce/tinymce.mjs";e();
|
1
|
+
import{getDefaultExportFromCjs as m}from"./_commonjsHelpers.mjs";import{__require as e}from"../node_modules/tinymce/tinymce.mjs";var o=m(e());export{o as default};
|
2
2
|
//# sourceMappingURL=tinymce.mjs.map
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IAllProps } from '@tinymce/tinymce-react';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
export interface EditorProps extends VariantProps<typeof editorVariants> {
|
5
|
+
tinymceScriptSrc?: string;
|
6
|
+
}
|
7
|
+
declare const editorVariants: (props?: ({
|
8
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
9
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
10
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
11
|
+
export declare const Editor: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & EditorProps & IAllProps & React.RefAttributes<HTMLDivElement>>;
|
12
|
+
export default Editor;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
'use client';
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
3
|
+
__assign = Object.assign || function(t) {
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
+
s = arguments[i];
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
+
t[p] = s[p];
|
8
|
+
}
|
9
|
+
return t;
|
10
|
+
};
|
11
|
+
return __assign.apply(this, arguments);
|
12
|
+
};
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
14
|
+
var t = {};
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
16
|
+
t[p] = s[p];
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
20
|
+
t[p[i]] = s[p[i]];
|
21
|
+
}
|
22
|
+
return t;
|
23
|
+
};
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
25
|
+
import { forwardRef } from 'react';
|
26
|
+
import { Editor as EditorUI } from '@tinymce/tinymce-react';
|
27
|
+
import { cva } from 'class-variance-authority';
|
28
|
+
import { scalingVariants } from '../../../lib/constants';
|
29
|
+
import { cn } from '../../../lib/utils/utils';
|
30
|
+
import { marked } from 'marked';
|
31
|
+
var editorVariants = cva('', {
|
32
|
+
variants: {
|
33
|
+
scaling: __assign({}, scalingVariants),
|
34
|
+
size: {
|
35
|
+
small: 'w-[500px] h-[350px]',
|
36
|
+
medium: 'w-[550px] h-[400px]',
|
37
|
+
large: 'w-[600px] h-[450px]',
|
38
|
+
},
|
39
|
+
},
|
40
|
+
defaultVariants: {
|
41
|
+
scaling: '100%',
|
42
|
+
size: 'medium',
|
43
|
+
},
|
44
|
+
});
|
45
|
+
export var Editor = forwardRef(function (_a, ref) {
|
46
|
+
var className = _a.className, size = _a.size, scaling = _a.scaling, tinymceScriptSrc = _a.tinymceScriptSrc, props = __rest(_a, ["className", "size", "scaling", "tinymceScriptSrc"]);
|
47
|
+
return (_jsx("div", { ref: ref, className: cn(editorVariants({ size: size, scaling: scaling }), className), children: _jsx(EditorUI, __assign({ tinymceScriptSrc: tinymceScriptSrc !== null && tinymceScriptSrc !== void 0 ? tinymceScriptSrc : "/tinymce/tinymce.min.js", initialValue: "", init: {
|
48
|
+
height: '100%',
|
49
|
+
menubar: false,
|
50
|
+
// plugins: ['image', 'code', 'link', 'table'],
|
51
|
+
plugins: ['advlist', 'autolink', 'lists', 'link', 'image', 'code', 'table', 'codesample'],
|
52
|
+
toolbar: 'undo redo | blocks | ' +
|
53
|
+
'bold italic forecolor strikethrough | hr blockquote | ' +
|
54
|
+
'bullist numlist outdent indent | ' +
|
55
|
+
'table image link | codeformat codesample | markdown',
|
56
|
+
content_style: 'body { font-family:Noto Sans KR,sans-serif,Nunito Sans,Helvetica Neue,Helvetica; font-size:14px }',
|
57
|
+
setup: function (editor) {
|
58
|
+
editor.ui.registry.addButton('markdown', {
|
59
|
+
text: 'Markdown',
|
60
|
+
onAction: function () {
|
61
|
+
var content = editor.getContent({ format: 'text' });
|
62
|
+
var html = marked(content);
|
63
|
+
editor.setContent(html);
|
64
|
+
},
|
65
|
+
});
|
66
|
+
editor.ui.registry.addButton('codeformat', {
|
67
|
+
icon: 'sourcecode',
|
68
|
+
tooltip: 'Inline code',
|
69
|
+
onAction: function () {
|
70
|
+
editor.formatter.toggle('code');
|
71
|
+
},
|
72
|
+
});
|
73
|
+
},
|
74
|
+
} }, props)) }));
|
75
|
+
});
|
76
|
+
Editor.displayName = 'Editor';
|
77
|
+
export default Editor;
|
@@ -1,6 +1,19 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IAllProps } from '@tinymce/tinymce-react';
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
4
|
+
import 'tinymce/icons/default';
|
5
|
+
import 'tinymce/themes/silver';
|
6
|
+
import 'tinymce/models/dom';
|
7
|
+
import 'tinymce/skins/ui/oxide/skin.css';
|
8
|
+
import 'tinymce/plugins/advlist';
|
9
|
+
import 'tinymce/plugins/code';
|
10
|
+
import 'tinymce/plugins/emoticons';
|
11
|
+
import 'tinymce/plugins/emoticons/js/emojis';
|
12
|
+
import 'tinymce/plugins/link';
|
13
|
+
import 'tinymce/plugins/lists';
|
14
|
+
import 'tinymce/plugins/table';
|
15
|
+
import 'tinymce/skins/ui/oxide/content.css';
|
16
|
+
import 'tinymce/skins/content/default/content.css';
|
4
17
|
export interface EditorProps extends VariantProps<typeof editorVariants> {
|
5
18
|
tinymceScriptSrc?: string;
|
6
19
|
}
|
@@ -9,5 +22,5 @@ declare const editorVariants: (props?: ({
|
|
9
22
|
size?: "small" | "medium" | "large" | null | undefined;
|
10
23
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
11
24
|
export declare const initTinyMCE: () => void;
|
12
|
-
export declare const Editor: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.
|
25
|
+
export declare const Editor: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & EditorProps & IAllProps & React.RefAttributes<HTMLTextAreaElement>>;
|
13
26
|
export default Editor;
|
@@ -22,13 +22,27 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
22
22
|
return t;
|
23
23
|
};
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
25
|
-
import { forwardRef } from 'react';
|
26
|
-
import { Editor as EditorUI } from '@tinymce/tinymce-react';
|
25
|
+
import { forwardRef, useEffect } from 'react';
|
27
26
|
import { cva } from 'class-variance-authority';
|
28
27
|
import { scalingVariants } from '../../../lib/constants';
|
29
|
-
import
|
30
|
-
import
|
31
|
-
import
|
28
|
+
import tinymce from 'tinymce';
|
29
|
+
/* Default icons are required. After that, import custom icons if applicable */
|
30
|
+
import 'tinymce/icons/default';
|
31
|
+
/* Required TinyMCE components */
|
32
|
+
import 'tinymce/themes/silver';
|
33
|
+
import 'tinymce/models/dom';
|
34
|
+
/* Import a skin (can be a custom skin instead of the default) */
|
35
|
+
import 'tinymce/skins/ui/oxide/skin.css';
|
36
|
+
/* Import plugins */
|
37
|
+
import 'tinymce/plugins/advlist';
|
38
|
+
import 'tinymce/plugins/code';
|
39
|
+
import 'tinymce/plugins/emoticons';
|
40
|
+
import 'tinymce/plugins/emoticons/js/emojis';
|
41
|
+
import 'tinymce/plugins/link';
|
42
|
+
import 'tinymce/plugins/lists';
|
43
|
+
import 'tinymce/plugins/table';
|
44
|
+
import 'tinymce/skins/ui/oxide/content.css';
|
45
|
+
import 'tinymce/skins/content/default/content.css';
|
32
46
|
var editorVariants = cva('', {
|
33
47
|
variants: {
|
34
48
|
scaling: __assign({}, scalingVariants),
|
@@ -44,43 +58,23 @@ var editorVariants = cva('', {
|
|
44
58
|
},
|
45
59
|
});
|
46
60
|
export var initTinyMCE = function () {
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
61
|
+
if (typeof window !== 'undefined') {
|
62
|
+
tinymce.init({
|
63
|
+
selector: '#tinymce',
|
64
|
+
plugins: 'link table image code',
|
65
|
+
toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | code',
|
66
|
+
skin: false,
|
67
|
+
tinymceScriptSrc: '',
|
68
|
+
src: '',
|
69
|
+
});
|
70
|
+
}
|
53
71
|
};
|
54
72
|
export var Editor = forwardRef(function (_a, ref) {
|
55
73
|
var className = _a.className, size = _a.size, scaling = _a.scaling, tinymceScriptSrc = _a.tinymceScriptSrc, props = __rest(_a, ["className", "size", "scaling", "tinymceScriptSrc"]);
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
plugins: ['advlist', 'autolink', 'lists', 'link', 'image', 'code', 'table', 'codesample'],
|
61
|
-
toolbar: 'undo redo | blocks | ' +
|
62
|
-
'bold italic forecolor strikethrough | hr blockquote | ' +
|
63
|
-
'bullist numlist outdent indent | ' +
|
64
|
-
'table image link | codeformat codesample | markdown',
|
65
|
-
content_style: 'body { font-family:Noto Sans KR,sans-serif,Nunito Sans,Helvetica Neue,Helvetica; font-size:14px }',
|
66
|
-
setup: function (editor) {
|
67
|
-
editor.ui.registry.addButton('markdown', {
|
68
|
-
text: 'Markdown',
|
69
|
-
onAction: function () {
|
70
|
-
var content = editor.getContent({ format: 'text' });
|
71
|
-
var html = marked(content);
|
72
|
-
editor.setContent(html);
|
73
|
-
},
|
74
|
-
});
|
75
|
-
editor.ui.registry.addButton('codeformat', {
|
76
|
-
icon: 'sourcecode',
|
77
|
-
tooltip: 'Inline code',
|
78
|
-
onAction: function () {
|
79
|
-
editor.formatter.toggle('code');
|
80
|
-
},
|
81
|
-
});
|
82
|
-
},
|
83
|
-
} }, props)) }));
|
74
|
+
useEffect(function () {
|
75
|
+
initTinyMCE();
|
76
|
+
}, []);
|
77
|
+
return _jsx("textarea", { id: "tinymce", ref: ref });
|
84
78
|
});
|
85
79
|
Editor.displayName = 'Editor';
|
86
80
|
export default Editor;
|
@@ -1,3 +1,3 @@
|
|
1
1
|
"use client";
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{forwardRef as
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{forwardRef as i,useEffect as r}from"react";import{cva as e}from"class-variance-authority";import{scalingVariants as n}from"../../constants.mjs";import o from"../../../../_virtual/tinymce.mjs";import"../../../../_virtual/index9.mjs";import"../../../../_virtual/index17.mjs";import"../../../../_virtual/index5.mjs";import"../../../../_virtual/index.mjs";import"../../../../_virtual/index7.mjs";import"../../../../_virtual/index3.mjs";import"../../../../node_modules/tinymce/plugins/emoticons/js/emojis.mjs";import"../../../../_virtual/index11.mjs";import"../../../../_virtual/index13.mjs";import"../../../../_virtual/index15.mjs";var a=function(){return a=Object.assign||function(t){for(var i,r=1,e=arguments.length;r<e;r++)for(var n in i=arguments[r])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t},a.apply(this,arguments)},m=function(t,i){var r={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(r[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(t);n<e.length;n++)i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(r[e[n]]=t[e[n]])}return r};e("",{variants:{scaling:a({},n),size:{small:"w-[500px] h-[350px]",medium:"w-[550px] h-[400px]",large:"w-[600px] h-[450px]"}},defaultVariants:{scaling:"100%",size:"medium"}});var s=function(){"undefined"!=typeof window&&o.init({selector:"#tinymce",plugins:"link table image code",toolbar:"undo redo | formatselect | bold italic | alignleft aligncenter alignright | code",skin:!1,tinymceScriptSrc:"",src:""})},l=i((function(i,e){return i.className,i.size,i.scaling,i.tinymceScriptSrc,m(i,["className","size","scaling","tinymceScriptSrc"]),r((function(){s()}),[]),t("textarea",{id:"tinymce",ref:e})}));l.displayName="Editor";export{l as Editor,l as default,s as initTinyMCE};
|
3
3
|
//# sourceMappingURL=index.mjs.map
|