@stll/folio-react 0.23.1 → 0.24.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.
@@ -1,9 +1,10 @@
1
- import { d as containedHandler } from "./renderAsync-CTnJ1YYt.js";
1
+ import { f as containedHandler, u as useDrawerFocus } from "./renderAsync-CYQL2X5T.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 { PANEL_METRICS } from "@stll/folio-core/panel-layout";
7
8
  import { commentAnchorSelector } from "@stll/folio-core/render-dom/commentAnchorAttributes";
8
9
  //#region src/components/CommentsSidebar.tsx
9
10
  /**
@@ -57,6 +58,17 @@ function getAvatarColor(name) {
57
58
  for (let i = 0; i < name.length; i++) hash = (name.codePointAt(i) ?? 0) + ((hash << 5) - hash);
58
59
  return AVATAR_COLORS[Math.abs(hash) % AVATAR_COLORS.length];
59
60
  }
61
+ const SIDEBAR_WIDTH = PANEL_METRICS.commentsWidth;
62
+ /** A drawer is a surface of its own over the page; a column is transparent. */
63
+ const DRAWER_SURFACE_STYLE = {
64
+ boxSizing: "border-box",
65
+ paddingInline: PANEL_METRICS.commentsGap,
66
+ background: "var(--doc-canvas-surface)",
67
+ borderInlineStart: "1px solid var(--doc-border)",
68
+ boxShadow: "0 8px 28px var(--doc-shadow-md)",
69
+ outline: "none"
70
+ };
71
+ const COLUMN_SURFACE_STYLE = { backgroundColor: "transparent" };
60
72
  const MIN_CARD_GAP = 6;
61
73
  const DEFAULT_CARD_HEIGHT = 64;
62
74
  const DEFAULT_INPUT_HEIGHT = 104;
@@ -86,7 +98,7 @@ const CANCEL_BUTTON_STYLE = {
86
98
  fontWeight: 500,
87
99
  fontFamily: "inherit"
88
100
  };
