@beyondwork/docx-react-component 1.0.132 → 1.0.133
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/api/public-types.cjs +158 -67
- package/dist/api/public-types.d.cts +1 -1
- package/dist/api/public-types.d.ts +1 -1
- package/dist/api/public-types.js +3 -3
- package/dist/api/v3.cjs +9326 -7478
- package/dist/api/v3.d.cts +2 -2
- package/dist/api/v3.d.ts +2 -2
- package/dist/api/v3.js +10 -10
- package/dist/{chunk-XYTWOJII.js → chunk-224TSMEB.js} +635 -89
- package/dist/{chunk-43JAPM2F.js → chunk-3JEE5RJU.js} +92 -131
- package/dist/{chunk-UP2KDOYE.js → chunk-57HTKX3P.js} +6 -2
- package/dist/{chunk-RYMMKOFI.js → chunk-5KTJKTNE.js} +32 -0
- package/dist/{chunk-LPLJZJT2.js → chunk-CVSD3UNK.js} +128 -69
- package/dist/{chunk-JVTDBX67.js → chunk-EFEW7BTT.js} +2 -2
- package/dist/{chunk-UFPBYJMA.js → chunk-INLRCC4N.js} +2 -2
- package/dist/{chunk-6736GA6J.js → chunk-KL4TZSZV.js} +1 -1
- package/dist/{chunk-N5FTU4HZ.js → chunk-MQ5GAJ54.js} +68 -39
- package/dist/{chunk-W2I47J2Q.js → chunk-NJFKPDNG.js} +216 -2
- package/dist/{chunk-YUHNDEV5.js → chunk-OTRVGNZQ.js} +2934 -1815
- package/dist/{chunk-4HGFJ6Z2.js → chunk-PZIEOEJZ.js} +1 -1
- package/dist/{chunk-C5LXKR54.js → chunk-QTRJLKR2.js} +1 -1
- package/dist/{chunk-SZ6BJA4Q.js → chunk-REFHJ2FN.js} +3 -3
- package/dist/{chunk-ZDYGRO2Z.js → chunk-RP76USJE.js} +1 -1
- package/dist/{chunk-QUTVR72L.js → chunk-S3PEKX6H.js} +246 -43
- package/dist/{chunk-RBWJHRNP.js → chunk-T66OS7MN.js} +8 -3
- package/dist/{chunk-ALWXYGXP.js → chunk-V2JF42SI.js} +2 -2
- package/dist/{chunk-6TLZ6CMP.js → chunk-WDDFU2N2.js} +2 -2
- package/dist/{chunk-U3UMKA7B.js → chunk-XBQFDBXE.js} +1 -1
- package/dist/{chunk-CDEZGLQ3.js → chunk-ZFCZ7XXH.js} +1 -1
- package/dist/core/commands/formatting-commands.d.cts +1 -1
- package/dist/core/commands/formatting-commands.d.ts +1 -1
- package/dist/core/commands/image-commands.cjs +32 -0
- package/dist/core/commands/image-commands.d.cts +1 -1
- package/dist/core/commands/image-commands.d.ts +1 -1
- package/dist/core/commands/image-commands.js +5 -5
- package/dist/core/commands/section-layout-commands.d.cts +1 -1
- package/dist/core/commands/section-layout-commands.d.ts +1 -1
- package/dist/core/commands/style-commands.d.cts +1 -1
- package/dist/core/commands/style-commands.d.ts +1 -1
- package/dist/core/commands/table-structure-commands.cjs +32 -0
- package/dist/core/commands/table-structure-commands.d.cts +1 -1
- package/dist/core/commands/table-structure-commands.d.ts +1 -1
- package/dist/core/commands/table-structure-commands.js +4 -4
- package/dist/core/commands/text-commands.cjs +99 -38
- package/dist/core/commands/text-commands.d.cts +12 -1
- package/dist/core/commands/text-commands.d.ts +12 -1
- package/dist/core/commands/text-commands.js +5 -5
- package/dist/core/selection/mapping.d.cts +1 -1
- package/dist/core/selection/mapping.d.ts +1 -1
- package/dist/core/state/editor-state.d.cts +1 -1
- package/dist/core/state/editor-state.d.ts +1 -1
- package/dist/index.cjs +4827 -2434
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +292 -53
- package/dist/io/docx-session.cjs +7 -2
- package/dist/io/docx-session.d.cts +3 -3
- package/dist/io/docx-session.d.ts +3 -3
- package/dist/io/docx-session.js +4 -4
- package/dist/legal.js +3 -3
- package/dist/{loader-MAa8VpzW.d.cts → loader-B2H99237.d.cts} +2 -2
- package/dist/{loader-CfpeEPAa.d.ts → loader-DfTjqVwn.d.ts} +2 -2
- package/dist/{public-types-Cjs8glST.d.ts → public-types-B5lOUIrP.d.ts} +689 -232
- package/dist/{public-types-KBS6JnOs.d.cts → public-types-S8gTYwKo.d.cts} +689 -232
- package/dist/public-types.cjs +158 -67
- package/dist/public-types.d.cts +1 -1
- package/dist/public-types.d.ts +1 -1
- package/dist/public-types.js +3 -3
- package/dist/runtime/collab.d.cts +2 -2
- package/dist/runtime/collab.d.ts +2 -2
- package/dist/runtime/document-runtime.cjs +1032 -416
- package/dist/runtime/document-runtime.d.cts +1 -1
- package/dist/runtime/document-runtime.d.ts +1 -1
- package/dist/runtime/document-runtime.js +14 -14
- package/dist/{session-CkoH8FoY.d.ts → session-CBDIOYXA.d.ts} +2 -2
- package/dist/{session-wwe0Gib-.d.cts → session-CR2A1hGZ.d.cts} +2 -2
- package/dist/session.cjs +7 -2
- package/dist/session.d.cts +4 -4
- package/dist/session.d.ts +4 -4
- package/dist/session.js +5 -5
- package/dist/tailwind.cjs +398 -105
- package/dist/tailwind.d.cts +1 -1
- package/dist/tailwind.d.ts +1 -1
- package/dist/tailwind.js +7 -7
- package/dist/{types-CH7NWqVL.d.ts → types-B-90ywjU.d.ts} +1 -1
- package/dist/{types-B3SGRW0w.d.cts → types-yty2K-hk.d.cts} +1 -1
- package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +2 -2
- package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +2 -2
- package/dist/ui-tailwind/editor-surface/search-plugin.js +4 -4
- package/dist/ui-tailwind.cjs +398 -105
- package/dist/ui-tailwind.d.cts +3 -2
- package/dist/ui-tailwind.d.ts +3 -2
- package/dist/ui-tailwind.js +7 -7
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-Y4XZCMCS.js";
|
|
4
4
|
import {
|
|
5
5
|
applyTextTransaction
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MQ5GAJ54.js";
|
|
7
7
|
import {
|
|
8
8
|
createInsertedTableBlock,
|
|
9
9
|
createNoopStructuralMutation,
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
replaceParagraphScope,
|
|
12
12
|
resolveInsertedTableStyleId,
|
|
13
13
|
resolveParagraphScope
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QTRJLKR2.js";
|
|
15
15
|
import {
|
|
16
16
|
NO_EDITABLE_TARGETS_INDEX,
|
|
17
17
|
createEditorSurfaceSnapshot
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XBQFDBXE.js";
|
|
19
19
|
import {
|
|
20
20
|
createSelectionSnapshot
|
|
21
21
|
} from "./chunk-OYGMRRR7.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolvePageOverlayRectsFromGeometry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-57HTKX3P.js";
|
|
4
4
|
import {
|
|
5
5
|
buildPageAnchorAttributes,
|
|
6
6
|
buildPageAnchorSelector,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resolveChromePreset,
|
|
9
9
|
resolveChromePresetOptions,
|
|
10
10
|
resolveChromeVisibilityForPreset
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NJFKPDNG.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_PAGE_ESTIMATE_PX_PER_TWIP,
|
|
14
14
|
DEFAULT_PX_PER_TWIP,
|
|
@@ -20,19 +20,19 @@ import {
|
|
|
20
20
|
incrementInvalidationCounter,
|
|
21
21
|
recordPerfSample,
|
|
22
22
|
sanitizeMarkdown
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CVSD3UNK.js";
|
|
24
24
|
import {
|
|
25
25
|
createCanvasBackend
|
|
26
26
|
} from "./chunk-OVLZQ6FZ.js";
|
|
27
27
|
import {
|
|
28
28
|
storyTargetKey
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XBQFDBXE.js";
|
|
30
30
|
import {
|
|
31
31
|
EMU_PER_INCH,
|
|
32
32
|
EMU_PER_PX,
|
|
33
33
|
ROTATION_UNITS_PER_DEGREE,
|
|
34
34
|
TWIPS_PER_PX
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-5KTJKTNE.js";
|
|
36
36
|
import {
|
|
37
37
|
createPublicNodeAnchor,
|
|
38
38
|
createPublicRangeAnchor
|
|
@@ -1870,6 +1870,43 @@ function TwToolbar(props) {
|
|
|
1870
1870
|
const showPostFormattingDivider = showListActionsInRow || showSpacingActionsInRow || showInsertActionsInRow || showUpdateActionsInRow || showCompactOverflow;
|
|
1871
1871
|
const zoomLabel = typeof zoomLevel === "number" ? `${zoomLevel}%` : zoomLevel === "pageWidth" ? "Fit width" : "Fit page";
|
|
1872
1872
|
const showZoomSteppers = responsiveTier === "wide";
|
|
1873
|
+
const bulletedListState = resolveListCommandControl({
|
|
1874
|
+
canEdit,
|
|
1875
|
+
editDisabledReason,
|
|
1876
|
+
callback: props.onToggleBulletedList,
|
|
1877
|
+
availability: getListCommandAvailability(props.activeListReadback, "toggle-bulleted")
|
|
1878
|
+
});
|
|
1879
|
+
const numberedListState = resolveListCommandControl({
|
|
1880
|
+
canEdit,
|
|
1881
|
+
editDisabledReason,
|
|
1882
|
+
callback: props.onToggleNumberedList,
|
|
1883
|
+
availability: getListCommandAvailability(props.activeListReadback, "toggle-numbered")
|
|
1884
|
+
});
|
|
1885
|
+
const outdentState = resolveListCommandControl({
|
|
1886
|
+
canEdit,
|
|
1887
|
+
editDisabledReason,
|
|
1888
|
+
callback: props.onOutdent,
|
|
1889
|
+
availability: getListCommandAvailability(props.activeListReadback, "outdent")
|
|
1890
|
+
});
|
|
1891
|
+
const indentState = resolveListCommandControl({
|
|
1892
|
+
canEdit,
|
|
1893
|
+
editDisabledReason,
|
|
1894
|
+
callback: props.onIndent,
|
|
1895
|
+
availability: getListCommandAvailability(props.activeListReadback, "indent")
|
|
1896
|
+
});
|
|
1897
|
+
const restartNumberingState = resolveListCommandControl({
|
|
1898
|
+
canEdit,
|
|
1899
|
+
editDisabledReason,
|
|
1900
|
+
callback: props.onRestartNumbering,
|
|
1901
|
+
availability: getListCommandAvailability(props.activeListReadback, "restart-numbering")
|
|
1902
|
+
});
|
|
1903
|
+
const continueNumberingState = resolveListCommandControl({
|
|
1904
|
+
canEdit,
|
|
1905
|
+
editDisabledReason,
|
|
1906
|
+
callback: props.onContinueNumbering,
|
|
1907
|
+
availability: getListCommandAvailability(props.activeListReadback, "continue-numbering")
|
|
1908
|
+
});
|
|
1909
|
+
const activeListKind = props.activeListReadback?.listKind;
|
|
1873
1910
|
return /* @__PURE__ */ jsxs6(
|
|
1874
1911
|
"header",
|
|
1875
1912
|
{
|
|
@@ -1885,7 +1922,7 @@ function TwToolbar(props) {
|
|
|
1885
1922
|
},
|
|
1886
1923
|
className: [
|
|
1887
1924
|
"shrink-0 rounded-[var(--radius-sm)] border border-[var(--color-border-subtle)]",
|
|
1888
|
-
"bg-[var(--color-bg-chrome)] px-2.5",
|
|
1925
|
+
"bg-[var(--color-bg-chrome)] px-2.5 shadow-[var(--shadow-soft)]",
|
|
1889
1926
|
isCompact ? "flex min-h-10 flex-wrap items-center gap-1.5 py-1.5" : "flex items-center gap-1"
|
|
1890
1927
|
].join(" "),
|
|
1891
1928
|
children: [
|
|
@@ -2054,9 +2091,9 @@ function TwToolbar(props) {
|
|
|
2054
2091
|
{
|
|
2055
2092
|
icon: List,
|
|
2056
2093
|
label: "Bulleted list",
|
|
2057
|
-
active: Boolean(props.activeListContext && !props.activeListContext.isOrdered),
|
|
2058
|
-
disabled:
|
|
2059
|
-
disabledReason:
|
|
2094
|
+
active: activeListKind ? activeListKind === "bulleted" : Boolean(props.activeListContext && !props.activeListContext.isOrdered),
|
|
2095
|
+
disabled: bulletedListState.disabled,
|
|
2096
|
+
disabledReason: bulletedListState.disabledReason,
|
|
2060
2097
|
onClick: props.onToggleBulletedList
|
|
2061
2098
|
}
|
|
2062
2099
|
),
|
|
@@ -2065,9 +2102,9 @@ function TwToolbar(props) {
|
|
|
2065
2102
|
{
|
|
2066
2103
|
icon: Rows32,
|
|
2067
2104
|
label: "Numbered list",
|
|
2068
|
-
active: Boolean(props.activeListContext?.isOrdered),
|
|
2069
|
-
disabled:
|
|
2070
|
-
disabledReason:
|
|
2105
|
+
active: activeListKind ? activeListKind === "numbered" : Boolean(props.activeListContext?.isOrdered),
|
|
2106
|
+
disabled: numberedListState.disabled,
|
|
2107
|
+
disabledReason: numberedListState.disabledReason,
|
|
2071
2108
|
onClick: props.onToggleNumberedList
|
|
2072
2109
|
}
|
|
2073
2110
|
)
|
|
@@ -2078,8 +2115,8 @@ function TwToolbar(props) {
|
|
|
2078
2115
|
{
|
|
2079
2116
|
icon: Outdent,
|
|
2080
2117
|
label: "Outdent",
|
|
2081
|
-
disabled:
|
|
2082
|
-
disabledReason:
|
|
2118
|
+
disabled: outdentState.disabled,
|
|
2119
|
+
disabledReason: outdentState.disabledReason,
|
|
2083
2120
|
onClick: props.onOutdent
|
|
2084
2121
|
}
|
|
2085
2122
|
),
|
|
@@ -2088,8 +2125,8 @@ function TwToolbar(props) {
|
|
|
2088
2125
|
{
|
|
2089
2126
|
icon: Indent,
|
|
2090
2127
|
label: "Indent",
|
|
2091
|
-
disabled:
|
|
2092
|
-
disabledReason:
|
|
2128
|
+
disabled: indentState.disabled,
|
|
2129
|
+
disabledReason: indentState.disabledReason,
|
|
2093
2130
|
onClick: props.onIndent
|
|
2094
2131
|
}
|
|
2095
2132
|
)
|
|
@@ -2099,8 +2136,8 @@ function TwToolbar(props) {
|
|
|
2099
2136
|
ToolbarTextButton,
|
|
2100
2137
|
{
|
|
2101
2138
|
ariaLabel: "Restart numbering",
|
|
2102
|
-
disabled:
|
|
2103
|
-
disabledReason:
|
|
2139
|
+
disabled: restartNumberingState.disabled,
|
|
2140
|
+
disabledReason: restartNumberingState.disabledReason,
|
|
2104
2141
|
onClick: props.onRestartNumbering,
|
|
2105
2142
|
children: "Restart"
|
|
2106
2143
|
}
|
|
@@ -2109,8 +2146,8 @@ function TwToolbar(props) {
|
|
|
2109
2146
|
ToolbarTextButton,
|
|
2110
2147
|
{
|
|
2111
2148
|
ariaLabel: "Continue numbering",
|
|
2112
|
-
disabled:
|
|
2113
|
-
disabledReason:
|
|
2149
|
+
disabled: continueNumberingState.disabled,
|
|
2150
|
+
disabledReason: continueNumberingState.disabledReason,
|
|
2114
2151
|
onClick: props.onContinueNumbering,
|
|
2115
2152
|
children: "Continue"
|
|
2116
2153
|
}
|
|
@@ -2154,6 +2191,7 @@ function TwToolbar(props) {
|
|
|
2154
2191
|
ToolbarCompactOverflow,
|
|
2155
2192
|
{
|
|
2156
2193
|
activeListContext: props.activeListContext,
|
|
2194
|
+
activeListReadback: props.activeListReadback,
|
|
2157
2195
|
canEdit,
|
|
2158
2196
|
canInsertStructural,
|
|
2159
2197
|
editDisabledReason,
|
|
@@ -2687,8 +2725,59 @@ function ToolbarFontSizeSelect(props) {
|
|
|
2687
2725
|
}
|
|
2688
2726
|
);
|
|
2689
2727
|
}
|
|
2728
|
+
function getListCommandAvailability(readback, command) {
|
|
2729
|
+
return readback?.commandSupport.find((entry) => entry.command === command);
|
|
2730
|
+
}
|
|
2731
|
+
function resolveListCommandControl(input) {
|
|
2732
|
+
if (!input.canEdit) {
|
|
2733
|
+
return { disabled: true, disabledReason: input.editDisabledReason };
|
|
2734
|
+
}
|
|
2735
|
+
if (!input.callback) {
|
|
2736
|
+
return { disabled: true };
|
|
2737
|
+
}
|
|
2738
|
+
if (input.availability?.enabled === false) {
|
|
2739
|
+
return { disabled: true, disabledReason: input.availability.reason };
|
|
2740
|
+
}
|
|
2741
|
+
return { disabled: false };
|
|
2742
|
+
}
|
|
2690
2743
|
function ToolbarCompactOverflow(props) {
|
|
2691
2744
|
const [open, setOpen] = React4.useState(false);
|
|
2745
|
+
const bulletedListState = resolveListCommandControl({
|
|
2746
|
+
canEdit: props.canEdit,
|
|
2747
|
+
editDisabledReason: props.editDisabledReason,
|
|
2748
|
+
callback: props.onToggleBulletedList,
|
|
2749
|
+
availability: getListCommandAvailability(props.activeListReadback, "toggle-bulleted")
|
|
2750
|
+
});
|
|
2751
|
+
const numberedListState = resolveListCommandControl({
|
|
2752
|
+
canEdit: props.canEdit,
|
|
2753
|
+
editDisabledReason: props.editDisabledReason,
|
|
2754
|
+
callback: props.onToggleNumberedList,
|
|
2755
|
+
availability: getListCommandAvailability(props.activeListReadback, "toggle-numbered")
|
|
2756
|
+
});
|
|
2757
|
+
const outdentState = resolveListCommandControl({
|
|
2758
|
+
canEdit: props.canEdit,
|
|
2759
|
+
editDisabledReason: props.editDisabledReason,
|
|
2760
|
+
callback: props.onOutdent,
|
|
2761
|
+
availability: getListCommandAvailability(props.activeListReadback, "outdent")
|
|
2762
|
+
});
|
|
2763
|
+
const indentState = resolveListCommandControl({
|
|
2764
|
+
canEdit: props.canEdit,
|
|
2765
|
+
editDisabledReason: props.editDisabledReason,
|
|
2766
|
+
callback: props.onIndent,
|
|
2767
|
+
availability: getListCommandAvailability(props.activeListReadback, "indent")
|
|
2768
|
+
});
|
|
2769
|
+
const restartNumberingState = resolveListCommandControl({
|
|
2770
|
+
canEdit: props.canEdit,
|
|
2771
|
+
editDisabledReason: props.editDisabledReason,
|
|
2772
|
+
callback: props.onRestartNumbering,
|
|
2773
|
+
availability: getListCommandAvailability(props.activeListReadback, "restart-numbering")
|
|
2774
|
+
});
|
|
2775
|
+
const continueNumberingState = resolveListCommandControl({
|
|
2776
|
+
canEdit: props.canEdit,
|
|
2777
|
+
editDisabledReason: props.editDisabledReason,
|
|
2778
|
+
callback: props.onContinueNumbering,
|
|
2779
|
+
availability: getListCommandAvailability(props.activeListReadback, "continue-numbering")
|
|
2780
|
+
});
|
|
2692
2781
|
const overflowGroups = [
|
|
2693
2782
|
props.showStyleSelectors || props.showInlineFormatting || props.showTextColors ? "Format" : null,
|
|
2694
2783
|
props.showListActions || props.showParagraphActions || props.showParagraphAlignment || props.showListContinuation ? "Paragraph" : null,
|
|
@@ -2905,8 +2994,8 @@ function ToolbarCompactOverflow(props) {
|
|
|
2905
2994
|
ToolbarMenuButton,
|
|
2906
2995
|
{
|
|
2907
2996
|
ariaLabel: "Bulleted list",
|
|
2908
|
-
disabled:
|
|
2909
|
-
disabledReason:
|
|
2997
|
+
disabled: bulletedListState.disabled,
|
|
2998
|
+
disabledReason: bulletedListState.disabledReason,
|
|
2910
2999
|
icon: /* @__PURE__ */ jsx6(List, { className: "h-3.5 w-3.5" }),
|
|
2911
3000
|
label: "Bulleted list",
|
|
2912
3001
|
onClick: () => {
|
|
@@ -2919,8 +3008,8 @@ function ToolbarCompactOverflow(props) {
|
|
|
2919
3008
|
ToolbarMenuButton,
|
|
2920
3009
|
{
|
|
2921
3010
|
ariaLabel: "Numbered list",
|
|
2922
|
-
disabled:
|
|
2923
|
-
disabledReason:
|
|
3011
|
+
disabled: numberedListState.disabled,
|
|
3012
|
+
disabledReason: numberedListState.disabledReason,
|
|
2924
3013
|
icon: /* @__PURE__ */ jsx6(Rows32, { className: "h-3.5 w-3.5" }),
|
|
2925
3014
|
label: "Numbered list",
|
|
2926
3015
|
onClick: () => {
|
|
@@ -2949,8 +3038,8 @@ function ToolbarCompactOverflow(props) {
|
|
|
2949
3038
|
ToolbarMenuButton,
|
|
2950
3039
|
{
|
|
2951
3040
|
ariaLabel: "Outdent",
|
|
2952
|
-
disabled:
|
|
2953
|
-
disabledReason:
|
|
3041
|
+
disabled: outdentState.disabled,
|
|
3042
|
+
disabledReason: outdentState.disabledReason,
|
|
2954
3043
|
icon: /* @__PURE__ */ jsx6(Outdent, { className: "h-3.5 w-3.5" }),
|
|
2955
3044
|
label: "Outdent",
|
|
2956
3045
|
onClick: () => {
|
|
@@ -2963,8 +3052,8 @@ function ToolbarCompactOverflow(props) {
|
|
|
2963
3052
|
ToolbarMenuButton,
|
|
2964
3053
|
{
|
|
2965
3054
|
ariaLabel: "Indent",
|
|
2966
|
-
disabled:
|
|
2967
|
-
disabledReason:
|
|
3055
|
+
disabled: indentState.disabled,
|
|
3056
|
+
disabledReason: indentState.disabledReason,
|
|
2968
3057
|
icon: /* @__PURE__ */ jsx6(Indent, { className: "h-3.5 w-3.5" }),
|
|
2969
3058
|
label: "Indent",
|
|
2970
3059
|
onClick: () => {
|
|
@@ -2979,8 +3068,8 @@ function ToolbarCompactOverflow(props) {
|
|
|
2979
3068
|
ToolbarMenuButton,
|
|
2980
3069
|
{
|
|
2981
3070
|
ariaLabel: "Restart numbering",
|
|
2982
|
-
disabled:
|
|
2983
|
-
disabledReason:
|
|
3071
|
+
disabled: restartNumberingState.disabled,
|
|
3072
|
+
disabledReason: restartNumberingState.disabledReason,
|
|
2984
3073
|
icon: /* @__PURE__ */ jsx6(Rows32, { className: "h-3.5 w-3.5" }),
|
|
2985
3074
|
label: "Restart numbering",
|
|
2986
3075
|
onClick: () => {
|
|
@@ -2993,8 +3082,8 @@ function ToolbarCompactOverflow(props) {
|
|
|
2993
3082
|
ToolbarMenuButton,
|
|
2994
3083
|
{
|
|
2995
3084
|
ariaLabel: "Continue numbering",
|
|
2996
|
-
disabled:
|
|
2997
|
-
disabledReason:
|
|
3085
|
+
disabled: continueNumberingState.disabled,
|
|
3086
|
+
disabledReason: continueNumberingState.disabledReason,
|
|
2998
3087
|
icon: /* @__PURE__ */ jsx6(Rows32, { className: "h-3.5 w-3.5" }),
|
|
2999
3088
|
label: "Continue numbering",
|
|
3000
3089
|
onClick: () => {
|
|
@@ -9043,6 +9132,18 @@ function emuToPx(emu, pxPerTwip) {
|
|
|
9043
9132
|
return emu / EMU_PER_PX * zoomFactor;
|
|
9044
9133
|
}
|
|
9045
9134
|
|
|
9135
|
+
// src/ui-tailwind/editor-surface/media-src-policy.ts
|
|
9136
|
+
var SAFE_DATA_IMAGE_PREFIX_RE = /^data:image\/(?:png|jpe?g|gif|webp|bmp);base64,/iu;
|
|
9137
|
+
var MAX_NUMBERING_PICTURE_BULLET_DATA_URL_LENGTH = 1024 * 1024;
|
|
9138
|
+
function sanitizeNumberingPictureBulletSrc(src) {
|
|
9139
|
+
if (typeof src !== "string") return null;
|
|
9140
|
+
const trimmed = src.trim();
|
|
9141
|
+
if (trimmed.length === 0) return null;
|
|
9142
|
+
if (trimmed.length > MAX_NUMBERING_PICTURE_BULLET_DATA_URL_LENGTH) return null;
|
|
9143
|
+
if (!SAFE_DATA_IMAGE_PREFIX_RE.test(trimmed)) return null;
|
|
9144
|
+
return trimmed;
|
|
9145
|
+
}
|
|
9146
|
+
|
|
9046
9147
|
// src/ui-tailwind/page-stack/tw-region-block-renderer.tsx
|
|
9047
9148
|
import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9048
9149
|
var EMU_PER_PX2 = 9525;
|
|
@@ -9157,6 +9258,10 @@ function renderSegment(seg, mediaPreviews, fallbackDisplay, tabInfoBySegment) {
|
|
|
9157
9258
|
"span",
|
|
9158
9259
|
{
|
|
9159
9260
|
"data-node-type": "field_ref",
|
|
9261
|
+
"data-generated-field": "true",
|
|
9262
|
+
"data-field-family": seg.fieldFamily,
|
|
9263
|
+
"data-field-target": seg.fieldTarget,
|
|
9264
|
+
"data-field-refresh-status": seg.refreshStatus,
|
|
9160
9265
|
style: { opacity: 0.6, fontSize: "0.85em" },
|
|
9161
9266
|
children: seg.displayText ?? seg.label
|
|
9162
9267
|
},
|
|
@@ -9206,6 +9311,9 @@ function RegionParagraph({
|
|
|
9206
9311
|
const markerWidth = resolvedNumbering?.geometry?.markerLane?.width;
|
|
9207
9312
|
const markerStart = resolvedNumbering?.geometry?.markerLane?.start;
|
|
9208
9313
|
const markerJustification = resolvedNumbering?.geometry?.markerJustification;
|
|
9314
|
+
const pictureBulletSrc = sanitizeNumberingPictureBulletSrc(
|
|
9315
|
+
resolvedNumbering?.picBulletMediaId ? mediaPreviews[resolvedNumbering.picBulletMediaId]?.src : null
|
|
9316
|
+
);
|
|
9209
9317
|
const prefixSpan = numberingPrefix != null ? /* @__PURE__ */ jsx29(
|
|
9210
9318
|
"span",
|
|
9211
9319
|
{
|
|
@@ -9216,7 +9324,9 @@ function RegionParagraph({
|
|
|
9216
9324
|
...!markerRunProperties ? ["text-tertiary", "font-[family-name:var(--font-legal-sans)]"] : []
|
|
9217
9325
|
].join(" "),
|
|
9218
9326
|
contentEditable: false,
|
|
9219
|
-
"data-numbering-
|
|
9327
|
+
"data-numbering-marker": "true",
|
|
9328
|
+
"data-numbering-prefix": pictureBulletSrc ? "" : numberingPrefix,
|
|
9329
|
+
...pictureBulletSrc ? { "data-numbering-picture-bullet": resolvedNumbering?.pictureBulletPosture?.status ?? "media-rendered" } : {},
|
|
9220
9330
|
...typeof resolvedNumbering?.level === "number" ? { "data-numbering-level": String(resolvedNumbering.level) } : {},
|
|
9221
9331
|
...numberingSuffix ? { "data-numbering-suffix": numberingSuffix } : {},
|
|
9222
9332
|
style: buildMarkerStyle(
|
|
@@ -9227,7 +9337,20 @@ function RegionParagraph({
|
|
|
9227
9337
|
markerStart,
|
|
9228
9338
|
markerJustification
|
|
9229
9339
|
),
|
|
9230
|
-
children:
|
|
9340
|
+
children: pictureBulletSrc ? /* @__PURE__ */ jsx29(
|
|
9341
|
+
"img",
|
|
9342
|
+
{
|
|
9343
|
+
src: pictureBulletSrc,
|
|
9344
|
+
alt: "",
|
|
9345
|
+
"aria-hidden": "true",
|
|
9346
|
+
style: {
|
|
9347
|
+
maxWidth: "100%",
|
|
9348
|
+
maxHeight: "100%",
|
|
9349
|
+
objectFit: "contain",
|
|
9350
|
+
display: "block"
|
|
9351
|
+
}
|
|
9352
|
+
}
|
|
9353
|
+
) : numberingPrefix
|
|
9231
9354
|
}
|
|
9232
9355
|
) : null;
|
|
9233
9356
|
const attrs = {
|
|
@@ -10945,7 +11068,17 @@ function TwSelectionToolStructure(props) {
|
|
|
10945
11068
|
onSetCellVerticalAlign: props.onSetCellVerticalAlign
|
|
10946
11069
|
}
|
|
10947
11070
|
);
|
|
10948
|
-
case "list":
|
|
11071
|
+
case "list": {
|
|
11072
|
+
const continueState = resolveListToolbarButtonState({
|
|
11073
|
+
canMutate: props.model.canMutate,
|
|
11074
|
+
callback: props.onContinueNumbering,
|
|
11075
|
+
availability: getListCommandAvailability2(props.activeListReadback, "continue-numbering")
|
|
11076
|
+
});
|
|
11077
|
+
const restartState = resolveListToolbarButtonState({
|
|
11078
|
+
canMutate: props.model.canMutate,
|
|
11079
|
+
callback: props.onRestartNumbering,
|
|
11080
|
+
availability: getListCommandAvailability2(props.activeListReadback, "restart-numbering")
|
|
11081
|
+
});
|
|
10949
11082
|
return /* @__PURE__ */ jsxs34(
|
|
10950
11083
|
"div",
|
|
10951
11084
|
{
|
|
@@ -10957,7 +11090,8 @@ function TwSelectionToolStructure(props) {
|
|
|
10957
11090
|
ToolbarButton3,
|
|
10958
11091
|
{
|
|
10959
11092
|
ariaLabel: "Continue numbering",
|
|
10960
|
-
disabled:
|
|
11093
|
+
disabled: continueState.disabled,
|
|
11094
|
+
disabledReason: continueState.disabledReason,
|
|
10961
11095
|
onClick: props.onContinueNumbering,
|
|
10962
11096
|
children: "Continue"
|
|
10963
11097
|
}
|
|
@@ -10966,7 +11100,8 @@ function TwSelectionToolStructure(props) {
|
|
|
10966
11100
|
ToolbarButton3,
|
|
10967
11101
|
{
|
|
10968
11102
|
ariaLabel: "Restart numbering",
|
|
10969
|
-
disabled:
|
|
11103
|
+
disabled: restartState.disabled,
|
|
11104
|
+
disabledReason: restartState.disabledReason,
|
|
10970
11105
|
onClick: props.onRestartNumbering,
|
|
10971
11106
|
children: "Restart"
|
|
10972
11107
|
}
|
|
@@ -10974,15 +11109,31 @@ function TwSelectionToolStructure(props) {
|
|
|
10974
11109
|
]
|
|
10975
11110
|
}
|
|
10976
11111
|
);
|
|
11112
|
+
}
|
|
11113
|
+
}
|
|
11114
|
+
}
|
|
11115
|
+
function getListCommandAvailability2(readback, command) {
|
|
11116
|
+
return readback?.commandSupport.find((entry) => entry.command === command);
|
|
11117
|
+
}
|
|
11118
|
+
function resolveListToolbarButtonState(input) {
|
|
11119
|
+
if (!input.canMutate || !input.callback) {
|
|
11120
|
+
return { disabled: true };
|
|
10977
11121
|
}
|
|
11122
|
+
if (input.availability?.enabled === false) {
|
|
11123
|
+
return { disabled: true, disabledReason: input.availability.reason };
|
|
11124
|
+
}
|
|
11125
|
+
return { disabled: false };
|
|
10978
11126
|
}
|
|
10979
11127
|
function ToolbarButton3(props) {
|
|
11128
|
+
const disabledReason = props.disabled && props.disabledReason ? props.disabledReason : void 0;
|
|
10980
11129
|
return /* @__PURE__ */ jsx43(
|
|
10981
11130
|
"button",
|
|
10982
11131
|
{
|
|
10983
11132
|
type: "button",
|
|
10984
11133
|
"aria-label": props.ariaLabel,
|
|
10985
11134
|
disabled: props.disabled,
|
|
11135
|
+
"data-disabled-reason": disabledReason,
|
|
11136
|
+
title: disabledReason ? `Not available: ${disabledReason}` : void 0,
|
|
10986
11137
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
10987
11138
|
onClick: props.onClick,
|
|
10988
11139
|
className: "inline-flex h-7 items-center rounded-md border border-border px-2 text-[length:var(--text-xs)] font-medium text-secondary transition-colors hover:bg-surface disabled:cursor-not-allowed disabled:opacity-40",
|
|
@@ -11371,6 +11522,7 @@ function renderTool(props, tool, density) {
|
|
|
11371
11522
|
onSetImageFrame: props.onSetImageFrame,
|
|
11372
11523
|
onRestartNumbering: props.onRestartNumbering,
|
|
11373
11524
|
onContinueNumbering: props.onContinueNumbering,
|
|
11525
|
+
activeListReadback: props.activeListReadback,
|
|
11374
11526
|
onToggleRowHeader: props.onToggleRowHeader,
|
|
11375
11527
|
onToggleRowCantSplit: props.onToggleRowCantSplit,
|
|
11376
11528
|
onDistributeColumnsEvenly: props.onDistributeColumnsEvenly,
|
|
@@ -11571,6 +11723,7 @@ var EDITOR_ACTION_REGISTRY = [
|
|
|
11571
11723
|
group: "clipboard",
|
|
11572
11724
|
targetKinds: [
|
|
11573
11725
|
"plain-text",
|
|
11726
|
+
"list-item",
|
|
11574
11727
|
"table-cell",
|
|
11575
11728
|
"image",
|
|
11576
11729
|
"hyperlink",
|
|
@@ -11589,9 +11742,11 @@ var EDITOR_ACTION_REGISTRY = [
|
|
|
11589
11742
|
group: "clipboard",
|
|
11590
11743
|
targetKinds: [
|
|
11591
11744
|
"plain-text",
|
|
11745
|
+
"list-item",
|
|
11592
11746
|
"table-cell",
|
|
11593
11747
|
"image",
|
|
11594
11748
|
"hyperlink",
|
|
11749
|
+
"generated-field",
|
|
11595
11750
|
"suggestion",
|
|
11596
11751
|
"comment-anchor",
|
|
11597
11752
|
"opaque-block",
|
|
@@ -11606,6 +11761,7 @@ var EDITOR_ACTION_REGISTRY = [
|
|
|
11606
11761
|
group: "clipboard",
|
|
11607
11762
|
targetKinds: [
|
|
11608
11763
|
"plain-text",
|
|
11764
|
+
"list-item",
|
|
11609
11765
|
"table-cell",
|
|
11610
11766
|
"hyperlink",
|
|
11611
11767
|
"suggestion",
|
|
@@ -11766,28 +11922,28 @@ var EDITOR_ACTION_REGISTRY = [
|
|
|
11766
11922
|
id: "list-bulleted",
|
|
11767
11923
|
label: "Bulleted list",
|
|
11768
11924
|
group: "formatting",
|
|
11769
|
-
targetKinds: ["plain-text", "table-cell"],
|
|
11925
|
+
targetKinds: ["list-item", "plain-text", "table-cell"],
|
|
11770
11926
|
callback: "onToggleBulletedList"
|
|
11771
11927
|
}),
|
|
11772
11928
|
mk({
|
|
11773
11929
|
id: "list-numbered",
|
|
11774
11930
|
label: "Numbered list",
|
|
11775
11931
|
group: "formatting",
|
|
11776
|
-
targetKinds: ["plain-text", "table-cell"],
|
|
11932
|
+
targetKinds: ["list-item", "plain-text", "table-cell"],
|
|
11777
11933
|
callback: "onToggleNumberedList"
|
|
11778
11934
|
}),
|
|
11779
11935
|
mk({
|
|
11780
11936
|
id: "paragraph-outdent",
|
|
11781
11937
|
label: "Decrease indent",
|
|
11782
11938
|
group: "formatting",
|
|
11783
|
-
targetKinds: ["plain-text", "table-cell"],
|
|
11939
|
+
targetKinds: ["list-item", "plain-text", "table-cell"],
|
|
11784
11940
|
callback: "onOutdent"
|
|
11785
11941
|
}),
|
|
11786
11942
|
mk({
|
|
11787
11943
|
id: "paragraph-indent",
|
|
11788
11944
|
label: "Increase indent",
|
|
11789
11945
|
group: "formatting",
|
|
11790
|
-
targetKinds: ["plain-text", "table-cell"],
|
|
11946
|
+
targetKinds: ["list-item", "plain-text", "table-cell"],
|
|
11791
11947
|
callback: "onIndent"
|
|
11792
11948
|
}),
|
|
11793
11949
|
mkArg({
|
|
@@ -12136,6 +12292,15 @@ var EDITOR_ACTION_REGISTRY = [
|
|
|
12136
12292
|
targetKinds: ["hyperlink"],
|
|
12137
12293
|
callback: "onOpenHyperlink"
|
|
12138
12294
|
}),
|
|
12295
|
+
// -------- Generated fields --------
|
|
12296
|
+
mk({
|
|
12297
|
+
id: "field-refresh",
|
|
12298
|
+
label: "Refresh field",
|
|
12299
|
+
description: "Refresh generated field results through the runtime field updater.",
|
|
12300
|
+
group: "misc",
|
|
12301
|
+
targetKinds: ["generated-field"],
|
|
12302
|
+
callback: "onUpdateFields"
|
|
12303
|
+
}),
|
|
12139
12304
|
// -------- Workflow scope --------
|
|
12140
12305
|
mk({
|
|
12141
12306
|
id: "scope-open-card",
|
|
@@ -12726,8 +12891,18 @@ function resolveTargetKind(target, options = {}) {
|
|
|
12726
12891
|
const el = toElement(target);
|
|
12727
12892
|
if (el) {
|
|
12728
12893
|
const { root } = options;
|
|
12894
|
+
const insideNumberingMarker = hasAncestorAttributeValue(
|
|
12895
|
+
el,
|
|
12896
|
+
"data-numbering-marker",
|
|
12897
|
+
"true",
|
|
12898
|
+
root
|
|
12899
|
+
);
|
|
12900
|
+
const insideListItem = insideNumberingMarker || hasAncestorAttributeValue(el, "data-numbered", "true", root);
|
|
12901
|
+
const insideGeneratedField = hasAncestorAttributeValue(el, "data-generated-field", "true", root) || hasAncestorAttributeValue(el, "data-node-type", "field_ref_atom", root) || hasAncestorAttributeValue(el, "data-node-type", "field_ref", root);
|
|
12902
|
+
if (insideListItem) kinds.push("list-item");
|
|
12903
|
+
if (insideGeneratedField) kinds.push("generated-field");
|
|
12729
12904
|
if (hasAncestorTag(el, "a", root)) kinds.push("hyperlink");
|
|
12730
|
-
if (hasAncestorTag(el, "img", root)) {
|
|
12905
|
+
if (!insideNumberingMarker && hasAncestorTag(el, "img", root)) {
|
|
12731
12906
|
kinds.push("image");
|
|
12732
12907
|
}
|
|
12733
12908
|
if (hasAncestorTag(el, "td", root) || hasAncestorTag(el, "th", root)) {
|
|
@@ -12763,7 +12938,9 @@ function resolveTargetKind(target, options = {}) {
|
|
|
12763
12938
|
if (!kinds.includes("template-slot")) kinds.push("template-slot");
|
|
12764
12939
|
}
|
|
12765
12940
|
}
|
|
12766
|
-
if (!kinds.includes("
|
|
12941
|
+
if (!kinds.includes("generated-field") && !kinds.includes("plain-text")) {
|
|
12942
|
+
kinds.push("plain-text");
|
|
12943
|
+
}
|
|
12767
12944
|
return kinds;
|
|
12768
12945
|
}
|
|
12769
12946
|
|
|
@@ -15405,6 +15582,21 @@ function resolveRoleChromePreset(basePreset, role) {
|
|
|
15405
15582
|
}
|
|
15406
15583
|
return basePreset;
|
|
15407
15584
|
}
|
|
15585
|
+
function resolveActiveListReadback(rows, activeListContext, selection) {
|
|
15586
|
+
if (!activeListContext) {
|
|
15587
|
+
return null;
|
|
15588
|
+
}
|
|
15589
|
+
const selectionPoint = selection.activeRange.kind === "range" ? selection.head : selection.activeRange.kind === "node" ? selection.activeRange.at : selection.activeRange.lastKnownRange.from;
|
|
15590
|
+
const matchingSelectionRow = rows.find(
|
|
15591
|
+
(row) => row.numberingInstanceId === activeListContext.numberingInstanceId && row.level === activeListContext.level && selectionPoint >= row.authoredTextRange.from && selectionPoint <= row.authoredTextRange.to
|
|
15592
|
+
);
|
|
15593
|
+
if (matchingSelectionRow) {
|
|
15594
|
+
return matchingSelectionRow;
|
|
15595
|
+
}
|
|
15596
|
+
return rows.find(
|
|
15597
|
+
(row) => row.numberingInstanceId === activeListContext.numberingInstanceId && row.level === activeListContext.level
|
|
15598
|
+
) ?? null;
|
|
15599
|
+
}
|
|
15408
15600
|
function TwReviewWorkspace(inputProps) {
|
|
15409
15601
|
const props = {
|
|
15410
15602
|
...inputProps,
|
|
@@ -15519,6 +15711,14 @@ function TwReviewWorkspace(inputProps) {
|
|
|
15519
15711
|
() => uiApi?.scope.list().length,
|
|
15520
15712
|
[uiApi, renderFrameRevision]
|
|
15521
15713
|
);
|
|
15714
|
+
const activeListReadback = useMemo15(
|
|
15715
|
+
() => resolveActiveListReadback(
|
|
15716
|
+
uiApi?.lists.list() ?? [],
|
|
15717
|
+
props.activeListContext,
|
|
15718
|
+
viewState.selection
|
|
15719
|
+
),
|
|
15720
|
+
[uiApi, props.activeListContext, viewState.selection, renderFrameRevision]
|
|
15721
|
+
);
|
|
15522
15722
|
const headings = props.documentNavigation?.headings ?? [];
|
|
15523
15723
|
const headerVariant = snapshot.pageLayout?.headerVariants[0]?.variant ?? "default";
|
|
15524
15724
|
const footerVariant = snapshot.pageLayout?.footerVariants[0]?.variant ?? "default";
|
|
@@ -15787,6 +15987,7 @@ function TwReviewWorkspace(inputProps) {
|
|
|
15787
15987
|
zoomLevel: props.zoomLevel,
|
|
15788
15988
|
formattingState: props.formattingState,
|
|
15789
15989
|
activeListContext: props.activeListContext,
|
|
15990
|
+
activeListReadback,
|
|
15790
15991
|
styleCatalog: props.styleCatalog,
|
|
15791
15992
|
showTrackedChanges: trackedChangesAuthoringEnabled,
|
|
15792
15993
|
showSidebarToggle: responsiveChrome.showSidebarToggle,
|
|
@@ -15998,6 +16199,7 @@ function TwReviewWorkspace(inputProps) {
|
|
|
15998
16199
|
onSetImageFrame: props.onSetImageFrame,
|
|
15999
16200
|
onRestartNumbering: props.onRestartNumbering,
|
|
16000
16201
|
onContinueNumbering: props.onContinueNumbering,
|
|
16202
|
+
activeListReadback,
|
|
16001
16203
|
onToggleRowHeader: props.onToggleRowHeader,
|
|
16002
16204
|
onToggleRowCantSplit: props.onToggleRowCantSplit,
|
|
16003
16205
|
onDistributeColumnsEvenly: props.onDistributeColumnsEvenly,
|
|
@@ -18798,6 +19000,7 @@ export {
|
|
|
18798
19000
|
TwCommandPaletteMount,
|
|
18799
19001
|
UiApiProvider,
|
|
18800
19002
|
shouldRenderAbsoluteFloatingImageInPageOverlay,
|
|
19003
|
+
sanitizeNumberingPictureBulletSrc,
|
|
18801
19004
|
TwChromeOverlay,
|
|
18802
19005
|
TwScopeRailLayer,
|
|
18803
19006
|
buildPictureFilterCss,
|