@stll/folio-react 0.20.2 → 0.21.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.
- package/dist/{CommentsSidebar-D6n3ifAJ.js → CommentsSidebar-BN6EX4xT.js} +3 -2
- package/dist/{TablePropertiesDialog-BW4RRZLZ.js → TablePropertiesDialog-DOUiX1KZ.js} +108 -149
- package/dist/compat/eigenpal.d.ts +1 -1
- package/dist/compat/eigenpal.js +1 -1
- package/dist/dialogs.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{renderAsync-yY4eNo9i.d.ts → renderAsync-CpeG0afF.d.ts} +1 -13
- package/dist/{renderAsync-dUCMzc_W.js → renderAsync-D5P4hvJg.js} +44 -47
- package/dist/standalone.css +1 -1
- package/package.json +10 -10
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { d as containedHandler } from "./renderAsync-
|
|
1
|
+
import { d as containedHandler } from "./renderAsync-D5P4hvJg.js";
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { CheckIcon, MoreVerticalIcon } from "lucide-react";
|
|
4
4
|
import { useLocale, useTranslations } from "use-intl";
|
|
5
5
|
import { closestHtmlElement, queryHtmlElement } from "@stll/folio-core/utils/domGuards";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { commentAnchorSelector } from "@stll/folio-core/render-dom/commentAnchorAttributes";
|
|
7
8
|
//#region src/components/CommentsSidebar.tsx
|
|
8
9
|
/**
|
|
9
10
|
* Comments Sidebar
|
|
@@ -174,7 +175,7 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
|
|
|
174
175
|
};
|
|
175
176
|
for (const comment of visibleComments) {
|
|
176
177
|
const cardId = `comment-${comment.id}`;
|
|
177
|
-
const el = pagesEl.querySelector(
|
|
178
|
+
const el = pagesEl.querySelector(commentAnchorSelector(comment.id));
|
|
178
179
|
if (el) {
|
|
179
180
|
pushPosition(cardId, el.getBoundingClientRect().top - containerRect.top + scrollTop, cardRefs.current.get(cardId)?.offsetHeight || DEFAULT_CARD_HEIGHT);
|
|
180
181
|
continue;
|
|
@@ -5,6 +5,7 @@ import { c } from "react-compiler-runtime";
|
|
|
5
5
|
import { useEffect, useId, useState } from "react";
|
|
6
6
|
import { useTranslations } from "use-intl";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { TABLE_PROPERTY_JUSTIFICATIONS, toTablePropertyJustification } from "@stll/folio-core/utils/tableOperations";
|
|
8
9
|
//#region src/components/dialogs/TablePropertiesDialog.tsx
|
|
9
10
|
/**
|
|
10
11
|
* Table Properties Dialog — width type, width value, alignment.
|
|
@@ -17,15 +18,15 @@ const editableWidthType = (value) => {
|
|
|
17
18
|
default: return "auto";
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const TABLE_JUSTIFICATION_LABEL_KEYS = {
|
|
22
|
+
center: "dialogs.tableProperties.alignOptions.center",
|
|
23
|
+
end: "dialogs.tableProperties.alignOptions.end",
|
|
24
|
+
left: "dialogs.tableProperties.alignOptions.left",
|
|
25
|
+
right: "dialogs.tableProperties.alignOptions.right",
|
|
26
|
+
start: "dialogs.tableProperties.alignOptions.start"
|
|
26
27
|
};
|
|
27
28
|
function TablePropertiesDialog(t0) {
|
|
28
|
-
const $ = c(
|
|
29
|
+
const $ = c(107);
|
|
29
30
|
const { isOpen, onClose, onApply, currentProps } = t0;
|
|
30
31
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
31
32
|
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
@@ -40,10 +41,10 @@ function TablePropertiesDialog(t0) {
|
|
|
40
41
|
$[1] = t2;
|
|
41
42
|
} else t2 = $[1];
|
|
42
43
|
const [widthType, setWidthType] = useState(t2);
|
|
43
|
-
const t3 = currentProps?.justification
|
|
44
|
+
const t3 = currentProps?.justification;
|
|
44
45
|
let t4;
|
|
45
46
|
if ($[2] !== t3) {
|
|
46
|
-
t4 =
|
|
47
|
+
t4 = toTablePropertyJustification(t3);
|
|
47
48
|
$[2] = t3;
|
|
48
49
|
$[3] = t4;
|
|
49
50
|
} else t4 = $[3];
|
|
@@ -54,7 +55,7 @@ function TablePropertiesDialog(t0) {
|
|
|
54
55
|
if (isOpen) {
|
|
55
56
|
setWidth(currentProps?.width ?? 0);
|
|
56
57
|
setWidthType(editableWidthType(currentProps?.widthType ?? "auto"));
|
|
57
|
-
setJustification(
|
|
58
|
+
setJustification(toTablePropertyJustification(currentProps?.justification));
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
$[4] = currentProps?.justification;
|
|
@@ -74,7 +75,7 @@ function TablePropertiesDialog(t0) {
|
|
|
74
75
|
let t7;
|
|
75
76
|
if ($[12] !== justification || $[13] !== onApply || $[14] !== onClose || $[15] !== width || $[16] !== widthType) {
|
|
76
77
|
t7 = () => {
|
|
77
|
-
const props = { justification
|
|
78
|
+
const props = { justification };
|
|
78
79
|
if (widthType === "auto") {
|
|
79
80
|
props.width = null;
|
|
80
81
|
props.widthType = "auto";
|
|
@@ -282,181 +283,139 @@ function TablePropertiesDialog(t0) {
|
|
|
282
283
|
const t32 = fieldIds.align;
|
|
283
284
|
let t33;
|
|
284
285
|
if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
|
|
285
|
-
t33 = (e_1) => setJustification(
|
|
286
|
+
t33 = (e_1) => setJustification(toTablePropertyJustification(e_1.target.value));
|
|
286
287
|
$[66] = t33;
|
|
287
288
|
} else t33 = $[66];
|
|
288
289
|
let t34;
|
|
289
290
|
if ($[67] !== t) {
|
|
290
|
-
t34 =
|
|
291
|
+
t34 = TABLE_PROPERTY_JUSTIFICATIONS.map((value) => /* @__PURE__ */ jsx("option", {
|
|
292
|
+
value,
|
|
293
|
+
children: t(TABLE_JUSTIFICATION_LABEL_KEYS[value])
|
|
294
|
+
}, value));
|
|
291
295
|
$[67] = t;
|
|
292
296
|
$[68] = t34;
|
|
293
297
|
} else t34 = $[68];
|
|
294
298
|
let t35;
|
|
295
|
-
if ($[69] !== t34) {
|
|
296
|
-
t35 = /* @__PURE__ */ jsx("
|
|
297
|
-
value: "left",
|
|
298
|
-
children: t34
|
|
299
|
-
});
|
|
300
|
-
$[69] = t34;
|
|
301
|
-
$[70] = t35;
|
|
302
|
-
} else t35 = $[70];
|
|
303
|
-
let t36;
|
|
304
|
-
if ($[71] !== t) {
|
|
305
|
-
t36 = t("dialogs.tableProperties.alignOptions.center");
|
|
306
|
-
$[71] = t;
|
|
307
|
-
$[72] = t36;
|
|
308
|
-
} else t36 = $[72];
|
|
309
|
-
let t37;
|
|
310
|
-
if ($[73] !== t36) {
|
|
311
|
-
t37 = /* @__PURE__ */ jsx("option", {
|
|
312
|
-
value: "center",
|
|
313
|
-
children: t36
|
|
314
|
-
});
|
|
315
|
-
$[73] = t36;
|
|
316
|
-
$[74] = t37;
|
|
317
|
-
} else t37 = $[74];
|
|
318
|
-
let t38;
|
|
319
|
-
if ($[75] !== t) {
|
|
320
|
-
t38 = t("dialogs.tableProperties.alignOptions.right");
|
|
321
|
-
$[75] = t;
|
|
322
|
-
$[76] = t38;
|
|
323
|
-
} else t38 = $[76];
|
|
324
|
-
let t39;
|
|
325
|
-
if ($[77] !== t38) {
|
|
326
|
-
t39 = /* @__PURE__ */ jsx("option", {
|
|
327
|
-
value: "right",
|
|
328
|
-
children: t38
|
|
329
|
-
});
|
|
330
|
-
$[77] = t38;
|
|
331
|
-
$[78] = t39;
|
|
332
|
-
} else t39 = $[78];
|
|
333
|
-
let t40;
|
|
334
|
-
if ($[79] !== fieldIds.align || $[80] !== justification || $[81] !== t35 || $[82] !== t37 || $[83] !== t39) {
|
|
335
|
-
t40 = /* @__PURE__ */ jsxs("select", {
|
|
299
|
+
if ($[69] !== fieldIds.align || $[70] !== justification || $[71] !== t34) {
|
|
300
|
+
t35 = /* @__PURE__ */ jsx("select", {
|
|
336
301
|
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
337
302
|
id: t32,
|
|
338
303
|
onChange: t33,
|
|
339
304
|
value: justification,
|
|
340
|
-
children:
|
|
341
|
-
t35,
|
|
342
|
-
t37,
|
|
343
|
-
t39
|
|
344
|
-
]
|
|
305
|
+
children: t34
|
|
345
306
|
});
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
if ($[85] !== t31 || $[86] !== t40) {
|
|
355
|
-
t41 = /* @__PURE__ */ jsxs("div", {
|
|
307
|
+
$[69] = fieldIds.align;
|
|
308
|
+
$[70] = justification;
|
|
309
|
+
$[71] = t34;
|
|
310
|
+
$[72] = t35;
|
|
311
|
+
} else t35 = $[72];
|
|
312
|
+
let t36;
|
|
313
|
+
if ($[73] !== t31 || $[74] !== t35) {
|
|
314
|
+
t36 = /* @__PURE__ */ jsxs("div", {
|
|
356
315
|
className: "flex items-center gap-3",
|
|
357
|
-
children: [t31,
|
|
316
|
+
children: [t31, t35]
|
|
358
317
|
});
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
} else
|
|
363
|
-
let
|
|
364
|
-
if ($[
|
|
365
|
-
|
|
318
|
+
$[73] = t31;
|
|
319
|
+
$[74] = t35;
|
|
320
|
+
$[75] = t36;
|
|
321
|
+
} else t36 = $[75];
|
|
322
|
+
let t37;
|
|
323
|
+
if ($[76] !== t27 || $[77] !== t28 || $[78] !== t36) {
|
|
324
|
+
t37 = /* @__PURE__ */ jsxs("div", {
|
|
366
325
|
className: "flex flex-col gap-3 px-5 py-4",
|
|
367
326
|
children: [
|
|
368
327
|
t27,
|
|
369
328
|
t28,
|
|
370
|
-
|
|
329
|
+
t36
|
|
371
330
|
]
|
|
372
331
|
});
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
} else
|
|
378
|
-
let
|
|
379
|
-
if ($[
|
|
380
|
-
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
} else
|
|
384
|
-
let
|
|
385
|
-
if ($[
|
|
386
|
-
|
|
332
|
+
$[76] = t27;
|
|
333
|
+
$[77] = t28;
|
|
334
|
+
$[78] = t36;
|
|
335
|
+
$[79] = t37;
|
|
336
|
+
} else t37 = $[79];
|
|
337
|
+
let t38;
|
|
338
|
+
if ($[80] !== t) {
|
|
339
|
+
t38 = t("common.cancel");
|
|
340
|
+
$[80] = t;
|
|
341
|
+
$[81] = t38;
|
|
342
|
+
} else t38 = $[81];
|
|
343
|
+
let t39;
|
|
344
|
+
if ($[82] !== DialogClose || $[83] !== t38) {
|
|
345
|
+
t39 = /* @__PURE__ */ jsx(DialogClose, {
|
|
387
346
|
className: "border-input rounded border px-4 py-1.5 text-[13px]",
|
|
388
|
-
children:
|
|
347
|
+
children: t38
|
|
389
348
|
});
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
} else
|
|
394
|
-
let
|
|
395
|
-
if ($[
|
|
396
|
-
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
} else
|
|
400
|
-
let
|
|
401
|
-
if ($[
|
|
402
|
-
|
|
349
|
+
$[82] = DialogClose;
|
|
350
|
+
$[83] = t38;
|
|
351
|
+
$[84] = t39;
|
|
352
|
+
} else t39 = $[84];
|
|
353
|
+
let t40;
|
|
354
|
+
if ($[85] !== t) {
|
|
355
|
+
t40 = t("common.apply");
|
|
356
|
+
$[85] = t;
|
|
357
|
+
$[86] = t40;
|
|
358
|
+
} else t40 = $[86];
|
|
359
|
+
let t41;
|
|
360
|
+
if ($[87] !== handleApply || $[88] !== t40) {
|
|
361
|
+
t41 = /* @__PURE__ */ jsx("button", {
|
|
403
362
|
className: "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium",
|
|
404
363
|
onClick: handleApply,
|
|
405
364
|
type: "button",
|
|
406
|
-
children:
|
|
365
|
+
children: t40
|
|
407
366
|
});
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
} else
|
|
412
|
-
let
|
|
413
|
-
if ($[
|
|
414
|
-
|
|
367
|
+
$[87] = handleApply;
|
|
368
|
+
$[88] = t40;
|
|
369
|
+
$[89] = t41;
|
|
370
|
+
} else t41 = $[89];
|
|
371
|
+
let t42;
|
|
372
|
+
if ($[90] !== t39 || $[91] !== t41) {
|
|
373
|
+
t42 = /* @__PURE__ */ jsxs("div", {
|
|
415
374
|
className: "flex justify-end gap-2 border-t px-5 py-3",
|
|
416
|
-
children: [
|
|
375
|
+
children: [t39, t41]
|
|
417
376
|
});
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
} else
|
|
422
|
-
let
|
|
423
|
-
if ($[
|
|
424
|
-
|
|
377
|
+
$[90] = t39;
|
|
378
|
+
$[91] = t41;
|
|
379
|
+
$[92] = t42;
|
|
380
|
+
} else t42 = $[92];
|
|
381
|
+
let t43;
|
|
382
|
+
if ($[93] !== DialogPopup || $[94] !== t14 || $[95] !== t37 || $[96] !== t42) {
|
|
383
|
+
t43 = /* @__PURE__ */ jsxs(DialogPopup, {
|
|
425
384
|
className: "bg-popover fixed start-1/2 top-1/2 z-[10001] w-full max-w-[440px] min-w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-xl",
|
|
426
385
|
children: [
|
|
427
386
|
t14,
|
|
428
|
-
|
|
429
|
-
|
|
387
|
+
t37,
|
|
388
|
+
t42
|
|
430
389
|
]
|
|
431
390
|
});
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
} else
|
|
438
|
-
let
|
|
439
|
-
if ($[
|
|
440
|
-
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
-
$[
|
|
445
|
-
} else
|
|
446
|
-
let
|
|
447
|
-
if ($[
|
|
448
|
-
|
|
391
|
+
$[93] = DialogPopup;
|
|
392
|
+
$[94] = t14;
|
|
393
|
+
$[95] = t37;
|
|
394
|
+
$[96] = t42;
|
|
395
|
+
$[97] = t43;
|
|
396
|
+
} else t43 = $[97];
|
|
397
|
+
let t44;
|
|
398
|
+
if ($[98] !== DialogPortal || $[99] !== t12 || $[100] !== t43) {
|
|
399
|
+
t44 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t12, t43] });
|
|
400
|
+
$[98] = DialogPortal;
|
|
401
|
+
$[99] = t12;
|
|
402
|
+
$[100] = t43;
|
|
403
|
+
$[101] = t44;
|
|
404
|
+
} else t44 = $[101];
|
|
405
|
+
let t45;
|
|
406
|
+
if ($[102] !== Dialog || $[103] !== handleOpenChange || $[104] !== isOpen || $[105] !== t44) {
|
|
407
|
+
t45 = /* @__PURE__ */ jsx(Dialog, {
|
|
449
408
|
open: isOpen,
|
|
450
409
|
onOpenChange: handleOpenChange,
|
|
451
|
-
children:
|
|
410
|
+
children: t44
|
|
452
411
|
});
|
|
453
|
-
$[
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
457
|
-
$[
|
|
458
|
-
} else
|
|
459
|
-
return
|
|
412
|
+
$[102] = Dialog;
|
|
413
|
+
$[103] = handleOpenChange;
|
|
414
|
+
$[104] = isOpen;
|
|
415
|
+
$[105] = t44;
|
|
416
|
+
$[106] = t45;
|
|
417
|
+
} else t45 = $[106];
|
|
418
|
+
return t45;
|
|
460
419
|
}
|
|
461
420
|
//#endregion
|
|
462
421
|
export { TablePropertiesDialog_exports as n, TablePropertiesDialog as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-
|
|
1
|
+
import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-CpeG0afF.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
|
|
4
4
|
//#region src/compat/eigenpal.d.ts
|
package/dist/compat/eigenpal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-
|
|
1
|
+
import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-D5P4hvJg.js";
|
|
2
2
|
import { t as messages_exports } from "../messages.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { forwardRef } from "react";
|
package/dist/dialogs.js
CHANGED
|
@@ -5,5 +5,5 @@ import { t as ImagePositionDialog } from "./ImagePositionDialog-DNodkoI2.js";
|
|
|
5
5
|
import { t as ImagePropertiesDialog } from "./ImagePropertiesDialog-CLsDIUWb.js";
|
|
6
6
|
import { t as InsertSymbolDialog } from "./InsertSymbolDialog-DCFLmfzn.js";
|
|
7
7
|
import { t as PageSetupDialog } from "./PageSetupDialog-COkgeOQn.js";
|
|
8
|
-
import { t as TablePropertiesDialog } from "./TablePropertiesDialog-
|
|
8
|
+
import { t as TablePropertiesDialog } from "./TablePropertiesDialog-DOUiX1KZ.js";
|
|
9
9
|
export { FindReplaceDialog, FootnotePropertiesDialog, HyperlinkDialog, ImagePositionDialog, ImagePropertiesDialog, InsertImageDialog, InsertSymbolDialog, InsertTableDialog, PageSetupDialog, PasteSpecialDialog, SplitCellDialog, TablePropertiesDialog, WatermarkDialog };
|