@stll/folio-react 0.6.0 → 0.8.0

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 (30) hide show
  1. package/dist/{CommentsSidebar-_utmEkA9.js → CommentsSidebar-Byn5lyrt.js} +127 -130
  2. package/dist/{FindReplaceDialog-DLdBekSR.js → FindReplaceDialog-CqKK82nE.js} +23 -18
  3. package/dist/FootnotePropertiesDialog-CixRdIiT.js +822 -0
  4. package/dist/ImagePositionDialog-DNodkoI2.js +1065 -0
  5. package/dist/ImagePropertiesDialog-CLsDIUWb.js +613 -0
  6. package/dist/InsertSymbolDialog-DCFLmfzn.js +376 -0
  7. package/dist/PageSetupDialog-COkgeOQn.js +820 -0
  8. package/dist/TablePropertiesDialog-B_AGrPR8.js +434 -0
  9. package/dist/{TextContextMenu-CG0V37wi.js → TextContextMenu-Ci7-M4oU.js} +199 -79
  10. package/dist/compat/eigenpal.d.ts +1 -1
  11. package/dist/compat/eigenpal.js +89 -17
  12. package/dist/dialogChrome-BoGYPgeu.js +26 -0
  13. package/dist/{dialogs-CzvXYJyG.js → dialogs-Bj2PdycR.js} +608 -352
  14. package/dist/{dialogs-j7qyw17x.d.ts → dialogs-DK8OVUT_.d.ts} +13 -1
  15. package/dist/dialogs.d.ts +2 -2
  16. package/dist/dialogs.js +9 -8
  17. package/dist/editor.css +1 -1
  18. package/dist/folio-ui-BgDDRsUX.js +1013 -0
  19. package/dist/index.d.ts +5 -4
  20. package/dist/index.js +12 -11
  21. package/dist/{renderAsync-B7UJsZye.d.ts → renderAsync-BmxQE7iO.d.ts} +12 -3
  22. package/dist/{renderAsync-CwHTsxBN.js → renderAsync-BtWYvQMT.js} +5717 -3275
  23. package/dist/standalone.css +1 -1
  24. package/package.json +8 -6
  25. package/dist/FootnotePropertiesDialog-CUjq9c6H.js +0 -267
  26. package/dist/ImagePositionDialog-BMuO9rLT.js +0 -395
  27. package/dist/ImagePropertiesDialog-C8iEgdmN.js +0 -198
  28. package/dist/PageSetupDialog-BKsSMCGb.js +0 -312
  29. package/dist/TablePropertiesDialog-Dw8gvL78.js +0 -159
  30. package/dist/useFindReplace-BPBpMWS9.js +0 -842
@@ -1,3 +1,4 @@
1
+ import { c } from "react-compiler-runtime";
1
2
  import { useCallback, useEffect, useRef, useState } from "react";
2
3
  import { ArrowDownToLine, ArrowLeftToLine, ArrowRightToLine, ArrowUpToLine, ClipboardPaste, Copy, Grid3x3, MessageSquarePlus, Scissors, SquareDashed, TextSelect, Trash2 } from "lucide-react";
3
4
  import { createPortal } from "react-dom";
@@ -94,67 +95,187 @@ function itemIconColor(item) {
94
95
  if (item.emphasis) return EMPHASIS_COLOR;
95
96
  return "var(--muted-foreground, var(--doc-text-muted, #737373))";
96
97
  }
