@lotte-innovate/ui-component-test 0.2.49 → 0.2.50

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.
@@ -10,42 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
13
  var __rest = (this && this.__rest) || function (s, e) {
50
14
  var t = {};
51
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -61,6 +25,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
61
25
  import { forwardRef, useEffect, useState, } from 'react';
62
26
  import { Editor as EditorUI } from '@tinymce/tinymce-react';
63
27
  import { cva } from 'class-variance-authority';
28
+ import { loadTinyMCE } from '../../../lib/utils/useLoadTinyMCE';
64
29
  import { scalingVariants } from '../../../lib/constants';
65
30
  import { cn } from '../../../lib/utils/utils';
66
31
  import { marked } from 'marked';
@@ -83,46 +48,6 @@ export var Editor = forwardRef(function (_a, ref) {
83
48
  var _b = useState(false), isClient = _b[0], setIsClient = _b[1];
84
49
  useEffect(function () {
85
50
  if (typeof window !== 'undefined') {
86
- var loadTinyMCE = function () { return __awaiter(void 0, void 0, void 0, function () {
87
- return __generator(this, function (_a) {
88
- switch (_a.label) {
89
- case 0: return [4 /*yield*/, import('tinymce/tinymce.js')];
90
- case 1:
91
- _a.sent();
92
- return [4 /*yield*/, import('tinymce/themes/silver/theme.js')];
93
- case 2:
94
- _a.sent();
95
- return [4 /*yield*/, import('tinymce/models/dom/model.js')];
96
- case 3:
97
- _a.sent();
98
- return [4 /*yield*/, import('tinymce/icons/default/icons.js')];
99
- case 4:
100
- _a.sent();
101
- return [4 /*yield*/, import('tinymce/plugins/advlist/plugin.js')];
102
- case 5:
103
- _a.sent();
104
- return [4 /*yield*/, import('tinymce/plugins/code/plugin.js')];
105
- case 6:
106
- _a.sent();
107
- return [4 /*yield*/, import('tinymce/plugins/codesample/plugin.js')];
108
- case 7:
109
- _a.sent();
110
- return [4 /*yield*/, import('tinymce/plugins/link/plugin.js')];
111
- case 8:
112
- _a.sent();
113
- return [4 /*yield*/, import('tinymce/plugins/lists/plugin.js')];
114
- case 9:
115
- _a.sent();
116
- return [4 /*yield*/, import('tinymce/plugins/table/plugin.js')];
117
- case 10:
118
- _a.sent();
119
- return [4 /*yield*/, import('tinymce/plugins/image/plugin.js')];
120
- case 11:
121
- _a.sent();
122
- return [2 /*return*/];
123
- }
124
- });
125
- }); };
126
51
  loadTinyMCE().then(function () {
127
52
  setIsClient(true);
128
53
  });
@@ -135,9 +60,18 @@ export var Editor = forwardRef(function (_a, ref) {
135
60
  base_url: 'tinymce',
136
61
  width: '100%',
137
62
  height: '100%',
138
- plugins: 'link table lists code codesample',
139
- menubar: false,
140
- toolbar: 'blocks | bold italic forecolor strikethrough | hr blockquote | bullist numlist outdent indent | table image link | inlinecode codeformat codesample markdown',
63
+ promotion: false,
64
+ plugins: 'preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount charmap quickbars accordion',
65
+ menubar: 'file edit view insert format tools table',
66
+ toolbar: 'undo redo | accordion accordionremove | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl',
67
+ autosave_ask_before_unload: true,
68
+ autosave_interval: '30s',
69
+ autosave_restore_when_empty: false,
70
+ autosave_retention: '2m',
71
+ image_advtab: true,
72
+ image_caption: true,
73
+ quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
74
+ toolbar_mode: 'sliding',
141
75
  content_style: 'body { font-family:Noto Sans KR, sans-serif, Nunito Sans, Helvetica Neue, Helvetica }',
142
76
  setup: function (editor) {
143
77
  editor.ui.registry.addButton('inlinecode', {
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{jsx as t}from"react/jsx-runtime";import{forwardRef as e,useState as n,useEffect as r}from"react";import{Editor as i}from"@tinymce/tinymce-react";import{cva as o}from"class-variance-authority";import{scalingVariants as s}from"../../constants.mjs";import{cn as a}from"../../utils/utils.mjs";import{marked as c}from"marked";var l=function(){return l=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},l.apply(this,arguments)},u=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},p=function(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},m=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},f=o("",{variants:{scaling:l({},s),size:{small:"w-[500px] h-[350px]",medium:"w-[550px] h-[400px]",large:"w-[600px] h-[450px]"}},defaultVariants:{scaling:"100%",size:"medium"}}),d=e((function(e,o){var s=e.className,d=e.size,y=e.scaling,g=m(e,["className","size","scaling"]),b=n(!1),h=b[0],v=b[1];return r((function(){if("undefined"!=typeof window){u(void 0,void 0,void 0,(function(){return p(this,(function(t){switch(t.label){case 0:return[4,import("tinymce/tinymce.js")];case 1:return t.sent(),[4,import("tinymce/themes/silver/theme.js")];case 2:return t.sent(),[4,import("tinymce/models/dom/model.js")];case 3:return t.sent(),[4,import("tinymce/icons/default/icons.js")];case 4:return t.sent(),[4,import("tinymce/plugins/advlist/plugin.js")];case 5:return t.sent(),[4,import("tinymce/plugins/code/plugin.js")];case 6:return t.sent(),[4,import("tinymce/plugins/codesample/plugin.js")];case 7:return t.sent(),[4,import("tinymce/plugins/link/plugin.js")];case 8:return t.sent(),[4,import("tinymce/plugins/lists/plugin.js")];case 9:return t.sent(),[4,import("tinymce/plugins/table/plugin.js")];case 10:return t.sent(),[4,import("tinymce/plugins/image/plugin.js")];case 11:return t.sent(),[2]}}))})).then((function(){v(!0)}))}}),[]),h?t("div",{className:a(f({size:d,scaling:y}),s),ref:o,children:t(i,l({init:{base_url:"tinymce",width:"100%",height:"100%",plugins:"link table lists code codesample",menubar:!1,toolbar:"blocks | bold italic forecolor strikethrough | hr blockquote | bullist numlist outdent indent | table image link | inlinecode codeformat codesample 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 e=t.getContent({format:"text"}),n=c(e);t.setContent(n)}})}}},g))}):null}));d.displayName="Editor";export{d as Editor,d as default};
2
+ import{jsx as e}from"react/jsx-runtime";import{forwardRef as t,useState as o,useEffect as i}from"react";import{Editor as a}from"@tinymce/tinymce-react";import{cva as r}from"class-variance-authority";import{loadTinyMCE as n}from"../../utils/useLoadTinyMCE.mjs";import{scalingVariants as l}from"../../constants.mjs";import{cn as s}from"../../utils/utils.mjs";import{marked as c}from"marked";var m=function(){return m=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var a in t=arguments[o])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},m.apply(this,arguments)},u=function(e,t){var o={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(o[i[a]]=e[i[a]])}return o},d=r("",{variants:{scaling:m({},l),size:{small:"w-[500px] h-[350px]",medium:"w-[550px] h-[400px]",large:"w-[600px] h-[450px]"}},defaultVariants:{scaling:"100%",size:"medium"}}),p=t((function(t,r){var l=t.className,p=t.size,f=t.scaling,b=u(t,["className","size","scaling"]),g=o(!1),v=g[0],h=g[1];return i((function(){"undefined"!=typeof window&&n().then((function(){h(!0)}))}),[]),v?e("div",{className:s(d({size:p,scaling:f}),l),ref:r,children:e(a,m({init:{base_url:"tinymce",width:"100%",height:"100%",promotion:!1,plugins:"preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount charmap quickbars accordion",menubar:"file edit view insert format tools table",toolbar:"undo redo | accordion accordionremove | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl",autosave_ask_before_unload:!0,autosave_interval:"30s",autosave_restore_when_empty:!1,autosave_retention:"2m",image_advtab:!0,image_caption:!0,quickbars_selection_toolbar:"bold italic | quicklink h2 h3 blockquote quickimage quicktable",toolbar_mode:"sliding",content_style:"body { font-family:Noto Sans KR, sans-serif, Nunito Sans, Helvetica Neue, Helvetica }",setup:function(e){e.ui.registry.addButton("inlinecode",{icon:"sourcecode",tooltip:"Inline code",onAction:function(){e.formatter.toggle("code")}}),e.on("init",(function(){e.formatter.register("code",{inline:"code",remove:"all"})})),e.ui.registry.addButton("markdown",{text:"Markdown",onAction:function(){var t=e.getContent({format:"text"}),o=c(t);e.setContent(o)}})}}},b))}):null}));p.displayName="Editor";export{p as Editor,p as default};
3
3
  //# sourceMappingURL=index.mjs.map