@team-monolith/cds 1.129.2-alpha.2 → 1.130.0-alpha

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.
Files changed (105) hide show
  1. package/dist/emotion.d.ts +185 -0
  2. package/dist/index.d.ts +8 -1
  3. package/dist/patterns/LexicalEditor/LexicalCustomConfigContext.d.ts +1 -0
  4. package/dist/patterns/LexicalEditor/LexicalCustomConfigContext.js +2 -1
  5. package/dist/patterns/LexicalEditor/LexicalEditor.d.ts +4 -0
  6. package/dist/patterns/LexicalEditor/LexicalEditor.js +9 -7
  7. package/dist/patterns/LexicalEditor/Plugins.d.ts +1 -0
  8. package/dist/patterns/LexicalEditor/Plugins.js +65 -61
  9. package/dist/patterns/LexicalEditor/components/FileSelectInput.js +24 -23
  10. package/dist/patterns/LexicalEditor/components/UploadFileDialog/UploadFileDialog.js +2 -1
  11. package/dist/patterns/LexicalEditor/nodes/FileNode/CompactFileView.d.ts +7 -0
  12. package/dist/patterns/LexicalEditor/nodes/FileNode/CompactFileView.js +53 -0
  13. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.d.ts +0 -27
  14. package/dist/patterns/LexicalEditor/nodes/FileNode/FileComponent.js +44 -115
  15. package/dist/patterns/LexicalEditor/nodes/FileNode/FileDownloadButton.js +1 -1
  16. package/dist/patterns/LexicalEditor/nodes/FileNode/fileStyles.d.ts +27 -0
  17. package/dist/patterns/LexicalEditor/nodes/FileNode/fileStyles.js +85 -0
  18. package/dist/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.d.ts +6 -0
  19. package/dist/patterns/LexicalEditor/nodes/ImageNode/CompactImageView.js +91 -0
  20. package/dist/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.js +108 -102
  21. package/dist/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.js +7 -7
  22. package/dist/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.js +4 -4
  23. package/dist/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.js +4 -4
  24. package/dist/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.js +4 -4
  25. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.d.ts +1 -0
  26. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.js +106 -0
  27. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.d.ts +8 -0
  28. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.js +6 -0
  29. package/dist/patterns/LexicalEditor/plugins/CompactToolbarPlugin/index.d.ts +1 -0
  30. package/dist/patterns/LexicalEditor/plugins/DragDropPastePlugin/index.js +15 -14
  31. package/dist/patterns/LexicalEditor/uploadConstants.d.ts +6 -0
  32. package/dist/patterns/LexicalEditor/uploadConstants.js +4 -0
  33. package/package.json +3 -7
  34. package/@types/emotion.d.ts +0 -197
  35. package/node_modules/react-i18next/.eslintrc.json +0 -74
  36. package/node_modules/react-i18next/.husky/pre-commit +0 -1
  37. package/node_modules/react-i18next/.prettierignore +0 -4
  38. package/node_modules/react-i18next/CHANGELOG.md +0 -1433
  39. package/node_modules/react-i18next/LICENSE +0 -22
  40. package/node_modules/react-i18next/README.md +0 -181
  41. package/node_modules/react-i18next/TransWithoutContext.d.mts +0 -1
  42. package/node_modules/react-i18next/TransWithoutContext.d.ts +0 -129
  43. package/node_modules/react-i18next/dist/amd/react-i18next.js +0 -867
  44. package/node_modules/react-i18next/dist/amd/react-i18next.min.js +0 -1
  45. package/node_modules/react-i18next/dist/commonjs/I18nextProvider.js +0 -21
  46. package/node_modules/react-i18next/dist/commonjs/Trans.js +0 -54
  47. package/node_modules/react-i18next/dist/commonjs/TransWithoutContext.js +0 -330
  48. package/node_modules/react-i18next/dist/commonjs/Translation.js +0 -19
  49. package/node_modules/react-i18next/dist/commonjs/context.js +0 -81
  50. package/node_modules/react-i18next/dist/commonjs/defaults.js +0 -26
  51. package/node_modules/react-i18next/dist/commonjs/i18nInstance.js +0 -13
  52. package/node_modules/react-i18next/dist/commonjs/index.js +0 -128
  53. package/node_modules/react-i18next/dist/commonjs/initReactI18next.js +0 -15
  54. package/node_modules/react-i18next/dist/commonjs/unescape.js +0 -32
  55. package/node_modules/react-i18next/dist/commonjs/useSSR.js +0 -34
  56. package/node_modules/react-i18next/dist/commonjs/useTranslation.js +0 -114
  57. package/node_modules/react-i18next/dist/commonjs/utils.js +0 -76
  58. package/node_modules/react-i18next/dist/commonjs/withSSR.js +0 -27
  59. package/node_modules/react-i18next/dist/commonjs/withTranslation.js +0 -39
  60. package/node_modules/react-i18next/dist/es/I18nextProvider.js +0 -15
  61. package/node_modules/react-i18next/dist/es/Trans.js +0 -43
  62. package/node_modules/react-i18next/dist/es/TransWithoutContext.js +0 -321
  63. package/node_modules/react-i18next/dist/es/Translation.js +0 -12
  64. package/node_modules/react-i18next/dist/es/context.js +0 -42
  65. package/node_modules/react-i18next/dist/es/defaults.js +0 -18
  66. package/node_modules/react-i18next/dist/es/i18nInstance.js +0 -5
  67. package/node_modules/react-i18next/dist/es/index.js +0 -18
  68. package/node_modules/react-i18next/dist/es/initReactI18next.js +0 -9
  69. package/node_modules/react-i18next/dist/es/package.json +0 -1
  70. package/node_modules/react-i18next/dist/es/unescape.js +0 -25
  71. package/node_modules/react-i18next/dist/es/useSSR.js +0 -27
  72. package/node_modules/react-i18next/dist/es/useTranslation.js +0 -107
  73. package/node_modules/react-i18next/dist/es/utils.js +0 -62
  74. package/node_modules/react-i18next/dist/es/withSSR.js +0 -20
  75. package/node_modules/react-i18next/dist/es/withTranslation.js +0 -32
  76. package/node_modules/react-i18next/dist/umd/react-i18next.js +0 -871
  77. package/node_modules/react-i18next/dist/umd/react-i18next.min.js +0 -1
  78. package/node_modules/react-i18next/helpers.d.ts +0 -3
  79. package/node_modules/react-i18next/icu.macro.d.mts +0 -1
  80. package/node_modules/react-i18next/icu.macro.d.ts +0 -103
  81. package/node_modules/react-i18next/icu.macro.js +0 -729
  82. package/node_modules/react-i18next/index.d.mts +0 -1
  83. package/node_modules/react-i18next/index.d.ts +0 -209
  84. package/node_modules/react-i18next/initReactI18next.d.mts +0 -1
  85. package/node_modules/react-i18next/initReactI18next.d.ts +0 -3
  86. package/node_modules/react-i18next/lint-staged.config.mjs +0 -4
  87. package/node_modules/react-i18next/package.json +0 -167
  88. package/node_modules/react-i18next/react-i18next.js +0 -871
  89. package/node_modules/react-i18next/react-i18next.min.js +0 -1
  90. package/node_modules/react-i18next/src/I18nextProvider.js +0 -7
  91. package/node_modules/react-i18next/src/Trans.js +0 -45
  92. package/node_modules/react-i18next/src/TransWithoutContext.js +0 -479
  93. package/node_modules/react-i18next/src/Translation.js +0 -14
  94. package/node_modules/react-i18next/src/context.js +0 -54
  95. package/node_modules/react-i18next/src/defaults.js +0 -20
  96. package/node_modules/react-i18next/src/i18nInstance.js +0 -7
  97. package/node_modules/react-i18next/src/index.js +0 -22
  98. package/node_modules/react-i18next/src/initReactI18next.js +0 -11
  99. package/node_modules/react-i18next/src/unescape.js +0 -31
  100. package/node_modules/react-i18next/src/useSSR.js +0 -33
  101. package/node_modules/react-i18next/src/useTranslation.js +0 -171
  102. package/node_modules/react-i18next/src/utils.js +0 -93
  103. package/node_modules/react-i18next/src/withSSR.js +0 -21
  104. package/node_modules/react-i18next/src/withTranslation.js +0 -35
  105. package/node_modules/react-i18next/vitest.workspace.typescript.mts +0 -52