97
- const MenuItemComponent = ({ item, onClick, isHighlighted, onMouseEnter }) => {
98
- if (item.action === "separator") return /* @__PURE__ */ jsx("div", {
99
- className: "docx-text-context-menu-separator",
100
- style: {
101
- height: "1px",
102
- backgroundColor: "var(--border, var(--doc-border, #e5e7eb))",
103
- margin: "4px 12px"
104
- }
105
- });
106
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("button", {
107
- type: "button",
108
- className: `docx-text-context-menu-item ${isHighlighted ? "docx-text-context-menu-item-highlighted" : ""} ${item.disabled ? "docx-text-context-menu-item-disabled" : ""}`,
109
- onClick,
110
- onMouseEnter,
111
- disabled: item.disabled,
112
- role: "menuitem",
113
- "aria-disabled": item.disabled,
114
- style: {
98
+ const MenuItemComponent = (t0) => {
99
+ const $ = c(45);
100
+ const { item, isHighlighted, navigableIndex, onItemClick, onItemEnter } = t0;
101
+ let t1;
102
+ if ($[0] !== item || $[1] !== onItemClick) {
103
+ t1 = () => onItemClick(item);
104
+ $[0] = item;
105
+ $[1] = onItemClick;
106
+ $[2] = t1;
107
+ } else t1 = $[2];
108
+ const handleClick = t1;
109
+ let t2;
110
+ if ($[3] !== item.disabled || $[4] !== navigableIndex || $[5] !== onItemEnter) {
111
+ t2 = () => {
112
+ if (navigableIndex !== -1 && !item.disabled) onItemEnter(navigableIndex);
113
+ };
114
+ $[3] = item.disabled;
115
+ $[4] = navigableIndex;
116
+ $[5] = onItemEnter;
117
+ $[6] = t2;
118
+ } else t2 = $[6];
119
+ const handleMouseEnter = t2;
120
+ if (item.action === "separator") {
121
+ let t3;
122
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
123
+ t3 = /* @__PURE__ */ jsx("div", {
124
+ className: "docx-text-context-menu-separator",
125
+ style: {
126
+ height: "1px",
127
+ backgroundColor: "var(--border, var(--doc-border, #e5e7eb))",
128
+ margin: "4px 12px"
129
+ }
130
+ });
131
+ $[7] = t3;
132
+ } else t3 = $[7];
133
+ return t3;
134
+ }
135
+ const t3 = `docx-text-context-menu-item ${isHighlighted ? "docx-text-context-menu-item-highlighted" : ""} ${item.disabled ? "docx-text-context-menu-item-disabled" : ""}`;
136
+ const t4 = item.disabled;
137
+ const t5 = item.disabled;
138
+ const t6 = isHighlighted && !item.disabled ? "var(--accent, var(--doc-primary-light, #f3f4f6))" : "transparent";
139
+ const t7 = item.disabled ? "not-allowed" : "pointer";
140
+ let t8;
141
+ if ($[8] !== item) {
142
+ t8 = itemTextColor(item);
143
+ $[8] = item;
144
+ $[9] = t8;
145
+ } else t8 = $[9];
146
+ const t9 = item.emphasis ? 500 : 400;
147
+ const t10 = item.disabled ? .6 : 1;
148
+ let t11;
149
+ if ($[10] !== t10 || $[11] !== t6 || $[12] !== t7 || $[13] !== t8 || $[14] !== t9) {
150
+ t11 = {
115
151
  display: "flex",
116
152
  alignItems: "center",
117
153
  gap: "10px",
118
154
  width: "100%",
119
155
  padding: "8px 12px",
120
156
  border: "none",
121
- background: isHighlighted && !item.disabled ? "var(--accent, var(--doc-primary-light, #f3f4f6))" : "transparent",
122
- cursor: item.disabled ? "not-allowed" : "pointer",
157
+ background: t6,
158
+ cursor: t7,
123
159
  fontSize: "13px",
124
- color: itemTextColor(item),
125
- fontWeight: item.emphasis ? 500 : 400,
160
+ color: t8,
161
+ fontWeight: t9,
126
162
  textAlign: "left",
127
- opacity: item.disabled ? .6 : 1
128
- },
129
- children: [
130
- /* @__PURE__ */ jsx("span", {
131
- style: {
132
- display: "flex",
133
- color: itemIconColor(item)
134
- },
135
- children: item.icon ?? getActionIcon(item.action)
136
- }),
137
- /* @__PURE__ */ jsx("span", {
138
- style: { flex: 1 },
139
- children: item.label
140
- }),
141
- item.shortcut && /* @__PURE__ */ jsx("span", {
142
- style: {
143
- fontSize: "11px",
144
- color: "var(--muted-foreground, var(--doc-text-subtle, #737373))",
145
- fontFamily: "monospace"
146
- },
147
- children: item.shortcut
148
- })
149
- ]
150
- }), item.dividerAfter && /* @__PURE__ */ jsx("div", {
151
- className: "docx-text-context-menu-separator",
152
- style: {
153
- height: "1px",
154
- backgroundColor: "var(--border, var(--doc-border, #e5e7eb))",
155
- margin: "4px 12px"
156
- }
157
- })] });
163
+ opacity: t10
164
+ };
165
+ $[10] = t10;
166
+ $[11] = t6;
167
+ $[12] = t7;
168
+ $[13] = t8;
169
+ $[14] = t9;
170
+ $[15] = t11;
171
+ } else t11 = $[15];
172
+ let t12;
173
+ if ($[16] !== item) {
174
+ t12 = itemIconColor(item);
175
+ $[16] = item;
176
+ $[17] = t12;
177
+ } else t12 = $[17];
178
+ let t13;
179
+ if ($[18] !== t12) {
180
+ t13 = {
181
+ display: "flex",
182
+ color: t12
183
+ };
184
+ $[18] = t12;
185
+ $[19] = t13;
186
+ } else t13 = $[19];
187
+ let t14;
188
+ if ($[20] !== item.action || $[21] !== item.icon) {
189
+ t14 = item.icon ?? getActionIcon(item.action);
190
+ $[20] = item.action;
191
+ $[21] = item.icon;
192
+ $[22] = t14;
193
+ } else t14 = $[22];
194
+ let t15;
195
+ if ($[23] !== t13 || $[24] !== t14) {
196
+ t15 = /* @__PURE__ */ jsx("span", {
197
+ style: t13,
198
+ children: t14
199
+ });
200
+ $[23] = t13;
201
+ $[24] = t14;
202
+ $[25] = t15;
203
+ } else t15 = $[25];
204
+ let t16;
205
+ if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
206
+ t16 = { flex: 1 };
207
+ $[26] = t16;
208
+ } else t16 = $[26];
209
+ let t17;
210
+ if ($[27] !== item.label) {
211
+ t17 = /* @__PURE__ */ jsx("span", {
212
+ style: t16,
213
+ children: item.label
214
+ });
215
+ $[27] = item.label;
216
+ $[28] = t17;
217
+ } else t17 = $[28];
218
+ let t18;
219
+ if ($[29] !== item.shortcut) {
220
+ t18 = item.shortcut && /* @__PURE__ */ jsx("span", {
221
+ style: {
222
+ fontSize: "11px",
223
+ color: "var(--muted-foreground, var(--doc-text-subtle, #737373))",
224
+ fontFamily: "monospace"
225
+ },
226
+ children: item.shortcut
227
+ });
228
+ $[29] = item.shortcut;
229
+ $[30] = t18;
230
+ } else t18 = $[30];
231
+ let t19;
232
+ if ($[31] !== handleClick || $[32] !== handleMouseEnter || $[33] !== item.disabled || $[34] !== t11 || $[35] !== t15 || $[36] !== t17 || $[37] !== t18 || $[38] !== t3) {
233
+ t19 = /* @__PURE__ */ jsxs("button", {
234
+ type: "button",
235
+ className: t3,
236
+ onClick: handleClick,
237
+ onMouseEnter: handleMouseEnter,
238
+ disabled: t4,
239
+ role: "menuitem",
240
+ "aria-disabled": t5,
241
+ style: t11,
242
+ children: [
243
+ t15,
244
+ t17,
245
+ t18
246
+ ]
247
+ });
248
+ $[31] = handleClick;
249
+ $[32] = handleMouseEnter;
250
+ $[33] = item.disabled;
251
+ $[34] = t11;
252
+ $[35] = t15;
253
+ $[36] = t17;
254
+ $[37] = t18;
255
+ $[38] = t3;
256
+ $[39] = t19;
257
+ } else t19 = $[39];
258
+ let t20;
259
+ if ($[40] !== item.dividerAfter) {
260
+ t20 = item.dividerAfter && /* @__PURE__ */ jsx("div", {
261
+ className: "docx-text-context-menu-separator",
262
+ style: {
263
+ height: "1px",
264
+ backgroundColor: "var(--border, var(--doc-border, #e5e7eb))",
265
+ margin: "4px 12px"
266
+ }
267
+ });
268
+ $[40] = item.dividerAfter;
269
+ $[41] = t20;
270
+ } else t20 = $[41];
271
+ let t21;
272
+ if ($[42] !== t19 || $[43] !== t20) {
273
+ t21 = /* @__PURE__ */ jsxs(Fragment, { children: [t19, t20] });
274
+ $[42] = t19;
275
+ $[43] = t20;
276
+ $[44] = t21;
277
+ } else t21 = $[44];
278
+ return t21;
158
279
  };
