@lotte-innovate/ui-component-test 0.1.106 → 0.1.108
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/components/Editor/index copy.d.ts +1 -15
- package/dist/lib/components/Editor/index copy.js +8 -35
- package/dist/lib/components/Editor/index.d.ts +15 -1
- package/dist/lib/components/Editor/index.js +35 -8
- package/dist/lib/components/Editor/index.mjs +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -4
@@ -1,19 +1,6 @@
|
|
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';
|
17
4
|
export interface EditorProps extends VariantProps<typeof editorVariants> {
|
18
5
|
tinymceScriptSrc?: string;
|
19
6
|
}
|
@@ -21,6 +8,5 @@ declare const editorVariants: (props?: ({
|
|
21
8
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
22
9
|
size?: "small" | "medium" | "large" | null | undefined;
|
23
10
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
24
|
-
export declare const
|
25
|
-
export declare const Editor: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & EditorProps & IAllProps & React.RefAttributes<HTMLTextAreaElement>>;
|
11
|
+
export declare const Editor: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & EditorProps & IAllProps & React.RefAttributes<HTMLDivElement>>;
|
26
12
|
export default Editor;
|
@@ -22,27 +22,11 @@ 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
|
25
|
+
import { forwardRef } from 'react';
|
26
|
+
import { Editor as EditorUI } from '@tinymce/tinymce-react';
|
26
27
|
import { cva } from 'class-variance-authority';
|
27
28
|
import { scalingVariants } from '../../constants';
|
28
|
-
import
|
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';
|
29
|
+
import { cn } from '../../utils/utils';
|
46
30
|
var editorVariants = cva('', {
|
47
31
|
variants: {
|
48
32
|
scaling: __assign({}, scalingVariants),
|
@@ -57,24 +41,13 @@ var editorVariants = cva('', {
|
|
57
41
|
size: 'medium',
|
58
42
|
},
|
59
43
|
});
|
60
|
-
export var initTinyMCE = function () {
|
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
|
-
}
|
71
|
-
};
|
72
44
|
export var Editor = forwardRef(function (_a, ref) {
|
73
45
|
var className = _a.className, size = _a.size, scaling = _a.scaling, tinymceScriptSrc = _a.tinymceScriptSrc, props = __rest(_a, ["className", "size", "scaling", "tinymceScriptSrc"]);
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
46
|
+
return (_jsx("div", { ref: ref, className: cn(editorVariants({ size: size, scaling: scaling }), className), children: _jsx(EditorUI, __assign({ tinymceScriptSrc: "/tinymce/tinymce.min.js", initialValue: "", init: {
|
47
|
+
height: '100%',
|
48
|
+
menubar: false,
|
49
|
+
// plugins: ['image', 'code', 'link', 'table'],
|
50
|
+
} }, props)) }));
|
78
51
|
});
|
79
52
|
Editor.displayName = 'Editor';
|
80
53
|
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
|
}
|
@@ -8,5 +21,6 @@ declare const editorVariants: (props?: ({
|
|
8
21
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
9
22
|
size?: "small" | "medium" | "large" | null | undefined;
|
10
23
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
11
|
-
export declare const
|
24
|
+
export declare const initTinyMCE: () => void;
|
25
|
+
export declare const Editor: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & EditorProps & IAllProps & React.RefAttributes<HTMLTextAreaElement>>;
|
12
26
|
export default Editor;
|
@@ -22,11 +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 '../../constants';
|
29
|
-
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';
|
30
46
|
var editorVariants = cva('', {
|
31
47
|
variants: {
|
32
48
|
scaling: __assign({}, scalingVariants),
|
@@ -41,13 +57,24 @@ var editorVariants = cva('', {
|
|
41
57
|
size: 'medium',
|
42
58
|
},
|
43
59
|
});
|
60
|
+
export var initTinyMCE = function () {
|
61
|
+
if (typeof window !== 'undefined') {
|
62
|
+
tinymce.init({
|
63
|
+
selector: '#tinymce',
|
64
|
+
plugins: 'link table code',
|
65
|
+
toolbar: 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | code',
|
66
|
+
skin: false,
|
67
|
+
tinymceScriptSrc: '',
|
68
|
+
src: '',
|
69
|
+
});
|
70
|
+
}
|
71
|
+
};
|
44
72
|
export var Editor = forwardRef(function (_a, ref) {
|
45
73
|
var className = _a.className, size = _a.size, scaling = _a.scaling, tinymceScriptSrc = _a.tinymceScriptSrc, props = __rest(_a, ["className", "size", "scaling", "tinymceScriptSrc"]);
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
} }, props)) }));
|
74
|
+
useEffect(function () {
|
75
|
+
initTinyMCE();
|
76
|
+
}, []);
|
77
|
+
return _jsx("textarea", { id: "tinymce", ref: ref });
|
51
78
|
});
|
52
79
|
Editor.displayName = 'Editor';
|
53
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 e}from"react";import{cva as n}from"class-variance-authority";import{scalingVariants as r}from"../../constants.mjs";import o from"tinymce";import"tinymce/icons/default";import"tinymce/themes/silver";import"tinymce/models/dom";import"tinymce/skins/ui/oxide/skin.css";import"tinymce/plugins/advlist";import"tinymce/plugins/code";import"tinymce/plugins/emoticons";import"tinymce/plugins/emoticons/js/emojis";import"tinymce/plugins/link";import"tinymce/plugins/lists";import"tinymce/plugins/table";import"tinymce/skins/ui/oxide/content.css";import"tinymce/skins/content/default/content.css";var c=function(){return c=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var r in i=arguments[e])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t},c.apply(this,arguments)},s=function(t,i){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&i.indexOf(n)<0&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)i.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(e[n[r]]=t[n[r]])}return e};n("",{variants:{scaling:c({},r),size:{small:"w-[500px] h-[350px]",medium:"w-[550px] h-[400px]",large:"w-[600px] h-[450px]"}},defaultVariants:{scaling:"100%",size:"medium"}});var m=function(){"undefined"!=typeof window&&o.init({selector:"#tinymce",plugins:"link table code",toolbar:"undo redo | formatselect | bold italic | alignleft aligncenter alignright | code",skin:!1,tinymceScriptSrc:"",src:""})},a=i((function(i,n){return i.className,i.size,i.scaling,i.tinymceScriptSrc,s(i,["className","size","scaling","tinymceScriptSrc"]),e((function(){m()}),[]),t("textarea",{id:"tinymce",ref:n})}));a.displayName="Editor";export{a as Editor,a as default,m as initTinyMCE};
|
3
3
|
//# sourceMappingURL=index.mjs.map
|