@beyondwork/docx-react-component 1.0.369 → 1.0.370
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/{chunk-NZWRRQ3F.js → chunk-4T2EC23H.js} +141 -101
- package/dist/{chunk-BY2AHRHB.js → chunk-5BR3IUTU.js} +1 -1
- package/dist/{chunk-MLEGJTCV.js → chunk-BW5Z32HF.js} +11 -2
- package/dist/{chunk-FGYKA36U.js → chunk-NVUBNJK6.js} +91 -1
- package/dist/clm/index.cjs +240 -101
- package/dist/clm/index.js +3 -3
- package/dist/index.cjs +240 -101
- package/dist/index.js +3 -3
- package/dist/tailwind.cjs +231 -101
- package/dist/tailwind.js +3 -3
- package/dist/ui/headless/chrome-unit-strings.d.ts +90 -0
- package/dist/ui/headless/chrome-units.cjs +91 -1
- package/dist/ui/headless/chrome-units.js +1 -1
- package/dist/ui-tailwind.cjs +231 -101
- package/dist/ui-tailwind.js +3 -3
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
resolveChromeUnits,
|
|
16
16
|
resolveChromeVisibilityFromConfig,
|
|
17
17
|
sessionCanTrackChangesAuthoring
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NVUBNJK6.js";
|
|
19
19
|
import {
|
|
20
20
|
RIBBON_GROUP_LABELS,
|
|
21
21
|
buildPageAnchorAttributes,
|
|
@@ -1196,6 +1196,7 @@ function TwToolbarIconButton(props) {
|
|
|
1196
1196
|
"button",
|
|
1197
1197
|
{
|
|
1198
1198
|
type: "button",
|
|
1199
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
1199
1200
|
"aria-label": props.label,
|
|
1200
1201
|
"aria-pressed": props.active ?? void 0,
|
|
1201
1202
|
"data-active": props.active ? "true" : void 0,
|
|
@@ -1545,6 +1546,7 @@ var CUSTOM_SCOPE_COLOR_SWATCHES = [
|
|
|
1545
1546
|
"#0891b2"
|
|
1546
1547
|
];
|
|
1547
1548
|
function TwScopePostureMenu(props) {
|
|
1549
|
+
const strings = useChromeStrings();
|
|
1548
1550
|
const [customOpen, setCustomOpen] = React2.useState(false);
|
|
1549
1551
|
const iconOnly = props.responsiveTier === "mobile" || props.responsiveTier === "compact";
|
|
1550
1552
|
return /* @__PURE__ */ jsxs4(
|
|
@@ -1552,8 +1554,9 @@ function TwScopePostureMenu(props) {
|
|
|
1552
1554
|
{
|
|
1553
1555
|
className: `relative flex min-w-0 items-center ${iconOnly ? "gap-px" : "gap-1"}`,
|
|
1554
1556
|
"data-testid": props["data-testid"] ?? "workflow-scope-palette",
|
|
1557
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
1555
1558
|
"data-ribbon-control": "direct-scope-palette",
|
|
1556
|
-
"aria-label":
|
|
1559
|
+
"aria-label": strings.workflowScopeControlsLabel,
|
|
1557
1560
|
role: "group",
|
|
1558
1561
|
children: [
|
|
1559
1562
|
/* @__PURE__ */ jsx6("div", { className: "flex shrink-0 items-center gap-px", children: SCOPE_POSTURE_MENU_ENTRIES.map((entry) => /* @__PURE__ */ jsx6(
|
|
@@ -1580,9 +1583,9 @@ function TwScopePostureMenu(props) {
|
|
|
1580
1583
|
"button",
|
|
1581
1584
|
{
|
|
1582
1585
|
type: "button",
|
|
1583
|
-
"aria-label":
|
|
1586
|
+
"aria-label": strings.createCustomWorkflowScopeLabel,
|
|
1584
1587
|
"aria-expanded": customOpen,
|
|
1585
|
-
title:
|
|
1588
|
+
title: strings.customScopeLabel,
|
|
1586
1589
|
disabled: !props.onCreateCustomScope,
|
|
1587
1590
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
1588
1591
|
onClick: () => setCustomOpen((value) => !value),
|
|
@@ -1594,7 +1597,7 @@ function TwScopePostureMenu(props) {
|
|
|
1594
1597
|
"data-label-visibility": iconOnly ? "icon-only" : "text",
|
|
1595
1598
|
children: [
|
|
1596
1599
|
/* @__PURE__ */ jsx6(TwGlyphIcon, { name: "plus", className: "h-3.5 w-3.5 text-accent" }),
|
|
1597
|
-
iconOnly ? null : /* @__PURE__ */ jsx6("span", { children:
|
|
1600
|
+
iconOnly ? null : /* @__PURE__ */ jsx6("span", { children: strings.customLabel })
|
|
1598
1601
|
]
|
|
1599
1602
|
}
|
|
1600
1603
|
),
|
|
@@ -1610,6 +1613,7 @@ function TwScopePostureMenu(props) {
|
|
|
1610
1613
|
);
|
|
1611
1614
|
}
|
|
1612
1615
|
function CustomScopeDialog(props) {
|
|
1616
|
+
const strings = useChromeStrings();
|
|
1613
1617
|
const [mode, setMode] = React2.useState("suggest");
|
|
1614
1618
|
const [color, setColor] = React2.useState(CUSTOM_SCOPE_COLOR_SWATCHES[0]);
|
|
1615
1619
|
const [metadataRows, setMetadataRows] = React2.useState([0]);
|
|
@@ -1655,12 +1659,12 @@ function CustomScopeDialog(props) {
|
|
|
1655
1659
|
},
|
|
1656
1660
|
children: [
|
|
1657
1661
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1658
|
-
/* @__PURE__ */ jsx6("span", { className: "font-semibold text-[var(--ink-primary)]", children:
|
|
1662
|
+
/* @__PURE__ */ jsx6("span", { className: "font-semibold text-[var(--ink-primary)]", children: strings.customScopeLabel }),
|
|
1659
1663
|
/* @__PURE__ */ jsx6(
|
|
1660
1664
|
"button",
|
|
1661
1665
|
{
|
|
1662
1666
|
type: "button",
|
|
1663
|
-
"aria-label":
|
|
1667
|
+
"aria-label": strings.closeCustomScopeDialogLabel,
|
|
1664
1668
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
1665
1669
|
onClick: props.onClose,
|
|
1666
1670
|
className: ds38IconButtonClass,
|
|
@@ -1669,19 +1673,19 @@ function CustomScopeDialog(props) {
|
|
|
1669
1673
|
)
|
|
1670
1674
|
] }),
|
|
1671
1675
|
/* @__PURE__ */ jsxs4("label", { className: "grid gap-1 font-medium text-[var(--ink-secondary)]", children: [
|
|
1672
|
-
|
|
1676
|
+
strings.nameLabel,
|
|
1673
1677
|
/* @__PURE__ */ jsx6(
|
|
1674
1678
|
"input",
|
|
1675
1679
|
{
|
|
1676
1680
|
autoFocus: true,
|
|
1677
|
-
"aria-label":
|
|
1681
|
+
"aria-label": strings.customScopeNameLabel,
|
|
1678
1682
|
name: "scope-label",
|
|
1679
1683
|
className: ds38SmallInputClass
|
|
1680
1684
|
}
|
|
1681
1685
|
)
|
|
1682
1686
|
] }),
|
|
1683
|
-
/* @__PURE__ */ jsxs4("div", { className: "grid gap-1", role: "group", "aria-label":
|
|
1684
|
-
/* @__PURE__ */ jsx6("span", { className: "font-medium text-[var(--ink-secondary)]", children:
|
|
1687
|
+
/* @__PURE__ */ jsxs4("div", { className: "grid gap-1", role: "group", "aria-label": strings.customScopeModeInputLabel, children: [
|
|
1688
|
+
/* @__PURE__ */ jsx6("span", { className: "font-medium text-[var(--ink-secondary)]", children: strings.modeLabel }),
|
|
1685
1689
|
/* @__PURE__ */ jsx6("div", { className: "flex flex-wrap gap-1", children: ["edit", "suggest", "comment", "view"].map((entry) => /* @__PURE__ */ jsx6(
|
|
1686
1690
|
"button",
|
|
1687
1691
|
{
|
|
@@ -1702,8 +1706,8 @@ function CustomScopeDialog(props) {
|
|
|
1702
1706
|
entry
|
|
1703
1707
|
)) })
|
|
1704
1708
|
] }),
|
|
1705
|
-
/* @__PURE__ */ jsxs4("div", { className: "grid gap-1", role: "group", "aria-label":
|
|
1706
|
-
/* @__PURE__ */ jsx6("span", { className: "font-medium text-[var(--ink-secondary)]", children:
|
|
1709
|
+
/* @__PURE__ */ jsxs4("div", { className: "grid gap-1", role: "group", "aria-label": strings.customScopeColorInputLabel, children: [
|
|
1710
|
+
/* @__PURE__ */ jsx6("span", { className: "font-medium text-[var(--ink-secondary)]", children: strings.colorLabel }),
|
|
1707
1711
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1", children: [
|
|
1708
1712
|
CUSTOM_SCOPE_COLOR_SWATCHES.map((swatch) => /* @__PURE__ */ jsx6(
|
|
1709
1713
|
"button",
|
|
@@ -1724,9 +1728,9 @@ function CustomScopeDialog(props) {
|
|
|
1724
1728
|
/* @__PURE__ */ jsx6(
|
|
1725
1729
|
"input",
|
|
1726
1730
|
{
|
|
1727
|
-
"aria-label":
|
|
1731
|
+
"aria-label": strings.customScopeColorInputLabel,
|
|
1728
1732
|
name: "scope-color",
|
|
1729
|
-
placeholder:
|
|
1733
|
+
placeholder: strings.scopeColorPlaceholder,
|
|
1730
1734
|
className: `${ds38SmallInputClass} w-24`
|
|
1731
1735
|
}
|
|
1732
1736
|
)
|
|
@@ -1734,7 +1738,7 @@ function CustomScopeDialog(props) {
|
|
|
1734
1738
|
] }),
|
|
1735
1739
|
/* @__PURE__ */ jsxs4("div", { className: "grid gap-1", children: [
|
|
1736
1740
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between", children: [
|
|
1737
|
-
/* @__PURE__ */ jsx6("span", { className: "font-medium text-[var(--ink-secondary)]", children:
|
|
1741
|
+
/* @__PURE__ */ jsx6("span", { className: "font-medium text-[var(--ink-secondary)]", children: strings.metadataLabelText }),
|
|
1738
1742
|
/* @__PURE__ */ jsx6(
|
|
1739
1743
|
"button",
|
|
1740
1744
|
{
|
|
@@ -1742,7 +1746,7 @@ function CustomScopeDialog(props) {
|
|
|
1742
1746
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
1743
1747
|
onClick: () => setMetadataRows((rows) => [...rows, Date.now()]),
|
|
1744
1748
|
className: `${ds38TextButtonClass} h-6 px-1.5 text-[10px] text-[var(--accent-primary)]`,
|
|
1745
|
-
children:
|
|
1749
|
+
children: strings.addLabel
|
|
1746
1750
|
}
|
|
1747
1751
|
)
|
|
1748
1752
|
] }),
|
|
@@ -1752,7 +1756,7 @@ function CustomScopeDialog(props) {
|
|
|
1752
1756
|
{
|
|
1753
1757
|
"aria-label": `Metadata key ${index + 1}`,
|
|
1754
1758
|
name: "metadata-key",
|
|
1755
|
-
placeholder:
|
|
1759
|
+
placeholder: strings.metadataKeyPlaceholderLabel,
|
|
1756
1760
|
className: ds38SmallInputClass
|
|
1757
1761
|
}
|
|
1758
1762
|
),
|
|
@@ -1761,7 +1765,7 @@ function CustomScopeDialog(props) {
|
|
|
1761
1765
|
{
|
|
1762
1766
|
"aria-label": `Metadata value ${index + 1}`,
|
|
1763
1767
|
name: "metadata-value",
|
|
1764
|
-
placeholder:
|
|
1768
|
+
placeholder: strings.metadataValuePlaceholderLabel,
|
|
1765
1769
|
className: ds38SmallInputClass
|
|
1766
1770
|
}
|
|
1767
1771
|
),
|
|
@@ -1794,7 +1798,7 @@ function CustomScopeDialog(props) {
|
|
|
1794
1798
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
1795
1799
|
onClick: props.onClose,
|
|
1796
1800
|
className: ds38TextButtonClass,
|
|
1797
|
-
children:
|
|
1801
|
+
children: strings.cancelLabel
|
|
1798
1802
|
}
|
|
1799
1803
|
),
|
|
1800
1804
|
/* @__PURE__ */ jsx6(
|
|
@@ -1803,7 +1807,7 @@ function CustomScopeDialog(props) {
|
|
|
1803
1807
|
type: "submit",
|
|
1804
1808
|
disabled: pending || !props.onCreate,
|
|
1805
1809
|
className: `h-7 rounded-[var(--r-2)] bg-[var(--accent-primary)] px-2 text-[length:var(--tx-xs)] font-semibold text-white disabled:cursor-not-allowed disabled:opacity-40 ${ds38ControlFocusClass}`,
|
|
1806
|
-
children:
|
|
1810
|
+
children: strings.createLabel
|
|
1807
1811
|
}
|
|
1808
1812
|
)
|
|
1809
1813
|
] })
|
|
@@ -1983,6 +1987,7 @@ function toneClass(tone) {
|
|
|
1983
1987
|
// src/ui-tailwind/toolbar/tw-role-action-region.tsx
|
|
1984
1988
|
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1985
1989
|
function TwRoleActionRegion(props) {
|
|
1990
|
+
const strings = useChromeStrings();
|
|
1986
1991
|
const responsiveTier = props.responsiveTier ?? (props.compactMode ? "compact" : "standard");
|
|
1987
1992
|
const order = resolveRoleActionOrder(props.role, props.chromeMode);
|
|
1988
1993
|
const inlineIds = [];
|
|
@@ -2018,6 +2023,7 @@ function TwRoleActionRegion(props) {
|
|
|
2018
2023
|
"div",
|
|
2019
2024
|
{
|
|
2020
2025
|
className: "flex min-w-0 shrink-0 items-stretch",
|
|
2026
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
2021
2027
|
"data-testid": props["data-testid"] ?? `role-action-region-${props.chromeMode ?? props.role}`,
|
|
2022
2028
|
"data-role": props.role,
|
|
2023
2029
|
"data-mode": props.chromeMode,
|
|
@@ -2034,7 +2040,7 @@ function TwRoleActionRegion(props) {
|
|
|
2034
2040
|
},
|
|
2035
2041
|
id
|
|
2036
2042
|
)) }, group.key)),
|
|
2037
|
-
overflowIds.length > 0 ? /* @__PURE__ */ jsx7(TwRibbonGroup, { label:
|
|
2043
|
+
overflowIds.length > 0 ? /* @__PURE__ */ jsx7(TwRibbonGroup, { label: strings.moreLabel, children: /* @__PURE__ */ jsx7(RoleActionOverflow, { ids: overflowIds, props }) }) : null
|
|
2038
2044
|
]
|
|
2039
2045
|
}
|
|
2040
2046
|
);
|
|
@@ -2184,6 +2190,7 @@ function roleOverflowLabel(role) {
|
|
|
2184
2190
|
}
|
|
2185
2191
|
function RoleActionButton(arg) {
|
|
2186
2192
|
const { id, props, responsiveTier } = arg;
|
|
2193
|
+
const strings = useChromeStrings();
|
|
2187
2194
|
const hideText = shouldUseIconOnlyRoleAction(id, responsiveTier);
|
|
2188
2195
|
const reviewQueueTotal = props.reviewQueue?.totalCount ?? 0;
|
|
2189
2196
|
const adjudicationProtected = props.capabilities?.adjudicationBlockedByProtection ?? false;
|
|
@@ -2195,7 +2202,7 @@ function RoleActionButton(arg) {
|
|
|
2195
2202
|
"button",
|
|
2196
2203
|
{
|
|
2197
2204
|
type: "button",
|
|
2198
|
-
"aria-label":
|
|
2205
|
+
"aria-label": strings.addCommentLabel,
|
|
2199
2206
|
disabled: !props.canAddComment || !props.onAddComment,
|
|
2200
2207
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
2201
2208
|
onClick: props.onAddComment,
|
|
@@ -2204,7 +2211,7 @@ function RoleActionButton(arg) {
|
|
|
2204
2211
|
children: /* @__PURE__ */ jsx7(TwGlyphIcon, { name: "comment", className: "h-3.5 w-3.5" })
|
|
2205
2212
|
}
|
|
2206
2213
|
) }),
|
|
2207
|
-
/* @__PURE__ */ jsx7(Tooltip2.Portal, { children: /* @__PURE__ */ jsx7(Tooltip2.Content, { className: ds38TooltipClass, sideOffset: 6, children:
|
|
2214
|
+
/* @__PURE__ */ jsx7(Tooltip2.Portal, { children: /* @__PURE__ */ jsx7(Tooltip2.Content, { className: ds38TooltipClass, sideOffset: 6, children: strings.addCommentLabel }) })
|
|
2208
2215
|
] });
|
|
2209
2216
|
case "review-compare-document":
|
|
2210
2217
|
return /* @__PURE__ */ jsx7(
|
|
@@ -2215,7 +2222,7 @@ function RoleActionButton(arg) {
|
|
|
2215
2222
|
}
|
|
2216
2223
|
);
|
|
2217
2224
|
case "review-track-changes-toggle": {
|
|
2218
|
-
const trackChangesLabel =
|
|
2225
|
+
const trackChangesLabel = strings.trackedChangesLabel;
|
|
2219
2226
|
const trackedChangesAuthoringEnabled = props.trackedChangesAuthoringEnabled ?? false;
|
|
2220
2227
|
const onTrackedChangesAuthoringChange = props.onTrackedChangesAuthoringChange ?? props.onShowTrackedChangesChange;
|
|
2221
2228
|
const trackChangesTooltip = trackedChangesAuthoringEnabled ? "Tracking on: new typing, insertions, deletions, and formatting changes become redlines." : "Tracking off: new edits are applied directly. Existing markup display is controlled in the status bar.";
|
|
@@ -2228,7 +2235,7 @@ function RoleActionButton(arg) {
|
|
|
2228
2235
|
"aria-label": trackChangesLabel,
|
|
2229
2236
|
disabled: props.capabilities ? !sessionCanTrackChangesAuthoring(props.capabilities) : false,
|
|
2230
2237
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
2231
|
-
title: trackedChangesAuthoringEnabled ?
|
|
2238
|
+
title: trackedChangesAuthoringEnabled ? strings.trackedChangesOnTitle : strings.trackedChangesOffTitle,
|
|
2232
2239
|
className: [
|
|
2233
2240
|
"inline-flex h-6 items-center justify-center gap-1 rounded-[var(--radius-sm)] px-2",
|
|
2234
2241
|
"text-[length:var(--text-xs)] font-medium text-[var(--ink-secondary)]",
|
|
@@ -2242,7 +2249,7 @@ function RoleActionButton(arg) {
|
|
|
2242
2249
|
"data-testid": "role-review-track-changes-toggle",
|
|
2243
2250
|
children: [
|
|
2244
2251
|
/* @__PURE__ */ jsx7(TwGlyphIcon, { name: "edit", className: "h-3.5 w-3.5" }),
|
|
2245
|
-
/* @__PURE__ */ jsx7("span", { children: trackedChangesAuthoringEnabled ?
|
|
2252
|
+
/* @__PURE__ */ jsx7("span", { children: trackedChangesAuthoringEnabled ? strings.trackedChangesOnLabel : strings.trackedChangesOffLabel })
|
|
2246
2253
|
]
|
|
2247
2254
|
}
|
|
2248
2255
|
) }),
|
|
@@ -2255,7 +2262,7 @@ function RoleActionButton(arg) {
|
|
|
2255
2262
|
"button",
|
|
2256
2263
|
{
|
|
2257
2264
|
type: "button",
|
|
2258
|
-
"aria-label":
|
|
2265
|
+
"aria-label": strings.showTrackedChangesSidebarLabel,
|
|
2259
2266
|
disabled: !props.onReviewSidebarTrackedChanges,
|
|
2260
2267
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
2261
2268
|
onClick: props.onReviewSidebarTrackedChanges,
|
|
@@ -2264,7 +2271,7 @@ function RoleActionButton(arg) {
|
|
|
2264
2271
|
children: /* @__PURE__ */ jsx7(TwGlyphIcon, { name: "diff", className: "h-3.5 w-3.5" })
|
|
2265
2272
|
}
|
|
2266
2273
|
) }),
|
|
2267
|
-
/* @__PURE__ */ jsx7(Tooltip2.Portal, { children: /* @__PURE__ */ jsx7(Tooltip2.Content, { className: ds38TooltipClass, sideOffset: 6, children:
|
|
2274
|
+
/* @__PURE__ */ jsx7(Tooltip2.Portal, { children: /* @__PURE__ */ jsx7(Tooltip2.Content, { className: ds38TooltipClass, sideOffset: 6, children: strings.trackedChangesPanelLabel }) })
|
|
2268
2275
|
] });
|
|
2269
2276
|
case "comments-panel":
|
|
2270
2277
|
return /* @__PURE__ */ jsxs5(Tooltip2.Root, { children: [
|
|
@@ -2272,7 +2279,7 @@ function RoleActionButton(arg) {
|
|
|
2272
2279
|
"button",
|
|
2273
2280
|
{
|
|
2274
2281
|
type: "button",
|
|
2275
|
-
"aria-label":
|
|
2282
|
+
"aria-label": strings.showCommentsSidebarLabel,
|
|
2276
2283
|
disabled: !props.onReviewSidebarComments,
|
|
2277
2284
|
onMouseDown: preserveEditorSelectionMouseDown,
|
|
2278
2285
|
onClick: props.onReviewSidebarComments,
|
|
@@ -2281,7 +2288,7 @@ function RoleActionButton(arg) {
|
|
|
2281
2288
|
children: /* @__PURE__ */ jsx7(TwGlyphIcon, { name: "comment", badge: "alert", className: "h-3.5 w-3.5" })
|
|
2282
2289
|
}
|
|
2283
2290
|
) }),
|
|
2284
|
-
/* @__PURE__ */ jsx7(Tooltip2.Portal, { children: /* @__PURE__ */ jsx7(Tooltip2.Content, { className: ds38TooltipClass, sideOffset: 6, children:
|
|
2291
|
+
/* @__PURE__ */ jsx7(Tooltip2.Portal, { children: /* @__PURE__ */ jsx7(Tooltip2.Content, { className: ds38TooltipClass, sideOffset: 6, children: strings.commentsPanelLabel }) })
|
|
2285
2292
|
] });
|
|
2286
2293
|
case "editor-scope-posture-menu":
|
|
2287
2294
|
return /* @__PURE__ */ jsx7(
|
|
@@ -2641,14 +2648,15 @@ function IconTextButton(arg) {
|
|
|
2641
2648
|
);
|
|
2642
2649
|
}
|
|
2643
2650
|
function ReviewCompareDocumentButton(props) {
|
|
2651
|
+
const strings = useChromeStrings();
|
|
2644
2652
|
const inputRef = React3.useRef(null);
|
|
2645
2653
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
2646
2654
|
/* @__PURE__ */ jsx7(
|
|
2647
2655
|
IconTextButton,
|
|
2648
2656
|
{
|
|
2649
2657
|
icon: twGlyphIconComponent("diff"),
|
|
2650
|
-
text:
|
|
2651
|
-
ariaLabel:
|
|
2658
|
+
text: strings.compareLabel,
|
|
2659
|
+
ariaLabel: strings.compareWithAnotherDocumentLabel,
|
|
2652
2660
|
disabled: props.disabled,
|
|
2653
2661
|
onClick: () => inputRef.current?.click(),
|
|
2654
2662
|
"data-testid": props.testId ?? "role-review-compare-document"
|
|
@@ -2661,7 +2669,7 @@ function ReviewCompareDocumentButton(props) {
|
|
|
2661
2669
|
type: "file",
|
|
2662
2670
|
accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2663
2671
|
className: "sr-only",
|
|
2664
|
-
"aria-label":
|
|
2672
|
+
"aria-label": strings.chooseDocumentToCompareLabel,
|
|
2665
2673
|
disabled: props.disabled,
|
|
2666
2674
|
onChange: (event) => {
|
|
2667
2675
|
const file = event.currentTarget.files?.[0];
|
|
@@ -2679,14 +2687,15 @@ function ReviewCompareDocumentButton(props) {
|
|
|
2679
2687
|
] });
|
|
2680
2688
|
}
|
|
2681
2689
|
function CompareMenuRow(arg) {
|
|
2690
|
+
const strings = useChromeStrings();
|
|
2682
2691
|
const inputRef = React3.useRef(null);
|
|
2683
2692
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
2684
2693
|
/* @__PURE__ */ jsx7(
|
|
2685
2694
|
MenuRow,
|
|
2686
2695
|
{
|
|
2687
2696
|
icon: twGlyphIconComponent("diff"),
|
|
2688
|
-
label:
|
|
2689
|
-
ariaLabel:
|
|
2697
|
+
label: strings.compareDocumentLabel,
|
|
2698
|
+
ariaLabel: strings.compareWithAnotherDocumentLabel,
|
|
2690
2699
|
disabled: arg.disabled,
|
|
2691
2700
|
onClick: () => inputRef.current?.click()
|
|
2692
2701
|
}
|
|
@@ -2698,7 +2707,7 @@ function CompareMenuRow(arg) {
|
|
|
2698
2707
|
type: "file",
|
|
2699
2708
|
accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2700
2709
|
className: "sr-only",
|
|
2701
|
-
"aria-label":
|
|
2710
|
+
"aria-label": strings.chooseDocumentToCompareLabel,
|
|
2702
2711
|
disabled: arg.disabled,
|
|
2703
2712
|
onChange: (event) => {
|
|
2704
2713
|
const file = event.currentTarget.files?.[0];
|
|
@@ -2797,6 +2806,7 @@ function TwRibbonTab(props) {
|
|
|
2797
2806
|
"button",
|
|
2798
2807
|
{
|
|
2799
2808
|
type: "button",
|
|
2809
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
2800
2810
|
role: "tab",
|
|
2801
2811
|
"aria-selected": selected,
|
|
2802
2812
|
"aria-label": label,
|
|
@@ -2834,15 +2844,24 @@ function TwRibbonTab(props) {
|
|
|
2834
2844
|
|
|
2835
2845
|
// src/ui-tailwind/toolbar/tw-ribbon-tab-strip.tsx
|
|
2836
2846
|
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2837
|
-
var
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2847
|
+
var TAB_IDS = [
|
|
2848
|
+
"home",
|
|
2849
|
+
"insert",
|
|
2850
|
+
"layout",
|
|
2851
|
+
"review",
|
|
2852
|
+
"workflow",
|
|
2853
|
+
"analytics"
|
|
2844
2854
|
];
|
|
2845
2855
|
function TwRibbonTabStrip(props) {
|
|
2856
|
+
const strings = useChromeStrings();
|
|
2857
|
+
const tabLabels = {
|
|
2858
|
+
home: strings.homeTabLabel,
|
|
2859
|
+
insert: strings.insertTabLabel,
|
|
2860
|
+
layout: strings.layoutTabLabel,
|
|
2861
|
+
review: strings.reviewTabLabel,
|
|
2862
|
+
workflow: strings.workflowTabLabel,
|
|
2863
|
+
analytics: strings.analyticsLabel
|
|
2864
|
+
};
|
|
2846
2865
|
const responsiveTier = props.responsiveTier ?? "standard";
|
|
2847
2866
|
const isMobile = responsiveTier === "mobile";
|
|
2848
2867
|
const disabledSet = React5.useMemo(
|
|
@@ -2853,6 +2872,7 @@ function TwRibbonTabStrip(props) {
|
|
|
2853
2872
|
"div",
|
|
2854
2873
|
{
|
|
2855
2874
|
"data-testid": "ribbon-tab-strip",
|
|
2875
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
2856
2876
|
"data-ribbon-layer": "tabs",
|
|
2857
2877
|
"data-responsive-tier": responsiveTier,
|
|
2858
2878
|
className: [
|
|
@@ -2864,22 +2884,22 @@ function TwRibbonTabStrip(props) {
|
|
|
2864
2884
|
"div",
|
|
2865
2885
|
{
|
|
2866
2886
|
role: "tablist",
|
|
2867
|
-
"aria-label":
|
|
2887
|
+
"aria-label": strings.ribbonTabsLabel,
|
|
2868
2888
|
className: [
|
|
2869
2889
|
"flex min-w-0 shrink items-end gap-0",
|
|
2870
2890
|
"overflow-x-auto overflow-y-hidden [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
2871
2891
|
].join(" "),
|
|
2872
|
-
children:
|
|
2892
|
+
children: TAB_IDS.map((id) => /* @__PURE__ */ jsx10(
|
|
2873
2893
|
TwRibbonTab,
|
|
2874
2894
|
{
|
|
2875
|
-
id
|
|
2876
|
-
label:
|
|
2877
|
-
selected:
|
|
2878
|
-
disabled: disabledSet.has(
|
|
2895
|
+
id,
|
|
2896
|
+
label: tabLabels[id],
|
|
2897
|
+
selected: id === props.activeTab,
|
|
2898
|
+
disabled: disabledSet.has(id),
|
|
2879
2899
|
responsiveTier,
|
|
2880
2900
|
onSelect: props.onTabChange
|
|
2881
2901
|
},
|
|
2882
|
-
|
|
2902
|
+
id
|
|
2883
2903
|
))
|
|
2884
2904
|
}
|
|
2885
2905
|
),
|
|
@@ -2891,10 +2911,10 @@ function TwRibbonTabStrip(props) {
|
|
|
2891
2911
|
type: "button",
|
|
2892
2912
|
"data-testid": "ribbon-collapse-toggle",
|
|
2893
2913
|
"aria-pressed": props.collapsed,
|
|
2894
|
-
"aria-label": props.collapsed ?
|
|
2914
|
+
"aria-label": props.collapsed ? strings.expandRibbonLabel : strings.collapseRibbonLabel,
|
|
2895
2915
|
onClick: props.onCollapseToggle,
|
|
2896
2916
|
"data-label-visibility": isMobile ? "icon-only" : "text",
|
|
2897
|
-
title: isMobile ? props.collapsed ?
|
|
2917
|
+
title: isMobile ? props.collapsed ? strings.expandRibbonLabel : strings.collapseRibbonLabel : void 0,
|
|
2898
2918
|
className: [
|
|
2899
2919
|
"inline-flex h-6 items-center rounded text-[length:var(--text-xs)] text-[var(--ink-secondary)]",
|
|
2900
2920
|
"transition-colors duration-[var(--t-fast)] hover:bg-[var(--bg-hover)] hover:text-[var(--ink-primary)]",
|
|
@@ -2916,15 +2936,17 @@ function TwRibbonTabStrip(props) {
|
|
|
2916
2936
|
// src/ui-tailwind/toolbar/tw-ribbon-tab-body-analytics.tsx
|
|
2917
2937
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2918
2938
|
function TwRibbonTabBodyAnalytics(props) {
|
|
2939
|
+
const strings = useChromeStrings();
|
|
2919
2940
|
return /* @__PURE__ */ jsx11(
|
|
2920
2941
|
"div",
|
|
2921
2942
|
{
|
|
2922
2943
|
"data-testid": "ribbon-tab-body-analytics",
|
|
2944
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
2923
2945
|
"data-ribbon-tab-body": "analytics",
|
|
2924
2946
|
"data-ribbon-body-density": "standard",
|
|
2925
|
-
"aria-label":
|
|
2947
|
+
"aria-label": strings.analyticsTabBodyLabel,
|
|
2926
2948
|
className: "flex h-full min-w-0 flex-nowrap items-center overflow-hidden px-0 py-0",
|
|
2927
|
-
children: props.children ?? /* @__PURE__ */ jsx11("span", { className: "px-3 text-[length:var(--text-xs)] text-tertiary", children:
|
|
2949
|
+
children: props.children ?? /* @__PURE__ */ jsx11("span", { className: "px-3 text-[length:var(--text-xs)] text-tertiary", children: strings.analyticsUnavailable })
|
|
2928
2950
|
}
|
|
2929
2951
|
);
|
|
2930
2952
|
}
|
|
@@ -2942,12 +2964,14 @@ var GROUP_LABEL = {
|
|
|
2942
2964
|
symbol: "Symbol"
|
|
2943
2965
|
};
|
|
2944
2966
|
function TwRibbonTabBodyInsert(props) {
|
|
2967
|
+
const strings = useChromeStrings();
|
|
2945
2968
|
const entries = filterRegistryByTab("insert");
|
|
2946
2969
|
const byGroup = groupEntriesByGroup(entries);
|
|
2947
2970
|
return /* @__PURE__ */ jsx12(
|
|
2948
2971
|
"div",
|
|
2949
2972
|
{
|
|
2950
2973
|
"data-testid": "ribbon-tab-body-insert",
|
|
2974
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
2951
2975
|
"data-ribbon-tab-body": "insert",
|
|
2952
2976
|
"data-ribbon-body-density": "compact",
|
|
2953
2977
|
className: "flex h-full min-w-0 flex-nowrap items-center gap-1 overflow-hidden px-3 py-0",
|
|
@@ -2958,7 +2982,7 @@ function TwRibbonTabBodyInsert(props) {
|
|
|
2958
2982
|
"data-testid": `ribbon-tab-body-insert-entry-${id}`,
|
|
2959
2983
|
"data-ribbon-entry-id": id,
|
|
2960
2984
|
disabled: true,
|
|
2961
|
-
title:
|
|
2985
|
+
title: strings.notAvailableCommandHandler,
|
|
2962
2986
|
className: "inline-flex h-6 items-center rounded px-1.5 text-[length:var(--text-xs)] text-[var(--ink-secondary)] opacity-50",
|
|
2963
2987
|
children: labelForEntry(id)
|
|
2964
2988
|
},
|
|
@@ -2998,6 +3022,7 @@ var GROUP_LABEL2 = {
|
|
|
2998
3022
|
ruler: "Ruler"
|
|
2999
3023
|
};
|
|
3000
3024
|
function TwRibbonTabBodyLayout(props) {
|
|
3025
|
+
const strings = useChromeStrings();
|
|
3001
3026
|
const entries = filterRegistryByTab("layout");
|
|
3002
3027
|
const byGroup = {};
|
|
3003
3028
|
for (const entry of entries) {
|
|
@@ -3009,6 +3034,7 @@ function TwRibbonTabBodyLayout(props) {
|
|
|
3009
3034
|
"div",
|
|
3010
3035
|
{
|
|
3011
3036
|
"data-testid": "ribbon-tab-body-layout",
|
|
3037
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
3012
3038
|
"data-ribbon-tab-body": "layout",
|
|
3013
3039
|
"data-ribbon-body-density": "compact",
|
|
3014
3040
|
className: "flex h-full min-w-0 flex-nowrap items-center gap-1 overflow-hidden px-3 py-0",
|
|
@@ -3019,7 +3045,7 @@ function TwRibbonTabBodyLayout(props) {
|
|
|
3019
3045
|
"data-testid": `ribbon-tab-body-layout-entry-${id}`,
|
|
3020
3046
|
"data-ribbon-entry-id": id,
|
|
3021
3047
|
disabled: true,
|
|
3022
|
-
title:
|
|
3048
|
+
title: strings.notAvailableCommandHandler,
|
|
3023
3049
|
className: "inline-flex h-6 items-center rounded px-1.5 text-[length:var(--text-xs)] text-[var(--ink-secondary)] opacity-50",
|
|
3024
3050
|
children: labelForEntry2(id)
|
|
3025
3051
|
},
|
|
@@ -3040,13 +3066,15 @@ function labelForEntry2(id) {
|
|
|
3040
3066
|
// src/ui-tailwind/toolbar/tw-ribbon-tab-body-mode.tsx
|
|
3041
3067
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
3042
3068
|
function TwRibbonTabBodyMode(props) {
|
|
3069
|
+
const strings = useChromeStrings();
|
|
3043
3070
|
return /* @__PURE__ */ jsx14(
|
|
3044
3071
|
"div",
|
|
3045
3072
|
{
|
|
3046
3073
|
"data-testid": `ribbon-tab-body-${props.tab}`,
|
|
3074
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
3047
3075
|
"data-ribbon-tab-body": props.tab,
|
|
3048
3076
|
"data-ribbon-body-density": "compact",
|
|
3049
|
-
"aria-label":
|
|
3077
|
+
"aria-label": strings.workflowTabBodyLabel,
|
|
3050
3078
|
className: "flex h-full min-w-0 flex-nowrap items-center gap-1 overflow-hidden px-3 py-0",
|
|
3051
3079
|
children: props.children ?? null
|
|
3052
3080
|
}
|
|
@@ -3056,13 +3084,15 @@ function TwRibbonTabBodyMode(props) {
|
|
|
3056
3084
|
// src/ui-tailwind/toolbar/tw-ribbon-tab-body-review.tsx
|
|
3057
3085
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3058
3086
|
function TwRibbonTabBodyReview(props) {
|
|
3087
|
+
const strings = useChromeStrings();
|
|
3059
3088
|
return /* @__PURE__ */ jsx15(
|
|
3060
3089
|
"div",
|
|
3061
3090
|
{
|
|
3062
3091
|
"data-testid": "ribbon-tab-body-review",
|
|
3092
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
3063
3093
|
"data-ribbon-tab-body": "review",
|
|
3064
3094
|
"data-ribbon-body-density": "compact",
|
|
3065
|
-
"aria-label":
|
|
3095
|
+
"aria-label": strings.reviewTabBodyLabel,
|
|
3066
3096
|
className: "flex h-full min-w-0 flex-nowrap items-center gap-1 overflow-hidden px-3 py-0",
|
|
3067
3097
|
children: props.children ?? null
|
|
3068
3098
|
}
|
|
@@ -3105,6 +3135,7 @@ function TwDisplayModeSelector(props) {
|
|
|
3105
3135
|
"button",
|
|
3106
3136
|
{
|
|
3107
3137
|
type: "button",
|
|
3138
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
3108
3139
|
disabled: props.disabled,
|
|
3109
3140
|
"data-testid": props["data-testid"] ?? "display-mode-selector-trigger",
|
|
3110
3141
|
"data-ribbon-control": "compact-selector",
|
|
@@ -6961,6 +6992,11 @@ function TwModePill(props) {
|
|
|
6961
6992
|
|
|
6962
6993
|
// src/ui-tailwind/toolbar/tw-shell-header.tsx
|
|
6963
6994
|
import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6995
|
+
var DEFAULT_SHELL_HEADER_MODES = [
|
|
6996
|
+
{ id: "edit", label: DEFAULT_CHROME_STRINGS.modeEditLabel },
|
|
6997
|
+
{ id: "review", label: DEFAULT_CHROME_STRINGS.reviewTabLabel },
|
|
6998
|
+
{ id: "workflow", label: DEFAULT_CHROME_STRINGS.workflowTabLabel }
|
|
6999
|
+
];
|
|
6964
7000
|
var POSTURE_HUES = {
|
|
6965
7001
|
ready: "var(--sem-success)",
|
|
6966
7002
|
unsaved: "var(--accent-primary)",
|
|
@@ -6968,8 +7004,9 @@ var POSTURE_HUES = {
|
|
|
6968
7004
|
blocked: "var(--sem-error)"
|
|
6969
7005
|
};
|
|
6970
7006
|
function TwShellHeader(props) {
|
|
6971
|
-
const
|
|
6972
|
-
const
|
|
7007
|
+
const strings = useChromeStrings();
|
|
7008
|
+
const title = props.documentTitle ?? props.brand ?? strings.defaultDocumentTitle;
|
|
7009
|
+
const wordmark = props.wordmark ?? strings.defaultWordmark;
|
|
6973
7010
|
const posture = props.posture ?? (props.saveState === "dirty" || props.saveState === "saving" ? "unsaved" : "ready");
|
|
6974
7011
|
const responsiveTier = props.responsiveTier ?? "wide";
|
|
6975
7012
|
const atLeastCompact = responsiveTier !== "mobile";
|
|
@@ -7082,8 +7119,8 @@ function TwShellHeader(props) {
|
|
|
7082
7119
|
type: "button",
|
|
7083
7120
|
"data-testid": "tw-shell-header__command",
|
|
7084
7121
|
"data-chrome-command-trigger": "true",
|
|
7085
|
-
"aria-label":
|
|
7086
|
-
title:
|
|
7122
|
+
"aria-label": strings.commandPaletteLabel,
|
|
7123
|
+
title: strings.commandPaletteLabel,
|
|
7087
7124
|
disabled: props.commandPaletteDisabled,
|
|
7088
7125
|
onClick: props.onOpenCommandPalette,
|
|
7089
7126
|
className: "inline-flex h-7 w-7 items-center justify-center rounded text-[var(--ink-secondary)] transition-colors hover:bg-[var(--bg-hover)] hover:text-[var(--ink-primary)] disabled:cursor-not-allowed disabled:opacity-40 focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)]",
|
|
@@ -7103,13 +7140,13 @@ function TwShellHeader(props) {
|
|
|
7103
7140
|
{
|
|
7104
7141
|
type: "button",
|
|
7105
7142
|
"data-testid": "tw-shell-header__analytics",
|
|
7106
|
-
"aria-label":
|
|
7143
|
+
"aria-label": strings.toggleAnalyticsLabel,
|
|
7107
7144
|
"aria-pressed": props.analyticsActive ?? false,
|
|
7108
7145
|
onClick: props.onToggleAnalytics,
|
|
7109
7146
|
className: "inline-flex h-7 items-center gap-1.5 rounded px-2 text-[length:var(--tx-sm)] font-medium text-[var(--ink-secondary)] transition-colors hover:bg-[var(--bg-hover)] hover:text-[var(--ink-primary)] aria-pressed:bg-[var(--accent-soft)] aria-pressed:text-[var(--accent-on-soft)] focus-visible:outline-none focus-visible:shadow-[var(--shadow-focus)]",
|
|
7110
7147
|
children: [
|
|
7111
7148
|
/* @__PURE__ */ jsx26(TwGlyphIcon, { name: "bar-blocks", className: "h-3.5 w-3.5", "aria-hidden": "true" }),
|
|
7112
|
-
/* @__PURE__ */ jsx26("span", { className: atLeastStandard ? "inline" : "hidden", children:
|
|
7149
|
+
/* @__PURE__ */ jsx26("span", { className: atLeastStandard ? "inline" : "hidden", children: strings.analyticsLabel })
|
|
7113
7150
|
]
|
|
7114
7151
|
}
|
|
7115
7152
|
) : null,
|
|
@@ -12397,6 +12434,7 @@ var STATUS_POSTURE_PIP_CLASS = {
|
|
|
12397
12434
|
blocked: "bg-[var(--sem-error)]"
|
|
12398
12435
|
};
|
|
12399
12436
|
function TwStatusBar(props) {
|
|
12437
|
+
const strings = useChromeStrings();
|
|
12400
12438
|
const responsiveTier = props.responsiveTier ?? "wide";
|
|
12401
12439
|
const atLeastCompact = responsiveTier !== "mobile";
|
|
12402
12440
|
const atLeastStandard = responsiveTier === "standard" || responsiveTier === "wide";
|
|
@@ -12406,7 +12444,7 @@ function TwStatusBar(props) {
|
|
|
12406
12444
|
const showPosture = segmentVisible("status-save-state");
|
|
12407
12445
|
const preservationStatusMessage = getPreserveOnlyStatusMessage(props.preserveOnlyCount);
|
|
12408
12446
|
const savePosture = props.isDirty ? "unsaved" : "ready";
|
|
12409
|
-
const saveLabel = props.isDirty ?
|
|
12447
|
+
const saveLabel = props.isDirty ? strings.unsavedLabel : strings.savedLabel;
|
|
12410
12448
|
const showExportPosture = showPosture && props.isExportBlocked;
|
|
12411
12449
|
const showOpenChangesPosture = showPosture && props.changeCount > 0;
|
|
12412
12450
|
const openChangesLabel = `${props.changeCount} ${props.changeCount === 1 ? "change" : "changes"}`;
|
|
@@ -12436,7 +12474,7 @@ function TwStatusBar(props) {
|
|
|
12436
12474
|
const showZoomControls = (props.zoomLevel != null || props.onZoomChange) && segmentVisible("status-zoom");
|
|
12437
12475
|
const trackingEnabled = Boolean(props.trackedChangesAuthoringEnabled);
|
|
12438
12476
|
const trackingDisabled = props.trackedChangesAuthoringDisabled === true || !props.onTrackedChangesAuthoringChange;
|
|
12439
|
-
const trackingTitle = trackingEnabled ?
|
|
12477
|
+
const trackingTitle = trackingEnabled ? strings.trackingOnDetail : strings.trackingOffDetail;
|
|
12440
12478
|
const trackingControlTitle = trackingDisabled && props.trackedChangesAuthoringDisabledReason ? props.trackedChangesAuthoringDisabledReason : trackingTitle;
|
|
12441
12479
|
const statusChromeMode = segmentVisible("status-mode") ? normalizeStatusChromeMode(props.chromeMode) : null;
|
|
12442
12480
|
const modeLabel = statusChromeMode ? formatStatusChromeModeLabel(statusChromeMode) : null;
|
|
@@ -12515,7 +12553,7 @@ function TwStatusBar(props) {
|
|
|
12515
12553
|
className: "inline-flex items-center gap-1",
|
|
12516
12554
|
"data-testid": "status-bar-posture-export",
|
|
12517
12555
|
"data-posture": "blocked",
|
|
12518
|
-
title:
|
|
12556
|
+
title: strings.exportBlockedLabel,
|
|
12519
12557
|
children: [
|
|
12520
12558
|
/* @__PURE__ */ jsx37(
|
|
12521
12559
|
"span",
|
|
@@ -12524,7 +12562,7 @@ function TwStatusBar(props) {
|
|
|
12524
12562
|
className: `h-1.5 w-1.5 shrink-0 rounded-[1px] ${STATUS_POSTURE_PIP_CLASS.blocked}`
|
|
12525
12563
|
}
|
|
12526
12564
|
),
|
|
12527
|
-
/* @__PURE__ */ jsx37("span", { className: atLeastCompact ? "" : "hidden", children:
|
|
12565
|
+
/* @__PURE__ */ jsx37("span", { className: atLeastCompact ? "" : "hidden", children: strings.exportBlockedLabel })
|
|
12528
12566
|
]
|
|
12529
12567
|
}
|
|
12530
12568
|
) : null,
|
|
@@ -12558,7 +12596,7 @@ function TwStatusBar(props) {
|
|
|
12558
12596
|
className: "flex shrink-0 items-center overflow-hidden",
|
|
12559
12597
|
"data-testid": "status-bar-page-anchored-stories",
|
|
12560
12598
|
"data-chrome-unit-id": "status-page-anchored-stories",
|
|
12561
|
-
"aria-label":
|
|
12599
|
+
"aria-label": strings.pageAnchoredStoriesNotShownLabel,
|
|
12562
12600
|
title: `${hiddenStoryCount} page-anchored ${hiddenStoryCount === 1 ? "story" : "stories"} (headers, footers, notes) ${hiddenStoryCount === 1 ? "is" : "are"} not shown in this view`,
|
|
12563
12601
|
children: /* @__PURE__ */ jsxs26("span", { className: "inline-flex h-5 items-center gap-1 rounded-[var(--r-2)] px-1.5 text-[var(--text-secondary)]", children: [
|
|
12564
12602
|
hiddenStoryCount,
|
|
@@ -12573,12 +12611,12 @@ function TwStatusBar(props) {
|
|
|
12573
12611
|
className: `flex shrink-0 items-center overflow-hidden ${isWide ? "w-[8.75rem]" : atLeastCompact ? "w-[4rem]" : "w-7"}`,
|
|
12574
12612
|
"data-testid": "status-bar-track-changes",
|
|
12575
12613
|
"data-chrome-unit-id": "status-track-changes",
|
|
12576
|
-
"aria-label":
|
|
12614
|
+
"aria-label": strings.trackChangesAuthoringLabel,
|
|
12577
12615
|
children: /* @__PURE__ */ jsxs26(
|
|
12578
12616
|
"button",
|
|
12579
12617
|
{
|
|
12580
12618
|
type: "button",
|
|
12581
|
-
"aria-label":
|
|
12619
|
+
"aria-label": strings.trackedChangesLabel,
|
|
12582
12620
|
"aria-pressed": trackingEnabled,
|
|
12583
12621
|
disabled: trackingDisabled,
|
|
12584
12622
|
onClick: () => props.onTrackedChangesAuthoringChange?.(!trackingEnabled),
|
|
@@ -12615,7 +12653,7 @@ function TwStatusBar(props) {
|
|
|
12615
12653
|
className: `shrink-0 items-center gap-1 overflow-hidden ${atLeastStandard ? "flex" : "hidden"} ${isWide ? "w-[8.75rem]" : "w-[4.25rem]"}`,
|
|
12616
12654
|
"data-testid": "status-bar-markup-mode",
|
|
12617
12655
|
"data-chrome-unit-id": "status-markup-display",
|
|
12618
|
-
"aria-label":
|
|
12656
|
+
"aria-label": strings.markupDisplayLabel,
|
|
12619
12657
|
children: [
|
|
12620
12658
|
/* @__PURE__ */ jsx37(
|
|
12621
12659
|
"div",
|
|
@@ -12752,13 +12790,13 @@ function TwStatusBar(props) {
|
|
|
12752
12790
|
className: "flex w-11 shrink-0 items-center gap-px",
|
|
12753
12791
|
"data-testid": "status-bar-workspace-mode",
|
|
12754
12792
|
"data-chrome-unit-id": "status-workspace-view",
|
|
12755
|
-
"aria-label":
|
|
12793
|
+
"aria-label": strings.workspaceViewLabel,
|
|
12756
12794
|
children: [
|
|
12757
12795
|
/* @__PURE__ */ jsx37(
|
|
12758
12796
|
StatusChromeButton,
|
|
12759
12797
|
{
|
|
12760
12798
|
active: props.workspace === "canvas",
|
|
12761
|
-
ariaLabel:
|
|
12799
|
+
ariaLabel: strings.canvasViewLabel,
|
|
12762
12800
|
disabled: !props.onWorkspaceModeChange,
|
|
12763
12801
|
onClick: () => props.onWorkspaceModeChange?.("canvas"),
|
|
12764
12802
|
children: /* @__PURE__ */ jsx37(TwGlyphIcon, { name: "desktop", className: "h-3 w-3", "aria-hidden": "true" })
|
|
@@ -12768,7 +12806,7 @@ function TwStatusBar(props) {
|
|
|
12768
12806
|
StatusChromeButton,
|
|
12769
12807
|
{
|
|
12770
12808
|
active: props.workspace === "page",
|
|
12771
|
-
ariaLabel:
|
|
12809
|
+
ariaLabel: strings.pageViewLabel,
|
|
12772
12810
|
disabled: !props.onWorkspaceModeChange,
|
|
12773
12811
|
onClick: () => props.onWorkspaceModeChange?.("page"),
|
|
12774
12812
|
children: /* @__PURE__ */ jsx37(TwGlyphIcon, { name: "document", className: "h-3 w-3", "aria-hidden": "true" })
|
|
@@ -12788,13 +12826,13 @@ function TwStatusBar(props) {
|
|
|
12788
12826
|
].join(" "),
|
|
12789
12827
|
"data-testid": "status-bar-zoom",
|
|
12790
12828
|
"data-chrome-unit-id": "status-zoom",
|
|
12791
|
-
"aria-label":
|
|
12829
|
+
"aria-label": strings.zoomControlsLabel,
|
|
12792
12830
|
children: [
|
|
12793
12831
|
/* @__PURE__ */ jsx37(
|
|
12794
12832
|
"button",
|
|
12795
12833
|
{
|
|
12796
12834
|
type: "button",
|
|
12797
|
-
"aria-label":
|
|
12835
|
+
"aria-label": strings.zoomOutLabel,
|
|
12798
12836
|
disabled: !canDecreaseZoom,
|
|
12799
12837
|
onClick: () => applyZoom(zoomPercent - STATUS_ZOOM_BUTTON_STEP),
|
|
12800
12838
|
className: [
|
|
@@ -12806,7 +12844,7 @@ function TwStatusBar(props) {
|
|
|
12806
12844
|
/* @__PURE__ */ jsx37(
|
|
12807
12845
|
"input",
|
|
12808
12846
|
{
|
|
12809
|
-
"aria-label":
|
|
12847
|
+
"aria-label": strings.zoomLevelLabel,
|
|
12810
12848
|
type: "range",
|
|
12811
12849
|
min: Math.min(STATUS_ZOOM_MIN, Math.floor(zoomPercent / STATUS_ZOOM_STEP) * STATUS_ZOOM_STEP),
|
|
12812
12850
|
max: STATUS_ZOOM_MAX,
|
|
@@ -12837,7 +12875,7 @@ function TwStatusBar(props) {
|
|
|
12837
12875
|
"button",
|
|
12838
12876
|
{
|
|
12839
12877
|
type: "button",
|
|
12840
|
-
"aria-label":
|
|
12878
|
+
"aria-label": strings.zoomInLabel,
|
|
12841
12879
|
disabled: !canIncreaseZoom,
|
|
12842
12880
|
onClick: () => applyZoom(zoomPercent + STATUS_ZOOM_BUTTON_STEP),
|
|
12843
12881
|
className: [
|
|
@@ -19090,6 +19128,7 @@ function ChromePresetToolbar(props) {
|
|
|
19090
19128
|
// src/ui-tailwind/toolbar/tw-analytics-ribbon.tsx
|
|
19091
19129
|
import { jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
19092
19130
|
function TwAnalyticsRibbon(props) {
|
|
19131
|
+
const strings = useChromeStrings();
|
|
19093
19132
|
const commentThreads = props.comments?.threads ?? [];
|
|
19094
19133
|
const resolvedCommentIds = props.comments?.resolvedCommentIds ?? [];
|
|
19095
19134
|
const revisions = props.trackedChanges?.revisions ?? [];
|
|
@@ -19110,7 +19149,7 @@ function TwAnalyticsRibbon(props) {
|
|
|
19110
19149
|
const scopeCount = scopeRailSegments.length;
|
|
19111
19150
|
const toolCount = props.toolRegistry?.editorActions.length ?? props.toolRegistry?.commandPalette.length ?? 0;
|
|
19112
19151
|
const state = blocked > 0 ? "blocked" : openComments + pendingChanges + tasks + approvals === 0 ? "empty" : "ready";
|
|
19113
|
-
const recentAction = props.contextAnalytics?.nextActions[0]?.label ?? (blocked > 0 ?
|
|
19152
|
+
const recentAction = props.contextAnalytics?.nextActions[0]?.label ?? (blocked > 0 ? strings.resolveBlockersAction : pendingChanges > 0 ? strings.reviewPendingChangesAction : openComments > 0 ? strings.openCommentThreadAction : strings.documentReadyAction);
|
|
19114
19153
|
const nextActions = (props.contextAnalytics?.nextActions ?? []).slice(0, 2).map((action) => action.label);
|
|
19115
19154
|
const visibleNextActions = nextActions.length > 0 ? nextActions : [recentAction];
|
|
19116
19155
|
return /* @__PURE__ */ jsxs33(
|
|
@@ -19118,34 +19157,35 @@ function TwAnalyticsRibbon(props) {
|
|
|
19118
19157
|
{
|
|
19119
19158
|
className: "flex h-full min-w-0 flex-1 items-center overflow-hidden px-1",
|
|
19120
19159
|
"data-testid": "tw-analytics-ribbon",
|
|
19160
|
+
"data-chrome-unit-id": "chrome.ribbon",
|
|
19121
19161
|
"data-region": "rib-analytics",
|
|
19122
19162
|
"data-analytics-state": state,
|
|
19123
19163
|
"data-analytics-review-items": totalReviewItems,
|
|
19124
19164
|
"data-analytics-tool-registry-count": toolCount,
|
|
19125
19165
|
children: [
|
|
19126
|
-
/* @__PURE__ */ jsxs33(TwRibbonGroup, { label:
|
|
19127
|
-
/* @__PURE__ */ jsx48(FactCell, { label:
|
|
19128
|
-
/* @__PURE__ */ jsx48(FactCell, { label:
|
|
19129
|
-
/* @__PURE__ */ jsx48(FactCell, { label:
|
|
19166
|
+
/* @__PURE__ */ jsxs33(TwRibbonGroup, { label: strings.documentGroupLabel, children: [
|
|
19167
|
+
/* @__PURE__ */ jsx48(FactCell, { label: strings.pagesLabel, value: props.pageCount == null ? "..." : String(props.pageCount) }),
|
|
19168
|
+
/* @__PURE__ */ jsx48(FactCell, { label: strings.charsLabel, value: formatCompactNumber(props.documentStats?.storyLength ?? 0) }),
|
|
19169
|
+
/* @__PURE__ */ jsx48(FactCell, { label: strings.exportLabel, value: props.exportBlocked ? strings.blockedLabel : strings.readyLabel, tone: props.exportBlocked ? "blocked" : "ready" })
|
|
19130
19170
|
] }),
|
|
19131
|
-
/* @__PURE__ */ jsxs33(TwRibbonGroup, { label:
|
|
19132
|
-
/* @__PURE__ */ jsx48(FactCell, { label:
|
|
19133
|
-
/* @__PURE__ */ jsx48(MetricCell, { label:
|
|
19134
|
-
/* @__PURE__ */ jsx48(MetricCell, { label:
|
|
19171
|
+
/* @__PURE__ */ jsxs33(TwRibbonGroup, { label: strings.reviewGroupLabel, children: [
|
|
19172
|
+
/* @__PURE__ */ jsx48(FactCell, { label: strings.itemsLabel, value: String(totalReviewItems), tone: totalReviewItems > 0 ? "attention" : "neutral" }),
|
|
19173
|
+
/* @__PURE__ */ jsx48(MetricCell, { label: strings.changesLabel, value: pendingChanges, color: "var(--sem-warning)" }),
|
|
19174
|
+
/* @__PURE__ */ jsx48(MetricCell, { label: strings.commentsLabel, value: openComments, color: "var(--markup-comment-ink)" })
|
|
19135
19175
|
] }),
|
|
19136
|
-
/* @__PURE__ */ jsxs33(TwRibbonGroup, { label:
|
|
19137
|
-
/* @__PURE__ */ jsx48(FactCell, { label:
|
|
19138
|
-
/* @__PURE__ */ jsx48(FactCell, { label:
|
|
19176
|
+
/* @__PURE__ */ jsxs33(TwRibbonGroup, { label: strings.riskGroupLabel, children: [
|
|
19177
|
+
/* @__PURE__ */ jsx48(FactCell, { label: strings.opaqueLabel, value: String(props.documentStats?.opaqueFragmentCount ?? 0), tone: (props.documentStats?.opaqueFragmentCount ?? 0) > 0 ? "attention" : "neutral" }),
|
|
19178
|
+
/* @__PURE__ */ jsx48(FactCell, { label: strings.blockedLabel, value: String(blocked), tone: blocked > 0 ? "blocked" : "neutral" })
|
|
19139
19179
|
] }),
|
|
19140
|
-
/* @__PURE__ */ jsxs33(TwRibbonGroup, { label:
|
|
19141
|
-
/* @__PURE__ */ jsx48(FactCell, { label:
|
|
19142
|
-
/* @__PURE__ */ jsx48(MetricCell, { label:
|
|
19143
|
-
/* @__PURE__ */ jsx48(MetricCell, { label:
|
|
19144
|
-
/* @__PURE__ */ jsx48(MetricCell, { label:
|
|
19180
|
+
/* @__PURE__ */ jsxs33(TwRibbonGroup, { label: strings.workflowGroupLabel, children: [
|
|
19181
|
+
/* @__PURE__ */ jsx48(FactCell, { label: strings.scopesLabel, value: String(scopeCount) }),
|
|
19182
|
+
/* @__PURE__ */ jsx48(MetricCell, { label: strings.tasksLabel, value: tasks, color: "var(--mode-workflow)" }),
|
|
19183
|
+
/* @__PURE__ */ jsx48(MetricCell, { label: strings.approvalsLabel, value: approvals, color: "var(--scope-review-marker)" }),
|
|
19184
|
+
/* @__PURE__ */ jsx48(MetricCell, { label: strings.blockedLabel, value: blocked, color: "var(--sem-error)" })
|
|
19145
19185
|
] }),
|
|
19146
|
-
/* @__PURE__ */ jsx48(TwRibbonGroup, { label:
|
|
19147
|
-
toolCount > 0 ? /* @__PURE__ */ jsx48(TwRibbonGroup, { label:
|
|
19148
|
-
/* @__PURE__ */ jsx48(TwRibbonGroup, { label:
|
|
19186
|
+
/* @__PURE__ */ jsx48(TwRibbonGroup, { label: strings.scopesGroupLabel, children: /* @__PURE__ */ jsx48(ScopeBreakdown, { segments: scopeRailSegments, label: strings.scopeBreakdownLabel }) }),
|
|
19187
|
+
toolCount > 0 ? /* @__PURE__ */ jsx48(TwRibbonGroup, { label: strings.toolsGroupLabel, children: /* @__PURE__ */ jsx48(FactCell, { label: strings.toolsGroupLabel, value: String(toolCount) }) }) : null,
|
|
19188
|
+
/* @__PURE__ */ jsx48(TwRibbonGroup, { label: strings.nextGroupLabel, children: visibleNextActions.slice(0, 2).map((action, index) => /* @__PURE__ */ jsx48(
|
|
19149
19189
|
"span",
|
|
19150
19190
|
{
|
|
19151
19191
|
className: "max-w-28 truncate px-1 text-[length:var(--tx-xs)] font-medium text-[var(--ink-secondary)]",
|
|
@@ -19199,7 +19239,7 @@ function ScopeBreakdown(props) {
|
|
|
19199
19239
|
"div",
|
|
19200
19240
|
{
|
|
19201
19241
|
className: "flex h-2 w-28 overflow-hidden rounded-[var(--r-1)] bg-[var(--bg-muted)]",
|
|
19202
|
-
"aria-label":
|
|
19242
|
+
"aria-label": props.label,
|
|
19203
19243
|
role: "img",
|
|
19204
19244
|
children: [
|
|
19205
19245
|
/* @__PURE__ */ jsx48(BreakdownSegment, { value: counts.edit, total, color: "var(--scope-edit-marker)" }),
|