@harbour-enterprises/superdoc 0.25.0-next.1 → 0.25.0-next.3
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/chunks/{PdfViewer-CvksDDwi.cjs → PdfViewer-DDL0V0l5.cjs} +1 -1
- package/dist/chunks/{PdfViewer-BEbvklge.es.js → PdfViewer-Y13XRanw.es.js} +1 -1
- package/dist/chunks/{index-Bf3lSVG2.cjs → index-Bo5YCvD5.cjs} +5 -7
- package/dist/chunks/{index-B9Ad3j3k.es.js → index-DKNVSdr6.es.js} +5 -7
- package/dist/chunks/{super-editor.es--RpCOiR4.es.js → super-editor.es-CYtLh0Ob.es.js} +28 -15
- package/dist/chunks/{super-editor.es-Bh07I_ue.cjs → super-editor.es-Ct2sXbNV.cjs} +28 -15
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/style.css +57 -54
- package/dist/super-editor/ai-writer.es.js +1 -1
- package/dist/super-editor/chunks/{editor-CyBtLJFF.js → editor-CoX24lXQ.js} +11 -7
- package/dist/super-editor/chunks/{toolbar-1Ejr8Exl.js → toolbar-BTw9-jfX.js} +3 -3
- package/dist/super-editor/editor.es.js +1 -1
- package/dist/super-editor/style.css +30 -27
- package/dist/super-editor/super-editor/src/components/toolbar/use-toolbar-item.d.ts +1 -1
- package/dist/super-editor/super-editor/src/extensions/track-changes/trackChangesHelpers/markDeletion.d.ts +1 -1
- package/dist/super-editor/super-editor.es.js +18 -9
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +31 -20
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const vue = require("./vue-DKMj1I9B.cjs");
|
|
4
|
-
const superdoc = require("./index-
|
|
4
|
+
const superdoc = require("./index-Bo5YCvD5.cjs");
|
|
5
5
|
function self(vars) {
|
|
6
6
|
const {
|
|
7
7
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-ZWZLQtoU.es.js";
|
|
2
|
-
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-
|
|
2
|
+
import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-DKNVSdr6.es.js";
|
|
3
3
|
function self(vars) {
|
|
4
4
|
const {
|
|
5
5
|
opacityDisabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const superEditor_es = require("./super-editor.es-
|
|
2
|
+
const superEditor_es = require("./super-editor.es-Ct2sXbNV.cjs");
|
|
3
3
|
const vue = require("./vue-DKMj1I9B.cjs");
|
|
4
4
|
const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
|
|
5
5
|
const eventemitter3 = require("./eventemitter3-DkXkH2rT.cjs");
|
|
@@ -17164,7 +17164,7 @@ const _sfc_main = {
|
|
|
17164
17164
|
__name: "SuperDoc",
|
|
17165
17165
|
emits: ["selection-update"],
|
|
17166
17166
|
setup(__props, { emit: __emit }) {
|
|
17167
|
-
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-
|
|
17167
|
+
const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DDL0V0l5.cjs")));
|
|
17168
17168
|
const superdocStore = useSuperdocStore();
|
|
17169
17169
|
const commentsStore = useCommentsStore();
|
|
17170
17170
|
const {
|
|
@@ -17341,10 +17341,8 @@ const _sfc_main = {
|
|
|
17341
17341
|
const onEditorListdefinitionsChange = (params2) => {
|
|
17342
17342
|
proxy.$superdoc.emit("list-definitions-change", params2);
|
|
17343
17343
|
};
|
|
17344
|
-
const onFontsResolved = (params2) => {
|
|
17345
|
-
proxy.$superdoc.emit("fonts-resolved", params2);
|
|
17346
|
-
};
|
|
17347
17344
|
const editorOptions = (doc) => {
|
|
17345
|
+
const onFontsResolvedFn = proxy.$superdoc.listeners?.("fonts-resolved")?.length > 0 ? proxy.$superdoc.listeners("fonts-resolved")[0] : null;
|
|
17348
17346
|
const options = {
|
|
17349
17347
|
isDebug: proxy.$superdoc.config.isDebug || false,
|
|
17350
17348
|
pagination: proxy.$superdoc.config.pagination,
|
|
@@ -17376,7 +17374,7 @@ const _sfc_main = {
|
|
|
17376
17374
|
onCommentsUpdate: onEditorCommentsUpdate,
|
|
17377
17375
|
onCommentLocationsUpdate: onEditorCommentLocationsUpdate,
|
|
17378
17376
|
onListDefinitionsChange: onEditorListdefinitionsChange,
|
|
17379
|
-
onFontsResolved:
|
|
17377
|
+
onFontsResolved: onFontsResolvedFn,
|
|
17380
17378
|
onTransaction: onEditorTransaction,
|
|
17381
17379
|
ydoc: doc.ydoc,
|
|
17382
17380
|
collaborationProvider: doc.provider || null,
|
|
@@ -17760,7 +17758,7 @@ const _sfc_main = {
|
|
|
17760
17758
|
};
|
|
17761
17759
|
}
|
|
17762
17760
|
};
|
|
17763
|
-
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
17761
|
+
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-715d68b1"]]);
|
|
17764
17762
|
const createSuperdocVueApp = () => {
|
|
17765
17763
|
const app = vue.createApp(App);
|
|
17766
17764
|
const pinia = createPinia();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es
|
|
1
|
+
import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-CYtLh0Ob.es.js";
|
|
2
2
|
import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-ZWZLQtoU.es.js";
|
|
3
3
|
import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
|
|
4
4
|
import { E as EventEmitter } from "./eventemitter3-BWEnUdTY.es.js";
|
|
@@ -17147,7 +17147,7 @@ const _sfc_main = {
|
|
|
17147
17147
|
__name: "SuperDoc",
|
|
17148
17148
|
emits: ["selection-update"],
|
|
17149
17149
|
setup(__props, { emit: __emit }) {
|
|
17150
|
-
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-
|
|
17150
|
+
const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-Y13XRanw.es.js"));
|
|
17151
17151
|
const superdocStore = useSuperdocStore();
|
|
17152
17152
|
const commentsStore = useCommentsStore();
|
|
17153
17153
|
const {
|
|
@@ -17324,10 +17324,8 @@ const _sfc_main = {
|
|
|
17324
17324
|
const onEditorListdefinitionsChange = (params2) => {
|
|
17325
17325
|
proxy.$superdoc.emit("list-definitions-change", params2);
|
|
17326
17326
|
};
|
|
17327
|
-
const onFontsResolved = (params2) => {
|
|
17328
|
-
proxy.$superdoc.emit("fonts-resolved", params2);
|
|
17329
|
-
};
|
|
17330
17327
|
const editorOptions = (doc) => {
|
|
17328
|
+
const onFontsResolvedFn = proxy.$superdoc.listeners?.("fonts-resolved")?.length > 0 ? proxy.$superdoc.listeners("fonts-resolved")[0] : null;
|
|
17331
17329
|
const options = {
|
|
17332
17330
|
isDebug: proxy.$superdoc.config.isDebug || false,
|
|
17333
17331
|
pagination: proxy.$superdoc.config.pagination,
|
|
@@ -17359,7 +17357,7 @@ const _sfc_main = {
|
|
|
17359
17357
|
onCommentsUpdate: onEditorCommentsUpdate,
|
|
17360
17358
|
onCommentLocationsUpdate: onEditorCommentLocationsUpdate,
|
|
17361
17359
|
onListDefinitionsChange: onEditorListdefinitionsChange,
|
|
17362
|
-
onFontsResolved:
|
|
17360
|
+
onFontsResolved: onFontsResolvedFn,
|
|
17363
17361
|
onTransaction: onEditorTransaction,
|
|
17364
17362
|
ydoc: doc.ydoc,
|
|
17365
17363
|
collaborationProvider: doc.provider || null,
|
|
@@ -17743,7 +17741,7 @@ const _sfc_main = {
|
|
|
17743
17741
|
};
|
|
17744
17742
|
}
|
|
17745
17743
|
};
|
|
17746
|
-
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
17744
|
+
const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-715d68b1"]]);
|
|
17747
17745
|
const createSuperdocVueApp = () => {
|
|
17748
17746
|
const app = createApp(App);
|
|
17749
17747
|
const pinia = createPinia();
|
|
@@ -49337,7 +49337,7 @@ const markInsertion = ({ tr, from: from2, to, user, date }) => {
|
|
|
49337
49337
|
});
|
|
49338
49338
|
return insertionMark;
|
|
49339
49339
|
};
|
|
49340
|
-
const markDeletion = ({ tr, from: from2, to, user, date }) => {
|
|
49340
|
+
const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
|
|
49341
49341
|
let trackedMark = findTrackedMarkBetween({
|
|
49342
49342
|
tr,
|
|
49343
49343
|
from: from2,
|
|
@@ -49346,7 +49346,9 @@ const markDeletion = ({ tr, from: from2, to, user, date }) => {
|
|
|
49346
49346
|
attrs: { authorEmail: user.email }
|
|
49347
49347
|
});
|
|
49348
49348
|
let id;
|
|
49349
|
-
if (
|
|
49349
|
+
if (providedId) {
|
|
49350
|
+
id = providedId;
|
|
49351
|
+
} else if (trackedMark) {
|
|
49350
49352
|
id = trackedMark.mark.attrs.id;
|
|
49351
49353
|
} else {
|
|
49352
49354
|
id = v4();
|
|
@@ -50618,7 +50620,8 @@ const replaceStep = ({ state: state2, tr, step, newTr, map: map22, user, date, o
|
|
|
50618
50620
|
from: step.from,
|
|
50619
50621
|
to: step.to,
|
|
50620
50622
|
user,
|
|
50621
|
-
date
|
|
50623
|
+
date,
|
|
50624
|
+
id: meta.insertedMark?.attrs?.id
|
|
50622
50625
|
});
|
|
50623
50626
|
meta.deletionNodes = deletionNodes;
|
|
50624
50627
|
meta.deletionMark = deletionMark2;
|
|
@@ -53534,6 +53537,7 @@ init_fn = function() {
|
|
|
53534
53537
|
this.on("paginationUpdate", this.options.onPaginationUpdate);
|
|
53535
53538
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
53536
53539
|
this.on("list-definitions-change", this.options.onListDefinitionsChange);
|
|
53540
|
+
this.on("fonts-resolved", this.options.onFontsResolved);
|
|
53537
53541
|
this.on("exception", this.options.onException);
|
|
53538
53542
|
if (!this.options.isHeadless) {
|
|
53539
53543
|
this.initializeCollaborationData();
|
|
@@ -53684,7 +53688,7 @@ checkFonts_fn = async function() {
|
|
|
53684
53688
|
if (!("queryLocalFonts" in window)) {
|
|
53685
53689
|
console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
|
|
53686
53690
|
const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
|
|
53687
|
-
this.
|
|
53691
|
+
this.emit("fonts-resolved", {
|
|
53688
53692
|
documentFonts: fontsUsedInDocument,
|
|
53689
53693
|
unsupportedFonts
|
|
53690
53694
|
});
|
|
@@ -53694,7 +53698,7 @@ checkFonts_fn = async function() {
|
|
|
53694
53698
|
if (localFontAccess.state === "denied") {
|
|
53695
53699
|
console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
|
|
53696
53700
|
const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
|
|
53697
|
-
this.
|
|
53701
|
+
this.emit("fonts-resolved", {
|
|
53698
53702
|
documentFonts: fontsUsedInDocument,
|
|
53699
53703
|
unsupportedFonts
|
|
53700
53704
|
});
|
|
@@ -53704,14 +53708,14 @@ checkFonts_fn = async function() {
|
|
|
53704
53708
|
const localFonts = await window.queryLocalFonts();
|
|
53705
53709
|
const uniqueLocalFonts = [...new Set(localFonts.map((font) => font.family))];
|
|
53706
53710
|
const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithLocalFonts_fn).call(this, fontsUsedInDocument, uniqueLocalFonts);
|
|
53707
|
-
this.
|
|
53711
|
+
this.emit("fonts-resolved", {
|
|
53708
53712
|
documentFonts: fontsUsedInDocument,
|
|
53709
53713
|
unsupportedFonts
|
|
53710
53714
|
});
|
|
53711
53715
|
} catch {
|
|
53712
53716
|
console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
|
|
53713
53717
|
const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
|
|
53714
|
-
this.
|
|
53718
|
+
this.emit("fonts-resolved", {
|
|
53715
53719
|
documentFonts: fontsUsedInDocument,
|
|
53716
53720
|
unsupportedFonts
|
|
53717
53721
|
});
|
|
@@ -73500,7 +73504,7 @@ const _sfc_main$4$1 = {
|
|
|
73500
73504
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
|
|
73501
73505
|
onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
|
|
73502
73506
|
type: "text",
|
|
73503
|
-
class: normalizeClass(["button-text-input", { "high-contrast": unref(isHighContrastMode2) }]),
|
|
73507
|
+
class: normalizeClass(["button-text-input button-text-input--font-size", { "high-contrast": unref(isHighContrastMode2) }]),
|
|
73504
73508
|
id: "inlineTextInput-" + unref(name),
|
|
73505
73509
|
autocomplete: "off",
|
|
73506
73510
|
ref_key: "inlineInput",
|
|
@@ -73534,7 +73538,7 @@ const _sfc_main$4$1 = {
|
|
|
73534
73538
|
};
|
|
73535
73539
|
}
|
|
73536
73540
|
};
|
|
73537
|
-
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-
|
|
73541
|
+
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-ea93b080"]]);
|
|
73538
73542
|
const _hoisted_1$2$1 = {
|
|
73539
73543
|
class: "toolbar-separator",
|
|
73540
73544
|
role: "separator",
|
|
@@ -84085,8 +84089,8 @@ const useToolbarItem = (options) => {
|
|
|
84085
84089
|
if (!Array.isArray(options.options)) throw new Error("Invalid toolbar item options - " + options.options);
|
|
84086
84090
|
nestedOptions.value?.push(...options.options);
|
|
84087
84091
|
}
|
|
84088
|
-
const activate = (attrs) => {
|
|
84089
|
-
onActivate(attrs);
|
|
84092
|
+
const activate = (attrs, ...args) => {
|
|
84093
|
+
onActivate(attrs, ...args);
|
|
84090
84094
|
if (suppressActiveHighlight.value) return;
|
|
84091
84095
|
active.value = true;
|
|
84092
84096
|
};
|
|
@@ -85387,7 +85391,12 @@ const makeDefaultItems = ({
|
|
|
85387
85391
|
ariaLabel: "Font size"
|
|
85388
85392
|
},
|
|
85389
85393
|
options: fontSizeOptions,
|
|
85390
|
-
onActivate: ({ fontSize: size2 }) => {
|
|
85394
|
+
onActivate: ({ fontSize: size2 }, isMultiple = false) => {
|
|
85395
|
+
if (isMultiple) {
|
|
85396
|
+
fontSize2.label.value = "";
|
|
85397
|
+
fontSize2.selectedValue.value = "";
|
|
85398
|
+
return;
|
|
85399
|
+
}
|
|
85391
85400
|
const defaultSize = fontSizeOptions.find((i2) => i2.label === String(fontSize2.defaultLabel.value));
|
|
85392
85401
|
if (!size2) {
|
|
85393
85402
|
fontSize2.label.value = fontSize2.defaultLabel.value;
|
|
@@ -85404,8 +85413,6 @@ const makeDefaultItems = ({
|
|
|
85404
85413
|
});
|
|
85405
85414
|
if (foundSize) {
|
|
85406
85415
|
fontSize2.selectedValue.value = foundSize.key;
|
|
85407
|
-
} else if (defaultSize) {
|
|
85408
|
-
fontSize2.selectedValue.value = defaultSize.key;
|
|
85409
85416
|
} else {
|
|
85410
85417
|
fontSize2.selectedValue.value = "";
|
|
85411
85418
|
}
|
|
@@ -86856,7 +86863,13 @@ class SuperToolbar extends EventEmitter2 {
|
|
|
86856
86863
|
const markNegated = rawActiveMark ? isNegatedMark(rawActiveMark.name, rawActiveMark.attrs) : false;
|
|
86857
86864
|
const activeMark = markNegated ? null : rawActiveMark;
|
|
86858
86865
|
if (activeMark) {
|
|
86859
|
-
|
|
86866
|
+
if (activeMark.name === "fontSize") {
|
|
86867
|
+
const fontSizes = marks.filter((i2) => i2.name === "fontSize").map((i2) => i2.attrs.fontSize);
|
|
86868
|
+
const isMultiple = [...new Set(fontSizes)].length > 1;
|
|
86869
|
+
item.activate(activeMark.attrs, isMultiple);
|
|
86870
|
+
} else {
|
|
86871
|
+
item.activate(activeMark.attrs);
|
|
86872
|
+
}
|
|
86860
86873
|
} else {
|
|
86861
86874
|
item.deactivate();
|
|
86862
86875
|
}
|
|
@@ -49354,7 +49354,7 @@ const markInsertion = ({ tr, from: from2, to, user, date }) => {
|
|
|
49354
49354
|
});
|
|
49355
49355
|
return insertionMark;
|
|
49356
49356
|
};
|
|
49357
|
-
const markDeletion = ({ tr, from: from2, to, user, date }) => {
|
|
49357
|
+
const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
|
|
49358
49358
|
let trackedMark = findTrackedMarkBetween({
|
|
49359
49359
|
tr,
|
|
49360
49360
|
from: from2,
|
|
@@ -49363,7 +49363,9 @@ const markDeletion = ({ tr, from: from2, to, user, date }) => {
|
|
|
49363
49363
|
attrs: { authorEmail: user.email }
|
|
49364
49364
|
});
|
|
49365
49365
|
let id;
|
|
49366
|
-
if (
|
|
49366
|
+
if (providedId) {
|
|
49367
|
+
id = providedId;
|
|
49368
|
+
} else if (trackedMark) {
|
|
49367
49369
|
id = trackedMark.mark.attrs.id;
|
|
49368
49370
|
} else {
|
|
49369
49371
|
id = v4();
|
|
@@ -50635,7 +50637,8 @@ const replaceStep = ({ state: state2, tr, step, newTr, map: map22, user, date, o
|
|
|
50635
50637
|
from: step.from,
|
|
50636
50638
|
to: step.to,
|
|
50637
50639
|
user,
|
|
50638
|
-
date
|
|
50640
|
+
date,
|
|
50641
|
+
id: meta.insertedMark?.attrs?.id
|
|
50639
50642
|
});
|
|
50640
50643
|
meta.deletionNodes = deletionNodes;
|
|
50641
50644
|
meta.deletionMark = deletionMark2;
|
|
@@ -53551,6 +53554,7 @@ init_fn = function() {
|
|
|
53551
53554
|
this.on("paginationUpdate", this.options.onPaginationUpdate);
|
|
53552
53555
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
53553
53556
|
this.on("list-definitions-change", this.options.onListDefinitionsChange);
|
|
53557
|
+
this.on("fonts-resolved", this.options.onFontsResolved);
|
|
53554
53558
|
this.on("exception", this.options.onException);
|
|
53555
53559
|
if (!this.options.isHeadless) {
|
|
53556
53560
|
this.initializeCollaborationData();
|
|
@@ -53701,7 +53705,7 @@ checkFonts_fn = async function() {
|
|
|
53701
53705
|
if (!("queryLocalFonts" in window)) {
|
|
53702
53706
|
console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
|
|
53703
53707
|
const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
|
|
53704
|
-
this.
|
|
53708
|
+
this.emit("fonts-resolved", {
|
|
53705
53709
|
documentFonts: fontsUsedInDocument,
|
|
53706
53710
|
unsupportedFonts
|
|
53707
53711
|
});
|
|
@@ -53711,7 +53715,7 @@ checkFonts_fn = async function() {
|
|
|
53711
53715
|
if (localFontAccess.state === "denied") {
|
|
53712
53716
|
console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
|
|
53713
53717
|
const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
|
|
53714
|
-
this.
|
|
53718
|
+
this.emit("fonts-resolved", {
|
|
53715
53719
|
documentFonts: fontsUsedInDocument,
|
|
53716
53720
|
unsupportedFonts
|
|
53717
53721
|
});
|
|
@@ -53721,14 +53725,14 @@ checkFonts_fn = async function() {
|
|
|
53721
53725
|
const localFonts = await window.queryLocalFonts();
|
|
53722
53726
|
const uniqueLocalFonts = [...new Set(localFonts.map((font) => font.family))];
|
|
53723
53727
|
const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithLocalFonts_fn).call(this, fontsUsedInDocument, uniqueLocalFonts);
|
|
53724
|
-
this.
|
|
53728
|
+
this.emit("fonts-resolved", {
|
|
53725
53729
|
documentFonts: fontsUsedInDocument,
|
|
53726
53730
|
unsupportedFonts
|
|
53727
53731
|
});
|
|
53728
53732
|
} catch {
|
|
53729
53733
|
console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
|
|
53730
53734
|
const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
|
|
53731
|
-
this.
|
|
53735
|
+
this.emit("fonts-resolved", {
|
|
53732
53736
|
documentFonts: fontsUsedInDocument,
|
|
53733
53737
|
unsupportedFonts
|
|
53734
53738
|
});
|
|
@@ -73517,7 +73521,7 @@ const _sfc_main$4$1 = {
|
|
|
73517
73521
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
|
|
73518
73522
|
onKeydown: vue.withKeys(vue.withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
|
|
73519
73523
|
type: "text",
|
|
73520
|
-
class: vue.normalizeClass(["button-text-input", { "high-contrast": vue.unref(isHighContrastMode2) }]),
|
|
73524
|
+
class: vue.normalizeClass(["button-text-input button-text-input--font-size", { "high-contrast": vue.unref(isHighContrastMode2) }]),
|
|
73521
73525
|
id: "inlineTextInput-" + vue.unref(name),
|
|
73522
73526
|
autocomplete: "off",
|
|
73523
73527
|
ref_key: "inlineInput",
|
|
@@ -73551,7 +73555,7 @@ const _sfc_main$4$1 = {
|
|
|
73551
73555
|
};
|
|
73552
73556
|
}
|
|
73553
73557
|
};
|
|
73554
|
-
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-
|
|
73558
|
+
const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-ea93b080"]]);
|
|
73555
73559
|
const _hoisted_1$2$1 = {
|
|
73556
73560
|
class: "toolbar-separator",
|
|
73557
73561
|
role: "separator",
|
|
@@ -84102,8 +84106,8 @@ const useToolbarItem = (options) => {
|
|
|
84102
84106
|
if (!Array.isArray(options.options)) throw new Error("Invalid toolbar item options - " + options.options);
|
|
84103
84107
|
nestedOptions.value?.push(...options.options);
|
|
84104
84108
|
}
|
|
84105
|
-
const activate = (attrs) => {
|
|
84106
|
-
onActivate(attrs);
|
|
84109
|
+
const activate = (attrs, ...args) => {
|
|
84110
|
+
onActivate(attrs, ...args);
|
|
84107
84111
|
if (suppressActiveHighlight.value) return;
|
|
84108
84112
|
active.value = true;
|
|
84109
84113
|
};
|
|
@@ -85404,7 +85408,12 @@ const makeDefaultItems = ({
|
|
|
85404
85408
|
ariaLabel: "Font size"
|
|
85405
85409
|
},
|
|
85406
85410
|
options: fontSizeOptions,
|
|
85407
|
-
onActivate: ({ fontSize: size2 }) => {
|
|
85411
|
+
onActivate: ({ fontSize: size2 }, isMultiple = false) => {
|
|
85412
|
+
if (isMultiple) {
|
|
85413
|
+
fontSize2.label.value = "";
|
|
85414
|
+
fontSize2.selectedValue.value = "";
|
|
85415
|
+
return;
|
|
85416
|
+
}
|
|
85408
85417
|
const defaultSize = fontSizeOptions.find((i2) => i2.label === String(fontSize2.defaultLabel.value));
|
|
85409
85418
|
if (!size2) {
|
|
85410
85419
|
fontSize2.label.value = fontSize2.defaultLabel.value;
|
|
@@ -85421,8 +85430,6 @@ const makeDefaultItems = ({
|
|
|
85421
85430
|
});
|
|
85422
85431
|
if (foundSize) {
|
|
85423
85432
|
fontSize2.selectedValue.value = foundSize.key;
|
|
85424
|
-
} else if (defaultSize) {
|
|
85425
|
-
fontSize2.selectedValue.value = defaultSize.key;
|
|
85426
85433
|
} else {
|
|
85427
85434
|
fontSize2.selectedValue.value = "";
|
|
85428
85435
|
}
|
|
@@ -86873,7 +86880,13 @@ class SuperToolbar extends EventEmitter2 {
|
|
|
86873
86880
|
const markNegated = rawActiveMark ? isNegatedMark(rawActiveMark.name, rawActiveMark.attrs) : false;
|
|
86874
86881
|
const activeMark = markNegated ? null : rawActiveMark;
|
|
86875
86882
|
if (activeMark) {
|
|
86876
|
-
|
|
86883
|
+
if (activeMark.name === "fontSize") {
|
|
86884
|
+
const fontSizes = marks.filter((i2) => i2.name === "fontSize").map((i2) => i2.attrs.fontSize);
|
|
86885
|
+
const isMultiple = [...new Set(fontSizes)].length > 1;
|
|
86886
|
+
item.activate(activeMark.attrs, isMultiple);
|
|
86887
|
+
} else {
|
|
86888
|
+
item.activate(activeMark.attrs);
|
|
86889
|
+
}
|
|
86877
86890
|
} else {
|
|
86878
86891
|
item.deactivate();
|
|
86879
86892
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/types/index.js"],"names":[],"mappings":";;;;;;;UAEc,MAAM;;;;WACN,MAAM;;;;YACN,MAAM,GAAG,IAAI;;;;;;;;;cAKb,OAAO;;;;iBACP,MAAM;;;;eACN,MAAM;;;;sBACN,MAAM;;;;;;SAKN,MAAM;;;;UACN,MAAM;;;;WACN,IAAI,GAAG,IAAI,GAAG,IAAI;;;;WAClB,MAAM;;;;UACN,MAAM;;;;gBACN,OAAO;;;;WACP,OAAO,KAAK,EAAE,GAAG;;;;eACjB,OAAO,sBAAsB,EAAE,kBAAkB;;;;;;eAM5D;QAQqC,kBAAkB,GAR5C,CAAC,MAAM,EAAE;YAClB,UAAU,EAAE,MAAM,CAAC;YACnB,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,UAAU,CAAC,EAAE,OAAO,CAAC;YACrB,OAAO,CAAC,EAAE,MAAS,IAAI,CAAC;YACxB,aAAa,CAAC,EAAE,MAAS,IAAI,CAAC;YAC9B,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;YAC1B,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;SAC5B,KAAK,OAAO,GAAG,SAAS;KACzB;;;;SACA;QAAuB,MAAM,GAAlB,MAAM;QACM,QAAQ,GAApB,MAAM;KACjB;;;;;;;;;;;;gBAGA;QAA6B,WAAW;QACR,YAAY;QACb,mBAAmB,GAAvC,OAAO;KACpB;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":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