@pptx-editor.dev/vue 0.6.0 → 0.7.0-canary.20261120032841.sha-d450255

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 CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  getCurrentInstance as getCurrentInstance3,
5
5
  h as h22,
6
6
  mergeProps as mergeProps2,
7
- shallowRef as shallowRef38
7
+ shallowRef as shallowRef39
8
8
  } from "vue";
9
9
  import {
10
10
  createEditorRefApi as createEditorRefApi2,
@@ -20,8 +20,8 @@ import {
20
20
  onMounted as onMounted22,
21
21
  onUnmounted as onUnmounted6,
22
22
  provide as provide18,
23
- shallowRef as shallowRef32,
24
- watch as watch39
23
+ shallowRef as shallowRef33,
24
+ watch as watch38
25
25
  } from "vue";
26
26
  import {
27
27
  churnWarning,
@@ -30,7 +30,7 @@ import {
30
30
  localeContentKey,
31
31
  repaintSurfaceOf,
32
32
  reportFontError,
33
- translateKeyOrText as translateKeyOrText21,
33
+ translateKeyOrText as translateKeyOrText20,
34
34
  warnModulesChanged
35
35
  } from "@pptx-editor.dev/core/editor";
36
36
  import { createTranslator as createTranslator2 } from "@pptx-editor.dev/i18n";
@@ -67,7 +67,8 @@ import {
67
67
  warnOutsideRoot,
68
68
  paneListenersVersion,
69
69
  subscribePaneListeners,
70
- isPaneSlot
70
+ isPaneSlot,
71
+ translateKeyOrText
71
72
  } from "@pptx-editor.dev/core/editor";
72
73
 
73
74
  // src/notes-target.ts
@@ -197,6 +198,7 @@ var chromeActionHostKey = /* @__PURE__ */ Symbol("pptxChromeActionHost");
197
198
  function useEditorCommand(slot) {
198
199
  const editorRef = usePptxEditor();
199
200
  const host = inject(chromeActionHostKey, null);
201
+ const { t } = useTranslation();
200
202
  const read = () => editorCommandFor(editorRef.value, toValue2(slot), host, "disabled.noRoot").state;
201
203
  const panes = useExternalVersion(subscribePaneListeners, paneListenersVersion);
202
204
  const state = useSlice(read, sameChromeCommandState, () => [
@@ -227,11 +229,12 @@ function useEditorCommand(slot) {
227
229
  const n = notesFormat.value;
228
230
  return n ? n.target.formats[n.format] : state.value.isActive;
229
231
  }),
232
+ // Readable text in the root locale, as React's: a catalog key is translated, and the
233
+ // engine's own text shows as itself. The translator follows the root's `locale` prop.
230
234
  disabledReason: computed(() => {
231
235
  const n = notesFormat.value;
232
- if (!n) return state.value.disabledReason;
233
- if (n.target.readOnly) return "disabled.viewing";
234
- return n.target.canFormat ? null : "disabled.selectNotesText";
236
+ const reason = !n ? state.value.disabledReason : n.target.readOnly ? "disabled.viewing" : n.target.canFormat ? null : "disabled.selectNotesText";
237
+ return reason ? translateKeyOrText(t, reason) : null;
235
238
  }),
236
239
  value: computed(() => state.value.value)
237
240
  };
@@ -1788,7 +1791,7 @@ import {
1788
1791
  altTextDraftFrom,
1789
1792
  commitDialogCommand as commitDialogCommand2,
1790
1793
  translateDialogErrors as translateDialogErrors3,
1791
- translateKeyOrText,
1794
+ translateKeyOrText as translateKeyOrText2,
1792
1795
  validateAltTextDraft
1793
1796
  } from "@pptx-editor.dev/core/editor";
1794
1797
  var parts2 = createDialogParts(
@@ -1853,8 +1856,8 @@ var ImageAltTextDialogOpen = defineComponent5({
1853
1856
  field: t(
1854
1857
  bad === "description" ? "imageAltText.description" : "imageAltText.titleLabel"
1855
1858
  ),
1856
- message: translateKeyOrText(t, errors[bad])
1857
- }) : errors.form ? translateKeyOrText(t, errors.form) : "";
1859
+ message: translateKeyOrText2(t, errors[bad])
1860
+ }) : errors.form ? translateKeyOrText2(t, errors.form) : "";
1858
1861
  const field = (name, extra, children) => h3(
1859
1862
  "section",
1860
1863
  {
@@ -2034,7 +2037,7 @@ import {
2034
2037
  picturePropertiesDraftFrom,
2035
2038
  picturePropertiesWithValue,
2036
2039
  translateDialogErrors as translateDialogErrors4,
2037
- translateKeyOrText as translateKeyOrText2,
2040
+ translateKeyOrText as translateKeyOrText3,
2038
2041
  validatePicturePropertiesDraft
2039
2042
  } from "@pptx-editor.dev/core/editor";
2040
2043
  var NUMBER_FIELDS = [
@@ -2141,8 +2144,8 @@ var ImagePropertiesDialogOpen = defineComponent6({
2141
2144
  const bad = NUMBER_FIELDS.find((f) => errors[f]);
2142
2145
  const error = bad ? t("imageProperties.fieldError", {
2143
2146
  field: t(FIELD_LABELS[bad]),
2144
- message: translateKeyOrText2(t, errors[bad])
2145
- }) : errors.form ? translateKeyOrText2(t, errors.form) : "";
2147
+ message: translateKeyOrText3(t, errors[bad])
2148
+ }) : errors.form ? translateKeyOrText3(t, errors.form) : "";
2146
2149
  const cropLocked = picture.value?.canCrop === false;
2147
2150
  const sizeLocked = picture.value?.canResize === false;
2148
2151
  const rotationLocked = picture.value?.canRotate === false;
@@ -2323,7 +2326,7 @@ import {
2323
2326
  equationDraftCommand,
2324
2327
  equationDraftFrom,
2325
2328
  translateDialogErrors as translateDialogErrors5,
2326
- translateKeyOrText as translateKeyOrText3,
2329
+ translateKeyOrText as translateKeyOrText4,
2327
2330
  validateEquationDraft
2328
2331
  } from "@pptx-editor.dev/core/editor";
2329
2332
  var parts4 = createDialogParts("EquationDialog");
@@ -2372,7 +2375,7 @@ var EquationDialogOpen = defineComponent7({
2372
2375
  return () => {
2373
2376
  const { linear } = draft.values.value;
2374
2377
  const errors = draft.errors.value;
2375
- const error = errors.linear ? translateKeyOrText3(t, errors.linear) : errors.form ? translateKeyOrText3(t, errors.form) : "";
2378
+ const error = errors.linear ? translateKeyOrText4(t, errors.linear) : errors.form ? translateKeyOrText4(t, errors.form) : "";
2376
2379
  const title = t(edits ? "equation.editTitle" : "equation.insertTitle");
2377
2380
  const defaults = h5(Fragment6, [
2378
2381
  h5("div", { "data-pptx-part": "header", class: "pptx-dialog__header" }, [
@@ -2972,16 +2975,13 @@ import {
2972
2975
  // src/slot.ts
2973
2976
  import { computed as computed10, toValue as toValue5 } from "vue";
2974
2977
  import {
2975
- tooltipAttributes as tooltipAttributes2,
2976
- translateKeyOrText as translateKeyOrText4
2978
+ tooltipAttributes as tooltipAttributes2
2977
2979
  } from "@pptx-editor.dev/core/editor";
2978
2980
  function useSlot(slot, control) {
2979
2981
  const cmd = useEditorCommand(slot);
2980
2982
  const { t } = useTranslation();
2981
2983
  const label = computed10(() => t(toValue5(control).labelKey));
2982
- const reason = computed10(
2983
- () => cmd.disabledReason.value ? translateKeyOrText4(t, cmd.disabledReason.value) : null
2984
- );
2984
+ const reason = cmd.disabledReason;
2985
2985
  const tip = computed10(() => tooltipAttributes2(label.value, !cmd.isEnabled.value, reason.value));
2986
2986
  return { cmd, label, reason, tip };
2987
2987
  }
@@ -7321,8 +7321,8 @@ var layoutGalleryProps = {
7321
7321
  /** Show the tiles but take no pick. Default: true while the deck is open for viewing. */
7322
7322
  disabled: { type: Boolean, default: void 0 },
7323
7323
  /**
7324
- * Why the gallery takes no pick, for the tiles' tooltips: a catalog key (such as
7325
- * `useEditorCommand(slotId).disabledReason`) or text. Default: the viewing reason.
7324
+ * Why the gallery takes no pick, for the tiles' tooltips: a catalog key or text
7325
+ * (such as `useEditorCommand(slotId).disabledReason`). Default: the viewing reason.
7326
7326
  */
7327
7327
  disabledReason: { type: String, default: void 0 },
7328
7328
  /** A class name added to the gallery, as React's `className`. A host `class` also works. */
@@ -8729,12 +8729,12 @@ function useCanvasContextMenu() {
8729
8729
  import {
8730
8730
  computed as computed24,
8731
8731
  defineComponent as defineComponent57,
8732
- onBeforeUnmount as onBeforeUnmount13,
8732
+ onBeforeUnmount as onBeforeUnmount14,
8733
8733
  onMounted as onMounted20,
8734
8734
  onUpdated as onUpdated5,
8735
- ref as ref41,
8736
- shallowRef as shallowRef30,
8737
- watch as watch37
8735
+ ref as ref40,
8736
+ shallowRef as shallowRef31,
8737
+ watch as watch36
8738
8738
  } from "vue";
8739
8739
  import {
8740
8740
  STATUS_BAR_VIEW_OPTIONS,
@@ -8750,7 +8750,6 @@ import {
8750
8750
  slideSorterMounted,
8751
8751
  sorterKeyDown,
8752
8752
  trackNotesInset,
8753
- translateKeyOrText as translateKeyOrText20,
8754
8753
  warnSlideSorterUnmounted
8755
8754
  } from "@pptx-editor.dev/core/editor";
8756
8755
 
@@ -8913,15 +8912,15 @@ import {
8913
8912
  computed as computed22,
8914
8913
  defineComponent as defineComponent55,
8915
8914
  nextTick as nextTick9,
8916
- onBeforeUnmount as onBeforeUnmount11,
8915
+ onBeforeUnmount as onBeforeUnmount12,
8917
8916
  onMounted as onMounted19,
8918
8917
  onUnmounted as onUnmounted4,
8919
8918
  onUpdated as onUpdated4,
8920
8919
  provide as provide17,
8921
- ref as ref40,
8922
- shallowRef as shallowRef28,
8920
+ ref as ref39,
8921
+ shallowRef as shallowRef29,
8923
8922
  useId as useId21,
8924
- watch as watch35
8923
+ watch as watch34
8925
8924
  } from "vue";
8926
8925
  import {
8927
8926
  ZOOM_MENU_LEVELS,
@@ -12212,8 +12211,8 @@ import {
12212
12211
  defineComponent as defineComponent54,
12213
12212
  nextTick as nextTick8,
12214
12213
  onMounted as onMounted18,
12215
- ref as ref39,
12216
- watch as watch34
12214
+ ref as ref38,
12215
+ watch as watch33
12217
12216
  } from "vue";
12218
12217
  import {
12219
12218
  listenPaneRequests,
@@ -12526,7 +12525,7 @@ var PptxEditorSelectionPane = defineComponent43({
12526
12525
  });
12527
12526
 
12528
12527
  // src/AnimationsPane.tsx
12529
- import { computed as computed20, defineComponent as defineComponent44, onBeforeUnmount as onBeforeUnmount10, ref as ref31, useId as useId17, watch as watch30 } from "vue";
12528
+ import { computed as computed20, defineComponent as defineComponent44, onBeforeUnmount as onBeforeUnmount11, ref as ref31, useId as useId17, watch as watch31 } from "vue";
12530
12529
  import {
12531
12530
  ANIMATION_PRESET_GROUPS,
12532
12531
  ANIMATION_TRIGGERS,
@@ -12535,9 +12534,46 @@ import {
12535
12534
  animationListParts,
12536
12535
  animationStartLabel,
12537
12536
  parseSeconds,
12537
+ sameFormatNumber,
12538
12538
  secondsText,
12539
12539
  transitionKindLabelKey
12540
12540
  } from "@pptx-editor.dev/core/editor";
12541
+
12542
+ // src/live-field.ts
12543
+ import { onBeforeUnmount as onBeforeUnmount10, shallowRef as shallowRef28, watch as watch30 } from "vue";
12544
+ import { createLiveField } from "@pptx-editor.dev/core/editor";
12545
+ function useLiveField(host, scope) {
12546
+ const version = shallowRef28(0);
12547
+ const field = createLiveField(host, () => {
12548
+ version.value++;
12549
+ });
12550
+ watch30(
12551
+ scope,
12552
+ () => {
12553
+ field.sync();
12554
+ version.value++;
12555
+ },
12556
+ { flush: "sync" }
12557
+ );
12558
+ onBeforeUnmount10(() => field.dispose());
12559
+ return {
12560
+ get draft() {
12561
+ void version.value;
12562
+ return field.draft;
12563
+ },
12564
+ get error() {
12565
+ void version.value;
12566
+ return field.error;
12567
+ },
12568
+ input: (text2, composing) => field.input(text2, composing),
12569
+ commit: () => field.commit(),
12570
+ cancel: () => field.cancel(),
12571
+ sync: () => field.sync(),
12572
+ dispose: () => field.dispose()
12573
+ };
12574
+ }
12575
+
12576
+ // src/AnimationsPane.tsx
12541
12577
  import { jsx as jsx36, jsxs as jsxs30 } from "vue/jsx-runtime";
12542
12578
  var SecondsField = defineComponent44({
12543
12579
  name: "PptxAnimationSecondsField",
@@ -12545,52 +12581,60 @@ var SecondsField = defineComponent44({
12545
12581
  label: { type: String, required: true },
12546
12582
  ms: { type: Number, required: true },
12547
12583
  disabled: { type: Boolean, required: true },
12548
- onCommit: { type: Function, required: true }
12584
+ onCommit: {
12585
+ type: Function,
12586
+ required: true
12587
+ }
12549
12588
  },
12550
12589
  setup(props) {
12551
12590
  const { t } = useTranslation();
12591
+ const editor = usePptxEditor();
12552
12592
  const errorId = useId17();
12553
- const draft = ref31(null);
12554
- const invalid = ref31(false);
12555
- const reset = () => {
12556
- draft.value = null;
12557
- invalid.value = false;
12558
- };
12559
- const commit = () => {
12560
- const d = draft.value;
12561
- if (d === null) return;
12562
- const shown = secondsText(props.ms);
12563
- const value = d === shown ? null : parseSeconds(d);
12564
- if (d === shown || value !== null && props.onCommit(value)) reset();
12565
- else invalid.value = true;
12566
- };
12567
- return () => /* @__PURE__ */ jsxs30("label", { class: "pptx-field", children: [
12568
- props.label,
12569
- /* @__PURE__ */ jsxs30("span", { class: "pptx-field__control", children: [
12570
- /* @__PURE__ */ jsx36(
12571
- "input",
12572
- {
12573
- inputmode: "decimal",
12574
- "aria-label": props.label,
12575
- "aria-invalid": invalid.value,
12576
- "aria-describedby": invalid.value ? errorId : void 0,
12577
- value: draft.value ?? secondsText(props.ms),
12578
- disabled: props.disabled,
12579
- "data-draft": draft.value !== null,
12580
- onInput: (e) => {
12581
- draft.value = e.target.value;
12582
- },
12583
- onBlur: commit,
12584
- onKeydown: (e) => {
12585
- if (e.key === "Enter") commit();
12586
- if (e.key === "Escape") reset();
12593
+ const field = useLiveField(
12594
+ () => ({
12595
+ editor: editor.value,
12596
+ value: () => secondsText(props.ms),
12597
+ same: sameFormatNumber,
12598
+ write(text2, options, final) {
12599
+ const value = parseSeconds(text2);
12600
+ if (value !== null && props.onCommit(value, options)) return null;
12601
+ return final ? t("panel.animations.invalidTime") : void 0;
12602
+ }
12603
+ }),
12604
+ () => props.ms
12605
+ );
12606
+ return () => {
12607
+ const invalid = field.error !== null;
12608
+ return /* @__PURE__ */ jsxs30("label", { class: "pptx-field", children: [
12609
+ props.label,
12610
+ /* @__PURE__ */ jsxs30("span", { class: "pptx-field__control", children: [
12611
+ /* @__PURE__ */ jsx36(
12612
+ "input",
12613
+ {
12614
+ inputmode: "decimal",
12615
+ "aria-label": props.label,
12616
+ "aria-invalid": invalid,
12617
+ "aria-describedby": invalid ? errorId : void 0,
12618
+ value: field.draft ?? secondsText(props.ms),
12619
+ disabled: props.disabled,
12620
+ "data-draft": field.draft !== null,
12621
+ onInput: (e) => field.input(
12622
+ e.target.value,
12623
+ e.isComposing === true
12624
+ ),
12625
+ onCompositionend: (e) => field.input(e.target.value),
12626
+ onBlur: () => field.commit(),
12627
+ onKeydown: (e) => {
12628
+ if (e.key === "Enter") field.commit();
12629
+ if (e.key === "Escape") field.cancel();
12630
+ }
12587
12631
  }
12588
- }
12589
- ),
12590
- /* @__PURE__ */ jsx36("span", { class: "pptx-field__unit", children: t("panel.animations.secondsUnit") })
12591
- ] }),
12592
- invalid.value ? /* @__PURE__ */ jsx36("span", { id: errorId, class: "pptx-animations__error", role: "alert", children: t("panel.animations.invalidTime") }) : null
12593
- ] });
12632
+ ),
12633
+ /* @__PURE__ */ jsx36("span", { class: "pptx-field__unit", children: t("panel.animations.secondsUnit") })
12634
+ ] }),
12635
+ invalid ? /* @__PURE__ */ jsx36("span", { id: errorId, class: "pptx-animations__error", role: "alert", children: field.error }) : null
12636
+ ] });
12637
+ };
12594
12638
  }
12595
12639
  });
12596
12640
  var TransitionSection = defineComponent44({
@@ -12602,7 +12646,7 @@ var TransitionSection = defineComponent44({
12602
12646
  const transition = useEditorState((s) => s.animations?.transition);
12603
12647
  const slideCount = useEditorState((s) => s.slides.length);
12604
12648
  const kindId = useId17();
12605
- const set = (change) => editor.value?.exec({ type: "setTransition", ...change }).ok === true;
12649
+ const set = (change, options) => editor.value?.exec({ type: "setTransition", ...change }, options).ok === true;
12606
12650
  return () => {
12607
12651
  const tr = transition.value;
12608
12652
  if (!tr) return null;
@@ -12633,7 +12677,7 @@ var TransitionSection = defineComponent44({
12633
12677
  label: t("panel.animations.duration"),
12634
12678
  ms: tr.durationMs,
12635
12679
  disabled: disabled || tr.kind === "none",
12636
- onCommit: (ms) => set({ durationMs: ms })
12680
+ onCommit: (ms, options) => set({ durationMs: ms }, options)
12637
12681
  }
12638
12682
  ),
12639
12683
  /* @__PURE__ */ jsx36(
@@ -12642,7 +12686,7 @@ var TransitionSection = defineComponent44({
12642
12686
  label: t("panel.animations.advanceAfter"),
12643
12687
  ms: tr.advanceAfterMs ?? 0,
12644
12688
  disabled: disabled || tr.advanceAfterMs === null,
12645
- onCommit: (ms) => set({ advanceAfterMs: ms })
12689
+ onCommit: (ms, options) => set({ advanceAfterMs: ms }, options)
12646
12690
  }
12647
12691
  )
12648
12692
  ] }),
@@ -12750,7 +12794,7 @@ var EffectFields = defineComponent44({
12750
12794
  return () => {
12751
12795
  const effect = props.effect;
12752
12796
  const off = props.disabled || !effect.editable;
12753
- const timing = (change) => editor.value?.exec({ type: "setAnimationTiming", effectId: effect.id, ...change }).ok === true;
12797
+ const timing = (change, options) => editor.value?.exec({ type: "setAnimationTiming", effectId: effect.id, ...change }, options).ok === true;
12754
12798
  const move = (to) => editor.value?.exec({ type: "moveAnimation", effectId: effect.id, to });
12755
12799
  return /* @__PURE__ */ jsxs30("div", { class: "pptx-panel__section pptx-animations__fields", children: [
12756
12800
  /* @__PURE__ */ jsxs30("label", { class: "pptx-field", for: startId, children: [
@@ -12774,7 +12818,7 @@ var EffectFields = defineComponent44({
12774
12818
  label: t("panel.animations.delay"),
12775
12819
  ms: effect.delayMs,
12776
12820
  disabled: off,
12777
- onCommit: (ms) => timing({ delayMs: ms })
12821
+ onCommit: (ms, options) => timing({ delayMs: ms }, options)
12778
12822
  }
12779
12823
  ),
12780
12824
  /* @__PURE__ */ jsx36(
@@ -12783,7 +12827,7 @@ var EffectFields = defineComponent44({
12783
12827
  label: t("panel.animations.duration"),
12784
12828
  ms: effect.durationMs ?? 0,
12785
12829
  disabled: off || effect.durationMs === null,
12786
- onCommit: (ms) => timing({ durationMs: ms })
12830
+ onCommit: (ms, options) => timing({ durationMs: ms }, options)
12787
12831
  }
12788
12832
  )
12789
12833
  ] }),
@@ -12833,7 +12877,7 @@ var AnimationsPane = defineComponent44({
12833
12877
  const chosen = ref31(null);
12834
12878
  const presetId = useId17();
12835
12879
  const listId = useId17();
12836
- watch30(
12880
+ watch31(
12837
12881
  editor,
12838
12882
  (e, _old, onCleanup) => {
12839
12883
  if (!e) return;
@@ -12842,7 +12886,7 @@ var AnimationsPane = defineComponent44({
12842
12886
  },
12843
12887
  { immediate: true }
12844
12888
  );
12845
- onBeforeUnmount10(() => void editor.value?.exec({ type: "showAnimationOrder", show: false }));
12889
+ onBeforeUnmount11(() => void editor.value?.exec({ type: "showAnimationOrder", show: false }));
12846
12890
  const effects = computed20(() => animations.value?.effects ?? []);
12847
12891
  const add = () => {
12848
12892
  const e = editor.value;
@@ -12930,7 +12974,7 @@ var AnimationsPane = defineComponent44({
12930
12974
  });
12931
12975
 
12932
12976
  // src/ChartDataPane.tsx
12933
- import { defineComponent as defineComponent45, ref as ref32, useId as useId18, watch as watch31 } from "vue";
12977
+ import { defineComponent as defineComponent45, ref as ref32, useId as useId18 } from "vue";
12934
12978
  import {
12935
12979
  CHART_LEGEND_CHOICES,
12936
12980
  CHART_TYPE_CHOICES,
@@ -12948,7 +12992,8 @@ import {
12948
12992
  focusChartRow,
12949
12993
  colorPickOf as colorPickOf2,
12950
12994
  nextChartCategoryLabel,
12951
- renderedColorOf as renderedColorOf2
12995
+ renderedColorOf as renderedColorOf2,
12996
+ sameFormatNumber as sameFormatNumber2
12952
12997
  } from "@pptx-editor.dev/core/editor";
12953
12998
  import { Fragment as Fragment23, jsx as jsx37, jsxs as jsxs31 } from "vue/jsx-runtime";
12954
12999
  var ChartField = defineComponent45({
@@ -12960,49 +13005,55 @@ var ChartField = defineComponent45({
12960
13005
  value: { type: String, required: true },
12961
13006
  numeric: { type: Boolean, default: false },
12962
13007
  disabled: { type: Boolean, required: true },
12963
- onCommit: { type: Function, required: true }
13008
+ onCommit: {
13009
+ type: Function,
13010
+ required: true
13011
+ }
12964
13012
  },
12965
13013
  setup(props) {
12966
13014
  const errorId = useId18();
12967
- const draft = ref32(null);
12968
- const error = ref32(null);
12969
- const reset = () => {
12970
- draft.value = null;
12971
- error.value = null;
12972
- };
12973
- watch31(() => props.draftKey, reset, { flush: "sync" });
12974
- const commit = () => {
12975
- const d = draft.value;
12976
- if (d === null) return;
12977
- if (d === props.value) return reset();
12978
- const refused = props.onCommit(d);
12979
- if (refused === null) reset();
12980
- else error.value = refused;
12981
- };
12982
- return () => /* @__PURE__ */ jsxs31("label", { class: "pptx-field pptx-chart-pane__field", children: [
12983
- props.visibleLabel ? /* @__PURE__ */ jsx37("span", { class: "pptx-chart-pane__label", children: props.visibleLabel }) : null,
12984
- /* @__PURE__ */ jsx37(
12985
- "input",
12986
- {
12987
- "aria-label": props.label,
12988
- inputmode: props.numeric ? "decimal" : void 0,
12989
- "aria-invalid": error.value !== null,
12990
- "aria-describedby": error.value !== null ? errorId : void 0,
12991
- value: draft.value ?? props.value,
12992
- disabled: props.disabled,
12993
- "data-draft": draft.value !== null,
12994
- onInput: (e) => {
12995
- draft.value = e.target.value;
12996
- },
12997
- onBlur: commit,
12998
- onKeydown: (e) => {
12999
- if (e.key === "Enter") commit();
13000
- if (e.key === "Escape") reset();
13001
- }
13015
+ const editor = usePptxEditor();
13016
+ const field = useLiveField(
13017
+ () => ({
13018
+ editor: editor.value,
13019
+ value: () => props.value,
13020
+ ...props.numeric ? { same: sameFormatNumber2 } : {},
13021
+ write: (text2, options, final) => {
13022
+ const refused = props.onCommit(text2, options);
13023
+ return refused === null || final ? refused : void 0;
13002
13024
  }
13003
- ),
13004
- error.value !== null ? /* @__PURE__ */ jsx37("span", { id: errorId, class: "pptx-chart-pane__error", role: "alert", children: error.value }) : null
13005
- ] });
13025
+ }),
13026
+ () => `${props.draftKey}\0${props.value}`
13027
+ );
13028
+ return () => {
13029
+ const error = field.error;
13030
+ return /* @__PURE__ */ jsxs31("label", { class: "pptx-field pptx-chart-pane__field", children: [
13031
+ props.visibleLabel ? /* @__PURE__ */ jsx37("span", { class: "pptx-chart-pane__label", children: props.visibleLabel }) : null,
13032
+ /* @__PURE__ */ jsx37(
13033
+ "input",
13034
+ {
13035
+ "aria-label": props.label,
13036
+ inputmode: props.numeric ? "decimal" : void 0,
13037
+ "aria-invalid": error !== null,
13038
+ "aria-describedby": error !== null ? errorId : void 0,
13039
+ value: field.draft ?? props.value,
13040
+ disabled: props.disabled,
13041
+ "data-draft": field.draft !== null,
13042
+ onInput: (e) => field.input(
13043
+ e.target.value,
13044
+ e.isComposing === true
13045
+ ),
13046
+ onCompositionend: (e) => field.input(e.target.value),
13047
+ onBlur: () => field.commit(),
13048
+ onKeydown: (e) => {
13049
+ if (e.key === "Enter") field.commit();
13050
+ if (e.key === "Escape") field.cancel();
13051
+ }
13052
+ }
13053
+ ),
13054
+ error !== null ? /* @__PURE__ */ jsx37("span", { id: errorId, class: "pptx-chart-pane__error", role: "alert", children: error }) : null
13055
+ ] });
13056
+ };
13006
13057
  }
13007
13058
  });
13008
13059
  var SeriesCard = defineComponent45({
@@ -13044,7 +13095,7 @@ var SeriesCard = defineComponent45({
13044
13095
  visibleLabel: t("chartData.name"),
13045
13096
  value: series.name,
13046
13097
  disabled,
13047
- onCommit: (text2) => props.apply({ type: "seriesName", series: index, text: text2 })
13098
+ onCommit: (text2, options) => props.apply({ type: "seriesName", series: index, text: text2 }, options)
13048
13099
  }
13049
13100
  ),
13050
13101
  /* @__PURE__ */ jsx37("div", { class: "pptx-panel__grid", children: data.categories.map((c, i) => /* @__PURE__ */ jsx37(
@@ -13056,7 +13107,7 @@ var SeriesCard = defineComponent45({
13056
13107
  value: chartValueText(series.values[i]),
13057
13108
  numeric: true,
13058
13109
  disabled,
13059
- onCommit: (text2) => props.apply({ type: "value", series: index, category: i, text: text2 })
13110
+ onCommit: (text2, options) => props.apply({ type: "value", series: index, category: i, text: text2 }, options)
13060
13111
  },
13061
13112
  i
13062
13113
  )) }),
@@ -13181,7 +13232,7 @@ var ChartFormatSection = defineComponent45({
13181
13232
  visibleLabel: t("chartFormat.titleText"),
13182
13233
  value: format.title,
13183
13234
  disabled,
13184
- onCommit: (text2) => run(chartTitleCommand(format, "title", text2))
13235
+ onCommit: (text2, options) => run(chartTitleCommand(format, "title", text2), options)
13185
13236
  }
13186
13237
  ) }) : null,
13187
13238
  /* @__PURE__ */ jsx37(
@@ -13234,7 +13285,7 @@ var ChartFormatSection = defineComponent45({
13234
13285
  visibleLabel: t(axisLabels.category),
13235
13286
  value: format.axisTitles?.category ?? "",
13236
13287
  disabled: disabled || !format.axes,
13237
- onCommit: (text2) => run(chartTitleCommand(format, "categoryAxisTitle", text2))
13288
+ onCommit: (text2, options) => run(chartTitleCommand(format, "categoryAxisTitle", text2), options)
13238
13289
  }
13239
13290
  ),
13240
13291
  /* @__PURE__ */ jsx37(
@@ -13245,7 +13296,7 @@ var ChartFormatSection = defineComponent45({
13245
13296
  visibleLabel: t(axisLabels.value),
13246
13297
  value: format.axisTitles?.value ?? "",
13247
13298
  disabled: disabled || !format.axes,
13248
- onCommit: (text2) => run(chartTitleCommand(format, "valueAxisTitle", text2))
13299
+ onCommit: (text2, options) => run(chartTitleCommand(format, "valueAxisTitle", text2), options)
13249
13300
  }
13250
13301
  )
13251
13302
  ] }),
@@ -13315,19 +13366,19 @@ var ChartDataPane = defineComponent45({
13315
13366
  }
13316
13367
  const draftKey = String(draftScope.reset);
13317
13368
  const disabled = readOnly.value || !selected.editable;
13318
- const apply = (change) => {
13369
+ const apply = (change, options) => {
13319
13370
  const command = chartPaneCommand(data, change);
13320
13371
  if (!command.ok) return t(command.error);
13321
- const result = editor.value?.exec(command.command);
13372
+ const result = editor.value?.exec(command.command, options);
13322
13373
  refusal.value = null;
13323
13374
  return !result || result.ok ? null : t(result.reason);
13324
13375
  };
13325
- const runFormat = (command) => {
13376
+ const runFormat = (command, options) => {
13326
13377
  if (!command) {
13327
13378
  refusal.value = null;
13328
13379
  return null;
13329
13380
  }
13330
- const result = editor.value?.exec(command);
13381
+ const result = editor.value?.exec(command, options);
13331
13382
  const reason = !result || result.ok ? null : t(result.reason);
13332
13383
  refusal.value = reason;
13333
13384
  return reason;
@@ -13366,7 +13417,7 @@ var ChartDataPane = defineComponent45({
13366
13417
  value: c.label,
13367
13418
  numeric: xy,
13368
13419
  disabled,
13369
- onCommit: (text2) => apply({ type: "label", category: i, text: text2 })
13420
+ onCommit: (text2, options) => apply({ type: "label", category: i, text: text2 }, options)
13370
13421
  }
13371
13422
  ),
13372
13423
  /* @__PURE__ */ jsx37(
@@ -13454,53 +13505,58 @@ var NodeField = defineComponent46({
13454
13505
  readOnly: { type: Boolean, required: true },
13455
13506
  /** The id of a note that describes the field, if any. */
13456
13507
  note: { type: String, default: void 0 },
13457
- onCommit: { type: Function, required: true }
13508
+ onCommit: {
13509
+ type: Function,
13510
+ required: true
13511
+ }
13458
13512
  },
13459
13513
  setup(props) {
13460
13514
  const errorId = useId19();
13461
- const draft = ref33(null);
13462
- const error = ref33(null);
13463
- const reset = () => {
13464
- draft.value = null;
13465
- error.value = null;
13466
- };
13467
- const commit = () => {
13468
- const d = draft.value;
13469
- if (d === null) return;
13470
- if (d === props.value) return reset();
13471
- const refused = props.onCommit(d);
13472
- if (refused === null) reset();
13473
- else error.value = refused;
13474
- };
13515
+ const editor = usePptxEditor();
13516
+ const field = useLiveField(
13517
+ () => ({
13518
+ editor: editor.value,
13519
+ value: () => props.value,
13520
+ write: (text2, options, final) => {
13521
+ const refused = props.onCommit(text2, options);
13522
+ return refused === null || final ? refused : void 0;
13523
+ }
13524
+ }),
13525
+ () => props.value
13526
+ );
13475
13527
  return () => {
13476
- const shown = draft.value ?? props.value;
13528
+ const draft = field.draft;
13529
+ const error = field.error;
13530
+ const shown = draft ?? props.value;
13477
13531
  return /* @__PURE__ */ jsxs32("label", { class: "pptx-field pptx-diagram-pane__field", children: [
13478
13532
  /* @__PURE__ */ jsx38(
13479
13533
  "textarea",
13480
13534
  {
13481
13535
  "aria-label": props.label,
13482
- "aria-invalid": error.value !== null,
13483
- "aria-describedby": [error.value !== null ? errorId : null, props.note].filter(Boolean).join(" ") || void 0,
13536
+ "aria-invalid": error !== null,
13537
+ "aria-describedby": [error !== null ? errorId : null, props.note].filter(Boolean).join(" ") || void 0,
13484
13538
  rows: Math.min(6, shown.split("\n").length),
13485
13539
  value: shown,
13486
13540
  readonly: props.readOnly,
13487
13541
  "data-node": props.node,
13488
- "data-draft": draft.value !== null,
13489
- onInput: (e) => {
13490
- draft.value = e.target.value;
13491
- },
13492
- onBlur: commit,
13542
+ "data-draft": draft !== null,
13543
+ onInput: (e) => field.input(
13544
+ e.target.value,
13545
+ e.isComposing === true
13546
+ ),
13547
+ onCompositionend: (e) => field.input(e.target.value),
13548
+ onBlur: () => field.commit(),
13493
13549
  onKeydown: (e) => {
13494
13550
  if (e.key === "Enter" && !e.shiftKey && !e.isComposing) {
13495
13551
  e.preventDefault();
13496
13552
  e.stopPropagation();
13497
- commit();
13553
+ field.commit();
13498
13554
  }
13499
- if (e.key === "Escape") reset();
13555
+ if (e.key === "Escape") field.cancel();
13500
13556
  }
13501
13557
  }
13502
13558
  ),
13503
- error.value !== null ? /* @__PURE__ */ jsx38("span", { id: errorId, class: "pptx-chart-pane__error", role: "alert", children: error.value }) : null
13559
+ error !== null ? /* @__PURE__ */ jsx38("span", { id: errorId, class: "pptx-chart-pane__error", role: "alert", children: error }) : null
13504
13560
  ] });
13505
13561
  };
13506
13562
  }
@@ -13530,8 +13586,8 @@ var DiagramTextPane = defineComponent46({
13530
13586
  /* @__PURE__ */ jsx38("p", { class: "pptx-empty__body", children: t("diagram.pane.emptyBody") })
13531
13587
  ] });
13532
13588
  const frame = selected.nodeId;
13533
- const apply = (command) => {
13534
- const result = editor.value?.exec(command);
13589
+ const apply = (command, options) => {
13590
+ const result = editor.value?.exec(command, options);
13535
13591
  return !result || result.ok ? null : t(result.reason);
13536
13592
  };
13537
13593
  const run = (command, index) => {
@@ -13575,7 +13631,10 @@ var DiagramTextPane = defineComponent46({
13575
13631
  node: node.node,
13576
13632
  readOnly: readOnly.value || !node.editable,
13577
13633
  note: node.editable ? void 0 : `${noteId}-${i}`,
13578
- onCommit: (text2) => apply({ type: "setDiagramText", nodeId: frame, node: node.node, text: text2 })
13634
+ onCommit: (text2, options) => apply(
13635
+ { type: "setDiagramText", nodeId: frame, node: node.node, text: text2 },
13636
+ options
13637
+ )
13579
13638
  }
13580
13639
  ),
13581
13640
  /* @__PURE__ */ jsxs32("div", { class: "pptx-diagram-pane__actions", children: [
@@ -13649,8 +13708,8 @@ var DiagramTextPane = defineComponent46({
13649
13708
  // src/FormatPanel.tsx
13650
13709
  import {
13651
13710
  defineComponent as defineComponent53,
13652
- ref as ref38,
13653
- watch as watch33
13711
+ ref as ref37,
13712
+ watch as watch32
13654
13713
  } from "vue";
13655
13714
  import {
13656
13715
  chromeControlForSlot as chromeControlForSlot7,
@@ -13665,10 +13724,18 @@ import {
13665
13724
 
13666
13725
  // src/FormatLineWidth.tsx
13667
13726
  import { defineComponent as defineComponent48 } from "vue";
13668
- import { formatLineState, formatTargetKey as formatTargetKey2, translateKeyOrText as translateKeyOrText16 } from "@pptx-editor.dev/core/editor";
13727
+ import {
13728
+ formatLineState,
13729
+ formatTargetKey as formatTargetKey2,
13730
+ translateKeyOrText as translateKeyOrText16
13731
+ } from "@pptx-editor.dev/core/editor";
13669
13732
 
13670
13733
  // src/FormatNumberField.tsx
13671
- import { defineComponent as defineComponent47, ref as ref34, watch as watch32, useId as useId20 } from "vue";
13734
+ import { defineComponent as defineComponent47, useId as useId20 } from "vue";
13735
+ import {
13736
+ parseFormatNumber,
13737
+ sameFormatNumber as sameFormatNumber3
13738
+ } from "@pptx-editor.dev/core/editor";
13672
13739
  import { jsx as jsx39, jsxs as jsxs33 } from "vue/jsx-runtime";
13673
13740
  var FormatNumberField = defineComponent47({
13674
13741
  name: "FormatNumberField",
@@ -13682,74 +13749,99 @@ var FormatNumberField = defineComponent47({
13682
13749
  exclusiveMin: Boolean,
13683
13750
  mixed: { type: Boolean, default: true },
13684
13751
  max: Number,
13685
- onCommit: { type: Function, required: true }
13752
+ /** The Arrow Up and Arrow Down increment. Shift multiplies it by 10. */
13753
+ step: { type: Number, default: 1 },
13754
+ /** Show the label beside the field, as the other rows of a format section do. */
13755
+ inline: Boolean,
13756
+ /** The hint for a field without a value that is not a mixed selection. */
13757
+ placeholder: { type: String, default: void 0 },
13758
+ onCommit: {
13759
+ type: Function,
13760
+ required: true
13761
+ }
13686
13762
  },
13687
13763
  setup(props) {
13688
13764
  const { t } = useTranslation();
13765
+ const editor = usePptxEditor();
13689
13766
  const errorId = useId20();
13690
- const draft = ref34(null);
13691
- const error = ref34(null);
13692
- const reset = () => {
13693
- draft.value = null;
13694
- error.value = null;
13695
- };
13696
- watch32(() => props.value, reset, { flush: "sync" });
13697
- const commit = () => {
13698
- if (draft.value === null) return;
13699
- const number = draft.value.trim() === "" ? NaN : Number(draft.value.replace(",", "."));
13700
- if (!Number.isFinite(number) || props.min !== void 0 && (number < props.min || props.exclusiveMin && number === props.min) || props.max !== void 0 && number > props.max) {
13701
- error.value = props.min !== void 0 && props.max !== void 0 ? t(props.exclusiveMin ? "inspector.numberRangeExclusive" : "inspector.numberRange", {
13702
- min: props.min,
13703
- max: props.max
13704
- }) : props.min !== void 0 ? t("inspector.numberMinimum", { min: props.min }) : t("disabled.invalidValue");
13705
- return;
13706
- }
13707
- if (props.value !== null && number === Number(props.value)) return reset();
13708
- const refused = props.onCommit(number);
13709
- if (refused) error.value = refused;
13710
- else reset();
13767
+ const field = useLiveField(
13768
+ () => ({
13769
+ editor: editor.value,
13770
+ value: () => props.value,
13771
+ same: sameFormatNumber3,
13772
+ write(text2, options, final) {
13773
+ const parsed = parseFormatNumber(text2, {
13774
+ min: props.min,
13775
+ max: props.max,
13776
+ exclusiveMin: props.exclusiveMin
13777
+ });
13778
+ if (!parsed.ok)
13779
+ return final || !parsed.incomplete ? t(parsed.key, parsed.params) : void 0;
13780
+ if (props.value !== null && parsed.value === Number(props.value)) return null;
13781
+ return props.onCommit(parsed.value, options);
13782
+ }
13783
+ }),
13784
+ () => props.value
13785
+ );
13786
+ const nudge = (direction, large) => {
13787
+ const parsed = parseFormatNumber(field.draft ?? props.value ?? "", {});
13788
+ if (!parsed.ok) return;
13789
+ const delta = direction * props.step * (large ? 10 : 1);
13790
+ let next = Math.round((parsed.value + delta) * 1e3) / 1e3;
13791
+ if (props.max !== void 0) next = Math.min(props.max, next);
13792
+ if (props.min !== void 0) next = Math.max(props.min, next);
13793
+ if (props.exclusiveMin && props.min !== void 0 && next <= props.min) return;
13794
+ field.input(String(next));
13711
13795
  };
13712
- return () => /* @__PURE__ */ jsxs33("label", { class: "pptx-field", children: [
13713
- props.label,
13714
- /* @__PURE__ */ jsxs33("span", { class: "pptx-field__control", children: [
13715
- /* @__PURE__ */ jsx39(
13716
- "input",
13717
- {
13718
- inputmode: "decimal",
13719
- "aria-label": props.label,
13720
- "data-format-property": props.property,
13721
- value: draft.value ?? props.value ?? "",
13722
- placeholder: props.value === null && props.mixed ? t("inspector.mixed") : void 0,
13723
- disabled: props.disabled,
13724
- "aria-invalid": !!error.value,
13725
- "aria-describedby": error.value ? errorId : void 0,
13726
- "data-draft": draft.value !== null,
13727
- onInput: (e) => {
13728
- draft.value = e.target.value;
13729
- },
13730
- onBlur: commit,
13731
- onKeydown: (e) => {
13732
- if (e.key === "Enter" && !e.isComposing) {
13733
- e.preventDefault();
13734
- commit();
13735
- }
13736
- if (e.key === "Escape") {
13737
- e.preventDefault();
13738
- e.stopPropagation();
13739
- reset();
13796
+ return () => {
13797
+ const error = field.error;
13798
+ return /* @__PURE__ */ jsxs33("label", { class: props.inline ? "pptx-field pptx-field--inline" : "pptx-field", children: [
13799
+ props.inline ? /* @__PURE__ */ jsx39("span", { class: "pptx-field__label", children: props.label }) : props.label,
13800
+ /* @__PURE__ */ jsxs33("span", { class: "pptx-field__control", children: [
13801
+ /* @__PURE__ */ jsx39(
13802
+ "input",
13803
+ {
13804
+ inputmode: "decimal",
13805
+ "aria-label": props.label,
13806
+ "data-format-property": props.property,
13807
+ value: field.draft ?? props.value ?? "",
13808
+ placeholder: props.value === null ? props.mixed ? t("inspector.mixed") : props.placeholder : void 0,
13809
+ disabled: props.disabled,
13810
+ "aria-invalid": !!error,
13811
+ "aria-describedby": error ? errorId : void 0,
13812
+ "data-draft": field.draft !== null,
13813
+ onInput: (e) => field.input(
13814
+ e.target.value,
13815
+ e.isComposing === true
13816
+ ),
13817
+ onCompositionend: (e) => field.input(e.target.value),
13818
+ onBlur: () => field.commit(),
13819
+ onKeydown: (e) => {
13820
+ if (e.isComposing) return;
13821
+ if (e.key === "Enter") {
13822
+ e.preventDefault();
13823
+ field.commit();
13824
+ } else if (e.key === "Escape") {
13825
+ e.preventDefault();
13826
+ e.stopPropagation();
13827
+ field.cancel();
13828
+ } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
13829
+ e.preventDefault();
13830
+ nudge(e.key === "ArrowUp" ? 1 : -1, e.shiftKey);
13831
+ }
13740
13832
  }
13741
13833
  }
13742
- }
13743
- ),
13744
- /* @__PURE__ */ jsx39("span", { class: "pptx-field__unit", children: props.unit })
13745
- ] }),
13746
- error.value ? /* @__PURE__ */ jsx39("span", { id: errorId, class: "pptx-chart-pane__error", role: "alert", children: error.value }) : null
13747
- ] });
13834
+ ),
13835
+ /* @__PURE__ */ jsx39("span", { class: "pptx-field__unit", children: props.unit })
13836
+ ] }),
13837
+ error ? /* @__PURE__ */ jsx39("span", { id: errorId, class: "pptx-chart-pane__error", role: "alert", children: error }) : null
13838
+ ] });
13839
+ };
13748
13840
  }
13749
13841
  });
13750
13842
 
13751
13843
  // src/FormatLineWidth.tsx
13752
- import { jsx as jsx40 } from "vue/jsx-runtime";
13844
+ import { jsx as jsx40, jsxs as jsxs34 } from "vue/jsx-runtime";
13753
13845
  var FormatLineWidth = defineComponent48({
13754
13846
  name: "FormatLineWidth",
13755
13847
  setup() {
@@ -13760,68 +13852,73 @@ var FormatLineWidth = defineComponent48({
13760
13852
  const line = formatLineState(editor.value);
13761
13853
  if (!line) return null;
13762
13854
  const key = `${editor.value?.session?.id}:${formatTargetKey2(snapshot.value)}`;
13763
- return /* @__PURE__ */ jsx40(
13764
- FormatNumberField,
13765
- {
13766
- label: t("inspector.lineWidth"),
13767
- property: "line.width",
13768
- value: line.width === null ? null : String(Math.round(line.width * 100) / 100),
13769
- unit: "pt",
13770
- min: 0,
13771
- exclusiveMin: true,
13772
- mixed: line.widthMixed,
13773
- max: 1584,
13774
- disabled: snapshot.value.mode === "view",
13775
- onCommit: (points) => {
13776
- if (!editor.value || `${editor.value.session?.id}:${formatTargetKey2(editor.value.snapshot())}` !== key)
13777
- return t("disabled.invalidValue");
13778
- if (points === line.width) return null;
13779
- const result = editor.value.exec({ type: "setLineWidth", points });
13780
- return result.ok ? null : translateKeyOrText16(t, result.reason);
13781
- }
13782
- },
13783
- key
13784
- );
13855
+ return /* @__PURE__ */ jsxs34("div", { class: "pptx-format-line-width", children: [
13856
+ /* @__PURE__ */ jsx40(
13857
+ FormatNumberField,
13858
+ {
13859
+ label: t("inspector.lineWidth"),
13860
+ property: "line.width",
13861
+ value: line.width === null ? null : String(Math.round(line.width * 100) / 100),
13862
+ unit: "pt",
13863
+ min: 0,
13864
+ exclusiveMin: true,
13865
+ mixed: line.widthMixed,
13866
+ max: 1584,
13867
+ step: 0.25,
13868
+ inline: true,
13869
+ placeholder: t("inspector.noLine"),
13870
+ disabled: snapshot.value.mode === "view",
13871
+ onCommit: (points, options) => {
13872
+ if (!editor.value || `${editor.value.session?.id}:${formatTargetKey2(editor.value.snapshot())}` !== key)
13873
+ return t("disabled.invalidValue");
13874
+ if (points === line.width) return null;
13875
+ const result = editor.value.exec({ type: "setLineWidth", points }, options);
13876
+ return result.ok ? null : translateKeyOrText16(t, result.reason);
13877
+ }
13878
+ },
13879
+ key
13880
+ ),
13881
+ /* @__PURE__ */ jsx40(ToolbarSlot, { slotId: "shape.lineWidth" })
13882
+ ] });
13785
13883
  };
13786
13884
  }
13787
13885
  });
13788
13886
 
13789
13887
  // src/FormatFillTransparency.tsx
13790
- import { defineComponent as defineComponent49, ref as ref35 } from "vue";
13888
+ import { defineComponent as defineComponent49, ref as ref34 } from "vue";
13791
13889
  import {
13792
13890
  formatFillTransparency,
13793
13891
  formatTargetKey as formatTargetKey3,
13794
13892
  translateKeyOrText as translateKeyOrText17
13795
13893
  } from "@pptx-editor.dev/core/editor";
13796
- import { jsx as jsx41, jsxs as jsxs34 } from "vue/jsx-runtime";
13894
+ import { jsx as jsx41, jsxs as jsxs35 } from "vue/jsx-runtime";
13797
13895
  var FormatFillTransparency = defineComponent49({
13798
13896
  name: "FormatFillTransparency",
13799
13897
  setup() {
13800
13898
  const editor = usePptxEditor();
13801
13899
  const snapshot = useEditorState((s) => s);
13802
13900
  const { t } = useTranslation();
13803
- const preview = ref35(null);
13804
- const error = ref35(null);
13901
+ const group = useHistoryGroup({ kind: "range" });
13902
+ const error = ref34(null);
13805
13903
  return () => {
13806
13904
  const field = formatFillTransparency(editor.value);
13807
13905
  if (!field) return null;
13808
13906
  const key = `${editor.value?.session?.id}:${formatTargetKey3(snapshot.value)}`;
13809
- const commit = (percent) => {
13907
+ const commit = (percent, options) => {
13810
13908
  const instance = editor.value;
13811
13909
  if (!instance || `${instance.session?.id}:${formatTargetKey3(instance.snapshot())}` !== key)
13812
13910
  return t("disabled.invalidValue");
13813
13911
  if (percent === field.value) return null;
13814
- const result = instance.exec({
13815
- type: "patchShapeFormat",
13816
- target: field.target,
13817
- patch: field.patch(percent)
13818
- });
13912
+ const result = instance.exec(
13913
+ { type: "patchShapeFormat", target: field.target, patch: field.patch(percent) },
13914
+ options
13915
+ );
13819
13916
  return result.ok ? null : translateKeyOrText17(t, result.reason);
13820
13917
  };
13821
13918
  const label = t(field.labelKey);
13822
- const value = preview.value ?? field.value;
13919
+ const value = field.value;
13823
13920
  const disabled = snapshot.value.mode === "view";
13824
- return /* @__PURE__ */ jsxs34("div", { class: "pptx-format-transparency", "data-format-fill-transparency": "", children: [
13921
+ return /* @__PURE__ */ jsxs35("div", { class: "pptx-format-transparency", "data-format-fill-transparency": "", children: [
13825
13922
  /* @__PURE__ */ jsx41(
13826
13923
  "input",
13827
13924
  {
@@ -13835,15 +13932,9 @@ var FormatFillTransparency = defineComponent49({
13835
13932
  step: 1,
13836
13933
  value,
13837
13934
  disabled,
13935
+ ref: group.ref,
13838
13936
  onInput: (e) => {
13839
- preview.value = Number(e.target.value);
13840
- },
13841
- onChange: (e) => {
13842
- preview.value = null;
13843
- error.value = commit(Number(e.target.value));
13844
- },
13845
- onBlur: () => {
13846
- preview.value = null;
13937
+ error.value = commit(Number(e.target.value), group.options());
13847
13938
  }
13848
13939
  }
13849
13940
  ),
@@ -13857,9 +13948,9 @@ var FormatFillTransparency = defineComponent49({
13857
13948
  min: field.min,
13858
13949
  max: field.max,
13859
13950
  disabled,
13860
- onCommit: (percent) => {
13951
+ onCommit: (percent, options) => {
13861
13952
  error.value = null;
13862
- return commit(percent);
13953
+ return commit(percent, options);
13863
13954
  }
13864
13955
  },
13865
13956
  key
@@ -13871,7 +13962,7 @@ var FormatFillTransparency = defineComponent49({
13871
13962
  });
13872
13963
 
13873
13964
  // src/FormatDetails.tsx
13874
- import { defineComponent as defineComponent51, ref as ref37, nextTick as nextTick7 } from "vue";
13965
+ import { defineComponent as defineComponent51, ref as ref36, nextTick as nextTick7 } from "vue";
13875
13966
  import {
13876
13967
  chromeControlForSlot as chromeControlForSlot6,
13877
13968
  createGradientStopIdentity,
@@ -13883,12 +13974,12 @@ import {
13883
13974
  } from "@pptx-editor.dev/core/editor";
13884
13975
 
13885
13976
  // src/FormatGradientPicker.tsx
13886
- import { defineComponent as defineComponent50, ref as ref36 } from "vue";
13977
+ import { defineComponent as defineComponent50, ref as ref35 } from "vue";
13887
13978
  import {
13888
13979
  gradientPreviewCss,
13889
13980
  gradientPreviewStops
13890
13981
  } from "@pptx-editor.dev/core/editor";
13891
- import { jsx as jsx42, jsxs as jsxs35 } from "vue/jsx-runtime";
13982
+ import { jsx as jsx42, jsxs as jsxs36 } from "vue/jsx-runtime";
13892
13983
  var FormatGradientPicker = defineComponent50({
13893
13984
  name: "FormatGradientPicker",
13894
13985
  props: {
@@ -13899,7 +13990,7 @@ var FormatGradientPicker = defineComponent50({
13899
13990
  setup(props) {
13900
13991
  const { t } = useTranslation();
13901
13992
  const rows = useEditorState((s) => s.themeColors);
13902
- const root = ref36(null);
13993
+ const root = ref35(null);
13903
13994
  return () => {
13904
13995
  const stops = gradientPreviewStops(props.gradient, rows.value);
13905
13996
  const background = gradientPreviewCss(stops);
@@ -13913,7 +14004,7 @@ var FormatGradientPicker = defineComponent50({
13913
14004
  );
13914
14005
  buttons?.[index]?.focus();
13915
14006
  };
13916
- return /* @__PURE__ */ jsxs35("div", { class: "pptx-gradient-picker", ref: root, children: [
14007
+ return /* @__PURE__ */ jsxs36("div", { class: "pptx-gradient-picker", ref: root, children: [
13917
14008
  /* @__PURE__ */ jsx42(
13918
14009
  "div",
13919
14010
  {
@@ -13950,7 +14041,7 @@ var FormatGradientPicker = defineComponent50({
13950
14041
  },
13951
14042
  stop.id
13952
14043
  )) }),
13953
- /* @__PURE__ */ jsxs35("label", { class: "pptx-field", children: [
14044
+ /* @__PURE__ */ jsxs36("label", { class: "pptx-field", children: [
13954
14045
  t("inspector.selectStop"),
13955
14046
  /* @__PURE__ */ jsx42(
13956
14047
  "select",
@@ -13969,7 +14060,7 @@ var FormatGradientPicker = defineComponent50({
13969
14060
  });
13970
14061
 
13971
14062
  // src/FormatDetails.tsx
13972
- import { jsx as jsx43, jsxs as jsxs36 } from "vue/jsx-runtime";
14063
+ import { jsx as jsx43, jsxs as jsxs37 } from "vue/jsx-runtime";
13973
14064
  var FormatDetails = defineComponent51({
13974
14065
  props: { section: { type: String, required: true } },
13975
14066
  setup(props) {
@@ -13977,10 +14068,10 @@ var FormatDetails = defineComponent51({
13977
14068
  const { t } = useTranslation();
13978
14069
  const snapshot = useEditorState((s) => s);
13979
14070
  const offered = useOfferedControl("shape.effects", chromeControlForSlot6("shape.effects"));
13980
- const root = ref37(null);
14071
+ const root = ref36(null);
13981
14072
  const stopIdentity = createGradientStopIdentity();
13982
- const selectedStop = ref37(null);
13983
- const error = ref37(null);
14073
+ const selectedStop = ref36(null);
14074
+ const error = ref36(null);
13984
14075
  return () => {
13985
14076
  const read = editor.value?.shapeFormat();
13986
14077
  if (snapshot.value.selection.kind === "shapes" && snapshot.value.selection.nodeIds.length > 1)
@@ -13996,14 +14087,13 @@ var FormatDetails = defineComponent51({
13996
14087
  (stop) => selectedStop.value !== null && identity(stop.id) === selectedStop.value
13997
14088
  ) ?? detail.gradient?.stops[0];
13998
14089
  const key = `${editor.value?.session?.id}:${formatTargetKey4(snapshot.value)}`;
13999
- const apply = (patch) => {
14090
+ const apply = (patch, options) => {
14000
14091
  if (!editor.value || `${editor.value.session?.id}:${formatTargetKey4(editor.value.snapshot())}` !== key)
14001
14092
  return t("disabled.invalidValue");
14002
- const result = editor.value.exec({
14003
- type: "patchShapeFormat",
14004
- target: detail.target,
14005
- patch
14006
- });
14093
+ const result = editor.value.exec(
14094
+ { type: "patchShapeFormat", target: detail.target, patch },
14095
+ options
14096
+ );
14007
14097
  if (result.ok && patch.kind === "gradient") {
14008
14098
  const next = editor.value.shapeFormat();
14009
14099
  if (next.ok && next.format.gradient && detail.gradient) {
@@ -14015,7 +14105,7 @@ var FormatDetails = defineComponent51({
14015
14105
  const disabled = snapshot.value.mode === "view";
14016
14106
  const effectsAvailable = offered.value?.options?.some((option) => option.value === "reflection.tightTouching") === true;
14017
14107
  const unavailable = (id) => !effectsAvailable && (id === "reflection" || id === "shadow" && detail.shadow?.kind === "inner");
14018
- return /* @__PURE__ */ jsxs36("div", { class: "pptx-format-details", ref: root, children: [
14108
+ return /* @__PURE__ */ jsxs37("div", { class: "pptx-format-details", ref: root, children: [
14019
14109
  props.section === "fill" && detail.gradient && activeStop ? /* @__PURE__ */ jsx43(
14020
14110
  FormatGradientPicker,
14021
14111
  {
@@ -14026,14 +14116,14 @@ var FormatDetails = defineComponent51({
14026
14116
  }
14027
14117
  }
14028
14118
  ) : null,
14029
- formatPropertyGroups(detail, props.section).filter((group) => group.index === void 0 || group.id === activeStop?.id).map((group) => /* @__PURE__ */ jsxs36(
14119
+ formatPropertyGroups(detail, props.section).filter((group) => group.index === void 0 || group.id === activeStop?.id).map((group) => /* @__PURE__ */ jsxs37(
14030
14120
  "fieldset",
14031
14121
  {
14032
14122
  class: "pptx-format-property-group",
14033
14123
  "data-format-stop": group.index,
14034
14124
  children: [
14035
14125
  /* @__PURE__ */ jsx43("legend", { children: t(group.labelKey, group.index ? { index: group.index } : void 0) }),
14036
- /* @__PURE__ */ jsxs36("div", { class: "pptx-format-property-fields", children: [
14126
+ /* @__PURE__ */ jsxs37("div", { class: "pptx-format-property-fields", children: [
14037
14127
  unavailable(group.id) ? /* @__PURE__ */ jsx43("p", { class: "pptx-empty__body", role: "status", children: t("inspector.effectUnavailable") }) : null,
14038
14128
  group.colors.map((field) => {
14039
14129
  const pick = field.color ? colorPickOf3(field.color) : "keep";
@@ -14064,7 +14154,7 @@ var FormatDetails = defineComponent51({
14064
14154
  max: field.max,
14065
14155
  label: t(field.labelKey),
14066
14156
  disabled: disabled || unavailable(group.id),
14067
- onCommit: (value) => apply(field.patch(value))
14157
+ onCommit: (value, options) => apply(field.patch(value), options)
14068
14158
  },
14069
14159
  field.id.split(".").at(-1)
14070
14160
  ))
@@ -14143,7 +14233,7 @@ import {
14143
14233
  formatTargetKey as formatTargetKey5,
14144
14234
  translateKeyOrText as translateKeyOrText19
14145
14235
  } from "@pptx-editor.dev/core/editor";
14146
- import { jsx as jsx44, jsxs as jsxs37 } from "vue/jsx-runtime";
14236
+ import { jsx as jsx44, jsxs as jsxs38 } from "vue/jsx-runtime";
14147
14237
  var EMU_PER_INCH = 914400;
14148
14238
  var inches = (emu) => String(Number((emu / EMU_PER_INCH).toFixed(6)));
14149
14239
  var FormatGeometry = defineComponent52({
@@ -14165,11 +14255,11 @@ var FormatGeometry = defineComponent52({
14165
14255
  return () => {
14166
14256
  const g = geometry.value;
14167
14257
  if (!g)
14168
- return selected.value > 1 ? /* @__PURE__ */ jsxs37("div", { class: "pptx-empty", children: [
14258
+ return selected.value > 1 ? /* @__PURE__ */ jsxs38("div", { class: "pptx-empty", children: [
14169
14259
  /* @__PURE__ */ jsx44("p", { class: "pptx-empty__title", children: t("panel.format.multipleTitle", { count: selected.value }) }),
14170
14260
  /* @__PURE__ */ jsx44("p", { class: "pptx-empty__body", children: platformShortcuts2(t("panel.format.multipleBody")) })
14171
14261
  ] }) : [
14172
- /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
14262
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__section", children: [
14173
14263
  /* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t(panelTitle.value) }),
14174
14264
  background.isAvailable.value ? /* @__PURE__ */ jsx44(
14175
14265
  "button",
@@ -14182,41 +14272,44 @@ var FormatGeometry = defineComponent52({
14182
14272
  }
14183
14273
  ) : null
14184
14274
  ] }),
14185
- /* @__PURE__ */ jsxs37("div", { class: "pptx-empty", children: [
14275
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-empty", children: [
14186
14276
  /* @__PURE__ */ jsx44("p", { class: "pptx-empty__title", children: t("panel.format.emptyTitle") }),
14187
14277
  /* @__PURE__ */ jsx44("p", { class: "pptx-empty__body", children: t(panelBody.value) })
14188
14278
  ] })
14189
14279
  ];
14190
14280
  const target = editor.value ? `${editor.value.session?.id}:${formatTargetKey5(editor.value.snapshot())}` : "";
14191
- const run = (command) => {
14281
+ const run = (command, options) => {
14192
14282
  if (!editor.value || `${editor.value.session?.id}:${formatTargetKey5(editor.value.snapshot())}` !== target)
14193
14283
  return t("disabled.invalidValue");
14194
- const result = editor.value.exec(command);
14284
+ const result = editor.value.exec(command, options);
14195
14285
  return result.ok ? null : translateKeyOrText19(t, result.reason);
14196
14286
  };
14197
- const move = (patch) => {
14287
+ const move = (patch, options) => {
14198
14288
  if (!editor.value || `${editor.value.session?.id}:${formatTargetKey5(editor.value.snapshot())}` !== target)
14199
14289
  return t("disabled.invalidValue");
14200
14290
  const current = editor.value.snapshot().geometry;
14201
14291
  if (!current || current.nodeId !== g.nodeId) return t("disabled.invalidValue");
14202
- return run({
14203
- type: "setTransform",
14204
- nodeId: g.nodeId,
14205
- x: patch.x ?? current.x,
14206
- y: patch.y ?? current.y,
14207
- cx: patch.cx ?? current.cx,
14208
- cy: patch.cy ?? current.cy,
14209
- rot: patch.rot ?? current.rot
14210
- });
14292
+ return run(
14293
+ {
14294
+ type: "setTransform",
14295
+ nodeId: g.nodeId,
14296
+ x: patch.x ?? current.x,
14297
+ y: patch.y ?? current.y,
14298
+ cx: patch.cx ?? current.cx,
14299
+ cy: patch.cy ?? current.cy,
14300
+ rot: patch.rot ?? current.rot
14301
+ },
14302
+ options
14303
+ );
14211
14304
  };
14212
14305
  const inch = (v) => Math.round(v * EMU_PER_INCH);
14213
14306
  const unit = t("panel.format.inchUnit");
14214
14307
  const tableSection = () => {
14215
14308
  const tb = table.value;
14216
14309
  if (!tb) return null;
14217
- return /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
14310
+ return /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__section", children: [
14218
14311
  /* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.table") }),
14219
- /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__grid", children: [
14312
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__grid", children: [
14220
14313
  /* @__PURE__ */ jsx44(
14221
14314
  FormatNumberField,
14222
14315
  {
@@ -14226,7 +14319,7 @@ var FormatGeometry = defineComponent52({
14226
14319
  value: inches(tb.rowHeight),
14227
14320
  unit,
14228
14321
  disabled: readOnly.value,
14229
- onCommit: (v) => run({ type: "setRowHeight", height: inch(v) })
14322
+ onCommit: (v, options) => run({ type: "setRowHeight", height: inch(v) }, options)
14230
14323
  }
14231
14324
  ),
14232
14325
  /* @__PURE__ */ jsx44(
@@ -14238,11 +14331,11 @@ var FormatGeometry = defineComponent52({
14238
14331
  value: inches(tb.columnWidth),
14239
14332
  unit,
14240
14333
  disabled: readOnly.value,
14241
- onCommit: (v) => run({ type: "setColumnWidth", width: inch(v) })
14334
+ onCommit: (v, options) => run({ type: "setColumnWidth", width: inch(v) }, options)
14242
14335
  }
14243
14336
  )
14244
14337
  ] }),
14245
- /* @__PURE__ */ jsx44("div", { class: "pptx-radios", role: "group", "aria-label": t("panel.format.styleOptions"), children: TABLE_OPTION_ROWS.map(({ option, labelKey }) => /* @__PURE__ */ jsxs37("label", { class: "pptx-radio", children: [
14338
+ /* @__PURE__ */ jsx44("div", { class: "pptx-radios", role: "group", "aria-label": t("panel.format.styleOptions"), children: TABLE_OPTION_ROWS.map(({ option, labelKey }) => /* @__PURE__ */ jsxs38("label", { class: "pptx-radio", children: [
14246
14339
  /* @__PURE__ */ jsx44(
14247
14340
  "input",
14248
14341
  {
@@ -14265,23 +14358,24 @@ var FormatGeometry = defineComponent52({
14265
14358
  value: inches(g[key]),
14266
14359
  unit,
14267
14360
  disabled: readOnly.value,
14268
- onCommit: (v) => move(
14269
- key === "cx" || key === "cy" ? formatPanelSize(g, key, inch(v)) : { [key]: inch(v) }
14361
+ onCommit: (v, options) => move(
14362
+ key === "cx" || key === "cy" ? formatPanelSize(g, key, inch(v)) : { [key]: inch(v) },
14363
+ options
14270
14364
  )
14271
14365
  }
14272
14366
  );
14273
14367
  return [
14274
- /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
14368
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__section", children: [
14275
14369
  /* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.element") }),
14276
14370
  /* @__PURE__ */ jsx44("span", { class: "pptx-chip", children: t(elementKindLabelKey(g, table.value, { chart: chart.value, diagram: diagram.value })) })
14277
14371
  ] }),
14278
- /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
14372
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__section", children: [
14279
14373
  /* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.size") }),
14280
- /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__grid", children: [
14374
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__grid", children: [
14281
14375
  field("cx", "panel.format.width"),
14282
14376
  field("cy", "panel.format.height")
14283
14377
  ] }),
14284
- /* @__PURE__ */ jsxs37("label", { class: "pptx-radio", children: [
14378
+ /* @__PURE__ */ jsxs38("label", { class: "pptx-radio", children: [
14285
14379
  /* @__PURE__ */ jsx44(
14286
14380
  "input",
14287
14381
  {
@@ -14297,14 +14391,14 @@ var FormatGeometry = defineComponent52({
14297
14391
  t("imageProperties.lockAspect")
14298
14392
  ] })
14299
14393
  ] }),
14300
- /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
14394
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__section", children: [
14301
14395
  /* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.position") }),
14302
- /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__grid", children: [
14396
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__grid", children: [
14303
14397
  field("x", "panel.format.x"),
14304
14398
  field("y", "panel.format.y")
14305
14399
  ] })
14306
14400
  ] }),
14307
- elementRotates(g, table.value) ? /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
14401
+ elementRotates(g, table.value) ? /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__section", children: [
14308
14402
  /* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.rotation") }),
14309
14403
  /* @__PURE__ */ jsx44("div", { class: "pptx-panel__grid", children: /* @__PURE__ */ jsx44(
14310
14404
  FormatNumberField,
@@ -14316,14 +14410,14 @@ var FormatGeometry = defineComponent52({
14316
14410
  value: String(Math.round(g.rot * 10) / 10),
14317
14411
  unit: "\xB0",
14318
14412
  disabled: readOnly.value,
14319
- onCommit: (v) => move({ rot: v })
14413
+ onCommit: (v, options) => move({ rot: v }, options)
14320
14414
  }
14321
14415
  ) })
14322
14416
  ] }) : null,
14323
14417
  tableSection(),
14324
- g.textFitting ? /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
14418
+ g.textFitting ? /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__section", children: [
14325
14419
  /* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.textFitting") }),
14326
- /* @__PURE__ */ jsx44("div", { class: "pptx-radios", role: "radiogroup", "aria-label": t("panel.format.textFitting"), children: ["none", "shrink", "shape"].map((mode) => /* @__PURE__ */ jsxs37("label", { class: "pptx-radio", children: [
14420
+ /* @__PURE__ */ jsx44("div", { class: "pptx-radios", role: "radiogroup", "aria-label": t("panel.format.textFitting"), children: ["none", "shrink", "shape"].map((mode) => /* @__PURE__ */ jsxs38("label", { class: "pptx-radio", children: [
14327
14421
  /* @__PURE__ */ jsx44(
14328
14422
  "input",
14329
14423
  {
@@ -14343,7 +14437,7 @@ var FormatGeometry = defineComponent52({
14343
14437
  });
14344
14438
 
14345
14439
  // src/FormatPanel.tsx
14346
- import { jsx as jsx45, jsxs as jsxs38 } from "vue/jsx-runtime";
14440
+ import { jsx as jsx45, jsxs as jsxs39 } from "vue/jsx-runtime";
14347
14441
  var formatSectionProps = {
14348
14442
  section: { type: Object, required: true }
14349
14443
  };
@@ -14355,8 +14449,8 @@ var FormatSection = defineComponent53({
14355
14449
  const editor = usePptxEditor();
14356
14450
  const background = useEditorDialog("background");
14357
14451
  const snapshot = useEditorState((s) => s);
14358
- const expansion = ref38(0);
14359
- watch33(
14452
+ const expansion = ref37(0);
14453
+ watch32(
14360
14454
  editor,
14361
14455
  (instance, _old, onCleanup) => {
14362
14456
  if (instance)
@@ -14373,7 +14467,7 @@ var FormatSection = defineComponent53({
14373
14467
  const section = props.section;
14374
14468
  const category = formatSelectionCategory(snapshot.value);
14375
14469
  const expanded = formatSectionOpen(editor.value, category, section.id);
14376
- return /* @__PURE__ */ jsxs38("details", { class: "pptx-format-disclosure", open: expanded, children: [
14470
+ return /* @__PURE__ */ jsxs39("details", { class: "pptx-format-disclosure", open: expanded, children: [
14377
14471
  /* @__PURE__ */ jsx45(
14378
14472
  "summary",
14379
14473
  {
@@ -14386,13 +14480,13 @@ var FormatSection = defineComponent53({
14386
14480
  children: t(section.labelKey)
14387
14481
  }
14388
14482
  ),
14389
- /* @__PURE__ */ jsxs38("div", { class: "pptx-format-section-body", children: [
14483
+ /* @__PURE__ */ jsxs39("div", { class: "pptx-format-section-body", children: [
14390
14484
  section.id === "geometry" ? /* @__PURE__ */ jsx45(FormatGeometry, {}) : null,
14391
14485
  section.id === "fill" || section.id === "effects" ? /* @__PURE__ */ jsx45(FormatDetails, { section: section.id }) : null,
14392
14486
  section.id === "geometry" ? null : section.id === "chart" ? /* @__PURE__ */ jsx45(ChartDataPane, {}) : section.id === "diagram" ? /* @__PURE__ */ jsx45(DiagramTextPane, {}) : /* @__PURE__ */ jsx45("div", { class: "pptx-format-controls", children: section.slots.filter((slot) => slot !== "slide.background" || background.isAvailable.value).flatMap((slot) => [
14393
- /* @__PURE__ */ jsxs38("div", { class: "pptx-format-control", "data-format-slot": slot, children: [
14487
+ /* @__PURE__ */ jsxs39("div", { class: "pptx-format-control", "data-format-slot": slot, children: [
14394
14488
  slot !== "shape.lineWidth" ? /* @__PURE__ */ jsx45("span", { class: "pptx-format-control__label", children: t(chromeControlForSlot7(slot).labelKey) }) : null,
14395
- formatControlMixed(editor.value, slot) ? /* @__PURE__ */ jsx45("span", { class: "pptx-format-mixed", children: t("inspector.mixed") }) : null,
14489
+ slot !== "shape.lineWidth" && formatControlMixed(editor.value, slot) ? /* @__PURE__ */ jsx45("span", { class: "pptx-format-mixed", children: t("inspector.mixed") }) : null,
14396
14490
  slot === "shape.lineWidth" ? /* @__PURE__ */ jsx45(FormatLineWidth, {}) : /* @__PURE__ */ jsx45(ToolbarSlot, { slotId: slot })
14397
14491
  ] }, slot),
14398
14492
  slot === "shape.fill" ? /* @__PURE__ */ jsx45(FormatFillTransparency, {}, "fill.transparency") : null
@@ -14414,8 +14508,8 @@ var FormatPanel = defineComponent53({
14414
14508
  const editor = usePptxEditor();
14415
14509
  const snapshot = useEditorState((s) => s);
14416
14510
  const { t } = useTranslation();
14417
- const root = ref38(null);
14418
- watch33(
14511
+ const root = ref37(null);
14512
+ watch32(
14419
14513
  () => formatSelectionCategory(snapshot.value),
14420
14514
  (category, previous) => {
14421
14515
  if (category !== previous) {
@@ -14425,7 +14519,7 @@ var FormatPanel = defineComponent53({
14425
14519
  },
14426
14520
  { flush: "post" }
14427
14521
  );
14428
- return () => /* @__PURE__ */ jsxs38("div", { ref: root, class: ["pptx-format-panel", props.className], children: [
14522
+ return () => /* @__PURE__ */ jsxs39("div", { ref: root, class: ["pptx-format-panel", props.className], children: [
14429
14523
  snapshot.value.selection.kind === "shapes" && snapshot.value.selection.nodeIds.length > 1 ? /* @__PURE__ */ jsx45("p", { class: "pptx-panel__title", children: t("panel.format.multipleTitle", { count: snapshot.value.selection.nodeIds.length }) }) : snapshot.value.geometry ? /* @__PURE__ */ jsx45("p", { class: "pptx-panel__title", children: snapshot.value.geometry.name }) : null,
14430
14524
  /* @__PURE__ */ jsx45("div", { class: "pptx-format-sections", children: formatSectionsOf(snapshot.value, props.sections).map((section) => /* @__PURE__ */ jsx45("div", { "data-format-section": section.id, children: slots[section.id] ? slots[section.id]() : /* @__PURE__ */ jsx45(
14431
14525
  FormatSection,
@@ -14440,7 +14534,7 @@ var FormatPanel = defineComponent53({
14440
14534
  });
14441
14535
 
14442
14536
  // src/SidePanel.tsx
14443
- import { jsx as jsx46, jsxs as jsxs39 } from "vue/jsx-runtime";
14537
+ import { jsx as jsx46, jsxs as jsxs40 } from "vue/jsx-runtime";
14444
14538
  var sidePanelProps = {
14445
14539
  /** The panel's width in CSS pixels. */
14446
14540
  paneWidth: { type: Number, default: void 0 },
@@ -14459,7 +14553,7 @@ function packagedPane(tab, t) {
14459
14553
  if (tab === "diagram") return /* @__PURE__ */ jsx46(DiagramTextPane, {});
14460
14554
  if (tab === "selection") return /* @__PURE__ */ jsx46(PptxEditorSelectionPane, {});
14461
14555
  if (tab === "animations") return /* @__PURE__ */ jsx46(AnimationsPane, {});
14462
- return /* @__PURE__ */ jsxs39("div", { class: "pptx-empty", children: [
14556
+ return /* @__PURE__ */ jsxs40("div", { class: "pptx-empty", children: [
14463
14557
  /* @__PURE__ */ jsx46("p", { class: "pptx-empty__title", children: t("panel.comments.emptyTitle") }),
14464
14558
  /* @__PURE__ */ jsx46("p", { class: "pptx-empty__body", children: t("panel.comments.emptyBody") })
14465
14559
  ] });
@@ -14479,7 +14573,7 @@ var PptxEditorSidePanel = defineComponent54({
14479
14573
  setup(props, { attrs, emit, slots }) {
14480
14574
  const { t } = useTranslation();
14481
14575
  const editor = usePptxEditor();
14482
- const own = ref39(props.tab ?? "format");
14576
+ const own = ref38(props.tab ?? "format");
14483
14577
  const tab = computed21(() => props.tab ?? own.value);
14484
14578
  const chartSelected = useEditorState((s) => !!s.chart);
14485
14579
  const diagramSelected = useEditorState((s) => !!s.diagram);
@@ -14491,7 +14585,7 @@ var PptxEditorSidePanel = defineComponent54({
14491
14585
  emit("tabChange", next);
14492
14586
  emit("update:tab", next);
14493
14587
  };
14494
- const root = ref39(null);
14588
+ const root = ref38(null);
14495
14589
  const focusTab = (pane) => void nextTick8(() => {
14496
14590
  const body = root.value?.querySelector(".pptx-panel__body");
14497
14591
  if (body?.contains(body.ownerDocument.activeElement)) return;
@@ -14500,7 +14594,7 @@ var PptxEditorSidePanel = defineComponent54({
14500
14594
  );
14501
14595
  (current ?? root.value?.querySelector(`[data-tab="${pane}"]`))?.focus();
14502
14596
  });
14503
- watch34(
14597
+ watch33(
14504
14598
  editor,
14505
14599
  (e, _old, onCleanup) => {
14506
14600
  if (!e) return;
@@ -14523,7 +14617,7 @@ var PptxEditorSidePanel = defineComponent54({
14523
14617
  return () => {
14524
14618
  const { class: hostClass, style: hostStyle, ...rest } = attrs;
14525
14619
  const style = [hostStyle, props.style];
14526
- return /* @__PURE__ */ jsxs39(
14620
+ return /* @__PURE__ */ jsxs40(
14527
14621
  "aside",
14528
14622
  {
14529
14623
  ref: root,
@@ -14533,7 +14627,7 @@ var PptxEditorSidePanel = defineComponent54({
14533
14627
  style: props.paneWidth === void 0 ? style : [{ width: `${props.paneWidth}px` }, ...style],
14534
14628
  onMousedown: keepFocus,
14535
14629
  children: [
14536
- /* @__PURE__ */ jsxs39("div", { class: "pptx-panel__head", children: [
14630
+ /* @__PURE__ */ jsxs40("div", { class: "pptx-panel__head", children: [
14537
14631
  /* @__PURE__ */ jsx46(
14538
14632
  "div",
14539
14633
  {
@@ -14546,7 +14640,7 @@ var PptxEditorSidePanel = defineComponent54({
14546
14640
  setTab(next);
14547
14641
  e.currentTarget.querySelector(`[data-tab="${next}"]`)?.focus();
14548
14642
  },
14549
- children: tabs.value.map((id) => /* @__PURE__ */ jsxs39(
14643
+ children: tabs.value.map((id) => /* @__PURE__ */ jsxs40(
14550
14644
  "button",
14551
14645
  {
14552
14646
  type: "button",
@@ -14586,7 +14680,7 @@ var PptxEditorSidePanel = defineComponent54({
14586
14680
  });
14587
14681
 
14588
14682
  // src/panes.tsx
14589
- import { jsx as jsx47, jsxs as jsxs40 } from "vue/jsx-runtime";
14683
+ import { jsx as jsx47, jsxs as jsxs41 } from "vue/jsx-runtime";
14590
14684
  var sameSlides2 = (a, b) => a.length === b.length && a.every((s, i) => s === b[i]);
14591
14685
  var sameIndices2 = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
14592
14686
  var clickMode = slideClickMode;
@@ -14598,15 +14692,15 @@ var Thumbnail = defineComponent55({
14598
14692
  },
14599
14693
  setup(props) {
14600
14694
  const editor = usePptxEditor();
14601
- const box = ref40(null);
14695
+ const box = ref39(null);
14602
14696
  let dispose = null;
14603
14697
  const paint = () => {
14604
14698
  dispose?.();
14605
14699
  dispose = editor.value && box.value ? editor.value.renderThumbnail(props.slide.index, box.value, { defer: true }) : null;
14606
14700
  };
14607
14701
  onMounted19(paint);
14608
- watch35(() => [editor.value, props.slide], paint, { flush: "post" });
14609
- onBeforeUnmount11(() => {
14702
+ watch34(() => [editor.value, props.slide], paint, { flush: "post" });
14703
+ onBeforeUnmount12(() => {
14610
14704
  dispose?.();
14611
14705
  dispose = null;
14612
14706
  });
@@ -14642,7 +14736,7 @@ var RailItem = defineComponent55({
14642
14736
  setup(props) {
14643
14737
  return () => {
14644
14738
  const { slide: s, on } = props;
14645
- return /* @__PURE__ */ jsxs40(
14739
+ return /* @__PURE__ */ jsxs41(
14646
14740
  "li",
14647
14741
  {
14648
14742
  class: "pptx-rail__item",
@@ -14674,7 +14768,7 @@ var RailItem = defineComponent55({
14674
14768
  });
14675
14769
  function useFocusFollowsCurrent(list, item, watched) {
14676
14770
  let focused = null;
14677
- watch35(
14771
+ watch34(
14678
14772
  () => watched().join("|"),
14679
14773
  () => followCurrentSlide(list.value, item, focused),
14680
14774
  { flush: "post" }
@@ -14730,7 +14824,7 @@ function restAttrs(attrs) {
14730
14824
  return rest;
14731
14825
  }
14732
14826
  function usePaneOpen(props, emit) {
14733
- const own = ref40(props.defaultOpen ?? true);
14827
+ const own = ref39(props.defaultOpen ?? true);
14734
14828
  return {
14735
14829
  open: computed22(() => props.open ?? own.value),
14736
14830
  setOpen: (next) => {
@@ -14746,7 +14840,7 @@ var SlideRailRoot = defineComponent55({
14746
14840
  emits: { "update:open": (_open) => true },
14747
14841
  setup(props, { attrs, emit, slots }) {
14748
14842
  const pane = usePaneOpen(props, emit);
14749
- const rail = ref40(null);
14843
+ const rail = ref39(null);
14750
14844
  const listId = useId21();
14751
14845
  let focusToggle = false;
14752
14846
  const setOpen = (next) => {
@@ -14763,24 +14857,24 @@ var SlideRailRoot = defineComponent55({
14763
14857
  const selected = useEditorState((s) => s.selectedSlides, sameIndices2);
14764
14858
  const ratio = useEditorState((s) => s.slideHeight / s.slideWidth);
14765
14859
  const readOnly = useEditorState((s) => s.mode === "view");
14766
- const list = ref40(null);
14860
+ const list = ref39(null);
14767
14861
  const count = () => slides.value.length;
14768
14862
  const opening = useEditorState((s) => (s.pendingSlides ?? 0) > 0);
14769
14863
  const loading = useEditorState((s) => s.isOpening === true);
14770
- const grown = ref40(0);
14864
+ const grown = ref39(0);
14771
14865
  const mount = createProgressiveMount(() => grown.value += 1);
14772
14866
  onMounted19(() => mount.follow(count()));
14773
14867
  onUpdated4(() => mount.follow(count()));
14774
14868
  onUnmounted4(() => mount.dispose());
14775
- const menu = shallowRef28(null);
14776
- const gallery = shallowRef28(null);
14777
- const actions = ref40(null);
14869
+ const menu = shallowRef29(null);
14870
+ const gallery = shallowRef29(null);
14871
+ const actions = ref39(null);
14778
14872
  const sections = useSlideSections();
14779
14873
  const grouped = computed22(() => groupSlideSections2(sections.value, count()));
14780
14874
  const orientation = () => resolveRailOrientation2(props.orientation, "PptxEditorSlideRail");
14781
14875
  const drag = useSlideDrag(() => railDragAxis(orientation()), selected, readOnly, grouped);
14782
- const folded = shallowRef28(false);
14783
- watch35(
14876
+ const folded = shallowRef29(false);
14877
+ watch34(
14784
14878
  () => [rail.value, orientation(), pane.open.value],
14785
14879
  ([el, axis], _old, onCleanup) => onCleanup(
14786
14880
  watchRailFold(el, axis, (next) => {
@@ -14789,14 +14883,14 @@ var SlideRailRoot = defineComponent55({
14789
14883
  ),
14790
14884
  { flush: "post", immediate: true }
14791
14885
  );
14792
- const rightToLeft = shallowRef28(false);
14886
+ const rightToLeft = shallowRef29(false);
14793
14887
  const readDirection = () => {
14794
14888
  rightToLeft.value = railRightToLeft2(rail.value);
14795
14889
  };
14796
14890
  onMounted19(readDirection);
14797
14891
  onUpdated4(readDirection);
14798
14892
  const collapsed = useCollapsedSections();
14799
- const renaming = ref40(null);
14893
+ const renaming = ref39(null);
14800
14894
  useOpenCurrentSection(grouped);
14801
14895
  useSectionRenameRequests(
14802
14896
  (id) => {
@@ -14826,12 +14920,12 @@ var SlideRailRoot = defineComponent55({
14826
14920
  count(),
14827
14921
  pane.open.value
14828
14922
  ]);
14829
- watch35(
14923
+ watch34(
14830
14924
  list,
14831
14925
  (el, _old, onCleanup) => onCleanup(keepCurrentSlideInView2(el, ".pptx-rail__item")),
14832
14926
  { flush: "post" }
14833
14927
  );
14834
- watch35(
14928
+ watch34(
14835
14929
  () => pane.open.value,
14836
14930
  (open) => {
14837
14931
  const active = document.activeElement;
@@ -14975,7 +15069,7 @@ var SlideRailRoot = defineComponent55({
14975
15069
  itemLimit = inView ? inView.limit : mounted;
14976
15070
  isSelected = new Set(selected.value);
14977
15071
  labels = slideItemLabels(t);
14978
- return /* @__PURE__ */ jsxs40(
15072
+ return /* @__PURE__ */ jsxs41(
14979
15073
  "nav",
14980
15074
  {
14981
15075
  ...restAttrs(attrs),
@@ -15103,9 +15197,9 @@ var PptxEditorZoomPill = defineComponent55({
15103
15197
  const fit = useEditorState((s) => s.fitZoom);
15104
15198
  const off = useEditorState((s) => s.presentationView === "slideSorter");
15105
15199
  const reason = () => off.value ? t("disabled.sorterZoom") : null;
15106
- const anchor = ref40(null);
15107
- const open = ref40(false);
15108
- watch35(off, (now) => {
15200
+ const anchor = ref39(null);
15201
+ const open = ref39(false);
15202
+ watch34(off, (now) => {
15109
15203
  if (now) open.value = false;
15110
15204
  });
15111
15205
  const step = (dir) => {
@@ -15123,7 +15217,7 @@ var PptxEditorZoomPill = defineComponent55({
15123
15217
  };
15124
15218
  return () => {
15125
15219
  const levelLabel = off.value ? t("zoom.ariaLabel") : t("zoom.levelAriaLabel", { percent: Math.round(zoom.value * 100) });
15126
- return /* @__PURE__ */ jsxs40(
15220
+ return /* @__PURE__ */ jsxs41(
15127
15221
  "div",
15128
15222
  {
15129
15223
  class: ["pptx-zoom", props.className],
@@ -15141,7 +15235,7 @@ var PptxEditorZoomPill = defineComponent55({
15141
15235
  disabledReason: reason() ?? limit(-1)
15142
15236
  }
15143
15237
  ),
15144
- /* @__PURE__ */ jsxs40(
15238
+ /* @__PURE__ */ jsxs41(
15145
15239
  "button",
15146
15240
  {
15147
15241
  ref: anchor,
@@ -15206,10 +15300,10 @@ var PptxEditorZoomPill = defineComponent55({
15206
15300
  import {
15207
15301
  computed as computed23,
15208
15302
  defineComponent as defineComponent56,
15209
- onBeforeUnmount as onBeforeUnmount12,
15303
+ onBeforeUnmount as onBeforeUnmount13,
15210
15304
  onScopeDispose as onScopeDispose8,
15211
- shallowRef as shallowRef29,
15212
- watch as watch36,
15305
+ shallowRef as shallowRef30,
15306
+ watch as watch35,
15213
15307
  watchEffect as watchEffect2
15214
15308
  } from "vue";
15215
15309
  import {
@@ -15223,7 +15317,7 @@ import {
15223
15317
  REMOVAL_NOTICE_MS,
15224
15318
  removalNoticeShows
15225
15319
  } from "@pptx-editor.dev/core/editor";
15226
- import { jsx as jsx48, jsxs as jsxs41 } from "vue/jsx-runtime";
15320
+ import { jsx as jsx48, jsxs as jsxs42 } from "vue/jsx-runtime";
15227
15321
  function rejectionMessage(t, rejection) {
15228
15322
  return editRejectionMessage(t, rejection);
15229
15323
  }
@@ -15241,9 +15335,9 @@ var PptxEditorEditNotice = defineComponent56({
15241
15335
  const { t } = useChromeTranslateScope(() => props.t);
15242
15336
  const rejection = useEditorState((s) => s.lastRejection ?? null);
15243
15337
  const removal = useEditorState((s) => s.lastRemoval ?? null);
15244
- const dismissed = shallowRef29(null);
15338
+ const dismissed = shallowRef30(null);
15245
15339
  const linkStore = injectHyperlinkPopupStore();
15246
- const linkPopup = shallowRef29(linkStore?.getState() ?? null);
15340
+ const linkPopup = shallowRef30(linkStore?.getState() ?? null);
15247
15341
  if (linkStore)
15248
15342
  onScopeDispose8(
15249
15343
  linkStore.subscribe(() => {
@@ -15254,16 +15348,16 @@ var PptxEditorEditNotice = defineComponent56({
15254
15348
  const covered = computed23(
15255
15349
  () => linkEntry() !== false && linkPopupShowsRejection(linkPopup.value, rejection.value) || fieldShowsRejection(rejection.value)
15256
15350
  );
15257
- watch36(
15351
+ watch35(
15258
15352
  covered,
15259
15353
  (now) => {
15260
15354
  if (now) dismissed.value = rejection.value;
15261
15355
  },
15262
15356
  { immediate: true }
15263
15357
  );
15264
- const closed = shallowRef29(null);
15265
- const held = shallowRef29(false);
15266
- watch36(
15358
+ const closed = shallowRef30(null);
15359
+ const held = shallowRef30(false);
15360
+ watch35(
15267
15361
  () => removal.value?.serial,
15268
15362
  () => {
15269
15363
  held.value = false;
@@ -15279,12 +15373,12 @@ var PptxEditorEditNotice = defineComponent56({
15279
15373
  }, REMOVAL_NOTICE_MS);
15280
15374
  onCleanup(() => clearTimeout(timer));
15281
15375
  });
15282
- onBeforeUnmount12(() => clearTimeout(timer));
15376
+ onBeforeUnmount13(() => clearTimeout(timer));
15283
15377
  return () => {
15284
15378
  const classes = ["pptx-edit-notice", attrs.class, props.className];
15285
15379
  const refused = rejection.value;
15286
15380
  if (!covered.value && editNoticeShows(refused, dismissed.value))
15287
- return /* @__PURE__ */ jsxs41(
15381
+ return /* @__PURE__ */ jsxs42(
15288
15382
  "div",
15289
15383
  {
15290
15384
  ...attrs,
@@ -15309,7 +15403,7 @@ var PptxEditorEditNotice = defineComponent56({
15309
15403
  );
15310
15404
  const removed = removal.value;
15311
15405
  if (!removalNoticeShows(removed, closed.value)) return null;
15312
- return /* @__PURE__ */ jsxs41(
15406
+ return /* @__PURE__ */ jsxs42(
15313
15407
  "div",
15314
15408
  {
15315
15409
  ...attrs,
@@ -15356,7 +15450,7 @@ var PptxEditorEditNotice = defineComponent56({
15356
15450
  });
15357
15451
 
15358
15452
  // src/SlideSorter.tsx
15359
- import { jsx as jsx49, jsxs as jsxs42 } from "vue/jsx-runtime";
15453
+ import { jsx as jsx49, jsxs as jsxs43 } from "vue/jsx-runtime";
15360
15454
  var sameList = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
15361
15455
  var slideSorterProps = {
15362
15456
  /** A class name added to the sorter, as React's `className`. A host `class` also works. */
@@ -15379,10 +15473,10 @@ var PptxEditorSlideSorter = defineComponent57({
15379
15473
  const collapsed = useCollapsedSections();
15380
15474
  useOpenCurrentSection(grouped);
15381
15475
  useSorterRegistration();
15382
- const list = ref41(null);
15476
+ const list = ref40(null);
15383
15477
  const drag = useSlideDrag("x", selected, readOnly, grouped);
15384
- const menu = shallowRef30(null);
15385
- const renaming = ref41(null);
15478
+ const menu = shallowRef31(null);
15479
+ const renaming = ref40(null);
15386
15480
  useSectionRenameRequests((id) => {
15387
15481
  renaming.value = id;
15388
15482
  });
@@ -15393,7 +15487,7 @@ var PptxEditorSlideSorter = defineComponent57({
15393
15487
  onMounted20(() => {
15394
15488
  if (list.value) stopFocus = focusSorterOnShow(list.value);
15395
15489
  });
15396
- onBeforeUnmount13(() => {
15490
+ onBeforeUnmount14(() => {
15397
15491
  stopFocus();
15398
15492
  if (list.value) refocusAfterSorterHides(list.value, editor.value);
15399
15493
  });
@@ -15431,7 +15525,7 @@ var PptxEditorSlideSorter = defineComponent57({
15431
15525
  const groups = grouped.value;
15432
15526
  const own = sectionOfSlide2(groups, current.value);
15433
15527
  const shut = !!own && collapsed.value.includes(own.id);
15434
- const item = (s) => /* @__PURE__ */ jsxs42(
15528
+ const item = (s) => /* @__PURE__ */ jsxs43(
15435
15529
  "li",
15436
15530
  {
15437
15531
  class: "pptx-sorter__item",
@@ -15464,7 +15558,7 @@ var PptxEditorSlideSorter = defineComponent57({
15464
15558
  },
15465
15559
  s.id
15466
15560
  );
15467
- return /* @__PURE__ */ jsxs42("section", { class: ["pptx-sorter", props.className], "aria-label": t("sorter.ariaLabel"), children: [
15561
+ return /* @__PURE__ */ jsxs43("section", { class: ["pptx-sorter", props.className], "aria-label": t("sorter.ariaLabel"), children: [
15468
15562
  /* @__PURE__ */ jsx49(
15469
15563
  "ol",
15470
15564
  {
@@ -15533,9 +15627,7 @@ var ViewSwitch = defineComponent57({
15533
15627
  const cmd = useEditorCommand("view.presentationView");
15534
15628
  const options = STATUS_BAR_VIEW_OPTIONS;
15535
15629
  const off = computed24(() => !cmd.isEnabled.value);
15536
- const reason = computed24(
15537
- () => cmd.disabledReason.value ? translateKeyOrText20(t, cmd.disabledReason.value) : null
15538
- );
15630
+ const reason = cmd.disabledReason;
15539
15631
  const offAttrs = useAriaDisabled(off, reason);
15540
15632
  const pick = (e, step) => {
15541
15633
  if (off.value) return;
@@ -15554,7 +15646,7 @@ var ViewSwitch = defineComponent57({
15554
15646
  ArrowRight: 1,
15555
15647
  ArrowDown: 1
15556
15648
  };
15557
- return () => /* @__PURE__ */ jsxs42(
15649
+ return () => /* @__PURE__ */ jsxs43(
15558
15650
  "div",
15559
15651
  {
15560
15652
  class: "pptx-zoom pptx-view-switch",
@@ -15604,8 +15696,8 @@ var DefaultWorkspace = defineComponent57({
15604
15696
  setup(_props, { slots }) {
15605
15697
  const editor = usePptxEditor();
15606
15698
  const view = useEditorState((s) => s.presentationView ?? "normal");
15607
- const box = ref41(null);
15608
- watch37(
15699
+ const box = ref40(null);
15700
+ watch36(
15609
15701
  view,
15610
15702
  () => {
15611
15703
  const active = box.value?.ownerDocument.activeElement;
@@ -15619,17 +15711,17 @@ var DefaultWorkspace = defineComponent57({
15619
15711
  if (box.value) inset = trackNotesInset(box.value);
15620
15712
  });
15621
15713
  onUpdated5(() => inset?.refresh());
15622
- onBeforeUnmount13(() => {
15714
+ onBeforeUnmount14(() => {
15623
15715
  inset?.dispose();
15624
15716
  inset = null;
15625
15717
  });
15626
- return () => /* @__PURE__ */ jsxs42("div", { ref: box, class: "pptx-default__views", children: [
15627
- view.value === "slideSorter" ? /* @__PURE__ */ jsx49("div", { class: "pptx-default__workspace", children: /* @__PURE__ */ jsxs42("div", { class: "pptx-default__main", children: [
15718
+ return () => /* @__PURE__ */ jsxs43("div", { ref: box, class: "pptx-default__views", children: [
15719
+ view.value === "slideSorter" ? /* @__PURE__ */ jsx49("div", { class: "pptx-default__workspace", children: /* @__PURE__ */ jsxs43("div", { class: "pptx-default__main", children: [
15628
15720
  /* @__PURE__ */ jsx49(PptxEditorSlideSorter, {}),
15629
15721
  /* @__PURE__ */ jsx49(PptxEditorEditNotice, {})
15630
15722
  ] }) }) : slots.normal?.(),
15631
15723
  slots.overlay?.(),
15632
- slots.status ? slots.status() : /* @__PURE__ */ jsxs42("div", { class: "pptx-statusbar", children: [
15724
+ slots.status ? slots.status() : /* @__PURE__ */ jsxs43("div", { class: "pptx-statusbar", children: [
15633
15725
  /* @__PURE__ */ jsx49(ReadOnlyBadge, {}),
15634
15726
  /* @__PURE__ */ jsx49(ViewSwitch, {}),
15635
15727
  /* @__PURE__ */ jsx49(PptxEditorZoomPill, {})
@@ -15642,7 +15734,7 @@ var SlideSorterWatch = defineComponent57({
15642
15734
  setup() {
15643
15735
  const editor = usePptxEditor();
15644
15736
  const sorter = useEditorState((s) => s.presentationView === "slideSorter");
15645
- watch37(
15737
+ watch36(
15646
15738
  [sorter, editor],
15647
15739
  ([on, ed]) => {
15648
15740
  if (on && ed && !slideSorterMounted(ed)) warnSlideSorterUnmounted();
@@ -15654,23 +15746,23 @@ var SlideSorterWatch = defineComponent57({
15654
15746
  });
15655
15747
 
15656
15748
  // src/ChromeTooltip.tsx
15657
- import { Teleport as Teleport4, defineComponent as defineComponent58, onMounted as onMounted21, onUnmounted as onUnmounted5, ref as ref42, shallowRef as shallowRef31, watch as watch38 } from "vue";
15749
+ import { Teleport as Teleport4, defineComponent as defineComponent58, onMounted as onMounted21, onUnmounted as onUnmounted5, ref as ref41, shallowRef as shallowRef32, watch as watch37 } from "vue";
15658
15750
  import {
15659
15751
  listenChromeTooltips,
15660
15752
  positionChromeTooltip
15661
15753
  } from "@pptx-editor.dev/core/editor";
15662
- import { jsx as jsx50, jsxs as jsxs43 } from "vue/jsx-runtime";
15754
+ import { jsx as jsx50, jsxs as jsxs44 } from "vue/jsx-runtime";
15663
15755
  var ChromeTooltip = defineComponent58({
15664
15756
  name: "ChromeTooltip",
15665
15757
  setup() {
15666
- const state = shallowRef31(null);
15667
- const bubble = ref42(null);
15758
+ const state = shallowRef32(null);
15759
+ const bubble = ref41(null);
15668
15760
  let stop = null;
15669
15761
  onMounted21(() => {
15670
15762
  stop = listenChromeTooltips(document, (next) => state.value = next);
15671
15763
  });
15672
15764
  onUnmounted5(() => stop?.());
15673
- watch38(
15765
+ watch37(
15674
15766
  [state, bubble],
15675
15767
  ([next, el]) => {
15676
15768
  if (next && el) positionChromeTooltip(el, next.target);
@@ -15680,7 +15772,7 @@ var ChromeTooltip = defineComponent58({
15680
15772
  return () => {
15681
15773
  const s = state.value;
15682
15774
  if (!s) return null;
15683
- return /* @__PURE__ */ jsx50(Teleport4, { to: s.scope, children: /* @__PURE__ */ jsxs43(
15775
+ return /* @__PURE__ */ jsx50(Teleport4, { to: s.scope, children: /* @__PURE__ */ jsxs44(
15684
15776
  "div",
15685
15777
  {
15686
15778
  ref: bubble,
@@ -15771,12 +15863,12 @@ var PptxEditorRoot = defineComponent59({
15771
15863
  let createdFonts;
15772
15864
  let createdFamilies;
15773
15865
  let createdModules;
15774
- const editor = shallowRef32(null);
15775
- const t = shallowRef32(createTranslator2(props.locale));
15866
+ const editor = shallowRef33(null);
15867
+ const t = shallowRef33(createTranslator2(props.locale));
15776
15868
  providePptxEditor(editor);
15777
15869
  provide18(pptxTranslationKey, t);
15778
15870
  expose(createEditorRefApi(() => editor.value));
15779
- watch39(
15871
+ watch38(
15780
15872
  () => localeContentKey(props.locale),
15781
15873
  () => {
15782
15874
  t.value = createTranslator2(props.locale);
@@ -15794,7 +15886,7 @@ var PptxEditorRoot = defineComponent59({
15794
15886
  ...props.readClipboardDrawing ? { readClipboardDrawing: props.readClipboardDrawing } : {},
15795
15887
  ...props.author ? { author: props.author } : {},
15796
15888
  onFontError,
15797
- translate: (key, params) => translateKeyOrText21(t.value, key, params)
15889
+ translate: (key, params) => translateKeyOrText20(t.value, key, params)
15798
15890
  });
15799
15891
  createdFonts = props.fonts;
15800
15892
  createdFamilies = props.fontFamilies;
@@ -15813,7 +15905,7 @@ var PptxEditorRoot = defineComponent59({
15813
15905
  });
15814
15906
  const documentChurn = churnWarning("PptxEditorRoot", "document");
15815
15907
  const fontsChurn = churnWarning("PptxEditorRoot", "fonts");
15816
- watch39(
15908
+ watch38(
15817
15909
  () => props.document,
15818
15910
  (bytes) => {
15819
15911
  if (!editor.value || !bytes) return;
@@ -15821,21 +15913,21 @@ var PptxEditorRoot = defineComponent59({
15821
15913
  void editor.value.load(bytes);
15822
15914
  }
15823
15915
  );
15824
- watch39(
15916
+ watch38(
15825
15917
  () => props.mode,
15826
15918
  (mode) => editor.value?.setMode(mode)
15827
15919
  );
15828
- watch39(
15920
+ watch38(
15829
15921
  () => props.author,
15830
15922
  (author) => editor.value?.setAuthor(author)
15831
15923
  );
15832
- watch39(
15924
+ watch38(
15833
15925
  () => props.modules,
15834
15926
  (modules) => {
15835
15927
  if (editor.value) warnModulesChanged(createdModules, modules, "PptxEditorRoot");
15836
15928
  }
15837
15929
  );
15838
- watch39(
15930
+ watch38(
15839
15931
  () => [editor.value, props.fonts],
15840
15932
  ([instance2, fonts]) => {
15841
15933
  if (!instance2 || createdFonts === fonts) return;
@@ -15846,7 +15938,7 @@ var PptxEditorRoot = defineComponent59({
15846
15938
  },
15847
15939
  { flush: "post" }
15848
15940
  );
15849
- watch39(
15941
+ watch38(
15850
15942
  () => [editor.value, props.fontFamilies],
15851
15943
  ([instance2, families]) => {
15852
15944
  if (!instance2 || createdFamilies === families) return;
@@ -15897,7 +15989,7 @@ var PptxEditorViewport = defineComponent59({
15897
15989
  class: ["pptx-editor", dark.value ? "dark" : null, props.className],
15898
15990
  ...props.label === false ? {} : {
15899
15991
  role: "region",
15900
- "aria-label": props.label ? translateKeyOrText21(t, props.label) : t("viewport.ariaLabel")
15992
+ "aria-label": props.label ? translateKeyOrText20(t, props.label) : t("viewport.ariaLabel")
15901
15993
  }
15902
15994
  },
15903
15995
  slots.default?.()
@@ -15916,7 +16008,7 @@ var PptxEditorContent = defineComponent59({
15916
16008
  setup(props, { attrs }) {
15917
16009
  const editorRef = usePptxEditor();
15918
16010
  const menu = useCanvasContextMenu();
15919
- const host = shallowRef32(null);
16011
+ const host = shallowRef33(null);
15920
16012
  let attached = null;
15921
16013
  const sync = () => {
15922
16014
  const editor = editorRef.value;
@@ -15931,7 +16023,7 @@ var PptxEditorContent = defineComponent59({
15931
16023
  }
15932
16024
  };
15933
16025
  onMounted22(sync);
15934
- watch39(editorRef, sync);
16026
+ watch38(editorRef, sync);
15935
16027
  onUnmounted6(() => {
15936
16028
  attached?.detach();
15937
16029
  attached = null;
@@ -16042,11 +16134,11 @@ import {
16042
16134
  computed as computed25,
16043
16135
  defineComponent as defineComponent62,
16044
16136
  nextTick as nextTick10,
16045
- onBeforeUnmount as onBeforeUnmount14,
16046
- ref as ref43,
16047
- shallowRef as shallowRef33,
16137
+ onBeforeUnmount as onBeforeUnmount15,
16138
+ ref as ref42,
16139
+ shallowRef as shallowRef34,
16048
16140
  useId as useId22,
16049
- watch as watch41
16141
+ watch as watch40
16050
16142
  } from "vue";
16051
16143
  import {
16052
16144
  NOTES_FORMAT_BUTTONS,
@@ -16068,7 +16160,7 @@ import {
16068
16160
  } from "@pptx-editor.dev/core/editor";
16069
16161
 
16070
16162
  // src/NotesView.tsx
16071
- import { defineComponent as defineComponent61, onMounted as onMounted23, watch as watch40 } from "vue";
16163
+ import { defineComponent as defineComponent61, onMounted as onMounted23, watch as watch39 } from "vue";
16072
16164
  import {
16073
16165
  notesFieldBeforeInput,
16074
16166
  notesFieldFocused,
@@ -16114,7 +16206,7 @@ var NotesField = defineComponent61({
16114
16206
  props.onSelection();
16115
16207
  };
16116
16208
  onMounted23(draw);
16117
- watch40(() => [props.paragraphs, props.drafting], draw, { flush: "post" });
16209
+ watch39(() => [props.paragraphs, props.drafting], draw, { flush: "post" });
16118
16210
  const onKeydown = (e) => {
16119
16211
  if (composing) return;
16120
16212
  notesFieldKeyDown(e, e.currentTarget, {
@@ -16166,7 +16258,7 @@ var NotesField = defineComponent61({
16166
16258
  });
16167
16259
 
16168
16260
  // src/NotesPane.tsx
16169
- import { jsx as jsx52, jsxs as jsxs44 } from "vue/jsx-runtime";
16261
+ import { jsx as jsx52, jsxs as jsxs45 } from "vue/jsx-runtime";
16170
16262
  var notesPaneProps = {
16171
16263
  /** Whether the pane is open, controlled. Use with the `update:open` event (`v-model:open`). */
16172
16264
  open: { type: Boolean, default: void 0 },
@@ -16184,8 +16276,8 @@ var notesPaneProps = {
16184
16276
  };
16185
16277
  function useNotesOpen(props, emit) {
16186
16278
  const shared = usePaneState();
16187
- const own = ref43(props.defaultOpen ?? true);
16188
- const owner = ref43(false);
16279
+ const own = ref42(props.defaultOpen ?? true);
16280
+ const owner = ref42(false);
16189
16281
  const open = computed25(
16190
16282
  () => props.open !== void 0 ? props.open : shared && owner.value ? shared.notesOpen.value ?? props.defaultOpen ?? true : own.value
16191
16283
  );
@@ -16206,11 +16298,11 @@ function useNotesOpen(props, emit) {
16206
16298
  }
16207
16299
  };
16208
16300
  claim();
16209
- watch41(() => shared?.notesOpen.value, claim);
16210
- onBeforeUnmount14(() => {
16301
+ watch40(() => shared?.notesOpen.value, claim);
16302
+ onBeforeUnmount15(() => {
16211
16303
  if (slot?.current === handler) slot.current = null;
16212
16304
  });
16213
- watch41(
16305
+ watch40(
16214
16306
  [open, owner],
16215
16307
  () => {
16216
16308
  if (!shared || !owner.value) return;
@@ -16233,11 +16325,11 @@ var PptxEditorNotesPane = defineComponent62({
16233
16325
  const readOnly = useEditorState((s) => s.mode === "view");
16234
16326
  const pane = useNotesOpen(props, emit);
16235
16327
  const notesId = useId22();
16236
- const draft = shallowRef33(null);
16237
- const refusal = ref43(null);
16238
- const formats = shallowRef33(NO_NOTES_FORMATS);
16239
- const canFormat = ref43(false);
16240
- const field = ref43(null);
16328
+ const draft = shallowRef34(null);
16329
+ const refusal = ref42(null);
16330
+ const formats = shallowRef34(NO_NOTES_FORMATS);
16331
+ const canFormat = ref42(false);
16332
+ const field = ref42(null);
16241
16333
  let pending = null;
16242
16334
  let bound = null;
16243
16335
  const restore = { value: null };
@@ -16268,7 +16360,7 @@ var PptxEditorNotesPane = defineComponent62({
16268
16360
  });
16269
16361
  refusal.value = r.ok ? null : rejectionMessage(t, r);
16270
16362
  };
16271
- watch41(
16363
+ watch40(
16272
16364
  slideId,
16273
16365
  (id) => {
16274
16366
  if (pending && pending.slideId !== id) commit();
@@ -16276,7 +16368,7 @@ var PptxEditorNotesPane = defineComponent62({
16276
16368
  },
16277
16369
  { immediate: true }
16278
16370
  );
16279
- watch41(draft, (d, _old, onCleanup) => {
16371
+ watch40(draft, (d, _old, onCleanup) => {
16280
16372
  if (!d) return;
16281
16373
  const doc = field.value?.ownerDocument;
16282
16374
  const onPointerDown = (e) => {
@@ -16285,14 +16377,14 @@ var PptxEditorNotesPane = defineComponent62({
16285
16377
  doc?.addEventListener("pointerdown", onPointerDown, true);
16286
16378
  onCleanup(() => doc?.removeEventListener("pointerdown", onPointerDown, true));
16287
16379
  });
16288
- watch41(
16380
+ watch40(
16289
16381
  () => pane.open.value,
16290
16382
  (open) => {
16291
16383
  if (!open) commit();
16292
16384
  },
16293
16385
  { flush: "post" }
16294
16386
  );
16295
- onBeforeUnmount14(() => commit());
16387
+ onBeforeUnmount15(() => commit());
16296
16388
  const readFormats = () => {
16297
16389
  const el = field.value;
16298
16390
  if (el) followNotesArm(el);
@@ -16306,7 +16398,7 @@ var PptxEditorNotesPane = defineComponent62({
16306
16398
  const ed = editor.value;
16307
16399
  if (ed && ed.snapshot().selection.kind !== "none") ed.setSelection({ kind: "none" });
16308
16400
  };
16309
- const active = ref43(false);
16401
+ const active = ref42(false);
16310
16402
  const target = () => ({
16311
16403
  formats: formats.value,
16312
16404
  readOnly: readOnly.value,
@@ -16327,7 +16419,7 @@ var PptxEditorNotesPane = defineComponent62({
16327
16419
  canFormat.value = false;
16328
16420
  formats.value = NO_NOTES_FORMATS;
16329
16421
  };
16330
- watch41(
16422
+ watch40(
16331
16423
  active,
16332
16424
  (on, _old, onCleanup) => {
16333
16425
  const doc = field.value?.ownerDocument;
@@ -16340,10 +16432,10 @@ var PptxEditorNotesPane = defineComponent62({
16340
16432
  );
16341
16433
  const painter = createNotesFindPainter();
16342
16434
  let mounted = true;
16343
- const findCount = ref43(0);
16435
+ const findCount = ref42(0);
16344
16436
  const selectionKind = useEditorState((s) => s.selection.kind);
16345
16437
  const revision = useEditorState((s) => s.revision);
16346
- watch41(
16438
+ watch40(
16347
16439
  editor,
16348
16440
  (ed, _old, onCleanup) => {
16349
16441
  if (ed)
@@ -16355,7 +16447,7 @@ var PptxEditorNotesPane = defineComponent62({
16355
16447
  },
16356
16448
  { immediate: true }
16357
16449
  );
16358
- watch41(
16450
+ watch40(
16359
16451
  [
16360
16452
  editor,
16361
16453
  () => pane.open.value,
@@ -16378,17 +16470,17 @@ var PptxEditorNotesPane = defineComponent62({
16378
16470
  }),
16379
16471
  { flush: "post", immediate: true }
16380
16472
  );
16381
- onBeforeUnmount14(() => {
16473
+ onBeforeUnmount15(() => {
16382
16474
  mounted = false;
16383
16475
  painter.stop();
16384
16476
  });
16385
- watch41([editor, formats, readOnly, canFormat], () => {
16477
+ watch40([editor, formats, readOnly, canFormat], () => {
16386
16478
  if (editor.value && focused) setNotesTarget(editor.value, target());
16387
16479
  });
16388
- watch41(editor, (_next, was) => {
16480
+ watch40(editor, (_next, was) => {
16389
16481
  if (was) setNotesTarget(was, null);
16390
16482
  });
16391
- onBeforeUnmount14(() => {
16483
+ onBeforeUnmount15(() => {
16392
16484
  if (editor.value) setNotesTarget(editor.value, null);
16393
16485
  });
16394
16486
  const onDraft = (text2) => {
@@ -16442,7 +16534,7 @@ var PptxEditorNotesPane = defineComponent62({
16442
16534
  if (masterView.value) return null;
16443
16535
  const open = pane.open.value;
16444
16536
  const d = draft.value;
16445
- return /* @__PURE__ */ jsxs44(
16537
+ return /* @__PURE__ */ jsxs45(
16446
16538
  "section",
16447
16539
  {
16448
16540
  class: ["pptx-notes", props.className],
@@ -16450,7 +16542,7 @@ var PptxEditorNotesPane = defineComponent62({
16450
16542
  "aria-label": t("notes.title"),
16451
16543
  "data-open": open ? "true" : "false",
16452
16544
  children: [
16453
- /* @__PURE__ */ jsxs44("div", { class: "pptx-notes__head", onMousedown: keepFocus, children: [
16545
+ /* @__PURE__ */ jsxs45("div", { class: "pptx-notes__head", onMousedown: keepFocus, children: [
16454
16546
  /* @__PURE__ */ jsx52("span", { children: t("notes.title") }),
16455
16547
  open && !readOnly.value && props.showFormatButtons ? /* @__PURE__ */ jsx52("div", { class: "pptx-notes__format", role: "group", "aria-label": t("notes.format"), children: NOTES_FORMAT_BUTTONS.map(([format, icon, key]) => /* @__PURE__ */ jsx52(
16456
16548
  ToolButton,
@@ -16514,7 +16606,7 @@ import {
16514
16606
  computed as computed26,
16515
16607
  defineComponent as defineComponent63,
16516
16608
  nextTick as nextTick11,
16517
- shallowRef as shallowRef34,
16609
+ shallowRef as shallowRef35,
16518
16610
  useId as useId23
16519
16611
  } from "vue";
16520
16612
  import {
@@ -16524,13 +16616,13 @@ import {
16524
16616
  openFailureKey,
16525
16617
  shownOpenFailure
16526
16618
  } from "@pptx-editor.dev/core/editor";
16527
- import { jsx as jsx53, jsxs as jsxs45 } from "vue/jsx-runtime";
16619
+ import { jsx as jsx53, jsxs as jsxs46 } from "vue/jsx-runtime";
16528
16620
  function useOpenFailure(options = {}) {
16529
16621
  const current = useEditorState(shownOpenFailure);
16530
16622
  const ready = useEditorState((s) => s.status === "ready");
16531
16623
  const { t: ambient } = useTranslation();
16532
16624
  const t = options.t ?? ambient;
16533
- const dismissed = shallowRef34(null);
16625
+ const dismissed = shallowRef35(null);
16534
16626
  const failure = computed26(
16535
16627
  () => current.value !== null && current.value !== dismissed.value ? current.value : null
16536
16628
  );
@@ -16595,9 +16687,9 @@ var PptxEditorOpenFailure = defineComponent63({
16595
16687
  const { t } = useChromeTranslateScope(() => props.t);
16596
16688
  const { failure, message, kept, dismiss } = useOpenFailure({ t });
16597
16689
  const titleId = useId23();
16598
- const copy = shallowRef34(null);
16599
- const reportRef = shallowRef34(null);
16600
- const rootRef = shallowRef34(null);
16690
+ const copy = shallowRef35(null);
16691
+ const reportRef = shallowRef35(null);
16692
+ const rootRef = shallowRef35(null);
16601
16693
  const editor = usePptxEditor();
16602
16694
  return () => {
16603
16695
  const shown = failure.value;
@@ -16617,7 +16709,7 @@ var PptxEditorOpenFailure = defineComponent63({
16617
16709
  if (focused) editor.value?.focus();
16618
16710
  };
16619
16711
  const context = { failure: shown, message: packaged, dismiss: close };
16620
- return /* @__PURE__ */ jsxs45(
16712
+ return /* @__PURE__ */ jsxs46(
16621
16713
  "div",
16622
16714
  {
16623
16715
  ref: rootRef,
@@ -16627,7 +16719,7 @@ var PptxEditorOpenFailure = defineComponent63({
16627
16719
  "aria-labelledby": titleId,
16628
16720
  "data-reason": shown.reason,
16629
16721
  children: [
16630
- /* @__PURE__ */ jsxs45("div", { class: "pptx-open-failure__text", role: "alert", children: [
16722
+ /* @__PURE__ */ jsxs46("div", { class: "pptx-open-failure__text", role: "alert", children: [
16631
16723
  /* @__PURE__ */ jsx53("p", { id: titleId, class: "pptx-open-failure__title", children: props.title ?? t("openFailure.title") }),
16632
16724
  /* @__PURE__ */ jsx53("div", { class: "pptx-open-failure__message", children: slots.message ? slots.message(context) : typeof props.message === "function" ? props.message(shown) : props.message ?? packaged }),
16633
16725
  kept.value ? /* @__PURE__ */ jsx53("p", { class: "pptx-open-failure__kept", children: t("openFailure.kept") }) : null,
@@ -16646,7 +16738,7 @@ var PptxEditorOpenFailure = defineComponent63({
16646
16738
  onFocus: (e) => e.currentTarget.select()
16647
16739
  }
16648
16740
  ) : null,
16649
- /* @__PURE__ */ jsxs45("div", { class: "pptx-open-failure__actions", children: [
16741
+ /* @__PURE__ */ jsxs46("div", { class: "pptx-open-failure__actions", children: [
16650
16742
  slots.actions ? slots.actions(context) : props.actions?.(context),
16651
16743
  props.showCopy ? /* @__PURE__ */ jsx53(
16652
16744
  "button",
@@ -16671,9 +16763,9 @@ var PptxEditorOpenFailure = defineComponent63({
16671
16763
  import {
16672
16764
  computed as computed27,
16673
16765
  defineComponent as defineComponent64,
16674
- ref as ref44,
16675
- shallowRef as shallowRef35,
16676
- watch as watch42
16766
+ ref as ref43,
16767
+ shallowRef as shallowRef36,
16768
+ watch as watch41
16677
16769
  } from "vue";
16678
16770
  import {
16679
16771
  applyLocalFonts,
@@ -16681,7 +16773,7 @@ import {
16681
16773
  fontNoticeFamilies,
16682
16774
  fontNoticeList
16683
16775
  } from "@pptx-editor.dev/core/editor";
16684
- import { jsx as jsx54, jsxs as jsxs46 } from "vue/jsx-runtime";
16776
+ import { jsx as jsx54, jsxs as jsxs47 } from "vue/jsx-runtime";
16685
16777
  var pptxEditorFontNoticeProps = {
16686
16778
  ...chromeTranslateProp,
16687
16779
  /** A class name added to the notice, as React's `className`. A host `class` also works. */
@@ -16698,12 +16790,12 @@ var PptxEditorFontNotice = defineComponent64({
16698
16790
  const loadState = useEditorState((s) => s.status);
16699
16791
  const missing = computed27(() => fontNoticeFamilies(substituted.value));
16700
16792
  const key = computed27(() => missing.value.join("|"));
16701
- const dismissed = shallowRef35(null);
16702
- const outcome = shallowRef35(null);
16793
+ const dismissed = shallowRef36(null);
16794
+ const outcome = shallowRef36(null);
16703
16795
  const status = computed27(() => outcome.value?.key === key.value ? outcome.value.text : null);
16704
- const busy = ref44(false);
16796
+ const busy = ref43(false);
16705
16797
  let round = 0;
16706
- watch42(loadState, () => {
16798
+ watch41(loadState, () => {
16707
16799
  round += 1;
16708
16800
  outcome.value = null;
16709
16801
  });
@@ -16724,7 +16816,7 @@ var PptxEditorFontNotice = defineComponent64({
16724
16816
  return () => {
16725
16817
  const families = missing.value;
16726
16818
  if (families.length === 0 && !status.value || dismissed.value === key.value) return null;
16727
- return /* @__PURE__ */ jsxs46(
16819
+ return /* @__PURE__ */ jsxs47(
16728
16820
  "div",
16729
16821
  {
16730
16822
  ...attrs,
@@ -16732,7 +16824,7 @@ var PptxEditorFontNotice = defineComponent64({
16732
16824
  role: "status",
16733
16825
  onMousedown: keepFocus,
16734
16826
  children: [
16735
- /* @__PURE__ */ jsxs46("span", { class: "pptx-font-notice__text", children: [
16827
+ /* @__PURE__ */ jsxs47("span", { class: "pptx-font-notice__text", children: [
16736
16828
  families.length ? t("fonts.notice", { families: fontNoticeList(families, t) }) : status.value,
16737
16829
  families.length && status.value ? ` ${status.value}` : ""
16738
16830
  ] }),
@@ -16769,8 +16861,8 @@ import {
16769
16861
  h as h20,
16770
16862
  isVNode as isVNode7,
16771
16863
  normalizeClass as normalizeClass7,
16772
- ref as ref45,
16773
- watch as watch43,
16864
+ ref as ref44,
16865
+ watch as watch42,
16774
16866
  nextTick as nextTick12,
16775
16867
  Comment as Comment4,
16776
16868
  Text as Text4,
@@ -16781,7 +16873,7 @@ import {
16781
16873
  ribbonInsertTab,
16782
16874
  ribbonShownTab,
16783
16875
  ribbonTabs,
16784
- translateKeyOrText as translateKeyOrText22,
16876
+ translateKeyOrText as translateKeyOrText21,
16785
16877
  warnRibbonChild
16786
16878
  } from "@pptx-editor.dev/core/editor";
16787
16879
  var ribbonTabProps = {
@@ -16862,20 +16954,20 @@ var PptxEditorRibbon = Object.assign(
16862
16954
  const { t } = useTranslation();
16863
16955
  const baseId = useId24();
16864
16956
  const layout = useEditorState((s) => ribbonTabs(s), sameLayout);
16865
- const own = ref45(props.defaultTab);
16957
+ const own = ref44(props.defaultTab);
16866
16958
  const names = /* @__PURE__ */ new Map();
16867
- const root = ref45(null);
16959
+ const root = ref44(null);
16868
16960
  let focusInside = false;
16869
16961
  const select = (id) => {
16870
16962
  if (props.tab === void 0) own.value = id;
16871
16963
  emit("update:tab", id);
16872
16964
  emit("tabChange", id);
16873
16965
  };
16874
- const shown = ref45({
16966
+ const shown = ref44({
16875
16967
  id: void 0,
16876
16968
  fellBack: false
16877
16969
  });
16878
- watch43(
16970
+ watch42(
16879
16971
  () => `${shown.value.fellBack}|${shown.value.id ?? ""}`,
16880
16972
  async () => {
16881
16973
  const { id, fellBack } = shown.value;
@@ -16889,7 +16981,7 @@ var PptxEditorRibbon = Object.assign(
16889
16981
  );
16890
16982
  const insertions = useEditorState((s) => s.insertions);
16891
16983
  let insertTab = null;
16892
- watch43(insertions, async () => {
16984
+ watch42(insertions, async () => {
16893
16985
  await nextTick12();
16894
16986
  if (insertTab !== null && insertTab !== (props.tab ?? own.value)) select(insertTab);
16895
16987
  });
@@ -16905,7 +16997,7 @@ var PptxEditorRibbon = Object.assign(
16905
16997
  layout.value,
16906
16998
  specs,
16907
16999
  props.preset,
16908
- (key) => translateKeyOrText22(t, key),
17000
+ (key) => translateKeyOrText21(t, key),
16909
17001
  "PptxEditorRibbon.Tab"
16910
17002
  );
16911
17003
  insertTab = ribbonInsertTab(tabs);
@@ -17178,9 +17270,9 @@ import {
17178
17270
  computed as computed28,
17179
17271
  getCurrentScope as getCurrentScope6,
17180
17272
  onScopeDispose as onScopeDispose9,
17181
- shallowRef as shallowRef36,
17273
+ shallowRef as shallowRef37,
17182
17274
  toValue as toValue8,
17183
- watch as watch44
17275
+ watch as watch43
17184
17276
  } from "vue";
17185
17277
  import {
17186
17278
  ZOOM_LEVELS,
@@ -17212,7 +17304,7 @@ function useZoom() {
17212
17304
  function useEditorEvent(event, handler) {
17213
17305
  const editor = usePptxEditor();
17214
17306
  if (!getCurrentScope6()) return;
17215
- watch44(
17307
+ watch43(
17216
17308
  editor,
17217
17309
  (instance, _prev, onCleanup) => {
17218
17310
  if (instance) onCleanup(onEditorEvent(instance, event, handler));
@@ -17221,9 +17313,9 @@ function useEditorEvent(event, handler) {
17221
17313
  );
17222
17314
  }
17223
17315
  function useEditorSnapshot(editor) {
17224
- const revision = shallowRef36(0);
17316
+ const revision = shallowRef37(0);
17225
17317
  if (!getCurrentScope6()) return revision;
17226
- const stop = watch44(
17318
+ const stop = watch43(
17227
17319
  () => toValue8(editor),
17228
17320
  (instance, _prev, onCleanup) => {
17229
17321
  if (!instance) return;
@@ -17245,9 +17337,9 @@ function useScopeClassName() {
17245
17337
  // src/usePptxSource.ts
17246
17338
  import {
17247
17339
  computed as computed29,
17248
- shallowRef as shallowRef37,
17340
+ shallowRef as shallowRef38,
17249
17341
  toValue as toValue9,
17250
- watch as watch45
17342
+ watch as watch44
17251
17343
  } from "vue";
17252
17344
  import {
17253
17345
  editorHostDocument,
@@ -17260,13 +17352,13 @@ import {
17260
17352
  watchEagerPptxFonts
17261
17353
  } from "@pptx-editor.dev/core/editor";
17262
17354
  function usePptxSource(source, options = {}) {
17263
- const bytes = shallowRef37(void 0);
17264
- const fonts = shallowRef37(void 0);
17265
- const error = shallowRef37(null);
17266
- const documentLoading = shallowRef37(toValue9(source) != null);
17267
- const fontsSettled = shallowRef37(toValue9(options).fonts === void 0);
17355
+ const bytes = shallowRef38(void 0);
17356
+ const fonts = shallowRef38(void 0);
17357
+ const error = shallowRef38(null);
17358
+ const documentLoading = shallowRef38(toValue9(source) != null);
17359
+ const fontsSettled = shallowRef38(toValue9(options).fonts === void 0);
17268
17360
  const resolver = pptxSourceFontsResolver(() => toValue9(options).fonts);
17269
- watch45(
17361
+ watch44(
17270
17362
  () => pptxFontsShape(toValue9(options).fonts),
17271
17363
  (_shape, _previous, onCleanup) => {
17272
17364
  const fontsSource = toValue9(options).fonts;
@@ -17291,7 +17383,7 @@ function usePptxSource(source, options = {}) {
17291
17383
  },
17292
17384
  { immediate: true }
17293
17385
  );
17294
- watch45(
17386
+ watch44(
17295
17387
  () => toValue9(source),
17296
17388
  (next, _previous, onCleanup) => {
17297
17389
  if (next == null) {
@@ -17339,12 +17431,12 @@ function usePptxSource(source, options = {}) {
17339
17431
  }
17340
17432
  function useEditorHostDocument() {
17341
17433
  const editorRef = usePptxEditor();
17342
- const current = shallowRef37(null);
17434
+ const current = shallowRef38(null);
17343
17435
  const read = () => {
17344
17436
  const editor = editorRef.value;
17345
17437
  current.value = editor ? editorHostDocument(editor) : typeof globalThis.document === "undefined" ? null : globalThis.document;
17346
17438
  };
17347
- watch45(
17439
+ watch44(
17348
17440
  () => editorRef.value,
17349
17441
  (editor, _previous, onCleanup) => {
17350
17442
  read();
@@ -17532,7 +17624,7 @@ var PptxEditorDefault = defineComponent67({
17532
17624
  slots: Object,
17533
17625
  setup(props, { attrs, emit, expose, slots }) {
17534
17626
  const instance = getCurrentInstance3();
17535
- const root = shallowRef38(null);
17627
+ const root = shallowRef39(null);
17536
17628
  expose(createEditorRefApi2(() => root.value?.getEditor() ?? null));
17537
17629
  return () => {
17538
17630
  warnOpenFailureActions(