@pptx-editor.dev/vue 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/index.ts
2
2
  import {
3
- defineComponent as defineComponent60,
3
+ defineComponent as defineComponent66,
4
4
  getCurrentInstance as getCurrentInstance3,
5
5
  h as h22,
6
6
  mergeProps as mergeProps2,
@@ -13,7 +13,7 @@ import {
13
13
 
14
14
  // src/components.ts
15
15
  import {
16
- defineComponent as defineComponent52,
16
+ defineComponent as defineComponent58,
17
17
  getCurrentInstance as getCurrentInstance2,
18
18
  h as h18,
19
19
  mergeProps,
@@ -21,7 +21,7 @@ import {
21
21
  onUnmounted as onUnmounted6,
22
22
  provide as provide18,
23
23
  shallowRef as shallowRef32,
24
- watch as watch37
24
+ watch as watch39
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 translateKeyOrText17,
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";
@@ -2942,6 +2942,7 @@ import {
2942
2942
  watch as watch10
2943
2943
  } from "vue";
2944
2944
  import {
2945
+ formatSelectionHasLineEnds,
2945
2946
  dialogInitialFocus as dialogInitialFocus3,
2946
2947
  isDialogBackdropPoint as isDialogBackdropPoint3,
2947
2948
  colorMenuSelection,
@@ -3542,7 +3543,7 @@ var LineMenuControl = defineComponent10({
3542
3543
  const { t } = useTranslation();
3543
3544
  const anchor = ref6(null);
3544
3545
  const open = ref6(false);
3545
- const isLine = useEditorState((s) => s.geometry?.lineHead !== void 0);
3546
+ const isLine = useEditorState((s) => formatSelectionHasLineEnds(s));
3546
3547
  const trigger = useTriggerAttributes(
3547
3548
  props.slot,
3548
3549
  "pptx-toolbar__button pptx-toolbar__button--wide",
@@ -8726,13 +8727,13 @@ function useCanvasContextMenu() {
8726
8727
  // src/SlideSorter.tsx
8727
8728
  import {
8728
8729
  computed as computed24,
8729
- defineComponent as defineComponent50,
8730
+ defineComponent as defineComponent56,
8730
8731
  onBeforeUnmount as onBeforeUnmount13,
8731
8732
  onMounted as onMounted20,
8732
8733
  onUpdated as onUpdated5,
8733
- ref as ref36,
8734
+ ref as ref40,
8734
8735
  shallowRef as shallowRef30,
8735
- watch as watch35
8736
+ watch as watch37
8736
8737
  } from "vue";
8737
8738
  import {
8738
8739
  STATUS_BAR_VIEW_OPTIONS,
@@ -8748,7 +8749,7 @@ import {
8748
8749
  slideSorterMounted,
8749
8750
  sorterKeyDown,
8750
8751
  trackNotesInset,
8751
- translateKeyOrText as translateKeyOrText16,
8752
+ translateKeyOrText as translateKeyOrText19,
8752
8753
  warnSlideSorterUnmounted
8753
8754
  } from "@pptx-editor.dev/core/editor";
8754
8755
 
@@ -8909,17 +8910,17 @@ var MasterViewBar = defineComponent29({
8909
8910
  // src/panes.tsx
8910
8911
  import {
8911
8912
  computed as computed22,
8912
- defineComponent as defineComponent48,
8913
- nextTick as nextTick8,
8913
+ defineComponent as defineComponent54,
8914
+ nextTick as nextTick9,
8914
8915
  onBeforeUnmount as onBeforeUnmount11,
8915
8916
  onMounted as onMounted19,
8916
8917
  onUnmounted as onUnmounted4,
8917
8918
  onUpdated as onUpdated4,
8918
8919
  provide as provide17,
8919
- ref as ref35,
8920
+ ref as ref39,
8920
8921
  shallowRef as shallowRef28,
8921
- useId as useId20,
8922
- watch as watch33
8922
+ useId as useId21,
8923
+ watch as watch35
8923
8924
  } from "vue";
8924
8925
  import {
8925
8926
  ZOOM_MENU_LEVELS,
@@ -10029,6 +10030,7 @@ var SizeControl = defineComponent33({
10029
10030
  // src/toolbar-file-controls.tsx
10030
10031
  import { defineComponent as defineComponent34, inject as inject21, ref as ref23 } from "vue";
10031
10032
  import {
10033
+ captureImageTarget,
10032
10034
  imageFileTypes,
10033
10035
  insertImageFile,
10034
10036
  requestLinkPopup as requestLinkPopup2,
@@ -10080,6 +10082,7 @@ var ImageControl = defineComponent34({
10080
10082
  );
10081
10083
  const editor = usePptxEditor();
10082
10084
  const input = ref23(null);
10085
+ let pickerTarget;
10083
10086
  return () => {
10084
10087
  const target = props.control.state.kind === "replace" ? "replaceImage" : void 0;
10085
10088
  return [
@@ -10091,7 +10094,10 @@ var ImageControl = defineComponent34({
10091
10094
  paths: props.control.paths,
10092
10095
  disabled: !cmd.isEnabled.value,
10093
10096
  disabledReason: reason.value,
10094
- onClick: () => input.value?.click()
10097
+ onClick: () => {
10098
+ pickerTarget = editor.value ? captureImageTarget(editor.value) : void 0;
10099
+ input.value?.click();
10100
+ }
10095
10101
  }
10096
10102
  ),
10097
10103
  /* @__PURE__ */ jsx28(
@@ -10105,7 +10111,9 @@ var ImageControl = defineComponent34({
10105
10111
  const el = e.target;
10106
10112
  const file = el.files?.[0];
10107
10113
  el.value = "";
10108
- if (file && editor.value) void insertImageFile(editor.value, file, target);
10114
+ const isCurrent = pickerTarget;
10115
+ pickerTarget = void 0;
10116
+ if (file && editor.value) void insertImageFile(editor.value, file, target, isCurrent);
10109
10117
  }
10110
10118
  }
10111
10119
  )
@@ -11042,6 +11050,8 @@ import {
11042
11050
  } from "vue";
11043
11051
  import {
11044
11052
  createToolbarFitMemory,
11053
+ formatSelectionHasLineEnds as formatSelectionHasLineEnds2,
11054
+ formatTargetKey,
11045
11055
  observeToolbarFit,
11046
11056
  toolbarCollapsedIds
11047
11057
  } from "@pptx-editor.dev/core/editor";
@@ -11130,7 +11140,7 @@ var PresetToolbar = defineComponent39({
11130
11140
  },
11131
11141
  setup(props) {
11132
11142
  const { t } = useTranslation();
11133
- const context = useEditorState((s) => `${s.selection.kind}|${s.geometry?.lineHead ?? ""}`);
11143
+ const context = useEditorState((s) => `${formatTargetKey(s)}|${formatSelectionHasLineEnds2(s)}`);
11134
11144
  const status = useEditorState((s) => s.status);
11135
11145
  const root = ref28(null);
11136
11146
  const more = ref28(null);
@@ -12198,25 +12208,19 @@ var SectionNode = defineComponent42({
12198
12208
  // src/SidePanel.tsx
12199
12209
  import {
12200
12210
  computed as computed21,
12201
- defineComponent as defineComponent47,
12202
- nextTick as nextTick7,
12211
+ defineComponent as defineComponent53,
12212
+ nextTick as nextTick8,
12203
12213
  onMounted as onMounted18,
12204
- ref as ref34,
12205
- watch as watch32
12214
+ ref as ref38,
12215
+ watch as watch34
12206
12216
  } from "vue";
12207
12217
  import {
12208
- elementKindLabelKey,
12209
- elementRotates,
12210
- formatPanelSize,
12211
12218
  listenPaneRequests,
12212
12219
  takePaneRequest,
12213
12220
  SIDE_PANEL_TAB_ICONS,
12214
- TABLE_OPTION_ROWS,
12215
12221
  visibleSidePanelTabs,
12216
12222
  panelHistoryKey,
12217
- platformShortcuts as platformShortcuts2,
12218
- radioGroupStep as radioGroupStep2,
12219
- formatPanelKeys
12223
+ radioGroupStep as radioGroupStep2
12220
12224
  } from "@pptx-editor.dev/core/editor";
12221
12225
 
12222
12226
  // src/SelectionPane.tsx
@@ -13488,6 +13492,7 @@ var NodeField = defineComponent46({
13488
13492
  onKeydown: (e) => {
13489
13493
  if (e.key === "Enter" && !e.shiftKey && !e.isComposing) {
13490
13494
  e.preventDefault();
13495
+ e.stopPropagation();
13491
13496
  commit();
13492
13497
  }
13493
13498
  if (e.key === "Escape") reset();
@@ -13640,26 +13645,68 @@ var DiagramTextPane = defineComponent46({
13640
13645
  }
13641
13646
  });
13642
13647
 
13643
- // src/SidePanel.tsx
13648
+ // src/FormatPanel.tsx
13649
+ import {
13650
+ defineComponent as defineComponent52,
13651
+ ref as ref37,
13652
+ watch as watch33
13653
+ } from "vue";
13654
+ import {
13655
+ chromeControlForSlot as chromeControlForSlot7,
13656
+ formatSectionsOf,
13657
+ formatControlMixed,
13658
+ formatTargetKey as formatTargetKey5,
13659
+ formatSelectionCategory,
13660
+ formatSectionOpen,
13661
+ setFormatSectionOpen,
13662
+ listenFormatSectionExpansion
13663
+ } from "@pptx-editor.dev/core/editor";
13664
+
13665
+ // src/FormatLineWidth.tsx
13666
+ import { defineComponent as defineComponent48 } from "vue";
13667
+ import { formatLineState, formatTargetKey as formatTargetKey2, translateKeyOrText as translateKeyOrText16 } from "@pptx-editor.dev/core/editor";
13668
+
13669
+ // src/FormatNumberField.tsx
13670
+ import { defineComponent as defineComponent47, ref as ref34, watch as watch32, useId as useId20 } from "vue";
13644
13671
  import { jsx as jsx39, jsxs as jsxs33 } from "vue/jsx-runtime";
13645
- var EMU_PER_INCH = 914400;
13646
- var inches = (emu) => (emu / EMU_PER_INCH).toFixed(2);
13647
- var PanelNumberField = defineComponent47({
13648
- name: "PptxPanelNumberField",
13672
+ var FormatNumberField = defineComponent47({
13673
+ name: "FormatNumberField",
13649
13674
  props: {
13650
13675
  label: { type: String, required: true },
13651
- value: { type: String, required: true },
13676
+ value: { type: String, default: null },
13652
13677
  unit: { type: String, required: true },
13653
- disabled: { type: Boolean, required: true },
13678
+ property: String,
13679
+ disabled: Boolean,
13680
+ min: Number,
13681
+ exclusiveMin: Boolean,
13682
+ mixed: { type: Boolean, default: true },
13683
+ max: Number,
13654
13684
  onCommit: { type: Function, required: true }
13655
13685
  },
13656
13686
  setup(props) {
13687
+ const { t } = useTranslation();
13688
+ const errorId = useId20();
13657
13689
  const draft = ref34(null);
13658
- const commit = () => {
13659
- const d = draft.value;
13660
- const n = d === null || d.trim() === "" ? NaN : Number(d.replace(",", "."));
13661
- if (Number.isFinite(n) && draft.value !== props.value) props.onCommit(n);
13690
+ const error = ref34(null);
13691
+ const reset = () => {
13662
13692
  draft.value = null;
13693
+ error.value = null;
13694
+ };
13695
+ watch32(() => props.value, reset, { flush: "sync" });
13696
+ const commit = () => {
13697
+ if (draft.value === null) return;
13698
+ const number = draft.value.trim() === "" ? NaN : Number(draft.value.replace(",", "."));
13699
+ if (!Number.isFinite(number) || props.min !== void 0 && (number < props.min || props.exclusiveMin && number === props.min) || props.max !== void 0 && number > props.max) {
13700
+ error.value = props.min !== void 0 && props.max !== void 0 ? t(props.exclusiveMin ? "inspector.numberRangeExclusive" : "inspector.numberRange", {
13701
+ min: props.min,
13702
+ max: props.max
13703
+ }) : props.min !== void 0 ? t("inspector.numberMinimum", { min: props.min }) : t("disabled.invalidValue");
13704
+ return;
13705
+ }
13706
+ if (props.value !== null && number === Number(props.value)) return reset();
13707
+ const refused = props.onCommit(number);
13708
+ if (refused) error.value = refused;
13709
+ else reset();
13663
13710
  };
13664
13711
  return () => /* @__PURE__ */ jsxs33("label", { class: "pptx-field", children: [
13665
13712
  props.label,
@@ -13669,25 +13716,352 @@ var PanelNumberField = defineComponent47({
13669
13716
  {
13670
13717
  inputmode: "decimal",
13671
13718
  "aria-label": props.label,
13672
- value: draft.value ?? props.value,
13719
+ "data-format-property": props.property,
13720
+ value: draft.value ?? props.value ?? "",
13721
+ placeholder: props.value === null && props.mixed ? t("inspector.mixed") : void 0,
13673
13722
  disabled: props.disabled,
13723
+ "aria-invalid": !!error.value,
13724
+ "aria-describedby": error.value ? errorId : void 0,
13674
13725
  "data-draft": draft.value !== null,
13675
13726
  onInput: (e) => {
13676
13727
  draft.value = e.target.value;
13677
13728
  },
13678
13729
  onBlur: commit,
13679
13730
  onKeydown: (e) => {
13680
- if (e.key === "Enter") commit();
13681
- if (e.key === "Escape") draft.value = null;
13731
+ if (e.key === "Enter" && !e.isComposing) {
13732
+ e.preventDefault();
13733
+ commit();
13734
+ }
13735
+ if (e.key === "Escape") {
13736
+ e.preventDefault();
13737
+ e.stopPropagation();
13738
+ reset();
13739
+ }
13682
13740
  }
13683
13741
  }
13684
13742
  ),
13685
13743
  /* @__PURE__ */ jsx39("span", { class: "pptx-field__unit", children: props.unit })
13686
- ] })
13744
+ ] }),
13745
+ error.value ? /* @__PURE__ */ jsx39("span", { id: errorId, class: "pptx-chart-pane__error", role: "alert", children: error.value }) : null
13687
13746
  ] });
13688
13747
  }
13689
13748
  });
13690
- var FormatTab = defineComponent47({
13749
+
13750
+ // src/FormatLineWidth.tsx
13751
+ import { jsx as jsx40 } from "vue/jsx-runtime";
13752
+ var FormatLineWidth = defineComponent48({
13753
+ name: "FormatLineWidth",
13754
+ setup() {
13755
+ const editor = usePptxEditor();
13756
+ const snapshot = useEditorState((s) => s);
13757
+ const { t } = useTranslation();
13758
+ return () => {
13759
+ const line = formatLineState(editor.value);
13760
+ if (!line) return null;
13761
+ const key = `${editor.value?.session?.id}:${formatTargetKey2(snapshot.value)}`;
13762
+ return /* @__PURE__ */ jsx40(
13763
+ FormatNumberField,
13764
+ {
13765
+ label: t("inspector.lineWidth"),
13766
+ property: "line.width",
13767
+ value: line.width === null ? null : String(Math.round(line.width * 100) / 100),
13768
+ unit: "pt",
13769
+ min: 0,
13770
+ exclusiveMin: true,
13771
+ mixed: line.widthMixed,
13772
+ max: 1584,
13773
+ disabled: snapshot.value.mode === "view",
13774
+ onCommit: (points) => {
13775
+ if (!editor.value || `${editor.value.session?.id}:${formatTargetKey2(editor.value.snapshot())}` !== key)
13776
+ return t("disabled.invalidValue");
13777
+ if (points === line.width) return null;
13778
+ const result = editor.value.exec({ type: "setLineWidth", points });
13779
+ return result.ok ? null : translateKeyOrText16(t, result.reason);
13780
+ }
13781
+ },
13782
+ key
13783
+ );
13784
+ };
13785
+ }
13786
+ });
13787
+
13788
+ // src/FormatDetails.tsx
13789
+ import { defineComponent as defineComponent50, ref as ref36, nextTick as nextTick7 } from "vue";
13790
+ import {
13791
+ chromeControlForSlot as chromeControlForSlot6,
13792
+ createGradientStopIdentity,
13793
+ colorChoiceOf as colorChoiceOf2,
13794
+ colorPickOf as colorPickOf3,
13795
+ formatPropertyGroups,
13796
+ formatTargetKey as formatTargetKey3,
13797
+ translateKeyOrText as translateKeyOrText17
13798
+ } from "@pptx-editor.dev/core/editor";
13799
+
13800
+ // src/FormatGradientPicker.tsx
13801
+ import { defineComponent as defineComponent49, ref as ref35 } from "vue";
13802
+ import {
13803
+ gradientPreviewCss,
13804
+ gradientPreviewStops
13805
+ } from "@pptx-editor.dev/core/editor";
13806
+ import { jsx as jsx41, jsxs as jsxs34 } from "vue/jsx-runtime";
13807
+ var FormatGradientPicker = defineComponent49({
13808
+ name: "FormatGradientPicker",
13809
+ props: {
13810
+ gradient: { type: Object, required: true },
13811
+ selected: { type: String, required: true },
13812
+ onSelect: { type: Function, required: true }
13813
+ },
13814
+ setup(props) {
13815
+ const { t } = useTranslation();
13816
+ const rows = useEditorState((s) => s.themeColors);
13817
+ const root = ref35(null);
13818
+ return () => {
13819
+ const stops = gradientPreviewStops(props.gradient, rows.value);
13820
+ const background = gradientPreviewCss(stops);
13821
+ const label = (index) => `${t("inspector.gradientStop", { index: index + 1 })} \xB7 ${Math.round(stops[index].position * 100)}%`;
13822
+ const move = (index) => {
13823
+ const stop = stops[index];
13824
+ if (!stop) return;
13825
+ props.onSelect(stop.id);
13826
+ const buttons = root.value?.querySelectorAll(
13827
+ "[data-format-stop-marker]"
13828
+ );
13829
+ buttons?.[index]?.focus();
13830
+ };
13831
+ return /* @__PURE__ */ jsxs34("div", { class: "pptx-gradient-picker", ref: root, children: [
13832
+ /* @__PURE__ */ jsx41(
13833
+ "div",
13834
+ {
13835
+ class: "pptx-gradient-picker__ramp",
13836
+ style: background ? { backgroundImage: background } : void 0,
13837
+ role: "img",
13838
+ "aria-label": t(background ? "gradient.preview" : "inspector.previewUnavailable")
13839
+ }
13840
+ ),
13841
+ /* @__PURE__ */ jsx41("div", { class: "pptx-gradient-picker__markers", role: "group", "aria-label": t("gradient.stops"), children: stops.map((stop, index) => /* @__PURE__ */ jsx41(
13842
+ "button",
13843
+ {
13844
+ type: "button",
13845
+ "data-format-stop-marker": stop.id,
13846
+ class: "pptx-gradient-picker__marker",
13847
+ style: { left: `${stop.position * 100}%` },
13848
+ "aria-label": label(index),
13849
+ "aria-pressed": props.selected === stop.id,
13850
+ tabindex: props.selected === stop.id ? 0 : -1,
13851
+ onClick: () => props.onSelect(stop.id),
13852
+ onKeydown: (e) => {
13853
+ const next = e.key === "ArrowRight" ? Math.min(stops.length - 1, index + 1) : e.key === "ArrowLeft" ? Math.max(0, index - 1) : e.key === "Home" ? 0 : e.key === "End" ? stops.length - 1 : null;
13854
+ if (next !== null) {
13855
+ e.preventDefault();
13856
+ move(next);
13857
+ }
13858
+ },
13859
+ children: /* @__PURE__ */ jsx41(
13860
+ "span",
13861
+ {
13862
+ style: stop.color ? { backgroundColor: stop.color, opacity: stop.opacity } : void 0
13863
+ }
13864
+ )
13865
+ },
13866
+ stop.id
13867
+ )) }),
13868
+ /* @__PURE__ */ jsxs34("label", { class: "pptx-field", children: [
13869
+ t("inspector.selectStop"),
13870
+ /* @__PURE__ */ jsx41(
13871
+ "select",
13872
+ {
13873
+ "data-format-stop-select": "",
13874
+ "aria-label": t("inspector.selectStop"),
13875
+ value: props.selected,
13876
+ onChange: (e) => props.onSelect(e.target.value),
13877
+ children: stops.map((stop, index) => /* @__PURE__ */ jsx41("option", { value: stop.id, children: label(index) }, stop.id))
13878
+ }
13879
+ )
13880
+ ] })
13881
+ ] });
13882
+ };
13883
+ }
13884
+ });
13885
+
13886
+ // src/FormatDetails.tsx
13887
+ import { jsx as jsx42, jsxs as jsxs35 } from "vue/jsx-runtime";
13888
+ var FormatDetails = defineComponent50({
13889
+ props: { section: { type: String, required: true } },
13890
+ setup(props) {
13891
+ const editor = usePptxEditor();
13892
+ const { t } = useTranslation();
13893
+ const snapshot = useEditorState((s) => s);
13894
+ const offered = useOfferedControl("shape.effects", chromeControlForSlot6("shape.effects"));
13895
+ const root = ref36(null);
13896
+ const stopIdentity = createGradientStopIdentity();
13897
+ const selectedStop = ref36(null);
13898
+ const error = ref36(null);
13899
+ return () => {
13900
+ const read = editor.value?.shapeFormat();
13901
+ if (snapshot.value.selection.kind === "shapes" && snapshot.value.selection.nodeIds.length > 1)
13902
+ return null;
13903
+ if (!read) return null;
13904
+ if (!read.ok)
13905
+ return /* @__PURE__ */ jsx42("p", { class: "pptx-empty__body", role: "status", children: translateKeyOrText17(t, read.reason) });
13906
+ const detail = read.format;
13907
+ if (props.section === "effects" && detail.effectsReason)
13908
+ return /* @__PURE__ */ jsx42("p", { class: "pptx-empty__body", role: "status", children: translateKeyOrText17(t, detail.effectsReason) });
13909
+ const identity = (id) => stopIdentity.identity(detail.gradient?.stops ?? [], id);
13910
+ const activeStop = detail.gradient?.stops.find(
13911
+ (stop) => selectedStop.value !== null && identity(stop.id) === selectedStop.value
13912
+ ) ?? detail.gradient?.stops[0];
13913
+ const key = `${editor.value?.session?.id}:${formatTargetKey3(snapshot.value)}`;
13914
+ const apply = (patch) => {
13915
+ if (!editor.value || `${editor.value.session?.id}:${formatTargetKey3(editor.value.snapshot())}` !== key)
13916
+ return t("disabled.invalidValue");
13917
+ const result = editor.value.exec({
13918
+ type: "patchShapeFormat",
13919
+ target: detail.target,
13920
+ patch
13921
+ });
13922
+ if (result.ok && patch.kind === "gradient") {
13923
+ const next = editor.value.shapeFormat();
13924
+ if (next.ok && next.format.gradient && detail.gradient) {
13925
+ stopIdentity.patched(detail.gradient.stops, next.format.gradient.stops, patch);
13926
+ }
13927
+ }
13928
+ return result.ok ? null : translateKeyOrText17(t, result.reason);
13929
+ };
13930
+ const disabled = snapshot.value.mode === "view";
13931
+ const effectsAvailable = offered.value?.options?.some((option) => option.value === "reflection.tightTouching") === true;
13932
+ const unavailable = (id) => !effectsAvailable && (id === "reflection" || id === "shadow" && detail.shadow?.kind === "inner");
13933
+ return /* @__PURE__ */ jsxs35("div", { class: "pptx-format-details", ref: root, children: [
13934
+ props.section === "fill" && detail.gradient && activeStop ? /* @__PURE__ */ jsx42(
13935
+ FormatGradientPicker,
13936
+ {
13937
+ gradient: detail.gradient,
13938
+ selected: activeStop.id,
13939
+ onSelect: (id) => {
13940
+ selectedStop.value = identity(id);
13941
+ }
13942
+ }
13943
+ ) : null,
13944
+ formatPropertyGroups(detail, props.section).filter((group) => group.index === void 0 || group.id === activeStop?.id).map((group) => /* @__PURE__ */ jsxs35(
13945
+ "fieldset",
13946
+ {
13947
+ class: "pptx-format-property-group",
13948
+ "data-format-stop": group.index,
13949
+ children: [
13950
+ /* @__PURE__ */ jsx42("legend", { children: t(group.labelKey, group.index ? { index: group.index } : void 0) }),
13951
+ /* @__PURE__ */ jsxs35("div", { class: "pptx-format-property-fields", children: [
13952
+ unavailable(group.id) ? /* @__PURE__ */ jsx42("p", { class: "pptx-empty__body", role: "status", children: t("inspector.effectUnavailable") }) : null,
13953
+ group.colors.map((field) => {
13954
+ const pick = field.color ? colorPickOf3(field.color) : "keep";
13955
+ return /* @__PURE__ */ jsx42(
13956
+ ColorField,
13957
+ {
13958
+ name: field.id,
13959
+ "data-format-property": field.id,
13960
+ label: t(field.labelKey),
13961
+ value: pick,
13962
+ seed: pick,
13963
+ disabled: disabled || unavailable(group.id),
13964
+ onChange: (next) => {
13965
+ const color = colorChoiceOf2(next);
13966
+ if (color) error.value = apply(field.patch(color));
13967
+ }
13968
+ },
13969
+ "color"
13970
+ );
13971
+ }),
13972
+ group.numbers.map((field) => /* @__PURE__ */ jsx42(
13973
+ FormatNumberField,
13974
+ {
13975
+ value: String(field.value),
13976
+ unit: field.unit,
13977
+ property: field.id,
13978
+ min: field.min,
13979
+ max: field.max,
13980
+ label: t(field.labelKey),
13981
+ disabled: disabled || unavailable(group.id),
13982
+ onCommit: (value) => apply(field.patch(value))
13983
+ },
13984
+ field.id.split(".").at(-1)
13985
+ ))
13986
+ ] }),
13987
+ group.index !== void 0 ? /* @__PURE__ */ jsx42(
13988
+ "button",
13989
+ {
13990
+ type: "button",
13991
+ class: "pptx-button",
13992
+ disabled: disabled || !group.remove,
13993
+ title: !group.remove ? t("inspector.stopLimit") : void 0,
13994
+ onClick: () => {
13995
+ error.value = apply(group.remove);
13996
+ if (!error.value) {
13997
+ const remaining = detail.gradient.stops.filter(
13998
+ (stop) => stop.id !== group.id
13999
+ );
14000
+ selectedStop.value = identity(
14001
+ remaining[Math.min((group.index ?? 1) - 1, remaining.length - 1)].id
14002
+ );
14003
+ void nextTick7(
14004
+ () => root.value?.querySelector("[data-format-stop-select]")?.focus()
14005
+ );
14006
+ }
14007
+ },
14008
+ children: t("gradient.remove")
14009
+ }
14010
+ ) : null
14011
+ ]
14012
+ },
14013
+ identity(group.id)
14014
+ )),
14015
+ props.section === "fill" && detail.gradient ? /* @__PURE__ */ jsx42("div", { class: "pptx-format-detail-actions", children: /* @__PURE__ */ jsx42(
14016
+ "button",
14017
+ {
14018
+ type: "button",
14019
+ class: "pptx-button",
14020
+ disabled: disabled || detail.gradient.stops.length >= 10,
14021
+ title: detail.gradient.stops.length >= 10 ? t("inspector.addStopLimit") : void 0,
14022
+ onClick: () => {
14023
+ const index = detail.gradient.stops.findIndex((stop) => stop.position > 0.5);
14024
+ error.value = apply({
14025
+ kind: "gradient",
14026
+ addStop: { position: 0.5, color: { theme: "accent1" }, opacity: 1 }
14027
+ });
14028
+ if (!error.value) {
14029
+ const next = editor.value.shapeFormat();
14030
+ if (next.ok)
14031
+ selectedStop.value = next.format.gradient ? stopIdentity.identity(
14032
+ next.format.gradient.stops,
14033
+ next.format.gradient.stops[index < 0 ? detail.gradient.stops.length : index].id
14034
+ ) : null;
14035
+ void nextTick7(
14036
+ () => root.value?.querySelector("[data-format-stop-select]")?.focus()
14037
+ );
14038
+ }
14039
+ },
14040
+ children: t("gradient.add")
14041
+ }
14042
+ ) }) : null,
14043
+ error.value ? /* @__PURE__ */ jsx42("p", { role: "alert", class: "pptx-chart-pane__error", children: error.value }) : null
14044
+ ] }, key);
14045
+ };
14046
+ }
14047
+ });
14048
+
14049
+ // src/FormatGeometry.tsx
14050
+ import { defineComponent as defineComponent51 } from "vue";
14051
+ import {
14052
+ TABLE_OPTION_ROWS,
14053
+ elementKindLabelKey,
14054
+ elementRotates,
14055
+ formatPanelSize,
14056
+ platformShortcuts as platformShortcuts2,
14057
+ formatPanelKeys,
14058
+ formatTargetKey as formatTargetKey4,
14059
+ translateKeyOrText as translateKeyOrText18
14060
+ } from "@pptx-editor.dev/core/editor";
14061
+ import { jsx as jsx43, jsxs as jsxs36 } from "vue/jsx-runtime";
14062
+ var EMU_PER_INCH = 914400;
14063
+ var inches = (emu) => String(Number((emu / EMU_PER_INCH).toFixed(6)));
14064
+ var FormatGeometry = defineComponent51({
13691
14065
  name: "PptxFormatTab",
13692
14066
  setup() {
13693
14067
  const { t } = useTranslation();
@@ -13706,13 +14080,13 @@ var FormatTab = defineComponent47({
13706
14080
  return () => {
13707
14081
  const g = geometry.value;
13708
14082
  if (!g)
13709
- return selected.value > 1 ? /* @__PURE__ */ jsxs33("div", { class: "pptx-empty", children: [
13710
- /* @__PURE__ */ jsx39("p", { class: "pptx-empty__title", children: t("panel.format.multipleTitle", { count: selected.value }) }),
13711
- /* @__PURE__ */ jsx39("p", { class: "pptx-empty__body", children: platformShortcuts2(t("panel.format.multipleBody")) })
14083
+ return selected.value > 1 ? /* @__PURE__ */ jsxs36("div", { class: "pptx-empty", children: [
14084
+ /* @__PURE__ */ jsx43("p", { class: "pptx-empty__title", children: t("panel.format.multipleTitle", { count: selected.value }) }),
14085
+ /* @__PURE__ */ jsx43("p", { class: "pptx-empty__body", children: platformShortcuts2(t("panel.format.multipleBody")) })
13712
14086
  ] }) : [
13713
- /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__section", children: [
13714
- /* @__PURE__ */ jsx39("h3", { class: "pptx-panel__title", children: t(panelTitle.value) }),
13715
- background.isAvailable.value ? /* @__PURE__ */ jsx39(
14087
+ /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__section", children: [
14088
+ /* @__PURE__ */ jsx43("h3", { class: "pptx-panel__title", children: t(panelTitle.value) }),
14089
+ background.isAvailable.value ? /* @__PURE__ */ jsx43(
13716
14090
  "button",
13717
14091
  {
13718
14092
  type: "button",
@@ -13723,20 +14097,31 @@ var FormatTab = defineComponent47({
13723
14097
  }
13724
14098
  ) : null
13725
14099
  ] }),
13726
- /* @__PURE__ */ jsxs33("div", { class: "pptx-empty", children: [
13727
- /* @__PURE__ */ jsx39("p", { class: "pptx-empty__title", children: t("panel.format.emptyTitle") }),
13728
- /* @__PURE__ */ jsx39("p", { class: "pptx-empty__body", children: t(panelBody.value) })
14100
+ /* @__PURE__ */ jsxs36("div", { class: "pptx-empty", children: [
14101
+ /* @__PURE__ */ jsx43("p", { class: "pptx-empty__title", children: t("panel.format.emptyTitle") }),
14102
+ /* @__PURE__ */ jsx43("p", { class: "pptx-empty__body", children: t(panelBody.value) })
13729
14103
  ] })
13730
14104
  ];
14105
+ const target = editor.value ? `${editor.value.session?.id}:${formatTargetKey4(editor.value.snapshot())}` : "";
14106
+ const run = (command) => {
14107
+ if (!editor.value || `${editor.value.session?.id}:${formatTargetKey4(editor.value.snapshot())}` !== target)
14108
+ return t("disabled.invalidValue");
14109
+ const result = editor.value.exec(command);
14110
+ return result.ok ? null : translateKeyOrText18(t, result.reason);
14111
+ };
13731
14112
  const move = (patch) => {
13732
- editor.value?.exec({
14113
+ if (!editor.value || `${editor.value.session?.id}:${formatTargetKey4(editor.value.snapshot())}` !== target)
14114
+ return t("disabled.invalidValue");
14115
+ const current = editor.value.snapshot().geometry;
14116
+ if (!current || current.nodeId !== g.nodeId) return t("disabled.invalidValue");
14117
+ return run({
13733
14118
  type: "setTransform",
13734
14119
  nodeId: g.nodeId,
13735
- x: patch.x ?? g.x,
13736
- y: patch.y ?? g.y,
13737
- cx: Math.max(0, patch.cx ?? g.cx),
13738
- cy: Math.max(0, patch.cy ?? g.cy),
13739
- rot: patch.rot ?? g.rot
14120
+ x: patch.x ?? current.x,
14121
+ y: patch.y ?? current.y,
14122
+ cx: patch.cx ?? current.cx,
14123
+ cy: patch.cy ?? current.cy,
14124
+ rot: patch.rot ?? current.rot
13740
14125
  });
13741
14126
  };
13742
14127
  const inch = (v) => Math.round(v * EMU_PER_INCH);
@@ -13744,32 +14129,36 @@ var FormatTab = defineComponent47({
13744
14129
  const tableSection = () => {
13745
14130
  const tb = table.value;
13746
14131
  if (!tb) return null;
13747
- return /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__section", children: [
13748
- /* @__PURE__ */ jsx39("h3", { class: "pptx-panel__title", children: t("panel.format.table") }),
13749
- /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__grid", children: [
13750
- /* @__PURE__ */ jsx39(
13751
- PanelNumberField,
14132
+ return /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__section", children: [
14133
+ /* @__PURE__ */ jsx43("h3", { class: "pptx-panel__title", children: t("panel.format.table") }),
14134
+ /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__grid", children: [
14135
+ /* @__PURE__ */ jsx43(
14136
+ FormatNumberField,
13752
14137
  {
13753
14138
  label: t("panel.format.rowHeight"),
14139
+ property: "table-rowHeight",
14140
+ min: 0,
13754
14141
  value: inches(tb.rowHeight),
13755
14142
  unit,
13756
14143
  disabled: readOnly.value,
13757
- onCommit: (v) => editor.value?.exec({ type: "setRowHeight", height: inch(v) })
14144
+ onCommit: (v) => run({ type: "setRowHeight", height: inch(v) })
13758
14145
  }
13759
14146
  ),
13760
- /* @__PURE__ */ jsx39(
13761
- PanelNumberField,
14147
+ /* @__PURE__ */ jsx43(
14148
+ FormatNumberField,
13762
14149
  {
13763
14150
  label: t("panel.format.columnWidth"),
14151
+ property: "table-columnWidth",
14152
+ min: 0,
13764
14153
  value: inches(tb.columnWidth),
13765
14154
  unit,
13766
14155
  disabled: readOnly.value,
13767
- onCommit: (v) => editor.value?.exec({ type: "setColumnWidth", width: inch(v) })
14156
+ onCommit: (v) => run({ type: "setColumnWidth", width: inch(v) })
13768
14157
  }
13769
14158
  )
13770
14159
  ] }),
13771
- /* @__PURE__ */ jsx39("div", { class: "pptx-radios", role: "group", "aria-label": t("panel.format.styleOptions"), children: TABLE_OPTION_ROWS.map(({ option, labelKey }) => /* @__PURE__ */ jsxs33("label", { class: "pptx-radio", children: [
13772
- /* @__PURE__ */ jsx39(
14160
+ /* @__PURE__ */ jsx43("div", { class: "pptx-radios", role: "group", "aria-label": t("panel.format.styleOptions"), children: TABLE_OPTION_ROWS.map(({ option, labelKey }) => /* @__PURE__ */ jsxs36("label", { class: "pptx-radio", children: [
14161
+ /* @__PURE__ */ jsx43(
13773
14162
  "input",
13774
14163
  {
13775
14164
  type: "checkbox",
@@ -13782,10 +14171,12 @@ var FormatTab = defineComponent47({
13782
14171
  ] }, option)) })
13783
14172
  ] });
13784
14173
  };
13785
- const field = (key, labelKey) => /* @__PURE__ */ jsx39(
13786
- PanelNumberField,
14174
+ const field = (key, labelKey) => /* @__PURE__ */ jsx43(
14175
+ FormatNumberField,
13787
14176
  {
13788
14177
  label: t(labelKey),
14178
+ property: `geometry.${key === "cx" ? "width" : key === "cy" ? "height" : key}`,
14179
+ min: key === "cx" || key === "cy" ? 0 : void 0,
13789
14180
  value: inches(g[key]),
13790
14181
  unit,
13791
14182
  disabled: readOnly.value,
@@ -13795,18 +14186,18 @@ var FormatTab = defineComponent47({
13795
14186
  }
13796
14187
  );
13797
14188
  return [
13798
- /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__section", children: [
13799
- /* @__PURE__ */ jsx39("h3", { class: "pptx-panel__title", children: t("panel.format.element") }),
13800
- /* @__PURE__ */ jsx39("span", { class: "pptx-chip", children: t(elementKindLabelKey(g, table.value, { chart: chart.value, diagram: diagram.value })) })
14189
+ /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__section", children: [
14190
+ /* @__PURE__ */ jsx43("h3", { class: "pptx-panel__title", children: t("panel.format.element") }),
14191
+ /* @__PURE__ */ jsx43("span", { class: "pptx-chip", children: t(elementKindLabelKey(g, table.value, { chart: chart.value, diagram: diagram.value })) })
13801
14192
  ] }),
13802
- /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__section", children: [
13803
- /* @__PURE__ */ jsx39("h3", { class: "pptx-panel__title", children: t("panel.format.size") }),
13804
- /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__grid", children: [
14193
+ /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__section", children: [
14194
+ /* @__PURE__ */ jsx43("h3", { class: "pptx-panel__title", children: t("panel.format.size") }),
14195
+ /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__grid", children: [
13805
14196
  field("cx", "panel.format.width"),
13806
14197
  field("cy", "panel.format.height")
13807
14198
  ] }),
13808
- /* @__PURE__ */ jsxs33("label", { class: "pptx-radio", children: [
13809
- /* @__PURE__ */ jsx39(
14199
+ /* @__PURE__ */ jsxs36("label", { class: "pptx-radio", children: [
14200
+ /* @__PURE__ */ jsx43(
13810
14201
  "input",
13811
14202
  {
13812
14203
  type: "checkbox",
@@ -13821,31 +14212,34 @@ var FormatTab = defineComponent47({
13821
14212
  t("imageProperties.lockAspect")
13822
14213
  ] })
13823
14214
  ] }),
13824
- /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__section", children: [
13825
- /* @__PURE__ */ jsx39("h3", { class: "pptx-panel__title", children: t("panel.format.position") }),
13826
- /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__grid", children: [
14215
+ /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__section", children: [
14216
+ /* @__PURE__ */ jsx43("h3", { class: "pptx-panel__title", children: t("panel.format.position") }),
14217
+ /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__grid", children: [
13827
14218
  field("x", "panel.format.x"),
13828
14219
  field("y", "panel.format.y")
13829
14220
  ] })
13830
14221
  ] }),
13831
- elementRotates(g, table.value) ? /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__section", children: [
13832
- /* @__PURE__ */ jsx39("h3", { class: "pptx-panel__title", children: t("panel.format.rotation") }),
13833
- /* @__PURE__ */ jsx39("div", { class: "pptx-panel__grid", children: /* @__PURE__ */ jsx39(
13834
- PanelNumberField,
14222
+ elementRotates(g, table.value) ? /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__section", children: [
14223
+ /* @__PURE__ */ jsx43("h3", { class: "pptx-panel__title", children: t("panel.format.rotation") }),
14224
+ /* @__PURE__ */ jsx43("div", { class: "pptx-panel__grid", children: /* @__PURE__ */ jsx43(
14225
+ FormatNumberField,
13835
14226
  {
13836
14227
  label: t("panel.format.angle"),
14228
+ property: "geometry.rotation",
14229
+ min: 0,
14230
+ max: 360,
13837
14231
  value: String(Math.round(g.rot * 10) / 10),
13838
14232
  unit: "\xB0",
13839
14233
  disabled: readOnly.value,
13840
- onCommit: (v) => move({ rot: (v % 360 + 360) % 360 })
14234
+ onCommit: (v) => move({ rot: v })
13841
14235
  }
13842
14236
  ) })
13843
14237
  ] }) : null,
13844
14238
  tableSection(),
13845
- g.textFitting ? /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__section", children: [
13846
- /* @__PURE__ */ jsx39("h3", { class: "pptx-panel__title", children: t("panel.format.textFitting") }),
13847
- /* @__PURE__ */ jsx39("div", { class: "pptx-radios", role: "radiogroup", "aria-label": t("panel.format.textFitting"), children: ["none", "shrink", "shape"].map((mode) => /* @__PURE__ */ jsxs33("label", { class: "pptx-radio", children: [
13848
- /* @__PURE__ */ jsx39(
14239
+ g.textFitting ? /* @__PURE__ */ jsxs36("div", { class: "pptx-panel__section", children: [
14240
+ /* @__PURE__ */ jsx43("h3", { class: "pptx-panel__title", children: t("panel.format.textFitting") }),
14241
+ /* @__PURE__ */ jsx43("div", { class: "pptx-radios", role: "radiogroup", "aria-label": t("panel.format.textFitting"), children: ["none", "shrink", "shape"].map((mode) => /* @__PURE__ */ jsxs36("label", { class: "pptx-radio", children: [
14242
+ /* @__PURE__ */ jsx43(
13849
14243
  "input",
13850
14244
  {
13851
14245
  type: "radio",
@@ -13862,6 +14256,103 @@ var FormatTab = defineComponent47({
13862
14256
  };
13863
14257
  }
13864
14258
  });
14259
+
14260
+ // src/FormatPanel.tsx
14261
+ import { jsx as jsx44, jsxs as jsxs37 } from "vue/jsx-runtime";
14262
+ var formatSectionProps = {
14263
+ section: { type: Object, required: true }
14264
+ };
14265
+ var FormatSection = defineComponent52({
14266
+ name: "FormatSection",
14267
+ props: formatSectionProps,
14268
+ setup(props) {
14269
+ const { t } = useTranslation();
14270
+ const editor = usePptxEditor();
14271
+ const background = useEditorDialog("background");
14272
+ const snapshot = useEditorState((s) => s);
14273
+ const expansion = ref37(0);
14274
+ watch33(
14275
+ editor,
14276
+ (instance, _old, onCleanup) => {
14277
+ if (instance)
14278
+ onCleanup(
14279
+ listenFormatSectionExpansion(instance, () => {
14280
+ expansion.value += 1;
14281
+ })
14282
+ );
14283
+ },
14284
+ { immediate: true }
14285
+ );
14286
+ return () => {
14287
+ void expansion.value;
14288
+ const section = props.section;
14289
+ const category = formatSelectionCategory(snapshot.value);
14290
+ const expanded = formatSectionOpen(editor.value, category, section.id);
14291
+ return /* @__PURE__ */ jsxs37("details", { class: "pptx-format-disclosure", open: expanded, children: [
14292
+ /* @__PURE__ */ jsx44(
14293
+ "summary",
14294
+ {
14295
+ "data-format-toggle": section.id,
14296
+ class: "pptx-format-summary",
14297
+ onClick: (event) => {
14298
+ event.preventDefault();
14299
+ if (editor.value) setFormatSectionOpen(editor.value, category, section.id, !expanded);
14300
+ },
14301
+ children: t(section.labelKey)
14302
+ }
14303
+ ),
14304
+ /* @__PURE__ */ jsxs37("div", { class: "pptx-format-section-body", children: [
14305
+ section.id === "geometry" ? /* @__PURE__ */ jsx44(FormatGeometry, {}) : null,
14306
+ section.id === "fill" || section.id === "effects" ? /* @__PURE__ */ jsx44(FormatDetails, { section: section.id }) : null,
14307
+ section.id === "geometry" ? null : section.id === "chart" ? /* @__PURE__ */ jsx44(ChartDataPane, {}) : section.id === "diagram" ? /* @__PURE__ */ jsx44(DiagramTextPane, {}) : /* @__PURE__ */ jsx44("div", { class: "pptx-format-controls", children: section.slots.filter((slot) => slot !== "slide.background" || background.isAvailable.value).map((slot) => /* @__PURE__ */ jsxs37("div", { class: "pptx-format-control", "data-format-slot": slot, children: [
14308
+ slot !== "shape.lineWidth" ? /* @__PURE__ */ jsx44("span", { class: "pptx-format-control__label", children: t(chromeControlForSlot7(slot).labelKey) }) : null,
14309
+ formatControlMixed(editor.value, slot) ? /* @__PURE__ */ jsx44("span", { class: "pptx-format-mixed", children: t("inspector.mixed") }) : null,
14310
+ slot === "shape.lineWidth" ? /* @__PURE__ */ jsx44(FormatLineWidth, {}) : /* @__PURE__ */ jsx44(ToolbarSlot, { slotId: slot })
14311
+ ] }, slot)) })
14312
+ ] })
14313
+ ] });
14314
+ };
14315
+ }
14316
+ });
14317
+ var formatPanelProps = {
14318
+ sections: { type: Array, default: void 0 },
14319
+ className: { type: String, default: void 0 }
14320
+ };
14321
+ var FormatPanel = defineComponent52({
14322
+ name: "FormatPanel",
14323
+ props: formatPanelProps,
14324
+ slots: Object,
14325
+ setup(props, { slots }) {
14326
+ const editor = usePptxEditor();
14327
+ const snapshot = useEditorState((s) => s);
14328
+ const { t } = useTranslation();
14329
+ const root = ref37(null);
14330
+ watch33(
14331
+ () => formatSelectionCategory(snapshot.value),
14332
+ (category, previous) => {
14333
+ if (category !== previous) {
14334
+ const scroller = root.value?.closest(".pptx-panel__body");
14335
+ if (scroller) scroller.scrollTop = 0;
14336
+ }
14337
+ },
14338
+ { flush: "post" }
14339
+ );
14340
+ return () => /* @__PURE__ */ jsxs37("div", { ref: root, class: ["pptx-format-panel", props.className], children: [
14341
+ snapshot.value.selection.kind === "shapes" && snapshot.value.selection.nodeIds.length > 1 ? /* @__PURE__ */ jsx44("p", { class: "pptx-panel__title", children: t("panel.format.multipleTitle", { count: snapshot.value.selection.nodeIds.length }) }) : snapshot.value.geometry ? /* @__PURE__ */ jsx44("p", { class: "pptx-panel__title", children: snapshot.value.geometry.name }) : null,
14342
+ /* @__PURE__ */ jsx44("div", { class: "pptx-format-sections", children: formatSectionsOf(snapshot.value, props.sections).map((section) => /* @__PURE__ */ jsx44("div", { "data-format-section": section.id, children: slots[section.id] ? slots[section.id]() : /* @__PURE__ */ jsx44(
14343
+ FormatSection,
14344
+ {
14345
+ section
14346
+ },
14347
+ section.id === "diagram" ? section.id : formatTargetKey5(snapshot.value)
14348
+ ) }, section.id)) }, editor.value?.session?.id),
14349
+ slots.default?.()
14350
+ ] });
14351
+ }
14352
+ });
14353
+
14354
+ // src/SidePanel.tsx
14355
+ import { jsx as jsx45, jsxs as jsxs38 } from "vue/jsx-runtime";
13865
14356
  var sidePanelProps = {
13866
14357
  /** The panel's width in CSS pixels. */
13867
14358
  paneWidth: { type: Number, default: void 0 },
@@ -13875,17 +14366,17 @@ var sidePanelProps = {
13875
14366
  tab: { type: String, default: void 0 }
13876
14367
  };
13877
14368
  function packagedPane(tab, t) {
13878
- if (tab === "format") return /* @__PURE__ */ jsx39(FormatTab, {});
13879
- if (tab === "chart") return /* @__PURE__ */ jsx39(ChartDataPane, {});
13880
- if (tab === "diagram") return /* @__PURE__ */ jsx39(DiagramTextPane, {});
13881
- if (tab === "selection") return /* @__PURE__ */ jsx39(PptxEditorSelectionPane, {});
13882
- if (tab === "animations") return /* @__PURE__ */ jsx39(AnimationsPane, {});
13883
- return /* @__PURE__ */ jsxs33("div", { class: "pptx-empty", children: [
13884
- /* @__PURE__ */ jsx39("p", { class: "pptx-empty__title", children: t("panel.comments.emptyTitle") }),
13885
- /* @__PURE__ */ jsx39("p", { class: "pptx-empty__body", children: t("panel.comments.emptyBody") })
14369
+ if (tab === "format") return /* @__PURE__ */ jsx45(FormatPanel, {});
14370
+ if (tab === "chart") return /* @__PURE__ */ jsx45(ChartDataPane, {});
14371
+ if (tab === "diagram") return /* @__PURE__ */ jsx45(DiagramTextPane, {});
14372
+ if (tab === "selection") return /* @__PURE__ */ jsx45(PptxEditorSelectionPane, {});
14373
+ if (tab === "animations") return /* @__PURE__ */ jsx45(AnimationsPane, {});
14374
+ return /* @__PURE__ */ jsxs38("div", { class: "pptx-empty", children: [
14375
+ /* @__PURE__ */ jsx45("p", { class: "pptx-empty__title", children: t("panel.comments.emptyTitle") }),
14376
+ /* @__PURE__ */ jsx45("p", { class: "pptx-empty__body", children: t("panel.comments.emptyBody") })
13886
14377
  ] });
13887
14378
  }
13888
- var PptxEditorSidePanel = defineComponent47({
14379
+ var PptxEditorSidePanel = defineComponent53({
13889
14380
  name: "PptxEditorSidePanel",
13890
14381
  inheritAttrs: false,
13891
14382
  props: sidePanelProps,
@@ -13900,7 +14391,7 @@ var PptxEditorSidePanel = defineComponent47({
13900
14391
  setup(props, { attrs, emit, slots }) {
13901
14392
  const { t } = useTranslation();
13902
14393
  const editor = usePptxEditor();
13903
- const own = ref34(props.tab ?? "format");
14394
+ const own = ref38(props.tab ?? "format");
13904
14395
  const tab = computed21(() => props.tab ?? own.value);
13905
14396
  const chartSelected = useEditorState((s) => !!s.chart);
13906
14397
  const diagramSelected = useEditorState((s) => !!s.diagram);
@@ -13912,8 +14403,8 @@ var PptxEditorSidePanel = defineComponent47({
13912
14403
  emit("tabChange", next);
13913
14404
  emit("update:tab", next);
13914
14405
  };
13915
- const root = ref34(null);
13916
- const focusTab = (pane) => void nextTick7(() => {
14406
+ const root = ref38(null);
14407
+ const focusTab = (pane) => void nextTick8(() => {
13917
14408
  const body = root.value?.querySelector(".pptx-panel__body");
13918
14409
  if (body?.contains(body.ownerDocument.activeElement)) return;
13919
14410
  const current = root.value?.querySelector(
@@ -13921,7 +14412,7 @@ var PptxEditorSidePanel = defineComponent47({
13921
14412
  );
13922
14413
  (current ?? root.value?.querySelector(`[data-tab="${pane}"]`))?.focus();
13923
14414
  });
13924
- watch32(
14415
+ watch34(
13925
14416
  editor,
13926
14417
  (e, _old, onCleanup) => {
13927
14418
  if (!e) return;
@@ -13944,7 +14435,7 @@ var PptxEditorSidePanel = defineComponent47({
13944
14435
  return () => {
13945
14436
  const { class: hostClass, style: hostStyle, ...rest } = attrs;
13946
14437
  const style = [hostStyle, props.style];
13947
- return /* @__PURE__ */ jsxs33(
14438
+ return /* @__PURE__ */ jsxs38(
13948
14439
  "aside",
13949
14440
  {
13950
14441
  ref: root,
@@ -13954,8 +14445,8 @@ var PptxEditorSidePanel = defineComponent47({
13954
14445
  style: props.paneWidth === void 0 ? style : [{ width: `${props.paneWidth}px` }, ...style],
13955
14446
  onMousedown: keepFocus,
13956
14447
  children: [
13957
- /* @__PURE__ */ jsxs33("div", { class: "pptx-panel__head", children: [
13958
- /* @__PURE__ */ jsx39(
14448
+ /* @__PURE__ */ jsxs38("div", { class: "pptx-panel__head", children: [
14449
+ /* @__PURE__ */ jsx45(
13959
14450
  "div",
13960
14451
  {
13961
14452
  class: "pptx-tabs",
@@ -13967,7 +14458,7 @@ var PptxEditorSidePanel = defineComponent47({
13967
14458
  setTab(next);
13968
14459
  e.currentTarget.querySelector(`[data-tab="${next}"]`)?.focus();
13969
14460
  },
13970
- children: tabs.value.map((id) => /* @__PURE__ */ jsxs33(
14461
+ children: tabs.value.map((id) => /* @__PURE__ */ jsxs38(
13971
14462
  "button",
13972
14463
  {
13973
14464
  type: "button",
@@ -13980,17 +14471,17 @@ var PptxEditorSidePanel = defineComponent47({
13980
14471
  tabindex: tab.value === id ? 0 : -1,
13981
14472
  onClick: () => setTab(id),
13982
14473
  children: [
13983
- /* @__PURE__ */ jsx39(Icon, { name: SIDE_PANEL_TAB_ICONS[id] }),
13984
- tab.value === id ? /* @__PURE__ */ jsx39("span", { class: "pptx-tabs__label", "aria-hidden": "true", children: t(`panel.tabs.${id}`) }) : null
14474
+ /* @__PURE__ */ jsx45(Icon, { name: SIDE_PANEL_TAB_ICONS[id] }),
14475
+ tab.value === id ? /* @__PURE__ */ jsx45("span", { class: "pptx-tabs__label", "aria-hidden": "true", children: t(`panel.tabs.${id}`) }) : null
13985
14476
  ]
13986
14477
  },
13987
14478
  id
13988
14479
  ))
13989
14480
  }
13990
14481
  ),
13991
- props.onClose ? /* @__PURE__ */ jsx39(ToolButton, { label: t("panel.close"), icon: "close", onClick: () => props.onClose?.() }) : null
14482
+ props.onClose ? /* @__PURE__ */ jsx45(ToolButton, { label: t("panel.close"), icon: "close", onClick: () => props.onClose?.() }) : null
13992
14483
  ] }),
13993
- /* @__PURE__ */ jsx39(
14484
+ /* @__PURE__ */ jsx45(
13994
14485
  "div",
13995
14486
  {
13996
14487
  class: "pptx-panel__body",
@@ -14007,11 +14498,11 @@ var PptxEditorSidePanel = defineComponent47({
14007
14498
  });
14008
14499
 
14009
14500
  // src/panes.tsx
14010
- import { jsx as jsx40, jsxs as jsxs34 } from "vue/jsx-runtime";
14501
+ import { jsx as jsx46, jsxs as jsxs39 } from "vue/jsx-runtime";
14011
14502
  var sameSlides2 = (a, b) => a.length === b.length && a.every((s, i) => s === b[i]);
14012
14503
  var sameIndices2 = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
14013
14504
  var clickMode = slideClickMode;
14014
- var Thumbnail = defineComponent48({
14505
+ var Thumbnail = defineComponent54({
14015
14506
  name: "PptxThumbnail",
14016
14507
  props: {
14017
14508
  slide: { type: Object, required: true },
@@ -14019,19 +14510,19 @@ var Thumbnail = defineComponent48({
14019
14510
  },
14020
14511
  setup(props) {
14021
14512
  const editor = usePptxEditor();
14022
- const box = ref35(null);
14513
+ const box = ref39(null);
14023
14514
  let dispose = null;
14024
14515
  const paint = () => {
14025
14516
  dispose?.();
14026
14517
  dispose = editor.value && box.value ? editor.value.renderThumbnail(props.slide.index, box.value, { defer: true }) : null;
14027
14518
  };
14028
14519
  onMounted19(paint);
14029
- watch33(() => [editor.value, props.slide], paint, { flush: "post" });
14520
+ watch35(() => [editor.value, props.slide], paint, { flush: "post" });
14030
14521
  onBeforeUnmount11(() => {
14031
14522
  dispose?.();
14032
14523
  dispose = null;
14033
14524
  });
14034
- return () => /* @__PURE__ */ jsx40(
14525
+ return () => /* @__PURE__ */ jsx46(
14035
14526
  "div",
14036
14527
  {
14037
14528
  ref: box,
@@ -14043,7 +14534,7 @@ var Thumbnail = defineComponent48({
14043
14534
  );
14044
14535
  }
14045
14536
  });
14046
- var RailItem = defineComponent48({
14537
+ var RailItem = defineComponent54({
14047
14538
  name: "PptxRailItem",
14048
14539
  props: {
14049
14540
  slide: { type: Object, required: true },
@@ -14063,7 +14554,7 @@ var RailItem = defineComponent48({
14063
14554
  setup(props) {
14064
14555
  return () => {
14065
14556
  const { slide: s, on } = props;
14066
- return /* @__PURE__ */ jsxs34(
14557
+ return /* @__PURE__ */ jsxs39(
14067
14558
  "li",
14068
14559
  {
14069
14560
  class: "pptx-rail__item",
@@ -14084,9 +14575,9 @@ var RailItem = defineComponent48({
14084
14575
  onClick: (e) => on.click(s.index, e),
14085
14576
  onContextmenu: (e) => on.menu(s.index, e),
14086
14577
  children: [
14087
- /* @__PURE__ */ jsx40("span", { class: "pptx-rail__number", "aria-hidden": "true", children: s.index + 1 }),
14088
- /* @__PURE__ */ jsx40("span", { class: "pptx-sr-only", children: props.name }),
14089
- /* @__PURE__ */ jsx40(Thumbnail, { slide: s, ratio: props.ratio })
14578
+ /* @__PURE__ */ jsx46("span", { class: "pptx-rail__number", "aria-hidden": "true", children: s.index + 1 }),
14579
+ /* @__PURE__ */ jsx46("span", { class: "pptx-sr-only", children: props.name }),
14580
+ /* @__PURE__ */ jsx46(Thumbnail, { slide: s, ratio: props.ratio })
14090
14581
  ]
14091
14582
  }
14092
14583
  );
@@ -14095,7 +14586,7 @@ var RailItem = defineComponent48({
14095
14586
  });
14096
14587
  function useFocusFollowsCurrent(list, item, watched) {
14097
14588
  let focused = null;
14098
- watch33(
14589
+ watch35(
14099
14590
  () => watched().join("|"),
14100
14591
  () => followCurrentSlide(list.value, item, focused),
14101
14592
  { flush: "post" }
@@ -14151,7 +14642,7 @@ function restAttrs(attrs) {
14151
14642
  return rest;
14152
14643
  }
14153
14644
  function usePaneOpen(props, emit) {
14154
- const own = ref35(props.defaultOpen ?? true);
14645
+ const own = ref39(props.defaultOpen ?? true);
14155
14646
  return {
14156
14647
  open: computed22(() => props.open ?? own.value),
14157
14648
  setOpen: (next) => {
@@ -14160,20 +14651,20 @@ function usePaneOpen(props, emit) {
14160
14651
  }
14161
14652
  };
14162
14653
  }
14163
- var SlideRailRoot = defineComponent48({
14654
+ var SlideRailRoot = defineComponent54({
14164
14655
  name: "PptxEditorSlideRail",
14165
14656
  inheritAttrs: false,
14166
14657
  props: slideRailProps,
14167
14658
  emits: { "update:open": (_open) => true },
14168
14659
  setup(props, { attrs, emit, slots }) {
14169
14660
  const pane = usePaneOpen(props, emit);
14170
- const rail = ref35(null);
14171
- const listId = useId20();
14661
+ const rail = ref39(null);
14662
+ const listId = useId21();
14172
14663
  let focusToggle = false;
14173
14664
  const setOpen = (next) => {
14174
14665
  focusToggle = rail.value?.contains(document.activeElement) ?? false;
14175
14666
  pane.setOpen(next);
14176
- void nextTick8(() => {
14667
+ void nextTick9(() => {
14177
14668
  focusToggle = false;
14178
14669
  });
14179
14670
  };
@@ -14184,24 +14675,24 @@ var SlideRailRoot = defineComponent48({
14184
14675
  const selected = useEditorState((s) => s.selectedSlides, sameIndices2);
14185
14676
  const ratio = useEditorState((s) => s.slideHeight / s.slideWidth);
14186
14677
  const readOnly = useEditorState((s) => s.mode === "view");
14187
- const list = ref35(null);
14678
+ const list = ref39(null);
14188
14679
  const count = () => slides.value.length;
14189
14680
  const opening = useEditorState((s) => (s.pendingSlides ?? 0) > 0);
14190
14681
  const loading = useEditorState((s) => s.isOpening === true);
14191
- const grown = ref35(0);
14682
+ const grown = ref39(0);
14192
14683
  const mount = createProgressiveMount(() => grown.value += 1);
14193
14684
  onMounted19(() => mount.follow(count()));
14194
14685
  onUpdated4(() => mount.follow(count()));
14195
14686
  onUnmounted4(() => mount.dispose());
14196
14687
  const menu = shallowRef28(null);
14197
14688
  const gallery = shallowRef28(null);
14198
- const actions = ref35(null);
14689
+ const actions = ref39(null);
14199
14690
  const sections = useSlideSections();
14200
14691
  const grouped = computed22(() => groupSlideSections2(sections.value, count()));
14201
14692
  const orientation = () => resolveRailOrientation2(props.orientation, "PptxEditorSlideRail");
14202
14693
  const drag = useSlideDrag(() => railDragAxis(orientation()), selected, readOnly, grouped);
14203
14694
  const folded = shallowRef28(false);
14204
- watch33(
14695
+ watch35(
14205
14696
  () => [rail.value, orientation(), pane.open.value],
14206
14697
  ([el, axis], _old, onCleanup) => onCleanup(
14207
14698
  watchRailFold(el, axis, (next) => {
@@ -14217,7 +14708,7 @@ var SlideRailRoot = defineComponent48({
14217
14708
  onMounted19(readDirection);
14218
14709
  onUpdated4(readDirection);
14219
14710
  const collapsed = useCollapsedSections();
14220
- const renaming = ref35(null);
14711
+ const renaming = ref39(null);
14221
14712
  useOpenCurrentSection(grouped);
14222
14713
  useSectionRenameRequests(
14223
14714
  (id) => {
@@ -14247,12 +14738,12 @@ var SlideRailRoot = defineComponent48({
14247
14738
  count(),
14248
14739
  pane.open.value
14249
14740
  ]);
14250
- watch33(
14741
+ watch35(
14251
14742
  list,
14252
14743
  (el, _old, onCleanup) => onCleanup(keepCurrentSlideInView2(el, ".pptx-rail__item")),
14253
14744
  { flush: "post" }
14254
14745
  );
14255
- watch33(
14746
+ watch35(
14256
14747
  () => pane.open.value,
14257
14748
  (open) => {
14258
14749
  const active = document.activeElement;
@@ -14330,7 +14821,7 @@ var SlideRailRoot = defineComponent48({
14330
14821
  const here = s.index === current.value;
14331
14822
  const drop = drag.marker(s.index);
14332
14823
  const inputs = [place?.setSize, place?.posInSet, ratio.value, chosen, here, role, props.t];
14333
- return memoItem(s, [...inputs, labels, drop, readOnly.value], () => /* @__PURE__ */ jsx40(
14824
+ return memoItem(s, [...inputs, labels, drop, readOnly.value], () => /* @__PURE__ */ jsx46(
14334
14825
  RailItem,
14335
14826
  {
14336
14827
  setSize: place?.setSize,
@@ -14352,7 +14843,7 @@ var SlideRailRoot = defineComponent48({
14352
14843
  return () => {
14353
14844
  if (masterView.value && props.open === false) return null;
14354
14845
  if (masterView.value)
14355
- return /* @__PURE__ */ jsx40(
14846
+ return /* @__PURE__ */ jsx46(
14356
14847
  MasterRail,
14357
14848
  {
14358
14849
  ...restAttrs(attrs),
@@ -14368,7 +14859,7 @@ var SlideRailRoot = defineComponent48({
14368
14859
  const style = [attrs.style, props.style];
14369
14860
  if (!open && !toggle) return null;
14370
14861
  if (!open)
14371
- return /* @__PURE__ */ jsx40(
14862
+ return /* @__PURE__ */ jsx46(
14372
14863
  "nav",
14373
14864
  {
14374
14865
  ...restAttrs(attrs),
@@ -14396,7 +14887,7 @@ var SlideRailRoot = defineComponent48({
14396
14887
  itemLimit = inView ? inView.limit : mounted;
14397
14888
  isSelected = new Set(selected.value);
14398
14889
  labels = slideItemLabels(t);
14399
- return /* @__PURE__ */ jsxs34(
14890
+ return /* @__PURE__ */ jsxs39(
14400
14891
  "nav",
14401
14892
  {
14402
14893
  ...restAttrs(attrs),
@@ -14407,7 +14898,7 @@ var SlideRailRoot = defineComponent48({
14407
14898
  "data-orientation": orientation(),
14408
14899
  style: paneStyle(props.paneWidth, style),
14409
14900
  children: [
14410
- /* @__PURE__ */ jsx40(
14901
+ /* @__PURE__ */ jsx46(
14411
14902
  "ol",
14412
14903
  {
14413
14904
  ref: list,
@@ -14424,7 +14915,7 @@ var SlideRailRoot = defineComponent48({
14424
14915
  },
14425
14916
  children: groups && inView ? inView.sections.map((sec) => {
14426
14917
  const shut = collapsed.value.includes(sec.id);
14427
- return /* @__PURE__ */ jsx40(
14918
+ return /* @__PURE__ */ jsx46(
14428
14919
  SectionNode,
14429
14920
  {
14430
14921
  section: sec,
@@ -14449,7 +14940,7 @@ var SlideRailRoot = defineComponent48({
14449
14940
  }) : slides.value.slice(0, mounted).map(item)
14450
14941
  }
14451
14942
  ),
14452
- /* @__PURE__ */ jsx40(
14943
+ /* @__PURE__ */ jsx46(
14453
14944
  "div",
14454
14945
  {
14455
14946
  ref: actions,
@@ -14459,7 +14950,7 @@ var SlideRailRoot = defineComponent48({
14459
14950
  children: content
14460
14951
  }
14461
14952
  ),
14462
- gallery.value ? /* @__PURE__ */ jsx40(
14953
+ gallery.value ? /* @__PURE__ */ jsx46(
14463
14954
  Popover,
14464
14955
  {
14465
14956
  anchor: gallery.value,
@@ -14467,7 +14958,7 @@ var SlideRailRoot = defineComponent48({
14467
14958
  gallery.value = null;
14468
14959
  },
14469
14960
  label: t("rail.chooseLayout"),
14470
- children: () => /* @__PURE__ */ jsx40(
14961
+ children: () => /* @__PURE__ */ jsx46(
14471
14962
  LayoutGallery,
14472
14963
  {
14473
14964
  onChange: (layoutId) => {
@@ -14478,7 +14969,7 @@ var SlideRailRoot = defineComponent48({
14478
14969
  )
14479
14970
  }
14480
14971
  ) : null,
14481
- /* @__PURE__ */ jsx40(
14972
+ /* @__PURE__ */ jsx46(
14482
14973
  RailMenuHost,
14483
14974
  {
14484
14975
  open: menu.value ? {
@@ -14514,7 +15005,7 @@ var zoomPillProps = {
14514
15005
  /** A class name added to the pill, as React's `className`. A host `class` also works. */
14515
15006
  className: { type: String, default: void 0 }
14516
15007
  };
14517
- var PptxEditorZoomPill = defineComponent48({
15008
+ var PptxEditorZoomPill = defineComponent54({
14518
15009
  name: "PptxEditorZoomPill",
14519
15010
  props: zoomPillProps,
14520
15011
  setup(props) {
@@ -14524,9 +15015,9 @@ var PptxEditorZoomPill = defineComponent48({
14524
15015
  const fit = useEditorState((s) => s.fitZoom);
14525
15016
  const off = useEditorState((s) => s.presentationView === "slideSorter");
14526
15017
  const reason = () => off.value ? t("disabled.sorterZoom") : null;
14527
- const anchor = ref35(null);
14528
- const open = ref35(false);
14529
- watch33(off, (now) => {
15018
+ const anchor = ref39(null);
15019
+ const open = ref39(false);
15020
+ watch35(off, (now) => {
14530
15021
  if (now) open.value = false;
14531
15022
  });
14532
15023
  const step = (dir) => {
@@ -14544,7 +15035,7 @@ var PptxEditorZoomPill = defineComponent48({
14544
15035
  };
14545
15036
  return () => {
14546
15037
  const levelLabel = off.value ? t("zoom.ariaLabel") : t("zoom.levelAriaLabel", { percent: Math.round(zoom.value * 100) });
14547
- return /* @__PURE__ */ jsxs34(
15038
+ return /* @__PURE__ */ jsxs39(
14548
15039
  "div",
14549
15040
  {
14550
15041
  class: ["pptx-zoom", props.className],
@@ -14552,7 +15043,7 @@ var PptxEditorZoomPill = defineComponent48({
14552
15043
  "aria-label": t("zoom.ariaLabel"),
14553
15044
  onMousedown: keepFocus,
14554
15045
  children: [
14555
- /* @__PURE__ */ jsx40(
15046
+ /* @__PURE__ */ jsx46(
14556
15047
  ToolButton,
14557
15048
  {
14558
15049
  label: t("zoom.zoomOut"),
@@ -14562,7 +15053,7 @@ var PptxEditorZoomPill = defineComponent48({
14562
15053
  disabledReason: reason() ?? limit(-1)
14563
15054
  }
14564
15055
  ),
14565
- /* @__PURE__ */ jsxs34(
15056
+ /* @__PURE__ */ jsxs39(
14566
15057
  "button",
14567
15058
  {
14568
15059
  ref: anchor,
@@ -14579,12 +15070,12 @@ var PptxEditorZoomPill = defineComponent48({
14579
15070
  },
14580
15071
  children: [
14581
15072
  off.value ? "\u2013" : t("zoom.level", { percent: Math.round(zoom.value * 100) }),
14582
- /* @__PURE__ */ jsx40(Icon, { name: "arrow_drop_down", className: "pptx-icon pptx-toolbar__caret" })
15073
+ /* @__PURE__ */ jsx46(Icon, { name: "arrow_drop_down", className: "pptx-icon pptx-toolbar__caret" })
14583
15074
  ]
14584
15075
  }
14585
15076
  ),
14586
15077
  levelOff.note(),
14587
- /* @__PURE__ */ jsx40(
15078
+ /* @__PURE__ */ jsx46(
14588
15079
  ToolButton,
14589
15080
  {
14590
15081
  label: t("zoom.zoomIn"),
@@ -14594,7 +15085,7 @@ var PptxEditorZoomPill = defineComponent48({
14594
15085
  disabledReason: reason() ?? limit(1)
14595
15086
  }
14596
15087
  ),
14597
- open.value && !off.value ? /* @__PURE__ */ jsx40(
15088
+ open.value && !off.value ? /* @__PURE__ */ jsx46(
14598
15089
  Popover,
14599
15090
  {
14600
15091
  anchor: anchor.value,
@@ -14603,8 +15094,8 @@ var PptxEditorZoomPill = defineComponent48({
14603
15094
  },
14604
15095
  align: "end",
14605
15096
  children: () => [
14606
- /* @__PURE__ */ jsx40(MenuItem, { checked: fit.value, onSelect: () => pick("fit"), children: () => t("zoom.fit") }),
14607
- ...ZOOM_MENU_LEVELS.map((z) => /* @__PURE__ */ jsx40(
15097
+ /* @__PURE__ */ jsx46(MenuItem, { checked: fit.value, onSelect: () => pick("fit"), children: () => t("zoom.fit") }),
15098
+ ...ZOOM_MENU_LEVELS.map((z) => /* @__PURE__ */ jsx46(
14608
15099
  MenuItem,
14609
15100
  {
14610
15101
  checked: !fit.value && Math.abs(z - zoom.value) < 1e-3,
@@ -14626,11 +15117,11 @@ var PptxEditorZoomPill = defineComponent48({
14626
15117
  // src/EditNotice.tsx
14627
15118
  import {
14628
15119
  computed as computed23,
14629
- defineComponent as defineComponent49,
15120
+ defineComponent as defineComponent55,
14630
15121
  onBeforeUnmount as onBeforeUnmount12,
14631
15122
  onScopeDispose as onScopeDispose8,
14632
15123
  shallowRef as shallowRef29,
14633
- watch as watch34,
15124
+ watch as watch36,
14634
15125
  watchEffect as watchEffect2
14635
15126
  } from "vue";
14636
15127
  import {
@@ -14644,7 +15135,7 @@ import {
14644
15135
  REMOVAL_NOTICE_MS,
14645
15136
  removalNoticeShows
14646
15137
  } from "@pptx-editor.dev/core/editor";
14647
- import { jsx as jsx41, jsxs as jsxs35 } from "vue/jsx-runtime";
15138
+ import { jsx as jsx47, jsxs as jsxs40 } from "vue/jsx-runtime";
14648
15139
  function rejectionMessage(t, rejection) {
14649
15140
  return editRejectionMessage(t, rejection);
14650
15141
  }
@@ -14653,7 +15144,7 @@ var pptxEditorEditNoticeProps = {
14653
15144
  /** A class name added to the notice, as React's `className`. A host `class` also works. */
14654
15145
  className: { type: String, default: void 0 }
14655
15146
  };
14656
- var PptxEditorEditNotice = defineComponent49({
15147
+ var PptxEditorEditNotice = defineComponent55({
14657
15148
  name: "PptxEditorEditNotice",
14658
15149
  inheritAttrs: false,
14659
15150
  props: pptxEditorEditNoticeProps,
@@ -14675,7 +15166,7 @@ var PptxEditorEditNotice = defineComponent49({
14675
15166
  const covered = computed23(
14676
15167
  () => linkEntry() !== false && linkPopupShowsRejection(linkPopup.value, rejection.value) || fieldShowsRejection(rejection.value)
14677
15168
  );
14678
- watch34(
15169
+ watch36(
14679
15170
  covered,
14680
15171
  (now) => {
14681
15172
  if (now) dismissed.value = rejection.value;
@@ -14684,7 +15175,7 @@ var PptxEditorEditNotice = defineComponent49({
14684
15175
  );
14685
15176
  const closed = shallowRef29(null);
14686
15177
  const held = shallowRef29(false);
14687
- watch34(
15178
+ watch36(
14688
15179
  () => removal.value?.serial,
14689
15180
  () => {
14690
15181
  held.value = false;
@@ -14705,7 +15196,7 @@ var PptxEditorEditNotice = defineComponent49({
14705
15196
  const classes = ["pptx-edit-notice", attrs.class, props.className];
14706
15197
  const refused = rejection.value;
14707
15198
  if (!covered.value && editNoticeShows(refused, dismissed.value))
14708
- return /* @__PURE__ */ jsxs35(
15199
+ return /* @__PURE__ */ jsxs40(
14709
15200
  "div",
14710
15201
  {
14711
15202
  ...attrs,
@@ -14714,8 +15205,8 @@ var PptxEditorEditNotice = defineComponent49({
14714
15205
  role: "status",
14715
15206
  onMousedown: keepFocus,
14716
15207
  children: [
14717
- /* @__PURE__ */ jsx41("span", { class: "pptx-edit-notice__text", children: rejectionMessage(t, refused) }),
14718
- /* @__PURE__ */ jsx41(
15208
+ /* @__PURE__ */ jsx47("span", { class: "pptx-edit-notice__text", children: rejectionMessage(t, refused) }),
15209
+ /* @__PURE__ */ jsx47(
14719
15210
  ToolButton,
14720
15211
  {
14721
15212
  label: t("notice.dismiss"),
@@ -14730,7 +15221,7 @@ var PptxEditorEditNotice = defineComponent49({
14730
15221
  );
14731
15222
  const removed = removal.value;
14732
15223
  if (!removalNoticeShows(removed, closed.value)) return null;
14733
- return /* @__PURE__ */ jsxs35(
15224
+ return /* @__PURE__ */ jsxs40(
14734
15225
  "div",
14735
15226
  {
14736
15227
  ...attrs,
@@ -14743,8 +15234,8 @@ var PptxEditorEditNotice = defineComponent49({
14743
15234
  onFocusin: () => held.value = true,
14744
15235
  onFocusout: () => held.value = false,
14745
15236
  children: [
14746
- /* @__PURE__ */ jsx41("span", { class: "pptx-edit-notice__text", children: editRemovalMessage(t, removed) }),
14747
- /* @__PURE__ */ jsx41(
15237
+ /* @__PURE__ */ jsx47("span", { class: "pptx-edit-notice__text", children: editRemovalMessage(t, removed) }),
15238
+ /* @__PURE__ */ jsx47(
14748
15239
  "button",
14749
15240
  {
14750
15241
  type: "button",
@@ -14758,7 +15249,7 @@ var PptxEditorEditNotice = defineComponent49({
14758
15249
  children: t("notice.undo")
14759
15250
  }
14760
15251
  ),
14761
- /* @__PURE__ */ jsx41(
15252
+ /* @__PURE__ */ jsx47(
14762
15253
  ToolButton,
14763
15254
  {
14764
15255
  label: t("notice.dismiss"),
@@ -14777,13 +15268,13 @@ var PptxEditorEditNotice = defineComponent49({
14777
15268
  });
14778
15269
 
14779
15270
  // src/SlideSorter.tsx
14780
- import { jsx as jsx42, jsxs as jsxs36 } from "vue/jsx-runtime";
15271
+ import { jsx as jsx48, jsxs as jsxs41 } from "vue/jsx-runtime";
14781
15272
  var sameList = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
14782
15273
  var slideSorterProps = {
14783
15274
  /** A class name added to the sorter, as React's `className`. A host `class` also works. */
14784
15275
  className: { type: String, default: void 0 }
14785
15276
  };
14786
- var PptxEditorSlideSorter = defineComponent50({
15277
+ var PptxEditorSlideSorter = defineComponent56({
14787
15278
  name: "PptxEditorSlideSorter",
14788
15279
  props: slideSorterProps,
14789
15280
  setup(props) {
@@ -14800,10 +15291,10 @@ var PptxEditorSlideSorter = defineComponent50({
14800
15291
  const collapsed = useCollapsedSections();
14801
15292
  useOpenCurrentSection(grouped);
14802
15293
  useSorterRegistration();
14803
- const list = ref36(null);
15294
+ const list = ref40(null);
14804
15295
  const drag = useSlideDrag("x", selected, readOnly, grouped);
14805
15296
  const menu = shallowRef30(null);
14806
- const renaming = ref36(null);
15297
+ const renaming = ref40(null);
14807
15298
  useSectionRenameRequests((id) => {
14808
15299
  renaming.value = id;
14809
15300
  });
@@ -14852,7 +15343,7 @@ var PptxEditorSlideSorter = defineComponent50({
14852
15343
  const groups = grouped.value;
14853
15344
  const own = sectionOfSlide2(groups, current.value);
14854
15345
  const shut = !!own && collapsed.value.includes(own.id);
14855
- const item = (s) => /* @__PURE__ */ jsxs36(
15346
+ const item = (s) => /* @__PURE__ */ jsxs41(
14856
15347
  "li",
14857
15348
  {
14858
15349
  class: "pptx-sorter__item",
@@ -14878,15 +15369,15 @@ var PptxEditorSlideSorter = defineComponent50({
14878
15369
  );
14879
15370
  },
14880
15371
  children: [
14881
- /* @__PURE__ */ jsx42(Thumbnail, { slide: s, ratio: ratio.value }),
14882
- /* @__PURE__ */ jsx42("span", { class: "pptx-sorter__number", "aria-hidden": "true", children: s.index + 1 }),
14883
- /* @__PURE__ */ jsx42("span", { class: "pptx-sr-only", children: slideItemName2(t, s) })
15372
+ /* @__PURE__ */ jsx48(Thumbnail, { slide: s, ratio: ratio.value }),
15373
+ /* @__PURE__ */ jsx48("span", { class: "pptx-sorter__number", "aria-hidden": "true", children: s.index + 1 }),
15374
+ /* @__PURE__ */ jsx48("span", { class: "pptx-sr-only", children: slideItemName2(t, s) })
14884
15375
  ]
14885
15376
  },
14886
15377
  s.id
14887
15378
  );
14888
- return /* @__PURE__ */ jsxs36("section", { class: ["pptx-sorter", props.className], "aria-label": t("sorter.ariaLabel"), children: [
14889
- /* @__PURE__ */ jsx42(
15379
+ return /* @__PURE__ */ jsxs41("section", { class: ["pptx-sorter", props.className], "aria-label": t("sorter.ariaLabel"), children: [
15380
+ /* @__PURE__ */ jsx48(
14890
15381
  "ol",
14891
15382
  {
14892
15383
  ref: list,
@@ -14899,7 +15390,7 @@ var PptxEditorSlideSorter = defineComponent50({
14899
15390
  trackFocus(e);
14900
15391
  trackCollapse(e);
14901
15392
  },
14902
- children: groups ? groups.map((sec) => /* @__PURE__ */ jsx42(
15393
+ children: groups ? groups.map((sec) => /* @__PURE__ */ jsx48(
14903
15394
  SectionNode,
14904
15395
  {
14905
15396
  section: sec,
@@ -14917,10 +15408,10 @@ var PptxEditorSlideSorter = defineComponent50({
14917
15408
  children: () => slides.value.slice(sec.firstSlide, sec.firstSlide + sec.slideCount).map(item)
14918
15409
  },
14919
15410
  sec.id
14920
- )) : /* @__PURE__ */ jsx42("li", { role: "presentation", class: "pptx-sorter__section", children: /* @__PURE__ */ jsx42("ol", { role: "group", class: "pptx-sorter__grid", children: slides.value.map(item) }) })
15411
+ )) : /* @__PURE__ */ jsx48("li", { role: "presentation", class: "pptx-sorter__section", children: /* @__PURE__ */ jsx48("ol", { role: "group", class: "pptx-sorter__grid", children: slides.value.map(item) }) })
14921
15412
  }
14922
15413
  ),
14923
- /* @__PURE__ */ jsx42(
15414
+ /* @__PURE__ */ jsx48(
14924
15415
  RailMenuHost,
14925
15416
  {
14926
15417
  open: menu.value ? {
@@ -14939,15 +15430,15 @@ var PptxEditorSlideSorter = defineComponent50({
14939
15430
  };
14940
15431
  }
14941
15432
  });
14942
- var ReadOnlyBadge = defineComponent50({
15433
+ var ReadOnlyBadge = defineComponent56({
14943
15434
  name: "ReadOnlyBadge",
14944
15435
  setup() {
14945
15436
  const { t } = useTranslation();
14946
15437
  const damaged = useEditorState((s) => s.readOnlyReason === "damaged-slide");
14947
- return () => damaged.value ? /* @__PURE__ */ jsx42("span", { class: "pptx-statusbar__read-only", role: "status", "data-reason": "damaged-slide", children: t("statusBar.readOnlyDamaged") }) : null;
15438
+ return () => damaged.value ? /* @__PURE__ */ jsx48("span", { class: "pptx-statusbar__read-only", role: "status", "data-reason": "damaged-slide", children: t("statusBar.readOnlyDamaged") }) : null;
14948
15439
  }
14949
15440
  });
14950
- var ViewSwitch = defineComponent50({
15441
+ var ViewSwitch = defineComponent56({
14951
15442
  name: "PptxViewSwitch",
14952
15443
  setup() {
14953
15444
  const { t } = useTranslation();
@@ -14955,7 +15446,7 @@ var ViewSwitch = defineComponent50({
14955
15446
  const options = STATUS_BAR_VIEW_OPTIONS;
14956
15447
  const off = computed24(() => !cmd.isEnabled.value);
14957
15448
  const reason = computed24(
14958
- () => cmd.disabledReason.value ? translateKeyOrText16(t, cmd.disabledReason.value) : null
15449
+ () => cmd.disabledReason.value ? translateKeyOrText19(t, cmd.disabledReason.value) : null
14959
15450
  );
14960
15451
  const offAttrs = useAriaDisabled(off, reason);
14961
15452
  const pick = (e, step) => {
@@ -14975,7 +15466,7 @@ var ViewSwitch = defineComponent50({
14975
15466
  ArrowRight: 1,
14976
15467
  ArrowDown: 1
14977
15468
  };
14978
- return () => /* @__PURE__ */ jsxs36(
15469
+ return () => /* @__PURE__ */ jsxs41(
14979
15470
  "div",
14980
15471
  {
14981
15472
  class: "pptx-zoom pptx-view-switch",
@@ -14987,7 +15478,7 @@ var ViewSwitch = defineComponent50({
14987
15478
  const on = cmd.value.value === o.value;
14988
15479
  const tabStop = on || i === 0 && !options.some((x) => x.value === cmd.value.value);
14989
15480
  const label = t(o.labelKey);
14990
- return /* @__PURE__ */ jsx42(
15481
+ return /* @__PURE__ */ jsx48(
14991
15482
  "button",
14992
15483
  {
14993
15484
  type: "button",
@@ -15009,7 +15500,7 @@ var ViewSwitch = defineComponent50({
15009
15500
  e.preventDefault();
15010
15501
  pick(e, step);
15011
15502
  },
15012
- children: /* @__PURE__ */ jsx42(Icon, { paths: o.paths ?? null })
15503
+ children: /* @__PURE__ */ jsx48(Icon, { paths: o.paths ?? null })
15013
15504
  },
15014
15505
  o.value
15015
15506
  );
@@ -15020,13 +15511,13 @@ var ViewSwitch = defineComponent50({
15020
15511
  );
15021
15512
  }
15022
15513
  });
15023
- var DefaultWorkspace = defineComponent50({
15514
+ var DefaultWorkspace = defineComponent56({
15024
15515
  name: "PptxDefaultWorkspace",
15025
15516
  setup(_props, { slots }) {
15026
15517
  const editor = usePptxEditor();
15027
15518
  const view = useEditorState((s) => s.presentationView ?? "normal");
15028
- const box = ref36(null);
15029
- watch35(
15519
+ const box = ref40(null);
15520
+ watch37(
15030
15521
  view,
15031
15522
  () => {
15032
15523
  const active = box.value?.ownerDocument.activeElement;
@@ -15044,26 +15535,26 @@ var DefaultWorkspace = defineComponent50({
15044
15535
  inset?.dispose();
15045
15536
  inset = null;
15046
15537
  });
15047
- return () => /* @__PURE__ */ jsxs36("div", { ref: box, class: "pptx-default__views", children: [
15048
- view.value === "slideSorter" ? /* @__PURE__ */ jsx42("div", { class: "pptx-default__workspace", children: /* @__PURE__ */ jsxs36("div", { class: "pptx-default__main", children: [
15049
- /* @__PURE__ */ jsx42(PptxEditorSlideSorter, {}),
15050
- /* @__PURE__ */ jsx42(PptxEditorEditNotice, {})
15538
+ return () => /* @__PURE__ */ jsxs41("div", { ref: box, class: "pptx-default__views", children: [
15539
+ view.value === "slideSorter" ? /* @__PURE__ */ jsx48("div", { class: "pptx-default__workspace", children: /* @__PURE__ */ jsxs41("div", { class: "pptx-default__main", children: [
15540
+ /* @__PURE__ */ jsx48(PptxEditorSlideSorter, {}),
15541
+ /* @__PURE__ */ jsx48(PptxEditorEditNotice, {})
15051
15542
  ] }) }) : slots.normal?.(),
15052
15543
  slots.overlay?.(),
15053
- slots.status ? slots.status() : /* @__PURE__ */ jsxs36("div", { class: "pptx-statusbar", children: [
15054
- /* @__PURE__ */ jsx42(ReadOnlyBadge, {}),
15055
- /* @__PURE__ */ jsx42(ViewSwitch, {}),
15056
- /* @__PURE__ */ jsx42(PptxEditorZoomPill, {})
15544
+ slots.status ? slots.status() : /* @__PURE__ */ jsxs41("div", { class: "pptx-statusbar", children: [
15545
+ /* @__PURE__ */ jsx48(ReadOnlyBadge, {}),
15546
+ /* @__PURE__ */ jsx48(ViewSwitch, {}),
15547
+ /* @__PURE__ */ jsx48(PptxEditorZoomPill, {})
15057
15548
  ] })
15058
15549
  ] });
15059
15550
  }
15060
15551
  });
15061
- var SlideSorterWatch = defineComponent50({
15552
+ var SlideSorterWatch = defineComponent56({
15062
15553
  name: "PptxSlideSorterWatch",
15063
15554
  setup() {
15064
15555
  const editor = usePptxEditor();
15065
15556
  const sorter = useEditorState((s) => s.presentationView === "slideSorter");
15066
- watch35(
15557
+ watch37(
15067
15558
  [sorter, editor],
15068
15559
  ([on, ed]) => {
15069
15560
  if (on && ed && !slideSorterMounted(ed)) warnSlideSorterUnmounted();
@@ -15075,23 +15566,23 @@ var SlideSorterWatch = defineComponent50({
15075
15566
  });
15076
15567
 
15077
15568
  // src/ChromeTooltip.tsx
15078
- import { Teleport as Teleport4, defineComponent as defineComponent51, onMounted as onMounted21, onUnmounted as onUnmounted5, ref as ref37, shallowRef as shallowRef31, watch as watch36 } from "vue";
15569
+ import { Teleport as Teleport4, defineComponent as defineComponent57, onMounted as onMounted21, onUnmounted as onUnmounted5, ref as ref41, shallowRef as shallowRef31, watch as watch38 } from "vue";
15079
15570
  import {
15080
15571
  listenChromeTooltips,
15081
15572
  positionChromeTooltip
15082
15573
  } from "@pptx-editor.dev/core/editor";
15083
- import { jsx as jsx43, jsxs as jsxs37 } from "vue/jsx-runtime";
15084
- var ChromeTooltip = defineComponent51({
15574
+ import { jsx as jsx49, jsxs as jsxs42 } from "vue/jsx-runtime";
15575
+ var ChromeTooltip = defineComponent57({
15085
15576
  name: "ChromeTooltip",
15086
15577
  setup() {
15087
15578
  const state = shallowRef31(null);
15088
- const bubble = ref37(null);
15579
+ const bubble = ref41(null);
15089
15580
  let stop = null;
15090
15581
  onMounted21(() => {
15091
15582
  stop = listenChromeTooltips(document, (next) => state.value = next);
15092
15583
  });
15093
15584
  onUnmounted5(() => stop?.());
15094
- watch36(
15585
+ watch38(
15095
15586
  [state, bubble],
15096
15587
  ([next, el]) => {
15097
15588
  if (next && el) positionChromeTooltip(el, next.target);
@@ -15101,7 +15592,7 @@ var ChromeTooltip = defineComponent51({
15101
15592
  return () => {
15102
15593
  const s = state.value;
15103
15594
  if (!s) return null;
15104
- return /* @__PURE__ */ jsx43(Teleport4, { to: s.scope, children: /* @__PURE__ */ jsxs37(
15595
+ return /* @__PURE__ */ jsx49(Teleport4, { to: s.scope, children: /* @__PURE__ */ jsxs42(
15105
15596
  "div",
15106
15597
  {
15107
15598
  ref: bubble,
@@ -15110,8 +15601,8 @@ var ChromeTooltip = defineComponent51({
15110
15601
  "aria-hidden": "true",
15111
15602
  "data-instant": s.instant || void 0,
15112
15603
  children: [
15113
- /* @__PURE__ */ jsx43("span", { class: "pptx-tooltip__label", children: s.label }),
15114
- s.reason ? /* @__PURE__ */ jsx43("span", { class: "pptx-tooltip__reason", children: s.reason }) : null
15604
+ /* @__PURE__ */ jsx49("span", { class: "pptx-tooltip__label", children: s.label }),
15605
+ s.reason ? /* @__PURE__ */ jsx49("span", { class: "pptx-tooltip__reason", children: s.reason }) : null
15115
15606
  ]
15116
15607
  }
15117
15608
  ) });
@@ -15174,7 +15665,7 @@ var pptxEditorRootProps = {
15174
15665
  function isElement(value) {
15175
15666
  return typeof value === "object" && value !== null && value.nodeType === 1;
15176
15667
  }
15177
- var PptxEditorRoot = defineComponent52({
15668
+ var PptxEditorRoot = defineComponent58({
15178
15669
  name: "PptxEditorRoot",
15179
15670
  props: pptxEditorRootProps,
15180
15671
  emits: {
@@ -15197,7 +15688,7 @@ var PptxEditorRoot = defineComponent52({
15197
15688
  providePptxEditor(editor);
15198
15689
  provide18(pptxTranslationKey, t);
15199
15690
  expose(createEditorRefApi(() => editor.value));
15200
- watch37(
15691
+ watch39(
15201
15692
  () => localeContentKey(props.locale),
15202
15693
  () => {
15203
15694
  t.value = createTranslator2(props.locale);
@@ -15215,7 +15706,7 @@ var PptxEditorRoot = defineComponent52({
15215
15706
  ...props.readClipboardDrawing ? { readClipboardDrawing: props.readClipboardDrawing } : {},
15216
15707
  ...props.author ? { author: props.author } : {},
15217
15708
  onFontError,
15218
- translate: (key, params) => translateKeyOrText17(t.value, key, params)
15709
+ translate: (key, params) => translateKeyOrText20(t.value, key, params)
15219
15710
  });
15220
15711
  createdFonts = props.fonts;
15221
15712
  createdFamilies = props.fontFamilies;
@@ -15234,7 +15725,7 @@ var PptxEditorRoot = defineComponent52({
15234
15725
  });
15235
15726
  const documentChurn = churnWarning("PptxEditorRoot", "document");
15236
15727
  const fontsChurn = churnWarning("PptxEditorRoot", "fonts");
15237
- watch37(
15728
+ watch39(
15238
15729
  () => props.document,
15239
15730
  (bytes) => {
15240
15731
  if (!editor.value || !bytes) return;
@@ -15242,21 +15733,21 @@ var PptxEditorRoot = defineComponent52({
15242
15733
  void editor.value.load(bytes);
15243
15734
  }
15244
15735
  );
15245
- watch37(
15736
+ watch39(
15246
15737
  () => props.mode,
15247
15738
  (mode) => editor.value?.setMode(mode)
15248
15739
  );
15249
- watch37(
15740
+ watch39(
15250
15741
  () => props.author,
15251
15742
  (author) => editor.value?.setAuthor(author)
15252
15743
  );
15253
- watch37(
15744
+ watch39(
15254
15745
  () => props.modules,
15255
15746
  (modules) => {
15256
15747
  if (editor.value) warnModulesChanged(createdModules, modules, "PptxEditorRoot");
15257
15748
  }
15258
15749
  );
15259
- watch37(
15750
+ watch39(
15260
15751
  () => [editor.value, props.fonts],
15261
15752
  ([instance2, fonts]) => {
15262
15753
  if (!instance2 || createdFonts === fonts) return;
@@ -15267,7 +15758,7 @@ var PptxEditorRoot = defineComponent52({
15267
15758
  },
15268
15759
  { flush: "post" }
15269
15760
  );
15270
- watch37(
15761
+ watch39(
15271
15762
  () => [editor.value, props.fontFamilies],
15272
15763
  ([instance2, families]) => {
15273
15764
  if (!instance2 || createdFamilies === families) return;
@@ -15305,7 +15796,7 @@ var pptxEditorViewportProps = {
15305
15796
  */
15306
15797
  label: { type: [String, Boolean], default: void 0 }
15307
15798
  };
15308
- var PptxEditorViewport = defineComponent52({
15799
+ var PptxEditorViewport = defineComponent58({
15309
15800
  name: "PptxEditorViewport",
15310
15801
  props: pptxEditorViewportProps,
15311
15802
  setup(props, { slots }) {
@@ -15318,7 +15809,7 @@ var PptxEditorViewport = defineComponent52({
15318
15809
  class: ["pptx-editor", dark.value ? "dark" : null, props.className],
15319
15810
  ...props.label === false ? {} : {
15320
15811
  role: "region",
15321
- "aria-label": props.label ? translateKeyOrText17(t, props.label) : t("viewport.ariaLabel")
15812
+ "aria-label": props.label ? translateKeyOrText20(t, props.label) : t("viewport.ariaLabel")
15322
15813
  }
15323
15814
  },
15324
15815
  slots.default?.()
@@ -15329,7 +15820,7 @@ var pptxEditorContentProps = {
15329
15820
  /** A class name added to the canvas, as React's `className`. A host `class` also works. */
15330
15821
  className: { type: String, default: void 0 }
15331
15822
  };
15332
- var PptxEditorContent = defineComponent52({
15823
+ var PptxEditorContent = defineComponent58({
15333
15824
  name: "PptxEditorContent",
15334
15825
  // The canvas renders next to its context menu layer, so the host's attributes go on the canvas.
15335
15826
  inheritAttrs: false,
@@ -15352,7 +15843,7 @@ var PptxEditorContent = defineComponent52({
15352
15843
  }
15353
15844
  };
15354
15845
  onMounted22(sync);
15355
- watch37(editorRef, sync);
15846
+ watch39(editorRef, sync);
15356
15847
  onUnmounted6(() => {
15357
15848
  attached?.detach();
15358
15849
  attached = null;
@@ -15381,7 +15872,7 @@ var PptxEditorContent = defineComponent52({
15381
15872
 
15382
15873
  // src/loading.ts
15383
15874
  import {
15384
- defineComponent as defineComponent53,
15875
+ defineComponent as defineComponent59,
15385
15876
  h as h19
15386
15877
  } from "vue";
15387
15878
  import { loadingSheetSize, sameLoadingSheetSize, showsLoading } from "@pptx-editor.dev/core/editor";
@@ -15389,7 +15880,7 @@ var loadingSpinnerProps = {
15389
15880
  /** A class name added to the spinner, as React's `className`. A host `class` also works. */
15390
15881
  className: { type: String, default: void 0 }
15391
15882
  };
15392
- var PptxEditorLoadingSpinner = defineComponent53({
15883
+ var PptxEditorLoadingSpinner = defineComponent59({
15393
15884
  name: "PptxEditorLoadingSpinner",
15394
15885
  props: loadingSpinnerProps,
15395
15886
  setup(props) {
@@ -15412,7 +15903,7 @@ var loadingProps = {
15412
15903
  /** Inline styles for the loading container, as React's `style`. */
15413
15904
  style: { type: Object, default: void 0 }
15414
15905
  };
15415
- var LoadingImpl = defineComponent53({
15906
+ var LoadingImpl = defineComponent59({
15416
15907
  name: "PptxEditorLoading",
15417
15908
  props: loadingProps,
15418
15909
  setup(props, { slots }) {
@@ -15461,13 +15952,13 @@ var PptxEditorLoading = Object.assign(LoadingImpl, {
15461
15952
  // src/NotesPane.tsx
15462
15953
  import {
15463
15954
  computed as computed25,
15464
- defineComponent as defineComponent55,
15465
- nextTick as nextTick9,
15955
+ defineComponent as defineComponent61,
15956
+ nextTick as nextTick10,
15466
15957
  onBeforeUnmount as onBeforeUnmount14,
15467
- ref as ref38,
15958
+ ref as ref42,
15468
15959
  shallowRef as shallowRef33,
15469
- useId as useId21,
15470
- watch as watch39
15960
+ useId as useId22,
15961
+ watch as watch41
15471
15962
  } from "vue";
15472
15963
  import {
15473
15964
  NOTES_FORMAT_BUTTONS,
@@ -15489,7 +15980,7 @@ import {
15489
15980
  } from "@pptx-editor.dev/core/editor";
15490
15981
 
15491
15982
  // src/NotesView.tsx
15492
- import { defineComponent as defineComponent54, onMounted as onMounted23, watch as watch38 } from "vue";
15983
+ import { defineComponent as defineComponent60, onMounted as onMounted23, watch as watch40 } from "vue";
15493
15984
  import {
15494
15985
  notesFieldBeforeInput,
15495
15986
  notesFieldFocused,
@@ -15499,8 +15990,8 @@ import {
15499
15990
  renderNotes,
15500
15991
  selectNotes
15501
15992
  } from "@pptx-editor.dev/core/editor";
15502
- import { jsx as jsx44 } from "vue/jsx-runtime";
15503
- var NotesField = defineComponent54({
15993
+ import { jsx as jsx50 } from "vue/jsx-runtime";
15994
+ var NotesField = defineComponent60({
15504
15995
  name: "PptxNotesField",
15505
15996
  props: {
15506
15997
  id: { type: String, default: void 0 },
@@ -15535,7 +16026,7 @@ var NotesField = defineComponent54({
15535
16026
  props.onSelection();
15536
16027
  };
15537
16028
  onMounted23(draw);
15538
- watch38(() => [props.paragraphs, props.drafting], draw, { flush: "post" });
16029
+ watch40(() => [props.paragraphs, props.drafting], draw, { flush: "post" });
15539
16030
  const onKeydown = (e) => {
15540
16031
  if (composing) return;
15541
16032
  notesFieldKeyDown(e, e.currentTarget, {
@@ -15549,7 +16040,7 @@ var NotesField = defineComponent54({
15549
16040
  const draft = (e) => {
15550
16041
  if (!props.readOnly) props.onDraft(notesFieldText(e.currentTarget));
15551
16042
  };
15552
- return () => /* @__PURE__ */ jsx44(
16043
+ return () => /* @__PURE__ */ jsx50(
15553
16044
  "div",
15554
16045
  {
15555
16046
  ref: props.field,
@@ -15587,7 +16078,7 @@ var NotesField = defineComponent54({
15587
16078
  });
15588
16079
 
15589
16080
  // src/NotesPane.tsx
15590
- import { jsx as jsx45, jsxs as jsxs38 } from "vue/jsx-runtime";
16081
+ import { jsx as jsx51, jsxs as jsxs43 } from "vue/jsx-runtime";
15591
16082
  var notesPaneProps = {
15592
16083
  /** Whether the pane is open, controlled. Use with the `update:open` event (`v-model:open`). */
15593
16084
  open: { type: Boolean, default: void 0 },
@@ -15605,8 +16096,8 @@ var notesPaneProps = {
15605
16096
  };
15606
16097
  function useNotesOpen(props, emit) {
15607
16098
  const shared = usePaneState();
15608
- const own = ref38(props.defaultOpen ?? true);
15609
- const owner = ref38(false);
16099
+ const own = ref42(props.defaultOpen ?? true);
16100
+ const owner = ref42(false);
15610
16101
  const open = computed25(
15611
16102
  () => props.open !== void 0 ? props.open : shared && owner.value ? shared.notesOpen.value ?? props.defaultOpen ?? true : own.value
15612
16103
  );
@@ -15627,11 +16118,11 @@ function useNotesOpen(props, emit) {
15627
16118
  }
15628
16119
  };
15629
16120
  claim();
15630
- watch39(() => shared?.notesOpen.value, claim);
16121
+ watch41(() => shared?.notesOpen.value, claim);
15631
16122
  onBeforeUnmount14(() => {
15632
16123
  if (slot?.current === handler) slot.current = null;
15633
16124
  });
15634
- watch39(
16125
+ watch41(
15635
16126
  [open, owner],
15636
16127
  () => {
15637
16128
  if (!shared || !owner.value) return;
@@ -15641,7 +16132,7 @@ function useNotesOpen(props, emit) {
15641
16132
  );
15642
16133
  return { open, setOpen };
15643
16134
  }
15644
- var PptxEditorNotesPane = defineComponent55({
16135
+ var PptxEditorNotesPane = defineComponent61({
15645
16136
  name: "PptxEditorNotesPane",
15646
16137
  props: notesPaneProps,
15647
16138
  emits: { "update:open": (_open) => true },
@@ -15653,12 +16144,12 @@ var PptxEditorNotesPane = defineComponent55({
15653
16144
  const slideId = useEditorState((s) => s.slides[s.currentSlide]?.id ?? null);
15654
16145
  const readOnly = useEditorState((s) => s.mode === "view");
15655
16146
  const pane = useNotesOpen(props, emit);
15656
- const notesId = useId21();
16147
+ const notesId = useId22();
15657
16148
  const draft = shallowRef33(null);
15658
- const refusal = ref38(null);
16149
+ const refusal = ref42(null);
15659
16150
  const formats = shallowRef33(NO_NOTES_FORMATS);
15660
- const canFormat = ref38(false);
15661
- const field = ref38(null);
16151
+ const canFormat = ref42(false);
16152
+ const field = ref42(null);
15662
16153
  let pending = null;
15663
16154
  let bound = null;
15664
16155
  const restore = { value: null };
@@ -15689,7 +16180,7 @@ var PptxEditorNotesPane = defineComponent55({
15689
16180
  });
15690
16181
  refusal.value = r.ok ? null : rejectionMessage(t, r);
15691
16182
  };
15692
- watch39(
16183
+ watch41(
15693
16184
  slideId,
15694
16185
  (id) => {
15695
16186
  if (pending && pending.slideId !== id) commit();
@@ -15697,7 +16188,7 @@ var PptxEditorNotesPane = defineComponent55({
15697
16188
  },
15698
16189
  { immediate: true }
15699
16190
  );
15700
- watch39(draft, (d, _old, onCleanup) => {
16191
+ watch41(draft, (d, _old, onCleanup) => {
15701
16192
  if (!d) return;
15702
16193
  const doc = field.value?.ownerDocument;
15703
16194
  const onPointerDown = (e) => {
@@ -15706,7 +16197,7 @@ var PptxEditorNotesPane = defineComponent55({
15706
16197
  doc?.addEventListener("pointerdown", onPointerDown, true);
15707
16198
  onCleanup(() => doc?.removeEventListener("pointerdown", onPointerDown, true));
15708
16199
  });
15709
- watch39(
16200
+ watch41(
15710
16201
  () => pane.open.value,
15711
16202
  (open) => {
15712
16203
  if (!open) commit();
@@ -15727,7 +16218,7 @@ var PptxEditorNotesPane = defineComponent55({
15727
16218
  const ed = editor.value;
15728
16219
  if (ed && ed.snapshot().selection.kind !== "none") ed.setSelection({ kind: "none" });
15729
16220
  };
15730
- const active = ref38(false);
16221
+ const active = ref42(false);
15731
16222
  const target = () => ({
15732
16223
  formats: formats.value,
15733
16224
  readOnly: readOnly.value,
@@ -15748,7 +16239,7 @@ var PptxEditorNotesPane = defineComponent55({
15748
16239
  canFormat.value = false;
15749
16240
  formats.value = NO_NOTES_FORMATS;
15750
16241
  };
15751
- watch39(
16242
+ watch41(
15752
16243
  active,
15753
16244
  (on, _old, onCleanup) => {
15754
16245
  const doc = field.value?.ownerDocument;
@@ -15761,10 +16252,10 @@ var PptxEditorNotesPane = defineComponent55({
15761
16252
  );
15762
16253
  const painter = createNotesFindPainter();
15763
16254
  let mounted = true;
15764
- const findCount = ref38(0);
16255
+ const findCount = ref42(0);
15765
16256
  const selectionKind = useEditorState((s) => s.selection.kind);
15766
16257
  const revision = useEditorState((s) => s.revision);
15767
- watch39(
16258
+ watch41(
15768
16259
  editor,
15769
16260
  (ed, _old, onCleanup) => {
15770
16261
  if (ed)
@@ -15776,7 +16267,7 @@ var PptxEditorNotesPane = defineComponent55({
15776
16267
  },
15777
16268
  { immediate: true }
15778
16269
  );
15779
- watch39(
16270
+ watch41(
15780
16271
  [
15781
16272
  editor,
15782
16273
  () => pane.open.value,
@@ -15788,7 +16279,7 @@ var PptxEditorNotesPane = defineComponent55({
15788
16279
  revision,
15789
16280
  slideId
15790
16281
  ],
15791
- () => void nextTick9(() => {
16282
+ () => void nextTick10(() => {
15792
16283
  if (!mounted) return;
15793
16284
  painter.paint(
15794
16285
  editor.value,
@@ -15803,10 +16294,10 @@ var PptxEditorNotesPane = defineComponent55({
15803
16294
  mounted = false;
15804
16295
  painter.stop();
15805
16296
  });
15806
- watch39([editor, formats, readOnly, canFormat], () => {
16297
+ watch41([editor, formats, readOnly, canFormat], () => {
15807
16298
  if (editor.value && focused) setNotesTarget(editor.value, target());
15808
16299
  });
15809
- watch39(editor, (_next, was) => {
16300
+ watch41(editor, (_next, was) => {
15810
16301
  if (was) setNotesTarget(was, null);
15811
16302
  });
15812
16303
  onBeforeUnmount14(() => {
@@ -15863,7 +16354,7 @@ var PptxEditorNotesPane = defineComponent55({
15863
16354
  if (masterView.value) return null;
15864
16355
  const open = pane.open.value;
15865
16356
  const d = draft.value;
15866
- return /* @__PURE__ */ jsxs38(
16357
+ return /* @__PURE__ */ jsxs43(
15867
16358
  "section",
15868
16359
  {
15869
16360
  class: ["pptx-notes", props.className],
@@ -15871,9 +16362,9 @@ var PptxEditorNotesPane = defineComponent55({
15871
16362
  "aria-label": t("notes.title"),
15872
16363
  "data-open": open ? "true" : "false",
15873
16364
  children: [
15874
- /* @__PURE__ */ jsxs38("div", { class: "pptx-notes__head", onMousedown: keepFocus, children: [
15875
- /* @__PURE__ */ jsx45("span", { children: t("notes.title") }),
15876
- open && !readOnly.value && props.showFormatButtons ? /* @__PURE__ */ jsx45("div", { class: "pptx-notes__format", role: "group", "aria-label": t("notes.format"), children: NOTES_FORMAT_BUTTONS.map(([format, icon, key]) => /* @__PURE__ */ jsx45(
16365
+ /* @__PURE__ */ jsxs43("div", { class: "pptx-notes__head", onMousedown: keepFocus, children: [
16366
+ /* @__PURE__ */ jsx51("span", { children: t("notes.title") }),
16367
+ open && !readOnly.value && props.showFormatButtons ? /* @__PURE__ */ jsx51("div", { class: "pptx-notes__format", role: "group", "aria-label": t("notes.format"), children: NOTES_FORMAT_BUTTONS.map(([format, icon, key]) => /* @__PURE__ */ jsx51(
15877
16368
  ToolButton,
15878
16369
  {
15879
16370
  label: t(key),
@@ -15885,7 +16376,7 @@ var PptxEditorNotesPane = defineComponent55({
15885
16376
  },
15886
16377
  format
15887
16378
  )) }) : null,
15888
- /* @__PURE__ */ jsx45(
16379
+ /* @__PURE__ */ jsx51(
15889
16380
  ToolButton,
15890
16381
  {
15891
16382
  label: open ? t("notes.collapse") : t("notes.expand"),
@@ -15899,7 +16390,7 @@ var PptxEditorNotesPane = defineComponent55({
15899
16390
  }
15900
16391
  )
15901
16392
  ] }),
15902
- open ? /* @__PURE__ */ jsx45(
16393
+ open ? /* @__PURE__ */ jsx51(
15903
16394
  NotesField,
15904
16395
  {
15905
16396
  id: notesId,
@@ -15922,7 +16413,7 @@ var PptxEditorNotesPane = defineComponent55({
15922
16413
  onFocus
15923
16414
  }
15924
16415
  ) : null,
15925
- refusal.value ? /* @__PURE__ */ jsx45("p", { class: "pptx-notes__refusal", role: "alert", children: refusal.value }) : null
16416
+ refusal.value ? /* @__PURE__ */ jsx51("p", { class: "pptx-notes__refusal", role: "alert", children: refusal.value }) : null
15926
16417
  ]
15927
16418
  }
15928
16419
  );
@@ -15933,10 +16424,10 @@ var PptxEditorNotesPane = defineComponent55({
15933
16424
  // src/OpenFailure.tsx
15934
16425
  import {
15935
16426
  computed as computed26,
15936
- defineComponent as defineComponent56,
15937
- nextTick as nextTick10,
16427
+ defineComponent as defineComponent62,
16428
+ nextTick as nextTick11,
15938
16429
  shallowRef as shallowRef34,
15939
- useId as useId22
16430
+ useId as useId23
15940
16431
  } from "vue";
15941
16432
  import {
15942
16433
  copyOpenFailureReport,
@@ -15945,7 +16436,7 @@ import {
15945
16436
  openFailureKey,
15946
16437
  shownOpenFailure
15947
16438
  } from "@pptx-editor.dev/core/editor";
15948
- import { jsx as jsx46, jsxs as jsxs39 } from "vue/jsx-runtime";
16439
+ import { jsx as jsx52, jsxs as jsxs44 } from "vue/jsx-runtime";
15949
16440
  function useOpenFailure(options = {}) {
15950
16441
  const current = useEditorState(shownOpenFailure);
15951
16442
  const ready = useEditorState((s) => s.status === "ready");
@@ -16004,7 +16495,7 @@ var openFailureProps = {
16004
16495
  style: { type: Object, default: void 0 },
16005
16496
  ...chromeTranslateProp
16006
16497
  };
16007
- var PptxEditorOpenFailure = defineComponent56({
16498
+ var PptxEditorOpenFailure = defineComponent62({
16008
16499
  name: "PptxEditorOpenFailure",
16009
16500
  props: openFailureProps,
16010
16501
  emits: {
@@ -16015,7 +16506,7 @@ var PptxEditorOpenFailure = defineComponent56({
16015
16506
  setup(props, { emit, slots }) {
16016
16507
  const { t } = useChromeTranslateScope(() => props.t);
16017
16508
  const { failure, message, kept, dismiss } = useOpenFailure({ t });
16018
- const titleId = useId22();
16509
+ const titleId = useId23();
16019
16510
  const copy = shallowRef34(null);
16020
16511
  const reportRef = shallowRef34(null);
16021
16512
  const rootRef = shallowRef34(null);
@@ -16028,7 +16519,7 @@ var PptxEditorOpenFailure = defineComponent56({
16028
16519
  copy.value = null;
16029
16520
  await new Promise((resolve) => setTimeout(resolve, COPY_RESULT_GAP_MS));
16030
16521
  copy.value = await copyOpenFailureReport(shown);
16031
- if (!copy.value.copied) void nextTick10(() => reportRef.value?.focus());
16522
+ if (!copy.value.copied) void nextTick11(() => reportRef.value?.focus());
16032
16523
  };
16033
16524
  const copyShown = copy.value?.failure === shown ? copy.value : null;
16034
16525
  const close = () => {
@@ -16038,7 +16529,7 @@ var PptxEditorOpenFailure = defineComponent56({
16038
16529
  if (focused) editor.value?.focus();
16039
16530
  };
16040
16531
  const context = { failure: shown, message: packaged, dismiss: close };
16041
- return /* @__PURE__ */ jsxs39(
16532
+ return /* @__PURE__ */ jsxs44(
16042
16533
  "div",
16043
16534
  {
16044
16535
  ref: rootRef,
@@ -16048,14 +16539,14 @@ var PptxEditorOpenFailure = defineComponent56({
16048
16539
  "aria-labelledby": titleId,
16049
16540
  "data-reason": shown.reason,
16050
16541
  children: [
16051
- /* @__PURE__ */ jsxs39("div", { class: "pptx-open-failure__text", role: "alert", children: [
16052
- /* @__PURE__ */ jsx46("p", { id: titleId, class: "pptx-open-failure__title", children: props.title ?? t("openFailure.title") }),
16053
- /* @__PURE__ */ jsx46("div", { class: "pptx-open-failure__message", children: slots.message ? slots.message(context) : typeof props.message === "function" ? props.message(shown) : props.message ?? packaged }),
16054
- kept.value ? /* @__PURE__ */ jsx46("p", { class: "pptx-open-failure__kept", children: t("openFailure.kept") }) : null,
16055
- props.showCode ? /* @__PURE__ */ jsx46("p", { class: "pptx-open-failure__code", children: t("openFailure.code", { code: shown.code }) }) : null
16542
+ /* @__PURE__ */ jsxs44("div", { class: "pptx-open-failure__text", role: "alert", children: [
16543
+ /* @__PURE__ */ jsx52("p", { id: titleId, class: "pptx-open-failure__title", children: props.title ?? t("openFailure.title") }),
16544
+ /* @__PURE__ */ jsx52("div", { class: "pptx-open-failure__message", children: slots.message ? slots.message(context) : typeof props.message === "function" ? props.message(shown) : props.message ?? packaged }),
16545
+ kept.value ? /* @__PURE__ */ jsx52("p", { class: "pptx-open-failure__kept", children: t("openFailure.kept") }) : null,
16546
+ props.showCode ? /* @__PURE__ */ jsx52("p", { class: "pptx-open-failure__code", children: t("openFailure.code", { code: shown.code }) }) : null
16056
16547
  ] }),
16057
- /* @__PURE__ */ jsx46("p", { class: "pptx-open-failure__status", role: "status", children: copyShown ? t(copyShown.copied ? "openFailure.copied" : "openFailure.copyFailed") : null }),
16058
- copyShown && !copyShown.copied ? /* @__PURE__ */ jsx46(
16548
+ /* @__PURE__ */ jsx52("p", { class: "pptx-open-failure__status", role: "status", children: copyShown ? t(copyShown.copied ? "openFailure.copied" : "openFailure.copyFailed") : null }),
16549
+ copyShown && !copyShown.copied ? /* @__PURE__ */ jsx52(
16059
16550
  "textarea",
16060
16551
  {
16061
16552
  ref: reportRef,
@@ -16067,9 +16558,9 @@ var PptxEditorOpenFailure = defineComponent56({
16067
16558
  onFocus: (e) => e.currentTarget.select()
16068
16559
  }
16069
16560
  ) : null,
16070
- /* @__PURE__ */ jsxs39("div", { class: "pptx-open-failure__actions", children: [
16561
+ /* @__PURE__ */ jsxs44("div", { class: "pptx-open-failure__actions", children: [
16071
16562
  slots.actions ? slots.actions(context) : props.actions?.(context),
16072
- props.showCopy ? /* @__PURE__ */ jsx46(
16563
+ props.showCopy ? /* @__PURE__ */ jsx52(
16073
16564
  "button",
16074
16565
  {
16075
16566
  type: "button",
@@ -16078,7 +16569,7 @@ var PptxEditorOpenFailure = defineComponent56({
16078
16569
  children: t("openFailure.copyDetails")
16079
16570
  }
16080
16571
  ) : null,
16081
- props.showClose ? /* @__PURE__ */ jsx46("button", { type: "button", class: "pptx-open-failure__action", onClick: close, children: props.closeLabel ?? t("openFailure.close") }) : null
16572
+ props.showClose ? /* @__PURE__ */ jsx52("button", { type: "button", class: "pptx-open-failure__action", onClick: close, children: props.closeLabel ?? t("openFailure.close") }) : null
16082
16573
  ] })
16083
16574
  ]
16084
16575
  },
@@ -16091,10 +16582,10 @@ var PptxEditorOpenFailure = defineComponent56({
16091
16582
  // src/FontNotice.tsx
16092
16583
  import {
16093
16584
  computed as computed27,
16094
- defineComponent as defineComponent57,
16095
- ref as ref39,
16585
+ defineComponent as defineComponent63,
16586
+ ref as ref43,
16096
16587
  shallowRef as shallowRef35,
16097
- watch as watch40
16588
+ watch as watch42
16098
16589
  } from "vue";
16099
16590
  import {
16100
16591
  applyLocalFonts,
@@ -16102,13 +16593,13 @@ import {
16102
16593
  fontNoticeFamilies,
16103
16594
  fontNoticeList
16104
16595
  } from "@pptx-editor.dev/core/editor";
16105
- import { jsx as jsx47, jsxs as jsxs40 } from "vue/jsx-runtime";
16596
+ import { jsx as jsx53, jsxs as jsxs45 } from "vue/jsx-runtime";
16106
16597
  var pptxEditorFontNoticeProps = {
16107
16598
  ...chromeTranslateProp,
16108
16599
  /** A class name added to the notice, as React's `className`. A host `class` also works. */
16109
16600
  className: { type: String, default: void 0 }
16110
16601
  };
16111
- var PptxEditorFontNotice = defineComponent57({
16602
+ var PptxEditorFontNotice = defineComponent63({
16112
16603
  name: "PptxEditorFontNotice",
16113
16604
  inheritAttrs: false,
16114
16605
  props: pptxEditorFontNoticeProps,
@@ -16122,9 +16613,9 @@ var PptxEditorFontNotice = defineComponent57({
16122
16613
  const dismissed = shallowRef35(null);
16123
16614
  const outcome = shallowRef35(null);
16124
16615
  const status = computed27(() => outcome.value?.key === key.value ? outcome.value.text : null);
16125
- const busy = ref39(false);
16616
+ const busy = ref43(false);
16126
16617
  let round = 0;
16127
- watch40(loadState, () => {
16618
+ watch42(loadState, () => {
16128
16619
  round += 1;
16129
16620
  outcome.value = null;
16130
16621
  });
@@ -16145,7 +16636,7 @@ var PptxEditorFontNotice = defineComponent57({
16145
16636
  return () => {
16146
16637
  const families = missing.value;
16147
16638
  if (families.length === 0 && !status.value || dismissed.value === key.value) return null;
16148
- return /* @__PURE__ */ jsxs40(
16639
+ return /* @__PURE__ */ jsxs45(
16149
16640
  "div",
16150
16641
  {
16151
16642
  ...attrs,
@@ -16153,11 +16644,11 @@ var PptxEditorFontNotice = defineComponent57({
16153
16644
  role: "status",
16154
16645
  onMousedown: keepFocus,
16155
16646
  children: [
16156
- /* @__PURE__ */ jsxs40("span", { class: "pptx-font-notice__text", children: [
16647
+ /* @__PURE__ */ jsxs45("span", { class: "pptx-font-notice__text", children: [
16157
16648
  families.length ? t("fonts.notice", { families: fontNoticeList(families, t) }) : status.value,
16158
16649
  families.length && status.value ? ` ${status.value}` : ""
16159
16650
  ] }),
16160
- families.length && canQueryLocalFonts() ? /* @__PURE__ */ jsx47(
16651
+ families.length && canQueryLocalFonts() ? /* @__PURE__ */ jsx53(
16161
16652
  "button",
16162
16653
  {
16163
16654
  type: "button",
@@ -16167,7 +16658,7 @@ var PptxEditorFontNotice = defineComponent57({
16167
16658
  children: t("fonts.useLocal")
16168
16659
  }
16169
16660
  ) : null,
16170
- /* @__PURE__ */ jsx47(
16661
+ /* @__PURE__ */ jsx53(
16171
16662
  ToolButton,
16172
16663
  {
16173
16664
  label: t("fonts.dismiss"),
@@ -16186,23 +16677,23 @@ var PptxEditorFontNotice = defineComponent57({
16186
16677
 
16187
16678
  // src/ribbon.ts
16188
16679
  import {
16189
- defineComponent as defineComponent58,
16680
+ defineComponent as defineComponent64,
16190
16681
  h as h20,
16191
16682
  isVNode as isVNode7,
16192
16683
  normalizeClass as normalizeClass7,
16193
- ref as ref40,
16194
- watch as watch41,
16195
- nextTick as nextTick11,
16684
+ ref as ref44,
16685
+ watch as watch43,
16686
+ nextTick as nextTick12,
16196
16687
  Comment as Comment4,
16197
16688
  Text as Text4,
16198
- useId as useId23
16689
+ useId as useId24
16199
16690
  } from "vue";
16200
16691
  import {
16201
16692
  arrangeRibbonTabs,
16202
16693
  ribbonInsertTab,
16203
16694
  ribbonShownTab,
16204
16695
  ribbonTabs,
16205
- translateKeyOrText as translateKeyOrText18,
16696
+ translateKeyOrText as translateKeyOrText21,
16206
16697
  warnRibbonChild
16207
16698
  } from "@pptx-editor.dev/core/editor";
16208
16699
  var ribbonTabProps = {
@@ -16219,7 +16710,7 @@ var ribbonTabProps = {
16219
16710
  /** A class name added to the tab's panel, as React's `className`. A host `class` also works. */
16220
16711
  className: { type: String, default: void 0 }
16221
16712
  };
16222
- var RibbonTab = defineComponent58({
16713
+ var RibbonTab = defineComponent64({
16223
16714
  name: "RibbonTab",
16224
16715
  props: ribbonTabProps,
16225
16716
  setup() {
@@ -16272,7 +16763,7 @@ var sameLayout = (a, b) => {
16272
16763
  return key(a) === key(b);
16273
16764
  };
16274
16765
  var PptxEditorRibbon = Object.assign(
16275
- defineComponent58({
16766
+ defineComponent64({
16276
16767
  name: "PptxEditorRibbon",
16277
16768
  props: ribbonProps,
16278
16769
  emits: {
@@ -16281,28 +16772,28 @@ var PptxEditorRibbon = Object.assign(
16281
16772
  },
16282
16773
  setup(props, { emit, slots }) {
16283
16774
  const { t } = useTranslation();
16284
- const baseId = useId23();
16775
+ const baseId = useId24();
16285
16776
  const layout = useEditorState((s) => ribbonTabs(s), sameLayout);
16286
- const own = ref40(props.defaultTab);
16777
+ const own = ref44(props.defaultTab);
16287
16778
  const names = /* @__PURE__ */ new Map();
16288
- const root = ref40(null);
16779
+ const root = ref44(null);
16289
16780
  let focusInside = false;
16290
16781
  const select = (id) => {
16291
16782
  if (props.tab === void 0) own.value = id;
16292
16783
  emit("update:tab", id);
16293
16784
  emit("tabChange", id);
16294
16785
  };
16295
- const shown = ref40({
16786
+ const shown = ref44({
16296
16787
  id: void 0,
16297
16788
  fellBack: false
16298
16789
  });
16299
- watch41(
16790
+ watch43(
16300
16791
  () => `${shown.value.fellBack}|${shown.value.id ?? ""}`,
16301
16792
  async () => {
16302
16793
  const { id, fellBack } = shown.value;
16303
16794
  if (!fellBack || id === void 0) return;
16304
16795
  select(id);
16305
- await nextTick11();
16796
+ await nextTick12();
16306
16797
  const active = root.value?.ownerDocument.activeElement;
16307
16798
  if (focusInside && (!active || active === active.ownerDocument.body))
16308
16799
  names.get(id)?.focus();
@@ -16310,8 +16801,8 @@ var PptxEditorRibbon = Object.assign(
16310
16801
  );
16311
16802
  const insertions = useEditorState((s) => s.insertions);
16312
16803
  let insertTab = null;
16313
- watch41(insertions, async () => {
16314
- await nextTick11();
16804
+ watch43(insertions, async () => {
16805
+ await nextTick12();
16315
16806
  if (insertTab !== null && insertTab !== (props.tab ?? own.value)) select(insertTab);
16316
16807
  });
16317
16808
  return () => {
@@ -16326,7 +16817,7 @@ var PptxEditorRibbon = Object.assign(
16326
16817
  layout.value,
16327
16818
  specs,
16328
16819
  props.preset,
16329
- (key) => translateKeyOrText18(t, key),
16820
+ (key) => translateKeyOrText21(t, key),
16330
16821
  "PptxEditorRibbon.Tab"
16331
16822
  );
16332
16823
  insertTab = ribbonInsertTab(tabs);
@@ -16434,7 +16925,7 @@ var PptxEditorRibbon = Object.assign(
16434
16925
 
16435
16926
  // src/status-bar.ts
16436
16927
  import {
16437
- defineComponent as defineComponent59,
16928
+ defineComponent as defineComponent65,
16438
16929
  h as h21,
16439
16930
  isVNode as isVNode8,
16440
16931
  normalizeClass as normalizeClass8
@@ -16449,7 +16940,7 @@ var partProps4 = {
16449
16940
  function keepFocus2(e) {
16450
16941
  if (chromeKeepsFocus2(e.target)) e.preventDefault();
16451
16942
  }
16452
- var StatusBarSlideNumber = defineComponent59({
16943
+ var StatusBarSlideNumber = defineComponent65({
16453
16944
  name: "StatusBarSlideNumber",
16454
16945
  props: partProps4,
16455
16946
  setup(props) {
@@ -16477,7 +16968,7 @@ var notesPartProps = {
16477
16968
  /** Render the one element of the default slot as the button: it gets the label, state, and click. */
16478
16969
  asChild: { type: Boolean, default: false }
16479
16970
  };
16480
- var StatusBarNotes = defineComponent59({
16971
+ var StatusBarNotes = defineComponent65({
16481
16972
  name: "StatusBarNotes",
16482
16973
  inheritAttrs: false,
16483
16974
  props: notesPartProps,
@@ -16506,7 +16997,7 @@ var StatusBarNotes = defineComponent59({
16506
16997
  };
16507
16998
  }
16508
16999
  });
16509
- var StatusBarViews = defineComponent59({
17000
+ var StatusBarViews = defineComponent65({
16510
17001
  name: "StatusBarViews",
16511
17002
  props: partProps4,
16512
17003
  setup(props) {
@@ -16515,7 +17006,7 @@ var StatusBarViews = defineComponent59({
16515
17006
  ]);
16516
17007
  }
16517
17008
  });
16518
- var StatusBarZoom = defineComponent59({
17009
+ var StatusBarZoom = defineComponent65({
16519
17010
  name: "StatusBarZoom",
16520
17011
  props: partProps4,
16521
17012
  setup(props) {
@@ -16549,7 +17040,7 @@ function flatten6(children, out = []) {
16549
17040
  return out;
16550
17041
  }
16551
17042
  var PptxEditorStatusBar = Object.assign(
16552
- defineComponent59({
17043
+ defineComponent65({
16553
17044
  name: "PptxEditorStatusBar",
16554
17045
  props: statusBarProps,
16555
17046
  setup(props, { slots }) {
@@ -16601,7 +17092,7 @@ import {
16601
17092
  onScopeDispose as onScopeDispose9,
16602
17093
  shallowRef as shallowRef36,
16603
17094
  toValue as toValue8,
16604
- watch as watch42
17095
+ watch as watch44
16605
17096
  } from "vue";
16606
17097
  import {
16607
17098
  ZOOM_LEVELS,
@@ -16633,7 +17124,7 @@ function useZoom() {
16633
17124
  function useEditorEvent(event, handler) {
16634
17125
  const editor = usePptxEditor();
16635
17126
  if (!getCurrentScope6()) return;
16636
- watch42(
17127
+ watch44(
16637
17128
  editor,
16638
17129
  (instance, _prev, onCleanup) => {
16639
17130
  if (instance) onCleanup(onEditorEvent(instance, event, handler));
@@ -16644,7 +17135,7 @@ function useEditorEvent(event, handler) {
16644
17135
  function useEditorSnapshot(editor) {
16645
17136
  const revision = shallowRef36(0);
16646
17137
  if (!getCurrentScope6()) return revision;
16647
- const stop = watch42(
17138
+ const stop = watch44(
16648
17139
  () => toValue8(editor),
16649
17140
  (instance, _prev, onCleanup) => {
16650
17141
  if (!instance) return;
@@ -16668,7 +17159,7 @@ import {
16668
17159
  computed as computed29,
16669
17160
  shallowRef as shallowRef37,
16670
17161
  toValue as toValue9,
16671
- watch as watch43
17162
+ watch as watch45
16672
17163
  } from "vue";
16673
17164
  import {
16674
17165
  editorHostDocument,
@@ -16687,7 +17178,7 @@ function usePptxSource(source, options = {}) {
16687
17178
  const documentLoading = shallowRef37(toValue9(source) != null);
16688
17179
  const fontsSettled = shallowRef37(toValue9(options).fonts === void 0);
16689
17180
  const resolver = pptxSourceFontsResolver(() => toValue9(options).fonts);
16690
- watch43(
17181
+ watch45(
16691
17182
  () => pptxFontsShape(toValue9(options).fonts),
16692
17183
  (_shape, _previous, onCleanup) => {
16693
17184
  const fontsSource = toValue9(options).fonts;
@@ -16712,7 +17203,7 @@ function usePptxSource(source, options = {}) {
16712
17203
  },
16713
17204
  { immediate: true }
16714
17205
  );
16715
- watch43(
17206
+ watch45(
16716
17207
  () => toValue9(source),
16717
17208
  (next, _previous, onCleanup) => {
16718
17209
  if (next == null) {
@@ -16765,7 +17256,7 @@ function useEditorHostDocument() {
16765
17256
  const editor = editorRef.value;
16766
17257
  current.value = editor ? editorHostDocument(editor) : typeof globalThis.document === "undefined" ? null : globalThis.document;
16767
17258
  };
16768
- watch43(
17259
+ watch45(
16769
17260
  () => editorRef.value,
16770
17261
  (editor, _previous, onCleanup) => {
16771
17262
  read();
@@ -16840,6 +17331,10 @@ import {
16840
17331
  isFontResolver,
16841
17332
  loadFonts
16842
17333
  } from "@pptx-editor.dev/core/editor";
17334
+ import {
17335
+ FORMAT_SECTIONS,
17336
+ formatSectionsOf as formatSectionsOf2
17337
+ } from "@pptx-editor.dev/core/editor";
16843
17338
  var pptxEditorProps = {
16844
17339
  /** `.pptx` bytes. Identity change loads the new document. */
16845
17340
  document: { type: Uint8Array, default: void 0 },
@@ -16928,7 +17423,7 @@ var OPEN_FAILURE_ACTION_NAMES = {
16928
17423
  actions: "The #openFailureActions slot",
16929
17424
  off: ':open-failure="false"'
16930
17425
  };
16931
- var PptxEditorDefault = defineComponent60({
17426
+ var PptxEditorDefault = defineComponent66({
16932
17427
  name: "PptxEditor",
16933
17428
  // The root renders no element, so the host's attributes (`class`, `style`, `id`, `data-*`)
16934
17429
  // go onto the viewport, as React's `className` does.
@@ -17046,8 +17541,11 @@ export {
17046
17541
  DEFAULT_FONT,
17047
17542
  EditorFontError,
17048
17543
  EquationDialog,
17544
+ FORMAT_SECTIONS,
17049
17545
  FillControl,
17050
17546
  FontDialog,
17547
+ FormatPanel,
17548
+ FormatSection,
17051
17549
  GradientDialog,
17052
17550
  HyperlinkPopup,
17053
17551
  Icon,
@@ -17125,6 +17623,7 @@ export {
17125
17623
  deferFonts,
17126
17624
  defineFontResolver2 as defineFontResolver,
17127
17625
  definePopup,
17626
+ formatSectionsOf2 as formatSectionsOf,
17128
17627
  isFontResolver,
17129
17628
  keepFocus,
17130
17629
  listenPaneRequests2 as listenPaneRequests,