89
- const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onCommentReply, onCommentResolve, onCommentDelete, onAddComment, onCancelAddComment, onAcceptChange: _onAcceptChange, onRejectChange: _onRejectChange, onTrackedChangeReply: _onTrackedChangeReply, topOffset = 0, showResolved = false, isAddingComment = false, addCommentYPosition = null, pageWidth = 816, editorContainerRef, anchorPositions }) => {
101
+ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onCommentReply, onCommentResolve, onCommentDelete, onAddComment, onCancelAddComment, onAcceptChange: _onAcceptChange, onRejectChange: _onRejectChange, onTrackedChangeReply: _onTrackedChangeReply, topOffset = 0, showResolved = false, isAddingComment = false, addCommentYPosition = null, pageWidth = 816, editorContainerRef, anchorPositions, surface = "column", onDismiss }) => {
90
102
  const t = useTranslations("folio");
91
103
  const locale = useLocale();
92
104
  const [replyingTo, setReplyingTo] = useState(null);
@@ -101,6 +113,13 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
101
113
  const lastKnownCardPositionsRef = useRef(/* @__PURE__ */ new Map());
102
114
  const sidebarRef = useRef(null);
103
115
  const cardRefs = useRef(/* @__PURE__ */ new Map());
116
+ const isDrawer = surface === "drawer";
117
+ const [drawerBox, setDrawerBox] = useState({
118
+ top: 0,
119
+ width: PANEL_METRICS.drawerWidth,
120
+ height: 0
121
+ });
122
+ useDrawerFocus(sidebarRef, isDrawer && onDismiss ? onDismiss : null, "container");
104
123
  const updateSidebarLeft = useCallback(() => {
105
124
  const scrollEl = editorContainerRef?.current;
106
125
  const sidebarEl = sidebarRef.current;
@@ -112,10 +131,27 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
112
131
  return;
113
132
  }
114
133
  const parentRect = offsetParent.getBoundingClientRect();
115
- const rawLeft = pageEl.getBoundingClientRect().right - parentRect.left + 12;
116
- const maxVisibleLeft = Math.max(8, parentRect.width - 280 - 8);
134
+ const parentScale = offsetParent.clientWidth ? parentRect.width / offsetParent.clientWidth : 1;
135
+ const parentX = (viewportX) => (viewportX - parentRect.left) / parentScale;
136
+ if (isDrawer) {
137
+ const scrollRect = scrollEl.getBoundingClientRect();
138
+ const top = -Math.round((parentRect.top - scrollRect.top) / parentScale + scrollEl.scrollTop);
139
+ const width = Math.min(PANEL_METRICS.drawerWidth, scrollEl.clientWidth - 16);
140
+ const height = scrollEl.clientHeight;
141
+ const scrollScale = scrollEl.offsetWidth ? scrollRect.width / scrollEl.offsetWidth : parentScale;
142
+ const viewportEnd = scrollRect.left + scrollEl.clientWidth * scrollScale;
143
+ setDrawerBox((box) => box.top === top && box.width === width && box.height === height ? box : {
144
+ top,
145
+ width,
146
+ height
147
+ });
148
+ setMeasuredLeft(parentX(viewportEnd) - width);
149
+ return;
150
+ }
151
+ const rawLeft = parentX(pageEl.getBoundingClientRect().right) + PANEL_METRICS.commentsGap;
152
+ const maxVisibleLeft = Math.max(8, offsetParent.clientWidth - SIDEBAR_WIDTH - 8);
117
153
  setMeasuredLeft(Math.max(8, Math.min(rawLeft, maxVisibleLeft)));
118
- }, [editorContainerRef]);
154
+ }, [editorContainerRef, isDrawer]);
119
155
  useLayoutEffect(() => {
120
156
  updateSidebarLeft();
121
157
  }, [
@@ -165,12 +201,12 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
165
201
  const containerRect = container.getBoundingClientRect();
166
202
  const scrollTop = container.scrollTop;
167
203
  const positions = [];
168
- const pushPosition = (id, targetY, height) => {
204
+ const pushPosition = (id, targetY, height_0) => {
169
205
  lastKnownCardPositionsRef.current.set(id, targetY);
170
206
  positions.push({
171
207
  id,
172
208
  targetY,
173
- height
209
+ height: height_0
174
210
  });
175
211
  };
176
212
  for (const comment of visibleComments) {
@@ -327,8 +363,15 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
327
363
  setExpandedCard(nextExpandedCard);
328
364
  setMenuOpenFor(null);
329
365
  if (commentId_0 !== void 0) onCommentClick?.(nextExpandedCard === null && activeCommentId === commentId_0 ? null : commentId_0);
366
+ if (isDrawer && commentId_0 !== void 0 && nextExpandedCard !== null) revealAnchor(cardId_0);
367
+ };
368
+ const revealAnchor = (cardId_1) => {
369
+ const scrollEl_1 = editorContainerRef?.current;
370
+ const anchorY = lastKnownCardPositionsRef.current.get(cardId_1) ?? anchorPositions?.get(cardId_1);
371
+ if (!scrollEl_1 || anchorY === void 0) return;
372
+ scrollEl_1.scrollTop = Math.max(0, anchorY - scrollEl_1.clientHeight / 3);
330
373
  };
331
- const hasPositions = cardPositions.size > 0;
374
+ const hasPositions = !isDrawer && cardPositions.size > 0;
332
375
  const avatarStyle = (name, size = 28) => ({
333
376
  width: size,
334
377
  height: size,
@@ -354,9 +397,9 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
354
397
  fontWeight: 500,
355
398
  fontFamily: "inherit"
356
399
  });
357
- const cardContainerStyle = (cardId_1, isExpanded, yPos) => {
358
- const isKnown = knownCardsRef.current.has(cardId_1);
359
- if (yPos !== void 0) knownCardsRef.current.add(cardId_1);
400
+ const cardContainerStyle = (cardId_2, isExpanded, yPos) => {
401
+ const isKnown = knownCardsRef.current.has(cardId_2);
402
+ if (yPos !== void 0) knownCardsRef.current.add(cardId_2);
360
403
  const isNewCard = !isKnown && yPos !== void 0;
361
404
  const noPosition = hasPositions && yPos === void 0;
362
405
  const positionStyle = (() => {
@@ -542,24 +585,24 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
542
585
  });
543
586
  const renderCommentCard = (comment_0) => {
544
587
  const replies_0 = getReplies(comment_0.id);
545
- const cardId_2 = `comment-${comment_0.id}`;
546
- const isExpanded_1 = expandedCard === cardId_2;
588
+ const cardId_3 = `comment-${comment_0.id}`;
589
+ const isExpanded_1 = expandedCard === cardId_3;
547
590
  const isActive = activeCommentId === comment_0.id;
548
- const yPos_0 = cardPositions.get(cardId_2) ?? lastKnownCardPositionsRef.current.get(cardId_2);
591
+ const yPos_0 = cardPositions.get(cardId_3) ?? lastKnownCardPositionsRef.current.get(cardId_3);
549
592
  return /* @__PURE__ */ jsxs("div", {
550
593
  ref: (el_3) => {
551
- if (el_3) cardRefs.current.set(cardId_2, el_3);
552
- else cardRefs.current.delete(cardId_2);
594
+ if (el_3) cardRefs.current.set(cardId_3, el_3);
595
+ else cardRefs.current.delete(cardId_3);
553
596
  },
554
597
  "data-comment-id": comment_0.id,
555
598
  className: "docx-comment-card",
556
- onClick: containedHandler(() => handleCardClick(cardId_2, comment_0.id)),
599
+ onClick: containedHandler(() => handleCardClick(cardId_3, comment_0.id)),
557
600
  onKeyDown: (e_9) => {
558
- if (e_9.key === "Enter" || e_9.key === " ") handleCardClick(cardId_2, comment_0.id);
601
+ if (e_9.key === "Enter" || e_9.key === " ") handleCardClick(cardId_3, comment_0.id);
559
602
  },
560
603
  onMouseDown: containedHandler((e_10) => e_10.stopPropagation()),
561
604
  style: {
562
- ...cardContainerStyle(cardId_2, isExpanded_1, yPos_0),
605
+ ...cardContainerStyle(cardId_3, isExpanded_1, yPos_0),
563
606
  opacity: comment_0.done ? .6 : 1,
564
607
  outline: isActive ? "2px solid var(--doc-primary, var(--primary))" : "none",
565
608
  outlineOffset: 2
@@ -618,13 +661,13 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
618
661
  type: "button",
619
662
  onClick: (e_12) => {
620
663
  e_12.stopPropagation();
621
- setMenuOpenFor(menuOpenFor === cardId_2 ? null : cardId_2);
664
+ setMenuOpenFor(menuOpenFor === cardId_3 ? null : cardId_3);
622
665
  },
623
666
  title: "More options",
624
667
  style: ICON_BUTTON_STYLE,
625
668
  children: /* @__PURE__ */ jsx(MoreVerticalIcon, { size: 16 })
626
669
  }),
627
- menuOpenFor === cardId_2 && /* @__PURE__ */ jsx("div", {
670
+ menuOpenFor === cardId_3 && /* @__PURE__ */ jsx("div", {
628
671
  onClick: (e_13) => e_13.stopPropagation(),
629
672
  onKeyDown: (e_14) => e_14.stopPropagation(),
630
673
  onMouseDown: (e_15) => e_15.stopPropagation(),
@@ -695,25 +738,35 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
695
738
  return /* @__PURE__ */ jsx("aside", {
696
739
  ref: sidebarRef,
697
740
  className: "docx-comments-sidebar",
698
- "aria-label": "Comments",
741
+ "aria-label": t("comments.visibility"),
742
+ "data-folio-comments-surface": surface,
743
+ "data-testid": "folio-comments",
744
+ tabIndex: isDrawer ? -1 : void 0,
699
745
  style: {
700
746
  position: "absolute",
701
- top: topOffset,
702
- left: measuredLeft ?? `calc(50% - 120px + ${pageWidth / 2 + 12}px)`,
747
+ top: isDrawer ? drawerBox.top : topOffset,
748
+ left: measuredLeft ?? `calc(50% - 120px + ${pageWidth / 2 + PANEL_METRICS.commentsGap}px)`,
703
749
  bottom: 0,
704
- width: 280,
750
+ width: isDrawer ? drawerBox.width : SIDEBAR_WIDTH,
705
751
  fontFamily: "inherit",
706
- zIndex: 40,
707
- backgroundColor: "transparent",
752
+ zIndex: isDrawer ? 46 : 40,
708
753
  overflowY: "visible",
709
754
  overflowX: "visible",
710
- opacity: initialPositionsDone || cardPositions.size > 0 ? 1 : 0,
711
- pointerEvents: initialPositionsDone || cardPositions.size > 0 ? "auto" : "none",
712
- transition: "opacity 0.15s ease"
755
+ opacity: isDrawer || initialPositionsDone || cardPositions.size > 0 ? 1 : 0,
756
+ pointerEvents: isDrawer || initialPositionsDone || cardPositions.size > 0 ? "auto" : "none",
757
+ transition: "opacity 0.15s ease",
758
+ ...isDrawer ? DRAWER_SURFACE_STYLE : COLUMN_SURFACE_STYLE
713
759
  },
714
760
  onMouseDown: containedHandler((e_20) => e_20.stopPropagation()),
715
761
  children: /* @__PURE__ */ jsxs("div", {
716
- style: { position: "relative" },
762
+ style: isDrawer ? {
763
+ position: "sticky",
764
+ top: 0,
765
+ maxHeight: drawerBox.height || void 0,
766
+ overflowY: "auto",
767
+ paddingBlock: PANEL_METRICS.commentsGap,
768
+ boxSizing: "border-box"
769
+ } : { position: "relative" },
717
770
  children: [
718
771
  isAddingComment && /* @__PURE__ */ jsxs("div", {
719
772
  ref: (el_4) => {
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
2
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
3
3
  import React, { useCallback, useEffect, useRef, useState } from "react";
4
4
  import { ChevronDownIcon, ChevronUpIcon, SearchIcon, XIcon } from "lucide-react";
5
5
  import { useTranslations } from "use-intl";
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
2
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
3
3
  import { u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
4
4
  import { c } from "react-compiler-runtime";
5
5
  import { useId, useState } from "react";
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
2
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
3
3
  import { u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
4
4
  import { c } from "react-compiler-runtime";
5
5
  import { useEffect, useId, useState } from "react";
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
2
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
3
3
  import { u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
4
4
  import { c } from "react-compiler-runtime";
5
5
  import { useEffect, useId, useState } from "react";
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
2
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
3
3
  import { c as DIALOG_SECONDARY_BUTTON_CLASS, i as DIALOG_INPUT_CLASS, l as DIALOG_TITLE_CLASS, n as DIALOG_BODY_CLASS, o as DIALOG_POPUP_CLASS, r as DIALOG_FOOTER_CLASS, s as DIALOG_PRIMARY_BUTTON_CLASS, t as DIALOG_BACKDROP_CLASS, u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
4
4
  import { c } from "react-compiler-runtime";
5
5
  import { useState } from "react";
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
2
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
3
3
  import { u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
4
4
  import { c } from "react-compiler-runtime";
5
5
  import { useEffect, useId, useState } from "react";
@@ -0,0 +1,237 @@
1
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
2
+ import { a as DIALOG_LABEL_CLASS, c as DIALOG_SECONDARY_BUTTON_CLASS, i as DIALOG_INPUT_CLASS, l as DIALOG_TITLE_CLASS, n as DIALOG_BODY_CLASS, o as DIALOG_POPUP_CLASS, r as DIALOG_FOOTER_CLASS, s as DIALOG_PRIMARY_BUTTON_CLASS, t as DIALOG_BACKDROP_CLASS, u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
3
+ import { c } from "react-compiler-runtime";
4
+ import { useEffect, useId, useState } from "react";
5
+ import { useTranslations } from "use-intl";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/dialogs/SetNumberingValueDialog.tsx
8
+ /** `w:startOverride` is a non-negative decimal; the input stops far below its limit. */
9
+ const MIN_VALUE = 0;
10
+ const MAX_VALUE = 32767;
11
+ const DEFAULT_VALUE = 1;
12
+ /** *Set Numbering Value*: start the selected item's list over at a value. */
13
+ function SetNumberingValueDialog(t0) {
14
+ const $ = c(62);
15
+ const { isOpen, onClose, onApply } = t0;
16
+ const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
17
+ const handleOpenChange = useCloseOnDialogOpenChange(onClose);
18
+ const t = useTranslations("folio");
19
+ const id = useId();
20
+ const [text, setText] = useState(String(DEFAULT_VALUE));
21
+ let t1;
22
+ let t2;
23
+ if ($[0] !== isOpen) {
24
+ t1 = () => {
25
+ if (isOpen) setText(String(DEFAULT_VALUE));
26
+ };
27
+ t2 = [isOpen];
28
+ $[0] = isOpen;
29
+ $[1] = t1;
30
+ $[2] = t2;
31
+ } else {
32
+ t1 = $[1];
33
+ t2 = $[2];
34
+ }
35
+ useEffect(t1, t2);
36
+ const inputId = `${id}-numbering-value`;
37
+ let t3;
38
+ if ($[3] !== text) {
39
+ t3 = text.trim() === "" ? NaN : Number(text);
40
+ $[3] = text;
41
+ $[4] = t3;
42
+ } else t3 = $[4];
43
+ const parsed = t3;
44
+ let t4;
45
+ if ($[5] !== parsed) {
46
+ t4 = Number.isFinite(parsed);
47
+ $[5] = parsed;
48
+ $[6] = t4;
49
+ } else t4 = $[6];
50
+ const valid = t4;
51
+ let t5;
52
+ if ($[7] !== onApply || $[8] !== onClose || $[9] !== parsed || $[10] !== valid) {
53
+ t5 = () => {
54
+ if (!valid) return;
55
+ onApply(Math.min(MAX_VALUE, Math.max(MIN_VALUE, Math.trunc(parsed))));
56
+ onClose();
57
+ };
58
+ $[7] = onApply;
59
+ $[8] = onClose;
60
+ $[9] = parsed;
61
+ $[10] = valid;
62
+ $[11] = t5;
63
+ } else t5 = $[11];
64
+ const apply = t5;
65
+ let t6;
66
+ if ($[12] !== DialogBackdrop) {
67
+ t6 = /* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS });
68
+ $[12] = DialogBackdrop;
69
+ $[13] = t6;
70
+ } else t6 = $[13];
71
+ let t7;
72
+ if ($[14] !== t) {
73
+ t7 = t("dialogs.setNumberingValue.title");
74
+ $[14] = t;
75
+ $[15] = t7;
76
+ } else t7 = $[15];
77
+ let t8;
78
+ if ($[16] !== DialogTitle || $[17] !== t7) {
79
+ t8 = /* @__PURE__ */ jsx(DialogTitle, {
80
+ className: DIALOG_TITLE_CLASS,
81
+ children: t7
82
+ });
83
+ $[16] = DialogTitle;
84
+ $[17] = t7;
85
+ $[18] = t8;
86
+ } else t8 = $[18];
87
+ let t9;
88
+ if ($[19] !== t) {
89
+ t9 = t("dialogs.setNumberingValue.valueLabel");
90
+ $[19] = t;
91
+ $[20] = t9;
92
+ } else t9 = $[20];
93
+ let t10;
94
+ if ($[21] !== t9) {
95
+ t10 = /* @__PURE__ */ jsx("span", {
96
+ className: DIALOG_LABEL_CLASS,
97
+ children: t9
98
+ });
99
+ $[21] = t9;
100
+ $[22] = t10;
101
+ } else t10 = $[22];
102
+ let t11;
103
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
104
+ t11 = (event) => setText(event.target.value);
105
+ $[23] = t11;
106
+ } else t11 = $[23];
107
+ let t12;
108
+ if ($[24] !== apply) {
109
+ t12 = (event_0) => {
110
+ if (event_0.key === "Enter") {
111
+ event_0.preventDefault();
112
+ apply();
113
+ }
114
+ };
115
+ $[24] = apply;
116
+ $[25] = t12;
117
+ } else t12 = $[25];
118
+ let t13;
119
+ if ($[26] !== inputId || $[27] !== t12 || $[28] !== text) {
120
+ t13 = /* @__PURE__ */ jsx("input", {
121
+ className: DIALOG_INPUT_CLASS,
122
+ id: inputId,
123
+ max: MAX_VALUE,
124
+ min: MIN_VALUE,
125
+ onChange: t11,
126
+ onKeyDown: t12,
127
+ type: "number",
128
+ value: text
129
+ });
130
+ $[26] = inputId;
131
+ $[27] = t12;
132
+ $[28] = text;
133
+ $[29] = t13;
134
+ } else t13 = $[29];
135
+ let t14;
136
+ if ($[30] !== inputId || $[31] !== t10 || $[32] !== t13) {
137
+ t14 = /* @__PURE__ */ jsx("div", {
138
+ className: DIALOG_BODY_CLASS,
139
+ children: /* @__PURE__ */ jsxs("label", {
140
+ className: "flex flex-col gap-1",
141
+ htmlFor: inputId,
142
+ children: [t10, t13]
143
+ })
144
+ });
145
+ $[30] = inputId;
146
+ $[31] = t10;
147
+ $[32] = t13;
148
+ $[33] = t14;
149
+ } else t14 = $[33];
150
+ let t15;
151
+ if ($[34] !== t) {
152
+ t15 = t("common.cancel");
153
+ $[34] = t;
154
+ $[35] = t15;
155
+ } else t15 = $[35];
156
+ let t16;
157
+ if ($[36] !== DialogClose || $[37] !== t15) {
158
+ t16 = /* @__PURE__ */ jsx(DialogClose, {
159
+ className: DIALOG_SECONDARY_BUTTON_CLASS,
160
+ children: t15
161
+ });
162
+ $[36] = DialogClose;
163
+ $[37] = t15;
164
+ $[38] = t16;
165
+ } else t16 = $[38];
166
+ const t17 = !valid;
167
+ let t18;
168
+ if ($[39] !== t) {
169
+ t18 = t("common.apply");
170
+ $[39] = t;
171
+ $[40] = t18;
172
+ } else t18 = $[40];
173
+ let t19;
174
+ if ($[41] !== apply || $[42] !== t17 || $[43] !== t18) {
175
+ t19 = /* @__PURE__ */ jsx("button", {
176
+ className: DIALOG_PRIMARY_BUTTON_CLASS,
177
+ disabled: t17,
178
+ onClick: apply,
179
+ type: "button",
180
+ children: t18
181
+ });
182
+ $[41] = apply;
183
+ $[42] = t17;
184
+ $[43] = t18;
185
+ $[44] = t19;
186
+ } else t19 = $[44];
187
+ let t20;
188
+ if ($[45] !== t16 || $[46] !== t19) {
189
+ t20 = /* @__PURE__ */ jsxs("div", {
190
+ className: DIALOG_FOOTER_CLASS,
191
+ children: [t16, t19]
192
+ });
193
+ $[45] = t16;
194
+ $[46] = t19;
195
+ $[47] = t20;
196
+ } else t20 = $[47];
197
+ let t21;
198
+ if ($[48] !== DialogPopup || $[49] !== t14 || $[50] !== t20 || $[51] !== t8) {
199
+ t21 = /* @__PURE__ */ jsxs(DialogPopup, {
200
+ className: DIALOG_POPUP_CLASS,
201
+ children: [
202
+ t8,
203
+ t14,
204
+ t20
205
+ ]
206
+ });
207
+ $[48] = DialogPopup;
208
+ $[49] = t14;
209
+ $[50] = t20;
210
+ $[51] = t8;
211
+ $[52] = t21;
212
+ } else t21 = $[52];
213
+ let t22;
214
+ if ($[53] !== DialogPortal || $[54] !== t21 || $[55] !== t6) {
215
+ t22 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t6, t21] });
216
+ $[53] = DialogPortal;
217
+ $[54] = t21;
218
+ $[55] = t6;
219
+ $[56] = t22;
220
+ } else t22 = $[56];
221
+ let t23;
222
+ if ($[57] !== Dialog || $[58] !== handleOpenChange || $[59] !== isOpen || $[60] !== t22) {
223
+ t23 = /* @__PURE__ */ jsx(Dialog, {
224
+ open: isOpen,
225
+ onOpenChange: handleOpenChange,
226
+ children: t22
227
+ });
228
+ $[57] = Dialog;
229
+ $[58] = handleOpenChange;
230
+ $[59] = isOpen;
231
+ $[60] = t22;
232
+ $[61] = t23;
233
+ } else t23 = $[61];
234
+ return t23;
235
+ }
236
+ //#endregion
237
+ export { SetNumberingValueDialog };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
2
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
3
3
  import { u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
4
4
  import { c } from "react-compiler-runtime";
5
5
  import { useEffect, useId, useState } from "react";
@@ -81,6 +81,9 @@ function getActionIcon(action) {
81
81
  case "addComment": return /* @__PURE__ */ jsx(MessageSquarePlus, { size: ICON_SIZE });
82
82
  case "acceptChange":
83
83
  case "rejectChange":
84
+ case "restartNumbering":
85
+ case "continueNumbering":
86
+ case "setNumberingValue":
84
87
  case "separator": return null;
85
88
  }
86
89
  }
@@ -302,7 +305,10 @@ const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipbo
302
305
  case "addColumnRight":
303
306
  case "deleteColumn":
304
307
  case "tableBordersAll":
305
- case "tableBordersNone": return false;
308
+ case "tableBordersNone":
309
+ case "restartNumbering":
310
+ case "continueNumbering":
311
+ case "setNumberingValue": return false;
306
312
  }
307
313
  })();
308
314
  const menuItem = {
@@ -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-D5OOIQRt.js";
1
+ import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-BYZY3FVx.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
@@ -1,4 +1,4 @@
1
- import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-CTnJ1YYt.js";
1
+ import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-CYQL2X5T.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";
@@ -1,4 +1,4 @@
1
- import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
1
+ import { r as useFolioUI } from "./folio-ui-DO95voaI.js";
2
2
  import { a as DIALOG_LABEL_CLASS, c as DIALOG_SECONDARY_BUTTON_CLASS, i as DIALOG_INPUT_CLASS, l as DIALOG_TITLE_CLASS, n as DIALOG_BODY_CLASS, o as DIALOG_POPUP_CLASS, r as DIALOG_FOOTER_CLASS, s as DIALOG_PRIMARY_BUTTON_CLASS, t as DIALOG_BACKDROP_CLASS, u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
3
3
  import { c } from "react-compiler-runtime";
4
4
  import { useEffect, useId, useState } from "react";
package/dist/dialogs.js CHANGED
@@ -1,9 +1,9 @@
1
- import { t as FindReplaceDialog } from "./FindReplaceDialog-CqKK82nE.js";
2
- import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-CixRdIiT.js";
3
- import { a as InsertImageDialog, i as InsertTableDialog, n as SplitCellDialog, o as HyperlinkDialog, r as PasteSpecialDialog, t as WatermarkDialog } from "./dialogs-CB49Gr8j.js";
4
- import { t as ImagePositionDialog } from "./ImagePositionDialog-DNodkoI2.js";
5
- import { t as ImagePropertiesDialog } from "./ImagePropertiesDialog-CLsDIUWb.js";
6
- import { t as InsertSymbolDialog } from "./InsertSymbolDialog-DCFLmfzn.js";
7
- import { t as PageSetupDialog } from "./PageSetupDialog-COkgeOQn.js";
8
- import { t as TablePropertiesDialog } from "./TablePropertiesDialog-DOUiX1KZ.js";
1
+ import { t as FindReplaceDialog } from "./FindReplaceDialog-BUwFQWaq.js";
2
+ import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-6XdO0zBH.js";
3
+ import { a as InsertImageDialog, i as InsertTableDialog, n as SplitCellDialog, o as HyperlinkDialog, r as PasteSpecialDialog, t as WatermarkDialog } from "./dialogs-Dzu4hqRp.js";
4
+ import { t as ImagePositionDialog } from "./ImagePositionDialog-9q71ka9N.js";
5
+ import { t as ImagePropertiesDialog } from "./ImagePropertiesDialog-o79NCGk7.js";
6
+ import { t as InsertSymbolDialog } from "./InsertSymbolDialog-Cn_Nifhg.js";
7
+ import { t as PageSetupDialog } from "./PageSetupDialog-CMdVXCZ-.js";
8
+ import { t as TablePropertiesDialog } from "./TablePropertiesDialog-DwPiUj4m.js";
9
9
  export { FindReplaceDialog, FootnotePropertiesDialog, HyperlinkDialog, ImagePositionDialog, ImagePropertiesDialog, InsertImageDialog, InsertSymbolDialog, InsertTableDialog, PageSetupDialog, PasteSpecialDialog, SplitCellDialog, TablePropertiesDialog, WatermarkDialog };