@lotte-innovate/ui-component-test 0.1.119 → 0.1.121

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/dist/lib/components/Editor/index copy.d.ts +26 -0
  2. package/dist/lib/components/Editor/index copy.js +120 -0
  3. package/dist/lib/components/Editor/index.js +1 -1
  4. package/dist/lib/components/Editor/index.mjs +1 -1
  5. package/dist/tsconfig.tsbuildinfo +1 -1
  6. package/package.json +2 -2
  7. package/dist/_virtual/icons.mjs +0 -2
  8. package/dist/_virtual/icons.mjs.map +0 -1
  9. package/dist/_virtual/index.mjs +0 -2
  10. package/dist/_virtual/index.mjs.map +0 -1
  11. package/dist/_virtual/index10.mjs +0 -2
  12. package/dist/_virtual/index10.mjs.map +0 -1
  13. package/dist/_virtual/index11.mjs +0 -2
  14. package/dist/_virtual/index11.mjs.map +0 -1
  15. package/dist/_virtual/index12.mjs +0 -2
  16. package/dist/_virtual/index12.mjs.map +0 -1
  17. package/dist/_virtual/index13.mjs +0 -2
  18. package/dist/_virtual/index13.mjs.map +0 -1
  19. package/dist/_virtual/index14.mjs +0 -2
  20. package/dist/_virtual/index14.mjs.map +0 -1
  21. package/dist/_virtual/index15.mjs +0 -2
  22. package/dist/_virtual/index15.mjs.map +0 -1
  23. package/dist/_virtual/index16.mjs +0 -2
  24. package/dist/_virtual/index16.mjs.map +0 -1
  25. package/dist/_virtual/index17.mjs +0 -2
  26. package/dist/_virtual/index17.mjs.map +0 -1
  27. package/dist/_virtual/index18.mjs +0 -2
  28. package/dist/_virtual/index18.mjs.map +0 -1
  29. package/dist/_virtual/index19.mjs +0 -2
  30. package/dist/_virtual/index19.mjs.map +0 -1
  31. package/dist/_virtual/index2.mjs +0 -2
  32. package/dist/_virtual/index2.mjs.map +0 -1
  33. package/dist/_virtual/index20.mjs +0 -2
  34. package/dist/_virtual/index20.mjs.map +0 -1
  35. package/dist/_virtual/index3.mjs +0 -2
  36. package/dist/_virtual/index3.mjs.map +0 -1
  37. package/dist/_virtual/index4.mjs +0 -2
  38. package/dist/_virtual/index4.mjs.map +0 -1
  39. package/dist/_virtual/index5.mjs +0 -2
  40. package/dist/_virtual/index5.mjs.map +0 -1
  41. package/dist/_virtual/index6.mjs +0 -2
  42. package/dist/_virtual/index6.mjs.map +0 -1
  43. package/dist/_virtual/index7.mjs +0 -2
  44. package/dist/_virtual/index7.mjs.map +0 -1
  45. package/dist/_virtual/index8.mjs +0 -2
  46. package/dist/_virtual/index8.mjs.map +0 -1
  47. package/dist/_virtual/index9.mjs +0 -2
  48. package/dist/_virtual/index9.mjs.map +0 -1
  49. package/dist/_virtual/model.mjs +0 -2
  50. package/dist/_virtual/model.mjs.map +0 -1
  51. package/dist/_virtual/plugin.mjs +0 -2
  52. package/dist/_virtual/plugin.mjs.map +0 -1
  53. package/dist/_virtual/plugin2.mjs +0 -2
  54. package/dist/_virtual/plugin2.mjs.map +0 -1
  55. package/dist/_virtual/plugin3.mjs +0 -2
  56. package/dist/_virtual/plugin3.mjs.map +0 -1
  57. package/dist/_virtual/plugin4.mjs +0 -2
  58. package/dist/_virtual/plugin4.mjs.map +0 -1
  59. package/dist/_virtual/plugin5.mjs +0 -2
  60. package/dist/_virtual/plugin5.mjs.map +0 -1
  61. package/dist/_virtual/plugin6.mjs +0 -2
  62. package/dist/_virtual/plugin6.mjs.map +0 -1
  63. package/dist/_virtual/plugin7.mjs +0 -2
  64. package/dist/_virtual/plugin7.mjs.map +0 -1
  65. package/dist/_virtual/theme.mjs +0 -2
  66. package/dist/_virtual/theme.mjs.map +0 -1
  67. package/dist/_virtual/tinymce.mjs +0 -2
  68. package/dist/_virtual/tinymce.mjs.map +0 -1
  69. package/dist/_virtual/tinymce2.mjs +0 -2
  70. package/dist/_virtual/tinymce2.mjs.map +0 -1
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { IAllProps } from '@tinymce/tinymce-react';
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/codesample';
11
+ import 'tinymce/plugins/link';
12
+ import 'tinymce/plugins/lists';
13
+ import 'tinymce/plugins/table';
14
+ import 'tinymce/plugins/image';
15
+ import 'tinymce/skins/ui/oxide/content.css';
16
+ export interface EditorProps extends VariantProps<typeof editorVariants> {
17
+ width?: string | number;
18
+ height?: string | number;
19
+ }
20
+ declare const editorVariants: (props?: ({
21
+ scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
22
+ size?: "small" | "medium" | "large" | null | undefined;
23
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
24
+ export declare const initTinyMCE: ({ width, height }: EditorProps) => void;
25
+ export declare const Editor: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & EditorProps & IAllProps & React.RefAttributes<HTMLTextAreaElement>>;
26
+ export default Editor;
@@ -0,0 +1,120 @@
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, useEffect } from 'react';
26
+ import { cva } from 'class-variance-authority';
27
+ import { scalingVariants } from '../../../lib/constants';
28
+ import { cn } from '../../../lib/utils/utils';
29
+ import { marked } from 'marked';
30
+ import tinymce from 'tinymce';
31
+ /* Default icons are required. After that, import custom icons if applicable */
32
+ import 'tinymce/icons/default';
33
+ /* Required TinyMCE components */
34
+ import 'tinymce/themes/silver';
35
+ import 'tinymce/models/dom';
36
+ /* Import a skin (can be a custom skin instead of the default) */
37
+ import 'tinymce/skins/ui/oxide/skin.css';
38
+ /* Import plugins */
39
+ import 'tinymce/plugins/advlist';
40
+ import 'tinymce/plugins/code';
41
+ import 'tinymce/plugins/codesample';
42
+ import 'tinymce/plugins/link';
43
+ import 'tinymce/plugins/lists';
44
+ import 'tinymce/plugins/table';
45
+ import 'tinymce/plugins/image';
46
+ /* content UI CSS is required */
47
+ import 'tinymce/skins/ui/oxide/content.css';
48
+ var editorVariants = cva('', {
49
+ variants: {
50
+ scaling: __assign({}, scalingVariants),
51
+ size: {
52
+ small: 'w-[500px] h-[350px]',
53
+ medium: 'w-[550px] h-[400px]',
54
+ large: 'w-[600px] h-[450px]',
55
+ },
56
+ },
57
+ defaultVariants: {
58
+ scaling: '100%',
59
+ size: 'medium',
60
+ },
61
+ });
62
+ export var initTinyMCE = function (_a) {
63
+ var width = _a.width, height = _a.height;
64
+ console.log('width', width, height);
65
+ tinymce.init({
66
+ width: width,
67
+ height: height,
68
+ selector: '#tinymce',
69
+ plugins: 'link table code lists codesample',
70
+ menubar: false,
71
+ toolbar: 'blocks | bold italic forecolor strikethrough | hr blockquote | bullist numlist outdent indent | table image link | inlinecode codeformat codesample markdown',
72
+ skin: false,
73
+ content_css: false,
74
+ setup: function (editor) {
75
+ editor.ui.registry.addButton('inlinecode', {
76
+ icon: 'sourcecode',
77
+ tooltip: 'Inline code',
78
+ onAction: function () {
79
+ editor.formatter.toggle('code');
80
+ },
81
+ });
82
+ editor.on('init', function () {
83
+ editor.formatter.register('code', {
84
+ inline: 'code',
85
+ remove: 'all',
86
+ });
87
+ });
88
+ editor.ui.registry.addButton('markdown', {
89
+ text: 'Markdown',
90
+ onAction: function () {
91
+ var content = editor.getContent({ format: 'text' });
92
+ var html = marked(content);
93
+ editor.setContent(html);
94
+ },
95
+ });
96
+ },
97
+ });
98
+ };
99
+ export var Editor = forwardRef(function (_a, ref) {
100
+ var className = _a.className, size = _a.size, scaling = _a.scaling, width = _a.width, height = _a.height, props = __rest(_a, ["className", "size", "scaling", "width", "height"]);
101
+ useEffect(function () {
102
+ initTinyMCE({ width: width, height: height });
103
+ }, [size]);
104
+ switch (size) {
105
+ case 'small':
106
+ (width = 500), (height = 350);
107
+ break;
108
+ case 'medium':
109
+ (width = 550), (height = 400);
110
+ break;
111
+ case 'large':
112
+ (width = 600), (height = 450);
113
+ break;
114
+ default:
115
+ (width = 550), (height = 400);
116
+ }
117
+ return (_jsx("textarea", { id: "tinymce", ref: ref, className: cn(editorVariants({ size: size, scaling: scaling })) }));
118
+ });
119
+ Editor.displayName = 'Editor';
120
+ export default Editor;
@@ -59,7 +59,7 @@ var editorVariants = cva('', {
59
59
  export var Editor = forwardRef(function (_a, ref) {
60
60
  var className = _a.className, size = _a.size, scaling = _a.scaling, props = __rest(_a, ["className", "size", "scaling"]);
61
61
  return (_jsx("div", { className: cn(editorVariants({ size: size, scaling: scaling }), className), ref: ref, children: _jsx(EditorUI, __assign({ init: {
62
- base_url: 'tinymce',
62
+ // base_url: 'tinymce',
63
63
  width: '100%',
64
64
  height: '100%',
65
65
  plugins: 'link table code lists codesample',
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as t}from"react/jsx-runtime";import{forwardRef as i}from"react";import{Editor as e}from"@tinymce/tinymce-react";import{cva as n}from"class-variance-authority";import{scalingVariants as o}from"../../constants.mjs";import{cn as r}from"../../utils/utils.mjs";import{marked as a}from"marked";import"../../../../_virtual/tinymce.mjs";import"../../../../_virtual/index19.mjs";import"../../../../_virtual/index.mjs";import"../../../../_virtual/index7.mjs";import"../../../../public/tinymce/skins/ui/oxide/skin.mjs";import"../../../../_virtual/index3.mjs";import"../../../../_virtual/index9.mjs";import"../../../../_virtual/index11.mjs";import"../../../../_virtual/index17.mjs";import"../../../../_virtual/index15.mjs";import"../../../../_virtual/index5.mjs";import"../../../../_virtual/index13.mjs";import"../../../../public/tinymce/skins/content/default/content.mjs";import"../../../../public/tinymce/skins/ui/oxide/content.mjs";var s=function(){return s=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var o in i=arguments[e])Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o]);return t},s.apply(this,arguments)},m=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 o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)i.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(e[n[o]]=t[n[o]])}return e},l=n("",{variants:{scaling:s({},o),size:{small:"w-[500px] h-[350px]",medium:"w-[550px] h-[400px]",large:"w-[600px] h-[450px]"}},defaultVariants:{scaling:"100%",size:"medium"}}),c=i((function(i,n){var o=i.className,c=i.size,u=i.scaling,p=m(i,["className","size","scaling"]);return t("div",{className:r(l({size:c,scaling:u}),o),ref:n,children:t(e,s({init:{base_url:"tinymce",width:"100%",height:"100%",plugins:"link table code lists codesample",menubar:!1,toolbar:"blocks | bold italic forecolor strikethrough | hr blockquote | bullist numlist outdent indent | table image link | inlinecode codeformat markdown",content_style:"body { font-family:Noto Sans KR, sans-serif, Nunito Sans, Helvetica Neue, Helvetica }",setup:function(t){t.ui.registry.addButton("inlinecode",{icon:"sourcecode",tooltip:"Inline code",onAction:function(){t.formatter.toggle("code")}}),t.on("init",(function(){t.formatter.register("code",{inline:"code",remove:"all"})})),t.ui.registry.addButton("markdown",{text:"Markdown",onAction:function(){var i=t.getContent({format:"text"}),e=a(i);t.setContent(e)}})}}},p))})}));c.displayName="Editor";export{c as Editor,c as default};
2
+ import{jsx as t}from"react/jsx-runtime";import{forwardRef as i}from"react";import{Editor as e}from"@tinymce/tinymce-react";import{cva as o}from"class-variance-authority";import{scalingVariants as n}from"../../constants.mjs";import{cn as r}from"../../utils/utils.mjs";import{marked as a}from"marked";import"../../../../_virtual/tinymce.mjs";import"../../../../_virtual/index19.mjs";import"../../../../_virtual/index13.mjs";import"../../../../_virtual/index11.mjs";import"../../../../public/tinymce/skins/ui/oxide/skin.mjs";import"../../../../_virtual/index5.mjs";import"../../../../_virtual/index.mjs";import"../../../../_virtual/index9.mjs";import"../../../../_virtual/index17.mjs";import"../../../../_virtual/index15.mjs";import"../../../../_virtual/index3.mjs";import"../../../../_virtual/index7.mjs";import"../../../../public/tinymce/skins/content/default/content.mjs";import"../../../../public/tinymce/skins/ui/oxide/content.mjs";var s=function(){return s=Object.assign||function(t){for(var i,e=1,o=arguments.length;e<o;e++)for(var n in i=arguments[e])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t},s.apply(this,arguments)},m=function(t,i){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&i.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)i.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(e[o[n]]=t[o[n]])}return e},l=o("",{variants:{scaling:s({},n),size:{small:"w-[500px] h-[350px]",medium:"w-[550px] h-[400px]",large:"w-[600px] h-[450px]"}},defaultVariants:{scaling:"100%",size:"medium"}}),c=i((function(i,o){var n=i.className,c=i.size,u=i.scaling,p=m(i,["className","size","scaling"]);return t("div",{className:r(l({size:c,scaling:u}),n),ref:o,children:t(e,s({init:{width:"100%",height:"100%",plugins:"link table code lists codesample",menubar:!1,toolbar:"blocks | bold italic forecolor strikethrough | hr blockquote | bullist numlist outdent indent | table image link | inlinecode codeformat markdown",content_style:"body { font-family:Noto Sans KR, sans-serif, Nunito Sans, Helvetica Neue, Helvetica }",setup:function(t){t.ui.registry.addButton("inlinecode",{icon:"sourcecode",tooltip:"Inline code",onAction:function(){t.formatter.toggle("code")}}),t.on("init",(function(){t.formatter.register("code",{inline:"code",remove:"all"})})),t.ui.registry.addButton("markdown",{text:"Markdown",onAction:function(){var i=t.getContent({format:"text"}),e=a(i);t.setContent(e)}})}}},p))})}));c.displayName="Editor";export{c as Editor,c as default};
3
3
  //# sourceMappingURL=index.mjs.map