@@ -3,35 +3,37 @@ import { stdin_default as t } from "../../../../node_modules/.pnpm/remixicon@4.3
3
3
  import { RESET_BUTTON as n } from "../../../../utils/reset.js";
4
4
  import { VISUALLY_HIDDEN as r } from "../../../../utils/visuallyHidden.js";
5
5
  import { $isImageNode as i } from "./ImageNode.js";
6
- import { ImageNotAvailable as a } from "./ImageNotAvailable.js";
7
- import { InsertImageDialog as o } from "../../components/InsertImageDialog/InsertImageDialog.js";
8
- import { ImageResizer as s } from "./ImageResizer.js";
9
- import { css as c } from "@emotion/react";
10
- import { Suspense as l, useCallback as u, useEffect as d, useRef as f, useState as p } from "react";
11
- import m from "@emotion/styled";
12
- import { Fragment as h, jsx as g, jsxs as _ } from "@emotion/react/jsx-runtime";
13
- import { useTranslation as ee } from "react-i18next";
14
- import { $getNodeByKey as v, $getSelection as y, $isNodeSelection as b, $isRangeSelection as x, $setSelection as te, CLICK_COMMAND as ne, COMMAND_PRIORITY_LOW as S, DRAGSTART_COMMAND as C, KEY_BACKSPACE_COMMAND as w, KEY_DELETE_COMMAND as re, KEY_ENTER_COMMAND as ie, KEY_ESCAPE_COMMAND as ae, SELECTION_CHANGE_COMMAND as T, createCommand as E } from "lexical";
15
- import { mergeRegister as oe } from "@lexical/utils";
16
- import { useLexicalComposerContext as se } from "@lexical/react/LexicalComposerContext";
17
- import { useLexicalNodeSelection as ce } from "@lexical/react/useLexicalNodeSelection";
18
- import { useLexicalEditable as D } from "@lexical/react/useLexicalEditable";
6
+ import { LexicalCustomConfigContext as a } from "../../LexicalCustomConfigContext.js";
7
+ import { ImageNotAvailable as o } from "./ImageNotAvailable.js";
8
+ import { InsertImageDialog as s } from "../../components/InsertImageDialog/InsertImageDialog.js";
9
+ import { CompactImageView as ee } from "./CompactImageView.js";
10
+ import { ImageResizer as c } from "./ImageResizer.js";
11
+ import { css as l } from "@emotion/react";
12
+ import { Suspense as u, useCallback as d, useContext as f, useEffect as te, useRef as p, useState as m } from "react";
13
+ import h from "@emotion/styled";
14
+ import { Fragment as g, jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
15
+ import { useTranslation as y } from "react-i18next";
16
+ import { $getNodeByKey as b, $getSelection as x, $isNodeSelection as S, $isRangeSelection as ne, $setSelection as re, CLICK_COMMAND as C, COMMAND_PRIORITY_LOW as w, DRAGSTART_COMMAND as T, KEY_BACKSPACE_COMMAND as ie, KEY_DELETE_COMMAND as ae, KEY_ENTER_COMMAND as oe, KEY_ESCAPE_COMMAND as se, SELECTION_CHANGE_COMMAND as ce, createCommand as E } from "lexical";
17
+ import { mergeRegister as le } from "@lexical/utils";
18
+ import { useLexicalComposerContext as D } from "@lexical/react/LexicalComposerContext";
19
+ import { useLexicalNodeSelection as O } from "@lexical/react/useLexicalNodeSelection";
20
+ import { useLexicalEditable as ue } from "@lexical/react/useLexicalEditable";
19
21
  //#region src/cds/patterns/LexicalEditor/nodes/ImageNode/ImageComponent.tsx
20
- var O = /* @__PURE__ */ new Set(), k = E("RIGHT_CLICK_IMAGE_COMMAND");
21
- function A(e) {
22
- if (!O.has(e)) throw new Promise((t) => {
22
+ var k = /* @__PURE__ */ new Set(), A = E("RIGHT_CLICK_IMAGE_COMMAND");
23
+ function j(e) {
24
+ if (!k.has(e)) throw new Promise((t) => {
23
25
  let n = new Image();
24
26
  n.src = e, n.onload = () => {
25
- O.add(e), t(null);
27
+ k.add(e), t(null);
26
28
  }, n.onerror = () => {
27
- O.add(e);
29
+ k.add(e);
28
30
  };
29
31
  });
30
32
  }
31
- function j(e) {
32
- let { altText: t, className: r, imageRef: i, src: a, width: o, height: s, maxWidth: c, onError: l, title: u, buttonProps: d, addtionalInfoLabel: f } = e;
33
- A(a);
34
- let p = /* @__PURE__ */ g("img", {
33
+ function M(e) {
34
+ let { altText: t, className: r, imageRef: i, src: a, width: o, height: s, maxWidth: ee, onError: c, title: l, buttonProps: u, addtionalInfoLabel: d } = e;
35
+ j(a);
36
+ let f = /* @__PURE__ */ _("img", {
35
37
  className: r || void 0,
36
38
  src: a,
37
39
  alt: t,
@@ -41,151 +43,155 @@ function j(e) {
41
43
  maxWidth: "100%",
42
44
  width: o
43
45
  },
44
- title: u,
45
- onError: l,
46
+ title: l,
47
+ onError: c,
46
48
  draggable: "false"
47
49
  });
48
- return d ? /* @__PURE__ */ _("button", {
50
+ return u ? /* @__PURE__ */ v("button", {
49
51
  type: "button",
50
52
  css: n,
51
- ...d,
52
- children: [p, f]
53
- }) : p;
53
+ ...u,
54
+ children: [f, d]
55
+ }) : f;
54
56
  }
55
- function M({ src: n, altText: m, nodeKey: E, width: O, height: A, maxWidth: M, resizable: ue }) {
56
- let N = f(null), P = f(null), [F, I, L] = ce(E), [R, z] = p(!1), [B] = se(), [V, H] = p(null), de = f(null), [U, W] = p(!1), { t: G } = ee(), K = u((e) => {
57
- let t = y();
58
- return F && b(t) && (e.preventDefault(), B.update(() => {
57
+ function N({ src: n, altText: h, nodeKey: E, width: k, height: j, maxWidth: N, resizable: fe }) {
58
+ let P = p(null), F = p(null), [I, L, R] = O(E), [z, B] = m(!1), [V] = D(), [H, pe] = m(null), me = p(null), [U, W] = m(!1), { t: G } = y(), K = d((e) => {
59
+ let t = x();
60
+ return I && S(t) && (e.preventDefault(), V.update(() => {
59
61
  t.getNodes().forEach((e) => {
60
62
  i(e) && e.remove();
61
63
  });
62
64
  })), !1;
63
- }, [B, F]), q = u((e) => {
64
- let t = y(), n = P.current;
65
- return F && b(t) && t.getNodes().length === 1 && n !== null && n !== document.activeElement ? (e.preventDefault(), n.focus(), !0) : !1;
66
- }, [F]), J = u((e) => P.current === e.target ? (te(null), B.update(() => {
67
- I(!0);
68
- let e = B.getRootElement();
65
+ }, [V, I]), q = d((e) => {
66
+ let t = x(), n = F.current;
67
+ return I && S(t) && t.getNodes().length === 1 && n !== null && n !== document.activeElement ? (e.preventDefault(), n.focus(), !0) : !1;
68
+ }, [I]), J = d((e) => F.current === e.target ? (re(null), V.update(() => {
69
+ L(!0);
70
+ let e = V.getRootElement();
69
71
  e !== null && e.focus();
70
- }), !0) : !1, [B, I]), Y = u((e) => {
72
+ }), !0) : !1, [V, L]), Y = d((e) => {
71
73
  let t = e;
72
- return R ? !0 : t.target === N.current ? (t.shiftKey ? I(!F) : (L(), I(!0)), !0) : !1;
74
+ return z ? !0 : t.target === P.current ? (t.shiftKey ? L(!I) : (R(), L(!0)), !0) : !1;
73
75
  }, [
74
- R,
75
- F,
76
+ z,
76
77
  I,
77
- L
78
- ]), X = u((e) => {
79
- B.getEditorState().read(() => {
80
- let t = y();
81
- e.target.tagName === "IMG" && x(t) && t.getNodes().length === 1 && B.dispatchCommand(k, e);
78
+ L,
79
+ R
80
+ ]), X = d((e) => {
81
+ V.getEditorState().read(() => {
82
+ let t = x();
83
+ e.target.tagName === "IMG" && ne(t) && t.getNodes().length === 1 && V.dispatchCommand(A, e);
82
84
  });
83
- }, [B]);
84
- d(() => {
85
- let e = !0, t = B.getRootElement(), n = oe(B.registerUpdateListener(({ editorState: t }) => {
86
- e && H(t.read(() => y()));
87
- }), B.registerCommand(T, (e, t) => (de.current = t, !1), S), B.registerCommand(ne, Y, S), B.registerCommand(k, Y, S), B.registerCommand(C, (e) => e.target === N.current ? (e.preventDefault(), !0) : !1, S), B.registerCommand(re, K, S), B.registerCommand(w, K, S), B.registerCommand(ie, q, S), B.registerCommand(ae, J, S));
85
+ }, [V]);
86
+ te(() => {
87
+ let e = !0, t = V.getRootElement(), n = le(V.registerUpdateListener(({ editorState: t }) => {
88
+ e && pe(t.read(() => x()));
89
+ }), V.registerCommand(ce, (e, t) => (me.current = t, !1), w), V.registerCommand(C, Y, w), V.registerCommand(A, Y, w), V.registerCommand(T, (e) => e.target === P.current ? (e.preventDefault(), !0) : !1, w), V.registerCommand(ae, K, w), V.registerCommand(ie, K, w), V.registerCommand(oe, q, w), V.registerCommand(se, J, w));
88
90
  return t?.addEventListener("contextmenu", X), () => {
89
91
  e = !1, n(), t?.removeEventListener("contextmenu", X);
90
92
  };
91
93
  }, [
92
- L,
93
- B,
94
94
  R,
95
- F,
95
+ V,
96
+ z,
97
+ I,
96
98
  E,
97
99
  K,
98
100
  q,
99
101
  J,
100
102
  Y,
101
103
  X,
102
- I
104
+ L
103
105
  ]);
104
- let fe = (e, t) => {
106
+ let he = (e, t) => {
105
107
  setTimeout(() => {
106
- z(!1);
107
- }, 200), B.update(() => {
108
- let n = v(E);
108
+ B(!1);
109
+ }, 200), V.update(() => {
110
+ let n = b(E);
109
111
  i(n) && n.setWidthAndHeight(e, t);
110
112
  });
111
- }, pe = () => {
112
- z(!0);
113
- }, Z = F && b(V) && !R, Q = F || R, [me, $] = p(!1);
114
- return D() ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(le, { children: [/* @__PURE__ */ g(l, {
113
+ }, ge = () => {
114
+ B(!0);
115
+ }, Z = I && S(H) && !z, Q = I || z, [_e, $] = m(!1), ve = ue(), { compactEditorMode: ye } = f(a);
116
+ return ye ? /* @__PURE__ */ _(ee, {
117
+ src: n,
118
+ altText: h,
119
+ nodeKey: E
120
+ }) : ve ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v(de, { children: [/* @__PURE__ */ _(u, {
115
121
  fallback: null,
116
- children: /* @__PURE__ */ g("div", {
122
+ children: /* @__PURE__ */ _("div", {
117
123
  draggable: Z,
118
- css: c`
124
+ css: l`
119
125
  // ImageResizer를 위한 relative 설정입니다.
120
126
  position: relative;
121
127
  `,
122
- children: U ? /* @__PURE__ */ g(a, {}) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(j, {
123
- className: Q ? `focused ${b(V) ? "draggable" : ""}` : null,
128
+ children: U ? /* @__PURE__ */ _(o, {}) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(M, {
129
+ className: Q ? `focused ${S(H) ? "draggable" : ""}` : null,
124
130
  src: n,
125
- altText: m,
126
- imageRef: N,
127
- width: O,
128
- height: A,
129
- maxWidth: M,
131
+ altText: h,
132
+ imageRef: P,
133
+ width: k,
134
+ height: j,
135
+ maxWidth: N,
130
136
  onError: () => W(!0)
131
- }), ue && b(V) && Q && /* @__PURE__ */ g(s, {
137
+ }), fe && S(H) && Q && /* @__PURE__ */ _(c, {
132
138
  showCaption: !1,
133
139
  setShowCaption: () => {},
134
- editor: B,
135
- buttonRef: P,
136
- imageRef: N,
137
- onResizeStart: pe,
138
- onResizeEnd: fe,
140
+ editor: V,
141
+ buttonRef: F,
142
+ imageRef: P,
143
+ onResizeStart: ge,
144
+ onResizeEnd: he,
139
145
  captionsEnabled: !1
140
146
  })] })
141
147
  })
142
- }), /* @__PURE__ */ g(e, {
148
+ }), /* @__PURE__ */ _(e, {
143
149
  size: "small",
144
150
  color: "icon",
145
- icon: /* @__PURE__ */ g(t, {}),
151
+ icon: /* @__PURE__ */ _(t, {}),
146
152
  onClick: () => {
147
153
  $(!0);
148
154
  },
149
155
  "aria-label": G("이미지 수정하기", { context: "스퀘어버튼, 렉시컬 이미지 도구" })
150
- })] }), /* @__PURE__ */ g(o, {
151
- open: me,
156
+ })] }), /* @__PURE__ */ _(s, {
157
+ open: _e,
152
158
  title: G("이미지 수정하기", { context: "제목, 이미지 수정 다이얼로그" }),
153
159
  onClose: () => $(!1),
154
160
  imageProps: {
155
161
  src: n,
156
- altText: m
162
+ altText: h
157
163
  },
158
164
  onChange: (e) => {
159
- B.update(() => {
160
- let t = v(E);
165
+ V.update(() => {
166
+ let t = b(E);
161
167
  i(t) && (t.setSrc(e.src), t.setAltText(e.altText));
162
168
  });
163
169
  },
164
170
  onDelete: () => {
165
- B.update(() => {
166
- let e = v(E);
171
+ V.update(() => {
172
+ let e = b(E);
167
173
  i(e) && e.remove();
168
174
  });
169
175
  }
170
- }, n)] }) : /* @__PURE__ */ g(l, {
176
+ }, n)] }) : /* @__PURE__ */ _(u, {
171
177
  fallback: null,
172
- children: /* @__PURE__ */ g("div", {
178
+ children: /* @__PURE__ */ _("div", {
173
179
  draggable: Z,
174
- children: U ? /* @__PURE__ */ g(a, {}) : /* @__PURE__ */ g(j, {
175
- className: Q ? `focused ${b(V) ? "draggable" : ""}` : null,
176
- css: c`
180
+ children: U ? /* @__PURE__ */ _(o, {}) : /* @__PURE__ */ _(M, {
181
+ className: Q ? `focused ${S(H) ? "draggable" : ""}` : null,
182
+ css: l`
177
183
  cursor: pointer;
178
184
  `,
179
185
  src: n,
180
- altText: m,
181
- imageRef: N,
182
- width: O,
183
- height: A,
184
- maxWidth: M,
186
+ altText: h,
187
+ imageRef: P,
188
+ width: k,
189
+ height: j,
190
+ maxWidth: N,
185
191
  onError: () => W(!0),
186
- buttonProps: { onClick: () => window.open(n, "_blank") },
192
+ buttonProps: { onClick: () => window.open(n, "_blank", "noopener") },
187
193
  title: G("클릭해서 원본 이미지 보기."),
188
- addtionalInfoLabel: /* @__PURE__ */ g("span", {
194
+ addtionalInfoLabel: /* @__PURE__ */ _("span", {
189
195
  css: r,
190
196
  children: G("(새 창)", { context: "렉시컬 이미지 도구" })
191
197
  })
@@ -193,9 +199,9 @@ function M({ src: n, altText: m, nodeKey: E, width: O, height: A, maxWidth: M, r
193
199
  })
194
200
  });
195
201
  }
196
- var le = m.div`
202
+ var de = h.div`
197
203
  display: flex;
198
204
  gap: 4px;
199
205
  `;
200
206
  //#endregion
201
- export { M as ImageComponent };
207
+ export { N as ImageComponent };
@@ -1,8 +1,8 @@
1
1
  import { SquareButton as e } from "../../../../components/SquareButton.js";
2
2
  import { stdin_default as t } from "../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/settings-3-fill.js";
3
- import { getTexts as n } from "../../../../texts.js";
4
- import { SettingForm as r } from "./SettingForm/SettingForm.js";
5
- import { LexicalCustomConfigContext as i } from "../../LexicalCustomConfigContext.js";
3
+ import { LexicalCustomConfigContext as n } from "../../LexicalCustomConfigContext.js";
4
+ import { getTexts as r } from "../../../../texts.js";
5
+ import { SettingForm as i } from "./SettingForm/SettingForm.js";
6
6
  import { TextInput as a } from "./TextInput.js";
7
7
  import { SegmentedInput as o } from "./SegmentedInput.js";
8
8
  import { $isProblemInputNode as s } from "./ProblemInputNode.js";
@@ -16,7 +16,7 @@ import { useLexicalComposerContext as _ } from "@lexical/react/LexicalComposerCo
16
16
  import { useLexicalEditable as v } from "@lexical/react/useLexicalEditable";
17
17
  //#region src/cds/patterns/LexicalEditor/nodes/ProblemInputNode/InputComponent.tsx
18
18
  function y(d) {
19
- let { answer: y, isCorrect: x, ...S } = d, { solutions: C, showCharacterNumber: w, placeholder: T, nodeKey: E } = S, [D] = _(), { t: O } = h(), [k, A] = u(!1), j = v(), [M, N] = u(y), { freezeProblemNode: P } = l(i), F = C[0].value, I = (e) => {
19
+ let { answer: y, isCorrect: x, ...S } = d, { solutions: C, showCharacterNumber: w, placeholder: T, nodeKey: E } = S, [D] = _(), { t: O } = h(), [k, A] = u(!1), j = v(), [M, N] = u(y), { freezeProblemNode: P } = l(n), F = C[0].value, I = (e) => {
20
20
  N(e), D.update(() => {
21
21
  let t = g(E);
22
22
  s(t) && t.setAnswer(e);
@@ -40,14 +40,14 @@ function y(d) {
40
40
  },
41
41
  "aria-label": O("입력 칸 설정", { context: "렉시컬 주관식 입력 도구" })
42
42
  })]
43
- }), k && /* @__PURE__ */ p(r, {
43
+ }), k && /* @__PURE__ */ p(i, {
44
44
  ...S,
45
45
  onClose: () => A(!1)
46
46
  })] }) : w ? /* @__PURE__ */ p(o, {
47
47
  readOnly: P,
48
48
  isCorrect: x,
49
49
  answerFormat: F,
50
- placeholder: T || n(O, "placeholderEnterHere"),
50
+ placeholder: T || r(O, "placeholderEnterHere"),
51
51
  value: M,
52
52
  onChange: I
53
53
  }) : /* @__PURE__ */ p(a, {
@@ -55,7 +55,7 @@ function y(d) {
55
55
  isCorrect: x,
56
56
  size: "small",
57
57
  color: "default",
58
- placeholder: T || n(O, "placeholderEnterHere"),
58
+ placeholder: T || r(O, "placeholderEnterHere"),
59
59
  value: M,
60
60
  onChange: (e) => {
61
61
  I(e.target.value);
@@ -1,8 +1,8 @@
1
1
  import { SquareButton as e } from "../../../../components/SquareButton.js";
2
2
  import { stdin_default as t } from "../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/alarm-warning-fill.js";
3
3
  import { stdin_default as n } from "../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/settings-3-fill.js";
4
- import { getTexts as r } from "../../../../texts.js";
5
- import { LexicalCustomConfigContext as i } from "../../LexicalCustomConfigContext.js";
4
+ import { LexicalCustomConfigContext as r } from "../../LexicalCustomConfigContext.js";
5
+ import { getTexts as i } from "../../../../texts.js";
6
6
  import { SelectBoxEdit as a } from "./SelectBox/SelectBoxEdit.js";
7
7
  import { SelectBoxView as o } from "./SelectBox/SelectBoxView.js";
8
8
  import { SettingForm as s } from "./SettingForm/SettingForm.js";
@@ -17,7 +17,7 @@ import { useLexicalComposerContext as v } from "@lexical/react/LexicalComposerCo
17
17
  import { useLexicalEditable as y } from "@lexical/react/useLexicalEditable";
18
18
  //#region src/cds/patterns/LexicalEditor/nodes/ProblemSelectNode/SelectComponent.tsx
19
19
  function b(f) {
20
- let { selected: b, hasMultipleSolutions: S, selections: C, nodeKey: w } = f, [T] = v(), { t: E } = g(), [D, O] = d(!1), k = y(), { freezeProblemNode: A, showQuizSolution: j } = u(i), M = S || S === void 0 && C.filter((e) => "isAnswer" in e && e.isAnswer).length > 1;
20
+ let { selected: b, hasMultipleSolutions: S, selections: C, nodeKey: w } = f, [T] = v(), { t: E } = g(), [D, O] = d(!1), k = y(), { freezeProblemNode: A, showQuizSolution: j } = u(r), M = S || S === void 0 && C.filter((e) => "isAnswer" in e && e.isAnswer).length > 1;
21
21
  return k ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
22
22
  css: l`
23
23
  display: flex;
@@ -64,7 +64,7 @@ function b(f) {
64
64
  children: [M && /* @__PURE__ */ h(x, { children: [/* @__PURE__ */ m(t, { css: l`
65
65
  width: 14px;
66
66
  height: 14px;
67
- ` }), r(E, "multipleChoicesProblem")] }), C.map((e, t) => /* @__PURE__ */ m(o, {
67
+ ` }), i(E, "multipleChoicesProblem")] }), C.map((e, t) => /* @__PURE__ */ m(o, {
68
68
  multipleSelectionsEnabled: M,
69
69
  index: t + 1,
70
70
  isAnswer: j && "isAnswer" in e ? e.isAnswer : void 0,
@@ -1,8 +1,8 @@
1
1
  import { SquareButton as e } from "../../../../components/SquareButton.js";
2
2
  import { stdin_default as t } from "../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/settings-3-fill.js";
3
3
  import { Input as n } from "../../../../components/Input.js";
4
- import { getTexts as r } from "../../../../texts.js";
5
- import { LexicalCustomConfigContext as i } from "../../LexicalCustomConfigContext.js";
4
+ import { LexicalCustomConfigContext as r } from "../../LexicalCustomConfigContext.js";
5
+ import { getTexts as i } from "../../../../texts.js";
6
6
  import { SettingForm as a } from "./SettingForm.js";
7
7
  import { $isSheetInputNode as o } from "./SheetInputNode.js";
8
8
  import { css as s } from "@emotion/react";
@@ -16,7 +16,7 @@ import { useLexicalEditable as _ } from "@lexical/react/useLexicalEditable";
16
16
  //#region src/cds/patterns/LexicalEditor/nodes/SheetInputNode/InputComponent.tsx
17
17
  var v = 84, y = 8;
18
18
  function b(u) {
19
- let { multiline: b, value: S, placeholder: C, nodeKey: w } = u, [T] = g(), [E, D] = l(!1), O = _(), [k, A] = l(!1), [j, M] = l(S), { freezeProblemNode: N } = c(i), { t: P } = m(), F = (e) => {
19
+ let { multiline: b, value: S, placeholder: C, nodeKey: w } = u, [T] = g(), [E, D] = l(!1), O = _(), [k, A] = l(!1), [j, M] = l(S), { freezeProblemNode: N } = c(r), { t: P } = m(), F = (e) => {
20
20
  M(e), T.update(() => {
21
21
  let t = h(w);
22
22
  o(t) && t.setValue(e);
@@ -60,7 +60,7 @@ function b(u) {
60
60
  },
61
61
  size: "small",
62
62
  color: k ? "activePrimary" : "default",
63
- placeholder: C || r(P, "placeholderEnterHere"),
63
+ placeholder: C || i(P, "placeholderEnterHere"),
64
64
  value: j,
65
65
  onChange: (e) => {
66
66
  F(e.target.value);
@@ -1,8 +1,8 @@
1
1
  import { SquareButton as e } from "../../../../../components/SquareButton.js";
2
2
  import { stdin_default as t } from "../../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/alarm-warning-fill.js";
3
3
  import { stdin_default as n } from "../../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/settings-3-fill.js";
4
- import { getTexts as r } from "../../../../../texts.js";
5
- import { LexicalCustomConfigContext as i } from "../../../LexicalCustomConfigContext.js";
4
+ import { LexicalCustomConfigContext as r } from "../../../LexicalCustomConfigContext.js";
5
+ import { getTexts as i } from "../../../../../texts.js";
6
6
  import { SettingForm as a } from "./SettingForm/SettingForm.js";
7
7
  import { SelectBoxView as o } from "./SelectBox/SelectBoxView.js";
8
8
  import { SelectBoxEdit as s } from "./SelectBox/SelectBoxEdit.js";
@@ -17,7 +17,7 @@ import { useLexicalComposerContext as v } from "@lexical/react/LexicalComposerCo
17
17
  import { useLexicalEditable as y } from "@lexical/react/useLexicalEditable";
18
18
  //#region src/cds/patterns/LexicalEditor/nodes/SheetSelectNode/SelectComponent/SelectComponent.tsx
19
19
  function b(f) {
20
- let { selections: b, selected: S, allowMultipleAnswers: C, nodeKey: w } = f, [T] = v(), { t: E } = g(), [D, O] = d(!1), k = y(), { freezeProblemNode: A } = u(i);
20
+ let { selections: b, selected: S, allowMultipleAnswers: C, nodeKey: w } = f, [T] = v(), { t: E } = g(), [D, O] = d(!1), k = y(), { freezeProblemNode: A } = u(r);
21
21
  return k ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
22
22
  css: l`
23
23
  display: flex;
@@ -57,7 +57,7 @@ function b(f) {
57
57
  })] }) : /* @__PURE__ */ h(p, { children: [C && /* @__PURE__ */ h(x, { children: [/* @__PURE__ */ m(t, { css: l`
58
58
  width: 14px;
59
59
  height: 14px;
60
- ` }), r(E, "multipleChoicesProblem")] }), b.map((e, t) => /* @__PURE__ */ m(o, {
60
+ ` }), i(E, "multipleChoicesProblem")] }), b.map((e, t) => /* @__PURE__ */ m(o, {
61
61
  index: t + 1,
62
62
  isSelected: S.includes(e.value),
63
63
  image: e.show.image,
@@ -0,0 +1 @@
1
+ export declare function CompactToolbarPlugin(): JSX.Element | null;
@@ -0,0 +1,106 @@
1
+ import { stdin_default as e } from "../../../../node_modules/.pnpm/remixicon@4.3.0/node_modules/remixicon/icons/System/upload-line.js";
2
+ import { CdsContext as t } from "../../../../CdsProvider.js";
3
+ import { $createImageNode as n } from "../../nodes/ImageNode/ImageNode.js";
4
+ import { $createFileNode as r } from "../../nodes/FileNode/FileNode.js";
5
+ import { getTexts as i } from "../../../../texts.js";
6
+ import "../../uploadConstants.js";
7
+ import { COMPACT_ATTACHMENT_NODES as a } from "./compactAttachmentNodes.js";
8
+ import { css as o } from "@emotion/react";
9
+ import { useContext as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
10
+ import d from "@emotion/styled";
11
+ import { jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
12
+ import { useTranslation as m } from "react-i18next";
13
+ import { $createParagraphNode as h, $getRoot as g } from "lexical";
14
+ import { mergeRegister as _ } from "@lexical/utils";
15
+ import { useLexicalComposerContext as v } from "@lexical/react/LexicalComposerContext";
16
+ import y from "moment";
17
+ //#region src/cds/patterns/LexicalEditor/plugins/CompactToolbarPlugin/CompactToolbarPlugin.tsx
18
+ function b() {
19
+ let { t } = m(), n = x(), r = S(), i = l(null);
20
+ return n ? null : /* @__PURE__ */ p(C, { children: [/* @__PURE__ */ p(w, {
21
+ type: "button",
22
+ onClick: () => i.current?.click(),
23
+ children: [/* @__PURE__ */ f(e, {}), /* @__PURE__ */ f(T, { children: t("업로드") })]
24
+ }), /* @__PURE__ */ f(E, {
25
+ ref: i,
26
+ type: "file",
27
+ onChange: (e) => {
28
+ let t = e.target.files?.[0];
29
+ t && r(t), e.target.value = "";
30
+ }
31
+ })] });
32
+ }
33
+ function x() {
34
+ let [e] = v(), [t, n] = u(!1);
35
+ return c(() => {
36
+ let t = /* @__PURE__ */ new Set();
37
+ return _(...a.map((r) => e.registerMutationListener(r, (e) => {
38
+ for (let [n, r] of e) r === "destroyed" ? t.delete(n) : t.add(n);
39
+ n(t.size > 0);
40
+ }, { skipInitialization: !1 })));
41
+ }, [e]), t;
42
+ }
43
+ function S() {
44
+ let [e] = v(), a = s(t), { t: o } = m();
45
+ return async (t) => {
46
+ let s = a.lexical?.uploadByFile, c = a.lexical?.showFileError;
47
+ if (!s) return;
48
+ if (t.size >= 1073741824) {
49
+ c?.("upload", i(o, "errorFileTooLarge"));
50
+ return;
51
+ }
52
+ let l;
53
+ try {
54
+ l = await s(t);
55
+ } catch {
56
+ c?.("upload", o("파일을 업로드하지 못했습니다. 다시 시도해 주세요."));
57
+ return;
58
+ }
59
+ e.update(() => {
60
+ let e = t.type.startsWith("image/") ? n({
61
+ src: l,
62
+ altText: t.name
63
+ }) : r({
64
+ fileUrl: l,
65
+ fileName: t.name,
66
+ fileSize: t.size,
67
+ fileUploadDate: y().format("YYYY.MM.DD HH:mm:ss")
68
+ }), i = g(), a = i.getFirstChild();
69
+ a ? a.insertBefore(e) : i.append(e), e.getNextSibling() === null && e.insertAfter(h());
70
+ });
71
+ };
72
+ }
73
+ var C = d.div(({ theme: e }) => o`
74
+ display: flex;
75
+ gap: 8px;
76
+ padding: 8px;
77
+ border: 1px dashed ${e.color.foreground.neutralBaseDisabled};
78
+ border-radius: 10px;
79
+ `), w = d.button(({ theme: e }) => o`
80
+ display: flex;
81
+ flex-direction: column;
82
+ align-items: center;
83
+ justify-content: center;
84
+ gap: 4px;
85
+ width: 72px;
86
+ height: 64px;
87
+ padding: 8px;
88
+ border: 1px solid ${e.color.foreground.neutralBaseDisabled};
89
+ border-radius: 8px;
90
+ background: ${e.color.background.neutralBase};
91
+ color: ${e.color.foreground.neutralBase};
92
+ cursor: pointer;
93
+
94
+ &:hover {
95
+ background: ${e.color.background.neutralAlt};
96
+ }
97
+ `), T = d.span(({ theme: e }) => o`
98
+ font-family: ${e.fontFamily.ui};
99
+ font-size: 12px;
100
+ font-weight: 500;
101
+ line-height: 16px;
102
+ `), E = d.input`
103
+ display: none;
104
+ `;
105
+ //#endregion
106
+ export { b as CompactToolbarPlugin };
@@ -0,0 +1,8 @@
1
+ import { Klass, LexicalNode } from 'lexical';
2
+ /**
3
+ * AIDEV-NOTE:
4
+ * compactEditorMode 툴바가 "첨부 노드"로 간주해 추적하는 노드 목록의 진실의 근원.
5
+ * 첨부 노드가 본문에 하나라도 존재하면 삽입 툴바를 미노출한다(CompactToolbarPlugin 참고).
6
+ * 새로운 첨부 노드(예: 비디오)가 추가되면 이 배열에만 등록하면 된다.
7
+ */
8
+ export declare const COMPACT_ATTACHMENT_NODES: Klass<LexicalNode>[];
@@ -0,0 +1,6 @@
1
+ import { ImageNode as e } from "../../nodes/ImageNode/ImageNode.js";
2
+ import { FileNode as t } from "../../nodes/FileNode/FileNode.js";
3
+ //#region src/cds/patterns/LexicalEditor/plugins/CompactToolbarPlugin/compactAttachmentNodes.ts
4
+ var n = [e, t];
5
+ //#endregion
6
+ export { n as COMPACT_ATTACHMENT_NODES };
@@ -0,0 +1 @@
1
+ export * from './CompactToolbarPlugin';
@@ -1,5 +1,6 @@
1
1
  import { CdsContext as e } from "../../../../CdsProvider.js";
2
2
  import { getTexts as t } from "../../../../texts.js";
3
+ import "../../uploadConstants.js";
3
4
  import { INSERT_IMAGE_COMMAND as n } from "../ImagesPlugin/index.js";
4
5
  import { UPLOAD_FILE_COMMAND as r } from "../FilePlugin/index.js";
5
6
  import { useContext as i, useEffect as a } from "react";
@@ -16,22 +17,22 @@ var p = [
16
17
  "image/heif",
17
18
  "image/gif",
18
19
  "image/webp"
19
- ], m = 1 * 1024 * 1024 * 1024;
20
- function h() {
21
- let [h] = d(), g = i(e), _ = g.lexical?.uploadByFile, v = g.lexical?.showFileError, { t: y } = o();
22
- return a(() => h.registerCommand(c, (e) => ((async () => {
23
- if (!_) return !1;
20
+ ];
21
+ function m() {
22
+ let [m] = d(), h = i(e), g = h.lexical?.uploadByFile, _ = h.lexical?.showFileError, { t: v } = o();
23
+ return a(() => m.registerCommand(c, (e) => ((async () => {
24
+ if (!g) return !1;
24
25
  let i = await u(e, [""]);
25
26
  for (let { file: e } of i) if (l(e, p)) {
26
- let t = await _(e);
27
- h.dispatchCommand(n, {
27
+ let t = await g(e);
28
+ m.dispatchCommand(n, {
28
29
  altText: e.name,
29
30
  src: t
30
31
  });
31
- } else if (e.size >= m) v?.("upload", t(y, "errorFileTooLarge"));
32
+ } else if (e.size >= 1073741824) _?.("upload", t(v, "errorFileTooLarge"));
32
33
  else {
33
- let t = await _(e);
34
- h.dispatchCommand(r, {
34
+ let t = await g(e);
35
+ m.dispatchCommand(r, {
35
36
  fileUrl: t,
36
37
  fileName: e.name,
37
38
  fileSize: e.size,
@@ -39,11 +40,11 @@ function h() {
39
40
  });
40
41
  }
41
42
  })(), !0), s), [
42
- h,
43
- v,
43
+ m,
44
44
  _,
45
- y
45
+ g,
46
+ v
46
47
  ]), null;
47
48
  }
48
49
  //#endregion
49
- export { h as DragDropPastePlugin };
50
+ export { m as DragDropPastePlugin };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * LexicalEditor의 모든 업로드 경로(DragDropPaste, UploadFileDialog, FileSelectInput,
3
+ * CompactToolbarPlugin)가 공유하는 최대 파일 크기. 경로마다 따로 정의하면 한도가 어긋나
4
+ * 사용자 혼란이 생기므로 단일 출처로 둔다.
5
+ */
6
+ export declare const MAX_FILE_SIZE: number;
@@ -0,0 +1,4 @@
1
+ //#region src/cds/patterns/LexicalEditor/uploadConstants.ts
2
+ var e = 1024 * 1024 * 1024;
3
+ //#endregion
4
+ export { e as MAX_FILE_SIZE };