@pptx-editor.dev/react 0.6.0 → 0.6.1-canary.20261119032858.sha-95106bb
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/index.js +512 -491
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -983,11 +983,11 @@ import {
|
|
|
983
983
|
// src/PptxEditorRoot.tsx
|
|
984
984
|
import {
|
|
985
985
|
forwardRef,
|
|
986
|
-
useEffect as
|
|
986
|
+
useEffect as useEffect40,
|
|
987
987
|
useImperativeHandle,
|
|
988
988
|
useLayoutEffect as useLayoutEffect19,
|
|
989
989
|
useMemo as useMemo19,
|
|
990
|
-
useRef as
|
|
990
|
+
useRef as useRef48,
|
|
991
991
|
useState as useState51
|
|
992
992
|
} from "react";
|
|
993
993
|
import {
|
|
@@ -7012,9 +7012,9 @@ function useCanvasContextMenu() {
|
|
|
7012
7012
|
|
|
7013
7013
|
// src/SlideSorter.tsx
|
|
7014
7014
|
import {
|
|
7015
|
-
useEffect as
|
|
7015
|
+
useEffect as useEffect38,
|
|
7016
7016
|
useLayoutEffect as useLayoutEffect17,
|
|
7017
|
-
useRef as
|
|
7017
|
+
useRef as useRef46,
|
|
7018
7018
|
useState as useState49
|
|
7019
7019
|
} from "react";
|
|
7020
7020
|
import {
|
|
@@ -7038,12 +7038,12 @@ import {
|
|
|
7038
7038
|
// src/panes.tsx
|
|
7039
7039
|
import {
|
|
7040
7040
|
memo as memo2,
|
|
7041
|
-
useEffect as
|
|
7041
|
+
useEffect as useEffect37,
|
|
7042
7042
|
useId as useId21,
|
|
7043
7043
|
useLayoutEffect as useLayoutEffect16,
|
|
7044
7044
|
useMemo as useMemo18,
|
|
7045
|
-
useReducer,
|
|
7046
|
-
useRef as
|
|
7045
|
+
useReducer as useReducer2,
|
|
7046
|
+
useRef as useRef45,
|
|
7047
7047
|
useState as useState48
|
|
7048
7048
|
} from "react";
|
|
7049
7049
|
import {
|
|
@@ -8414,7 +8414,7 @@ function RenameField(props) {
|
|
|
8414
8414
|
}
|
|
8415
8415
|
|
|
8416
8416
|
// src/SidePanel.tsx
|
|
8417
|
-
import { useEffect as
|
|
8417
|
+
import { useEffect as useEffect33, useRef as useRef42, useState as useState45 } from "react";
|
|
8418
8418
|
import {
|
|
8419
8419
|
SIDE_PANEL_TAB_ICONS,
|
|
8420
8420
|
listenPaneRequests,
|
|
@@ -8425,7 +8425,7 @@ import {
|
|
|
8425
8425
|
} from "@pptx-editor.dev/core/editor";
|
|
8426
8426
|
|
|
8427
8427
|
// src/AnimationsPane.tsx
|
|
8428
|
-
import { useEffect as
|
|
8428
|
+
import { useEffect as useEffect27, useId as useId13, useState as useState32 } from "react";
|
|
8429
8429
|
import {
|
|
8430
8430
|
ANIMATION_PRESET_GROUPS,
|
|
8431
8431
|
ANIMATION_TRIGGERS,
|
|
@@ -8434,9 +8434,29 @@ import {
|
|
|
8434
8434
|
animationListParts,
|
|
8435
8435
|
animationStartLabel,
|
|
8436
8436
|
parseSeconds,
|
|
8437
|
+
sameFormatNumber,
|
|
8437
8438
|
secondsText,
|
|
8438
8439
|
transitionKindLabelKey
|
|
8439
8440
|
} from "@pptx-editor.dev/core/editor";
|
|
8441
|
+
|
|
8442
|
+
// src/live-field.ts
|
|
8443
|
+
import { useEffect as useEffect26, useReducer, useRef as useRef29, useState as useState31 } from "react";
|
|
8444
|
+
import { createLiveField } from "@pptx-editor.dev/core/editor";
|
|
8445
|
+
function useLiveField(host, scope) {
|
|
8446
|
+
const [, render2] = useReducer((n) => n + 1, 0);
|
|
8447
|
+
const latest = useRef29(host);
|
|
8448
|
+
latest.current = host;
|
|
8449
|
+
const [field] = useState31(() => createLiveField(() => latest.current, render2));
|
|
8450
|
+
const [seen, setSeen] = useState31(scope);
|
|
8451
|
+
if (!Object.is(seen, scope)) {
|
|
8452
|
+
setSeen(scope);
|
|
8453
|
+
field.sync();
|
|
8454
|
+
}
|
|
8455
|
+
useEffect26(() => () => field.dispose(), [field]);
|
|
8456
|
+
return field;
|
|
8457
|
+
}
|
|
8458
|
+
|
|
8459
|
+
// src/AnimationsPane.tsx
|
|
8440
8460
|
import { jsx as jsx35, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
8441
8461
|
function SecondsField({
|
|
8442
8462
|
label,
|
|
@@ -8445,20 +8465,23 @@ function SecondsField({
|
|
|
8445
8465
|
onCommit
|
|
8446
8466
|
}) {
|
|
8447
8467
|
const { t } = useTranslation();
|
|
8468
|
+
const editor = usePptxEditor();
|
|
8448
8469
|
const errorId = useId13();
|
|
8449
|
-
const [draft, setDraft] = useState31(null);
|
|
8450
|
-
const [invalid, setInvalid] = useState31(false);
|
|
8451
8470
|
const shown = secondsText(ms);
|
|
8452
|
-
const
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8471
|
+
const field = useLiveField(
|
|
8472
|
+
{
|
|
8473
|
+
editor,
|
|
8474
|
+
value: () => shown,
|
|
8475
|
+
same: sameFormatNumber,
|
|
8476
|
+
write(text, options, final) {
|
|
8477
|
+
const value = parseSeconds(text);
|
|
8478
|
+
if (value !== null && onCommit(value, options)) return null;
|
|
8479
|
+
return final ? t("panel.animations.invalidTime") : void 0;
|
|
8480
|
+
}
|
|
8481
|
+
},
|
|
8482
|
+
shown
|
|
8483
|
+
);
|
|
8484
|
+
const invalid = field.error !== null;
|
|
8462
8485
|
return /* @__PURE__ */ jsxs32("label", { className: "pptx-field", children: [
|
|
8463
8486
|
label,
|
|
8464
8487
|
/* @__PURE__ */ jsxs32("span", { className: "pptx-field__control", children: [
|
|
@@ -8469,20 +8492,21 @@ function SecondsField({
|
|
|
8469
8492
|
"aria-label": label,
|
|
8470
8493
|
"aria-invalid": invalid,
|
|
8471
8494
|
"aria-describedby": invalid ? errorId : void 0,
|
|
8472
|
-
value: draft ?? shown,
|
|
8495
|
+
value: field.draft ?? shown,
|
|
8473
8496
|
disabled,
|
|
8474
|
-
"data-draft": draft !== null,
|
|
8475
|
-
onChange: (e) =>
|
|
8476
|
-
|
|
8497
|
+
"data-draft": field.draft !== null,
|
|
8498
|
+
onChange: (e) => field.input(e.target.value, e.nativeEvent.isComposing === true),
|
|
8499
|
+
onCompositionEnd: (e) => field.input(e.currentTarget.value),
|
|
8500
|
+
onBlur: () => field.commit(),
|
|
8477
8501
|
onKeyDown: (e) => {
|
|
8478
|
-
if (e.key === "Enter") commit();
|
|
8479
|
-
if (e.key === "Escape")
|
|
8502
|
+
if (e.key === "Enter") field.commit();
|
|
8503
|
+
if (e.key === "Escape") field.cancel();
|
|
8480
8504
|
}
|
|
8481
8505
|
}
|
|
8482
8506
|
),
|
|
8483
8507
|
/* @__PURE__ */ jsx35("span", { className: "pptx-field__unit", children: t("panel.animations.secondsUnit") })
|
|
8484
8508
|
] }),
|
|
8485
|
-
invalid ? /* @__PURE__ */ jsx35("span", { id: errorId, className: "pptx-animations__error", role: "alert", children:
|
|
8509
|
+
invalid ? /* @__PURE__ */ jsx35("span", { id: errorId, className: "pptx-animations__error", role: "alert", children: field.error }) : null
|
|
8486
8510
|
] });
|
|
8487
8511
|
}
|
|
8488
8512
|
function TransitionSection({ disabled }) {
|
|
@@ -8492,7 +8516,7 @@ function TransitionSection({ disabled }) {
|
|
|
8492
8516
|
const slideCount = useEditorState((s) => s.slides.length);
|
|
8493
8517
|
const kindId = useId13();
|
|
8494
8518
|
if (!transition) return null;
|
|
8495
|
-
const set = (change) => editor?.exec({ type: "setTransition", ...change }).ok === true;
|
|
8519
|
+
const set = (change, options) => editor?.exec({ type: "setTransition", ...change }, options).ok === true;
|
|
8496
8520
|
return /* @__PURE__ */ jsxs32("div", { className: "pptx-panel__section", children: [
|
|
8497
8521
|
/* @__PURE__ */ jsx35("h3", { className: "pptx-panel__title", children: t("panel.animations.transition") }),
|
|
8498
8522
|
/* @__PURE__ */ jsxs32("label", { className: "pptx-field", htmlFor: kindId, children: [
|
|
@@ -8519,7 +8543,7 @@ function TransitionSection({ disabled }) {
|
|
|
8519
8543
|
label: t("panel.animations.duration"),
|
|
8520
8544
|
ms: transition.durationMs,
|
|
8521
8545
|
disabled: disabled || transition.kind === "none",
|
|
8522
|
-
onCommit: (ms) => set({ durationMs: ms })
|
|
8546
|
+
onCommit: (ms, options) => set({ durationMs: ms }, options)
|
|
8523
8547
|
}
|
|
8524
8548
|
),
|
|
8525
8549
|
/* @__PURE__ */ jsx35(
|
|
@@ -8528,7 +8552,7 @@ function TransitionSection({ disabled }) {
|
|
|
8528
8552
|
label: t("panel.animations.advanceAfter"),
|
|
8529
8553
|
ms: transition.advanceAfterMs ?? 0,
|
|
8530
8554
|
disabled: disabled || transition.advanceAfterMs === null,
|
|
8531
|
-
onCommit: (ms) => set({ advanceAfterMs: ms })
|
|
8555
|
+
onCommit: (ms, options) => set({ advanceAfterMs: ms }, options)
|
|
8532
8556
|
}
|
|
8533
8557
|
)
|
|
8534
8558
|
] }),
|
|
@@ -8620,7 +8644,7 @@ function EffectFields({
|
|
|
8620
8644
|
const editor = usePptxEditor();
|
|
8621
8645
|
const startId = useId13();
|
|
8622
8646
|
const off = disabled || !effect.editable;
|
|
8623
|
-
const timing = (change) => editor?.exec({ type: "setAnimationTiming", effectId: effect.id, ...change }).ok === true;
|
|
8647
|
+
const timing = (change, options) => editor?.exec({ type: "setAnimationTiming", effectId: effect.id, ...change }, options).ok === true;
|
|
8624
8648
|
return /* @__PURE__ */ jsxs32("div", { className: "pptx-panel__section pptx-animations__fields", children: [
|
|
8625
8649
|
/* @__PURE__ */ jsxs32("label", { className: "pptx-field", htmlFor: startId, children: [
|
|
8626
8650
|
t("panel.animations.start"),
|
|
@@ -8643,7 +8667,7 @@ function EffectFields({
|
|
|
8643
8667
|
label: t("panel.animations.delay"),
|
|
8644
8668
|
ms: effect.delayMs,
|
|
8645
8669
|
disabled: off,
|
|
8646
|
-
onCommit: (ms) => timing({ delayMs: ms })
|
|
8670
|
+
onCommit: (ms, options) => timing({ delayMs: ms }, options)
|
|
8647
8671
|
}
|
|
8648
8672
|
),
|
|
8649
8673
|
/* @__PURE__ */ jsx35(
|
|
@@ -8652,7 +8676,7 @@ function EffectFields({
|
|
|
8652
8676
|
label: t("panel.animations.duration"),
|
|
8653
8677
|
ms: effect.durationMs ?? 0,
|
|
8654
8678
|
disabled: off || effect.durationMs === null,
|
|
8655
|
-
onCommit: (ms) => timing({ durationMs: ms })
|
|
8679
|
+
onCommit: (ms, options) => timing({ durationMs: ms }, options)
|
|
8656
8680
|
}
|
|
8657
8681
|
)
|
|
8658
8682
|
] }),
|
|
@@ -8693,12 +8717,12 @@ function AnimationsPane() {
|
|
|
8693
8717
|
const animations = useEditorState((s) => s.animations);
|
|
8694
8718
|
const readOnly = useEditorState((s) => s.status !== "ready" || s.mode === "view");
|
|
8695
8719
|
const hasSelection = useEditorState((s) => s.selection.kind !== "none");
|
|
8696
|
-
const [preset, setPreset] =
|
|
8720
|
+
const [preset, setPreset] = useState32("fade");
|
|
8697
8721
|
const slide = useEditorState((s) => s.currentSlide);
|
|
8698
|
-
const [chosen, setChosen] =
|
|
8722
|
+
const [chosen, setChosen] = useState32(null);
|
|
8699
8723
|
const presetId = useId13();
|
|
8700
8724
|
const listId = useId13();
|
|
8701
|
-
|
|
8725
|
+
useEffect27(() => {
|
|
8702
8726
|
if (!editor) return;
|
|
8703
8727
|
editor.exec({ type: "showAnimationOrder", show: true });
|
|
8704
8728
|
return () => void editor.exec({ type: "showAnimationOrder", show: false });
|
|
@@ -8782,7 +8806,7 @@ function AnimationsPane() {
|
|
|
8782
8806
|
}
|
|
8783
8807
|
|
|
8784
8808
|
// src/ChartDataPane.tsx
|
|
8785
|
-
import { useId as useId14, useRef as
|
|
8809
|
+
import { useId as useId14, useRef as useRef30, useState as useState33 } from "react";
|
|
8786
8810
|
import {
|
|
8787
8811
|
CHART_LEGEND_CHOICES,
|
|
8788
8812
|
CHART_TYPE_CHOICES,
|
|
@@ -8800,7 +8824,8 @@ import {
|
|
|
8800
8824
|
focusChartRow,
|
|
8801
8825
|
colorPickOf as colorPickOf2,
|
|
8802
8826
|
nextChartCategoryLabel,
|
|
8803
|
-
renderedColorOf as renderedColorOf2
|
|
8827
|
+
renderedColorOf as renderedColorOf2,
|
|
8828
|
+
sameFormatNumber as sameFormatNumber2
|
|
8804
8829
|
} from "@pptx-editor.dev/core/editor";
|
|
8805
8830
|
import { Fragment as Fragment29, jsx as jsx36, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8806
8831
|
function ChartField({
|
|
@@ -8813,25 +8838,20 @@ function ChartField({
|
|
|
8813
8838
|
onCommit
|
|
8814
8839
|
}) {
|
|
8815
8840
|
const errorId = useId14();
|
|
8816
|
-
const
|
|
8817
|
-
const
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
if (draft === value) return reset();
|
|
8831
|
-
const refused = onCommit(draft);
|
|
8832
|
-
if (refused === null) reset();
|
|
8833
|
-
else setError(refused);
|
|
8834
|
-
};
|
|
8841
|
+
const editor = usePptxEditor();
|
|
8842
|
+
const field = useLiveField(
|
|
8843
|
+
{
|
|
8844
|
+
editor,
|
|
8845
|
+
value: () => value,
|
|
8846
|
+
...numeric ? { same: sameFormatNumber2 } : {},
|
|
8847
|
+
write: (text, options, final) => {
|
|
8848
|
+
const refused = onCommit(text, options);
|
|
8849
|
+
return refused === null || final ? refused : void 0;
|
|
8850
|
+
}
|
|
8851
|
+
},
|
|
8852
|
+
`${draftKey}\0${value}`
|
|
8853
|
+
);
|
|
8854
|
+
const error = field.error;
|
|
8835
8855
|
return /* @__PURE__ */ jsxs33("label", { className: "pptx-field pptx-chart-pane__field", children: [
|
|
8836
8856
|
visibleLabel ? /* @__PURE__ */ jsx36("span", { className: "pptx-chart-pane__label", children: visibleLabel }) : null,
|
|
8837
8857
|
/* @__PURE__ */ jsx36(
|
|
@@ -8841,14 +8861,15 @@ function ChartField({
|
|
|
8841
8861
|
inputMode: numeric ? "decimal" : void 0,
|
|
8842
8862
|
"aria-invalid": error !== null,
|
|
8843
8863
|
"aria-describedby": error !== null ? errorId : void 0,
|
|
8844
|
-
value: draft ?? value,
|
|
8864
|
+
value: field.draft ?? value,
|
|
8845
8865
|
disabled,
|
|
8846
|
-
"data-draft": draft !== null,
|
|
8847
|
-
onChange: (e) =>
|
|
8848
|
-
|
|
8866
|
+
"data-draft": field.draft !== null,
|
|
8867
|
+
onChange: (e) => field.input(e.target.value, e.nativeEvent.isComposing === true),
|
|
8868
|
+
onCompositionEnd: (e) => field.input(e.currentTarget.value),
|
|
8869
|
+
onBlur: () => field.commit(),
|
|
8849
8870
|
onKeyDown: (e) => {
|
|
8850
|
-
if (e.key === "Enter") commit();
|
|
8851
|
-
if (e.key === "Escape")
|
|
8871
|
+
if (e.key === "Enter") field.commit();
|
|
8872
|
+
if (e.key === "Escape") field.cancel();
|
|
8852
8873
|
}
|
|
8853
8874
|
}
|
|
8854
8875
|
),
|
|
@@ -8886,7 +8907,7 @@ function SeriesCard({
|
|
|
8886
8907
|
visibleLabel: t("chartData.name"),
|
|
8887
8908
|
value: series.name,
|
|
8888
8909
|
disabled,
|
|
8889
|
-
onCommit: (text) => apply({ type: "seriesName", series: index, text })
|
|
8910
|
+
onCommit: (text, options) => apply({ type: "seriesName", series: index, text }, options)
|
|
8890
8911
|
}
|
|
8891
8912
|
),
|
|
8892
8913
|
/* @__PURE__ */ jsx36("div", { className: "pptx-panel__grid", children: data.categories.map((c, i) => /* @__PURE__ */ jsx36(
|
|
@@ -8898,7 +8919,7 @@ function SeriesCard({
|
|
|
8898
8919
|
value: chartValueText(series.values[i]),
|
|
8899
8920
|
numeric: true,
|
|
8900
8921
|
disabled,
|
|
8901
|
-
onCommit: (text) => apply({ type: "value", series: index, category: i, text })
|
|
8922
|
+
onCommit: (text, options) => apply({ type: "value", series: index, category: i, text }, options)
|
|
8902
8923
|
},
|
|
8903
8924
|
i
|
|
8904
8925
|
)) }),
|
|
@@ -8951,7 +8972,7 @@ function ChartFormatSection({
|
|
|
8951
8972
|
const { t } = useTranslation();
|
|
8952
8973
|
const editor = usePptxEditor();
|
|
8953
8974
|
const rows = useEditorState((s) => s.themeColors);
|
|
8954
|
-
const [typeNote, setTypeNote] =
|
|
8975
|
+
const [typeNote, setTypeNote] = useState33(null);
|
|
8955
8976
|
const read = editor ? editor.chartFormat(nodeId) : null;
|
|
8956
8977
|
if (!read?.ok) return null;
|
|
8957
8978
|
const format = read.format;
|
|
@@ -9003,7 +9024,7 @@ function ChartFormatSection({
|
|
|
9003
9024
|
visibleLabel: t("chartFormat.titleText"),
|
|
9004
9025
|
value: format.title,
|
|
9005
9026
|
disabled,
|
|
9006
|
-
onCommit: (text) => run(chartTitleCommand(format, "title", text))
|
|
9027
|
+
onCommit: (text, options) => run(chartTitleCommand(format, "title", text), options)
|
|
9007
9028
|
}
|
|
9008
9029
|
) }) : null,
|
|
9009
9030
|
/* @__PURE__ */ jsx36(
|
|
@@ -9056,7 +9077,7 @@ function ChartFormatSection({
|
|
|
9056
9077
|
visibleLabel: t(axisLabels.category),
|
|
9057
9078
|
value: format.axisTitles?.category ?? "",
|
|
9058
9079
|
disabled: disabled || !format.axes,
|
|
9059
|
-
onCommit: (text) => run(chartTitleCommand(format, "categoryAxisTitle", text))
|
|
9080
|
+
onCommit: (text, options) => run(chartTitleCommand(format, "categoryAxisTitle", text), options)
|
|
9060
9081
|
}
|
|
9061
9082
|
),
|
|
9062
9083
|
/* @__PURE__ */ jsx36(
|
|
@@ -9067,7 +9088,7 @@ function ChartFormatSection({
|
|
|
9067
9088
|
visibleLabel: t(axisLabels.value),
|
|
9068
9089
|
value: format.axisTitles?.value ?? "",
|
|
9069
9090
|
disabled: disabled || !format.axes,
|
|
9070
|
-
onCommit: (text) => run(chartTitleCommand(format, "valueAxisTitle", text))
|
|
9091
|
+
onCommit: (text, options) => run(chartTitleCommand(format, "valueAxisTitle", text), options)
|
|
9071
9092
|
}
|
|
9072
9093
|
)
|
|
9073
9094
|
] }),
|
|
@@ -9099,10 +9120,10 @@ function ChartDataPane() {
|
|
|
9099
9120
|
useEditorState((s) => s.revision);
|
|
9100
9121
|
const readOnly = useEditorState((s) => s.mode === "view");
|
|
9101
9122
|
const read = editor && chart ? editor.chartData(chart.nodeId) : null;
|
|
9102
|
-
const [refusal, setRefusal] =
|
|
9103
|
-
const pane =
|
|
9104
|
-
const [open, setOpen] =
|
|
9105
|
-
const [draftScope, setDraftScope] =
|
|
9123
|
+
const [refusal, setRefusal] = useState33(null);
|
|
9124
|
+
const pane = useRef30(null);
|
|
9125
|
+
const [open, setOpen] = useState33(() => /* @__PURE__ */ new Set([0]));
|
|
9126
|
+
const [draftScope, setDraftScope] = useState33({ key: "", reset: 0 });
|
|
9106
9127
|
if (!chart || !read)
|
|
9107
9128
|
return /* @__PURE__ */ jsxs33("div", { className: "pptx-empty", children: [
|
|
9108
9129
|
/* @__PURE__ */ jsx36("p", { className: "pptx-empty__title", children: t("chartData.emptyTitle") }),
|
|
@@ -9122,19 +9143,19 @@ function ChartDataPane() {
|
|
|
9122
9143
|
if (nextScope !== draftScope) setDraftScope(nextScope);
|
|
9123
9144
|
const draftKey = String(nextScope.reset);
|
|
9124
9145
|
const disabled = readOnly || !chart.editable;
|
|
9125
|
-
const apply = (change) => {
|
|
9146
|
+
const apply = (change, options) => {
|
|
9126
9147
|
const command = chartPaneCommand(data, change);
|
|
9127
9148
|
if (!command.ok) return t(command.error);
|
|
9128
|
-
const result = editor?.exec(command.command);
|
|
9149
|
+
const result = editor?.exec(command.command, options);
|
|
9129
9150
|
setRefusal(null);
|
|
9130
9151
|
return !result || result.ok ? null : t(result.reason);
|
|
9131
9152
|
};
|
|
9132
|
-
const runFormat = (command) => {
|
|
9153
|
+
const runFormat = (command, options) => {
|
|
9133
9154
|
if (!command) {
|
|
9134
9155
|
setRefusal(null);
|
|
9135
9156
|
return null;
|
|
9136
9157
|
}
|
|
9137
|
-
const result = editor?.exec(command);
|
|
9158
|
+
const result = editor?.exec(command, options);
|
|
9138
9159
|
const reason = !result || result.ok ? null : t(result.reason);
|
|
9139
9160
|
setRefusal(reason);
|
|
9140
9161
|
return reason;
|
|
@@ -9180,7 +9201,7 @@ function ChartDataPane() {
|
|
|
9180
9201
|
value: c.label,
|
|
9181
9202
|
numeric: xy,
|
|
9182
9203
|
disabled,
|
|
9183
|
-
onCommit: (text) => apply({ type: "label", category: i, text })
|
|
9204
|
+
onCommit: (text, options) => apply({ type: "label", category: i, text }, options)
|
|
9184
9205
|
}
|
|
9185
9206
|
),
|
|
9186
9207
|
/* @__PURE__ */ jsx36(
|
|
@@ -9253,7 +9274,7 @@ function ChartDataPane() {
|
|
|
9253
9274
|
}
|
|
9254
9275
|
|
|
9255
9276
|
// src/DiagramTextPane.tsx
|
|
9256
|
-
import { useEffect as
|
|
9277
|
+
import { useEffect as useEffect28, useId as useId15, useRef as useRef31, useState as useState34 } from "react";
|
|
9257
9278
|
import { jsx as jsx37, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9258
9279
|
function NodeField({
|
|
9259
9280
|
label,
|
|
@@ -9264,19 +9285,20 @@ function NodeField({
|
|
|
9264
9285
|
onCommit
|
|
9265
9286
|
}) {
|
|
9266
9287
|
const errorId = useId15();
|
|
9267
|
-
const
|
|
9268
|
-
const
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
|
|
9279
|
-
|
|
9288
|
+
const editor = usePptxEditor();
|
|
9289
|
+
const field = useLiveField(
|
|
9290
|
+
{
|
|
9291
|
+
editor,
|
|
9292
|
+
value: () => value,
|
|
9293
|
+
write: (text, options, final) => {
|
|
9294
|
+
const refused = onCommit(text, options);
|
|
9295
|
+
return refused === null || final ? refused : void 0;
|
|
9296
|
+
}
|
|
9297
|
+
},
|
|
9298
|
+
value
|
|
9299
|
+
);
|
|
9300
|
+
const draft = field.draft;
|
|
9301
|
+
const error = field.error;
|
|
9280
9302
|
const shown = draft ?? value;
|
|
9281
9303
|
return /* @__PURE__ */ jsxs34("label", { className: "pptx-field pptx-diagram-pane__field", children: [
|
|
9282
9304
|
/* @__PURE__ */ jsx37(
|
|
@@ -9290,15 +9312,16 @@ function NodeField({
|
|
|
9290
9312
|
readOnly,
|
|
9291
9313
|
"data-node": node,
|
|
9292
9314
|
"data-draft": draft !== null,
|
|
9293
|
-
onChange: (e) =>
|
|
9294
|
-
|
|
9315
|
+
onChange: (e) => field.input(e.target.value, e.nativeEvent.isComposing === true),
|
|
9316
|
+
onCompositionEnd: (e) => field.input(e.currentTarget.value),
|
|
9317
|
+
onBlur: () => field.commit(),
|
|
9295
9318
|
onKeyDown: (e) => {
|
|
9296
9319
|
if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
|
|
9297
9320
|
e.preventDefault();
|
|
9298
9321
|
e.stopPropagation();
|
|
9299
|
-
commit();
|
|
9322
|
+
field.commit();
|
|
9300
9323
|
}
|
|
9301
|
-
if (e.key === "Escape")
|
|
9324
|
+
if (e.key === "Escape") field.cancel();
|
|
9302
9325
|
}
|
|
9303
9326
|
}
|
|
9304
9327
|
),
|
|
@@ -9310,13 +9333,13 @@ function DiagramTextPane() {
|
|
|
9310
9333
|
const editor = usePptxEditor();
|
|
9311
9334
|
const diagram = useEditorState((s) => s.diagram ?? null);
|
|
9312
9335
|
const readOnly = useEditorState((s) => s.mode === "view");
|
|
9313
|
-
const [refusal, setRefusal] =
|
|
9336
|
+
const [refusal, setRefusal] = useState34(
|
|
9314
9337
|
null
|
|
9315
9338
|
);
|
|
9316
9339
|
const noteId = useId15();
|
|
9317
|
-
const root =
|
|
9318
|
-
const [focus, setFocus] =
|
|
9319
|
-
|
|
9340
|
+
const root = useRef31(null);
|
|
9341
|
+
const [focus, setFocus] = useState34(null);
|
|
9342
|
+
useEffect28(() => {
|
|
9320
9343
|
if (!focus) return;
|
|
9321
9344
|
setFocus(null);
|
|
9322
9345
|
const fields = [...root.current?.querySelectorAll("textarea") ?? []];
|
|
@@ -9329,8 +9352,8 @@ function DiagramTextPane() {
|
|
|
9329
9352
|
/* @__PURE__ */ jsx37("p", { className: "pptx-empty__body", children: t("diagram.pane.emptyBody") })
|
|
9330
9353
|
] });
|
|
9331
9354
|
const frame = diagram.nodeId;
|
|
9332
|
-
const apply = (command) => {
|
|
9333
|
-
const result = editor?.exec(command);
|
|
9355
|
+
const apply = (command, options) => {
|
|
9356
|
+
const result = editor?.exec(command, options);
|
|
9334
9357
|
return !result || result.ok ? null : t(result.reason);
|
|
9335
9358
|
};
|
|
9336
9359
|
const run = (command, index) => {
|
|
@@ -9368,7 +9391,7 @@ function DiagramTextPane() {
|
|
|
9368
9391
|
node: node.node,
|
|
9369
9392
|
readOnly: readOnly || !node.editable,
|
|
9370
9393
|
...node.editable ? {} : { note: `${noteId}-${i}` },
|
|
9371
|
-
onCommit: (text) => apply({ type: "setDiagramText", nodeId: frame, node: node.node, text })
|
|
9394
|
+
onCommit: (text, options) => apply({ type: "setDiagramText", nodeId: frame, node: node.node, text }, options)
|
|
9372
9395
|
}
|
|
9373
9396
|
),
|
|
9374
9397
|
/* @__PURE__ */ jsxs34("div", { className: "pptx-diagram-pane__actions", children: [
|
|
@@ -9435,7 +9458,7 @@ function DiagramTextPane() {
|
|
|
9435
9458
|
}
|
|
9436
9459
|
|
|
9437
9460
|
// src/FormatPanel.tsx
|
|
9438
|
-
import { useEffect as
|
|
9461
|
+
import { useEffect as useEffect32, useLayoutEffect as useLayoutEffect13, useRef as useRef41, useState as useState44 } from "react";
|
|
9439
9462
|
import {
|
|
9440
9463
|
chromeControlForSlot as chromeControlForSlot6,
|
|
9441
9464
|
formatSectionsOf,
|
|
@@ -9452,11 +9475,11 @@ import {
|
|
|
9452
9475
|
Children as Children7,
|
|
9453
9476
|
Fragment as Fragment37,
|
|
9454
9477
|
isValidElement as isValidElement7,
|
|
9455
|
-
useEffect as
|
|
9478
|
+
useEffect as useEffect31,
|
|
9456
9479
|
useId as useId18,
|
|
9457
9480
|
useLayoutEffect as useLayoutEffect11,
|
|
9458
|
-
useRef as
|
|
9459
|
-
useState as
|
|
9481
|
+
useRef as useRef38,
|
|
9482
|
+
useState as useState41
|
|
9460
9483
|
} from "react";
|
|
9461
9484
|
import {
|
|
9462
9485
|
colorMenuSelection as colorMenuSelection2,
|
|
@@ -9489,7 +9512,7 @@ import {
|
|
|
9489
9512
|
} from "@pptx-editor.dev/core/editor";
|
|
9490
9513
|
|
|
9491
9514
|
// src/ShapeFormatControls.tsx
|
|
9492
|
-
import { Fragment as Fragment30, useCallback as useCallback12, useRef as
|
|
9515
|
+
import { Fragment as Fragment30, useCallback as useCallback12, useRef as useRef32, useState as useState35 } from "react";
|
|
9493
9516
|
import {
|
|
9494
9517
|
GLOW_ACCENTS,
|
|
9495
9518
|
SHAPE_STYLE_GALLERY,
|
|
@@ -9580,8 +9603,8 @@ function ShapeStyleGalleryControl({
|
|
|
9580
9603
|
}) {
|
|
9581
9604
|
const { cmd, label, reason, tip } = useSlot(slot, control);
|
|
9582
9605
|
const off = useAriaDisabled(!cmd.isEnabled, reason);
|
|
9583
|
-
const anchor =
|
|
9584
|
-
const [open, setOpen] =
|
|
9606
|
+
const anchor = useRef32(null);
|
|
9607
|
+
const [open, setOpen] = useState35(false);
|
|
9585
9608
|
const trigger = useTriggerAttributes(slot, "pptx-toolbar__button pptx-toolbar__button--wide", {
|
|
9586
9609
|
disabled: !cmd.isEnabled
|
|
9587
9610
|
});
|
|
@@ -9688,8 +9711,8 @@ function EffectMenuControl({
|
|
|
9688
9711
|
const { cmd, label, reason, tip } = useSlot(slot, control);
|
|
9689
9712
|
const off = useAriaDisabled(!cmd.isEnabled, reason);
|
|
9690
9713
|
const { t } = useTranslation();
|
|
9691
|
-
const anchor =
|
|
9692
|
-
const [open, setOpen] =
|
|
9714
|
+
const anchor = useRef32(null);
|
|
9715
|
+
const [open, setOpen] = useState35(false);
|
|
9693
9716
|
const trigger = useTriggerAttributes(slot, "pptx-toolbar__button pptx-toolbar__button--wide", {
|
|
9694
9717
|
disabled: !cmd.isEnabled
|
|
9695
9718
|
});
|
|
@@ -9748,7 +9771,7 @@ function EffectMenuControl({
|
|
|
9748
9771
|
}
|
|
9749
9772
|
|
|
9750
9773
|
// src/TextEffectsControl.tsx
|
|
9751
|
-
import { useCallback as useCallback13, useRef as
|
|
9774
|
+
import { useCallback as useCallback13, useRef as useRef33, useState as useState36 } from "react";
|
|
9752
9775
|
import {
|
|
9753
9776
|
TEXT_WARP_GALLERY,
|
|
9754
9777
|
chromeOptionChecked as chromeOptionChecked2,
|
|
@@ -9813,8 +9836,8 @@ function TextEffectsMenuControl({
|
|
|
9813
9836
|
const { cmd, label, reason, tip } = useSlot(slot, control);
|
|
9814
9837
|
const off = useAriaDisabled(!cmd.isEnabled, reason);
|
|
9815
9838
|
const { t } = useTranslation();
|
|
9816
|
-
const anchor =
|
|
9817
|
-
const [open, setOpen] =
|
|
9839
|
+
const anchor = useRef33(null);
|
|
9840
|
+
const [open, setOpen] = useState36(false);
|
|
9818
9841
|
const trigger = useTriggerAttributes(slot, "pptx-toolbar__button pptx-toolbar__button--wide", {
|
|
9819
9842
|
disabled: !cmd.isEnabled
|
|
9820
9843
|
});
|
|
@@ -9862,7 +9885,7 @@ function TextEffectsMenuControl({
|
|
|
9862
9885
|
}
|
|
9863
9886
|
|
|
9864
9887
|
// src/toolbar-file-controls.tsx
|
|
9865
|
-
import { useRef as
|
|
9888
|
+
import { useRef as useRef34 } from "react";
|
|
9866
9889
|
import {
|
|
9867
9890
|
captureImageTarget,
|
|
9868
9891
|
imageFileTypes,
|
|
@@ -9875,7 +9898,7 @@ function LinkControl({ slot, control }) {
|
|
|
9875
9898
|
const editor = usePptxEditor();
|
|
9876
9899
|
const { t } = useTranslation();
|
|
9877
9900
|
const off = useChromeActionHost().unavailable?.(slot) ?? null;
|
|
9878
|
-
const anchor =
|
|
9901
|
+
const anchor = useRef34(null);
|
|
9879
9902
|
return /* @__PURE__ */ jsx40("span", { ref: anchor, className: "pptx-toolbar__group", children: /* @__PURE__ */ jsx40(
|
|
9880
9903
|
ToolButton,
|
|
9881
9904
|
{
|
|
@@ -9892,8 +9915,8 @@ function LinkControl({ slot, control }) {
|
|
|
9892
9915
|
function ImageControl({ slot, control }) {
|
|
9893
9916
|
const { cmd, label, reason } = useSlot(slot, control);
|
|
9894
9917
|
const editor = usePptxEditor();
|
|
9895
|
-
const input =
|
|
9896
|
-
const pickerTarget =
|
|
9918
|
+
const input = useRef34(null);
|
|
9919
|
+
const pickerTarget = useRef34(void 0);
|
|
9897
9920
|
const target = control.state.kind === "replace" ? "replaceImage" : void 0;
|
|
9898
9921
|
const onFile = async (file) => {
|
|
9899
9922
|
const isCurrent = pickerTarget.current;
|
|
@@ -9933,7 +9956,7 @@ function ImageControl({ slot, control }) {
|
|
|
9933
9956
|
}
|
|
9934
9957
|
|
|
9935
9958
|
// src/PictureControls.tsx
|
|
9936
|
-
import { useRef as
|
|
9959
|
+
import { useRef as useRef35, useState as useState37 } from "react";
|
|
9937
9960
|
import {
|
|
9938
9961
|
chromeOptionChecked as chromeOptionChecked3,
|
|
9939
9962
|
correctionGridRows,
|
|
@@ -9954,8 +9977,8 @@ function CorrectionsControl({
|
|
|
9954
9977
|
const { cmd, label, reason, tip } = useSlot(slot, control);
|
|
9955
9978
|
const off = useAriaDisabled(!cmd.isEnabled, reason);
|
|
9956
9979
|
const { t } = useTranslation();
|
|
9957
|
-
const anchor =
|
|
9958
|
-
const [open, setOpen] =
|
|
9980
|
+
const anchor = useRef35(null);
|
|
9981
|
+
const [open, setOpen] = useState37(false);
|
|
9959
9982
|
const trigger = useTriggerAttributes(slot, "pptx-toolbar__button pptx-toolbar__button--wide", {
|
|
9960
9983
|
disabled: !cmd.isEnabled
|
|
9961
9984
|
});
|
|
@@ -10048,11 +10071,11 @@ import {
|
|
|
10048
10071
|
import {
|
|
10049
10072
|
createContext as createContext15,
|
|
10050
10073
|
useContext as useContext17,
|
|
10051
|
-
useEffect as
|
|
10074
|
+
useEffect as useEffect29,
|
|
10052
10075
|
useId as useId16,
|
|
10053
10076
|
useLayoutEffect as useLayoutEffect9,
|
|
10054
|
-
useRef as
|
|
10055
|
-
useState as
|
|
10077
|
+
useRef as useRef36,
|
|
10078
|
+
useState as useState38
|
|
10056
10079
|
} from "react";
|
|
10057
10080
|
import {
|
|
10058
10081
|
firstFontPickerFamily,
|
|
@@ -10198,10 +10221,10 @@ function FontFamilyControl({ slot, control, children }) {
|
|
|
10198
10221
|
const { cmd, reason } = slotState;
|
|
10199
10222
|
const off = useAriaDisabled(!cmd.isEnabled, reason);
|
|
10200
10223
|
const editor = usePptxEditor();
|
|
10201
|
-
const anchor =
|
|
10202
|
-
const list =
|
|
10203
|
-
const [open, setOpen] =
|
|
10204
|
-
const [query, setQuery] =
|
|
10224
|
+
const anchor = useRef36(null);
|
|
10225
|
+
const list = useRef36(null);
|
|
10226
|
+
const [open, setOpen] = useState38(false);
|
|
10227
|
+
const [query, setQuery] = useState38("");
|
|
10205
10228
|
useEditorState((s) => s.revision);
|
|
10206
10229
|
const slide = useEditorState((s) => s.currentSlide);
|
|
10207
10230
|
const groups = open ? fontPickerGroups(editor, slide, query) : [];
|
|
@@ -10212,7 +10235,7 @@ function FontFamilyControl({ slot, control, children }) {
|
|
|
10212
10235
|
useLayoutEffect9(() => {
|
|
10213
10236
|
if (open) revealCurrentFont(list.current);
|
|
10214
10237
|
}, [open]);
|
|
10215
|
-
|
|
10238
|
+
useEffect29(() => {
|
|
10216
10239
|
if (open) focusFontOption(list.current);
|
|
10217
10240
|
}, [open]);
|
|
10218
10241
|
const state = {
|
|
@@ -10315,7 +10338,7 @@ function SlotControl({
|
|
|
10315
10338
|
}
|
|
10316
10339
|
|
|
10317
10340
|
// src/toolbar-size.tsx
|
|
10318
|
-
import { useEffect as
|
|
10341
|
+
import { useEffect as useEffect30, useId as useId17, useRef as useRef37, useState as useState39 } from "react";
|
|
10319
10342
|
import {
|
|
10320
10343
|
SIZE_ERROR_MS,
|
|
10321
10344
|
parseToolbarSize,
|
|
@@ -10329,14 +10352,14 @@ function SizeControl({ slot, control }) {
|
|
|
10329
10352
|
const editor = usePptxEditor();
|
|
10330
10353
|
const { t } = useTranslation();
|
|
10331
10354
|
const mixed = useEditorState((s) => s.format?.font?.disagrees.fontSizePt === true);
|
|
10332
|
-
const [draft, setDraft] =
|
|
10333
|
-
const box =
|
|
10334
|
-
const handled =
|
|
10355
|
+
const [draft, setDraft] = useState39(null);
|
|
10356
|
+
const box = useRef37(null);
|
|
10357
|
+
const handled = useRef37(false);
|
|
10335
10358
|
const value = toolbarSizeText(cmd.value, mixed);
|
|
10336
10359
|
const off = useAriaDisabled(!cmd.isEnabled, reason);
|
|
10337
10360
|
const errorId = useId17();
|
|
10338
|
-
const [error, setError] =
|
|
10339
|
-
|
|
10361
|
+
const [error, setError] = useState39(null);
|
|
10362
|
+
useEffect30(() => {
|
|
10340
10363
|
if (!error) return;
|
|
10341
10364
|
const timer = setTimeout(() => setError(null), SIZE_ERROR_MS);
|
|
10342
10365
|
return () => clearTimeout(timer);
|
|
@@ -10426,7 +10449,7 @@ function SizeControl({ slot, control }) {
|
|
|
10426
10449
|
}
|
|
10427
10450
|
|
|
10428
10451
|
// src/toolbar-measure.ts
|
|
10429
|
-
import { useLayoutEffect as useLayoutEffect10, useState as
|
|
10452
|
+
import { useLayoutEffect as useLayoutEffect10, useState as useState40 } from "react";
|
|
10430
10453
|
import {
|
|
10431
10454
|
syncToolbarTabStop,
|
|
10432
10455
|
toolbarArrowKey,
|
|
@@ -10434,7 +10457,7 @@ import {
|
|
|
10434
10457
|
} from "@pptx-editor.dev/core/editor";
|
|
10435
10458
|
import { separatorCost, toolbarRoom } from "@pptx-editor.dev/core/editor";
|
|
10436
10459
|
function useRovingToolbar(ref) {
|
|
10437
|
-
const [tracker] =
|
|
10460
|
+
const [tracker] = useState40(toolbarFocusTracker);
|
|
10438
10461
|
useLayoutEffect10(() => {
|
|
10439
10462
|
const bar = ref.current;
|
|
10440
10463
|
if (!bar) return;
|
|
@@ -10487,8 +10510,8 @@ function DropdownControl({ slot, control }) {
|
|
|
10487
10510
|
const editor = usePptxEditor();
|
|
10488
10511
|
const openDialog = useDialogOpener();
|
|
10489
10512
|
const host = useChromeActionHost();
|
|
10490
|
-
const anchor =
|
|
10491
|
-
const [open, setOpen] =
|
|
10513
|
+
const anchor = useRef38(null);
|
|
10514
|
+
const [open, setOpen] = useState41(false);
|
|
10492
10515
|
const current = control.options?.find((o) => o.value === cmd.value);
|
|
10493
10516
|
const offered = useOfferedControl(slot, control) ?? control;
|
|
10494
10517
|
const icon = current?.paths ?? control.paths;
|
|
@@ -10562,11 +10585,11 @@ function ColorControl({ slot, control }) {
|
|
|
10562
10585
|
const { cmd, label, reason, tip } = useSlot(slot, control);
|
|
10563
10586
|
const editor = usePptxEditor();
|
|
10564
10587
|
const { t } = useTranslation();
|
|
10565
|
-
const anchor =
|
|
10566
|
-
const [open, setOpen] =
|
|
10588
|
+
const anchor = useRef38(null);
|
|
10589
|
+
const [open, setOpen] = useState41(false);
|
|
10567
10590
|
const fallback = useDefaultColor(slot);
|
|
10568
10591
|
const selected = useEditorState((s) => colorMenuSelection2(slot, s));
|
|
10569
|
-
const [picked, setPicked] =
|
|
10592
|
+
const [picked, setPicked] = useState41(null);
|
|
10570
10593
|
const last = picked ?? fallback;
|
|
10571
10594
|
const resetLabel = t(toolbarColorResetKey(slot));
|
|
10572
10595
|
const off = useAriaDisabled(!cmd.isEnabled, reason);
|
|
@@ -10683,7 +10706,7 @@ function ActionControl({ slot, control }) {
|
|
|
10683
10706
|
const { t } = useTranslation();
|
|
10684
10707
|
const host = useChromeActionHost();
|
|
10685
10708
|
const off = host.unavailable?.(slot) ?? null;
|
|
10686
|
-
const ref =
|
|
10709
|
+
const ref = useRef38(null);
|
|
10687
10710
|
return /* @__PURE__ */ jsx45("span", { ref, className: "pptx-toolbar__group", children: /* @__PURE__ */ jsx45(
|
|
10688
10711
|
ToolButton,
|
|
10689
10712
|
{
|
|
@@ -10871,7 +10894,7 @@ function PresetBar({
|
|
|
10871
10894
|
}
|
|
10872
10895
|
function HandBar({ className, children }) {
|
|
10873
10896
|
const { t } = useTranslation();
|
|
10874
|
-
const ref =
|
|
10897
|
+
const ref = useRef38(null);
|
|
10875
10898
|
const roving = useRovingToolbar(ref);
|
|
10876
10899
|
return /* @__PURE__ */ jsx45(
|
|
10877
10900
|
"div",
|
|
@@ -10897,16 +10920,16 @@ function PresetToolbar({
|
|
|
10897
10920
|
const { t } = useTranslation();
|
|
10898
10921
|
useEditorState((s) => s.status);
|
|
10899
10922
|
const context = useEditorState((s) => `${formatTargetKey(s)}|${formatSelectionHasLineEnds2(s)}`);
|
|
10900
|
-
const ref =
|
|
10901
|
-
const more =
|
|
10902
|
-
const fixed =
|
|
10923
|
+
const ref = useRef38(null);
|
|
10924
|
+
const more = useRef38(null);
|
|
10925
|
+
const fixed = useRef38(null);
|
|
10903
10926
|
const panelId2 = useId18();
|
|
10904
|
-
const memory =
|
|
10927
|
+
const memory = useRef38(createToolbarFitMemory());
|
|
10905
10928
|
const count = items.length;
|
|
10906
|
-
const [collapsed, setCollapsed] =
|
|
10907
|
-
const [open, setOpen] =
|
|
10929
|
+
const [collapsed, setCollapsed] = useState41([]);
|
|
10930
|
+
const [open, setOpen] = useState41(false);
|
|
10908
10931
|
const shape = items.map((g) => `${g.id}:${g.priority}:${g.pinned ? 1 : 0}`).join("|");
|
|
10909
|
-
const itemsRef =
|
|
10932
|
+
const itemsRef = useRef38(items);
|
|
10910
10933
|
itemsRef.current = items;
|
|
10911
10934
|
useLayoutEffect11(() => {
|
|
10912
10935
|
const el = ref.current;
|
|
@@ -10950,7 +10973,7 @@ function PresetToolbar({
|
|
|
10950
10973
|
const visible = items.map((_, i) => i).filter((i) => !hiddenIds.has(items[i].id));
|
|
10951
10974
|
const hidden = items.map((_, i) => i).filter((i) => hiddenIds.has(items[i].id));
|
|
10952
10975
|
const roving = useRovingToolbar(ref);
|
|
10953
|
-
|
|
10976
|
+
useEffect31(() => {
|
|
10954
10977
|
if (!hidden.length) setOpen(false);
|
|
10955
10978
|
}, [hidden.length]);
|
|
10956
10979
|
return /* @__PURE__ */ jsxs41(
|
|
@@ -11018,7 +11041,11 @@ function PresetToolbar({
|
|
|
11018
11041
|
import { formatLineState, formatTargetKey as formatTargetKey2, translateKeyOrText as translateKeyOrText16 } from "@pptx-editor.dev/core/editor";
|
|
11019
11042
|
|
|
11020
11043
|
// src/FormatNumberField.tsx
|
|
11021
|
-
import { useId as useId19
|
|
11044
|
+
import { useId as useId19 } from "react";
|
|
11045
|
+
import {
|
|
11046
|
+
parseFormatNumber,
|
|
11047
|
+
sameFormatNumber as sameFormatNumber3
|
|
11048
|
+
} from "@pptx-editor.dev/core/editor";
|
|
11022
11049
|
import { jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
11023
11050
|
function FormatNumberField({
|
|
11024
11051
|
label,
|
|
@@ -11030,43 +11057,41 @@ function FormatNumberField({
|
|
|
11030
11057
|
exclusiveMin,
|
|
11031
11058
|
mixed = true,
|
|
11032
11059
|
max,
|
|
11060
|
+
step = 1,
|
|
11061
|
+
inline,
|
|
11062
|
+
placeholder,
|
|
11033
11063
|
onCommit
|
|
11034
11064
|
}) {
|
|
11035
11065
|
const { t } = useTranslation();
|
|
11066
|
+
const editor = usePptxEditor();
|
|
11036
11067
|
const errorId = useId19();
|
|
11037
|
-
const
|
|
11038
|
-
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
|
|
11045
|
-
|
|
11046
|
-
|
|
11047
|
-
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
const
|
|
11054
|
-
if (!
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
const refused = onCommit(number);
|
|
11065
|
-
if (refused) setError(refused);
|
|
11066
|
-
else reset();
|
|
11067
|
-
};
|
|
11068
|
-
return /* @__PURE__ */ jsxs42("label", { className: "pptx-field", children: [
|
|
11069
|
-
label,
|
|
11068
|
+
const field = useLiveField(
|
|
11069
|
+
{
|
|
11070
|
+
editor,
|
|
11071
|
+
value: () => value,
|
|
11072
|
+
same: sameFormatNumber3,
|
|
11073
|
+
write(text, options, final) {
|
|
11074
|
+
const parsed = parseFormatNumber(text, { min, max, exclusiveMin });
|
|
11075
|
+
if (!parsed.ok)
|
|
11076
|
+
return final || !parsed.incomplete ? t(parsed.key, parsed.params) : void 0;
|
|
11077
|
+
if (value !== null && parsed.value === Number(value)) return null;
|
|
11078
|
+
return onCommit(parsed.value, options);
|
|
11079
|
+
}
|
|
11080
|
+
},
|
|
11081
|
+
value
|
|
11082
|
+
);
|
|
11083
|
+
const nudge = (direction, large) => {
|
|
11084
|
+
const parsed = parseFormatNumber(field.draft ?? value ?? "", {});
|
|
11085
|
+
if (!parsed.ok) return;
|
|
11086
|
+
let next = Math.round((parsed.value + direction * step * (large ? 10 : 1)) * 1e3) / 1e3;
|
|
11087
|
+
if (max !== void 0) next = Math.min(max, next);
|
|
11088
|
+
if (min !== void 0) next = Math.max(min, next);
|
|
11089
|
+
if (exclusiveMin && min !== void 0 && next <= min) return;
|
|
11090
|
+
field.input(String(next));
|
|
11091
|
+
};
|
|
11092
|
+
const error = field.error;
|
|
11093
|
+
return /* @__PURE__ */ jsxs42("label", { className: inline ? "pptx-field pptx-field--inline" : "pptx-field", children: [
|
|
11094
|
+
inline ? /* @__PURE__ */ jsx46("span", { className: "pptx-field__label", children: label }) : label,
|
|
11070
11095
|
/* @__PURE__ */ jsxs42("span", { className: "pptx-field__control", children: [
|
|
11071
11096
|
/* @__PURE__ */ jsx46(
|
|
11072
11097
|
"input",
|
|
@@ -11074,26 +11099,27 @@ function FormatNumberField({
|
|
|
11074
11099
|
inputMode: "decimal",
|
|
11075
11100
|
"aria-label": label,
|
|
11076
11101
|
"data-format-property": property,
|
|
11077
|
-
value: draft ?? value ?? "",
|
|
11078
|
-
placeholder: value === null
|
|
11102
|
+
value: field.draft ?? value ?? "",
|
|
11103
|
+
placeholder: value === null ? mixed ? t("inspector.mixed") : placeholder : void 0,
|
|
11079
11104
|
disabled,
|
|
11080
11105
|
"aria-invalid": !!error,
|
|
11081
11106
|
"aria-describedby": error ? errorId : void 0,
|
|
11082
|
-
"data-draft": draft !== null,
|
|
11083
|
-
onChange: (e) =>
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
},
|
|
11087
|
-
onBlur: commit,
|
|
11107
|
+
"data-draft": field.draft !== null,
|
|
11108
|
+
onChange: (e) => field.input(e.target.value, e.nativeEvent.isComposing === true),
|
|
11109
|
+
onCompositionEnd: (e) => field.input(e.currentTarget.value),
|
|
11110
|
+
onBlur: () => field.commit(),
|
|
11088
11111
|
onKeyDown: (e) => {
|
|
11089
|
-
if (e.
|
|
11112
|
+
if (e.nativeEvent.isComposing) return;
|
|
11113
|
+
if (e.key === "Enter") {
|
|
11090
11114
|
e.preventDefault();
|
|
11091
|
-
commit();
|
|
11092
|
-
}
|
|
11093
|
-
if (e.key === "Escape") {
|
|
11115
|
+
field.commit();
|
|
11116
|
+
} else if (e.key === "Escape") {
|
|
11094
11117
|
e.preventDefault();
|
|
11095
11118
|
e.stopPropagation();
|
|
11096
|
-
|
|
11119
|
+
field.cancel();
|
|
11120
|
+
} else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
11121
|
+
e.preventDefault();
|
|
11122
|
+
nudge(e.key === "ArrowUp" ? 1 : -1, e.shiftKey);
|
|
11097
11123
|
}
|
|
11098
11124
|
}
|
|
11099
11125
|
}
|
|
@@ -11105,7 +11131,7 @@ function FormatNumberField({
|
|
|
11105
11131
|
}
|
|
11106
11132
|
|
|
11107
11133
|
// src/FormatLineWidth.tsx
|
|
11108
|
-
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
11134
|
+
import { jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
11109
11135
|
function FormatLineWidth() {
|
|
11110
11136
|
const editor = usePptxEditor();
|
|
11111
11137
|
const snapshot = useEditorState((s) => s);
|
|
@@ -11113,92 +11139,81 @@ function FormatLineWidth() {
|
|
|
11113
11139
|
const line = formatLineState(editor);
|
|
11114
11140
|
if (!line) return null;
|
|
11115
11141
|
const key = `${editor?.session?.id}:${formatTargetKey2(snapshot)}`;
|
|
11116
|
-
return /* @__PURE__ */
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11142
|
+
return /* @__PURE__ */ jsxs43("div", { className: "pptx-format-line-width", children: [
|
|
11143
|
+
/* @__PURE__ */ jsx47(
|
|
11144
|
+
FormatNumberField,
|
|
11145
|
+
{
|
|
11146
|
+
label: t("inspector.lineWidth"),
|
|
11147
|
+
property: "line.width",
|
|
11148
|
+
value: line.width === null ? null : String(Math.round(line.width * 100) / 100),
|
|
11149
|
+
unit: "pt",
|
|
11150
|
+
min: 0,
|
|
11151
|
+
exclusiveMin: true,
|
|
11152
|
+
mixed: line.widthMixed,
|
|
11153
|
+
max: 1584,
|
|
11154
|
+
step: 0.25,
|
|
11155
|
+
inline: true,
|
|
11156
|
+
placeholder: t("inspector.noLine"),
|
|
11157
|
+
disabled: snapshot.mode === "view",
|
|
11158
|
+
onCommit: (points, options) => {
|
|
11159
|
+
if (!editor || `${editor.session?.id}:${formatTargetKey2(editor.snapshot())}` !== key)
|
|
11160
|
+
return t("disabled.invalidValue");
|
|
11161
|
+
if (points === line.width) return null;
|
|
11162
|
+
const result = editor.exec({ type: "setLineWidth", points }, options);
|
|
11163
|
+
return result.ok ? null : translateKeyOrText16(t, result.reason);
|
|
11164
|
+
}
|
|
11165
|
+
},
|
|
11166
|
+
key
|
|
11167
|
+
),
|
|
11168
|
+
/* @__PURE__ */ jsx47(ToolbarSlot, { slotId: "shape.lineWidth" })
|
|
11169
|
+
] });
|
|
11138
11170
|
}
|
|
11139
11171
|
|
|
11140
11172
|
// src/FormatFillTransparency.tsx
|
|
11141
|
-
import {
|
|
11173
|
+
import { useState as useState42 } from "react";
|
|
11142
11174
|
import {
|
|
11143
11175
|
formatFillTransparency,
|
|
11144
11176
|
formatTargetKey as formatTargetKey3,
|
|
11145
11177
|
translateKeyOrText as translateKeyOrText17
|
|
11146
11178
|
} from "@pptx-editor.dev/core/editor";
|
|
11147
|
-
import { jsx as jsx48, jsxs as
|
|
11179
|
+
import { jsx as jsx48, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
11148
11180
|
function FormatFillTransparency() {
|
|
11149
11181
|
const editor = usePptxEditor();
|
|
11150
11182
|
const snapshot = useEditorState((s) => s);
|
|
11151
11183
|
const { t } = useTranslation();
|
|
11152
|
-
const [preview, setPreview] = useState42(null);
|
|
11153
11184
|
const [error, setError] = useState42(null);
|
|
11185
|
+
const group = useHistoryGroup({ kind: "range" });
|
|
11154
11186
|
const field = formatFillTransparency(editor);
|
|
11155
11187
|
const key = `${editor?.session?.id}:${formatTargetKey3(snapshot)}`;
|
|
11156
|
-
const commit = (percent) => {
|
|
11188
|
+
const commit = (percent, options) => {
|
|
11157
11189
|
if (!editor || !field || `${editor.session?.id}:${formatTargetKey3(editor.snapshot())}` !== key)
|
|
11158
11190
|
return t("disabled.invalidValue");
|
|
11159
11191
|
if (percent === field.value) return null;
|
|
11160
|
-
const result = editor.exec(
|
|
11161
|
-
type: "patchShapeFormat",
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
});
|
|
11192
|
+
const result = editor.exec(
|
|
11193
|
+
{ type: "patchShapeFormat", target: field.target, patch: field.patch(percent) },
|
|
11194
|
+
options
|
|
11195
|
+
);
|
|
11165
11196
|
return result.ok ? null : translateKeyOrText17(t, result.reason);
|
|
11166
11197
|
};
|
|
11167
|
-
const latest = useRef39(commit);
|
|
11168
|
-
latest.current = commit;
|
|
11169
|
-
const attached = useRef39(null);
|
|
11170
|
-
const slider = useCallback14((el) => {
|
|
11171
|
-
attached.current?.();
|
|
11172
|
-
attached.current = null;
|
|
11173
|
-
if (!el) return;
|
|
11174
|
-
const release = () => {
|
|
11175
|
-
setPreview(null);
|
|
11176
|
-
setError(latest.current(Number(el.value)));
|
|
11177
|
-
};
|
|
11178
|
-
el.addEventListener("change", release);
|
|
11179
|
-
attached.current = () => el.removeEventListener("change", release);
|
|
11180
|
-
}, []);
|
|
11181
11198
|
if (!field) return null;
|
|
11182
11199
|
const label = t(field.labelKey);
|
|
11183
|
-
const value = preview ?? field.value;
|
|
11184
11200
|
const disabled = snapshot.mode === "view";
|
|
11185
|
-
return /* @__PURE__ */
|
|
11201
|
+
return /* @__PURE__ */ jsxs44("div", { className: "pptx-format-transparency", "data-format-fill-transparency": "", children: [
|
|
11186
11202
|
/* @__PURE__ */ jsx48(
|
|
11187
11203
|
"input",
|
|
11188
11204
|
{
|
|
11189
|
-
ref:
|
|
11205
|
+
ref: group.ref,
|
|
11190
11206
|
type: "range",
|
|
11191
11207
|
className: "pptx-format-transparency__slider",
|
|
11192
11208
|
"data-format-slider": field.id,
|
|
11193
11209
|
"aria-label": label,
|
|
11194
|
-
"aria-valuetext": `${value}${field.unit}`,
|
|
11210
|
+
"aria-valuetext": `${field.value}${field.unit}`,
|
|
11195
11211
|
min: field.min,
|
|
11196
11212
|
max: field.max,
|
|
11197
11213
|
step: 1,
|
|
11198
|
-
value,
|
|
11214
|
+
value: field.value,
|
|
11199
11215
|
disabled,
|
|
11200
|
-
onChange: (e) =>
|
|
11201
|
-
onBlur: () => setPreview(null)
|
|
11216
|
+
onChange: (e) => setError(commit(Number(e.target.value), group.options()))
|
|
11202
11217
|
}
|
|
11203
11218
|
),
|
|
11204
11219
|
/* @__PURE__ */ jsx48(
|
|
@@ -11206,14 +11221,14 @@ function FormatFillTransparency() {
|
|
|
11206
11221
|
{
|
|
11207
11222
|
label,
|
|
11208
11223
|
property: field.id,
|
|
11209
|
-
value: String(value),
|
|
11224
|
+
value: String(field.value),
|
|
11210
11225
|
unit: field.unit,
|
|
11211
11226
|
min: field.min,
|
|
11212
11227
|
max: field.max,
|
|
11213
11228
|
disabled,
|
|
11214
|
-
onCommit: (percent) => {
|
|
11229
|
+
onCommit: (percent, options) => {
|
|
11215
11230
|
setError(null);
|
|
11216
|
-
return commit(percent);
|
|
11231
|
+
return commit(percent, options);
|
|
11217
11232
|
}
|
|
11218
11233
|
},
|
|
11219
11234
|
key
|
|
@@ -11223,7 +11238,7 @@ function FormatFillTransparency() {
|
|
|
11223
11238
|
}
|
|
11224
11239
|
|
|
11225
11240
|
// src/FormatDetails.tsx
|
|
11226
|
-
import { useState as useState43, useRef as
|
|
11241
|
+
import { useState as useState43, useRef as useRef40, useLayoutEffect as useLayoutEffect12 } from "react";
|
|
11227
11242
|
import {
|
|
11228
11243
|
chromeControlForSlot as chromeControlForSlot5,
|
|
11229
11244
|
createGradientStopIdentity,
|
|
@@ -11235,12 +11250,12 @@ import {
|
|
|
11235
11250
|
} from "@pptx-editor.dev/core/editor";
|
|
11236
11251
|
|
|
11237
11252
|
// src/FormatGradientPicker.tsx
|
|
11238
|
-
import { useRef as
|
|
11253
|
+
import { useRef as useRef39 } from "react";
|
|
11239
11254
|
import {
|
|
11240
11255
|
gradientPreviewCss,
|
|
11241
11256
|
gradientPreviewStops
|
|
11242
11257
|
} from "@pptx-editor.dev/core/editor";
|
|
11243
|
-
import { jsx as jsx49, jsxs as
|
|
11258
|
+
import { jsx as jsx49, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
11244
11259
|
function FormatGradientPicker({
|
|
11245
11260
|
gradient,
|
|
11246
11261
|
selected,
|
|
@@ -11248,7 +11263,7 @@ function FormatGradientPicker({
|
|
|
11248
11263
|
}) {
|
|
11249
11264
|
const { t } = useTranslation();
|
|
11250
11265
|
const rows = useEditorState((s) => s.themeColors);
|
|
11251
|
-
const root =
|
|
11266
|
+
const root = useRef39(null);
|
|
11252
11267
|
const stops = gradientPreviewStops(gradient, rows);
|
|
11253
11268
|
const background = gradientPreviewCss(stops);
|
|
11254
11269
|
const label = (index) => `${t("inspector.gradientStop", { index: index + 1 })} \xB7 ${Math.round(stops[index].position * 100)}%`;
|
|
@@ -11259,7 +11274,7 @@ function FormatGradientPicker({
|
|
|
11259
11274
|
const buttons = root.current?.querySelectorAll("[data-format-stop-marker]");
|
|
11260
11275
|
buttons?.[index]?.focus();
|
|
11261
11276
|
};
|
|
11262
|
-
return /* @__PURE__ */
|
|
11277
|
+
return /* @__PURE__ */ jsxs45("div", { className: "pptx-gradient-picker", ref: root, children: [
|
|
11263
11278
|
/* @__PURE__ */ jsx49(
|
|
11264
11279
|
"div",
|
|
11265
11280
|
{
|
|
@@ -11296,7 +11311,7 @@ function FormatGradientPicker({
|
|
|
11296
11311
|
},
|
|
11297
11312
|
stop.id
|
|
11298
11313
|
)) }),
|
|
11299
|
-
/* @__PURE__ */
|
|
11314
|
+
/* @__PURE__ */ jsxs45("label", { className: "pptx-field", children: [
|
|
11300
11315
|
t("inspector.selectStop"),
|
|
11301
11316
|
/* @__PURE__ */ jsx49(
|
|
11302
11317
|
"select",
|
|
@@ -11313,7 +11328,7 @@ function FormatGradientPicker({
|
|
|
11313
11328
|
}
|
|
11314
11329
|
|
|
11315
11330
|
// src/FormatDetails.tsx
|
|
11316
|
-
import { jsx as jsx50, jsxs as
|
|
11331
|
+
import { jsx as jsx50, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
11317
11332
|
function FormatDetails({ section }) {
|
|
11318
11333
|
const editor = usePptxEditor();
|
|
11319
11334
|
const { t } = useTranslation();
|
|
@@ -11321,8 +11336,8 @@ function FormatDetails({ section }) {
|
|
|
11321
11336
|
const offered = useOfferedControl("shape.effects", chromeControlForSlot5("shape.effects"));
|
|
11322
11337
|
const effectsAvailable = offered?.options?.some((option) => option.value === "reflection.tightTouching") === true;
|
|
11323
11338
|
const [error, setError] = useState43(null);
|
|
11324
|
-
const root =
|
|
11325
|
-
const stopIdentity =
|
|
11339
|
+
const root = useRef40(null);
|
|
11340
|
+
const stopIdentity = useRef40(createGradientStopIdentity());
|
|
11326
11341
|
const [selectedStop, setSelectedStop] = useState43(null);
|
|
11327
11342
|
const [focusStop, setFocusStop] = useState43(null);
|
|
11328
11343
|
useLayoutEffect12(() => {
|
|
@@ -11343,10 +11358,10 @@ function FormatDetails({ section }) {
|
|
|
11343
11358
|
(stop) => selectedStop !== null && identity(stop.id) === selectedStop
|
|
11344
11359
|
) ?? detail.gradient?.stops[0];
|
|
11345
11360
|
const key = `${editor?.session?.id}:${formatTargetKey4(snapshot)}`;
|
|
11346
|
-
const apply = (patch) => {
|
|
11361
|
+
const apply = (patch, options) => {
|
|
11347
11362
|
if (!editor || `${editor.session?.id}:${formatTargetKey4(editor.snapshot())}` !== key)
|
|
11348
11363
|
return t("disabled.invalidValue");
|
|
11349
|
-
const result = editor.exec({ type: "patchShapeFormat", target: detail.target, patch });
|
|
11364
|
+
const result = editor.exec({ type: "patchShapeFormat", target: detail.target, patch }, options);
|
|
11350
11365
|
if (result.ok && patch.kind === "gradient") {
|
|
11351
11366
|
const next = editor.shapeFormat();
|
|
11352
11367
|
if (next.ok && next.format.gradient && detail.gradient) {
|
|
@@ -11357,7 +11372,7 @@ function FormatDetails({ section }) {
|
|
|
11357
11372
|
};
|
|
11358
11373
|
const disabled = snapshot.mode === "view";
|
|
11359
11374
|
const unavailable = (id) => !effectsAvailable && (id === "reflection" || id === "shadow" && detail.shadow?.kind === "inner");
|
|
11360
|
-
return /* @__PURE__ */
|
|
11375
|
+
return /* @__PURE__ */ jsxs46("div", { className: "pptx-format-details", ref: root, children: [
|
|
11361
11376
|
section === "fill" && detail.gradient && activeStop ? /* @__PURE__ */ jsx50(
|
|
11362
11377
|
FormatGradientPicker,
|
|
11363
11378
|
{
|
|
@@ -11366,14 +11381,14 @@ function FormatDetails({ section }) {
|
|
|
11366
11381
|
onSelect: (id) => setSelectedStop(identity(id))
|
|
11367
11382
|
}
|
|
11368
11383
|
) : null,
|
|
11369
|
-
formatPropertyGroups(detail, section).filter((group) => group.index === void 0 || group.id === activeStop?.id).map((group) => /* @__PURE__ */
|
|
11384
|
+
formatPropertyGroups(detail, section).filter((group) => group.index === void 0 || group.id === activeStop?.id).map((group) => /* @__PURE__ */ jsxs46(
|
|
11370
11385
|
"fieldset",
|
|
11371
11386
|
{
|
|
11372
11387
|
className: "pptx-format-property-group",
|
|
11373
11388
|
"data-format-stop": group.index,
|
|
11374
11389
|
children: [
|
|
11375
11390
|
/* @__PURE__ */ jsx50("legend", { children: t(group.labelKey, group.index ? { index: group.index } : void 0) }),
|
|
11376
|
-
/* @__PURE__ */
|
|
11391
|
+
/* @__PURE__ */ jsxs46("div", { className: "pptx-format-property-fields", children: [
|
|
11377
11392
|
unavailable(group.id) ? /* @__PURE__ */ jsx50("p", { className: "pptx-empty__body", role: "status", children: t("inspector.effectUnavailable") }) : null,
|
|
11378
11393
|
group.colors.map((field) => {
|
|
11379
11394
|
const pick = field.color ? colorPickOf3(field.color) : "keep";
|
|
@@ -11404,7 +11419,7 @@ function FormatDetails({ section }) {
|
|
|
11404
11419
|
max: field.max,
|
|
11405
11420
|
label: t(field.labelKey),
|
|
11406
11421
|
disabled: disabled || unavailable(group.id),
|
|
11407
|
-
onCommit: (value) => apply(field.patch(value))
|
|
11422
|
+
onCommit: (value, options) => apply(field.patch(value), options)
|
|
11408
11423
|
},
|
|
11409
11424
|
field.id.split(".").at(-1)
|
|
11410
11425
|
))
|
|
@@ -11480,7 +11495,7 @@ import {
|
|
|
11480
11495
|
formatTargetKey as formatTargetKey5,
|
|
11481
11496
|
translateKeyOrText as translateKeyOrText19
|
|
11482
11497
|
} from "@pptx-editor.dev/core/editor";
|
|
11483
|
-
import { Fragment as Fragment39, jsx as jsx51, jsxs as
|
|
11498
|
+
import { Fragment as Fragment39, jsx as jsx51, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
11484
11499
|
var EMU_PER_INCH = 914400;
|
|
11485
11500
|
var inches = (emu) => String(Number((emu / EMU_PER_INCH).toFixed(6)));
|
|
11486
11501
|
function FormatGeometry() {
|
|
@@ -11498,11 +11513,11 @@ function FormatGeometry() {
|
|
|
11498
11513
|
);
|
|
11499
11514
|
const background = useEditorDialog("background");
|
|
11500
11515
|
if (!geometry)
|
|
11501
|
-
return selected > 1 ? /* @__PURE__ */
|
|
11516
|
+
return selected > 1 ? /* @__PURE__ */ jsxs47("div", { className: "pptx-empty", children: [
|
|
11502
11517
|
/* @__PURE__ */ jsx51("p", { className: "pptx-empty__title", children: t("panel.format.multipleTitle", { count: selected }) }),
|
|
11503
11518
|
/* @__PURE__ */ jsx51("p", { className: "pptx-empty__body", children: platformShortcuts2(t("panel.format.multipleBody")) })
|
|
11504
|
-
] }) : /* @__PURE__ */
|
|
11505
|
-
/* @__PURE__ */
|
|
11519
|
+
] }) : /* @__PURE__ */ jsxs47(Fragment39, { children: [
|
|
11520
|
+
/* @__PURE__ */ jsxs47("div", { className: "pptx-panel__section", children: [
|
|
11506
11521
|
/* @__PURE__ */ jsx51("h3", { className: "pptx-panel__title", children: t(panelTitle) }),
|
|
11507
11522
|
background.isAvailable ? /* @__PURE__ */ jsx51(
|
|
11508
11523
|
"button",
|
|
@@ -11515,33 +11530,36 @@ function FormatGeometry() {
|
|
|
11515
11530
|
}
|
|
11516
11531
|
) : null
|
|
11517
11532
|
] }),
|
|
11518
|
-
/* @__PURE__ */
|
|
11533
|
+
/* @__PURE__ */ jsxs47("div", { className: "pptx-empty", children: [
|
|
11519
11534
|
/* @__PURE__ */ jsx51("p", { className: "pptx-empty__title", children: t("panel.format.emptyTitle") }),
|
|
11520
11535
|
/* @__PURE__ */ jsx51("p", { className: "pptx-empty__body", children: t(panelBody) })
|
|
11521
11536
|
] })
|
|
11522
11537
|
] });
|
|
11523
11538
|
const g = geometry;
|
|
11524
11539
|
const target = editor ? `${editor.session?.id}:${formatTargetKey5(editor.snapshot())}` : "";
|
|
11525
|
-
const run = (command) => {
|
|
11540
|
+
const run = (command, options) => {
|
|
11526
11541
|
if (!editor || `${editor.session?.id}:${formatTargetKey5(editor.snapshot())}` !== target)
|
|
11527
11542
|
return t("disabled.invalidValue");
|
|
11528
|
-
const result = editor.exec(command);
|
|
11543
|
+
const result = editor.exec(command, options);
|
|
11529
11544
|
return result.ok ? null : translateKeyOrText19(t, result.reason);
|
|
11530
11545
|
};
|
|
11531
|
-
const move = (patch) => {
|
|
11546
|
+
const move = (patch, options) => {
|
|
11532
11547
|
if (!editor || `${editor.session?.id}:${formatTargetKey5(editor.snapshot())}` !== target)
|
|
11533
11548
|
return t("disabled.invalidValue");
|
|
11534
11549
|
const current = editor.snapshot().geometry;
|
|
11535
11550
|
if (!current || current.nodeId !== g.nodeId) return t("disabled.invalidValue");
|
|
11536
|
-
return run(
|
|
11537
|
-
|
|
11538
|
-
|
|
11539
|
-
|
|
11540
|
-
|
|
11541
|
-
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11551
|
+
return run(
|
|
11552
|
+
{
|
|
11553
|
+
type: "setTransform",
|
|
11554
|
+
nodeId: g.nodeId,
|
|
11555
|
+
x: patch.x ?? current.x,
|
|
11556
|
+
y: patch.y ?? current.y,
|
|
11557
|
+
cx: patch.cx ?? current.cx,
|
|
11558
|
+
cy: patch.cy ?? current.cy,
|
|
11559
|
+
rot: patch.rot ?? current.rot
|
|
11560
|
+
},
|
|
11561
|
+
options
|
|
11562
|
+
);
|
|
11545
11563
|
};
|
|
11546
11564
|
const inch = (v) => Math.round(v * EMU_PER_INCH);
|
|
11547
11565
|
const unit = t("panel.format.inchUnit");
|
|
@@ -11554,21 +11572,24 @@ function FormatGeometry() {
|
|
|
11554
11572
|
value: inches(g[key]),
|
|
11555
11573
|
unit,
|
|
11556
11574
|
disabled: readOnly,
|
|
11557
|
-
onCommit: (v) => move(
|
|
11575
|
+
onCommit: (v, options) => move(
|
|
11576
|
+
key === "cx" || key === "cy" ? formatPanelSize(g, key, inch(v)) : { [key]: inch(v) },
|
|
11577
|
+
options
|
|
11578
|
+
)
|
|
11558
11579
|
}
|
|
11559
11580
|
);
|
|
11560
|
-
return /* @__PURE__ */
|
|
11561
|
-
/* @__PURE__ */
|
|
11581
|
+
return /* @__PURE__ */ jsxs47(Fragment39, { children: [
|
|
11582
|
+
/* @__PURE__ */ jsxs47("div", { className: "pptx-panel__section", children: [
|
|
11562
11583
|
/* @__PURE__ */ jsx51("h3", { className: "pptx-panel__title", children: t("panel.format.element") }),
|
|
11563
11584
|
/* @__PURE__ */ jsx51("span", { className: "pptx-chip", children: t(elementKindLabelKey(g, table, { chart, diagram })) })
|
|
11564
11585
|
] }),
|
|
11565
|
-
/* @__PURE__ */
|
|
11586
|
+
/* @__PURE__ */ jsxs47("div", { className: "pptx-panel__section", children: [
|
|
11566
11587
|
/* @__PURE__ */ jsx51("h3", { className: "pptx-panel__title", children: t("panel.format.size") }),
|
|
11567
|
-
/* @__PURE__ */
|
|
11588
|
+
/* @__PURE__ */ jsxs47("div", { className: "pptx-panel__grid", children: [
|
|
11568
11589
|
field("cx", "panel.format.width"),
|
|
11569
11590
|
field("cy", "panel.format.height")
|
|
11570
11591
|
] }),
|
|
11571
|
-
/* @__PURE__ */
|
|
11592
|
+
/* @__PURE__ */ jsxs47("label", { className: "pptx-radio", children: [
|
|
11572
11593
|
/* @__PURE__ */ jsx51(
|
|
11573
11594
|
"input",
|
|
11574
11595
|
{
|
|
@@ -11581,14 +11602,14 @@ function FormatGeometry() {
|
|
|
11581
11602
|
t("imageProperties.lockAspect")
|
|
11582
11603
|
] })
|
|
11583
11604
|
] }),
|
|
11584
|
-
/* @__PURE__ */
|
|
11605
|
+
/* @__PURE__ */ jsxs47("div", { className: "pptx-panel__section", children: [
|
|
11585
11606
|
/* @__PURE__ */ jsx51("h3", { className: "pptx-panel__title", children: t("panel.format.position") }),
|
|
11586
|
-
/* @__PURE__ */
|
|
11607
|
+
/* @__PURE__ */ jsxs47("div", { className: "pptx-panel__grid", children: [
|
|
11587
11608
|
field("x", "panel.format.x"),
|
|
11588
11609
|
field("y", "panel.format.y")
|
|
11589
11610
|
] })
|
|
11590
11611
|
] }),
|
|
11591
|
-
elementRotates(g, table) ? /* @__PURE__ */
|
|
11612
|
+
elementRotates(g, table) ? /* @__PURE__ */ jsxs47("div", { className: "pptx-panel__section", children: [
|
|
11592
11613
|
/* @__PURE__ */ jsx51("h3", { className: "pptx-panel__title", children: t("panel.format.rotation") }),
|
|
11593
11614
|
/* @__PURE__ */ jsx51("div", { className: "pptx-panel__grid", children: /* @__PURE__ */ jsx51(
|
|
11594
11615
|
FormatNumberField,
|
|
@@ -11600,13 +11621,13 @@ function FormatGeometry() {
|
|
|
11600
11621
|
value: String(Math.round(g.rot * 10) / 10),
|
|
11601
11622
|
unit: "\xB0",
|
|
11602
11623
|
disabled: readOnly,
|
|
11603
|
-
onCommit: (v) => move({ rot: v })
|
|
11624
|
+
onCommit: (v, options) => move({ rot: v }, options)
|
|
11604
11625
|
}
|
|
11605
11626
|
) })
|
|
11606
11627
|
] }) : null,
|
|
11607
|
-
table ? /* @__PURE__ */
|
|
11628
|
+
table ? /* @__PURE__ */ jsxs47("div", { className: "pptx-panel__section", children: [
|
|
11608
11629
|
/* @__PURE__ */ jsx51("h3", { className: "pptx-panel__title", children: t("panel.format.table") }),
|
|
11609
|
-
/* @__PURE__ */
|
|
11630
|
+
/* @__PURE__ */ jsxs47("div", { className: "pptx-panel__grid", children: [
|
|
11610
11631
|
/* @__PURE__ */ jsx51(
|
|
11611
11632
|
FormatNumberField,
|
|
11612
11633
|
{
|
|
@@ -11616,7 +11637,7 @@ function FormatGeometry() {
|
|
|
11616
11637
|
value: inches(table.rowHeight),
|
|
11617
11638
|
unit,
|
|
11618
11639
|
disabled: readOnly,
|
|
11619
|
-
onCommit: (v) => run({ type: "setRowHeight", height: inch(v) })
|
|
11640
|
+
onCommit: (v, options) => run({ type: "setRowHeight", height: inch(v) }, options)
|
|
11620
11641
|
}
|
|
11621
11642
|
),
|
|
11622
11643
|
/* @__PURE__ */ jsx51(
|
|
@@ -11628,11 +11649,11 @@ function FormatGeometry() {
|
|
|
11628
11649
|
value: inches(table.columnWidth),
|
|
11629
11650
|
unit,
|
|
11630
11651
|
disabled: readOnly,
|
|
11631
|
-
onCommit: (v) => run({ type: "setColumnWidth", width: inch(v) })
|
|
11652
|
+
onCommit: (v, options) => run({ type: "setColumnWidth", width: inch(v) }, options)
|
|
11632
11653
|
}
|
|
11633
11654
|
)
|
|
11634
11655
|
] }),
|
|
11635
|
-
/* @__PURE__ */ jsx51("div", { className: "pptx-radios", role: "group", "aria-label": t("panel.format.styleOptions"), children: TABLE_OPTION_ROWS.map(({ option, labelKey }) => /* @__PURE__ */
|
|
11656
|
+
/* @__PURE__ */ jsx51("div", { className: "pptx-radios", role: "group", "aria-label": t("panel.format.styleOptions"), children: TABLE_OPTION_ROWS.map(({ option, labelKey }) => /* @__PURE__ */ jsxs47("label", { className: "pptx-radio", children: [
|
|
11636
11657
|
/* @__PURE__ */ jsx51(
|
|
11637
11658
|
"input",
|
|
11638
11659
|
{
|
|
@@ -11645,9 +11666,9 @@ function FormatGeometry() {
|
|
|
11645
11666
|
t(labelKey)
|
|
11646
11667
|
] }, option)) })
|
|
11647
11668
|
] }) : null,
|
|
11648
|
-
g.textFitting ? /* @__PURE__ */
|
|
11669
|
+
g.textFitting ? /* @__PURE__ */ jsxs47("div", { className: "pptx-panel__section", children: [
|
|
11649
11670
|
/* @__PURE__ */ jsx51("h3", { className: "pptx-panel__title", children: t("panel.format.textFitting") }),
|
|
11650
|
-
/* @__PURE__ */ jsx51("div", { className: "pptx-radios", role: "radiogroup", "aria-label": t("panel.format.textFitting"), children: ["none", "shrink", "shape"].map((mode) => /* @__PURE__ */
|
|
11671
|
+
/* @__PURE__ */ jsx51("div", { className: "pptx-radios", role: "radiogroup", "aria-label": t("panel.format.textFitting"), children: ["none", "shrink", "shape"].map((mode) => /* @__PURE__ */ jsxs47("label", { className: "pptx-radio", children: [
|
|
11651
11672
|
/* @__PURE__ */ jsx51(
|
|
11652
11673
|
"input",
|
|
11653
11674
|
{
|
|
@@ -11665,20 +11686,20 @@ function FormatGeometry() {
|
|
|
11665
11686
|
}
|
|
11666
11687
|
|
|
11667
11688
|
// src/FormatPanel.tsx
|
|
11668
|
-
import { jsx as jsx52, jsxs as
|
|
11689
|
+
import { jsx as jsx52, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
11669
11690
|
function FormatSection({ section }) {
|
|
11670
11691
|
const { t } = useTranslation();
|
|
11671
11692
|
const editor = usePptxEditor();
|
|
11672
11693
|
const background = useEditorDialog("background");
|
|
11673
11694
|
const snapshot = useEditorState((s) => s);
|
|
11674
11695
|
const [, refresh] = useState44(0);
|
|
11675
|
-
|
|
11696
|
+
useEffect32(
|
|
11676
11697
|
() => editor ? listenFormatSectionExpansion(editor, () => refresh((n) => n + 1)) : void 0,
|
|
11677
11698
|
[editor]
|
|
11678
11699
|
);
|
|
11679
11700
|
const category = formatSelectionCategory(snapshot);
|
|
11680
11701
|
const expanded = formatSectionOpen(editor, category, section.id);
|
|
11681
|
-
return /* @__PURE__ */
|
|
11702
|
+
return /* @__PURE__ */ jsxs48("details", { className: "pptx-format-disclosure", open: expanded, children: [
|
|
11682
11703
|
/* @__PURE__ */ jsx52(
|
|
11683
11704
|
"summary",
|
|
11684
11705
|
{
|
|
@@ -11691,13 +11712,13 @@ function FormatSection({ section }) {
|
|
|
11691
11712
|
children: t(section.labelKey)
|
|
11692
11713
|
}
|
|
11693
11714
|
),
|
|
11694
|
-
/* @__PURE__ */
|
|
11715
|
+
/* @__PURE__ */ jsxs48("div", { className: "pptx-format-section-body", children: [
|
|
11695
11716
|
section.id === "geometry" ? /* @__PURE__ */ jsx52(FormatGeometry, {}) : null,
|
|
11696
11717
|
section.id === "fill" || section.id === "effects" ? /* @__PURE__ */ jsx52(FormatDetails, { section: section.id }) : null,
|
|
11697
11718
|
section.id === "geometry" ? null : section.id === "chart" ? /* @__PURE__ */ jsx52(ChartDataPane, {}) : section.id === "diagram" ? /* @__PURE__ */ jsx52(DiagramTextPane, {}) : /* @__PURE__ */ jsx52("div", { className: "pptx-format-controls", children: section.slots.filter((slot) => slot !== "slide.background" || background.isAvailable).flatMap((slot) => [
|
|
11698
|
-
/* @__PURE__ */
|
|
11719
|
+
/* @__PURE__ */ jsxs48("div", { className: "pptx-format-control", "data-format-slot": slot, children: [
|
|
11699
11720
|
slot !== "shape.lineWidth" ? /* @__PURE__ */ jsx52("span", { className: "pptx-format-control__label", children: t(chromeControlForSlot6(slot).labelKey) }) : null,
|
|
11700
|
-
formatControlMixed(editor, slot) ? /* @__PURE__ */ jsx52("span", { className: "pptx-format-mixed", children: t("inspector.mixed") }) : null,
|
|
11721
|
+
slot !== "shape.lineWidth" && formatControlMixed(editor, slot) ? /* @__PURE__ */ jsx52("span", { className: "pptx-format-mixed", children: t("inspector.mixed") }) : null,
|
|
11701
11722
|
slot === "shape.lineWidth" ? /* @__PURE__ */ jsx52(FormatLineWidth, {}) : /* @__PURE__ */ jsx52(ToolbarSlot, { slotId: slot })
|
|
11702
11723
|
] }, slot),
|
|
11703
11724
|
slot === "shape.fill" ? /* @__PURE__ */ jsx52(FormatFillTransparency, {}, "fill.transparency") : null
|
|
@@ -11709,9 +11730,9 @@ function FormatPanel({ sections, sectionContent, className, children }) {
|
|
|
11709
11730
|
const editor = usePptxEditor();
|
|
11710
11731
|
const snapshot = useEditorState((s) => s);
|
|
11711
11732
|
const { t } = useTranslation();
|
|
11712
|
-
const root =
|
|
11733
|
+
const root = useRef41(null);
|
|
11713
11734
|
const category = formatSelectionCategory(snapshot);
|
|
11714
|
-
const previousCategory =
|
|
11735
|
+
const previousCategory = useRef41(category);
|
|
11715
11736
|
useLayoutEffect13(() => {
|
|
11716
11737
|
if (previousCategory.current !== category) {
|
|
11717
11738
|
const scroller = root.current?.closest(".pptx-panel__body");
|
|
@@ -11720,7 +11741,7 @@ function FormatPanel({ sections, sectionContent, className, children }) {
|
|
|
11720
11741
|
}
|
|
11721
11742
|
}, [category]);
|
|
11722
11743
|
const target = `${editor?.session?.id ?? ""}:${formatTargetKey6(snapshot)}`;
|
|
11723
|
-
return /* @__PURE__ */
|
|
11744
|
+
return /* @__PURE__ */ jsxs48("div", { ref: root, className: ["pptx-format-panel", className].filter(Boolean).join(" "), children: [
|
|
11724
11745
|
snapshot.selection.kind === "shapes" && snapshot.selection.nodeIds.length > 1 ? /* @__PURE__ */ jsx52("p", { className: "pptx-panel__title", children: t("panel.format.multipleTitle", { count: snapshot.selection.nodeIds.length }) }) : snapshot.geometry ? /* @__PURE__ */ jsx52("p", { className: "pptx-panel__title", children: snapshot.geometry.name }) : null,
|
|
11725
11746
|
/* @__PURE__ */ jsx52("div", { className: "pptx-format-sections", children: formatSectionsOf(snapshot, sections).map((section) => /* @__PURE__ */ jsx52("div", { "data-format-section": section.id, children: sectionContent?.[section.id] !== void 0 ? sectionContent[section.id] : /* @__PURE__ */ jsx52(
|
|
11726
11747
|
FormatSection,
|
|
@@ -11734,7 +11755,7 @@ function FormatPanel({ sections, sectionContent, className, children }) {
|
|
|
11734
11755
|
}
|
|
11735
11756
|
|
|
11736
11757
|
// src/SidePanel.tsx
|
|
11737
|
-
import { jsx as jsx53, jsxs as
|
|
11758
|
+
import { jsx as jsx53, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
11738
11759
|
function PackagedPane({ tab }) {
|
|
11739
11760
|
const { t } = useTranslation();
|
|
11740
11761
|
if (tab === "format") return /* @__PURE__ */ jsx53(FormatPanel, {});
|
|
@@ -11742,7 +11763,7 @@ function PackagedPane({ tab }) {
|
|
|
11742
11763
|
if (tab === "diagram") return /* @__PURE__ */ jsx53(DiagramTextPane, {});
|
|
11743
11764
|
if (tab === "selection") return /* @__PURE__ */ jsx53(SelectionPane, {});
|
|
11744
11765
|
if (tab === "animations") return /* @__PURE__ */ jsx53(AnimationsPane, {});
|
|
11745
|
-
return /* @__PURE__ */
|
|
11766
|
+
return /* @__PURE__ */ jsxs49("div", { className: "pptx-empty", children: [
|
|
11746
11767
|
/* @__PURE__ */ jsx53("p", { className: "pptx-empty__title", children: t("panel.comments.emptyTitle") }),
|
|
11747
11768
|
/* @__PURE__ */ jsx53("p", { className: "pptx-empty__body", children: t("panel.comments.emptyBody") })
|
|
11748
11769
|
] });
|
|
@@ -11767,11 +11788,11 @@ function SidePanel({
|
|
|
11767
11788
|
setOwn(next);
|
|
11768
11789
|
onTabChange?.(next);
|
|
11769
11790
|
};
|
|
11770
|
-
const latest =
|
|
11791
|
+
const latest = useRef42(setTab);
|
|
11771
11792
|
latest.current = setTab;
|
|
11772
|
-
const root =
|
|
11793
|
+
const root = useRef42(null);
|
|
11773
11794
|
const [asked, setAsked] = useState45(null);
|
|
11774
|
-
|
|
11795
|
+
useEffect33(
|
|
11775
11796
|
() => editor ? listenPaneRequests(editor, (pane, request) => {
|
|
11776
11797
|
takePaneRequest(editor);
|
|
11777
11798
|
latest.current(pane);
|
|
@@ -11779,13 +11800,13 @@ function SidePanel({
|
|
|
11779
11800
|
}) : void 0,
|
|
11780
11801
|
[editor]
|
|
11781
11802
|
);
|
|
11782
|
-
|
|
11803
|
+
useEffect33(() => {
|
|
11783
11804
|
const request = takePaneRequest(editor);
|
|
11784
11805
|
if (!request) return;
|
|
11785
11806
|
latest.current(request.pane);
|
|
11786
11807
|
if (request.focus) setAsked({ pane: request.pane });
|
|
11787
11808
|
}, [editor]);
|
|
11788
|
-
|
|
11809
|
+
useEffect33(() => {
|
|
11789
11810
|
if (!asked) return;
|
|
11790
11811
|
const body = root.current?.querySelector(".pptx-panel__body");
|
|
11791
11812
|
if (body?.contains(body.ownerDocument.activeElement)) return;
|
|
@@ -11794,7 +11815,7 @@ function SidePanel({
|
|
|
11794
11815
|
);
|
|
11795
11816
|
(current ?? root.current?.querySelector(`[data-tab="${asked.pane}"]`))?.focus();
|
|
11796
11817
|
}, [asked]);
|
|
11797
|
-
return /* @__PURE__ */
|
|
11818
|
+
return /* @__PURE__ */ jsxs49(
|
|
11798
11819
|
"aside",
|
|
11799
11820
|
{
|
|
11800
11821
|
ref: root,
|
|
@@ -11803,7 +11824,7 @@ function SidePanel({
|
|
|
11803
11824
|
style: paneStyle(paneWidth, style),
|
|
11804
11825
|
onMouseDown: keepFocus,
|
|
11805
11826
|
children: [
|
|
11806
|
-
/* @__PURE__ */
|
|
11827
|
+
/* @__PURE__ */ jsxs49("div", { className: "pptx-panel__head", children: [
|
|
11807
11828
|
/* @__PURE__ */ jsx53(
|
|
11808
11829
|
"div",
|
|
11809
11830
|
{
|
|
@@ -11816,7 +11837,7 @@ function SidePanel({
|
|
|
11816
11837
|
setTab(next);
|
|
11817
11838
|
e.currentTarget.querySelector(`[data-tab="${next}"]`)?.focus();
|
|
11818
11839
|
},
|
|
11819
|
-
children: tabs.map((id) => /* @__PURE__ */
|
|
11840
|
+
children: tabs.map((id) => /* @__PURE__ */ jsxs49(
|
|
11820
11841
|
"button",
|
|
11821
11842
|
{
|
|
11822
11843
|
type: "button",
|
|
@@ -11858,13 +11879,13 @@ import { listenPaneRequests as listenPaneRequests2, requestPane } from "@pptx-ed
|
|
|
11858
11879
|
|
|
11859
11880
|
// src/NotesPane.tsx
|
|
11860
11881
|
import {
|
|
11861
|
-
useCallback as
|
|
11882
|
+
useCallback as useCallback14,
|
|
11862
11883
|
useContext as useContext19,
|
|
11863
|
-
useEffect as
|
|
11884
|
+
useEffect as useEffect36,
|
|
11864
11885
|
useId as useId20,
|
|
11865
11886
|
useLayoutEffect as useLayoutEffect15,
|
|
11866
11887
|
useMemo as useMemo17,
|
|
11867
|
-
useRef as
|
|
11888
|
+
useRef as useRef44,
|
|
11868
11889
|
useState as useState47
|
|
11869
11890
|
} from "react";
|
|
11870
11891
|
import {
|
|
@@ -11897,8 +11918,8 @@ import {
|
|
|
11897
11918
|
REMOVAL_NOTICE_MS,
|
|
11898
11919
|
removalNoticeShows
|
|
11899
11920
|
} from "@pptx-editor.dev/core/editor";
|
|
11900
|
-
import { useContext as useContext18, useEffect as
|
|
11901
|
-
import { jsx as jsx54, jsxs as
|
|
11921
|
+
import { useContext as useContext18, useEffect as useEffect34, useState as useState46, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
11922
|
+
import { jsx as jsx54, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
11902
11923
|
var NO_STORE = () => () => void 0;
|
|
11903
11924
|
var NO_STATE = () => null;
|
|
11904
11925
|
function rejectionMessage(t, rejection) {
|
|
@@ -11913,9 +11934,9 @@ function EditNoticeRoot({ className }) {
|
|
|
11913
11934
|
const [dismissed, setDismissed] = useState46(null);
|
|
11914
11935
|
const [closed, setClosed] = useState46(null);
|
|
11915
11936
|
const [held, setHeld] = useState46(false);
|
|
11916
|
-
|
|
11937
|
+
useEffect34(() => setHeld(false), [removal?.serial]);
|
|
11917
11938
|
const offered = removalNoticeShows(removal, closed);
|
|
11918
|
-
|
|
11939
|
+
useEffect34(() => {
|
|
11919
11940
|
if (!offered || held) return;
|
|
11920
11941
|
const serial = removal.serial;
|
|
11921
11942
|
const timer = setTimeout(() => setClosed(serial), REMOVAL_NOTICE_MS);
|
|
@@ -11928,12 +11949,12 @@ function EditNoticeRoot({ className }) {
|
|
|
11928
11949
|
linkStore?.getState ?? NO_STATE
|
|
11929
11950
|
);
|
|
11930
11951
|
const covered = usePopupEntry("hyperlink") !== false && linkPopupShowsRejection(linkPopup, rejection) || fieldShowsRejection(rejection);
|
|
11931
|
-
|
|
11952
|
+
useEffect34(() => {
|
|
11932
11953
|
if (covered) setDismissed(rejection);
|
|
11933
11954
|
}, [covered, rejection]);
|
|
11934
11955
|
const classes = `pptx-edit-notice${className ? ` ${className}` : ""}`;
|
|
11935
11956
|
if (!covered && editNoticeShows(rejection, dismissed))
|
|
11936
|
-
return /* @__PURE__ */
|
|
11957
|
+
return /* @__PURE__ */ jsxs50(
|
|
11937
11958
|
"div",
|
|
11938
11959
|
{
|
|
11939
11960
|
className: classes,
|
|
@@ -11954,7 +11975,7 @@ function EditNoticeRoot({ className }) {
|
|
|
11954
11975
|
}
|
|
11955
11976
|
);
|
|
11956
11977
|
if (!offered) return null;
|
|
11957
|
-
return /* @__PURE__ */
|
|
11978
|
+
return /* @__PURE__ */ jsxs50(
|
|
11958
11979
|
"div",
|
|
11959
11980
|
{
|
|
11960
11981
|
className: classes,
|
|
@@ -11997,7 +12018,7 @@ function EditNoticeRoot({ className }) {
|
|
|
11997
12018
|
}
|
|
11998
12019
|
|
|
11999
12020
|
// src/NotesView.tsx
|
|
12000
|
-
import { useEffect as
|
|
12021
|
+
import { useEffect as useEffect35, useLayoutEffect as useLayoutEffect14, useRef as useRef43 } from "react";
|
|
12001
12022
|
import {
|
|
12002
12023
|
notesFieldBeforeInput,
|
|
12003
12024
|
notesFieldFocused,
|
|
@@ -12026,7 +12047,7 @@ function NotesField({
|
|
|
12026
12047
|
onSelection,
|
|
12027
12048
|
onFocus
|
|
12028
12049
|
}) {
|
|
12029
|
-
const composing =
|
|
12050
|
+
const composing = useRef43(false);
|
|
12030
12051
|
useLayoutEffect14(() => {
|
|
12031
12052
|
const el = fieldRef.current;
|
|
12032
12053
|
if (!el || drafting) return;
|
|
@@ -12037,9 +12058,9 @@ function NotesField({
|
|
|
12037
12058
|
if (keep) selectNotes(el, keep.start, keep.end);
|
|
12038
12059
|
onSelection();
|
|
12039
12060
|
}, [paragraphs, drafting, fieldRef, restore, onSelection]);
|
|
12040
|
-
const draftRef =
|
|
12061
|
+
const draftRef = useRef43(onDraft);
|
|
12041
12062
|
draftRef.current = onDraft;
|
|
12042
|
-
|
|
12063
|
+
useEffect35(() => {
|
|
12043
12064
|
const el = fieldRef.current;
|
|
12044
12065
|
if (!el) return;
|
|
12045
12066
|
const onBeforeInput = (e) => notesFieldBeforeInput(e, el, {
|
|
@@ -12087,7 +12108,7 @@ function NotesField({
|
|
|
12087
12108
|
}
|
|
12088
12109
|
|
|
12089
12110
|
// src/NotesPane.tsx
|
|
12090
|
-
import { jsx as jsx56, jsxs as
|
|
12111
|
+
import { jsx as jsx56, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
12091
12112
|
var NO_FORMATS = NO_NOTES_FORMATS;
|
|
12092
12113
|
function useNotesOpen(props) {
|
|
12093
12114
|
const shared = useContext19(PaneStateContext);
|
|
@@ -12103,9 +12124,9 @@ function useNotesOpen(props) {
|
|
|
12103
12124
|
}
|
|
12104
12125
|
props.onOpenChange?.(next);
|
|
12105
12126
|
};
|
|
12106
|
-
const request =
|
|
12127
|
+
const request = useRef44(setOpenValue);
|
|
12107
12128
|
request.current = setOpenValue;
|
|
12108
|
-
const handler =
|
|
12129
|
+
const handler = useRef44((next) => request.current(next)).current;
|
|
12109
12130
|
const slot = shared?.notesRequest ?? null;
|
|
12110
12131
|
useLayoutEffect15(() => {
|
|
12111
12132
|
if (slot?.current && slot.current !== handler) warnDuplicatePane("PptxEditor.NotesPane");
|
|
@@ -12147,17 +12168,17 @@ function NotesPaneBody(props) {
|
|
|
12147
12168
|
const [refusal, setRefusal] = useState47(null);
|
|
12148
12169
|
const [formats, setFormats] = useState47(NO_FORMATS);
|
|
12149
12170
|
const [canFormat, setCanFormat] = useState47(false);
|
|
12150
|
-
const field =
|
|
12151
|
-
const pending =
|
|
12152
|
-
const bound =
|
|
12153
|
-
const restore =
|
|
12171
|
+
const field = useRef44(null);
|
|
12172
|
+
const pending = useRef44(null);
|
|
12173
|
+
const bound = useRef44(null);
|
|
12174
|
+
const restore = useRef44(null);
|
|
12154
12175
|
const paragraphs = useMemo17(
|
|
12155
12176
|
() => formatted ?? notes.split("\n").map((text) => ({
|
|
12156
12177
|
runs: [{ text, bold: false, italic: false, underline: false, strike: false }]
|
|
12157
12178
|
})),
|
|
12158
12179
|
[formatted, notes]
|
|
12159
12180
|
);
|
|
12160
|
-
const commit =
|
|
12181
|
+
const commit = useCallback14(
|
|
12161
12182
|
(leaving = false) => {
|
|
12162
12183
|
const d = pending.current;
|
|
12163
12184
|
pending.current = null;
|
|
@@ -12181,11 +12202,11 @@ function NotesPaneBody(props) {
|
|
|
12181
12202
|
},
|
|
12182
12203
|
[editor, t]
|
|
12183
12204
|
);
|
|
12184
|
-
|
|
12205
|
+
useEffect36(() => {
|
|
12185
12206
|
if (pending.current && pending.current.slideId !== slideId) commit();
|
|
12186
12207
|
bound.current = slideId;
|
|
12187
12208
|
}, [slideId, commit]);
|
|
12188
|
-
|
|
12209
|
+
useEffect36(() => {
|
|
12189
12210
|
if (!draft) return;
|
|
12190
12211
|
const doc = field.current?.ownerDocument;
|
|
12191
12212
|
const onPointerDown = (e) => {
|
|
@@ -12197,8 +12218,8 @@ function NotesPaneBody(props) {
|
|
|
12197
12218
|
useLayoutEffect15(() => {
|
|
12198
12219
|
if (!open) commit();
|
|
12199
12220
|
}, [open, commit]);
|
|
12200
|
-
|
|
12201
|
-
const readFormats =
|
|
12221
|
+
useEffect36(() => () => commit(), [commit]);
|
|
12222
|
+
const readFormats = useCallback14(() => {
|
|
12202
12223
|
const el = field.current;
|
|
12203
12224
|
if (el) followNotesArm(el);
|
|
12204
12225
|
const range = el && notesFieldFocused(el) ? notesSelection2(el) : null;
|
|
@@ -12206,9 +12227,9 @@ function NotesPaneBody(props) {
|
|
|
12206
12227
|
setCanFormat(!!el && notesCanFormat(notesFieldText2(el), range));
|
|
12207
12228
|
setFormats((was) => sameNotesFormats(was, next) ? was : next);
|
|
12208
12229
|
}, []);
|
|
12209
|
-
const focused =
|
|
12210
|
-
const applyRef =
|
|
12211
|
-
const leaveSlide =
|
|
12230
|
+
const focused = useRef44(false);
|
|
12231
|
+
const applyRef = useRef44(() => false);
|
|
12232
|
+
const leaveSlide = useCallback14(() => {
|
|
12212
12233
|
if (editor && editor.snapshot().selection.kind !== "none")
|
|
12213
12234
|
editor.setSelection({ kind: "none" });
|
|
12214
12235
|
}, [editor]);
|
|
@@ -12228,18 +12249,18 @@ function NotesPaneBody(props) {
|
|
|
12228
12249
|
setCanFormat(false);
|
|
12229
12250
|
setFormats(NO_FORMATS);
|
|
12230
12251
|
};
|
|
12231
|
-
|
|
12252
|
+
useEffect36(() => {
|
|
12232
12253
|
const doc = field.current?.ownerDocument;
|
|
12233
12254
|
if (!active || !doc) return;
|
|
12234
12255
|
readFormats();
|
|
12235
12256
|
doc.addEventListener("selectionchange", readFormats);
|
|
12236
12257
|
return () => doc.removeEventListener("selectionchange", readFormats);
|
|
12237
12258
|
}, [active, readFormats]);
|
|
12238
|
-
|
|
12259
|
+
useEffect36(() => {
|
|
12239
12260
|
if (editor && focused.current)
|
|
12240
12261
|
setNotesTarget(editor, { formats, readOnly, canFormat, apply: (f) => applyRef.current(f) });
|
|
12241
12262
|
}, [editor, formats, readOnly, canFormat]);
|
|
12242
|
-
|
|
12263
|
+
useEffect36(
|
|
12243
12264
|
() => () => {
|
|
12244
12265
|
if (editor) setNotesTarget(editor, null);
|
|
12245
12266
|
},
|
|
@@ -12249,11 +12270,11 @@ function NotesPaneBody(props) {
|
|
|
12249
12270
|
const [findCount, setFindCount] = useState47(0);
|
|
12250
12271
|
const selectionKind = useEditorState((s) => s.selection.kind);
|
|
12251
12272
|
const revision = useEditorState((s) => s.revision);
|
|
12252
|
-
|
|
12273
|
+
useEffect36(
|
|
12253
12274
|
() => editor ? onFindShown2(editor.find, () => setFindCount((n) => n + 1)) : void 0,
|
|
12254
12275
|
[editor]
|
|
12255
12276
|
);
|
|
12256
|
-
|
|
12277
|
+
useEffect36(() => {
|
|
12257
12278
|
painter.paint(editor, open ? field.current : null, paragraphs, !!draft);
|
|
12258
12279
|
}, [
|
|
12259
12280
|
painter,
|
|
@@ -12267,7 +12288,7 @@ function NotesPaneBody(props) {
|
|
|
12267
12288
|
revision,
|
|
12268
12289
|
slideId
|
|
12269
12290
|
]);
|
|
12270
|
-
|
|
12291
|
+
useEffect36(() => () => painter.stop(), [painter]);
|
|
12271
12292
|
const onDraft = (text) => {
|
|
12272
12293
|
const id = pending.current?.slideId ?? bound.current ?? slideId;
|
|
12273
12294
|
if (!id) return;
|
|
@@ -12319,7 +12340,7 @@ function NotesPaneBody(props) {
|
|
|
12319
12340
|
if (editor.snapshot().notesFormatted === before) restore.current = null;
|
|
12320
12341
|
leaveSlide();
|
|
12321
12342
|
};
|
|
12322
|
-
return /* @__PURE__ */
|
|
12343
|
+
return /* @__PURE__ */ jsxs51(
|
|
12323
12344
|
"section",
|
|
12324
12345
|
{
|
|
12325
12346
|
className: ["pptx-notes", className].filter(Boolean).join(" "),
|
|
@@ -12327,7 +12348,7 @@ function NotesPaneBody(props) {
|
|
|
12327
12348
|
"data-open": open ? "true" : "false",
|
|
12328
12349
|
style: props.style,
|
|
12329
12350
|
children: [
|
|
12330
|
-
/* @__PURE__ */
|
|
12351
|
+
/* @__PURE__ */ jsxs51("div", { className: "pptx-notes__head", onMouseDown: keepFocus, children: [
|
|
12331
12352
|
/* @__PURE__ */ jsx56("span", { children: t("notes.title") }),
|
|
12332
12353
|
open && !readOnly && showFormatButtons ? /* @__PURE__ */ jsx56("div", { className: "pptx-notes__format", role: "group", "aria-label": t("notes.format"), children: NOTES_FORMAT_BUTTONS.map(([format, icon, key]) => /* @__PURE__ */ jsx56(
|
|
12333
12354
|
ToolButton,
|
|
@@ -12385,7 +12406,7 @@ function NotesPaneBody(props) {
|
|
|
12385
12406
|
}
|
|
12386
12407
|
|
|
12387
12408
|
// src/panes.tsx
|
|
12388
|
-
import { jsx as jsx57, jsxs as
|
|
12409
|
+
import { jsx as jsx57, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
12389
12410
|
var sameSlides = (a, b) => a.length === b.length && a.every((s, i) => s === b[i]);
|
|
12390
12411
|
var sameIndices2 = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
|
|
12391
12412
|
var clickMode = slideClickMode;
|
|
@@ -12394,8 +12415,8 @@ var Thumbnail = memo2(function Thumbnail2({
|
|
|
12394
12415
|
ratio
|
|
12395
12416
|
}) {
|
|
12396
12417
|
const editor = usePptxEditor();
|
|
12397
|
-
const box =
|
|
12398
|
-
|
|
12418
|
+
const box = useRef45(null);
|
|
12419
|
+
useEffect37(() => {
|
|
12399
12420
|
if (!editor || !box.current) return void 0;
|
|
12400
12421
|
return editor.renderThumbnail(slide.index, box.current, { defer: true });
|
|
12401
12422
|
}, [editor, slide]);
|
|
@@ -12412,7 +12433,7 @@ var Thumbnail = memo2(function Thumbnail2({
|
|
|
12412
12433
|
});
|
|
12413
12434
|
var RailItem = memo2(function RailItem2(props) {
|
|
12414
12435
|
const { slide: s, on } = props;
|
|
12415
|
-
return /* @__PURE__ */
|
|
12436
|
+
return /* @__PURE__ */ jsxs52(
|
|
12416
12437
|
"li",
|
|
12417
12438
|
{
|
|
12418
12439
|
className: "pptx-rail__item",
|
|
@@ -12441,8 +12462,8 @@ var RailItem = memo2(function RailItem2(props) {
|
|
|
12441
12462
|
);
|
|
12442
12463
|
});
|
|
12443
12464
|
function useFocusFollowsCurrent(list, item, current, count, shown = true) {
|
|
12444
|
-
const focused =
|
|
12445
|
-
|
|
12465
|
+
const focused = useRef45(null);
|
|
12466
|
+
useEffect37(() => {
|
|
12446
12467
|
followCurrentSlide(list.current, item, focused.current);
|
|
12447
12468
|
}, [list, item, current, count, shown]);
|
|
12448
12469
|
return (e) => {
|
|
@@ -12460,11 +12481,11 @@ function stripStyle(style) {
|
|
|
12460
12481
|
return rest;
|
|
12461
12482
|
}
|
|
12462
12483
|
function useProgressiveMount(total, needed, opening, loading) {
|
|
12463
|
-
const [, grow] =
|
|
12484
|
+
const [, grow] = useReducer2((n) => n + 1, 0);
|
|
12464
12485
|
const [mount] = useState48(() => createProgressiveMount(grow));
|
|
12465
|
-
|
|
12486
|
+
useEffect37(() => () => mount.dispose(), [mount]);
|
|
12466
12487
|
const shown = mount.limit(total, needed, opening, loading);
|
|
12467
|
-
|
|
12488
|
+
useEffect37(() => mount.follow(total));
|
|
12468
12489
|
return shown;
|
|
12469
12490
|
}
|
|
12470
12491
|
function usePaneOpen(props) {
|
|
@@ -12484,9 +12505,9 @@ function SlideRail(props = {}) {
|
|
|
12484
12505
|
function SlideList(props) {
|
|
12485
12506
|
const [open, setPaneOpen] = usePaneOpen(props);
|
|
12486
12507
|
const toggle = props.toggle !== false;
|
|
12487
|
-
const rail =
|
|
12508
|
+
const rail = useRef45(null);
|
|
12488
12509
|
const listId = useId21();
|
|
12489
|
-
const focusToggle =
|
|
12510
|
+
const focusToggle = useRef45(false);
|
|
12490
12511
|
const setOpen = (next) => {
|
|
12491
12512
|
focusToggle.current = rail.current?.contains(document.activeElement) ?? false;
|
|
12492
12513
|
setPaneOpen(next);
|
|
@@ -12498,14 +12519,14 @@ function SlideList(props) {
|
|
|
12498
12519
|
const selected = useEditorState((s) => s.selectedSlides, sameIndices2);
|
|
12499
12520
|
const ratio = useEditorState((s) => s.slideHeight / s.slideWidth);
|
|
12500
12521
|
const readOnly = useEditorState((s) => s.mode === "view");
|
|
12501
|
-
const list =
|
|
12522
|
+
const list = useRef45(null);
|
|
12502
12523
|
const count = slides.length;
|
|
12503
12524
|
const opening = useEditorState((s) => (s.pendingSlides ?? 0) > 0);
|
|
12504
12525
|
const loading = useEditorState((s) => s.isOpening === true);
|
|
12505
12526
|
const mounted = useProgressiveMount(count, current, opening, loading);
|
|
12506
12527
|
const [menu, setMenu] = useState48(null);
|
|
12507
12528
|
const [gallery, setGallery] = useState48(null);
|
|
12508
|
-
const actions =
|
|
12529
|
+
const actions = useRef45(null);
|
|
12509
12530
|
const sections = useSlideSections();
|
|
12510
12531
|
const grouped = groupSlideSections2(sections, count);
|
|
12511
12532
|
const inView = grouped ? mountedSections(grouped, mounted) : null;
|
|
@@ -12514,7 +12535,7 @@ function SlideList(props) {
|
|
|
12514
12535
|
useLayoutEffect16(() => setRightToLeft(railRightToLeft2(rail.current)), [orientation, open]);
|
|
12515
12536
|
const chrome = railOrientationChrome2(orientation, rightToLeft);
|
|
12516
12537
|
const [folded, setFolded] = useState48(false);
|
|
12517
|
-
|
|
12538
|
+
useEffect37(() => watchRailFold(rail.current, orientation, setFolded), [orientation, open]);
|
|
12518
12539
|
const {
|
|
12519
12540
|
itemProps: dragProps,
|
|
12520
12541
|
cancel: cancelDrag,
|
|
@@ -12537,9 +12558,9 @@ function SlideList(props) {
|
|
|
12537
12558
|
runSlideStep2(editor, stepCommand2(selected, stepTarget(step)));
|
|
12538
12559
|
};
|
|
12539
12560
|
const trackFocus = useFocusFollowsCurrent(list, ".pptx-rail__item", current, count, open);
|
|
12540
|
-
|
|
12561
|
+
useEffect37(() => keepCurrentSlideInView2(list.current, ".pptx-rail__item"), [open]);
|
|
12541
12562
|
const why = !editor ? t("disabled.noEditor") : readOnly ? t("disabled.viewing") : null;
|
|
12542
|
-
|
|
12563
|
+
useEffect37(() => {
|
|
12543
12564
|
const active = document.activeElement;
|
|
12544
12565
|
const lost = !active || active === document.body || rail.current?.contains(active);
|
|
12545
12566
|
if (focusToggle.current && lost)
|
|
@@ -12550,7 +12571,7 @@ function SlideList(props) {
|
|
|
12550
12571
|
setRenaming(null);
|
|
12551
12572
|
}
|
|
12552
12573
|
}, [open, cancelDrag]);
|
|
12553
|
-
|
|
12574
|
+
useEffect37(() => {
|
|
12554
12575
|
focusToggle.current = false;
|
|
12555
12576
|
});
|
|
12556
12577
|
const onKeyDown = (e) => railKeyDown(e, {
|
|
@@ -12567,7 +12588,7 @@ function SlideList(props) {
|
|
|
12567
12588
|
focusCurrent
|
|
12568
12589
|
});
|
|
12569
12590
|
const [memoItem] = useState48(() => createItemMemo());
|
|
12570
|
-
const latest =
|
|
12591
|
+
const latest = useRef45({ editor, dragProps, openMenu });
|
|
12571
12592
|
useLayoutEffect16(() => {
|
|
12572
12593
|
latest.current = { editor, dragProps, openMenu };
|
|
12573
12594
|
});
|
|
@@ -12661,7 +12682,7 @@ function SlideList(props) {
|
|
|
12661
12682
|
children: /* @__PURE__ */ jsx57(RailActionsContext.Provider, { value: railActions, children: railExpandContent(props.children) })
|
|
12662
12683
|
}
|
|
12663
12684
|
);
|
|
12664
|
-
return /* @__PURE__ */
|
|
12685
|
+
return /* @__PURE__ */ jsxs52(
|
|
12665
12686
|
"nav",
|
|
12666
12687
|
{
|
|
12667
12688
|
ref: rail,
|
|
@@ -12745,9 +12766,9 @@ function ZoomPill({ className } = {}) {
|
|
|
12745
12766
|
const off = useEditorState((s) => s.presentationView === "slideSorter");
|
|
12746
12767
|
const reason = off ? t("disabled.sorterZoom") : null;
|
|
12747
12768
|
const levelLabel = off ? t("zoom.ariaLabel") : t("zoom.levelAriaLabel", { percent: Math.round(zoom * 100) });
|
|
12748
|
-
const anchor =
|
|
12769
|
+
const anchor = useRef45(null);
|
|
12749
12770
|
const [open, setOpen] = useState48(false);
|
|
12750
|
-
|
|
12771
|
+
useEffect37(() => {
|
|
12751
12772
|
if (off) setOpen(false);
|
|
12752
12773
|
}, [off]);
|
|
12753
12774
|
const step = (dir) => {
|
|
@@ -12759,7 +12780,7 @@ function ZoomPill({ className } = {}) {
|
|
|
12759
12780
|
const key = zoomLimitReason(zoom, dir);
|
|
12760
12781
|
return key ? t(key) : null;
|
|
12761
12782
|
};
|
|
12762
|
-
return /* @__PURE__ */
|
|
12783
|
+
return /* @__PURE__ */ jsxs52(
|
|
12763
12784
|
"div",
|
|
12764
12785
|
{
|
|
12765
12786
|
className: ["pptx-zoom", className].filter(Boolean).join(" "),
|
|
@@ -12777,7 +12798,7 @@ function ZoomPill({ className } = {}) {
|
|
|
12777
12798
|
disabledReason: reason ?? limit(-1)
|
|
12778
12799
|
}
|
|
12779
12800
|
),
|
|
12780
|
-
/* @__PURE__ */
|
|
12801
|
+
/* @__PURE__ */ jsxs52(
|
|
12781
12802
|
"button",
|
|
12782
12803
|
{
|
|
12783
12804
|
ref: anchor,
|
|
@@ -12807,7 +12828,7 @@ function ZoomPill({ className } = {}) {
|
|
|
12807
12828
|
disabledReason: reason ?? limit(1)
|
|
12808
12829
|
}
|
|
12809
12830
|
),
|
|
12810
|
-
open && !off ? /* @__PURE__ */
|
|
12831
|
+
open && !off ? /* @__PURE__ */ jsxs52(Popover, { anchor: anchor.current, onClose: () => setOpen(false), align: "end", children: [
|
|
12811
12832
|
/* @__PURE__ */ jsx57(MenuItem, { checked: fit, onSelect: () => (editor?.setZoom("fit"), setOpen(false)), children: t("zoom.fit") }),
|
|
12812
12833
|
ZOOM_MENU_LEVELS.map((z) => /* @__PURE__ */ jsx57(
|
|
12813
12834
|
MenuItem,
|
|
@@ -12825,7 +12846,7 @@ function ZoomPill({ className } = {}) {
|
|
|
12825
12846
|
}
|
|
12826
12847
|
|
|
12827
12848
|
// src/SlideSorter.tsx
|
|
12828
|
-
import { jsx as jsx58, jsxs as
|
|
12849
|
+
import { jsx as jsx58, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
12829
12850
|
var sameList = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
|
|
12830
12851
|
function SlideSorter({ className } = {}) {
|
|
12831
12852
|
const editor = usePptxEditor();
|
|
@@ -12840,15 +12861,15 @@ function SlideSorter({ className } = {}) {
|
|
|
12840
12861
|
const collapsed = useCollapsedSections();
|
|
12841
12862
|
useOpenCurrentSection(grouped);
|
|
12842
12863
|
useSorterRegistration();
|
|
12843
|
-
const list =
|
|
12864
|
+
const list = useRef46(null);
|
|
12844
12865
|
const { itemProps: dragProps } = useSlideDrag("x", selected, readOnly, grouped);
|
|
12845
12866
|
const [menu, setMenu] = useState49(null);
|
|
12846
12867
|
const [renaming, setRenaming] = useState49(null);
|
|
12847
12868
|
useSectionRenameRequests(setRenaming);
|
|
12848
12869
|
const focusCurrent = useFocusCurrentAfterRender(list);
|
|
12849
12870
|
useFocusAfterCollapse(list, collapsed);
|
|
12850
|
-
|
|
12851
|
-
const editorNow =
|
|
12871
|
+
useEffect38(() => list.current ? focusSorterOnShow(list.current) : void 0, []);
|
|
12872
|
+
const editorNow = useRef46(editor);
|
|
12852
12873
|
editorNow.current = editor;
|
|
12853
12874
|
useLayoutEffect17(() => {
|
|
12854
12875
|
const el = list.current;
|
|
@@ -12881,7 +12902,7 @@ function SlideSorter({ className } = {}) {
|
|
|
12881
12902
|
focusCurrent,
|
|
12882
12903
|
openSlide
|
|
12883
12904
|
});
|
|
12884
|
-
const item = (s) => /* @__PURE__ */
|
|
12905
|
+
const item = (s) => /* @__PURE__ */ jsxs53(
|
|
12885
12906
|
"li",
|
|
12886
12907
|
{
|
|
12887
12908
|
className: "pptx-sorter__item",
|
|
@@ -12910,7 +12931,7 @@ function SlideSorter({ className } = {}) {
|
|
|
12910
12931
|
},
|
|
12911
12932
|
s.id
|
|
12912
12933
|
);
|
|
12913
|
-
return /* @__PURE__ */
|
|
12934
|
+
return /* @__PURE__ */ jsxs53(
|
|
12914
12935
|
"section",
|
|
12915
12936
|
{
|
|
12916
12937
|
className: ["pptx-sorter", className].filter(Boolean).join(" "),
|
|
@@ -12974,7 +12995,7 @@ function ViewSwitch() {
|
|
|
12974
12995
|
const buttons = e.currentTarget.parentElement?.querySelectorAll('[role="radio"]');
|
|
12975
12996
|
buttons?.[options.indexOf(next)]?.focus();
|
|
12976
12997
|
};
|
|
12977
|
-
return /* @__PURE__ */
|
|
12998
|
+
return /* @__PURE__ */ jsxs53(
|
|
12978
12999
|
"div",
|
|
12979
13000
|
{
|
|
12980
13001
|
className: "pptx-zoom pptx-view-switch",
|
|
@@ -13023,17 +13044,17 @@ function DefaultWorkspace({
|
|
|
13023
13044
|
}) {
|
|
13024
13045
|
const editor = usePptxEditor();
|
|
13025
13046
|
const view = useEditorState((s) => s.presentationView ?? "normal");
|
|
13026
|
-
const box =
|
|
13027
|
-
const was =
|
|
13028
|
-
|
|
13047
|
+
const box = useRef46(null);
|
|
13048
|
+
const was = useRef46(view);
|
|
13049
|
+
useEffect38(() => {
|
|
13029
13050
|
if (was.current === view) return;
|
|
13030
13051
|
was.current = view;
|
|
13031
13052
|
const active = box.current?.ownerDocument.activeElement;
|
|
13032
13053
|
if (active && active !== active.ownerDocument.body && active.isConnected) return;
|
|
13033
13054
|
focusCurrentSlideOrCanvas(box.current, editor);
|
|
13034
13055
|
}, [view, editor]);
|
|
13035
|
-
const inset =
|
|
13036
|
-
|
|
13056
|
+
const inset = useRef46(null);
|
|
13057
|
+
useEffect38(() => {
|
|
13037
13058
|
if (!box.current) return;
|
|
13038
13059
|
const tracker = trackNotesInset(box.current);
|
|
13039
13060
|
inset.current = tracker;
|
|
@@ -13042,16 +13063,16 @@ function DefaultWorkspace({
|
|
|
13042
13063
|
inset.current = null;
|
|
13043
13064
|
};
|
|
13044
13065
|
}, []);
|
|
13045
|
-
|
|
13066
|
+
useEffect38(() => {
|
|
13046
13067
|
inset.current?.refresh();
|
|
13047
13068
|
});
|
|
13048
|
-
return /* @__PURE__ */
|
|
13049
|
-
view === "slideSorter" ? /* @__PURE__ */ jsx58("div", { className: "pptx-default__workspace", children: /* @__PURE__ */
|
|
13069
|
+
return /* @__PURE__ */ jsxs53("div", { ref: box, className: "pptx-default__views", children: [
|
|
13070
|
+
view === "slideSorter" ? /* @__PURE__ */ jsx58("div", { className: "pptx-default__workspace", children: /* @__PURE__ */ jsxs53("div", { className: "pptx-default__main", children: [
|
|
13050
13071
|
/* @__PURE__ */ jsx58(SlideSorter, {}),
|
|
13051
13072
|
/* @__PURE__ */ jsx58(EditNotice, {})
|
|
13052
13073
|
] }) }) : normal,
|
|
13053
13074
|
overlay,
|
|
13054
|
-
status === void 0 ? /* @__PURE__ */
|
|
13075
|
+
status === void 0 ? /* @__PURE__ */ jsxs53("div", { className: "pptx-statusbar", children: [
|
|
13055
13076
|
/* @__PURE__ */ jsx58(ReadOnlyBadge, {}),
|
|
13056
13077
|
/* @__PURE__ */ jsx58(ViewSwitch, {}),
|
|
13057
13078
|
/* @__PURE__ */ jsx58(ZoomPill, {})
|
|
@@ -13067,24 +13088,24 @@ function ReadOnlyBadge() {
|
|
|
13067
13088
|
function SlideSorterWatch() {
|
|
13068
13089
|
const editor = usePptxEditor();
|
|
13069
13090
|
const sorter = useEditorState((s) => s.presentationView === "slideSorter");
|
|
13070
|
-
|
|
13091
|
+
useEffect38(() => {
|
|
13071
13092
|
if (sorter && editor && !slideSorterMounted(editor)) warnSlideSorterUnmounted();
|
|
13072
13093
|
}, [sorter, editor]);
|
|
13073
13094
|
return null;
|
|
13074
13095
|
}
|
|
13075
13096
|
|
|
13076
13097
|
// src/ChromeTooltip.tsx
|
|
13077
|
-
import { useEffect as
|
|
13098
|
+
import { useEffect as useEffect39, useLayoutEffect as useLayoutEffect18, useRef as useRef47, useState as useState50 } from "react";
|
|
13078
13099
|
import { createPortal as createPortal3 } from "react-dom";
|
|
13079
13100
|
import {
|
|
13080
13101
|
listenChromeTooltips,
|
|
13081
13102
|
positionChromeTooltip
|
|
13082
13103
|
} from "@pptx-editor.dev/core/editor";
|
|
13083
|
-
import { jsx as jsx59, jsxs as
|
|
13104
|
+
import { jsx as jsx59, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
13084
13105
|
function ChromeTooltip() {
|
|
13085
13106
|
const [state, setState] = useState50(null);
|
|
13086
|
-
const ref =
|
|
13087
|
-
|
|
13107
|
+
const ref = useRef47(null);
|
|
13108
|
+
useEffect39(
|
|
13088
13109
|
() => typeof document === "undefined" ? void 0 : listenChromeTooltips(document, setState),
|
|
13089
13110
|
[]
|
|
13090
13111
|
);
|
|
@@ -13094,7 +13115,7 @@ function ChromeTooltip() {
|
|
|
13094
13115
|
if (!state) return null;
|
|
13095
13116
|
return createPortal3(
|
|
13096
13117
|
// Visual only: the control's `aria-label` and `aria-describedby` carry the same text.
|
|
13097
|
-
/* @__PURE__ */
|
|
13118
|
+
/* @__PURE__ */ jsxs54(
|
|
13098
13119
|
"div",
|
|
13099
13120
|
{
|
|
13100
13121
|
ref,
|
|
@@ -13113,26 +13134,26 @@ function ChromeTooltip() {
|
|
|
13113
13134
|
}
|
|
13114
13135
|
|
|
13115
13136
|
// src/PptxEditorRoot.tsx
|
|
13116
|
-
import { Fragment as Fragment40, jsx as jsx60, jsxs as
|
|
13137
|
+
import { Fragment as Fragment40, jsx as jsx60, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
13117
13138
|
var PptxEditorRoot = forwardRef(
|
|
13118
13139
|
function PptxEditorRoot2(props, ref) {
|
|
13119
13140
|
const { document: bytes, mode = "edit", locale, onReady, onChange, children } = props;
|
|
13120
13141
|
const [editor, setEditor] = useState51(null);
|
|
13121
|
-
const live =
|
|
13142
|
+
const live = useRef48(null);
|
|
13122
13143
|
useImperativeHandle(ref, () => createEditorRefApi(() => live.current), []);
|
|
13123
|
-
const callbacks =
|
|
13144
|
+
const callbacks = useRef48({ onReady, onChange, onFontError: props.onFontError });
|
|
13124
13145
|
callbacks.current = { onReady, onChange, onFontError: props.onFontError };
|
|
13125
|
-
const createdFonts =
|
|
13126
|
-
const createdFamilies =
|
|
13127
|
-
const createdModules =
|
|
13146
|
+
const createdFonts = useRef48(props.fonts);
|
|
13147
|
+
const createdFamilies = useRef48(props.fontFamilies);
|
|
13148
|
+
const createdModules = useRef48(props.modules);
|
|
13128
13149
|
const localeKey = localeContentKey(locale);
|
|
13129
|
-
const translator =
|
|
13150
|
+
const translator = useRef48(null);
|
|
13130
13151
|
if (translator.current?.key !== localeKey)
|
|
13131
13152
|
translator.current = { key: localeKey, t: translatorFor(locale) };
|
|
13132
13153
|
const t = translator.current.t;
|
|
13133
|
-
const tRef =
|
|
13154
|
+
const tRef = useRef48(t);
|
|
13134
13155
|
tRef.current = t;
|
|
13135
|
-
|
|
13156
|
+
useEffect40(() => {
|
|
13136
13157
|
const instance = createPptxEditor({
|
|
13137
13158
|
mode,
|
|
13138
13159
|
...props.fontFamilies ? { fontFamilies: props.fontFamilies } : {},
|
|
@@ -13159,24 +13180,24 @@ var PptxEditorRoot = forwardRef(
|
|
|
13159
13180
|
}, []);
|
|
13160
13181
|
const [documentChurn] = useState51(() => churnWarning("PptxEditor.Root", "document"));
|
|
13161
13182
|
const [fontsChurn] = useState51(() => churnWarning("PptxEditor.Root", "fonts"));
|
|
13162
|
-
|
|
13183
|
+
useEffect40(() => {
|
|
13163
13184
|
if (!editor || !bytes) return;
|
|
13164
13185
|
documentChurn();
|
|
13165
13186
|
void editor.load(bytes);
|
|
13166
13187
|
}, [editor, bytes, documentChurn]);
|
|
13167
|
-
|
|
13188
|
+
useEffect40(() => {
|
|
13168
13189
|
editor?.setMode(mode);
|
|
13169
13190
|
}, [editor, mode]);
|
|
13170
13191
|
const author = props.author;
|
|
13171
|
-
|
|
13192
|
+
useEffect40(() => {
|
|
13172
13193
|
editor?.setAuthor(author);
|
|
13173
13194
|
}, [editor, author]);
|
|
13174
13195
|
const modules = props.modules;
|
|
13175
|
-
|
|
13196
|
+
useEffect40(() => {
|
|
13176
13197
|
if (editor) warnModulesChanged(createdModules.current, modules, "PptxEditor.Root");
|
|
13177
13198
|
}, [editor, modules]);
|
|
13178
13199
|
const fonts = props.fonts;
|
|
13179
|
-
|
|
13200
|
+
useEffect40(() => {
|
|
13180
13201
|
if (!editor || createdFonts.current === fonts) return;
|
|
13181
13202
|
createdFonts.current = fonts;
|
|
13182
13203
|
fontsChurn();
|
|
@@ -13184,13 +13205,13 @@ var PptxEditorRoot = forwardRef(
|
|
|
13184
13205
|
});
|
|
13185
13206
|
}, [editor, fonts, fontsChurn]);
|
|
13186
13207
|
const fontFamilies = props.fontFamilies;
|
|
13187
|
-
|
|
13208
|
+
useEffect40(() => {
|
|
13188
13209
|
if (!editor || createdFamilies.current === fontFamilies) return;
|
|
13189
13210
|
createdFamilies.current = fontFamilies;
|
|
13190
13211
|
editor.setFontFamilies(fontFamilies ?? []);
|
|
13191
13212
|
}, [editor, fontFamilies]);
|
|
13192
|
-
const painted =
|
|
13193
|
-
|
|
13213
|
+
const painted = useRef48(localeKey);
|
|
13214
|
+
useEffect40(() => {
|
|
13194
13215
|
if (!editor || painted.current === localeKey) return;
|
|
13195
13216
|
painted.current = localeKey;
|
|
13196
13217
|
repaintSurfaceOf(editor);
|
|
@@ -13198,12 +13219,12 @@ var PptxEditorRoot = forwardRef(
|
|
|
13198
13219
|
const slideshow = useSlideshowHandle(editor);
|
|
13199
13220
|
const dark = useResolvedDark(props.colorMode);
|
|
13200
13221
|
const [notesOpen, setNotesOpen] = useState51(void 0);
|
|
13201
|
-
const notesRequest =
|
|
13222
|
+
const notesRequest = useRef48(null);
|
|
13202
13223
|
const panes = useMemo19(
|
|
13203
13224
|
() => ({ notesOpen, setNotesOpen, notesRequest }),
|
|
13204
13225
|
[notesOpen]
|
|
13205
13226
|
);
|
|
13206
|
-
return /* @__PURE__ */ jsx60(PptxEditorContext.Provider, { value: editor, children: /* @__PURE__ */ jsx60(TranslationContext.Provider, { value: t, children: /* @__PURE__ */ jsx60(SlideshowContext.Provider, { value: slideshow, children: /* @__PURE__ */ jsx60(ChromeDarkContext.Provider, { value: dark, children: /* @__PURE__ */ jsx60(PaneStateContext.Provider, { value: panes, children: /* @__PURE__ */ jsx60(DialogProvider, { ...props.popups ? { popups: props.popups } : {}, children: /* @__PURE__ */
|
|
13227
|
+
return /* @__PURE__ */ jsx60(PptxEditorContext.Provider, { value: editor, children: /* @__PURE__ */ jsx60(TranslationContext.Provider, { value: t, children: /* @__PURE__ */ jsx60(SlideshowContext.Provider, { value: slideshow, children: /* @__PURE__ */ jsx60(ChromeDarkContext.Provider, { value: dark, children: /* @__PURE__ */ jsx60(PaneStateContext.Provider, { value: panes, children: /* @__PURE__ */ jsx60(DialogProvider, { ...props.popups ? { popups: props.popups } : {}, children: /* @__PURE__ */ jsxs55(ChromeActionHostProvider, { children: [
|
|
13207
13228
|
children,
|
|
13208
13229
|
/* @__PURE__ */ jsx60(SlideSorterWatch, {}),
|
|
13209
13230
|
/* @__PURE__ */ jsx60(ChromeTooltip, {})
|
|
@@ -13231,14 +13252,14 @@ function PptxEditorViewport({ className, label, children }) {
|
|
|
13231
13252
|
}
|
|
13232
13253
|
function PptxEditorContent({ className }) {
|
|
13233
13254
|
const editor = usePptxEditor();
|
|
13234
|
-
const host =
|
|
13255
|
+
const host = useRef48(null);
|
|
13235
13256
|
const menu = useCanvasContextMenu();
|
|
13236
13257
|
useLayoutEffect19(() => {
|
|
13237
13258
|
if (!editor || !host.current) return;
|
|
13238
13259
|
editor.attach(host.current);
|
|
13239
13260
|
return () => editor.detach();
|
|
13240
13261
|
}, [editor]);
|
|
13241
|
-
return /* @__PURE__ */
|
|
13262
|
+
return /* @__PURE__ */ jsxs55(Fragment40, { children: [
|
|
13242
13263
|
/* @__PURE__ */ jsx60(
|
|
13243
13264
|
"div",
|
|
13244
13265
|
{
|
|
@@ -13257,7 +13278,7 @@ function PptxEditorContent({ className }) {
|
|
|
13257
13278
|
// src/toolbar-action.tsx
|
|
13258
13279
|
import { Children as Children8, Fragment as Fragment41, isValidElement as isValidElement8 } from "react";
|
|
13259
13280
|
import { tooltipAttributes as tooltipAttributes7, warnAsChildChild as warnAsChildChild3 } from "@pptx-editor.dev/core/editor";
|
|
13260
|
-
import { Fragment as Fragment42, jsx as jsx61, jsxs as
|
|
13281
|
+
import { Fragment as Fragment42, jsx as jsx61, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
13261
13282
|
function ToolbarAction(props) {
|
|
13262
13283
|
const { label, icon, active, disabled, disabledReason, onSelect, asChild, className, children } = props;
|
|
13263
13284
|
const off = useAriaDisabled(!!disabled, disabledReason);
|
|
@@ -13278,7 +13299,7 @@ function ToolbarAction(props) {
|
|
|
13278
13299
|
const select = disabled ? void 0 : () => onSelect?.();
|
|
13279
13300
|
if (child) {
|
|
13280
13301
|
const isButton = child.type === "button";
|
|
13281
|
-
return /* @__PURE__ */
|
|
13302
|
+
return /* @__PURE__ */ jsxs56(Fragment42, { children: [
|
|
13282
13303
|
renderAsChild(child, {
|
|
13283
13304
|
...shared,
|
|
13284
13305
|
...isButton ? { type: "button" } : buttonRoleProps(select),
|
|
@@ -13302,7 +13323,7 @@ function ToolbarAction(props) {
|
|
|
13302
13323
|
children: content ?? label
|
|
13303
13324
|
}
|
|
13304
13325
|
);
|
|
13305
|
-
return off.note ? /* @__PURE__ */
|
|
13326
|
+
return off.note ? /* @__PURE__ */ jsxs56(Fragment42, { children: [
|
|
13306
13327
|
button,
|
|
13307
13328
|
off.note
|
|
13308
13329
|
] }) : button;
|
|
@@ -13339,14 +13360,14 @@ var TOOLBAR_PARTS = Object.fromEntries(
|
|
|
13339
13360
|
);
|
|
13340
13361
|
|
|
13341
13362
|
// src/FontNotice.tsx
|
|
13342
|
-
import { useEffect as
|
|
13363
|
+
import { useEffect as useEffect41, useRef as useRef49, useState as useState52 } from "react";
|
|
13343
13364
|
import {
|
|
13344
13365
|
applyLocalFonts,
|
|
13345
13366
|
canQueryLocalFonts,
|
|
13346
13367
|
fontNoticeFamilies,
|
|
13347
13368
|
fontNoticeList
|
|
13348
13369
|
} from "@pptx-editor.dev/core/editor";
|
|
13349
|
-
import { jsx as jsx63, jsxs as
|
|
13370
|
+
import { jsx as jsx63, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
13350
13371
|
var FontNotice = withChromeTranslate(FontNoticeRoot, "FontNotice");
|
|
13351
13372
|
function FontNoticeRoot({ className }) {
|
|
13352
13373
|
const editor = usePptxEditor();
|
|
@@ -13358,8 +13379,8 @@ function FontNoticeRoot({ className }) {
|
|
|
13358
13379
|
const [dismissed, setDismissed] = useState52(null);
|
|
13359
13380
|
const [outcome, setOutcome] = useState52(null);
|
|
13360
13381
|
const [busy, setBusy] = useState52(false);
|
|
13361
|
-
const round =
|
|
13362
|
-
|
|
13382
|
+
const round = useRef49(0);
|
|
13383
|
+
useEffect41(() => {
|
|
13363
13384
|
round.current += 1;
|
|
13364
13385
|
setOutcome(null);
|
|
13365
13386
|
}, [loadState]);
|
|
@@ -13378,14 +13399,14 @@ function FontNoticeRoot({ className }) {
|
|
|
13378
13399
|
setBusy(false);
|
|
13379
13400
|
}
|
|
13380
13401
|
};
|
|
13381
|
-
return /* @__PURE__ */
|
|
13402
|
+
return /* @__PURE__ */ jsxs57(
|
|
13382
13403
|
"div",
|
|
13383
13404
|
{
|
|
13384
13405
|
className: `pptx-font-notice${className ? ` ${className}` : ""}`,
|
|
13385
13406
|
role: "status",
|
|
13386
13407
|
onMouseDown: keepFocus,
|
|
13387
13408
|
children: [
|
|
13388
|
-
/* @__PURE__ */
|
|
13409
|
+
/* @__PURE__ */ jsxs57("span", { className: "pptx-font-notice__text", children: [
|
|
13389
13410
|
missing.length ? t("fonts.notice", { families: fontNoticeList(missing, t) }) : status,
|
|
13390
13411
|
missing.length && status ? ` ${status}` : ""
|
|
13391
13412
|
] }),
|
|
@@ -13407,10 +13428,10 @@ function FontNoticeRoot({ className }) {
|
|
|
13407
13428
|
|
|
13408
13429
|
// src/OpenFailure.tsx
|
|
13409
13430
|
import {
|
|
13410
|
-
useCallback as
|
|
13411
|
-
useEffect as
|
|
13431
|
+
useCallback as useCallback15,
|
|
13432
|
+
useEffect as useEffect42,
|
|
13412
13433
|
useId as useId22,
|
|
13413
|
-
useRef as
|
|
13434
|
+
useRef as useRef50,
|
|
13414
13435
|
useState as useState53
|
|
13415
13436
|
} from "react";
|
|
13416
13437
|
import {
|
|
@@ -13420,7 +13441,7 @@ import {
|
|
|
13420
13441
|
openFailureKey,
|
|
13421
13442
|
shownOpenFailure
|
|
13422
13443
|
} from "@pptx-editor.dev/core/editor";
|
|
13423
|
-
import { jsx as jsx64, jsxs as
|
|
13444
|
+
import { jsx as jsx64, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
13424
13445
|
function useOpenFailure(options = {}) {
|
|
13425
13446
|
const current = useEditorState(shownOpenFailure);
|
|
13426
13447
|
const kept = useEditorState((s) => s.status === "ready");
|
|
@@ -13428,7 +13449,7 @@ function useOpenFailure(options = {}) {
|
|
|
13428
13449
|
const t = options.t ?? ambient;
|
|
13429
13450
|
const [dismissed, setDismissed] = useState53(null);
|
|
13430
13451
|
const failure = current !== null && current !== dismissed ? current : null;
|
|
13431
|
-
const dismiss =
|
|
13452
|
+
const dismiss = useCallback15(
|
|
13432
13453
|
(shown) => {
|
|
13433
13454
|
if (!shown || shown === current) setDismissed(current);
|
|
13434
13455
|
},
|
|
@@ -13458,10 +13479,10 @@ function OpenFailureRoot({
|
|
|
13458
13479
|
const { failure, message: packaged, kept, dismiss } = useOpenFailure();
|
|
13459
13480
|
const titleId = useId22();
|
|
13460
13481
|
const [copy, setCopy] = useState53(null);
|
|
13461
|
-
const reportRef =
|
|
13462
|
-
const rootRef =
|
|
13482
|
+
const reportRef = useRef50(null);
|
|
13483
|
+
const rootRef = useRef50(null);
|
|
13463
13484
|
const editor = usePptxEditor();
|
|
13464
|
-
|
|
13485
|
+
useEffect42(() => {
|
|
13465
13486
|
if (copy && !copy.copied) reportRef.current?.focus();
|
|
13466
13487
|
}, [copy]);
|
|
13467
13488
|
if (!failure || packaged === null) return null;
|
|
@@ -13479,7 +13500,7 @@ function OpenFailureRoot({
|
|
|
13479
13500
|
};
|
|
13480
13501
|
const context = { failure, message: packaged, dismiss: close };
|
|
13481
13502
|
const body = typeof message === "function" ? message(failure) : message ?? packaged;
|
|
13482
|
-
return /* @__PURE__ */
|
|
13503
|
+
return /* @__PURE__ */ jsxs58(
|
|
13483
13504
|
"div",
|
|
13484
13505
|
{
|
|
13485
13506
|
ref: rootRef,
|
|
@@ -13489,7 +13510,7 @@ function OpenFailureRoot({
|
|
|
13489
13510
|
"aria-labelledby": titleId,
|
|
13490
13511
|
"data-reason": failure.reason,
|
|
13491
13512
|
children: [
|
|
13492
|
-
/* @__PURE__ */
|
|
13513
|
+
/* @__PURE__ */ jsxs58("div", { className: "pptx-open-failure__text", role: "alert", children: [
|
|
13493
13514
|
/* @__PURE__ */ jsx64("p", { id: titleId, className: "pptx-open-failure__title", children: title ?? t("openFailure.title") }),
|
|
13494
13515
|
/* @__PURE__ */ jsx64("div", { className: "pptx-open-failure__message", children: body }),
|
|
13495
13516
|
kept ? /* @__PURE__ */ jsx64("p", { className: "pptx-open-failure__kept", children: t("openFailure.kept") }) : null,
|
|
@@ -13508,7 +13529,7 @@ function OpenFailureRoot({
|
|
|
13508
13529
|
onFocus: (e) => e.currentTarget.select()
|
|
13509
13530
|
}
|
|
13510
13531
|
) : null,
|
|
13511
|
-
/* @__PURE__ */
|
|
13532
|
+
/* @__PURE__ */ jsxs58("div", { className: "pptx-open-failure__actions", children: [
|
|
13512
13533
|
actions?.(context),
|
|
13513
13534
|
showCopy ? /* @__PURE__ */ jsx64(
|
|
13514
13535
|
"button",
|
|
@@ -13529,7 +13550,7 @@ function OpenFailureRoot({
|
|
|
13529
13550
|
|
|
13530
13551
|
// src/Loading.tsx
|
|
13531
13552
|
import { loadingSheetSize, sameLoadingSheetSize, showsLoading } from "@pptx-editor.dev/core/editor";
|
|
13532
|
-
import { Fragment as Fragment43, jsx as jsx65, jsxs as
|
|
13553
|
+
import { Fragment as Fragment43, jsx as jsx65, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
13533
13554
|
function LoadingSpinner({ className }) {
|
|
13534
13555
|
return /* @__PURE__ */ jsx65(
|
|
13535
13556
|
"span",
|
|
@@ -13567,7 +13588,7 @@ function LoadingImpl({
|
|
|
13567
13588
|
{
|
|
13568
13589
|
className: "pptx-loading__sheet",
|
|
13569
13590
|
style: { width: sheet.width, aspectRatio: `${sheet.width} / ${sheet.height}` },
|
|
13570
|
-
children: indicator ?? /* @__PURE__ */
|
|
13591
|
+
children: indicator ?? /* @__PURE__ */ jsxs59(Fragment43, { children: [
|
|
13571
13592
|
/* @__PURE__ */ jsx65(LoadingSpinner, {}),
|
|
13572
13593
|
/* @__PURE__ */ jsx65("span", { className: "pptx-sr-only", children: t("app.loading") })
|
|
13573
13594
|
] })
|
|
@@ -13590,9 +13611,9 @@ import {
|
|
|
13590
13611
|
Children as Children9,
|
|
13591
13612
|
Fragment as Fragment44,
|
|
13592
13613
|
isValidElement as isValidElement9,
|
|
13593
|
-
useEffect as
|
|
13614
|
+
useEffect as useEffect43,
|
|
13594
13615
|
useId as useId23,
|
|
13595
|
-
useRef as
|
|
13616
|
+
useRef as useRef51,
|
|
13596
13617
|
useState as useState54
|
|
13597
13618
|
} from "react";
|
|
13598
13619
|
import {
|
|
@@ -13603,7 +13624,7 @@ import {
|
|
|
13603
13624
|
translateKeyOrText as translateKeyOrText22,
|
|
13604
13625
|
warnRibbonChild
|
|
13605
13626
|
} from "@pptx-editor.dev/core/editor";
|
|
13606
|
-
import { jsx as jsx66, jsxs as
|
|
13627
|
+
import { jsx as jsx66, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
13607
13628
|
function RibbonTab(_props) {
|
|
13608
13629
|
return null;
|
|
13609
13630
|
}
|
|
@@ -13628,9 +13649,9 @@ function Ribbon({
|
|
|
13628
13649
|
const baseId = useId23();
|
|
13629
13650
|
const layout = useEditorState(selectTabs, sameLayout);
|
|
13630
13651
|
const [own, setOwn] = useState54(defaultTab);
|
|
13631
|
-
const names =
|
|
13632
|
-
const root =
|
|
13633
|
-
const focusInside =
|
|
13652
|
+
const names = useRef51(/* @__PURE__ */ new Map());
|
|
13653
|
+
const root = useRef51(null);
|
|
13654
|
+
const focusInside = useRef51(false);
|
|
13634
13655
|
const specs = /* @__PURE__ */ new Map();
|
|
13635
13656
|
for (const child of flatten5(children)) {
|
|
13636
13657
|
if (isValidElement9(child) && child.type === RibbonTab) {
|
|
@@ -13649,7 +13670,7 @@ function Ribbon({
|
|
|
13649
13670
|
const wanted = tab ?? own;
|
|
13650
13671
|
const { shown: current, fellBack } = ribbonShownTab(tabs, wanted);
|
|
13651
13672
|
const shownId = current?.id;
|
|
13652
|
-
|
|
13673
|
+
useEffect43(() => {
|
|
13653
13674
|
if (!fellBack || shownId === void 0) return;
|
|
13654
13675
|
if (tab === void 0) setOwn(shownId);
|
|
13655
13676
|
onTabChange?.(shownId);
|
|
@@ -13662,9 +13683,9 @@ function Ribbon({
|
|
|
13662
13683
|
onTabChange?.(id);
|
|
13663
13684
|
};
|
|
13664
13685
|
const insertions = useEditorState((s) => s.insertions);
|
|
13665
|
-
const seen =
|
|
13686
|
+
const seen = useRef51(insertions);
|
|
13666
13687
|
const insertTab = ribbonInsertTab(tabs);
|
|
13667
|
-
|
|
13688
|
+
useEffect43(() => {
|
|
13668
13689
|
if (insertions === seen.current) return;
|
|
13669
13690
|
seen.current = insertions;
|
|
13670
13691
|
if (insertTab !== null && insertTab !== wanted) select(insertTab);
|
|
@@ -13679,7 +13700,7 @@ function Ribbon({
|
|
|
13679
13700
|
};
|
|
13680
13701
|
const tabId2 = (id) => `${baseId}-tab-${id}`;
|
|
13681
13702
|
const panelId2 = `${baseId}-panel`;
|
|
13682
|
-
return /* @__PURE__ */
|
|
13703
|
+
return /* @__PURE__ */ jsxs60(
|
|
13683
13704
|
"div",
|
|
13684
13705
|
{
|
|
13685
13706
|
ref: root,
|
|
@@ -13692,7 +13713,7 @@ function Ribbon({
|
|
|
13692
13713
|
if (next && !e.currentTarget.contains(next)) focusInside.current = false;
|
|
13693
13714
|
},
|
|
13694
13715
|
children: [
|
|
13695
|
-
/* @__PURE__ */
|
|
13716
|
+
/* @__PURE__ */ jsxs60("div", { className: "pptx-ribbon__bar", children: [
|
|
13696
13717
|
quickAccess ? /* @__PURE__ */ jsx66("div", { className: "pptx-ribbon__qat", children: /* @__PURE__ */ jsx66(PresetBar, { groups: quickAccess.groups, label: quickAccess.title, overflow: false, children: quickAccess.override?.children }) }) : null,
|
|
13697
13718
|
/* @__PURE__ */ jsx66(
|
|
13698
13719
|
"div",
|
|
@@ -13757,7 +13778,7 @@ function Ribbon({
|
|
|
13757
13778
|
// src/StatusBar.tsx
|
|
13758
13779
|
import { Children as Children10, Fragment as Fragment45, isValidElement as isValidElement10 } from "react";
|
|
13759
13780
|
import { slideStatus, warnAsChildChild as warnAsChildChild4 } from "@pptx-editor.dev/core/editor";
|
|
13760
|
-
import { Fragment as Fragment46, jsx as jsx67, jsxs as
|
|
13781
|
+
import { Fragment as Fragment46, jsx as jsx67, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
13761
13782
|
function StatusBarSlideNumber({ className, hidden }) {
|
|
13762
13783
|
const { t } = useTranslation();
|
|
13763
13784
|
const status = useEditorState(
|
|
@@ -13842,7 +13863,7 @@ function StatusBar({ className, preset = true, children }) {
|
|
|
13842
13863
|
);
|
|
13843
13864
|
if (!preset)
|
|
13844
13865
|
return bar(
|
|
13845
|
-
/* @__PURE__ */
|
|
13866
|
+
/* @__PURE__ */ jsxs61(Fragment46, { children: [
|
|
13846
13867
|
children,
|
|
13847
13868
|
/* @__PURE__ */ jsx67(ReadOnlyBadge, {})
|
|
13848
13869
|
] })
|
|
@@ -13856,7 +13877,7 @@ function StatusBar({ className, preset = true, children }) {
|
|
|
13856
13877
|
}
|
|
13857
13878
|
const part = (Part) => overrides.get(Part) ?? /* @__PURE__ */ jsx67(Part, {});
|
|
13858
13879
|
return bar(
|
|
13859
|
-
/* @__PURE__ */
|
|
13880
|
+
/* @__PURE__ */ jsxs61(Fragment46, { children: [
|
|
13860
13881
|
part(StatusBarSlideNumber),
|
|
13861
13882
|
/* @__PURE__ */ jsx67(ReadOnlyBadge, {}),
|
|
13862
13883
|
/* @__PURE__ */ jsx67("span", { className: "pptx-statusbar__spacer" }),
|
|
@@ -13869,7 +13890,7 @@ function StatusBar({ className, preset = true, children }) {
|
|
|
13869
13890
|
}
|
|
13870
13891
|
|
|
13871
13892
|
// src/HyperlinkPopup.tsx
|
|
13872
|
-
import { useContext as useContext20, useEffect as
|
|
13893
|
+
import { useContext as useContext20, useEffect as useEffect44, useId as useId24, useMemo as useMemo20, useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
13873
13894
|
import { hyperlinkPopupFromRequest } from "@pptx-editor.dev/core/editor";
|
|
13874
13895
|
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
13875
13896
|
function HyperlinkPopup(props) {
|
|
@@ -13886,7 +13907,7 @@ function OwnState({ children, ...props }) {
|
|
|
13886
13907
|
[editor, anchor]
|
|
13887
13908
|
// eslint-disable-line react-hooks/exhaustive-deps
|
|
13888
13909
|
);
|
|
13889
|
-
|
|
13910
|
+
useEffect44(() => () => controller.dispose(), [controller]);
|
|
13890
13911
|
const state = useSyncExternalStore12(
|
|
13891
13912
|
controller.subscribe,
|
|
13892
13913
|
controller.getState,
|
|
@@ -13896,7 +13917,7 @@ function OwnState({ children, ...props }) {
|
|
|
13896
13917
|
}
|
|
13897
13918
|
|
|
13898
13919
|
// src/customization-hooks.ts
|
|
13899
|
-
import { useCallback as
|
|
13920
|
+
import { useCallback as useCallback16, useContext as useContext21, useEffect as useEffect45, useMemo as useMemo21, useRef as useRef52, useState as useState55 } from "react";
|
|
13900
13921
|
import {
|
|
13901
13922
|
ZOOM_LEVELS,
|
|
13902
13923
|
onEditorEvent,
|
|
@@ -13908,7 +13929,7 @@ var sameZoom = (a, b) => a.zoom === b.zoom && a.fit === b.fit;
|
|
|
13908
13929
|
function useZoom() {
|
|
13909
13930
|
const editor = usePptxEditor();
|
|
13910
13931
|
const { zoom, fit } = useEditorState(selectZoom, sameZoom);
|
|
13911
|
-
const setZoom =
|
|
13932
|
+
const setZoom = useCallback16((next) => editor?.setZoom(next), [editor]);
|
|
13912
13933
|
return useMemo21(() => {
|
|
13913
13934
|
const next = zoomStep2(zoom, 1);
|
|
13914
13935
|
const previous = zoomStep2(zoom, -1);
|
|
@@ -13928,9 +13949,9 @@ function useZoom() {
|
|
|
13928
13949
|
}
|
|
13929
13950
|
function useEditorEvent(event, handler) {
|
|
13930
13951
|
const editor = usePptxEditor();
|
|
13931
|
-
const handlerRef =
|
|
13952
|
+
const handlerRef = useRef52(handler);
|
|
13932
13953
|
handlerRef.current = handler;
|
|
13933
|
-
|
|
13954
|
+
useEffect45(() => {
|
|
13934
13955
|
if (!editor) return void 0;
|
|
13935
13956
|
const forward = ((...args) => handlerRef.current(...args));
|
|
13936
13957
|
return onEditorEvent(editor, event, forward);
|
|
@@ -13938,7 +13959,7 @@ function useEditorEvent(event, handler) {
|
|
|
13938
13959
|
}
|
|
13939
13960
|
function useEditorSnapshot(editor) {
|
|
13940
13961
|
const [revision, setRevision] = useState55(0);
|
|
13941
|
-
|
|
13962
|
+
useEffect45(() => {
|
|
13942
13963
|
if (!editor) return void 0;
|
|
13943
13964
|
const bump = () => setRevision((n) => n + 1);
|
|
13944
13965
|
const off = editor.subscribe(bump);
|
|
@@ -13955,7 +13976,7 @@ function useScopeClassName() {
|
|
|
13955
13976
|
}
|
|
13956
13977
|
|
|
13957
13978
|
// src/usePptxSource.ts
|
|
13958
|
-
import { useCallback as
|
|
13979
|
+
import { useCallback as useCallback17, useEffect as useEffect46, useMemo as useMemo22, useRef as useRef53, useState as useState56, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
13959
13980
|
import {
|
|
13960
13981
|
editorHostDocument,
|
|
13961
13982
|
fetchPptxSource,
|
|
@@ -13973,13 +13994,13 @@ function usePptxSource(source, options = {}) {
|
|
|
13973
13994
|
const [documentLoading, setDocumentLoading] = useState56(source != null);
|
|
13974
13995
|
const shape = pptxFontsShape(options.fonts);
|
|
13975
13996
|
const [fontsSettled, setFontsSettled] = useState56(options.fonts === void 0);
|
|
13976
|
-
const latest =
|
|
13997
|
+
const latest = useRef53(options);
|
|
13977
13998
|
latest.current = options;
|
|
13978
13999
|
const resolver = useMemo22(
|
|
13979
14000
|
() => pptxSourceFontsResolver(() => latest.current.fonts),
|
|
13980
14001
|
[]
|
|
13981
14002
|
);
|
|
13982
|
-
|
|
14003
|
+
useEffect46(() => {
|
|
13983
14004
|
const fontsSource = latest.current.fonts;
|
|
13984
14005
|
if (fontsSource === void 0) {
|
|
13985
14006
|
setFonts(void 0);
|
|
@@ -13996,7 +14017,7 @@ function usePptxSource(source, options = {}) {
|
|
|
13996
14017
|
release: () => setFontsSettled(true)
|
|
13997
14018
|
});
|
|
13998
14019
|
}, [shape]);
|
|
13999
|
-
|
|
14020
|
+
useEffect46(() => {
|
|
14000
14021
|
if (source == null) {
|
|
14001
14022
|
setBytes(void 0);
|
|
14002
14023
|
setError(null);
|
|
@@ -14043,11 +14064,11 @@ var NOOP_UNSUBSCRIBE = () => {
|
|
|
14043
14064
|
};
|
|
14044
14065
|
function useEditorHostDocument() {
|
|
14045
14066
|
const editor = usePptxEditor();
|
|
14046
|
-
const subscribe =
|
|
14067
|
+
const subscribe = useCallback17(
|
|
14047
14068
|
(onChange) => editor ? onEditorHostChange(editor, onChange) : NOOP_UNSUBSCRIBE,
|
|
14048
14069
|
[editor]
|
|
14049
14070
|
);
|
|
14050
|
-
const read =
|
|
14071
|
+
const read = useCallback17(
|
|
14051
14072
|
() => editor ? editorHostDocument(editor) : typeof globalThis.document === "undefined" ? null : globalThis.document,
|
|
14052
14073
|
[editor]
|
|
14053
14074
|
);
|
|
@@ -14058,7 +14079,7 @@ function useEditorHostDocument() {
|
|
|
14058
14079
|
import { gradientCss as gradientCss3 } from "@pptx-editor.dev/core/editor";
|
|
14059
14080
|
|
|
14060
14081
|
// src/useParagraphFormat.ts
|
|
14061
|
-
import { useCallback as
|
|
14082
|
+
import { useCallback as useCallback18 } from "react";
|
|
14062
14083
|
import {
|
|
14063
14084
|
chromeCommandState,
|
|
14064
14085
|
sameParagraphFormat
|
|
@@ -14067,7 +14088,7 @@ function useParagraphFormat() {
|
|
|
14067
14088
|
const editor = usePptxEditor();
|
|
14068
14089
|
const format = useEditorState((s) => s.format?.paragraph ?? null, sameParagraphFormat);
|
|
14069
14090
|
const isEnabled = useEditorState(() => chromeCommandState(editor, "paragraph.dialog").isEnabled);
|
|
14070
|
-
const apply =
|
|
14091
|
+
const apply = useCallback18(
|
|
14071
14092
|
(update) => editor !== null && editor.exec({ ...update, type: "setParagraphFormat" }).ok,
|
|
14072
14093
|
[editor]
|
|
14073
14094
|
);
|
|
@@ -14075,7 +14096,7 @@ function useParagraphFormat() {
|
|
|
14075
14096
|
}
|
|
14076
14097
|
|
|
14077
14098
|
// src/useFontFormat.ts
|
|
14078
|
-
import { useCallback as
|
|
14099
|
+
import { useCallback as useCallback19 } from "react";
|
|
14079
14100
|
import {
|
|
14080
14101
|
chromeCommandState as chromeCommandState2,
|
|
14081
14102
|
sameFontFormat
|
|
@@ -14084,7 +14105,7 @@ function useFontFormat() {
|
|
|
14084
14105
|
const editor = usePptxEditor();
|
|
14085
14106
|
const format = useEditorState((s) => s.format?.font ?? null, sameFontFormat);
|
|
14086
14107
|
const isEnabled = useEditorState(() => chromeCommandState2(editor, "text.dialog").isEnabled);
|
|
14087
|
-
const apply =
|
|
14108
|
+
const apply = useCallback19(
|
|
14088
14109
|
(update) => editor !== null && editor.exec({ ...update, type: "setFontFormat" }).ok,
|
|
14089
14110
|
[editor]
|
|
14090
14111
|
);
|
|
@@ -14092,7 +14113,7 @@ function useFontFormat() {
|
|
|
14092
14113
|
}
|
|
14093
14114
|
|
|
14094
14115
|
// src/useBulletFormat.ts
|
|
14095
|
-
import { useCallback as
|
|
14116
|
+
import { useCallback as useCallback20 } from "react";
|
|
14096
14117
|
import {
|
|
14097
14118
|
sameBulletFormat
|
|
14098
14119
|
} from "@pptx-editor.dev/core/editor";
|
|
@@ -14100,7 +14121,7 @@ function useBulletFormat() {
|
|
|
14100
14121
|
const editor = usePptxEditor();
|
|
14101
14122
|
const format = useEditorState((s) => s.format?.bulletFormat, sameBulletFormat);
|
|
14102
14123
|
const { isEnabled } = useEditorCommand("list.bulletStyle");
|
|
14103
|
-
const apply =
|
|
14124
|
+
const apply = useCallback20(
|
|
14104
14125
|
(next) => editor !== null && editor.exec({ type: "setBulletFormat", format: next }).ok,
|
|
14105
14126
|
[editor]
|
|
14106
14127
|
);
|
|
@@ -14108,21 +14129,21 @@ function useBulletFormat() {
|
|
|
14108
14129
|
}
|
|
14109
14130
|
|
|
14110
14131
|
// src/useReviewAuthors.ts
|
|
14111
|
-
import { useCallback as
|
|
14132
|
+
import { useCallback as useCallback21 } from "react";
|
|
14112
14133
|
var NONE = Object.freeze([]);
|
|
14113
14134
|
function useReviewAuthors() {
|
|
14114
14135
|
const editor = usePptxEditor();
|
|
14115
|
-
return useEditorState(
|
|
14136
|
+
return useEditorState(useCallback21(() => editor?.getReviewAuthors() ?? NONE, [editor]));
|
|
14116
14137
|
}
|
|
14117
14138
|
|
|
14118
14139
|
// src/useFonts.ts
|
|
14119
|
-
import { useMemo as useMemo23, useRef as
|
|
14140
|
+
import { useMemo as useMemo23, useRef as useRef54 } from "react";
|
|
14120
14141
|
import {
|
|
14121
14142
|
composeFontOrigins,
|
|
14122
14143
|
defineFontResolver
|
|
14123
14144
|
} from "@pptx-editor.dev/core/editor";
|
|
14124
14145
|
function useFonts(...origins) {
|
|
14125
|
-
const latest =
|
|
14146
|
+
const latest = useRef54(origins);
|
|
14126
14147
|
latest.current = origins;
|
|
14127
14148
|
return useMemo23(
|
|
14128
14149
|
() => defineFontResolver(
|
|
@@ -14138,7 +14159,7 @@ function useFonts(...origins) {
|
|
|
14138
14159
|
}
|
|
14139
14160
|
|
|
14140
14161
|
// src/useFontFamily.ts
|
|
14141
|
-
import { useCallback as
|
|
14162
|
+
import { useCallback as useCallback22, useMemo as useMemo24 } from "react";
|
|
14142
14163
|
import {
|
|
14143
14164
|
fontPickerGroups as fontPickerGroups2,
|
|
14144
14165
|
isCurrentFontRow as isCurrentFontRow2
|
|
@@ -14161,8 +14182,8 @@ function useFontFamily() {
|
|
|
14161
14182
|
[editor, slide, revision]
|
|
14162
14183
|
);
|
|
14163
14184
|
const { execute } = cmd;
|
|
14164
|
-
const setValue =
|
|
14165
|
-
const isCurrent =
|
|
14185
|
+
const setValue = useCallback22((family) => void execute(family), [execute]);
|
|
14186
|
+
const isCurrent = useCallback22(
|
|
14166
14187
|
(row) => !row.disabled && isCurrentFontRow2(row, value, theme),
|
|
14167
14188
|
[value, theme]
|
|
14168
14189
|
);
|