159
280
  const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipboardContent = true, onAction, onClose, items, className = "" }) => {
160
281
  const menuRef = useRef(null);
@@ -193,7 +314,7 @@ const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipbo
193
314
  if (item.dividerAfter !== void 0) menuItem.dividerAfter = item.dividerAfter;
194
315
  return menuItem;
195
316
  });
196
- const navigableItems = menuItems.filter((item) => item.action !== "separator");
317
+ const navigableItems = menuItems.filter((item_0) => item_0.action !== "separator");
197
318
  useEffect(() => {
198
319
  if (!isOpen) return;
199
320
  const handleClickOutside = (e) => {
@@ -209,22 +330,22 @@ const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipbo
209
330
  }, [isOpen, onClose]);
210
331
  useEffect(() => {
211
332
  if (!isOpen) return;
212
- const handleKeyDown = (e) => {
213
- switch (e.key) {
333
+ const handleKeyDown = (e_0) => {
334
+ switch (e_0.key) {
214
335
  case "Escape":
215
- e.preventDefault();
336
+ e_0.preventDefault();
216
337
  onClose();
217
338
  break;
218
339
  case "ArrowDown":
219
- e.preventDefault();
220
- setHighlightedIndex((prev) => {
221
- let next = (prev + 1) % navigableItems.length;
222
- while (navigableItems[next]?.disabled && next !== prev) next = (next + 1) % navigableItems.length;
223
- return next;
340
+ e_0.preventDefault();
341
+ setHighlightedIndex((prev_0) => {
342
+ let next_0 = (prev_0 + 1) % navigableItems.length;
343
+ while (navigableItems[next_0]?.disabled && next_0 !== prev_0) next_0 = (next_0 + 1) % navigableItems.length;
344
+ return next_0;
224
345
  });
225
346
  break;
226
347
  case "ArrowUp":
227
- e.preventDefault();
348
+ e_0.preventDefault();
228
349
  setHighlightedIndex((prev) => {
229
350
  let next = (prev - 1 + navigableItems.length) % navigableItems.length;
230
351
  while (navigableItems[next]?.disabled && next !== prev) next = (next - 1 + navigableItems.length) % navigableItems.length;
@@ -232,10 +353,10 @@ const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipbo
232
353
  });
233
354
  break;
234
355
  case "Enter": {
235
- e.preventDefault();
236
- const item = navigableItems[highlightedIndex];
237
- if (item && !item.disabled) {
238
- onAction(item.action);
356
+ e_0.preventDefault();
357
+ const item_1 = navigableItems[highlightedIndex];
358
+ if (item_1 && !item_1.disabled) {
359
+ onAction(item_1.action);
239
360
  onClose();
240
361
  }
241
362
  break;
@@ -282,11 +403,11 @@ const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipbo
282
403
  position,
283
404
  menuItems.length
284
405
  ]);
285
- const handleItemClick = (item) => {
286
- if (item.disabled) return;
287
- onAction(item.action);
406
+ const handleItemClick = useCallback((item_2) => {
407
+ if (item_2.disabled) return;
408
+ onAction(item_2.action);
288
409
  onClose();
289
- };
410
+ }, [onAction, onClose]);
290
411
  if (!isOpen) return null;
291
412
  const menu = /* @__PURE__ */ jsx("div", {
292
413
  ref: menuRef,
@@ -294,16 +415,15 @@ const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipbo
294
415
  style: getMenuStyle(),
295
416
  role: "menu",
296
417
  "aria-label": "Text editing menu",
297
- children: menuItems.map((item, index) => {
298
- const navigableIndex = navigableItems.indexOf(item);
418
+ children: menuItems.map((item_3, index) => {
419
+ const navigableIndex = navigableItems.indexOf(item_3);
299
420
  return /* @__PURE__ */ jsx(MenuItemComponent, {
300
- item,
301
- onClick: () => handleItemClick(item),
421
+ item: item_3,
302
422
  isHighlighted: navigableIndex === highlightedIndex,
303
- onMouseEnter: () => {
304
- if (navigableIndex !== -1 && !item.disabled) setHighlightedIndex(navigableIndex);
305
- }
306
- }, `${item.action}-${index}`);
423
+ navigableIndex,
424
+ onItemClick: handleItemClick,
425
+ onItemEnter: setHighlightedIndex
426
+ }, `${item_3.action}-${index}`);
307
427
  })
308
428
  });
309
429
  if (typeof document === "undefined") return menu;
@@ -1,4 +1,4 @@
1
- import { i as renderAsync, n as EditorHandle, o as DocxEditorProps, r as RenderAsyncOptions, s as DocxEditorRef, t as DocxEditorHandle } from "../renderAsync-B7UJsZye.js";
1
+ import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-BmxQE7iO.js";
2
2
  import { ReactNode } from "react";
3
3
  import { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
4
4
 
@@ -1,5 +1,6 @@
1
- import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-CwHTsxBN.js";
1
+ import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-BtWYvQMT.js";
2
2
  import { t as messages_exports } from "../messages.js";
3
+ import { c } from "react-compiler-runtime";
3
4
  import { forwardRef } from "react";
4
5
  import { IntlProvider, useTranslations } from "use-intl";
5
6
  import { jsx } from "react/jsx-runtime";
@@ -26,25 +27,96 @@ const locales = {
26
27
  tr,
27
28
  "zh-CN": zhCN
28
29
  };
29
- const LocaleProvider = ({ children, i18n, locale }) => {
30
- const resolvedLocale = resolveLocale(locale, i18n);
31
- return /* @__PURE__ */ jsx(IntlProvider, {
32
- locale: resolvedLocale,
33
- messages: (0, messages_exports.getFolioMessages)(resolvedLocale),
34
- children
35
- });
30
+ const LocaleProvider = (t0) => {
31
+ const $ = c(10);
32
+ const { children, i18n, locale } = t0;
33
+ let T0;
34
+ let t1;
35
+ let t2;
36
+ if ($[0] !== i18n || $[1] !== locale) {
37
+ const resolvedLocale = resolveLocale(locale, i18n);
38
+ T0 = IntlProvider;
39
+ t1 = resolvedLocale;
40
+ t2 = (0, messages_exports.getFolioMessages)(resolvedLocale);
41
+ $[0] = i18n;
42
+ $[1] = locale;
43
+ $[2] = T0;
44
+ $[3] = t1;
45
+ $[4] = t2;
46
+ } else {
47
+ T0 = $[2];
48
+ t1 = $[3];
49
+ t2 = $[4];
50
+ }
51
+ let t3;
52
+ if ($[5] !== T0 || $[6] !== children || $[7] !== t1 || $[8] !== t2) {
53
+ t3 = /* @__PURE__ */ jsx(T0, {
54
+ locale: t1,
55
+ messages: t2,
56
+ children
57
+ });
58
+ $[5] = T0;
59
+ $[6] = children;
60
+ $[7] = t1;
61
+ $[8] = t2;
62
+ $[9] = t3;
63
+ } else t3 = $[9];
64
+ return t3;
36
65
  };
37
66
  const useTranslation = () => {
38
- return { t: useTranslations("folio") };
67
+ const $ = c(2);
68
+ const t0 = useTranslations("folio");
69
+ let t1;
70
+ if ($[0] !== t0) {
71
+ t1 = { t: t0 };
72
+ $[0] = t0;
73
+ $[1] = t1;
74
+ } else t1 = $[1];
75
+ return t1;
39
76
  };
40
- const DocxEditor = forwardRef(({ agentPanel: _agentPanel, colorMode: _colorMode, commentsSidebarOpen: _commentsSidebarOpen, disableFindReplaceShortcuts: _disableFindReplaceShortcuts, documentName: _documentName, documentNameEditable: _documentNameEditable, externalContent: _externalContent, externalPlugins: _externalPlugins, i18n, locale, onCommentAdd: _onCommentAdd, onCommentDelete: _onCommentDelete, onCommentReply: _onCommentReply, onCommentResolve: _onCommentResolve, onCommentsSidebarOpenChange: _onCommentsSidebarOpenChange, onDocumentNameChange: _onDocumentNameChange, onOpen: _onOpen, onRenderedDomContextReady: _onRenderedDomContextReady, pluginOverlays: _pluginOverlays, pluginRenderedDomContext: _pluginRenderedDomContext, pluginSidebarItems: _pluginSidebarItems, printOptions: _printOptions, renderLogo: _renderLogo, renderTitleBarRight: _renderTitleBarRight, showFileOpen: _showFileOpen, showHelpMenu: _showHelpMenu, showOutlineButton: _showOutlineButton, watermarkPresets: _watermarkPresets, ...props }, ref) => /* @__PURE__ */ jsx(LocaleProvider, {
41
- i18n,
42
- locale,
43
- children: /* @__PURE__ */ jsx(DocxEditor$1, {
44
- ...props,
45
- ref
46
- })
47
- }));
77
+ const DocxEditor = forwardRef((t0, ref) => {
78
+ const $ = c(11);
79
+ let i18n;
80
+ let locale;
81
+ let props;
82
+ if ($[0] !== t0) {
83
+ const { agentPanel: _agentPanel, colorMode: _colorMode, commentsSidebarOpen: _commentsSidebarOpen, disableFindReplaceShortcuts: _disableFindReplaceShortcuts, documentName: _documentName, documentNameEditable: _documentNameEditable, externalContent: _externalContent, externalPlugins: _externalPlugins, i18n: t1, locale: t2, onCommentAdd: _onCommentAdd, onCommentDelete: _onCommentDelete, onCommentReply: _onCommentReply, onCommentResolve: _onCommentResolve, onCommentsSidebarOpenChange: _onCommentsSidebarOpenChange, onDocumentNameChange: _onDocumentNameChange, onOpen: _onOpen, onRenderedDomContextReady: _onRenderedDomContextReady, pluginOverlays: _pluginOverlays, pluginRenderedDomContext: _pluginRenderedDomContext, pluginSidebarItems: _pluginSidebarItems, printOptions: _printOptions, renderLogo: _renderLogo, renderTitleBarRight: _renderTitleBarRight, showFileOpen: _showFileOpen, showHelpMenu: _showHelpMenu, showOutlineButton: _showOutlineButton, watermarkPresets: _watermarkPresets, ...t3 } = t0;
84
+ i18n = t1;
85
+ locale = t2;
86
+ props = t3;
87
+ $[0] = t0;
88
+ $[1] = i18n;
89
+ $[2] = locale;
90
+ $[3] = props;
91
+ } else {
92
+ i18n = $[1];
93
+ locale = $[2];
94
+ props = $[3];
95
+ }
96
+ let t1;
97
+ if ($[4] !== props || $[5] !== ref) {
98
+ t1 = /* @__PURE__ */ jsx(DocxEditor$1, {
99
+ ...props,
100
+ ref
101
+ });
102
+ $[4] = props;
103
+ $[5] = ref;
104
+ $[6] = t1;
105
+ } else t1 = $[6];
106
+ let t2;
107
+ if ($[7] !== i18n || $[8] !== locale || $[9] !== t1) {
108
+ t2 = /* @__PURE__ */ jsx(LocaleProvider, {
109
+ i18n,
110
+ locale,
111
+ children: t1
112
+ });
113
+ $[7] = i18n;
114
+ $[8] = locale;
115
+ $[9] = t1;
116
+ $[10] = t2;
117
+ } else t2 = $[10];
118
+ return t2;
119
+ });
48
120
  DocxEditor.displayName = "EigenpalCompatDocxEditor";
49
121
  const resolveLocale = (locale, i18n) => locale ?? i18n?._lang ?? "en";
50
122
  //#endregion
@@ -0,0 +1,26 @@
1
+ import { c } from "react-compiler-runtime";
2
+ import "react";
3
+ //#region src/components/dialogs/dialogChrome.ts
4
+ function useCloseOnDialogOpenChange(onClose) {
5
+ const $ = c(2);
6
+ let t0;
7
+ if ($[0] !== onClose) {
8
+ t0 = (open) => {
9
+ if (!open) onClose();
10
+ };
11
+ $[0] = onClose;
12
+ $[1] = t0;
13
+ } else t0 = $[1];
14
+ return t0;
15
+ }
16
+ const DIALOG_BACKDROP_CLASS = "fixed inset-0 z-[10000] bg-black/50";
17
+ const DIALOG_POPUP_CLASS = "bg-popover fixed start-1/2 top-1/2 z-[10001] w-full max-w-[520px] min-w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-xl";
18
+ const DIALOG_TITLE_CLASS = "border-b px-5 py-3 text-base font-semibold";
19
+ const DIALOG_BODY_CLASS = "flex flex-col gap-4 px-5 py-4";
20
+ const DIALOG_FOOTER_CLASS = "flex justify-end gap-2 border-t px-5 py-3";
21
+ const DIALOG_LABEL_CLASS = "text-muted-foreground text-[13px]";
22
+ const DIALOG_INPUT_CLASS = "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none";
23
+ const DIALOG_SECONDARY_BUTTON_CLASS = "border-input rounded border px-4 py-1.5 text-[13px]";
24
+ const DIALOG_PRIMARY_BUTTON_CLASS = "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium disabled:cursor-not-allowed disabled:opacity-50";
25
+ //#endregion
26
+ export { DIALOG_LABEL_CLASS as a, DIALOG_SECONDARY_BUTTON_CLASS as c, DIALOG_INPUT_CLASS as i, DIALOG_TITLE_CLASS as l, DIALOG_BODY_CLASS as n, DIALOG_POPUP_CLASS as o, DIALOG_FOOTER_CLASS as r, DIALOG_PRIMARY_BUTTON_CLASS as s, DIALOG_BACKDROP_CLASS as t, useCloseOnDialogOpenChange as u };