@pptx-editor.dev/vue 0.3.2-canary.20261110032720.sha-1742572 → 0.5.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.d.ts +60 -4
- package/dist/index.js +916 -329
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {
|
|
3
|
-
defineComponent as
|
|
3
|
+
defineComponent as defineComponent67,
|
|
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
|
|
16
|
+
defineComponent as defineComponent59,
|
|
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
|
|
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
|
|
33
|
+
translateKeyOrText as translateKeyOrText21,
|
|
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
|
|
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",
|
|
@@ -8679,10 +8680,11 @@ function useCanvasContextMenu() {
|
|
|
8679
8680
|
const open = (owner, at) => {
|
|
8680
8681
|
const instance = editor.value;
|
|
8681
8682
|
if (entry() === false || !instance || instance.snapshot().status !== "ready") return;
|
|
8683
|
+
const kind = canvasMenuKind(instance.snapshot());
|
|
8682
8684
|
const state = {
|
|
8683
|
-
// From the keyboard: open at the selection, or
|
|
8684
|
-
at: canvasMenuPoint(owner, at),
|
|
8685
|
-
kind
|
|
8685
|
+
// From the keyboard: open at the caret, the selection, or the middle of the canvas.
|
|
8686
|
+
at: canvasMenuPoint(owner, at, instance.snapshot().selection.kind === "text"),
|
|
8687
|
+
kind,
|
|
8686
8688
|
keyboard: at === null,
|
|
8687
8689
|
owner
|
|
8688
8690
|
};
|
|
@@ -8726,13 +8728,13 @@ function useCanvasContextMenu() {
|
|
|
8726
8728
|
// src/SlideSorter.tsx
|
|
8727
8729
|
import {
|
|
8728
8730
|
computed as computed24,
|
|
8729
|
-
defineComponent as
|
|
8731
|
+
defineComponent as defineComponent57,
|
|
8730
8732
|
onBeforeUnmount as onBeforeUnmount13,
|
|
8731
8733
|
onMounted as onMounted20,
|
|
8732
8734
|
onUpdated as onUpdated5,
|
|
8733
|
-
ref as
|
|
8735
|
+
ref as ref41,
|
|
8734
8736
|
shallowRef as shallowRef30,
|
|
8735
|
-
watch as
|
|
8737
|
+
watch as watch37
|
|
8736
8738
|
} from "vue";
|
|
8737
8739
|
import {
|
|
8738
8740
|
STATUS_BAR_VIEW_OPTIONS,
|
|
@@ -8748,7 +8750,7 @@ import {
|
|
|
8748
8750
|
slideSorterMounted,
|
|
8749
8751
|
sorterKeyDown,
|
|
8750
8752
|
trackNotesInset,
|
|
8751
|
-
translateKeyOrText as
|
|
8753
|
+
translateKeyOrText as translateKeyOrText20,
|
|
8752
8754
|
warnSlideSorterUnmounted
|
|
8753
8755
|
} from "@pptx-editor.dev/core/editor";
|
|
8754
8756
|
|
|
@@ -8909,17 +8911,17 @@ var MasterViewBar = defineComponent29({
|
|
|
8909
8911
|
// src/panes.tsx
|
|
8910
8912
|
import {
|
|
8911
8913
|
computed as computed22,
|
|
8912
|
-
defineComponent as
|
|
8913
|
-
nextTick as
|
|
8914
|
+
defineComponent as defineComponent55,
|
|
8915
|
+
nextTick as nextTick9,
|
|
8914
8916
|
onBeforeUnmount as onBeforeUnmount11,
|
|
8915
8917
|
onMounted as onMounted19,
|
|
8916
8918
|
onUnmounted as onUnmounted4,
|
|
8917
8919
|
onUpdated as onUpdated4,
|
|
8918
8920
|
provide as provide17,
|
|
8919
|
-
ref as
|
|
8921
|
+
ref as ref40,
|
|
8920
8922
|
shallowRef as shallowRef28,
|
|
8921
|
-
useId as
|
|
8922
|
-
watch as
|
|
8923
|
+
useId as useId21,
|
|
8924
|
+
watch as watch35
|
|
8923
8925
|
} from "vue";
|
|
8924
8926
|
import {
|
|
8925
8927
|
ZOOM_MENU_LEVELS,
|
|
@@ -10029,6 +10031,7 @@ var SizeControl = defineComponent33({
|
|
|
10029
10031
|
// src/toolbar-file-controls.tsx
|
|
10030
10032
|
import { defineComponent as defineComponent34, inject as inject21, ref as ref23 } from "vue";
|
|
10031
10033
|
import {
|
|
10034
|
+
captureImageTarget,
|
|
10032
10035
|
imageFileTypes,
|
|
10033
10036
|
insertImageFile,
|
|
10034
10037
|
requestLinkPopup as requestLinkPopup2,
|
|
@@ -10080,6 +10083,7 @@ var ImageControl = defineComponent34({
|
|
|
10080
10083
|
);
|
|
10081
10084
|
const editor = usePptxEditor();
|
|
10082
10085
|
const input = ref23(null);
|
|
10086
|
+
let pickerTarget;
|
|
10083
10087
|
return () => {
|
|
10084
10088
|
const target = props.control.state.kind === "replace" ? "replaceImage" : void 0;
|
|
10085
10089
|
return [
|
|
@@ -10091,7 +10095,10 @@ var ImageControl = defineComponent34({
|
|
|
10091
10095
|
paths: props.control.paths,
|
|
10092
10096
|
disabled: !cmd.isEnabled.value,
|
|
10093
10097
|
disabledReason: reason.value,
|
|
10094
|
-
onClick: () =>
|
|
10098
|
+
onClick: () => {
|
|
10099
|
+
pickerTarget = editor.value ? captureImageTarget(editor.value) : void 0;
|
|
10100
|
+
input.value?.click();
|
|
10101
|
+
}
|
|
10095
10102
|
}
|
|
10096
10103
|
),
|
|
10097
10104
|
/* @__PURE__ */ jsx28(
|
|
@@ -10105,7 +10112,9 @@ var ImageControl = defineComponent34({
|
|
|
10105
10112
|
const el = e.target;
|
|
10106
10113
|
const file = el.files?.[0];
|
|
10107
10114
|
el.value = "";
|
|
10108
|
-
|
|
10115
|
+
const isCurrent = pickerTarget;
|
|
10116
|
+
pickerTarget = void 0;
|
|
10117
|
+
if (file && editor.value) void insertImageFile(editor.value, file, target, isCurrent);
|
|
10109
10118
|
}
|
|
10110
10119
|
}
|
|
10111
10120
|
)
|
|
@@ -11042,6 +11051,8 @@ import {
|
|
|
11042
11051
|
} from "vue";
|
|
11043
11052
|
import {
|
|
11044
11053
|
createToolbarFitMemory,
|
|
11054
|
+
formatSelectionHasLineEnds as formatSelectionHasLineEnds2,
|
|
11055
|
+
formatTargetKey,
|
|
11045
11056
|
observeToolbarFit,
|
|
11046
11057
|
toolbarCollapsedIds
|
|
11047
11058
|
} from "@pptx-editor.dev/core/editor";
|
|
@@ -11130,7 +11141,7 @@ var PresetToolbar = defineComponent39({
|
|
|
11130
11141
|
},
|
|
11131
11142
|
setup(props) {
|
|
11132
11143
|
const { t } = useTranslation();
|
|
11133
|
-
const context = useEditorState((s) => `${s
|
|
11144
|
+
const context = useEditorState((s) => `${formatTargetKey(s)}|${formatSelectionHasLineEnds2(s)}`);
|
|
11134
11145
|
const status = useEditorState((s) => s.status);
|
|
11135
11146
|
const root = ref28(null);
|
|
11136
11147
|
const more = ref28(null);
|
|
@@ -12198,25 +12209,19 @@ var SectionNode = defineComponent42({
|
|
|
12198
12209
|
// src/SidePanel.tsx
|
|
12199
12210
|
import {
|
|
12200
12211
|
computed as computed21,
|
|
12201
|
-
defineComponent as
|
|
12202
|
-
nextTick as
|
|
12212
|
+
defineComponent as defineComponent54,
|
|
12213
|
+
nextTick as nextTick8,
|
|
12203
12214
|
onMounted as onMounted18,
|
|
12204
|
-
ref as
|
|
12205
|
-
watch as
|
|
12215
|
+
ref as ref39,
|
|
12216
|
+
watch as watch34
|
|
12206
12217
|
} from "vue";
|
|
12207
12218
|
import {
|
|
12208
|
-
elementKindLabelKey,
|
|
12209
|
-
elementRotates,
|
|
12210
|
-
formatPanelSize,
|
|
12211
12219
|
listenPaneRequests,
|
|
12212
12220
|
takePaneRequest,
|
|
12213
12221
|
SIDE_PANEL_TAB_ICONS,
|
|
12214
|
-
TABLE_OPTION_ROWS,
|
|
12215
12222
|
visibleSidePanelTabs,
|
|
12216
12223
|
panelHistoryKey,
|
|
12217
|
-
|
|
12218
|
-
radioGroupStep as radioGroupStep2,
|
|
12219
|
-
formatPanelKeys
|
|
12224
|
+
radioGroupStep as radioGroupStep2
|
|
12220
12225
|
} from "@pptx-editor.dev/core/editor";
|
|
12221
12226
|
|
|
12222
12227
|
// src/SelectionPane.tsx
|
|
@@ -13488,6 +13493,7 @@ var NodeField = defineComponent46({
|
|
|
13488
13493
|
onKeydown: (e) => {
|
|
13489
13494
|
if (e.key === "Enter" && !e.shiftKey && !e.isComposing) {
|
|
13490
13495
|
e.preventDefault();
|
|
13496
|
+
e.stopPropagation();
|
|
13491
13497
|
commit();
|
|
13492
13498
|
}
|
|
13493
13499
|
if (e.key === "Escape") reset();
|
|
@@ -13640,26 +13646,68 @@ var DiagramTextPane = defineComponent46({
|
|
|
13640
13646
|
}
|
|
13641
13647
|
});
|
|
13642
13648
|
|
|
13643
|
-
// src/
|
|
13649
|
+
// src/FormatPanel.tsx
|
|
13650
|
+
import {
|
|
13651
|
+
defineComponent as defineComponent53,
|
|
13652
|
+
ref as ref38,
|
|
13653
|
+
watch as watch33
|
|
13654
|
+
} from "vue";
|
|
13655
|
+
import {
|
|
13656
|
+
chromeControlForSlot as chromeControlForSlot7,
|
|
13657
|
+
formatSectionsOf,
|
|
13658
|
+
formatControlMixed,
|
|
13659
|
+
formatTargetKey as formatTargetKey6,
|
|
13660
|
+
formatSelectionCategory,
|
|
13661
|
+
formatSectionOpen,
|
|
13662
|
+
setFormatSectionOpen,
|
|
13663
|
+
listenFormatSectionExpansion
|
|
13664
|
+
} from "@pptx-editor.dev/core/editor";
|
|
13665
|
+
|
|
13666
|
+
// src/FormatLineWidth.tsx
|
|
13667
|
+
import { defineComponent as defineComponent48 } from "vue";
|
|
13668
|
+
import { formatLineState, formatTargetKey as formatTargetKey2, translateKeyOrText as translateKeyOrText16 } from "@pptx-editor.dev/core/editor";
|
|
13669
|
+
|
|
13670
|
+
// src/FormatNumberField.tsx
|
|
13671
|
+
import { defineComponent as defineComponent47, ref as ref34, watch as watch32, useId as useId20 } from "vue";
|
|
13644
13672
|
import { jsx as jsx39, jsxs as jsxs33 } from "vue/jsx-runtime";
|
|
13645
|
-
var
|
|
13646
|
-
|
|
13647
|
-
var PanelNumberField = defineComponent47({
|
|
13648
|
-
name: "PptxPanelNumberField",
|
|
13673
|
+
var FormatNumberField = defineComponent47({
|
|
13674
|
+
name: "FormatNumberField",
|
|
13649
13675
|
props: {
|
|
13650
13676
|
label: { type: String, required: true },
|
|
13651
|
-
value: { type: String,
|
|
13677
|
+
value: { type: String, default: null },
|
|
13652
13678
|
unit: { type: String, required: true },
|
|
13653
|
-
|
|
13679
|
+
property: String,
|
|
13680
|
+
disabled: Boolean,
|
|
13681
|
+
min: Number,
|
|
13682
|
+
exclusiveMin: Boolean,
|
|
13683
|
+
mixed: { type: Boolean, default: true },
|
|
13684
|
+
max: Number,
|
|
13654
13685
|
onCommit: { type: Function, required: true }
|
|
13655
13686
|
},
|
|
13656
13687
|
setup(props) {
|
|
13688
|
+
const { t } = useTranslation();
|
|
13689
|
+
const errorId = useId20();
|
|
13657
13690
|
const draft = ref34(null);
|
|
13658
|
-
const
|
|
13659
|
-
|
|
13660
|
-
const n = d === null || d.trim() === "" ? NaN : Number(d.replace(",", "."));
|
|
13661
|
-
if (Number.isFinite(n) && draft.value !== props.value) props.onCommit(n);
|
|
13691
|
+
const error = ref34(null);
|
|
13692
|
+
const reset = () => {
|
|
13662
13693
|
draft.value = null;
|
|
13694
|
+
error.value = null;
|
|
13695
|
+
};
|
|
13696
|
+
watch32(() => props.value, reset, { flush: "sync" });
|
|
13697
|
+
const commit = () => {
|
|
13698
|
+
if (draft.value === null) return;
|
|
13699
|
+
const number = draft.value.trim() === "" ? NaN : Number(draft.value.replace(",", "."));
|
|
13700
|
+
if (!Number.isFinite(number) || props.min !== void 0 && (number < props.min || props.exclusiveMin && number === props.min) || props.max !== void 0 && number > props.max) {
|
|
13701
|
+
error.value = props.min !== void 0 && props.max !== void 0 ? t(props.exclusiveMin ? "inspector.numberRangeExclusive" : "inspector.numberRange", {
|
|
13702
|
+
min: props.min,
|
|
13703
|
+
max: props.max
|
|
13704
|
+
}) : props.min !== void 0 ? t("inspector.numberMinimum", { min: props.min }) : t("disabled.invalidValue");
|
|
13705
|
+
return;
|
|
13706
|
+
}
|
|
13707
|
+
if (props.value !== null && number === Number(props.value)) return reset();
|
|
13708
|
+
const refused = props.onCommit(number);
|
|
13709
|
+
if (refused) error.value = refused;
|
|
13710
|
+
else reset();
|
|
13663
13711
|
};
|
|
13664
13712
|
return () => /* @__PURE__ */ jsxs33("label", { class: "pptx-field", children: [
|
|
13665
13713
|
props.label,
|
|
@@ -13669,25 +13717,436 @@ var PanelNumberField = defineComponent47({
|
|
|
13669
13717
|
{
|
|
13670
13718
|
inputmode: "decimal",
|
|
13671
13719
|
"aria-label": props.label,
|
|
13672
|
-
|
|
13720
|
+
"data-format-property": props.property,
|
|
13721
|
+
value: draft.value ?? props.value ?? "",
|
|
13722
|
+
placeholder: props.value === null && props.mixed ? t("inspector.mixed") : void 0,
|
|
13673
13723
|
disabled: props.disabled,
|
|
13724
|
+
"aria-invalid": !!error.value,
|
|
13725
|
+
"aria-describedby": error.value ? errorId : void 0,
|
|
13674
13726
|
"data-draft": draft.value !== null,
|
|
13675
13727
|
onInput: (e) => {
|
|
13676
13728
|
draft.value = e.target.value;
|
|
13677
13729
|
},
|
|
13678
13730
|
onBlur: commit,
|
|
13679
13731
|
onKeydown: (e) => {
|
|
13680
|
-
if (e.key === "Enter")
|
|
13681
|
-
|
|
13732
|
+
if (e.key === "Enter" && !e.isComposing) {
|
|
13733
|
+
e.preventDefault();
|
|
13734
|
+
commit();
|
|
13735
|
+
}
|
|
13736
|
+
if (e.key === "Escape") {
|
|
13737
|
+
e.preventDefault();
|
|
13738
|
+
e.stopPropagation();
|
|
13739
|
+
reset();
|
|
13740
|
+
}
|
|
13682
13741
|
}
|
|
13683
13742
|
}
|
|
13684
13743
|
),
|
|
13685
13744
|
/* @__PURE__ */ jsx39("span", { class: "pptx-field__unit", children: props.unit })
|
|
13686
|
-
] })
|
|
13745
|
+
] }),
|
|
13746
|
+
error.value ? /* @__PURE__ */ jsx39("span", { id: errorId, class: "pptx-chart-pane__error", role: "alert", children: error.value }) : null
|
|
13687
13747
|
] });
|
|
13688
13748
|
}
|
|
13689
13749
|
});
|
|
13690
|
-
|
|
13750
|
+
|
|
13751
|
+
// src/FormatLineWidth.tsx
|
|
13752
|
+
import { jsx as jsx40 } from "vue/jsx-runtime";
|
|
13753
|
+
var FormatLineWidth = defineComponent48({
|
|
13754
|
+
name: "FormatLineWidth",
|
|
13755
|
+
setup() {
|
|
13756
|
+
const editor = usePptxEditor();
|
|
13757
|
+
const snapshot = useEditorState((s) => s);
|
|
13758
|
+
const { t } = useTranslation();
|
|
13759
|
+
return () => {
|
|
13760
|
+
const line = formatLineState(editor.value);
|
|
13761
|
+
if (!line) return null;
|
|
13762
|
+
const key = `${editor.value?.session?.id}:${formatTargetKey2(snapshot.value)}`;
|
|
13763
|
+
return /* @__PURE__ */ jsx40(
|
|
13764
|
+
FormatNumberField,
|
|
13765
|
+
{
|
|
13766
|
+
label: t("inspector.lineWidth"),
|
|
13767
|
+
property: "line.width",
|
|
13768
|
+
value: line.width === null ? null : String(Math.round(line.width * 100) / 100),
|
|
13769
|
+
unit: "pt",
|
|
13770
|
+
min: 0,
|
|
13771
|
+
exclusiveMin: true,
|
|
13772
|
+
mixed: line.widthMixed,
|
|
13773
|
+
max: 1584,
|
|
13774
|
+
disabled: snapshot.value.mode === "view",
|
|
13775
|
+
onCommit: (points) => {
|
|
13776
|
+
if (!editor.value || `${editor.value.session?.id}:${formatTargetKey2(editor.value.snapshot())}` !== key)
|
|
13777
|
+
return t("disabled.invalidValue");
|
|
13778
|
+
if (points === line.width) return null;
|
|
13779
|
+
const result = editor.value.exec({ type: "setLineWidth", points });
|
|
13780
|
+
return result.ok ? null : translateKeyOrText16(t, result.reason);
|
|
13781
|
+
}
|
|
13782
|
+
},
|
|
13783
|
+
key
|
|
13784
|
+
);
|
|
13785
|
+
};
|
|
13786
|
+
}
|
|
13787
|
+
});
|
|
13788
|
+
|
|
13789
|
+
// src/FormatFillTransparency.tsx
|
|
13790
|
+
import { defineComponent as defineComponent49, ref as ref35 } from "vue";
|
|
13791
|
+
import {
|
|
13792
|
+
formatFillTransparency,
|
|
13793
|
+
formatTargetKey as formatTargetKey3,
|
|
13794
|
+
translateKeyOrText as translateKeyOrText17
|
|
13795
|
+
} from "@pptx-editor.dev/core/editor";
|
|
13796
|
+
import { jsx as jsx41, jsxs as jsxs34 } from "vue/jsx-runtime";
|
|
13797
|
+
var FormatFillTransparency = defineComponent49({
|
|
13798
|
+
name: "FormatFillTransparency",
|
|
13799
|
+
setup() {
|
|
13800
|
+
const editor = usePptxEditor();
|
|
13801
|
+
const snapshot = useEditorState((s) => s);
|
|
13802
|
+
const { t } = useTranslation();
|
|
13803
|
+
const preview = ref35(null);
|
|
13804
|
+
const error = ref35(null);
|
|
13805
|
+
return () => {
|
|
13806
|
+
const field = formatFillTransparency(editor.value);
|
|
13807
|
+
if (!field) return null;
|
|
13808
|
+
const key = `${editor.value?.session?.id}:${formatTargetKey3(snapshot.value)}`;
|
|
13809
|
+
const commit = (percent) => {
|
|
13810
|
+
const instance = editor.value;
|
|
13811
|
+
if (!instance || `${instance.session?.id}:${formatTargetKey3(instance.snapshot())}` !== key)
|
|
13812
|
+
return t("disabled.invalidValue");
|
|
13813
|
+
if (percent === field.value) return null;
|
|
13814
|
+
const result = instance.exec({
|
|
13815
|
+
type: "patchShapeFormat",
|
|
13816
|
+
target: field.target,
|
|
13817
|
+
patch: field.patch(percent)
|
|
13818
|
+
});
|
|
13819
|
+
return result.ok ? null : translateKeyOrText17(t, result.reason);
|
|
13820
|
+
};
|
|
13821
|
+
const label = t(field.labelKey);
|
|
13822
|
+
const value = preview.value ?? field.value;
|
|
13823
|
+
const disabled = snapshot.value.mode === "view";
|
|
13824
|
+
return /* @__PURE__ */ jsxs34("div", { class: "pptx-format-transparency", "data-format-fill-transparency": "", children: [
|
|
13825
|
+
/* @__PURE__ */ jsx41(
|
|
13826
|
+
"input",
|
|
13827
|
+
{
|
|
13828
|
+
type: "range",
|
|
13829
|
+
class: "pptx-format-transparency__slider",
|
|
13830
|
+
"data-format-slider": field.id,
|
|
13831
|
+
"aria-label": label,
|
|
13832
|
+
"aria-valuetext": `${value}${field.unit}`,
|
|
13833
|
+
min: field.min,
|
|
13834
|
+
max: field.max,
|
|
13835
|
+
step: 1,
|
|
13836
|
+
value,
|
|
13837
|
+
disabled,
|
|
13838
|
+
onInput: (e) => {
|
|
13839
|
+
preview.value = Number(e.target.value);
|
|
13840
|
+
},
|
|
13841
|
+
onChange: (e) => {
|
|
13842
|
+
preview.value = null;
|
|
13843
|
+
error.value = commit(Number(e.target.value));
|
|
13844
|
+
},
|
|
13845
|
+
onBlur: () => {
|
|
13846
|
+
preview.value = null;
|
|
13847
|
+
}
|
|
13848
|
+
}
|
|
13849
|
+
),
|
|
13850
|
+
/* @__PURE__ */ jsx41(
|
|
13851
|
+
FormatNumberField,
|
|
13852
|
+
{
|
|
13853
|
+
label,
|
|
13854
|
+
property: field.id,
|
|
13855
|
+
value: String(value),
|
|
13856
|
+
unit: field.unit,
|
|
13857
|
+
min: field.min,
|
|
13858
|
+
max: field.max,
|
|
13859
|
+
disabled,
|
|
13860
|
+
onCommit: (percent) => {
|
|
13861
|
+
error.value = null;
|
|
13862
|
+
return commit(percent);
|
|
13863
|
+
}
|
|
13864
|
+
},
|
|
13865
|
+
key
|
|
13866
|
+
),
|
|
13867
|
+
error.value ? /* @__PURE__ */ jsx41("span", { class: "pptx-chart-pane__error", role: "alert", children: error.value }) : null
|
|
13868
|
+
] });
|
|
13869
|
+
};
|
|
13870
|
+
}
|
|
13871
|
+
});
|
|
13872
|
+
|
|
13873
|
+
// src/FormatDetails.tsx
|
|
13874
|
+
import { defineComponent as defineComponent51, ref as ref37, nextTick as nextTick7 } from "vue";
|
|
13875
|
+
import {
|
|
13876
|
+
chromeControlForSlot as chromeControlForSlot6,
|
|
13877
|
+
createGradientStopIdentity,
|
|
13878
|
+
colorChoiceOf as colorChoiceOf2,
|
|
13879
|
+
colorPickOf as colorPickOf3,
|
|
13880
|
+
formatPropertyGroups,
|
|
13881
|
+
formatTargetKey as formatTargetKey4,
|
|
13882
|
+
translateKeyOrText as translateKeyOrText18
|
|
13883
|
+
} from "@pptx-editor.dev/core/editor";
|
|
13884
|
+
|
|
13885
|
+
// src/FormatGradientPicker.tsx
|
|
13886
|
+
import { defineComponent as defineComponent50, ref as ref36 } from "vue";
|
|
13887
|
+
import {
|
|
13888
|
+
gradientPreviewCss,
|
|
13889
|
+
gradientPreviewStops
|
|
13890
|
+
} from "@pptx-editor.dev/core/editor";
|
|
13891
|
+
import { jsx as jsx42, jsxs as jsxs35 } from "vue/jsx-runtime";
|
|
13892
|
+
var FormatGradientPicker = defineComponent50({
|
|
13893
|
+
name: "FormatGradientPicker",
|
|
13894
|
+
props: {
|
|
13895
|
+
gradient: { type: Object, required: true },
|
|
13896
|
+
selected: { type: String, required: true },
|
|
13897
|
+
onSelect: { type: Function, required: true }
|
|
13898
|
+
},
|
|
13899
|
+
setup(props) {
|
|
13900
|
+
const { t } = useTranslation();
|
|
13901
|
+
const rows = useEditorState((s) => s.themeColors);
|
|
13902
|
+
const root = ref36(null);
|
|
13903
|
+
return () => {
|
|
13904
|
+
const stops = gradientPreviewStops(props.gradient, rows.value);
|
|
13905
|
+
const background = gradientPreviewCss(stops);
|
|
13906
|
+
const label = (index) => `${t("inspector.gradientStop", { index: index + 1 })} \xB7 ${Math.round(stops[index].position * 100)}%`;
|
|
13907
|
+
const move = (index) => {
|
|
13908
|
+
const stop = stops[index];
|
|
13909
|
+
if (!stop) return;
|
|
13910
|
+
props.onSelect(stop.id);
|
|
13911
|
+
const buttons = root.value?.querySelectorAll(
|
|
13912
|
+
"[data-format-stop-marker]"
|
|
13913
|
+
);
|
|
13914
|
+
buttons?.[index]?.focus();
|
|
13915
|
+
};
|
|
13916
|
+
return /* @__PURE__ */ jsxs35("div", { class: "pptx-gradient-picker", ref: root, children: [
|
|
13917
|
+
/* @__PURE__ */ jsx42(
|
|
13918
|
+
"div",
|
|
13919
|
+
{
|
|
13920
|
+
class: "pptx-gradient-picker__ramp",
|
|
13921
|
+
style: background ? { backgroundImage: background } : void 0,
|
|
13922
|
+
role: "img",
|
|
13923
|
+
"aria-label": t(background ? "gradient.preview" : "inspector.previewUnavailable")
|
|
13924
|
+
}
|
|
13925
|
+
),
|
|
13926
|
+
/* @__PURE__ */ jsx42("div", { class: "pptx-gradient-picker__markers", role: "group", "aria-label": t("gradient.stops"), children: stops.map((stop, index) => /* @__PURE__ */ jsx42(
|
|
13927
|
+
"button",
|
|
13928
|
+
{
|
|
13929
|
+
type: "button",
|
|
13930
|
+
"data-format-stop-marker": stop.id,
|
|
13931
|
+
class: "pptx-gradient-picker__marker",
|
|
13932
|
+
style: { left: `${stop.position * 100}%` },
|
|
13933
|
+
"aria-label": label(index),
|
|
13934
|
+
"aria-pressed": props.selected === stop.id,
|
|
13935
|
+
tabindex: props.selected === stop.id ? 0 : -1,
|
|
13936
|
+
onClick: () => props.onSelect(stop.id),
|
|
13937
|
+
onKeydown: (e) => {
|
|
13938
|
+
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;
|
|
13939
|
+
if (next !== null) {
|
|
13940
|
+
e.preventDefault();
|
|
13941
|
+
move(next);
|
|
13942
|
+
}
|
|
13943
|
+
},
|
|
13944
|
+
children: /* @__PURE__ */ jsx42(
|
|
13945
|
+
"span",
|
|
13946
|
+
{
|
|
13947
|
+
style: stop.color ? { backgroundColor: stop.color, opacity: stop.opacity } : void 0
|
|
13948
|
+
}
|
|
13949
|
+
)
|
|
13950
|
+
},
|
|
13951
|
+
stop.id
|
|
13952
|
+
)) }),
|
|
13953
|
+
/* @__PURE__ */ jsxs35("label", { class: "pptx-field", children: [
|
|
13954
|
+
t("inspector.selectStop"),
|
|
13955
|
+
/* @__PURE__ */ jsx42(
|
|
13956
|
+
"select",
|
|
13957
|
+
{
|
|
13958
|
+
"data-format-stop-select": "",
|
|
13959
|
+
"aria-label": t("inspector.selectStop"),
|
|
13960
|
+
value: props.selected,
|
|
13961
|
+
onChange: (e) => props.onSelect(e.target.value),
|
|
13962
|
+
children: stops.map((stop, index) => /* @__PURE__ */ jsx42("option", { value: stop.id, children: label(index) }, stop.id))
|
|
13963
|
+
}
|
|
13964
|
+
)
|
|
13965
|
+
] })
|
|
13966
|
+
] });
|
|
13967
|
+
};
|
|
13968
|
+
}
|
|
13969
|
+
});
|
|
13970
|
+
|
|
13971
|
+
// src/FormatDetails.tsx
|
|
13972
|
+
import { jsx as jsx43, jsxs as jsxs36 } from "vue/jsx-runtime";
|
|
13973
|
+
var FormatDetails = defineComponent51({
|
|
13974
|
+
props: { section: { type: String, required: true } },
|
|
13975
|
+
setup(props) {
|
|
13976
|
+
const editor = usePptxEditor();
|
|
13977
|
+
const { t } = useTranslation();
|
|
13978
|
+
const snapshot = useEditorState((s) => s);
|
|
13979
|
+
const offered = useOfferedControl("shape.effects", chromeControlForSlot6("shape.effects"));
|
|
13980
|
+
const root = ref37(null);
|
|
13981
|
+
const stopIdentity = createGradientStopIdentity();
|
|
13982
|
+
const selectedStop = ref37(null);
|
|
13983
|
+
const error = ref37(null);
|
|
13984
|
+
return () => {
|
|
13985
|
+
const read = editor.value?.shapeFormat();
|
|
13986
|
+
if (snapshot.value.selection.kind === "shapes" && snapshot.value.selection.nodeIds.length > 1)
|
|
13987
|
+
return null;
|
|
13988
|
+
if (!read) return null;
|
|
13989
|
+
if (!read.ok)
|
|
13990
|
+
return /* @__PURE__ */ jsx43("p", { class: "pptx-empty__body", role: "status", children: translateKeyOrText18(t, read.reason) });
|
|
13991
|
+
const detail = read.format;
|
|
13992
|
+
if (props.section === "effects" && detail.effectsReason)
|
|
13993
|
+
return /* @__PURE__ */ jsx43("p", { class: "pptx-empty__body", role: "status", children: translateKeyOrText18(t, detail.effectsReason) });
|
|
13994
|
+
const identity = (id) => stopIdentity.identity(detail.gradient?.stops ?? [], id);
|
|
13995
|
+
const activeStop = detail.gradient?.stops.find(
|
|
13996
|
+
(stop) => selectedStop.value !== null && identity(stop.id) === selectedStop.value
|
|
13997
|
+
) ?? detail.gradient?.stops[0];
|
|
13998
|
+
const key = `${editor.value?.session?.id}:${formatTargetKey4(snapshot.value)}`;
|
|
13999
|
+
const apply = (patch) => {
|
|
14000
|
+
if (!editor.value || `${editor.value.session?.id}:${formatTargetKey4(editor.value.snapshot())}` !== key)
|
|
14001
|
+
return t("disabled.invalidValue");
|
|
14002
|
+
const result = editor.value.exec({
|
|
14003
|
+
type: "patchShapeFormat",
|
|
14004
|
+
target: detail.target,
|
|
14005
|
+
patch
|
|
14006
|
+
});
|
|
14007
|
+
if (result.ok && patch.kind === "gradient") {
|
|
14008
|
+
const next = editor.value.shapeFormat();
|
|
14009
|
+
if (next.ok && next.format.gradient && detail.gradient) {
|
|
14010
|
+
stopIdentity.patched(detail.gradient.stops, next.format.gradient.stops, patch);
|
|
14011
|
+
}
|
|
14012
|
+
}
|
|
14013
|
+
return result.ok ? null : translateKeyOrText18(t, result.reason);
|
|
14014
|
+
};
|
|
14015
|
+
const disabled = snapshot.value.mode === "view";
|
|
14016
|
+
const effectsAvailable = offered.value?.options?.some((option) => option.value === "reflection.tightTouching") === true;
|
|
14017
|
+
const unavailable = (id) => !effectsAvailable && (id === "reflection" || id === "shadow" && detail.shadow?.kind === "inner");
|
|
14018
|
+
return /* @__PURE__ */ jsxs36("div", { class: "pptx-format-details", ref: root, children: [
|
|
14019
|
+
props.section === "fill" && detail.gradient && activeStop ? /* @__PURE__ */ jsx43(
|
|
14020
|
+
FormatGradientPicker,
|
|
14021
|
+
{
|
|
14022
|
+
gradient: detail.gradient,
|
|
14023
|
+
selected: activeStop.id,
|
|
14024
|
+
onSelect: (id) => {
|
|
14025
|
+
selectedStop.value = identity(id);
|
|
14026
|
+
}
|
|
14027
|
+
}
|
|
14028
|
+
) : null,
|
|
14029
|
+
formatPropertyGroups(detail, props.section).filter((group) => group.index === void 0 || group.id === activeStop?.id).map((group) => /* @__PURE__ */ jsxs36(
|
|
14030
|
+
"fieldset",
|
|
14031
|
+
{
|
|
14032
|
+
class: "pptx-format-property-group",
|
|
14033
|
+
"data-format-stop": group.index,
|
|
14034
|
+
children: [
|
|
14035
|
+
/* @__PURE__ */ jsx43("legend", { children: t(group.labelKey, group.index ? { index: group.index } : void 0) }),
|
|
14036
|
+
/* @__PURE__ */ jsxs36("div", { class: "pptx-format-property-fields", children: [
|
|
14037
|
+
unavailable(group.id) ? /* @__PURE__ */ jsx43("p", { class: "pptx-empty__body", role: "status", children: t("inspector.effectUnavailable") }) : null,
|
|
14038
|
+
group.colors.map((field) => {
|
|
14039
|
+
const pick = field.color ? colorPickOf3(field.color) : "keep";
|
|
14040
|
+
return /* @__PURE__ */ jsx43(
|
|
14041
|
+
ColorField,
|
|
14042
|
+
{
|
|
14043
|
+
name: field.id,
|
|
14044
|
+
"data-format-property": field.id,
|
|
14045
|
+
label: t(field.labelKey),
|
|
14046
|
+
value: pick,
|
|
14047
|
+
seed: pick,
|
|
14048
|
+
disabled: disabled || unavailable(group.id),
|
|
14049
|
+
onChange: (next) => {
|
|
14050
|
+
const color = colorChoiceOf2(next);
|
|
14051
|
+
if (color) error.value = apply(field.patch(color));
|
|
14052
|
+
}
|
|
14053
|
+
},
|
|
14054
|
+
"color"
|
|
14055
|
+
);
|
|
14056
|
+
}),
|
|
14057
|
+
group.numbers.map((field) => /* @__PURE__ */ jsx43(
|
|
14058
|
+
FormatNumberField,
|
|
14059
|
+
{
|
|
14060
|
+
value: String(field.value),
|
|
14061
|
+
unit: field.unit,
|
|
14062
|
+
property: field.id,
|
|
14063
|
+
min: field.min,
|
|
14064
|
+
max: field.max,
|
|
14065
|
+
label: t(field.labelKey),
|
|
14066
|
+
disabled: disabled || unavailable(group.id),
|
|
14067
|
+
onCommit: (value) => apply(field.patch(value))
|
|
14068
|
+
},
|
|
14069
|
+
field.id.split(".").at(-1)
|
|
14070
|
+
))
|
|
14071
|
+
] }),
|
|
14072
|
+
group.index !== void 0 ? /* @__PURE__ */ jsx43(
|
|
14073
|
+
"button",
|
|
14074
|
+
{
|
|
14075
|
+
type: "button",
|
|
14076
|
+
class: "pptx-button",
|
|
14077
|
+
disabled: disabled || !group.remove,
|
|
14078
|
+
title: !group.remove ? t("inspector.stopLimit") : void 0,
|
|
14079
|
+
onClick: () => {
|
|
14080
|
+
error.value = apply(group.remove);
|
|
14081
|
+
if (!error.value) {
|
|
14082
|
+
const remaining = detail.gradient.stops.filter(
|
|
14083
|
+
(stop) => stop.id !== group.id
|
|
14084
|
+
);
|
|
14085
|
+
selectedStop.value = identity(
|
|
14086
|
+
remaining[Math.min((group.index ?? 1) - 1, remaining.length - 1)].id
|
|
14087
|
+
);
|
|
14088
|
+
void nextTick7(
|
|
14089
|
+
() => root.value?.querySelector("[data-format-stop-select]")?.focus()
|
|
14090
|
+
);
|
|
14091
|
+
}
|
|
14092
|
+
},
|
|
14093
|
+
children: t("gradient.remove")
|
|
14094
|
+
}
|
|
14095
|
+
) : null
|
|
14096
|
+
]
|
|
14097
|
+
},
|
|
14098
|
+
identity(group.id)
|
|
14099
|
+
)),
|
|
14100
|
+
props.section === "fill" && detail.gradient ? /* @__PURE__ */ jsx43("div", { class: "pptx-format-detail-actions", children: /* @__PURE__ */ jsx43(
|
|
14101
|
+
"button",
|
|
14102
|
+
{
|
|
14103
|
+
type: "button",
|
|
14104
|
+
class: "pptx-button",
|
|
14105
|
+
disabled: disabled || detail.gradient.stops.length >= 10,
|
|
14106
|
+
title: detail.gradient.stops.length >= 10 ? t("inspector.addStopLimit") : void 0,
|
|
14107
|
+
onClick: () => {
|
|
14108
|
+
const index = detail.gradient.stops.findIndex((stop) => stop.position > 0.5);
|
|
14109
|
+
error.value = apply({
|
|
14110
|
+
kind: "gradient",
|
|
14111
|
+
addStop: { position: 0.5, color: { theme: "accent1" }, opacity: 1 }
|
|
14112
|
+
});
|
|
14113
|
+
if (!error.value) {
|
|
14114
|
+
const next = editor.value.shapeFormat();
|
|
14115
|
+
if (next.ok)
|
|
14116
|
+
selectedStop.value = next.format.gradient ? stopIdentity.identity(
|
|
14117
|
+
next.format.gradient.stops,
|
|
14118
|
+
next.format.gradient.stops[index < 0 ? detail.gradient.stops.length : index].id
|
|
14119
|
+
) : null;
|
|
14120
|
+
void nextTick7(
|
|
14121
|
+
() => root.value?.querySelector("[data-format-stop-select]")?.focus()
|
|
14122
|
+
);
|
|
14123
|
+
}
|
|
14124
|
+
},
|
|
14125
|
+
children: t("gradient.add")
|
|
14126
|
+
}
|
|
14127
|
+
) }) : null,
|
|
14128
|
+
error.value ? /* @__PURE__ */ jsx43("p", { role: "alert", class: "pptx-chart-pane__error", children: error.value }) : null
|
|
14129
|
+
] }, key);
|
|
14130
|
+
};
|
|
14131
|
+
}
|
|
14132
|
+
});
|
|
14133
|
+
|
|
14134
|
+
// src/FormatGeometry.tsx
|
|
14135
|
+
import { defineComponent as defineComponent52 } from "vue";
|
|
14136
|
+
import {
|
|
14137
|
+
TABLE_OPTION_ROWS,
|
|
14138
|
+
elementKindLabelKey,
|
|
14139
|
+
elementRotates,
|
|
14140
|
+
formatPanelSize,
|
|
14141
|
+
platformShortcuts as platformShortcuts2,
|
|
14142
|
+
formatPanelKeys,
|
|
14143
|
+
formatTargetKey as formatTargetKey5,
|
|
14144
|
+
translateKeyOrText as translateKeyOrText19
|
|
14145
|
+
} from "@pptx-editor.dev/core/editor";
|
|
14146
|
+
import { jsx as jsx44, jsxs as jsxs37 } from "vue/jsx-runtime";
|
|
14147
|
+
var EMU_PER_INCH = 914400;
|
|
14148
|
+
var inches = (emu) => String(Number((emu / EMU_PER_INCH).toFixed(6)));
|
|
14149
|
+
var FormatGeometry = defineComponent52({
|
|
13691
14150
|
name: "PptxFormatTab",
|
|
13692
14151
|
setup() {
|
|
13693
14152
|
const { t } = useTranslation();
|
|
@@ -13706,13 +14165,13 @@ var FormatTab = defineComponent47({
|
|
|
13706
14165
|
return () => {
|
|
13707
14166
|
const g = geometry.value;
|
|
13708
14167
|
if (!g)
|
|
13709
|
-
return selected.value > 1 ? /* @__PURE__ */
|
|
13710
|
-
/* @__PURE__ */
|
|
13711
|
-
/* @__PURE__ */
|
|
14168
|
+
return selected.value > 1 ? /* @__PURE__ */ jsxs37("div", { class: "pptx-empty", children: [
|
|
14169
|
+
/* @__PURE__ */ jsx44("p", { class: "pptx-empty__title", children: t("panel.format.multipleTitle", { count: selected.value }) }),
|
|
14170
|
+
/* @__PURE__ */ jsx44("p", { class: "pptx-empty__body", children: platformShortcuts2(t("panel.format.multipleBody")) })
|
|
13712
14171
|
] }) : [
|
|
13713
|
-
/* @__PURE__ */
|
|
13714
|
-
/* @__PURE__ */
|
|
13715
|
-
background.isAvailable.value ? /* @__PURE__ */
|
|
14172
|
+
/* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
|
|
14173
|
+
/* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t(panelTitle.value) }),
|
|
14174
|
+
background.isAvailable.value ? /* @__PURE__ */ jsx44(
|
|
13716
14175
|
"button",
|
|
13717
14176
|
{
|
|
13718
14177
|
type: "button",
|
|
@@ -13723,20 +14182,31 @@ var FormatTab = defineComponent47({
|
|
|
13723
14182
|
}
|
|
13724
14183
|
) : null
|
|
13725
14184
|
] }),
|
|
13726
|
-
/* @__PURE__ */
|
|
13727
|
-
/* @__PURE__ */
|
|
13728
|
-
/* @__PURE__ */
|
|
14185
|
+
/* @__PURE__ */ jsxs37("div", { class: "pptx-empty", children: [
|
|
14186
|
+
/* @__PURE__ */ jsx44("p", { class: "pptx-empty__title", children: t("panel.format.emptyTitle") }),
|
|
14187
|
+
/* @__PURE__ */ jsx44("p", { class: "pptx-empty__body", children: t(panelBody.value) })
|
|
13729
14188
|
] })
|
|
13730
14189
|
];
|
|
14190
|
+
const target = editor.value ? `${editor.value.session?.id}:${formatTargetKey5(editor.value.snapshot())}` : "";
|
|
14191
|
+
const run = (command) => {
|
|
14192
|
+
if (!editor.value || `${editor.value.session?.id}:${formatTargetKey5(editor.value.snapshot())}` !== target)
|
|
14193
|
+
return t("disabled.invalidValue");
|
|
14194
|
+
const result = editor.value.exec(command);
|
|
14195
|
+
return result.ok ? null : translateKeyOrText19(t, result.reason);
|
|
14196
|
+
};
|
|
13731
14197
|
const move = (patch) => {
|
|
13732
|
-
editor.value?.
|
|
14198
|
+
if (!editor.value || `${editor.value.session?.id}:${formatTargetKey5(editor.value.snapshot())}` !== target)
|
|
14199
|
+
return t("disabled.invalidValue");
|
|
14200
|
+
const current = editor.value.snapshot().geometry;
|
|
14201
|
+
if (!current || current.nodeId !== g.nodeId) return t("disabled.invalidValue");
|
|
14202
|
+
return run({
|
|
13733
14203
|
type: "setTransform",
|
|
13734
14204
|
nodeId: g.nodeId,
|
|
13735
|
-
x: patch.x ??
|
|
13736
|
-
y: patch.y ??
|
|
13737
|
-
cx:
|
|
13738
|
-
cy:
|
|
13739
|
-
rot: patch.rot ??
|
|
14205
|
+
x: patch.x ?? current.x,
|
|
14206
|
+
y: patch.y ?? current.y,
|
|
14207
|
+
cx: patch.cx ?? current.cx,
|
|
14208
|
+
cy: patch.cy ?? current.cy,
|
|
14209
|
+
rot: patch.rot ?? current.rot
|
|
13740
14210
|
});
|
|
13741
14211
|
};
|
|
13742
14212
|
const inch = (v) => Math.round(v * EMU_PER_INCH);
|
|
@@ -13744,32 +14214,36 @@ var FormatTab = defineComponent47({
|
|
|
13744
14214
|
const tableSection = () => {
|
|
13745
14215
|
const tb = table.value;
|
|
13746
14216
|
if (!tb) return null;
|
|
13747
|
-
return /* @__PURE__ */
|
|
13748
|
-
/* @__PURE__ */
|
|
13749
|
-
/* @__PURE__ */
|
|
13750
|
-
/* @__PURE__ */
|
|
13751
|
-
|
|
14217
|
+
return /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
|
|
14218
|
+
/* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.table") }),
|
|
14219
|
+
/* @__PURE__ */ jsxs37("div", { class: "pptx-panel__grid", children: [
|
|
14220
|
+
/* @__PURE__ */ jsx44(
|
|
14221
|
+
FormatNumberField,
|
|
13752
14222
|
{
|
|
13753
14223
|
label: t("panel.format.rowHeight"),
|
|
14224
|
+
property: "table-rowHeight",
|
|
14225
|
+
min: 0,
|
|
13754
14226
|
value: inches(tb.rowHeight),
|
|
13755
14227
|
unit,
|
|
13756
14228
|
disabled: readOnly.value,
|
|
13757
|
-
onCommit: (v) =>
|
|
14229
|
+
onCommit: (v) => run({ type: "setRowHeight", height: inch(v) })
|
|
13758
14230
|
}
|
|
13759
14231
|
),
|
|
13760
|
-
/* @__PURE__ */
|
|
13761
|
-
|
|
14232
|
+
/* @__PURE__ */ jsx44(
|
|
14233
|
+
FormatNumberField,
|
|
13762
14234
|
{
|
|
13763
14235
|
label: t("panel.format.columnWidth"),
|
|
14236
|
+
property: "table-columnWidth",
|
|
14237
|
+
min: 0,
|
|
13764
14238
|
value: inches(tb.columnWidth),
|
|
13765
14239
|
unit,
|
|
13766
14240
|
disabled: readOnly.value,
|
|
13767
|
-
onCommit: (v) =>
|
|
14241
|
+
onCommit: (v) => run({ type: "setColumnWidth", width: inch(v) })
|
|
13768
14242
|
}
|
|
13769
14243
|
)
|
|
13770
14244
|
] }),
|
|
13771
|
-
/* @__PURE__ */
|
|
13772
|
-
/* @__PURE__ */
|
|
14245
|
+
/* @__PURE__ */ jsx44("div", { class: "pptx-radios", role: "group", "aria-label": t("panel.format.styleOptions"), children: TABLE_OPTION_ROWS.map(({ option, labelKey }) => /* @__PURE__ */ jsxs37("label", { class: "pptx-radio", children: [
|
|
14246
|
+
/* @__PURE__ */ jsx44(
|
|
13773
14247
|
"input",
|
|
13774
14248
|
{
|
|
13775
14249
|
type: "checkbox",
|
|
@@ -13782,10 +14256,12 @@ var FormatTab = defineComponent47({
|
|
|
13782
14256
|
] }, option)) })
|
|
13783
14257
|
] });
|
|
13784
14258
|
};
|
|
13785
|
-
const field = (key, labelKey) => /* @__PURE__ */
|
|
13786
|
-
|
|
14259
|
+
const field = (key, labelKey) => /* @__PURE__ */ jsx44(
|
|
14260
|
+
FormatNumberField,
|
|
13787
14261
|
{
|
|
13788
14262
|
label: t(labelKey),
|
|
14263
|
+
property: `geometry.${key === "cx" ? "width" : key === "cy" ? "height" : key}`,
|
|
14264
|
+
min: key === "cx" || key === "cy" ? 0 : void 0,
|
|
13789
14265
|
value: inches(g[key]),
|
|
13790
14266
|
unit,
|
|
13791
14267
|
disabled: readOnly.value,
|
|
@@ -13795,18 +14271,18 @@ var FormatTab = defineComponent47({
|
|
|
13795
14271
|
}
|
|
13796
14272
|
);
|
|
13797
14273
|
return [
|
|
13798
|
-
/* @__PURE__ */
|
|
13799
|
-
/* @__PURE__ */
|
|
13800
|
-
/* @__PURE__ */
|
|
14274
|
+
/* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
|
|
14275
|
+
/* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.element") }),
|
|
14276
|
+
/* @__PURE__ */ jsx44("span", { class: "pptx-chip", children: t(elementKindLabelKey(g, table.value, { chart: chart.value, diagram: diagram.value })) })
|
|
13801
14277
|
] }),
|
|
13802
|
-
/* @__PURE__ */
|
|
13803
|
-
/* @__PURE__ */
|
|
13804
|
-
/* @__PURE__ */
|
|
14278
|
+
/* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
|
|
14279
|
+
/* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.size") }),
|
|
14280
|
+
/* @__PURE__ */ jsxs37("div", { class: "pptx-panel__grid", children: [
|
|
13805
14281
|
field("cx", "panel.format.width"),
|
|
13806
14282
|
field("cy", "panel.format.height")
|
|
13807
14283
|
] }),
|
|
13808
|
-
/* @__PURE__ */
|
|
13809
|
-
/* @__PURE__ */
|
|
14284
|
+
/* @__PURE__ */ jsxs37("label", { class: "pptx-radio", children: [
|
|
14285
|
+
/* @__PURE__ */ jsx44(
|
|
13810
14286
|
"input",
|
|
13811
14287
|
{
|
|
13812
14288
|
type: "checkbox",
|
|
@@ -13821,31 +14297,34 @@ var FormatTab = defineComponent47({
|
|
|
13821
14297
|
t("imageProperties.lockAspect")
|
|
13822
14298
|
] })
|
|
13823
14299
|
] }),
|
|
13824
|
-
/* @__PURE__ */
|
|
13825
|
-
/* @__PURE__ */
|
|
13826
|
-
/* @__PURE__ */
|
|
14300
|
+
/* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
|
|
14301
|
+
/* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.position") }),
|
|
14302
|
+
/* @__PURE__ */ jsxs37("div", { class: "pptx-panel__grid", children: [
|
|
13827
14303
|
field("x", "panel.format.x"),
|
|
13828
14304
|
field("y", "panel.format.y")
|
|
13829
14305
|
] })
|
|
13830
14306
|
] }),
|
|
13831
|
-
elementRotates(g, table.value) ? /* @__PURE__ */
|
|
13832
|
-
/* @__PURE__ */
|
|
13833
|
-
/* @__PURE__ */
|
|
13834
|
-
|
|
14307
|
+
elementRotates(g, table.value) ? /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
|
|
14308
|
+
/* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.rotation") }),
|
|
14309
|
+
/* @__PURE__ */ jsx44("div", { class: "pptx-panel__grid", children: /* @__PURE__ */ jsx44(
|
|
14310
|
+
FormatNumberField,
|
|
13835
14311
|
{
|
|
13836
14312
|
label: t("panel.format.angle"),
|
|
14313
|
+
property: "geometry.rotation",
|
|
14314
|
+
min: 0,
|
|
14315
|
+
max: 360,
|
|
13837
14316
|
value: String(Math.round(g.rot * 10) / 10),
|
|
13838
14317
|
unit: "\xB0",
|
|
13839
14318
|
disabled: readOnly.value,
|
|
13840
|
-
onCommit: (v) => move({ rot:
|
|
14319
|
+
onCommit: (v) => move({ rot: v })
|
|
13841
14320
|
}
|
|
13842
14321
|
) })
|
|
13843
14322
|
] }) : null,
|
|
13844
14323
|
tableSection(),
|
|
13845
|
-
g.textFitting ? /* @__PURE__ */
|
|
13846
|
-
/* @__PURE__ */
|
|
13847
|
-
/* @__PURE__ */
|
|
13848
|
-
/* @__PURE__ */
|
|
14324
|
+
g.textFitting ? /* @__PURE__ */ jsxs37("div", { class: "pptx-panel__section", children: [
|
|
14325
|
+
/* @__PURE__ */ jsx44("h3", { class: "pptx-panel__title", children: t("panel.format.textFitting") }),
|
|
14326
|
+
/* @__PURE__ */ jsx44("div", { class: "pptx-radios", role: "radiogroup", "aria-label": t("panel.format.textFitting"), children: ["none", "shrink", "shape"].map((mode) => /* @__PURE__ */ jsxs37("label", { class: "pptx-radio", children: [
|
|
14327
|
+
/* @__PURE__ */ jsx44(
|
|
13849
14328
|
"input",
|
|
13850
14329
|
{
|
|
13851
14330
|
type: "radio",
|
|
@@ -13862,6 +14341,106 @@ var FormatTab = defineComponent47({
|
|
|
13862
14341
|
};
|
|
13863
14342
|
}
|
|
13864
14343
|
});
|
|
14344
|
+
|
|
14345
|
+
// src/FormatPanel.tsx
|
|
14346
|
+
import { jsx as jsx45, jsxs as jsxs38 } from "vue/jsx-runtime";
|
|
14347
|
+
var formatSectionProps = {
|
|
14348
|
+
section: { type: Object, required: true }
|
|
14349
|
+
};
|
|
14350
|
+
var FormatSection = defineComponent53({
|
|
14351
|
+
name: "FormatSection",
|
|
14352
|
+
props: formatSectionProps,
|
|
14353
|
+
setup(props) {
|
|
14354
|
+
const { t } = useTranslation();
|
|
14355
|
+
const editor = usePptxEditor();
|
|
14356
|
+
const background = useEditorDialog("background");
|
|
14357
|
+
const snapshot = useEditorState((s) => s);
|
|
14358
|
+
const expansion = ref38(0);
|
|
14359
|
+
watch33(
|
|
14360
|
+
editor,
|
|
14361
|
+
(instance, _old, onCleanup) => {
|
|
14362
|
+
if (instance)
|
|
14363
|
+
onCleanup(
|
|
14364
|
+
listenFormatSectionExpansion(instance, () => {
|
|
14365
|
+
expansion.value += 1;
|
|
14366
|
+
})
|
|
14367
|
+
);
|
|
14368
|
+
},
|
|
14369
|
+
{ immediate: true }
|
|
14370
|
+
);
|
|
14371
|
+
return () => {
|
|
14372
|
+
void expansion.value;
|
|
14373
|
+
const section = props.section;
|
|
14374
|
+
const category = formatSelectionCategory(snapshot.value);
|
|
14375
|
+
const expanded = formatSectionOpen(editor.value, category, section.id);
|
|
14376
|
+
return /* @__PURE__ */ jsxs38("details", { class: "pptx-format-disclosure", open: expanded, children: [
|
|
14377
|
+
/* @__PURE__ */ jsx45(
|
|
14378
|
+
"summary",
|
|
14379
|
+
{
|
|
14380
|
+
"data-format-toggle": section.id,
|
|
14381
|
+
class: "pptx-format-summary",
|
|
14382
|
+
onClick: (event) => {
|
|
14383
|
+
event.preventDefault();
|
|
14384
|
+
if (editor.value) setFormatSectionOpen(editor.value, category, section.id, !expanded);
|
|
14385
|
+
},
|
|
14386
|
+
children: t(section.labelKey)
|
|
14387
|
+
}
|
|
14388
|
+
),
|
|
14389
|
+
/* @__PURE__ */ jsxs38("div", { class: "pptx-format-section-body", children: [
|
|
14390
|
+
section.id === "geometry" ? /* @__PURE__ */ jsx45(FormatGeometry, {}) : null,
|
|
14391
|
+
section.id === "fill" || section.id === "effects" ? /* @__PURE__ */ jsx45(FormatDetails, { section: section.id }) : null,
|
|
14392
|
+
section.id === "geometry" ? null : section.id === "chart" ? /* @__PURE__ */ jsx45(ChartDataPane, {}) : section.id === "diagram" ? /* @__PURE__ */ jsx45(DiagramTextPane, {}) : /* @__PURE__ */ jsx45("div", { class: "pptx-format-controls", children: section.slots.filter((slot) => slot !== "slide.background" || background.isAvailable.value).flatMap((slot) => [
|
|
14393
|
+
/* @__PURE__ */ jsxs38("div", { class: "pptx-format-control", "data-format-slot": slot, children: [
|
|
14394
|
+
slot !== "shape.lineWidth" ? /* @__PURE__ */ jsx45("span", { class: "pptx-format-control__label", children: t(chromeControlForSlot7(slot).labelKey) }) : null,
|
|
14395
|
+
formatControlMixed(editor.value, slot) ? /* @__PURE__ */ jsx45("span", { class: "pptx-format-mixed", children: t("inspector.mixed") }) : null,
|
|
14396
|
+
slot === "shape.lineWidth" ? /* @__PURE__ */ jsx45(FormatLineWidth, {}) : /* @__PURE__ */ jsx45(ToolbarSlot, { slotId: slot })
|
|
14397
|
+
] }, slot),
|
|
14398
|
+
slot === "shape.fill" ? /* @__PURE__ */ jsx45(FormatFillTransparency, {}, "fill.transparency") : null
|
|
14399
|
+
]) })
|
|
14400
|
+
] })
|
|
14401
|
+
] });
|
|
14402
|
+
};
|
|
14403
|
+
}
|
|
14404
|
+
});
|
|
14405
|
+
var formatPanelProps = {
|
|
14406
|
+
sections: { type: Array, default: void 0 },
|
|
14407
|
+
className: { type: String, default: void 0 }
|
|
14408
|
+
};
|
|
14409
|
+
var FormatPanel = defineComponent53({
|
|
14410
|
+
name: "FormatPanel",
|
|
14411
|
+
props: formatPanelProps,
|
|
14412
|
+
slots: Object,
|
|
14413
|
+
setup(props, { slots }) {
|
|
14414
|
+
const editor = usePptxEditor();
|
|
14415
|
+
const snapshot = useEditorState((s) => s);
|
|
14416
|
+
const { t } = useTranslation();
|
|
14417
|
+
const root = ref38(null);
|
|
14418
|
+
watch33(
|
|
14419
|
+
() => formatSelectionCategory(snapshot.value),
|
|
14420
|
+
(category, previous) => {
|
|
14421
|
+
if (category !== previous) {
|
|
14422
|
+
const scroller = root.value?.closest(".pptx-panel__body");
|
|
14423
|
+
if (scroller) scroller.scrollTop = 0;
|
|
14424
|
+
}
|
|
14425
|
+
},
|
|
14426
|
+
{ flush: "post" }
|
|
14427
|
+
);
|
|
14428
|
+
return () => /* @__PURE__ */ jsxs38("div", { ref: root, class: ["pptx-format-panel", props.className], children: [
|
|
14429
|
+
snapshot.value.selection.kind === "shapes" && snapshot.value.selection.nodeIds.length > 1 ? /* @__PURE__ */ jsx45("p", { class: "pptx-panel__title", children: t("panel.format.multipleTitle", { count: snapshot.value.selection.nodeIds.length }) }) : snapshot.value.geometry ? /* @__PURE__ */ jsx45("p", { class: "pptx-panel__title", children: snapshot.value.geometry.name }) : null,
|
|
14430
|
+
/* @__PURE__ */ jsx45("div", { class: "pptx-format-sections", children: formatSectionsOf(snapshot.value, props.sections).map((section) => /* @__PURE__ */ jsx45("div", { "data-format-section": section.id, children: slots[section.id] ? slots[section.id]() : /* @__PURE__ */ jsx45(
|
|
14431
|
+
FormatSection,
|
|
14432
|
+
{
|
|
14433
|
+
section
|
|
14434
|
+
},
|
|
14435
|
+
section.id === "diagram" ? section.id : formatTargetKey6(snapshot.value)
|
|
14436
|
+
) }, section.id)) }, editor.value?.session?.id),
|
|
14437
|
+
slots.default?.()
|
|
14438
|
+
] });
|
|
14439
|
+
}
|
|
14440
|
+
});
|
|
14441
|
+
|
|
14442
|
+
// src/SidePanel.tsx
|
|
14443
|
+
import { jsx as jsx46, jsxs as jsxs39 } from "vue/jsx-runtime";
|
|
13865
14444
|
var sidePanelProps = {
|
|
13866
14445
|
/** The panel's width in CSS pixels. */
|
|
13867
14446
|
paneWidth: { type: Number, default: void 0 },
|
|
@@ -13875,17 +14454,17 @@ var sidePanelProps = {
|
|
|
13875
14454
|
tab: { type: String, default: void 0 }
|
|
13876
14455
|
};
|
|
13877
14456
|
function packagedPane(tab, t) {
|
|
13878
|
-
if (tab === "format") return /* @__PURE__ */
|
|
13879
|
-
if (tab === "chart") return /* @__PURE__ */
|
|
13880
|
-
if (tab === "diagram") return /* @__PURE__ */
|
|
13881
|
-
if (tab === "selection") return /* @__PURE__ */
|
|
13882
|
-
if (tab === "animations") return /* @__PURE__ */
|
|
13883
|
-
return /* @__PURE__ */
|
|
13884
|
-
/* @__PURE__ */
|
|
13885
|
-
/* @__PURE__ */
|
|
14457
|
+
if (tab === "format") return /* @__PURE__ */ jsx46(FormatPanel, {});
|
|
14458
|
+
if (tab === "chart") return /* @__PURE__ */ jsx46(ChartDataPane, {});
|
|
14459
|
+
if (tab === "diagram") return /* @__PURE__ */ jsx46(DiagramTextPane, {});
|
|
14460
|
+
if (tab === "selection") return /* @__PURE__ */ jsx46(PptxEditorSelectionPane, {});
|
|
14461
|
+
if (tab === "animations") return /* @__PURE__ */ jsx46(AnimationsPane, {});
|
|
14462
|
+
return /* @__PURE__ */ jsxs39("div", { class: "pptx-empty", children: [
|
|
14463
|
+
/* @__PURE__ */ jsx46("p", { class: "pptx-empty__title", children: t("panel.comments.emptyTitle") }),
|
|
14464
|
+
/* @__PURE__ */ jsx46("p", { class: "pptx-empty__body", children: t("panel.comments.emptyBody") })
|
|
13886
14465
|
] });
|
|
13887
14466
|
}
|
|
13888
|
-
var PptxEditorSidePanel =
|
|
14467
|
+
var PptxEditorSidePanel = defineComponent54({
|
|
13889
14468
|
name: "PptxEditorSidePanel",
|
|
13890
14469
|
inheritAttrs: false,
|
|
13891
14470
|
props: sidePanelProps,
|
|
@@ -13900,7 +14479,7 @@ var PptxEditorSidePanel = defineComponent47({
|
|
|
13900
14479
|
setup(props, { attrs, emit, slots }) {
|
|
13901
14480
|
const { t } = useTranslation();
|
|
13902
14481
|
const editor = usePptxEditor();
|
|
13903
|
-
const own =
|
|
14482
|
+
const own = ref39(props.tab ?? "format");
|
|
13904
14483
|
const tab = computed21(() => props.tab ?? own.value);
|
|
13905
14484
|
const chartSelected = useEditorState((s) => !!s.chart);
|
|
13906
14485
|
const diagramSelected = useEditorState((s) => !!s.diagram);
|
|
@@ -13912,8 +14491,8 @@ var PptxEditorSidePanel = defineComponent47({
|
|
|
13912
14491
|
emit("tabChange", next);
|
|
13913
14492
|
emit("update:tab", next);
|
|
13914
14493
|
};
|
|
13915
|
-
const root =
|
|
13916
|
-
const focusTab = (pane) => void
|
|
14494
|
+
const root = ref39(null);
|
|
14495
|
+
const focusTab = (pane) => void nextTick8(() => {
|
|
13917
14496
|
const body = root.value?.querySelector(".pptx-panel__body");
|
|
13918
14497
|
if (body?.contains(body.ownerDocument.activeElement)) return;
|
|
13919
14498
|
const current = root.value?.querySelector(
|
|
@@ -13921,7 +14500,7 @@ var PptxEditorSidePanel = defineComponent47({
|
|
|
13921
14500
|
);
|
|
13922
14501
|
(current ?? root.value?.querySelector(`[data-tab="${pane}"]`))?.focus();
|
|
13923
14502
|
});
|
|
13924
|
-
|
|
14503
|
+
watch34(
|
|
13925
14504
|
editor,
|
|
13926
14505
|
(e, _old, onCleanup) => {
|
|
13927
14506
|
if (!e) return;
|
|
@@ -13944,7 +14523,7 @@ var PptxEditorSidePanel = defineComponent47({
|
|
|
13944
14523
|
return () => {
|
|
13945
14524
|
const { class: hostClass, style: hostStyle, ...rest } = attrs;
|
|
13946
14525
|
const style = [hostStyle, props.style];
|
|
13947
|
-
return /* @__PURE__ */
|
|
14526
|
+
return /* @__PURE__ */ jsxs39(
|
|
13948
14527
|
"aside",
|
|
13949
14528
|
{
|
|
13950
14529
|
ref: root,
|
|
@@ -13954,8 +14533,8 @@ var PptxEditorSidePanel = defineComponent47({
|
|
|
13954
14533
|
style: props.paneWidth === void 0 ? style : [{ width: `${props.paneWidth}px` }, ...style],
|
|
13955
14534
|
onMousedown: keepFocus,
|
|
13956
14535
|
children: [
|
|
13957
|
-
/* @__PURE__ */
|
|
13958
|
-
/* @__PURE__ */
|
|
14536
|
+
/* @__PURE__ */ jsxs39("div", { class: "pptx-panel__head", children: [
|
|
14537
|
+
/* @__PURE__ */ jsx46(
|
|
13959
14538
|
"div",
|
|
13960
14539
|
{
|
|
13961
14540
|
class: "pptx-tabs",
|
|
@@ -13967,7 +14546,7 @@ var PptxEditorSidePanel = defineComponent47({
|
|
|
13967
14546
|
setTab(next);
|
|
13968
14547
|
e.currentTarget.querySelector(`[data-tab="${next}"]`)?.focus();
|
|
13969
14548
|
},
|
|
13970
|
-
children: tabs.value.map((id) => /* @__PURE__ */
|
|
14549
|
+
children: tabs.value.map((id) => /* @__PURE__ */ jsxs39(
|
|
13971
14550
|
"button",
|
|
13972
14551
|
{
|
|
13973
14552
|
type: "button",
|
|
@@ -13980,17 +14559,17 @@ var PptxEditorSidePanel = defineComponent47({
|
|
|
13980
14559
|
tabindex: tab.value === id ? 0 : -1,
|
|
13981
14560
|
onClick: () => setTab(id),
|
|
13982
14561
|
children: [
|
|
13983
|
-
/* @__PURE__ */
|
|
13984
|
-
tab.value === id ? /* @__PURE__ */
|
|
14562
|
+
/* @__PURE__ */ jsx46(Icon, { name: SIDE_PANEL_TAB_ICONS[id] }),
|
|
14563
|
+
tab.value === id ? /* @__PURE__ */ jsx46("span", { class: "pptx-tabs__label", "aria-hidden": "true", children: t(`panel.tabs.${id}`) }) : null
|
|
13985
14564
|
]
|
|
13986
14565
|
},
|
|
13987
14566
|
id
|
|
13988
14567
|
))
|
|
13989
14568
|
}
|
|
13990
14569
|
),
|
|
13991
|
-
props.onClose ? /* @__PURE__ */
|
|
14570
|
+
props.onClose ? /* @__PURE__ */ jsx46(ToolButton, { label: t("panel.close"), icon: "close", onClick: () => props.onClose?.() }) : null
|
|
13992
14571
|
] }),
|
|
13993
|
-
/* @__PURE__ */
|
|
14572
|
+
/* @__PURE__ */ jsx46(
|
|
13994
14573
|
"div",
|
|
13995
14574
|
{
|
|
13996
14575
|
class: "pptx-panel__body",
|
|
@@ -14007,11 +14586,11 @@ var PptxEditorSidePanel = defineComponent47({
|
|
|
14007
14586
|
});
|
|
14008
14587
|
|
|
14009
14588
|
// src/panes.tsx
|
|
14010
|
-
import { jsx as
|
|
14589
|
+
import { jsx as jsx47, jsxs as jsxs40 } from "vue/jsx-runtime";
|
|
14011
14590
|
var sameSlides2 = (a, b) => a.length === b.length && a.every((s, i) => s === b[i]);
|
|
14012
14591
|
var sameIndices2 = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
|
|
14013
14592
|
var clickMode = slideClickMode;
|
|
14014
|
-
var Thumbnail =
|
|
14593
|
+
var Thumbnail = defineComponent55({
|
|
14015
14594
|
name: "PptxThumbnail",
|
|
14016
14595
|
props: {
|
|
14017
14596
|
slide: { type: Object, required: true },
|
|
@@ -14019,19 +14598,19 @@ var Thumbnail = defineComponent48({
|
|
|
14019
14598
|
},
|
|
14020
14599
|
setup(props) {
|
|
14021
14600
|
const editor = usePptxEditor();
|
|
14022
|
-
const box =
|
|
14601
|
+
const box = ref40(null);
|
|
14023
14602
|
let dispose = null;
|
|
14024
14603
|
const paint = () => {
|
|
14025
14604
|
dispose?.();
|
|
14026
14605
|
dispose = editor.value && box.value ? editor.value.renderThumbnail(props.slide.index, box.value, { defer: true }) : null;
|
|
14027
14606
|
};
|
|
14028
14607
|
onMounted19(paint);
|
|
14029
|
-
|
|
14608
|
+
watch35(() => [editor.value, props.slide], paint, { flush: "post" });
|
|
14030
14609
|
onBeforeUnmount11(() => {
|
|
14031
14610
|
dispose?.();
|
|
14032
14611
|
dispose = null;
|
|
14033
14612
|
});
|
|
14034
|
-
return () => /* @__PURE__ */
|
|
14613
|
+
return () => /* @__PURE__ */ jsx47(
|
|
14035
14614
|
"div",
|
|
14036
14615
|
{
|
|
14037
14616
|
ref: box,
|
|
@@ -14043,7 +14622,7 @@ var Thumbnail = defineComponent48({
|
|
|
14043
14622
|
);
|
|
14044
14623
|
}
|
|
14045
14624
|
});
|
|
14046
|
-
var RailItem =
|
|
14625
|
+
var RailItem = defineComponent55({
|
|
14047
14626
|
name: "PptxRailItem",
|
|
14048
14627
|
props: {
|
|
14049
14628
|
slide: { type: Object, required: true },
|
|
@@ -14063,7 +14642,7 @@ var RailItem = defineComponent48({
|
|
|
14063
14642
|
setup(props) {
|
|
14064
14643
|
return () => {
|
|
14065
14644
|
const { slide: s, on } = props;
|
|
14066
|
-
return /* @__PURE__ */
|
|
14645
|
+
return /* @__PURE__ */ jsxs40(
|
|
14067
14646
|
"li",
|
|
14068
14647
|
{
|
|
14069
14648
|
class: "pptx-rail__item",
|
|
@@ -14084,9 +14663,9 @@ var RailItem = defineComponent48({
|
|
|
14084
14663
|
onClick: (e) => on.click(s.index, e),
|
|
14085
14664
|
onContextmenu: (e) => on.menu(s.index, e),
|
|
14086
14665
|
children: [
|
|
14087
|
-
/* @__PURE__ */
|
|
14088
|
-
/* @__PURE__ */
|
|
14089
|
-
/* @__PURE__ */
|
|
14666
|
+
/* @__PURE__ */ jsx47("span", { class: "pptx-rail__number", "aria-hidden": "true", children: s.index + 1 }),
|
|
14667
|
+
/* @__PURE__ */ jsx47("span", { class: "pptx-sr-only", children: props.name }),
|
|
14668
|
+
/* @__PURE__ */ jsx47(Thumbnail, { slide: s, ratio: props.ratio })
|
|
14090
14669
|
]
|
|
14091
14670
|
}
|
|
14092
14671
|
);
|
|
@@ -14095,7 +14674,7 @@ var RailItem = defineComponent48({
|
|
|
14095
14674
|
});
|
|
14096
14675
|
function useFocusFollowsCurrent(list, item, watched) {
|
|
14097
14676
|
let focused = null;
|
|
14098
|
-
|
|
14677
|
+
watch35(
|
|
14099
14678
|
() => watched().join("|"),
|
|
14100
14679
|
() => followCurrentSlide(list.value, item, focused),
|
|
14101
14680
|
{ flush: "post" }
|
|
@@ -14151,7 +14730,7 @@ function restAttrs(attrs) {
|
|
|
14151
14730
|
return rest;
|
|
14152
14731
|
}
|
|
14153
14732
|
function usePaneOpen(props, emit) {
|
|
14154
|
-
const own =
|
|
14733
|
+
const own = ref40(props.defaultOpen ?? true);
|
|
14155
14734
|
return {
|
|
14156
14735
|
open: computed22(() => props.open ?? own.value),
|
|
14157
14736
|
setOpen: (next) => {
|
|
@@ -14160,20 +14739,20 @@ function usePaneOpen(props, emit) {
|
|
|
14160
14739
|
}
|
|
14161
14740
|
};
|
|
14162
14741
|
}
|
|
14163
|
-
var SlideRailRoot =
|
|
14742
|
+
var SlideRailRoot = defineComponent55({
|
|
14164
14743
|
name: "PptxEditorSlideRail",
|
|
14165
14744
|
inheritAttrs: false,
|
|
14166
14745
|
props: slideRailProps,
|
|
14167
14746
|
emits: { "update:open": (_open) => true },
|
|
14168
14747
|
setup(props, { attrs, emit, slots }) {
|
|
14169
14748
|
const pane = usePaneOpen(props, emit);
|
|
14170
|
-
const rail =
|
|
14171
|
-
const listId =
|
|
14749
|
+
const rail = ref40(null);
|
|
14750
|
+
const listId = useId21();
|
|
14172
14751
|
let focusToggle = false;
|
|
14173
14752
|
const setOpen = (next) => {
|
|
14174
14753
|
focusToggle = rail.value?.contains(document.activeElement) ?? false;
|
|
14175
14754
|
pane.setOpen(next);
|
|
14176
|
-
void
|
|
14755
|
+
void nextTick9(() => {
|
|
14177
14756
|
focusToggle = false;
|
|
14178
14757
|
});
|
|
14179
14758
|
};
|
|
@@ -14184,24 +14763,24 @@ var SlideRailRoot = defineComponent48({
|
|
|
14184
14763
|
const selected = useEditorState((s) => s.selectedSlides, sameIndices2);
|
|
14185
14764
|
const ratio = useEditorState((s) => s.slideHeight / s.slideWidth);
|
|
14186
14765
|
const readOnly = useEditorState((s) => s.mode === "view");
|
|
14187
|
-
const list =
|
|
14766
|
+
const list = ref40(null);
|
|
14188
14767
|
const count = () => slides.value.length;
|
|
14189
14768
|
const opening = useEditorState((s) => (s.pendingSlides ?? 0) > 0);
|
|
14190
14769
|
const loading = useEditorState((s) => s.isOpening === true);
|
|
14191
|
-
const grown =
|
|
14770
|
+
const grown = ref40(0);
|
|
14192
14771
|
const mount = createProgressiveMount(() => grown.value += 1);
|
|
14193
14772
|
onMounted19(() => mount.follow(count()));
|
|
14194
14773
|
onUpdated4(() => mount.follow(count()));
|
|
14195
14774
|
onUnmounted4(() => mount.dispose());
|
|
14196
14775
|
const menu = shallowRef28(null);
|
|
14197
14776
|
const gallery = shallowRef28(null);
|
|
14198
|
-
const actions =
|
|
14777
|
+
const actions = ref40(null);
|
|
14199
14778
|
const sections = useSlideSections();
|
|
14200
14779
|
const grouped = computed22(() => groupSlideSections2(sections.value, count()));
|
|
14201
14780
|
const orientation = () => resolveRailOrientation2(props.orientation, "PptxEditorSlideRail");
|
|
14202
14781
|
const drag = useSlideDrag(() => railDragAxis(orientation()), selected, readOnly, grouped);
|
|
14203
14782
|
const folded = shallowRef28(false);
|
|
14204
|
-
|
|
14783
|
+
watch35(
|
|
14205
14784
|
() => [rail.value, orientation(), pane.open.value],
|
|
14206
14785
|
([el, axis], _old, onCleanup) => onCleanup(
|
|
14207
14786
|
watchRailFold(el, axis, (next) => {
|
|
@@ -14217,7 +14796,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14217
14796
|
onMounted19(readDirection);
|
|
14218
14797
|
onUpdated4(readDirection);
|
|
14219
14798
|
const collapsed = useCollapsedSections();
|
|
14220
|
-
const renaming =
|
|
14799
|
+
const renaming = ref40(null);
|
|
14221
14800
|
useOpenCurrentSection(grouped);
|
|
14222
14801
|
useSectionRenameRequests(
|
|
14223
14802
|
(id) => {
|
|
@@ -14247,12 +14826,12 @@ var SlideRailRoot = defineComponent48({
|
|
|
14247
14826
|
count(),
|
|
14248
14827
|
pane.open.value
|
|
14249
14828
|
]);
|
|
14250
|
-
|
|
14829
|
+
watch35(
|
|
14251
14830
|
list,
|
|
14252
14831
|
(el, _old, onCleanup) => onCleanup(keepCurrentSlideInView2(el, ".pptx-rail__item")),
|
|
14253
14832
|
{ flush: "post" }
|
|
14254
14833
|
);
|
|
14255
|
-
|
|
14834
|
+
watch35(
|
|
14256
14835
|
() => pane.open.value,
|
|
14257
14836
|
(open) => {
|
|
14258
14837
|
const active = document.activeElement;
|
|
@@ -14330,7 +14909,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14330
14909
|
const here = s.index === current.value;
|
|
14331
14910
|
const drop = drag.marker(s.index);
|
|
14332
14911
|
const inputs = [place?.setSize, place?.posInSet, ratio.value, chosen, here, role, props.t];
|
|
14333
|
-
return memoItem(s, [...inputs, labels, drop, readOnly.value], () => /* @__PURE__ */
|
|
14912
|
+
return memoItem(s, [...inputs, labels, drop, readOnly.value], () => /* @__PURE__ */ jsx47(
|
|
14334
14913
|
RailItem,
|
|
14335
14914
|
{
|
|
14336
14915
|
setSize: place?.setSize,
|
|
@@ -14352,7 +14931,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14352
14931
|
return () => {
|
|
14353
14932
|
if (masterView.value && props.open === false) return null;
|
|
14354
14933
|
if (masterView.value)
|
|
14355
|
-
return /* @__PURE__ */
|
|
14934
|
+
return /* @__PURE__ */ jsx47(
|
|
14356
14935
|
MasterRail,
|
|
14357
14936
|
{
|
|
14358
14937
|
...restAttrs(attrs),
|
|
@@ -14368,7 +14947,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14368
14947
|
const style = [attrs.style, props.style];
|
|
14369
14948
|
if (!open && !toggle) return null;
|
|
14370
14949
|
if (!open)
|
|
14371
|
-
return /* @__PURE__ */
|
|
14950
|
+
return /* @__PURE__ */ jsx47(
|
|
14372
14951
|
"nav",
|
|
14373
14952
|
{
|
|
14374
14953
|
...restAttrs(attrs),
|
|
@@ -14396,7 +14975,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14396
14975
|
itemLimit = inView ? inView.limit : mounted;
|
|
14397
14976
|
isSelected = new Set(selected.value);
|
|
14398
14977
|
labels = slideItemLabels(t);
|
|
14399
|
-
return /* @__PURE__ */
|
|
14978
|
+
return /* @__PURE__ */ jsxs40(
|
|
14400
14979
|
"nav",
|
|
14401
14980
|
{
|
|
14402
14981
|
...restAttrs(attrs),
|
|
@@ -14407,7 +14986,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14407
14986
|
"data-orientation": orientation(),
|
|
14408
14987
|
style: paneStyle(props.paneWidth, style),
|
|
14409
14988
|
children: [
|
|
14410
|
-
/* @__PURE__ */
|
|
14989
|
+
/* @__PURE__ */ jsx47(
|
|
14411
14990
|
"ol",
|
|
14412
14991
|
{
|
|
14413
14992
|
ref: list,
|
|
@@ -14424,7 +15003,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14424
15003
|
},
|
|
14425
15004
|
children: groups && inView ? inView.sections.map((sec) => {
|
|
14426
15005
|
const shut = collapsed.value.includes(sec.id);
|
|
14427
|
-
return /* @__PURE__ */
|
|
15006
|
+
return /* @__PURE__ */ jsx47(
|
|
14428
15007
|
SectionNode,
|
|
14429
15008
|
{
|
|
14430
15009
|
section: sec,
|
|
@@ -14449,7 +15028,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14449
15028
|
}) : slides.value.slice(0, mounted).map(item)
|
|
14450
15029
|
}
|
|
14451
15030
|
),
|
|
14452
|
-
/* @__PURE__ */
|
|
15031
|
+
/* @__PURE__ */ jsx47(
|
|
14453
15032
|
"div",
|
|
14454
15033
|
{
|
|
14455
15034
|
ref: actions,
|
|
@@ -14459,7 +15038,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14459
15038
|
children: content
|
|
14460
15039
|
}
|
|
14461
15040
|
),
|
|
14462
|
-
gallery.value ? /* @__PURE__ */
|
|
15041
|
+
gallery.value ? /* @__PURE__ */ jsx47(
|
|
14463
15042
|
Popover,
|
|
14464
15043
|
{
|
|
14465
15044
|
anchor: gallery.value,
|
|
@@ -14467,7 +15046,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14467
15046
|
gallery.value = null;
|
|
14468
15047
|
},
|
|
14469
15048
|
label: t("rail.chooseLayout"),
|
|
14470
|
-
children: () => /* @__PURE__ */
|
|
15049
|
+
children: () => /* @__PURE__ */ jsx47(
|
|
14471
15050
|
LayoutGallery,
|
|
14472
15051
|
{
|
|
14473
15052
|
onChange: (layoutId) => {
|
|
@@ -14478,7 +15057,7 @@ var SlideRailRoot = defineComponent48({
|
|
|
14478
15057
|
)
|
|
14479
15058
|
}
|
|
14480
15059
|
) : null,
|
|
14481
|
-
/* @__PURE__ */
|
|
15060
|
+
/* @__PURE__ */ jsx47(
|
|
14482
15061
|
RailMenuHost,
|
|
14483
15062
|
{
|
|
14484
15063
|
open: menu.value ? {
|
|
@@ -14514,7 +15093,7 @@ var zoomPillProps = {
|
|
|
14514
15093
|
/** A class name added to the pill, as React's `className`. A host `class` also works. */
|
|
14515
15094
|
className: { type: String, default: void 0 }
|
|
14516
15095
|
};
|
|
14517
|
-
var PptxEditorZoomPill =
|
|
15096
|
+
var PptxEditorZoomPill = defineComponent55({
|
|
14518
15097
|
name: "PptxEditorZoomPill",
|
|
14519
15098
|
props: zoomPillProps,
|
|
14520
15099
|
setup(props) {
|
|
@@ -14524,9 +15103,9 @@ var PptxEditorZoomPill = defineComponent48({
|
|
|
14524
15103
|
const fit = useEditorState((s) => s.fitZoom);
|
|
14525
15104
|
const off = useEditorState((s) => s.presentationView === "slideSorter");
|
|
14526
15105
|
const reason = () => off.value ? t("disabled.sorterZoom") : null;
|
|
14527
|
-
const anchor =
|
|
14528
|
-
const open =
|
|
14529
|
-
|
|
15106
|
+
const anchor = ref40(null);
|
|
15107
|
+
const open = ref40(false);
|
|
15108
|
+
watch35(off, (now) => {
|
|
14530
15109
|
if (now) open.value = false;
|
|
14531
15110
|
});
|
|
14532
15111
|
const step = (dir) => {
|
|
@@ -14544,7 +15123,7 @@ var PptxEditorZoomPill = defineComponent48({
|
|
|
14544
15123
|
};
|
|
14545
15124
|
return () => {
|
|
14546
15125
|
const levelLabel = off.value ? t("zoom.ariaLabel") : t("zoom.levelAriaLabel", { percent: Math.round(zoom.value * 100) });
|
|
14547
|
-
return /* @__PURE__ */
|
|
15126
|
+
return /* @__PURE__ */ jsxs40(
|
|
14548
15127
|
"div",
|
|
14549
15128
|
{
|
|
14550
15129
|
class: ["pptx-zoom", props.className],
|
|
@@ -14552,7 +15131,7 @@ var PptxEditorZoomPill = defineComponent48({
|
|
|
14552
15131
|
"aria-label": t("zoom.ariaLabel"),
|
|
14553
15132
|
onMousedown: keepFocus,
|
|
14554
15133
|
children: [
|
|
14555
|
-
/* @__PURE__ */
|
|
15134
|
+
/* @__PURE__ */ jsx47(
|
|
14556
15135
|
ToolButton,
|
|
14557
15136
|
{
|
|
14558
15137
|
label: t("zoom.zoomOut"),
|
|
@@ -14562,7 +15141,7 @@ var PptxEditorZoomPill = defineComponent48({
|
|
|
14562
15141
|
disabledReason: reason() ?? limit(-1)
|
|
14563
15142
|
}
|
|
14564
15143
|
),
|
|
14565
|
-
/* @__PURE__ */
|
|
15144
|
+
/* @__PURE__ */ jsxs40(
|
|
14566
15145
|
"button",
|
|
14567
15146
|
{
|
|
14568
15147
|
ref: anchor,
|
|
@@ -14579,12 +15158,12 @@ var PptxEditorZoomPill = defineComponent48({
|
|
|
14579
15158
|
},
|
|
14580
15159
|
children: [
|
|
14581
15160
|
off.value ? "\u2013" : t("zoom.level", { percent: Math.round(zoom.value * 100) }),
|
|
14582
|
-
/* @__PURE__ */
|
|
15161
|
+
/* @__PURE__ */ jsx47(Icon, { name: "arrow_drop_down", className: "pptx-icon pptx-toolbar__caret" })
|
|
14583
15162
|
]
|
|
14584
15163
|
}
|
|
14585
15164
|
),
|
|
14586
15165
|
levelOff.note(),
|
|
14587
|
-
/* @__PURE__ */
|
|
15166
|
+
/* @__PURE__ */ jsx47(
|
|
14588
15167
|
ToolButton,
|
|
14589
15168
|
{
|
|
14590
15169
|
label: t("zoom.zoomIn"),
|
|
@@ -14594,7 +15173,7 @@ var PptxEditorZoomPill = defineComponent48({
|
|
|
14594
15173
|
disabledReason: reason() ?? limit(1)
|
|
14595
15174
|
}
|
|
14596
15175
|
),
|
|
14597
|
-
open.value && !off.value ? /* @__PURE__ */
|
|
15176
|
+
open.value && !off.value ? /* @__PURE__ */ jsx47(
|
|
14598
15177
|
Popover,
|
|
14599
15178
|
{
|
|
14600
15179
|
anchor: anchor.value,
|
|
@@ -14603,8 +15182,8 @@ var PptxEditorZoomPill = defineComponent48({
|
|
|
14603
15182
|
},
|
|
14604
15183
|
align: "end",
|
|
14605
15184
|
children: () => [
|
|
14606
|
-
/* @__PURE__ */
|
|
14607
|
-
...ZOOM_MENU_LEVELS.map((z) => /* @__PURE__ */
|
|
15185
|
+
/* @__PURE__ */ jsx47(MenuItem, { checked: fit.value, onSelect: () => pick("fit"), children: () => t("zoom.fit") }),
|
|
15186
|
+
...ZOOM_MENU_LEVELS.map((z) => /* @__PURE__ */ jsx47(
|
|
14608
15187
|
MenuItem,
|
|
14609
15188
|
{
|
|
14610
15189
|
checked: !fit.value && Math.abs(z - zoom.value) < 1e-3,
|
|
@@ -14626,11 +15205,11 @@ var PptxEditorZoomPill = defineComponent48({
|
|
|
14626
15205
|
// src/EditNotice.tsx
|
|
14627
15206
|
import {
|
|
14628
15207
|
computed as computed23,
|
|
14629
|
-
defineComponent as
|
|
15208
|
+
defineComponent as defineComponent56,
|
|
14630
15209
|
onBeforeUnmount as onBeforeUnmount12,
|
|
14631
15210
|
onScopeDispose as onScopeDispose8,
|
|
14632
15211
|
shallowRef as shallowRef29,
|
|
14633
|
-
watch as
|
|
15212
|
+
watch as watch36,
|
|
14634
15213
|
watchEffect as watchEffect2
|
|
14635
15214
|
} from "vue";
|
|
14636
15215
|
import {
|
|
@@ -14644,7 +15223,7 @@ import {
|
|
|
14644
15223
|
REMOVAL_NOTICE_MS,
|
|
14645
15224
|
removalNoticeShows
|
|
14646
15225
|
} from "@pptx-editor.dev/core/editor";
|
|
14647
|
-
import { jsx as
|
|
15226
|
+
import { jsx as jsx48, jsxs as jsxs41 } from "vue/jsx-runtime";
|
|
14648
15227
|
function rejectionMessage(t, rejection) {
|
|
14649
15228
|
return editRejectionMessage(t, rejection);
|
|
14650
15229
|
}
|
|
@@ -14653,7 +15232,7 @@ var pptxEditorEditNoticeProps = {
|
|
|
14653
15232
|
/** A class name added to the notice, as React's `className`. A host `class` also works. */
|
|
14654
15233
|
className: { type: String, default: void 0 }
|
|
14655
15234
|
};
|
|
14656
|
-
var PptxEditorEditNotice =
|
|
15235
|
+
var PptxEditorEditNotice = defineComponent56({
|
|
14657
15236
|
name: "PptxEditorEditNotice",
|
|
14658
15237
|
inheritAttrs: false,
|
|
14659
15238
|
props: pptxEditorEditNoticeProps,
|
|
@@ -14675,7 +15254,7 @@ var PptxEditorEditNotice = defineComponent49({
|
|
|
14675
15254
|
const covered = computed23(
|
|
14676
15255
|
() => linkEntry() !== false && linkPopupShowsRejection(linkPopup.value, rejection.value) || fieldShowsRejection(rejection.value)
|
|
14677
15256
|
);
|
|
14678
|
-
|
|
15257
|
+
watch36(
|
|
14679
15258
|
covered,
|
|
14680
15259
|
(now) => {
|
|
14681
15260
|
if (now) dismissed.value = rejection.value;
|
|
@@ -14684,7 +15263,7 @@ var PptxEditorEditNotice = defineComponent49({
|
|
|
14684
15263
|
);
|
|
14685
15264
|
const closed = shallowRef29(null);
|
|
14686
15265
|
const held = shallowRef29(false);
|
|
14687
|
-
|
|
15266
|
+
watch36(
|
|
14688
15267
|
() => removal.value?.serial,
|
|
14689
15268
|
() => {
|
|
14690
15269
|
held.value = false;
|
|
@@ -14705,7 +15284,7 @@ var PptxEditorEditNotice = defineComponent49({
|
|
|
14705
15284
|
const classes = ["pptx-edit-notice", attrs.class, props.className];
|
|
14706
15285
|
const refused = rejection.value;
|
|
14707
15286
|
if (!covered.value && editNoticeShows(refused, dismissed.value))
|
|
14708
|
-
return /* @__PURE__ */
|
|
15287
|
+
return /* @__PURE__ */ jsxs41(
|
|
14709
15288
|
"div",
|
|
14710
15289
|
{
|
|
14711
15290
|
...attrs,
|
|
@@ -14714,8 +15293,8 @@ var PptxEditorEditNotice = defineComponent49({
|
|
|
14714
15293
|
role: "status",
|
|
14715
15294
|
onMousedown: keepFocus,
|
|
14716
15295
|
children: [
|
|
14717
|
-
/* @__PURE__ */
|
|
14718
|
-
/* @__PURE__ */
|
|
15296
|
+
/* @__PURE__ */ jsx48("span", { class: "pptx-edit-notice__text", children: rejectionMessage(t, refused) }),
|
|
15297
|
+
/* @__PURE__ */ jsx48(
|
|
14719
15298
|
ToolButton,
|
|
14720
15299
|
{
|
|
14721
15300
|
label: t("notice.dismiss"),
|
|
@@ -14730,7 +15309,7 @@ var PptxEditorEditNotice = defineComponent49({
|
|
|
14730
15309
|
);
|
|
14731
15310
|
const removed = removal.value;
|
|
14732
15311
|
if (!removalNoticeShows(removed, closed.value)) return null;
|
|
14733
|
-
return /* @__PURE__ */
|
|
15312
|
+
return /* @__PURE__ */ jsxs41(
|
|
14734
15313
|
"div",
|
|
14735
15314
|
{
|
|
14736
15315
|
...attrs,
|
|
@@ -14743,8 +15322,8 @@ var PptxEditorEditNotice = defineComponent49({
|
|
|
14743
15322
|
onFocusin: () => held.value = true,
|
|
14744
15323
|
onFocusout: () => held.value = false,
|
|
14745
15324
|
children: [
|
|
14746
|
-
/* @__PURE__ */
|
|
14747
|
-
/* @__PURE__ */
|
|
15325
|
+
/* @__PURE__ */ jsx48("span", { class: "pptx-edit-notice__text", children: editRemovalMessage(t, removed) }),
|
|
15326
|
+
/* @__PURE__ */ jsx48(
|
|
14748
15327
|
"button",
|
|
14749
15328
|
{
|
|
14750
15329
|
type: "button",
|
|
@@ -14758,7 +15337,7 @@ var PptxEditorEditNotice = defineComponent49({
|
|
|
14758
15337
|
children: t("notice.undo")
|
|
14759
15338
|
}
|
|
14760
15339
|
),
|
|
14761
|
-
/* @__PURE__ */
|
|
15340
|
+
/* @__PURE__ */ jsx48(
|
|
14762
15341
|
ToolButton,
|
|
14763
15342
|
{
|
|
14764
15343
|
label: t("notice.dismiss"),
|
|
@@ -14777,13 +15356,13 @@ var PptxEditorEditNotice = defineComponent49({
|
|
|
14777
15356
|
});
|
|
14778
15357
|
|
|
14779
15358
|
// src/SlideSorter.tsx
|
|
14780
|
-
import { jsx as
|
|
15359
|
+
import { jsx as jsx49, jsxs as jsxs42 } from "vue/jsx-runtime";
|
|
14781
15360
|
var sameList = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
|
|
14782
15361
|
var slideSorterProps = {
|
|
14783
15362
|
/** A class name added to the sorter, as React's `className`. A host `class` also works. */
|
|
14784
15363
|
className: { type: String, default: void 0 }
|
|
14785
15364
|
};
|
|
14786
|
-
var PptxEditorSlideSorter =
|
|
15365
|
+
var PptxEditorSlideSorter = defineComponent57({
|
|
14787
15366
|
name: "PptxEditorSlideSorter",
|
|
14788
15367
|
props: slideSorterProps,
|
|
14789
15368
|
setup(props) {
|
|
@@ -14800,10 +15379,10 @@ var PptxEditorSlideSorter = defineComponent50({
|
|
|
14800
15379
|
const collapsed = useCollapsedSections();
|
|
14801
15380
|
useOpenCurrentSection(grouped);
|
|
14802
15381
|
useSorterRegistration();
|
|
14803
|
-
const list =
|
|
15382
|
+
const list = ref41(null);
|
|
14804
15383
|
const drag = useSlideDrag("x", selected, readOnly, grouped);
|
|
14805
15384
|
const menu = shallowRef30(null);
|
|
14806
|
-
const renaming =
|
|
15385
|
+
const renaming = ref41(null);
|
|
14807
15386
|
useSectionRenameRequests((id) => {
|
|
14808
15387
|
renaming.value = id;
|
|
14809
15388
|
});
|
|
@@ -14852,7 +15431,7 @@ var PptxEditorSlideSorter = defineComponent50({
|
|
|
14852
15431
|
const groups = grouped.value;
|
|
14853
15432
|
const own = sectionOfSlide2(groups, current.value);
|
|
14854
15433
|
const shut = !!own && collapsed.value.includes(own.id);
|
|
14855
|
-
const item = (s) => /* @__PURE__ */
|
|
15434
|
+
const item = (s) => /* @__PURE__ */ jsxs42(
|
|
14856
15435
|
"li",
|
|
14857
15436
|
{
|
|
14858
15437
|
class: "pptx-sorter__item",
|
|
@@ -14878,15 +15457,15 @@ var PptxEditorSlideSorter = defineComponent50({
|
|
|
14878
15457
|
);
|
|
14879
15458
|
},
|
|
14880
15459
|
children: [
|
|
14881
|
-
/* @__PURE__ */
|
|
14882
|
-
/* @__PURE__ */
|
|
14883
|
-
/* @__PURE__ */
|
|
15460
|
+
/* @__PURE__ */ jsx49(Thumbnail, { slide: s, ratio: ratio.value }),
|
|
15461
|
+
/* @__PURE__ */ jsx49("span", { class: "pptx-sorter__number", "aria-hidden": "true", children: s.index + 1 }),
|
|
15462
|
+
/* @__PURE__ */ jsx49("span", { class: "pptx-sr-only", children: slideItemName2(t, s) })
|
|
14884
15463
|
]
|
|
14885
15464
|
},
|
|
14886
15465
|
s.id
|
|
14887
15466
|
);
|
|
14888
|
-
return /* @__PURE__ */
|
|
14889
|
-
/* @__PURE__ */
|
|
15467
|
+
return /* @__PURE__ */ jsxs42("section", { class: ["pptx-sorter", props.className], "aria-label": t("sorter.ariaLabel"), children: [
|
|
15468
|
+
/* @__PURE__ */ jsx49(
|
|
14890
15469
|
"ol",
|
|
14891
15470
|
{
|
|
14892
15471
|
ref: list,
|
|
@@ -14899,7 +15478,7 @@ var PptxEditorSlideSorter = defineComponent50({
|
|
|
14899
15478
|
trackFocus(e);
|
|
14900
15479
|
trackCollapse(e);
|
|
14901
15480
|
},
|
|
14902
|
-
children: groups ? groups.map((sec) => /* @__PURE__ */
|
|
15481
|
+
children: groups ? groups.map((sec) => /* @__PURE__ */ jsx49(
|
|
14903
15482
|
SectionNode,
|
|
14904
15483
|
{
|
|
14905
15484
|
section: sec,
|
|
@@ -14917,10 +15496,10 @@ var PptxEditorSlideSorter = defineComponent50({
|
|
|
14917
15496
|
children: () => slides.value.slice(sec.firstSlide, sec.firstSlide + sec.slideCount).map(item)
|
|
14918
15497
|
},
|
|
14919
15498
|
sec.id
|
|
14920
|
-
)) : /* @__PURE__ */
|
|
15499
|
+
)) : /* @__PURE__ */ jsx49("li", { role: "presentation", class: "pptx-sorter__section", children: /* @__PURE__ */ jsx49("ol", { role: "group", class: "pptx-sorter__grid", children: slides.value.map(item) }) })
|
|
14921
15500
|
}
|
|
14922
15501
|
),
|
|
14923
|
-
/* @__PURE__ */
|
|
15502
|
+
/* @__PURE__ */ jsx49(
|
|
14924
15503
|
RailMenuHost,
|
|
14925
15504
|
{
|
|
14926
15505
|
open: menu.value ? {
|
|
@@ -14939,15 +15518,15 @@ var PptxEditorSlideSorter = defineComponent50({
|
|
|
14939
15518
|
};
|
|
14940
15519
|
}
|
|
14941
15520
|
});
|
|
14942
|
-
var ReadOnlyBadge =
|
|
15521
|
+
var ReadOnlyBadge = defineComponent57({
|
|
14943
15522
|
name: "ReadOnlyBadge",
|
|
14944
15523
|
setup() {
|
|
14945
15524
|
const { t } = useTranslation();
|
|
14946
15525
|
const damaged = useEditorState((s) => s.readOnlyReason === "damaged-slide");
|
|
14947
|
-
return () => damaged.value ? /* @__PURE__ */
|
|
15526
|
+
return () => damaged.value ? /* @__PURE__ */ jsx49("span", { class: "pptx-statusbar__read-only", role: "status", "data-reason": "damaged-slide", children: t("statusBar.readOnlyDamaged") }) : null;
|
|
14948
15527
|
}
|
|
14949
15528
|
});
|
|
14950
|
-
var ViewSwitch =
|
|
15529
|
+
var ViewSwitch = defineComponent57({
|
|
14951
15530
|
name: "PptxViewSwitch",
|
|
14952
15531
|
setup() {
|
|
14953
15532
|
const { t } = useTranslation();
|
|
@@ -14955,7 +15534,7 @@ var ViewSwitch = defineComponent50({
|
|
|
14955
15534
|
const options = STATUS_BAR_VIEW_OPTIONS;
|
|
14956
15535
|
const off = computed24(() => !cmd.isEnabled.value);
|
|
14957
15536
|
const reason = computed24(
|
|
14958
|
-
() => cmd.disabledReason.value ?
|
|
15537
|
+
() => cmd.disabledReason.value ? translateKeyOrText20(t, cmd.disabledReason.value) : null
|
|
14959
15538
|
);
|
|
14960
15539
|
const offAttrs = useAriaDisabled(off, reason);
|
|
14961
15540
|
const pick = (e, step) => {
|
|
@@ -14975,7 +15554,7 @@ var ViewSwitch = defineComponent50({
|
|
|
14975
15554
|
ArrowRight: 1,
|
|
14976
15555
|
ArrowDown: 1
|
|
14977
15556
|
};
|
|
14978
|
-
return () => /* @__PURE__ */
|
|
15557
|
+
return () => /* @__PURE__ */ jsxs42(
|
|
14979
15558
|
"div",
|
|
14980
15559
|
{
|
|
14981
15560
|
class: "pptx-zoom pptx-view-switch",
|
|
@@ -14987,7 +15566,7 @@ var ViewSwitch = defineComponent50({
|
|
|
14987
15566
|
const on = cmd.value.value === o.value;
|
|
14988
15567
|
const tabStop = on || i === 0 && !options.some((x) => x.value === cmd.value.value);
|
|
14989
15568
|
const label = t(o.labelKey);
|
|
14990
|
-
return /* @__PURE__ */
|
|
15569
|
+
return /* @__PURE__ */ jsx49(
|
|
14991
15570
|
"button",
|
|
14992
15571
|
{
|
|
14993
15572
|
type: "button",
|
|
@@ -15009,7 +15588,7 @@ var ViewSwitch = defineComponent50({
|
|
|
15009
15588
|
e.preventDefault();
|
|
15010
15589
|
pick(e, step);
|
|
15011
15590
|
},
|
|
15012
|
-
children: /* @__PURE__ */
|
|
15591
|
+
children: /* @__PURE__ */ jsx49(Icon, { paths: o.paths ?? null })
|
|
15013
15592
|
},
|
|
15014
15593
|
o.value
|
|
15015
15594
|
);
|
|
@@ -15020,13 +15599,13 @@ var ViewSwitch = defineComponent50({
|
|
|
15020
15599
|
);
|
|
15021
15600
|
}
|
|
15022
15601
|
});
|
|
15023
|
-
var DefaultWorkspace =
|
|
15602
|
+
var DefaultWorkspace = defineComponent57({
|
|
15024
15603
|
name: "PptxDefaultWorkspace",
|
|
15025
15604
|
setup(_props, { slots }) {
|
|
15026
15605
|
const editor = usePptxEditor();
|
|
15027
15606
|
const view = useEditorState((s) => s.presentationView ?? "normal");
|
|
15028
|
-
const box =
|
|
15029
|
-
|
|
15607
|
+
const box = ref41(null);
|
|
15608
|
+
watch37(
|
|
15030
15609
|
view,
|
|
15031
15610
|
() => {
|
|
15032
15611
|
const active = box.value?.ownerDocument.activeElement;
|
|
@@ -15044,26 +15623,26 @@ var DefaultWorkspace = defineComponent50({
|
|
|
15044
15623
|
inset?.dispose();
|
|
15045
15624
|
inset = null;
|
|
15046
15625
|
});
|
|
15047
|
-
return () => /* @__PURE__ */
|
|
15048
|
-
view.value === "slideSorter" ? /* @__PURE__ */
|
|
15049
|
-
/* @__PURE__ */
|
|
15050
|
-
/* @__PURE__ */
|
|
15626
|
+
return () => /* @__PURE__ */ jsxs42("div", { ref: box, class: "pptx-default__views", children: [
|
|
15627
|
+
view.value === "slideSorter" ? /* @__PURE__ */ jsx49("div", { class: "pptx-default__workspace", children: /* @__PURE__ */ jsxs42("div", { class: "pptx-default__main", children: [
|
|
15628
|
+
/* @__PURE__ */ jsx49(PptxEditorSlideSorter, {}),
|
|
15629
|
+
/* @__PURE__ */ jsx49(PptxEditorEditNotice, {})
|
|
15051
15630
|
] }) }) : slots.normal?.(),
|
|
15052
15631
|
slots.overlay?.(),
|
|
15053
|
-
slots.status ? slots.status() : /* @__PURE__ */
|
|
15054
|
-
/* @__PURE__ */
|
|
15055
|
-
/* @__PURE__ */
|
|
15056
|
-
/* @__PURE__ */
|
|
15632
|
+
slots.status ? slots.status() : /* @__PURE__ */ jsxs42("div", { class: "pptx-statusbar", children: [
|
|
15633
|
+
/* @__PURE__ */ jsx49(ReadOnlyBadge, {}),
|
|
15634
|
+
/* @__PURE__ */ jsx49(ViewSwitch, {}),
|
|
15635
|
+
/* @__PURE__ */ jsx49(PptxEditorZoomPill, {})
|
|
15057
15636
|
] })
|
|
15058
15637
|
] });
|
|
15059
15638
|
}
|
|
15060
15639
|
});
|
|
15061
|
-
var SlideSorterWatch =
|
|
15640
|
+
var SlideSorterWatch = defineComponent57({
|
|
15062
15641
|
name: "PptxSlideSorterWatch",
|
|
15063
15642
|
setup() {
|
|
15064
15643
|
const editor = usePptxEditor();
|
|
15065
15644
|
const sorter = useEditorState((s) => s.presentationView === "slideSorter");
|
|
15066
|
-
|
|
15645
|
+
watch37(
|
|
15067
15646
|
[sorter, editor],
|
|
15068
15647
|
([on, ed]) => {
|
|
15069
15648
|
if (on && ed && !slideSorterMounted(ed)) warnSlideSorterUnmounted();
|
|
@@ -15075,23 +15654,23 @@ var SlideSorterWatch = defineComponent50({
|
|
|
15075
15654
|
});
|
|
15076
15655
|
|
|
15077
15656
|
// src/ChromeTooltip.tsx
|
|
15078
|
-
import { Teleport as Teleport4, defineComponent as
|
|
15657
|
+
import { Teleport as Teleport4, defineComponent as defineComponent58, onMounted as onMounted21, onUnmounted as onUnmounted5, ref as ref42, shallowRef as shallowRef31, watch as watch38 } from "vue";
|
|
15079
15658
|
import {
|
|
15080
15659
|
listenChromeTooltips,
|
|
15081
15660
|
positionChromeTooltip
|
|
15082
15661
|
} from "@pptx-editor.dev/core/editor";
|
|
15083
|
-
import { jsx as
|
|
15084
|
-
var ChromeTooltip =
|
|
15662
|
+
import { jsx as jsx50, jsxs as jsxs43 } from "vue/jsx-runtime";
|
|
15663
|
+
var ChromeTooltip = defineComponent58({
|
|
15085
15664
|
name: "ChromeTooltip",
|
|
15086
15665
|
setup() {
|
|
15087
15666
|
const state = shallowRef31(null);
|
|
15088
|
-
const bubble =
|
|
15667
|
+
const bubble = ref42(null);
|
|
15089
15668
|
let stop = null;
|
|
15090
15669
|
onMounted21(() => {
|
|
15091
15670
|
stop = listenChromeTooltips(document, (next) => state.value = next);
|
|
15092
15671
|
});
|
|
15093
15672
|
onUnmounted5(() => stop?.());
|
|
15094
|
-
|
|
15673
|
+
watch38(
|
|
15095
15674
|
[state, bubble],
|
|
15096
15675
|
([next, el]) => {
|
|
15097
15676
|
if (next && el) positionChromeTooltip(el, next.target);
|
|
@@ -15101,7 +15680,7 @@ var ChromeTooltip = defineComponent51({
|
|
|
15101
15680
|
return () => {
|
|
15102
15681
|
const s = state.value;
|
|
15103
15682
|
if (!s) return null;
|
|
15104
|
-
return /* @__PURE__ */
|
|
15683
|
+
return /* @__PURE__ */ jsx50(Teleport4, { to: s.scope, children: /* @__PURE__ */ jsxs43(
|
|
15105
15684
|
"div",
|
|
15106
15685
|
{
|
|
15107
15686
|
ref: bubble,
|
|
@@ -15110,8 +15689,8 @@ var ChromeTooltip = defineComponent51({
|
|
|
15110
15689
|
"aria-hidden": "true",
|
|
15111
15690
|
"data-instant": s.instant || void 0,
|
|
15112
15691
|
children: [
|
|
15113
|
-
/* @__PURE__ */
|
|
15114
|
-
s.reason ? /* @__PURE__ */
|
|
15692
|
+
/* @__PURE__ */ jsx50("span", { class: "pptx-tooltip__label", children: s.label }),
|
|
15693
|
+
s.reason ? /* @__PURE__ */ jsx50("span", { class: "pptx-tooltip__reason", children: s.reason }) : null
|
|
15115
15694
|
]
|
|
15116
15695
|
}
|
|
15117
15696
|
) });
|
|
@@ -15174,7 +15753,7 @@ var pptxEditorRootProps = {
|
|
|
15174
15753
|
function isElement(value) {
|
|
15175
15754
|
return typeof value === "object" && value !== null && value.nodeType === 1;
|
|
15176
15755
|
}
|
|
15177
|
-
var PptxEditorRoot =
|
|
15756
|
+
var PptxEditorRoot = defineComponent59({
|
|
15178
15757
|
name: "PptxEditorRoot",
|
|
15179
15758
|
props: pptxEditorRootProps,
|
|
15180
15759
|
emits: {
|
|
@@ -15197,7 +15776,7 @@ var PptxEditorRoot = defineComponent52({
|
|
|
15197
15776
|
providePptxEditor(editor);
|
|
15198
15777
|
provide18(pptxTranslationKey, t);
|
|
15199
15778
|
expose(createEditorRefApi(() => editor.value));
|
|
15200
|
-
|
|
15779
|
+
watch39(
|
|
15201
15780
|
() => localeContentKey(props.locale),
|
|
15202
15781
|
() => {
|
|
15203
15782
|
t.value = createTranslator2(props.locale);
|
|
@@ -15215,7 +15794,7 @@ var PptxEditorRoot = defineComponent52({
|
|
|
15215
15794
|
...props.readClipboardDrawing ? { readClipboardDrawing: props.readClipboardDrawing } : {},
|
|
15216
15795
|
...props.author ? { author: props.author } : {},
|
|
15217
15796
|
onFontError,
|
|
15218
|
-
translate: (key, params) =>
|
|
15797
|
+
translate: (key, params) => translateKeyOrText21(t.value, key, params)
|
|
15219
15798
|
});
|
|
15220
15799
|
createdFonts = props.fonts;
|
|
15221
15800
|
createdFamilies = props.fontFamilies;
|
|
@@ -15234,7 +15813,7 @@ var PptxEditorRoot = defineComponent52({
|
|
|
15234
15813
|
});
|
|
15235
15814
|
const documentChurn = churnWarning("PptxEditorRoot", "document");
|
|
15236
15815
|
const fontsChurn = churnWarning("PptxEditorRoot", "fonts");
|
|
15237
|
-
|
|
15816
|
+
watch39(
|
|
15238
15817
|
() => props.document,
|
|
15239
15818
|
(bytes) => {
|
|
15240
15819
|
if (!editor.value || !bytes) return;
|
|
@@ -15242,21 +15821,21 @@ var PptxEditorRoot = defineComponent52({
|
|
|
15242
15821
|
void editor.value.load(bytes);
|
|
15243
15822
|
}
|
|
15244
15823
|
);
|
|
15245
|
-
|
|
15824
|
+
watch39(
|
|
15246
15825
|
() => props.mode,
|
|
15247
15826
|
(mode) => editor.value?.setMode(mode)
|
|
15248
15827
|
);
|
|
15249
|
-
|
|
15828
|
+
watch39(
|
|
15250
15829
|
() => props.author,
|
|
15251
15830
|
(author) => editor.value?.setAuthor(author)
|
|
15252
15831
|
);
|
|
15253
|
-
|
|
15832
|
+
watch39(
|
|
15254
15833
|
() => props.modules,
|
|
15255
15834
|
(modules) => {
|
|
15256
15835
|
if (editor.value) warnModulesChanged(createdModules, modules, "PptxEditorRoot");
|
|
15257
15836
|
}
|
|
15258
15837
|
);
|
|
15259
|
-
|
|
15838
|
+
watch39(
|
|
15260
15839
|
() => [editor.value, props.fonts],
|
|
15261
15840
|
([instance2, fonts]) => {
|
|
15262
15841
|
if (!instance2 || createdFonts === fonts) return;
|
|
@@ -15267,7 +15846,7 @@ var PptxEditorRoot = defineComponent52({
|
|
|
15267
15846
|
},
|
|
15268
15847
|
{ flush: "post" }
|
|
15269
15848
|
);
|
|
15270
|
-
|
|
15849
|
+
watch39(
|
|
15271
15850
|
() => [editor.value, props.fontFamilies],
|
|
15272
15851
|
([instance2, families]) => {
|
|
15273
15852
|
if (!instance2 || createdFamilies === families) return;
|
|
@@ -15305,7 +15884,7 @@ var pptxEditorViewportProps = {
|
|
|
15305
15884
|
*/
|
|
15306
15885
|
label: { type: [String, Boolean], default: void 0 }
|
|
15307
15886
|
};
|
|
15308
|
-
var PptxEditorViewport =
|
|
15887
|
+
var PptxEditorViewport = defineComponent59({
|
|
15309
15888
|
name: "PptxEditorViewport",
|
|
15310
15889
|
props: pptxEditorViewportProps,
|
|
15311
15890
|
setup(props, { slots }) {
|
|
@@ -15318,7 +15897,7 @@ var PptxEditorViewport = defineComponent52({
|
|
|
15318
15897
|
class: ["pptx-editor", dark.value ? "dark" : null, props.className],
|
|
15319
15898
|
...props.label === false ? {} : {
|
|
15320
15899
|
role: "region",
|
|
15321
|
-
"aria-label": props.label ?
|
|
15900
|
+
"aria-label": props.label ? translateKeyOrText21(t, props.label) : t("viewport.ariaLabel")
|
|
15322
15901
|
}
|
|
15323
15902
|
},
|
|
15324
15903
|
slots.default?.()
|
|
@@ -15329,7 +15908,7 @@ var pptxEditorContentProps = {
|
|
|
15329
15908
|
/** A class name added to the canvas, as React's `className`. A host `class` also works. */
|
|
15330
15909
|
className: { type: String, default: void 0 }
|
|
15331
15910
|
};
|
|
15332
|
-
var PptxEditorContent =
|
|
15911
|
+
var PptxEditorContent = defineComponent59({
|
|
15333
15912
|
name: "PptxEditorContent",
|
|
15334
15913
|
// The canvas renders next to its context menu layer, so the host's attributes go on the canvas.
|
|
15335
15914
|
inheritAttrs: false,
|
|
@@ -15352,7 +15931,7 @@ var PptxEditorContent = defineComponent52({
|
|
|
15352
15931
|
}
|
|
15353
15932
|
};
|
|
15354
15933
|
onMounted22(sync);
|
|
15355
|
-
|
|
15934
|
+
watch39(editorRef, sync);
|
|
15356
15935
|
onUnmounted6(() => {
|
|
15357
15936
|
attached?.detach();
|
|
15358
15937
|
attached = null;
|
|
@@ -15381,7 +15960,7 @@ var PptxEditorContent = defineComponent52({
|
|
|
15381
15960
|
|
|
15382
15961
|
// src/loading.ts
|
|
15383
15962
|
import {
|
|
15384
|
-
defineComponent as
|
|
15963
|
+
defineComponent as defineComponent60,
|
|
15385
15964
|
h as h19
|
|
15386
15965
|
} from "vue";
|
|
15387
15966
|
import { loadingSheetSize, sameLoadingSheetSize, showsLoading } from "@pptx-editor.dev/core/editor";
|
|
@@ -15389,7 +15968,7 @@ var loadingSpinnerProps = {
|
|
|
15389
15968
|
/** A class name added to the spinner, as React's `className`. A host `class` also works. */
|
|
15390
15969
|
className: { type: String, default: void 0 }
|
|
15391
15970
|
};
|
|
15392
|
-
var PptxEditorLoadingSpinner =
|
|
15971
|
+
var PptxEditorLoadingSpinner = defineComponent60({
|
|
15393
15972
|
name: "PptxEditorLoadingSpinner",
|
|
15394
15973
|
props: loadingSpinnerProps,
|
|
15395
15974
|
setup(props) {
|
|
@@ -15412,7 +15991,7 @@ var loadingProps = {
|
|
|
15412
15991
|
/** Inline styles for the loading container, as React's `style`. */
|
|
15413
15992
|
style: { type: Object, default: void 0 }
|
|
15414
15993
|
};
|
|
15415
|
-
var LoadingImpl =
|
|
15994
|
+
var LoadingImpl = defineComponent60({
|
|
15416
15995
|
name: "PptxEditorLoading",
|
|
15417
15996
|
props: loadingProps,
|
|
15418
15997
|
setup(props, { slots }) {
|
|
@@ -15461,13 +16040,13 @@ var PptxEditorLoading = Object.assign(LoadingImpl, {
|
|
|
15461
16040
|
// src/NotesPane.tsx
|
|
15462
16041
|
import {
|
|
15463
16042
|
computed as computed25,
|
|
15464
|
-
defineComponent as
|
|
15465
|
-
nextTick as
|
|
16043
|
+
defineComponent as defineComponent62,
|
|
16044
|
+
nextTick as nextTick10,
|
|
15466
16045
|
onBeforeUnmount as onBeforeUnmount14,
|
|
15467
|
-
ref as
|
|
16046
|
+
ref as ref43,
|
|
15468
16047
|
shallowRef as shallowRef33,
|
|
15469
|
-
useId as
|
|
15470
|
-
watch as
|
|
16048
|
+
useId as useId22,
|
|
16049
|
+
watch as watch41
|
|
15471
16050
|
} from "vue";
|
|
15472
16051
|
import {
|
|
15473
16052
|
NOTES_FORMAT_BUTTONS,
|
|
@@ -15489,7 +16068,7 @@ import {
|
|
|
15489
16068
|
} from "@pptx-editor.dev/core/editor";
|
|
15490
16069
|
|
|
15491
16070
|
// src/NotesView.tsx
|
|
15492
|
-
import { defineComponent as
|
|
16071
|
+
import { defineComponent as defineComponent61, onMounted as onMounted23, watch as watch40 } from "vue";
|
|
15493
16072
|
import {
|
|
15494
16073
|
notesFieldBeforeInput,
|
|
15495
16074
|
notesFieldFocused,
|
|
@@ -15499,8 +16078,8 @@ import {
|
|
|
15499
16078
|
renderNotes,
|
|
15500
16079
|
selectNotes
|
|
15501
16080
|
} from "@pptx-editor.dev/core/editor";
|
|
15502
|
-
import { jsx as
|
|
15503
|
-
var NotesField =
|
|
16081
|
+
import { jsx as jsx51 } from "vue/jsx-runtime";
|
|
16082
|
+
var NotesField = defineComponent61({
|
|
15504
16083
|
name: "PptxNotesField",
|
|
15505
16084
|
props: {
|
|
15506
16085
|
id: { type: String, default: void 0 },
|
|
@@ -15535,7 +16114,7 @@ var NotesField = defineComponent54({
|
|
|
15535
16114
|
props.onSelection();
|
|
15536
16115
|
};
|
|
15537
16116
|
onMounted23(draw);
|
|
15538
|
-
|
|
16117
|
+
watch40(() => [props.paragraphs, props.drafting], draw, { flush: "post" });
|
|
15539
16118
|
const onKeydown = (e) => {
|
|
15540
16119
|
if (composing) return;
|
|
15541
16120
|
notesFieldKeyDown(e, e.currentTarget, {
|
|
@@ -15549,7 +16128,7 @@ var NotesField = defineComponent54({
|
|
|
15549
16128
|
const draft = (e) => {
|
|
15550
16129
|
if (!props.readOnly) props.onDraft(notesFieldText(e.currentTarget));
|
|
15551
16130
|
};
|
|
15552
|
-
return () => /* @__PURE__ */
|
|
16131
|
+
return () => /* @__PURE__ */ jsx51(
|
|
15553
16132
|
"div",
|
|
15554
16133
|
{
|
|
15555
16134
|
ref: props.field,
|
|
@@ -15587,7 +16166,7 @@ var NotesField = defineComponent54({
|
|
|
15587
16166
|
});
|
|
15588
16167
|
|
|
15589
16168
|
// src/NotesPane.tsx
|
|
15590
|
-
import { jsx as
|
|
16169
|
+
import { jsx as jsx52, jsxs as jsxs44 } from "vue/jsx-runtime";
|
|
15591
16170
|
var notesPaneProps = {
|
|
15592
16171
|
/** Whether the pane is open, controlled. Use with the `update:open` event (`v-model:open`). */
|
|
15593
16172
|
open: { type: Boolean, default: void 0 },
|
|
@@ -15605,8 +16184,8 @@ var notesPaneProps = {
|
|
|
15605
16184
|
};
|
|
15606
16185
|
function useNotesOpen(props, emit) {
|
|
15607
16186
|
const shared = usePaneState();
|
|
15608
|
-
const own =
|
|
15609
|
-
const owner =
|
|
16187
|
+
const own = ref43(props.defaultOpen ?? true);
|
|
16188
|
+
const owner = ref43(false);
|
|
15610
16189
|
const open = computed25(
|
|
15611
16190
|
() => props.open !== void 0 ? props.open : shared && owner.value ? shared.notesOpen.value ?? props.defaultOpen ?? true : own.value
|
|
15612
16191
|
);
|
|
@@ -15627,11 +16206,11 @@ function useNotesOpen(props, emit) {
|
|
|
15627
16206
|
}
|
|
15628
16207
|
};
|
|
15629
16208
|
claim();
|
|
15630
|
-
|
|
16209
|
+
watch41(() => shared?.notesOpen.value, claim);
|
|
15631
16210
|
onBeforeUnmount14(() => {
|
|
15632
16211
|
if (slot?.current === handler) slot.current = null;
|
|
15633
16212
|
});
|
|
15634
|
-
|
|
16213
|
+
watch41(
|
|
15635
16214
|
[open, owner],
|
|
15636
16215
|
() => {
|
|
15637
16216
|
if (!shared || !owner.value) return;
|
|
@@ -15641,7 +16220,7 @@ function useNotesOpen(props, emit) {
|
|
|
15641
16220
|
);
|
|
15642
16221
|
return { open, setOpen };
|
|
15643
16222
|
}
|
|
15644
|
-
var PptxEditorNotesPane =
|
|
16223
|
+
var PptxEditorNotesPane = defineComponent62({
|
|
15645
16224
|
name: "PptxEditorNotesPane",
|
|
15646
16225
|
props: notesPaneProps,
|
|
15647
16226
|
emits: { "update:open": (_open) => true },
|
|
@@ -15653,12 +16232,12 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15653
16232
|
const slideId = useEditorState((s) => s.slides[s.currentSlide]?.id ?? null);
|
|
15654
16233
|
const readOnly = useEditorState((s) => s.mode === "view");
|
|
15655
16234
|
const pane = useNotesOpen(props, emit);
|
|
15656
|
-
const notesId =
|
|
16235
|
+
const notesId = useId22();
|
|
15657
16236
|
const draft = shallowRef33(null);
|
|
15658
|
-
const refusal =
|
|
16237
|
+
const refusal = ref43(null);
|
|
15659
16238
|
const formats = shallowRef33(NO_NOTES_FORMATS);
|
|
15660
|
-
const canFormat =
|
|
15661
|
-
const field =
|
|
16239
|
+
const canFormat = ref43(false);
|
|
16240
|
+
const field = ref43(null);
|
|
15662
16241
|
let pending = null;
|
|
15663
16242
|
let bound = null;
|
|
15664
16243
|
const restore = { value: null };
|
|
@@ -15689,7 +16268,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15689
16268
|
});
|
|
15690
16269
|
refusal.value = r.ok ? null : rejectionMessage(t, r);
|
|
15691
16270
|
};
|
|
15692
|
-
|
|
16271
|
+
watch41(
|
|
15693
16272
|
slideId,
|
|
15694
16273
|
(id) => {
|
|
15695
16274
|
if (pending && pending.slideId !== id) commit();
|
|
@@ -15697,7 +16276,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15697
16276
|
},
|
|
15698
16277
|
{ immediate: true }
|
|
15699
16278
|
);
|
|
15700
|
-
|
|
16279
|
+
watch41(draft, (d, _old, onCleanup) => {
|
|
15701
16280
|
if (!d) return;
|
|
15702
16281
|
const doc = field.value?.ownerDocument;
|
|
15703
16282
|
const onPointerDown = (e) => {
|
|
@@ -15706,7 +16285,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15706
16285
|
doc?.addEventListener("pointerdown", onPointerDown, true);
|
|
15707
16286
|
onCleanup(() => doc?.removeEventListener("pointerdown", onPointerDown, true));
|
|
15708
16287
|
});
|
|
15709
|
-
|
|
16288
|
+
watch41(
|
|
15710
16289
|
() => pane.open.value,
|
|
15711
16290
|
(open) => {
|
|
15712
16291
|
if (!open) commit();
|
|
@@ -15727,7 +16306,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15727
16306
|
const ed = editor.value;
|
|
15728
16307
|
if (ed && ed.snapshot().selection.kind !== "none") ed.setSelection({ kind: "none" });
|
|
15729
16308
|
};
|
|
15730
|
-
const active =
|
|
16309
|
+
const active = ref43(false);
|
|
15731
16310
|
const target = () => ({
|
|
15732
16311
|
formats: formats.value,
|
|
15733
16312
|
readOnly: readOnly.value,
|
|
@@ -15748,7 +16327,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15748
16327
|
canFormat.value = false;
|
|
15749
16328
|
formats.value = NO_NOTES_FORMATS;
|
|
15750
16329
|
};
|
|
15751
|
-
|
|
16330
|
+
watch41(
|
|
15752
16331
|
active,
|
|
15753
16332
|
(on, _old, onCleanup) => {
|
|
15754
16333
|
const doc = field.value?.ownerDocument;
|
|
@@ -15761,10 +16340,10 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15761
16340
|
);
|
|
15762
16341
|
const painter = createNotesFindPainter();
|
|
15763
16342
|
let mounted = true;
|
|
15764
|
-
const findCount =
|
|
16343
|
+
const findCount = ref43(0);
|
|
15765
16344
|
const selectionKind = useEditorState((s) => s.selection.kind);
|
|
15766
16345
|
const revision = useEditorState((s) => s.revision);
|
|
15767
|
-
|
|
16346
|
+
watch41(
|
|
15768
16347
|
editor,
|
|
15769
16348
|
(ed, _old, onCleanup) => {
|
|
15770
16349
|
if (ed)
|
|
@@ -15776,7 +16355,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15776
16355
|
},
|
|
15777
16356
|
{ immediate: true }
|
|
15778
16357
|
);
|
|
15779
|
-
|
|
16358
|
+
watch41(
|
|
15780
16359
|
[
|
|
15781
16360
|
editor,
|
|
15782
16361
|
() => pane.open.value,
|
|
@@ -15788,7 +16367,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15788
16367
|
revision,
|
|
15789
16368
|
slideId
|
|
15790
16369
|
],
|
|
15791
|
-
() => void
|
|
16370
|
+
() => void nextTick10(() => {
|
|
15792
16371
|
if (!mounted) return;
|
|
15793
16372
|
painter.paint(
|
|
15794
16373
|
editor.value,
|
|
@@ -15803,10 +16382,10 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15803
16382
|
mounted = false;
|
|
15804
16383
|
painter.stop();
|
|
15805
16384
|
});
|
|
15806
|
-
|
|
16385
|
+
watch41([editor, formats, readOnly, canFormat], () => {
|
|
15807
16386
|
if (editor.value && focused) setNotesTarget(editor.value, target());
|
|
15808
16387
|
});
|
|
15809
|
-
|
|
16388
|
+
watch41(editor, (_next, was) => {
|
|
15810
16389
|
if (was) setNotesTarget(was, null);
|
|
15811
16390
|
});
|
|
15812
16391
|
onBeforeUnmount14(() => {
|
|
@@ -15863,7 +16442,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15863
16442
|
if (masterView.value) return null;
|
|
15864
16443
|
const open = pane.open.value;
|
|
15865
16444
|
const d = draft.value;
|
|
15866
|
-
return /* @__PURE__ */
|
|
16445
|
+
return /* @__PURE__ */ jsxs44(
|
|
15867
16446
|
"section",
|
|
15868
16447
|
{
|
|
15869
16448
|
class: ["pptx-notes", props.className],
|
|
@@ -15871,9 +16450,9 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15871
16450
|
"aria-label": t("notes.title"),
|
|
15872
16451
|
"data-open": open ? "true" : "false",
|
|
15873
16452
|
children: [
|
|
15874
|
-
/* @__PURE__ */
|
|
15875
|
-
/* @__PURE__ */
|
|
15876
|
-
open && !readOnly.value && props.showFormatButtons ? /* @__PURE__ */
|
|
16453
|
+
/* @__PURE__ */ jsxs44("div", { class: "pptx-notes__head", onMousedown: keepFocus, children: [
|
|
16454
|
+
/* @__PURE__ */ jsx52("span", { children: t("notes.title") }),
|
|
16455
|
+
open && !readOnly.value && props.showFormatButtons ? /* @__PURE__ */ jsx52("div", { class: "pptx-notes__format", role: "group", "aria-label": t("notes.format"), children: NOTES_FORMAT_BUTTONS.map(([format, icon, key]) => /* @__PURE__ */ jsx52(
|
|
15877
16456
|
ToolButton,
|
|
15878
16457
|
{
|
|
15879
16458
|
label: t(key),
|
|
@@ -15885,7 +16464,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15885
16464
|
},
|
|
15886
16465
|
format
|
|
15887
16466
|
)) }) : null,
|
|
15888
|
-
/* @__PURE__ */
|
|
16467
|
+
/* @__PURE__ */ jsx52(
|
|
15889
16468
|
ToolButton,
|
|
15890
16469
|
{
|
|
15891
16470
|
label: open ? t("notes.collapse") : t("notes.expand"),
|
|
@@ -15899,7 +16478,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15899
16478
|
}
|
|
15900
16479
|
)
|
|
15901
16480
|
] }),
|
|
15902
|
-
open ? /* @__PURE__ */
|
|
16481
|
+
open ? /* @__PURE__ */ jsx52(
|
|
15903
16482
|
NotesField,
|
|
15904
16483
|
{
|
|
15905
16484
|
id: notesId,
|
|
@@ -15922,7 +16501,7 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15922
16501
|
onFocus
|
|
15923
16502
|
}
|
|
15924
16503
|
) : null,
|
|
15925
|
-
refusal.value ? /* @__PURE__ */
|
|
16504
|
+
refusal.value ? /* @__PURE__ */ jsx52("p", { class: "pptx-notes__refusal", role: "alert", children: refusal.value }) : null
|
|
15926
16505
|
]
|
|
15927
16506
|
}
|
|
15928
16507
|
);
|
|
@@ -15933,10 +16512,10 @@ var PptxEditorNotesPane = defineComponent55({
|
|
|
15933
16512
|
// src/OpenFailure.tsx
|
|
15934
16513
|
import {
|
|
15935
16514
|
computed as computed26,
|
|
15936
|
-
defineComponent as
|
|
15937
|
-
nextTick as
|
|
16515
|
+
defineComponent as defineComponent63,
|
|
16516
|
+
nextTick as nextTick11,
|
|
15938
16517
|
shallowRef as shallowRef34,
|
|
15939
|
-
useId as
|
|
16518
|
+
useId as useId23
|
|
15940
16519
|
} from "vue";
|
|
15941
16520
|
import {
|
|
15942
16521
|
copyOpenFailureReport,
|
|
@@ -15945,7 +16524,7 @@ import {
|
|
|
15945
16524
|
openFailureKey,
|
|
15946
16525
|
shownOpenFailure
|
|
15947
16526
|
} from "@pptx-editor.dev/core/editor";
|
|
15948
|
-
import { jsx as
|
|
16527
|
+
import { jsx as jsx53, jsxs as jsxs45 } from "vue/jsx-runtime";
|
|
15949
16528
|
function useOpenFailure(options = {}) {
|
|
15950
16529
|
const current = useEditorState(shownOpenFailure);
|
|
15951
16530
|
const ready = useEditorState((s) => s.status === "ready");
|
|
@@ -16004,7 +16583,7 @@ var openFailureProps = {
|
|
|
16004
16583
|
style: { type: Object, default: void 0 },
|
|
16005
16584
|
...chromeTranslateProp
|
|
16006
16585
|
};
|
|
16007
|
-
var PptxEditorOpenFailure =
|
|
16586
|
+
var PptxEditorOpenFailure = defineComponent63({
|
|
16008
16587
|
name: "PptxEditorOpenFailure",
|
|
16009
16588
|
props: openFailureProps,
|
|
16010
16589
|
emits: {
|
|
@@ -16015,7 +16594,7 @@ var PptxEditorOpenFailure = defineComponent56({
|
|
|
16015
16594
|
setup(props, { emit, slots }) {
|
|
16016
16595
|
const { t } = useChromeTranslateScope(() => props.t);
|
|
16017
16596
|
const { failure, message, kept, dismiss } = useOpenFailure({ t });
|
|
16018
|
-
const titleId =
|
|
16597
|
+
const titleId = useId23();
|
|
16019
16598
|
const copy = shallowRef34(null);
|
|
16020
16599
|
const reportRef = shallowRef34(null);
|
|
16021
16600
|
const rootRef = shallowRef34(null);
|
|
@@ -16028,7 +16607,7 @@ var PptxEditorOpenFailure = defineComponent56({
|
|
|
16028
16607
|
copy.value = null;
|
|
16029
16608
|
await new Promise((resolve) => setTimeout(resolve, COPY_RESULT_GAP_MS));
|
|
16030
16609
|
copy.value = await copyOpenFailureReport(shown);
|
|
16031
|
-
if (!copy.value.copied) void
|
|
16610
|
+
if (!copy.value.copied) void nextTick11(() => reportRef.value?.focus());
|
|
16032
16611
|
};
|
|
16033
16612
|
const copyShown = copy.value?.failure === shown ? copy.value : null;
|
|
16034
16613
|
const close = () => {
|
|
@@ -16038,7 +16617,7 @@ var PptxEditorOpenFailure = defineComponent56({
|
|
|
16038
16617
|
if (focused) editor.value?.focus();
|
|
16039
16618
|
};
|
|
16040
16619
|
const context = { failure: shown, message: packaged, dismiss: close };
|
|
16041
|
-
return /* @__PURE__ */
|
|
16620
|
+
return /* @__PURE__ */ jsxs45(
|
|
16042
16621
|
"div",
|
|
16043
16622
|
{
|
|
16044
16623
|
ref: rootRef,
|
|
@@ -16048,14 +16627,14 @@ var PptxEditorOpenFailure = defineComponent56({
|
|
|
16048
16627
|
"aria-labelledby": titleId,
|
|
16049
16628
|
"data-reason": shown.reason,
|
|
16050
16629
|
children: [
|
|
16051
|
-
/* @__PURE__ */
|
|
16052
|
-
/* @__PURE__ */
|
|
16053
|
-
/* @__PURE__ */
|
|
16054
|
-
kept.value ? /* @__PURE__ */
|
|
16055
|
-
props.showCode ? /* @__PURE__ */
|
|
16630
|
+
/* @__PURE__ */ jsxs45("div", { class: "pptx-open-failure__text", role: "alert", children: [
|
|
16631
|
+
/* @__PURE__ */ jsx53("p", { id: titleId, class: "pptx-open-failure__title", children: props.title ?? t("openFailure.title") }),
|
|
16632
|
+
/* @__PURE__ */ jsx53("div", { class: "pptx-open-failure__message", children: slots.message ? slots.message(context) : typeof props.message === "function" ? props.message(shown) : props.message ?? packaged }),
|
|
16633
|
+
kept.value ? /* @__PURE__ */ jsx53("p", { class: "pptx-open-failure__kept", children: t("openFailure.kept") }) : null,
|
|
16634
|
+
props.showCode ? /* @__PURE__ */ jsx53("p", { class: "pptx-open-failure__code", children: t("openFailure.code", { code: shown.code }) }) : null
|
|
16056
16635
|
] }),
|
|
16057
|
-
/* @__PURE__ */
|
|
16058
|
-
copyShown && !copyShown.copied ? /* @__PURE__ */
|
|
16636
|
+
/* @__PURE__ */ jsx53("p", { class: "pptx-open-failure__status", role: "status", children: copyShown ? t(copyShown.copied ? "openFailure.copied" : "openFailure.copyFailed") : null }),
|
|
16637
|
+
copyShown && !copyShown.copied ? /* @__PURE__ */ jsx53(
|
|
16059
16638
|
"textarea",
|
|
16060
16639
|
{
|
|
16061
16640
|
ref: reportRef,
|
|
@@ -16067,9 +16646,9 @@ var PptxEditorOpenFailure = defineComponent56({
|
|
|
16067
16646
|
onFocus: (e) => e.currentTarget.select()
|
|
16068
16647
|
}
|
|
16069
16648
|
) : null,
|
|
16070
|
-
/* @__PURE__ */
|
|
16649
|
+
/* @__PURE__ */ jsxs45("div", { class: "pptx-open-failure__actions", children: [
|
|
16071
16650
|
slots.actions ? slots.actions(context) : props.actions?.(context),
|
|
16072
|
-
props.showCopy ? /* @__PURE__ */
|
|
16651
|
+
props.showCopy ? /* @__PURE__ */ jsx53(
|
|
16073
16652
|
"button",
|
|
16074
16653
|
{
|
|
16075
16654
|
type: "button",
|
|
@@ -16078,7 +16657,7 @@ var PptxEditorOpenFailure = defineComponent56({
|
|
|
16078
16657
|
children: t("openFailure.copyDetails")
|
|
16079
16658
|
}
|
|
16080
16659
|
) : null,
|
|
16081
|
-
props.showClose ? /* @__PURE__ */
|
|
16660
|
+
props.showClose ? /* @__PURE__ */ jsx53("button", { type: "button", class: "pptx-open-failure__action", onClick: close, children: props.closeLabel ?? t("openFailure.close") }) : null
|
|
16082
16661
|
] })
|
|
16083
16662
|
]
|
|
16084
16663
|
},
|
|
@@ -16091,10 +16670,10 @@ var PptxEditorOpenFailure = defineComponent56({
|
|
|
16091
16670
|
// src/FontNotice.tsx
|
|
16092
16671
|
import {
|
|
16093
16672
|
computed as computed27,
|
|
16094
|
-
defineComponent as
|
|
16095
|
-
ref as
|
|
16673
|
+
defineComponent as defineComponent64,
|
|
16674
|
+
ref as ref44,
|
|
16096
16675
|
shallowRef as shallowRef35,
|
|
16097
|
-
watch as
|
|
16676
|
+
watch as watch42
|
|
16098
16677
|
} from "vue";
|
|
16099
16678
|
import {
|
|
16100
16679
|
applyLocalFonts,
|
|
@@ -16102,13 +16681,13 @@ import {
|
|
|
16102
16681
|
fontNoticeFamilies,
|
|
16103
16682
|
fontNoticeList
|
|
16104
16683
|
} from "@pptx-editor.dev/core/editor";
|
|
16105
|
-
import { jsx as
|
|
16684
|
+
import { jsx as jsx54, jsxs as jsxs46 } from "vue/jsx-runtime";
|
|
16106
16685
|
var pptxEditorFontNoticeProps = {
|
|
16107
16686
|
...chromeTranslateProp,
|
|
16108
16687
|
/** A class name added to the notice, as React's `className`. A host `class` also works. */
|
|
16109
16688
|
className: { type: String, default: void 0 }
|
|
16110
16689
|
};
|
|
16111
|
-
var PptxEditorFontNotice =
|
|
16690
|
+
var PptxEditorFontNotice = defineComponent64({
|
|
16112
16691
|
name: "PptxEditorFontNotice",
|
|
16113
16692
|
inheritAttrs: false,
|
|
16114
16693
|
props: pptxEditorFontNoticeProps,
|
|
@@ -16122,9 +16701,9 @@ var PptxEditorFontNotice = defineComponent57({
|
|
|
16122
16701
|
const dismissed = shallowRef35(null);
|
|
16123
16702
|
const outcome = shallowRef35(null);
|
|
16124
16703
|
const status = computed27(() => outcome.value?.key === key.value ? outcome.value.text : null);
|
|
16125
|
-
const busy =
|
|
16704
|
+
const busy = ref44(false);
|
|
16126
16705
|
let round = 0;
|
|
16127
|
-
|
|
16706
|
+
watch42(loadState, () => {
|
|
16128
16707
|
round += 1;
|
|
16129
16708
|
outcome.value = null;
|
|
16130
16709
|
});
|
|
@@ -16145,7 +16724,7 @@ var PptxEditorFontNotice = defineComponent57({
|
|
|
16145
16724
|
return () => {
|
|
16146
16725
|
const families = missing.value;
|
|
16147
16726
|
if (families.length === 0 && !status.value || dismissed.value === key.value) return null;
|
|
16148
|
-
return /* @__PURE__ */
|
|
16727
|
+
return /* @__PURE__ */ jsxs46(
|
|
16149
16728
|
"div",
|
|
16150
16729
|
{
|
|
16151
16730
|
...attrs,
|
|
@@ -16153,11 +16732,11 @@ var PptxEditorFontNotice = defineComponent57({
|
|
|
16153
16732
|
role: "status",
|
|
16154
16733
|
onMousedown: keepFocus,
|
|
16155
16734
|
children: [
|
|
16156
|
-
/* @__PURE__ */
|
|
16735
|
+
/* @__PURE__ */ jsxs46("span", { class: "pptx-font-notice__text", children: [
|
|
16157
16736
|
families.length ? t("fonts.notice", { families: fontNoticeList(families, t) }) : status.value,
|
|
16158
16737
|
families.length && status.value ? ` ${status.value}` : ""
|
|
16159
16738
|
] }),
|
|
16160
|
-
families.length && canQueryLocalFonts() ? /* @__PURE__ */
|
|
16739
|
+
families.length && canQueryLocalFonts() ? /* @__PURE__ */ jsx54(
|
|
16161
16740
|
"button",
|
|
16162
16741
|
{
|
|
16163
16742
|
type: "button",
|
|
@@ -16167,7 +16746,7 @@ var PptxEditorFontNotice = defineComponent57({
|
|
|
16167
16746
|
children: t("fonts.useLocal")
|
|
16168
16747
|
}
|
|
16169
16748
|
) : null,
|
|
16170
|
-
/* @__PURE__ */
|
|
16749
|
+
/* @__PURE__ */ jsx54(
|
|
16171
16750
|
ToolButton,
|
|
16172
16751
|
{
|
|
16173
16752
|
label: t("fonts.dismiss"),
|
|
@@ -16186,23 +16765,23 @@ var PptxEditorFontNotice = defineComponent57({
|
|
|
16186
16765
|
|
|
16187
16766
|
// src/ribbon.ts
|
|
16188
16767
|
import {
|
|
16189
|
-
defineComponent as
|
|
16768
|
+
defineComponent as defineComponent65,
|
|
16190
16769
|
h as h20,
|
|
16191
16770
|
isVNode as isVNode7,
|
|
16192
16771
|
normalizeClass as normalizeClass7,
|
|
16193
|
-
ref as
|
|
16194
|
-
watch as
|
|
16195
|
-
nextTick as
|
|
16772
|
+
ref as ref45,
|
|
16773
|
+
watch as watch43,
|
|
16774
|
+
nextTick as nextTick12,
|
|
16196
16775
|
Comment as Comment4,
|
|
16197
16776
|
Text as Text4,
|
|
16198
|
-
useId as
|
|
16777
|
+
useId as useId24
|
|
16199
16778
|
} from "vue";
|
|
16200
16779
|
import {
|
|
16201
16780
|
arrangeRibbonTabs,
|
|
16202
16781
|
ribbonInsertTab,
|
|
16203
16782
|
ribbonShownTab,
|
|
16204
16783
|
ribbonTabs,
|
|
16205
|
-
translateKeyOrText as
|
|
16784
|
+
translateKeyOrText as translateKeyOrText22,
|
|
16206
16785
|
warnRibbonChild
|
|
16207
16786
|
} from "@pptx-editor.dev/core/editor";
|
|
16208
16787
|
var ribbonTabProps = {
|
|
@@ -16219,7 +16798,7 @@ var ribbonTabProps = {
|
|
|
16219
16798
|
/** A class name added to the tab's panel, as React's `className`. A host `class` also works. */
|
|
16220
16799
|
className: { type: String, default: void 0 }
|
|
16221
16800
|
};
|
|
16222
|
-
var RibbonTab =
|
|
16801
|
+
var RibbonTab = defineComponent65({
|
|
16223
16802
|
name: "RibbonTab",
|
|
16224
16803
|
props: ribbonTabProps,
|
|
16225
16804
|
setup() {
|
|
@@ -16272,7 +16851,7 @@ var sameLayout = (a, b) => {
|
|
|
16272
16851
|
return key(a) === key(b);
|
|
16273
16852
|
};
|
|
16274
16853
|
var PptxEditorRibbon = Object.assign(
|
|
16275
|
-
|
|
16854
|
+
defineComponent65({
|
|
16276
16855
|
name: "PptxEditorRibbon",
|
|
16277
16856
|
props: ribbonProps,
|
|
16278
16857
|
emits: {
|
|
@@ -16281,28 +16860,28 @@ var PptxEditorRibbon = Object.assign(
|
|
|
16281
16860
|
},
|
|
16282
16861
|
setup(props, { emit, slots }) {
|
|
16283
16862
|
const { t } = useTranslation();
|
|
16284
|
-
const baseId =
|
|
16863
|
+
const baseId = useId24();
|
|
16285
16864
|
const layout = useEditorState((s) => ribbonTabs(s), sameLayout);
|
|
16286
|
-
const own =
|
|
16865
|
+
const own = ref45(props.defaultTab);
|
|
16287
16866
|
const names = /* @__PURE__ */ new Map();
|
|
16288
|
-
const root =
|
|
16867
|
+
const root = ref45(null);
|
|
16289
16868
|
let focusInside = false;
|
|
16290
16869
|
const select = (id) => {
|
|
16291
16870
|
if (props.tab === void 0) own.value = id;
|
|
16292
16871
|
emit("update:tab", id);
|
|
16293
16872
|
emit("tabChange", id);
|
|
16294
16873
|
};
|
|
16295
|
-
const shown =
|
|
16874
|
+
const shown = ref45({
|
|
16296
16875
|
id: void 0,
|
|
16297
16876
|
fellBack: false
|
|
16298
16877
|
});
|
|
16299
|
-
|
|
16878
|
+
watch43(
|
|
16300
16879
|
() => `${shown.value.fellBack}|${shown.value.id ?? ""}`,
|
|
16301
16880
|
async () => {
|
|
16302
16881
|
const { id, fellBack } = shown.value;
|
|
16303
16882
|
if (!fellBack || id === void 0) return;
|
|
16304
16883
|
select(id);
|
|
16305
|
-
await
|
|
16884
|
+
await nextTick12();
|
|
16306
16885
|
const active = root.value?.ownerDocument.activeElement;
|
|
16307
16886
|
if (focusInside && (!active || active === active.ownerDocument.body))
|
|
16308
16887
|
names.get(id)?.focus();
|
|
@@ -16310,8 +16889,8 @@ var PptxEditorRibbon = Object.assign(
|
|
|
16310
16889
|
);
|
|
16311
16890
|
const insertions = useEditorState((s) => s.insertions);
|
|
16312
16891
|
let insertTab = null;
|
|
16313
|
-
|
|
16314
|
-
await
|
|
16892
|
+
watch43(insertions, async () => {
|
|
16893
|
+
await nextTick12();
|
|
16315
16894
|
if (insertTab !== null && insertTab !== (props.tab ?? own.value)) select(insertTab);
|
|
16316
16895
|
});
|
|
16317
16896
|
return () => {
|
|
@@ -16326,7 +16905,7 @@ var PptxEditorRibbon = Object.assign(
|
|
|
16326
16905
|
layout.value,
|
|
16327
16906
|
specs,
|
|
16328
16907
|
props.preset,
|
|
16329
|
-
(key) =>
|
|
16908
|
+
(key) => translateKeyOrText22(t, key),
|
|
16330
16909
|
"PptxEditorRibbon.Tab"
|
|
16331
16910
|
);
|
|
16332
16911
|
insertTab = ribbonInsertTab(tabs);
|
|
@@ -16434,7 +17013,7 @@ var PptxEditorRibbon = Object.assign(
|
|
|
16434
17013
|
|
|
16435
17014
|
// src/status-bar.ts
|
|
16436
17015
|
import {
|
|
16437
|
-
defineComponent as
|
|
17016
|
+
defineComponent as defineComponent66,
|
|
16438
17017
|
h as h21,
|
|
16439
17018
|
isVNode as isVNode8,
|
|
16440
17019
|
normalizeClass as normalizeClass8
|
|
@@ -16449,7 +17028,7 @@ var partProps4 = {
|
|
|
16449
17028
|
function keepFocus2(e) {
|
|
16450
17029
|
if (chromeKeepsFocus2(e.target)) e.preventDefault();
|
|
16451
17030
|
}
|
|
16452
|
-
var StatusBarSlideNumber =
|
|
17031
|
+
var StatusBarSlideNumber = defineComponent66({
|
|
16453
17032
|
name: "StatusBarSlideNumber",
|
|
16454
17033
|
props: partProps4,
|
|
16455
17034
|
setup(props) {
|
|
@@ -16477,7 +17056,7 @@ var notesPartProps = {
|
|
|
16477
17056
|
/** Render the one element of the default slot as the button: it gets the label, state, and click. */
|
|
16478
17057
|
asChild: { type: Boolean, default: false }
|
|
16479
17058
|
};
|
|
16480
|
-
var StatusBarNotes =
|
|
17059
|
+
var StatusBarNotes = defineComponent66({
|
|
16481
17060
|
name: "StatusBarNotes",
|
|
16482
17061
|
inheritAttrs: false,
|
|
16483
17062
|
props: notesPartProps,
|
|
@@ -16506,7 +17085,7 @@ var StatusBarNotes = defineComponent59({
|
|
|
16506
17085
|
};
|
|
16507
17086
|
}
|
|
16508
17087
|
});
|
|
16509
|
-
var StatusBarViews =
|
|
17088
|
+
var StatusBarViews = defineComponent66({
|
|
16510
17089
|
name: "StatusBarViews",
|
|
16511
17090
|
props: partProps4,
|
|
16512
17091
|
setup(props) {
|
|
@@ -16515,7 +17094,7 @@ var StatusBarViews = defineComponent59({
|
|
|
16515
17094
|
]);
|
|
16516
17095
|
}
|
|
16517
17096
|
});
|
|
16518
|
-
var StatusBarZoom =
|
|
17097
|
+
var StatusBarZoom = defineComponent66({
|
|
16519
17098
|
name: "StatusBarZoom",
|
|
16520
17099
|
props: partProps4,
|
|
16521
17100
|
setup(props) {
|
|
@@ -16549,7 +17128,7 @@ function flatten6(children, out = []) {
|
|
|
16549
17128
|
return out;
|
|
16550
17129
|
}
|
|
16551
17130
|
var PptxEditorStatusBar = Object.assign(
|
|
16552
|
-
|
|
17131
|
+
defineComponent66({
|
|
16553
17132
|
name: "PptxEditorStatusBar",
|
|
16554
17133
|
props: statusBarProps,
|
|
16555
17134
|
setup(props, { slots }) {
|
|
@@ -16601,7 +17180,7 @@ import {
|
|
|
16601
17180
|
onScopeDispose as onScopeDispose9,
|
|
16602
17181
|
shallowRef as shallowRef36,
|
|
16603
17182
|
toValue as toValue8,
|
|
16604
|
-
watch as
|
|
17183
|
+
watch as watch44
|
|
16605
17184
|
} from "vue";
|
|
16606
17185
|
import {
|
|
16607
17186
|
ZOOM_LEVELS,
|
|
@@ -16633,7 +17212,7 @@ function useZoom() {
|
|
|
16633
17212
|
function useEditorEvent(event, handler) {
|
|
16634
17213
|
const editor = usePptxEditor();
|
|
16635
17214
|
if (!getCurrentScope6()) return;
|
|
16636
|
-
|
|
17215
|
+
watch44(
|
|
16637
17216
|
editor,
|
|
16638
17217
|
(instance, _prev, onCleanup) => {
|
|
16639
17218
|
if (instance) onCleanup(onEditorEvent(instance, event, handler));
|
|
@@ -16644,7 +17223,7 @@ function useEditorEvent(event, handler) {
|
|
|
16644
17223
|
function useEditorSnapshot(editor) {
|
|
16645
17224
|
const revision = shallowRef36(0);
|
|
16646
17225
|
if (!getCurrentScope6()) return revision;
|
|
16647
|
-
const stop =
|
|
17226
|
+
const stop = watch44(
|
|
16648
17227
|
() => toValue8(editor),
|
|
16649
17228
|
(instance, _prev, onCleanup) => {
|
|
16650
17229
|
if (!instance) return;
|
|
@@ -16668,7 +17247,7 @@ import {
|
|
|
16668
17247
|
computed as computed29,
|
|
16669
17248
|
shallowRef as shallowRef37,
|
|
16670
17249
|
toValue as toValue9,
|
|
16671
|
-
watch as
|
|
17250
|
+
watch as watch45
|
|
16672
17251
|
} from "vue";
|
|
16673
17252
|
import {
|
|
16674
17253
|
editorHostDocument,
|
|
@@ -16687,7 +17266,7 @@ function usePptxSource(source, options = {}) {
|
|
|
16687
17266
|
const documentLoading = shallowRef37(toValue9(source) != null);
|
|
16688
17267
|
const fontsSettled = shallowRef37(toValue9(options).fonts === void 0);
|
|
16689
17268
|
const resolver = pptxSourceFontsResolver(() => toValue9(options).fonts);
|
|
16690
|
-
|
|
17269
|
+
watch45(
|
|
16691
17270
|
() => pptxFontsShape(toValue9(options).fonts),
|
|
16692
17271
|
(_shape, _previous, onCleanup) => {
|
|
16693
17272
|
const fontsSource = toValue9(options).fonts;
|
|
@@ -16712,7 +17291,7 @@ function usePptxSource(source, options = {}) {
|
|
|
16712
17291
|
},
|
|
16713
17292
|
{ immediate: true }
|
|
16714
17293
|
);
|
|
16715
|
-
|
|
17294
|
+
watch45(
|
|
16716
17295
|
() => toValue9(source),
|
|
16717
17296
|
(next, _previous, onCleanup) => {
|
|
16718
17297
|
if (next == null) {
|
|
@@ -16765,7 +17344,7 @@ function useEditorHostDocument() {
|
|
|
16765
17344
|
const editor = editorRef.value;
|
|
16766
17345
|
current.value = editor ? editorHostDocument(editor) : typeof globalThis.document === "undefined" ? null : globalThis.document;
|
|
16767
17346
|
};
|
|
16768
|
-
|
|
17347
|
+
watch45(
|
|
16769
17348
|
() => editorRef.value,
|
|
16770
17349
|
(editor, _previous, onCleanup) => {
|
|
16771
17350
|
read();
|
|
@@ -16840,6 +17419,10 @@ import {
|
|
|
16840
17419
|
isFontResolver,
|
|
16841
17420
|
loadFonts
|
|
16842
17421
|
} from "@pptx-editor.dev/core/editor";
|
|
17422
|
+
import {
|
|
17423
|
+
FORMAT_SECTIONS,
|
|
17424
|
+
formatSectionsOf as formatSectionsOf2
|
|
17425
|
+
} from "@pptx-editor.dev/core/editor";
|
|
16843
17426
|
var pptxEditorProps = {
|
|
16844
17427
|
/** `.pptx` bytes. Identity change loads the new document. */
|
|
16845
17428
|
document: { type: Uint8Array, default: void 0 },
|
|
@@ -16928,7 +17511,7 @@ var OPEN_FAILURE_ACTION_NAMES = {
|
|
|
16928
17511
|
actions: "The #openFailureActions slot",
|
|
16929
17512
|
off: ':open-failure="false"'
|
|
16930
17513
|
};
|
|
16931
|
-
var PptxEditorDefault =
|
|
17514
|
+
var PptxEditorDefault = defineComponent67({
|
|
16932
17515
|
name: "PptxEditor",
|
|
16933
17516
|
// The root renders no element, so the host's attributes (`class`, `style`, `id`, `data-*`)
|
|
16934
17517
|
// go onto the viewport, as React's `className` does.
|
|
@@ -17046,8 +17629,11 @@ export {
|
|
|
17046
17629
|
DEFAULT_FONT,
|
|
17047
17630
|
EditorFontError,
|
|
17048
17631
|
EquationDialog,
|
|
17632
|
+
FORMAT_SECTIONS,
|
|
17049
17633
|
FillControl,
|
|
17050
17634
|
FontDialog,
|
|
17635
|
+
FormatPanel,
|
|
17636
|
+
FormatSection,
|
|
17051
17637
|
GradientDialog,
|
|
17052
17638
|
HyperlinkPopup,
|
|
17053
17639
|
Icon,
|
|
@@ -17125,6 +17711,7 @@ export {
|
|
|
17125
17711
|
deferFonts,
|
|
17126
17712
|
defineFontResolver2 as defineFontResolver,
|
|
17127
17713
|
definePopup,
|
|
17714
|
+
formatSectionsOf2 as formatSectionsOf,
|
|
17128
17715
|
isFontResolver,
|
|
17129
17716
|
keepFocus,
|
|
17130
17717
|
listenPaneRequests2 as listenPaneRequests,
|