superdoc 2.0.0-next.33 → 2.0.0-next.34
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/{create-super-doc-ui-C01vcKRO.es.js → create-super-doc-ui-C_kKiKQ4.es.js} +334 -29
- package/dist/chunks/{create-super-doc-ui-C0ZJE05U.cjs → create-super-doc-ui-DLyJzmj9.cjs} +558 -28
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/types/blocks.types.d.ts +5 -0
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/superdoc/src/internal/toolbar/built-in/toolbar-focus-helpers.d.ts +1 -1
- package/dist/superdoc.cjs +66 -306
- package/dist/superdoc.es.js +65 -86
- package/dist-cdn/superdoc.min.js +37 -37
- package/package.json +2 -2
|
@@ -7,7 +7,7 @@ const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
7
7
|
var PRIVATE_ENGINE_INFO = (0, __superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
|
|
8
8
|
var ENGINE_INFO = Object.freeze({
|
|
9
9
|
...PRIVATE_ENGINE_INFO,
|
|
10
|
-
superdocVersion: "2.0.0-next.
|
|
10
|
+
superdocVersion: "2.0.0-next.34",
|
|
11
11
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
12
12
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
13
13
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -6,7 +6,7 @@ const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
6
6
|
var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
|
|
7
7
|
var ENGINE_INFO = Object.freeze({
|
|
8
8
|
...PRIVATE_ENGINE_INFO,
|
|
9
|
-
superdocVersion: "2.0.0-next.
|
|
9
|
+
superdocVersion: "2.0.0-next.34",
|
|
10
10
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
11
11
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
12
12
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -182,4 +182,9 @@ export interface BlocksDeleteRangeResult {
|
|
|
182
182
|
after: string;
|
|
183
183
|
};
|
|
184
184
|
dryRun: boolean;
|
|
185
|
+
trackedChangeRefs?: ReceiptInsert[];
|
|
186
|
+
invalidatedRefs?: AffectedRef[];
|
|
187
|
+
affectedStories?: StoryLocator[];
|
|
188
|
+
textRangeShifts?: TextRangeShift[];
|
|
189
|
+
txId?: string;
|
|
185
190
|
}
|
package/dist/public/ui-react.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("../chunks/rolldown-runtime-_dR15c8t.cjs");
|
|
3
|
-
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-
|
|
3
|
+
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DLyJzmj9.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
var SuperDocUIContext = (0, react.createContext)(null);
|
|
6
6
|
function SuperDocUIProvider(props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-C_kKiKQ4.es.js";
|
|
2
2
|
import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
3
3
|
var SuperDocUIContext = createContext(null);
|
|
4
4
|
function SuperDocUIProvider(props) {
|
package/dist/public/ui.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-
|
|
2
|
+
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DLyJzmj9.cjs");
|
|
3
3
|
exports.BUILT_IN_COMMAND_IDS = require_create_super_doc_ui.BUILT_IN_COMMAND_IDS;
|
|
4
4
|
exports.createSuperDocUI = require_create_super_doc_ui.createSuperDocUI;
|
|
5
5
|
exports.shallowEqual = require_create_super_doc_ui.shallowEqual;
|
package/dist/public/ui.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as BUILT_IN_COMMAND_IDS, r as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { n as BUILT_IN_COMMAND_IDS, r as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-C_kKiKQ4.es.js";
|
|
2
2
|
export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function refocusEditorSurface(superToolbar: any): void;
|
|
1
|
+
export function refocusEditorSurface(superToolbar: any, preferredEditor?: null): void;
|
package/dist/superdoc.cjs
CHANGED
|
@@ -6,7 +6,7 @@ const require_uuid = require("./chunks/uuid-CFp0WGVU.cjs");
|
|
|
6
6
|
const require_jszip = require("./chunks/jszip-BdUBlUeG.cjs");
|
|
7
7
|
const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-BTwbGDKw.cjs");
|
|
8
8
|
const require_constants = require("./chunks/constants-sbCZ2O_A.cjs");
|
|
9
|
-
const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-
|
|
9
|
+
const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-DLyJzmj9.cjs");
|
|
10
10
|
let vue = require("vue");
|
|
11
11
|
vue = require_rolldown_runtime.__toESM(vue);
|
|
12
12
|
require("y-websocket");
|
|
@@ -1845,6 +1845,7 @@ function useComment(params) {
|
|
|
1845
1845
|
const trackedChangeStoryLabel = (0, vue.ref)(params.trackedChangeStoryLabel || "");
|
|
1846
1846
|
const trackedChangeAnchorKey = (0, vue.ref)(params.trackedChangeAnchorKey || null);
|
|
1847
1847
|
const trackedChangeCanonicalId = (0, vue.ref)(params.trackedChangeCanonicalId || null);
|
|
1848
|
+
const trackedChangePositionAliases = (0, vue.ref)(params.trackedChangePositionAliases || []);
|
|
1848
1849
|
const deletedText = (0, vue.ref)(params.deletedText || null);
|
|
1849
1850
|
const trackedChangeLabel = (0, vue.ref)(params.trackedChangeLabel || null);
|
|
1850
1851
|
const trackedChangeDetailLines = (0, vue.ref)(params.trackedChangeDetailLines || null);
|
|
@@ -2014,6 +2015,7 @@ function useComment(params) {
|
|
|
2014
2015
|
trackedChangeStoryLabel: trackedChangeStoryLabel.value,
|
|
2015
2016
|
trackedChangeAnchorKey: trackedChangeAnchorKey.value,
|
|
2016
2017
|
trackedChangeCanonicalId: trackedChangeCanonicalId.value,
|
|
2018
|
+
trackedChangePositionAliases: trackedChangePositionAliases.value,
|
|
2017
2019
|
trackedChangeDecision: trackedChangeDecision.value,
|
|
2018
2020
|
trackedChangeLabel: trackedChangeLabel.value,
|
|
2019
2021
|
trackedChangeDetailLines: trackedChangeDetailLines.value,
|
|
@@ -2063,6 +2065,7 @@ function useComment(params) {
|
|
|
2063
2065
|
trackedChangeStoryLabel,
|
|
2064
2066
|
trackedChangeAnchorKey,
|
|
2065
2067
|
trackedChangeCanonicalId,
|
|
2068
|
+
trackedChangePositionAliases,
|
|
2066
2069
|
trackedChangeDecision,
|
|
2067
2070
|
trackedChangeLabel,
|
|
2068
2071
|
trackedChangeDetailLines,
|
|
@@ -2516,6 +2519,11 @@ var toFinitePageIndex = (value) => {
|
|
|
2516
2519
|
var buildPageScopedInstanceId = (positionKey, pageIndex) => {
|
|
2517
2520
|
return `${positionKey}::page:${pageIndex}`;
|
|
2518
2521
|
};
|
|
2522
|
+
var matchesTrackedChangePositionAlias = (positionKey, alias) => {
|
|
2523
|
+
const normalizedPositionKey = String(positionKey);
|
|
2524
|
+
const normalizedAlias = String(alias);
|
|
2525
|
+
return normalizedPositionKey === normalizedAlias || normalizedPositionKey.startsWith("tc::") && normalizedPositionKey.endsWith(`::${normalizedAlias}`);
|
|
2526
|
+
};
|
|
2519
2527
|
var aggregateRectBounds = (rects) => {
|
|
2520
2528
|
if (!Array.isArray(rects) || rects.length === 0) return null;
|
|
2521
2529
|
let left = Number.POSITIVE_INFINITY;
|
|
@@ -2622,7 +2630,9 @@ var buildRepeatedHeaderFooterInstances = ({ comment, positionKey, positionEntry,
|
|
|
2622
2630
|
});
|
|
2623
2631
|
};
|
|
2624
2632
|
const buildFloatingCommentInstances = ({ comment, positionKey, positionEntry, fallbackId }) => {
|
|
2625
|
-
const
|
|
2633
|
+
const hasTrackedChangePositionAlias = comment?.trackedChange && positionKey && fallbackId && Array.isArray(comment?.trackedChangePositionAliases) && comment.trackedChangePositionAliases.some((alias) => matchesTrackedChangePositionAlias(positionKey, alias));
|
|
2634
|
+
const hasSharedTrackedChangeAnchor = comment?.trackedChange && comment?.trackedChangeCanonicalId && positionKey && fallbackId && String(positionKey) !== String(fallbackId);
|
|
2635
|
+
const instanceId = hasTrackedChangePositionAlias || hasSharedTrackedChangeAnchor ? fallbackId : positionKey ?? fallbackId;
|
|
2626
2636
|
if (!instanceId) return [];
|
|
2627
2637
|
if (isRepeatedHeaderFooterTrackedChange(comment, positionEntry) && positionKey) {
|
|
2628
2638
|
const repeatedInstances = buildRepeatedHeaderFooterInstances({
|
|
@@ -3104,6 +3114,37 @@ const useCommentsStore = defineStore("comments", () => {
|
|
|
3104
3114
|
if (config.comments && config.comments.length) commentsList.value = config.comments?.map((c) => useComment(c)) || [];
|
|
3105
3115
|
};
|
|
3106
3116
|
const normalizeCommentId = (id) => id === void 0 || id === null ? null : String(id);
|
|
3117
|
+
const normalizeTrackedChangePositionAliases = (aliases) => {
|
|
3118
|
+
if (!Array.isArray(aliases)) return [];
|
|
3119
|
+
return [...new Set(aliases.map((id) => normalizeCommentId(id)).filter(Boolean))];
|
|
3120
|
+
};
|
|
3121
|
+
const getTrackedChangeStoryKey = (comment) => {
|
|
3122
|
+
if (!comment?.trackedChange) return null;
|
|
3123
|
+
const anchorKey = normalizeCommentId(comment.trackedChangeAnchorKey);
|
|
3124
|
+
if (anchorKey?.startsWith("tc::")) {
|
|
3125
|
+
const separatorIndex = anchorKey.indexOf("::", 4);
|
|
3126
|
+
if (separatorIndex > 4) return anchorKey.slice(4, separatorIndex);
|
|
3127
|
+
}
|
|
3128
|
+
const story = comment.trackedChangeStory;
|
|
3129
|
+
switch (story?.storyType) {
|
|
3130
|
+
case "body": return "body";
|
|
3131
|
+
case "headerFooterPart": return story.refId ? `hf:${story.refId}` : null;
|
|
3132
|
+
case "footnote": return story.noteId ? `fn:${story.noteId}` : null;
|
|
3133
|
+
case "endnote": return story.noteId ? `en:${story.noteId}` : null;
|
|
3134
|
+
case "textbox": return story.textboxId ? `textbox:${story.textboxId}` : null;
|
|
3135
|
+
default: return null;
|
|
3136
|
+
}
|
|
3137
|
+
};
|
|
3138
|
+
const normalizeTrackedChangeStoryKey = (storyKey) => {
|
|
3139
|
+
if (storyKey?.startsWith("hf:part:")) return `hf:${storyKey.slice(8)}`;
|
|
3140
|
+
if (storyKey?.startsWith("headerFooterPart:")) return `hf:${storyKey.slice(17)}`;
|
|
3141
|
+
return storyKey;
|
|
3142
|
+
};
|
|
3143
|
+
const positionEntryMatchesTrackedChangeStory = (entry, comment) => {
|
|
3144
|
+
const expectedStoryKey = normalizeTrackedChangeStoryKey(getTrackedChangeStoryKey(comment));
|
|
3145
|
+
const entryStoryKey = normalizeTrackedChangeStoryKey(normalizeCommentId(entry?.storyKey));
|
|
3146
|
+
return !expectedStoryKey || !entryStoryKey || entryStoryKey === expectedStoryKey;
|
|
3147
|
+
};
|
|
3107
3148
|
const buildTrackedChangeImportedPositionId = (id) => {
|
|
3108
3149
|
const normalizedId = normalizeCommentId(id);
|
|
3109
3150
|
if (!normalizedId) return null;
|
|
@@ -3227,6 +3268,8 @@ const useCommentsStore = defineStore("comments", () => {
|
|
|
3227
3268
|
if (commentOrId === void 0 || commentOrId === null) return [];
|
|
3228
3269
|
const rawId = typeof commentOrId === "object" ? null : commentOrId;
|
|
3229
3270
|
const comment = typeof commentOrId === "object" ? commentOrId : getComment(commentOrId);
|
|
3271
|
+
const trackedChangePositionAliases = comment?.trackedChange ? normalizeTrackedChangePositionAliases(comment?.trackedChangePositionAliases) : [];
|
|
3272
|
+
const trackedChangeStoryKey = normalizeTrackedChangeStoryKey(getTrackedChangeStoryKey(comment));
|
|
3230
3273
|
const seen = /* @__PURE__ */ new Set();
|
|
3231
3274
|
return [
|
|
3232
3275
|
rawId,
|
|
@@ -3234,7 +3277,11 @@ const useCommentsStore = defineStore("comments", () => {
|
|
|
3234
3277
|
comment?.trackedChangeAnchorKey,
|
|
3235
3278
|
comment?.commentId,
|
|
3236
3279
|
comment?.importedId,
|
|
3237
|
-
comment?.trackedChange ? buildTrackedChangeImportedPositionId(comment?.importedId) : null
|
|
3280
|
+
comment?.trackedChange ? buildTrackedChangeImportedPositionId(comment?.importedId) : null,
|
|
3281
|
+
...trackedChangePositionAliases.flatMap((id) => [trackedChangeStoryKey && !id.startsWith("tc::") ? makeTrackedChangeAnchorKey({
|
|
3282
|
+
storyKey: trackedChangeStoryKey,
|
|
3283
|
+
rawId: id
|
|
3284
|
+
}) : null, id])
|
|
3238
3285
|
].map((id) => normalizeCommentId(id)).filter((id) => {
|
|
3239
3286
|
if (!id || seen.has(id)) return false;
|
|
3240
3287
|
seen.add(id);
|
|
@@ -3243,12 +3290,13 @@ const useCommentsStore = defineStore("comments", () => {
|
|
|
3243
3290
|
};
|
|
3244
3291
|
const resolveCommentPositionEntry = (commentOrId, preferredId) => {
|
|
3245
3292
|
const currentPositions = editorCommentPositions.value || {};
|
|
3293
|
+
const comment = typeof commentOrId === "object" ? commentOrId : getComment(commentOrId);
|
|
3246
3294
|
const seen = /* @__PURE__ */ new Set();
|
|
3247
3295
|
for (const key of [preferredId, ...getCommentAliasIds(commentOrId)].map((id) => normalizeCommentId(id)).filter(Boolean)) {
|
|
3248
3296
|
if (seen.has(key)) continue;
|
|
3249
3297
|
seen.add(key);
|
|
3250
3298
|
const entry = currentPositions[key];
|
|
3251
|
-
if (entry !== void 0) return {
|
|
3299
|
+
if (entry !== void 0 && positionEntryMatchesTrackedChangeStory(entry, comment)) return {
|
|
3252
3300
|
key,
|
|
3253
3301
|
entry
|
|
3254
3302
|
};
|
|
@@ -3487,9 +3535,11 @@ const useCommentsStore = defineStore("comments", () => {
|
|
|
3487
3535
|
documentId: params?.documentId ?? null
|
|
3488
3536
|
});
|
|
3489
3537
|
try {
|
|
3490
|
-
const { event, changeId, trackedChangeText, trackedChangeType, trackedChangeDisplayType, semanticColorKey, semanticColor, deletedText, trackedChangeLabel, trackedChangeDetailLines, trackedChangeImagePreview, authorId, authorEmail, authorImage, date, author: authorName, importedAuthor, documentId, coords, trackedChangeStory, trackedChangeStoryKind, trackedChangeStoryLabel, trackedChangeAnchorKey, trackedChangeCanonicalId, importedId } = params;
|
|
3538
|
+
const { event, changeId, trackedChangeText, trackedChangeType, trackedChangeDisplayType, semanticColorKey, semanticColor, deletedText, trackedChangeLabel, trackedChangeDetailLines, trackedChangeImagePreview, authorId, authorEmail, authorImage, date, author: authorName, importedAuthor, documentId, coords, trackedChangeStory, trackedChangeStoryKind, trackedChangeStoryLabel, trackedChangeAnchorKey, trackedChangeCanonicalId, trackedChangePositionAliases, importedId } = params;
|
|
3491
3539
|
const normalizedChangeId = changeId != null ? String(changeId) : null;
|
|
3492
3540
|
const normalizedTrackedChangeCanonicalId = trackedChangeCanonicalId != null ? String(trackedChangeCanonicalId) : null;
|
|
3541
|
+
const hasTrackedChangePositionAliases = Object.prototype.hasOwnProperty.call(params, "trackedChangePositionAliases");
|
|
3542
|
+
const normalizedTrackedChangePositionAliases = hasTrackedChangePositionAliases ? normalizeTrackedChangePositionAliases(trackedChangePositionAliases) : void 0;
|
|
3493
3543
|
const hasImportedId = Object.prototype.hasOwnProperty.call(params, "importedId");
|
|
3494
3544
|
const normalizedImportedId = hasImportedId ? importedId != null ? String(importedId) : null : void 0;
|
|
3495
3545
|
const normalizedDocumentId = documentId != null ? String(documentId) : null;
|
|
@@ -3547,6 +3597,7 @@ const useCommentsStore = defineStore("comments", () => {
|
|
|
3547
3597
|
trackedChangeStoryLabel: normalizedTrackedChangeStoryLabel,
|
|
3548
3598
|
trackedChangeAnchorKey: normalizedTrackedChangeAnchorKey,
|
|
3549
3599
|
trackedChangeCanonicalId: normalizedTrackedChangeCanonicalId,
|
|
3600
|
+
...hasTrackedChangePositionAliases ? { trackedChangePositionAliases: normalizedTrackedChangePositionAliases } : {},
|
|
3550
3601
|
selection: {
|
|
3551
3602
|
source: DOCUMENT_EDITOR_SELECTION_SOURCE,
|
|
3552
3603
|
selectionBounds: coords
|
|
@@ -3607,6 +3658,7 @@ const useCommentsStore = defineStore("comments", () => {
|
|
|
3607
3658
|
createdTime: date ?? null
|
|
3608
3659
|
};
|
|
3609
3660
|
if (hasImportedId) fields.importedId = normalizedImportedId;
|
|
3661
|
+
if (hasTrackedChangePositionAliases) fields.trackedChangePositionAliases = normalizedTrackedChangePositionAliases;
|
|
3610
3662
|
let didChange = false;
|
|
3611
3663
|
for (const [key, value] of Object.entries(fields)) didChange = setIfChanged(target, key, value) || didChange;
|
|
3612
3664
|
if (target && !(target.trackedChangeDetailLines == null && normalizedTrackedChangeDetailLines == null) && !trackedChangeDetailLinesEqual(target.trackedChangeDetailLines, normalizedTrackedChangeDetailLines)) {
|
|
@@ -9713,304 +9765,6 @@ var _sfc_main$27 = {
|
|
|
9713
9765
|
}
|
|
9714
9766
|
};
|
|
9715
9767
|
var WhiteboardLayer_default = /* @__PURE__ */ require__plugin_vue_export_helper.__plugin_vue_export_helper_default(_sfc_main$27, [["__scopeId", "data-v-54546c3d"]]);
|
|
9716
|
-
var FALLBACK_PALETTE = [
|
|
9717
|
-
"#1f6feb",
|
|
9718
|
-
"#d1242f",
|
|
9719
|
-
"#8250df",
|
|
9720
|
-
"#bf3989",
|
|
9721
|
-
"#1a7f37",
|
|
9722
|
-
"#9a6700",
|
|
9723
|
-
"#bc4c00",
|
|
9724
|
-
"#0969da",
|
|
9725
|
-
"#cf222e",
|
|
9726
|
-
"#6639ba",
|
|
9727
|
-
"#116329",
|
|
9728
|
-
"#7d4e00"
|
|
9729
|
-
];
|
|
9730
|
-
const authorIdentityKey = (author) => {
|
|
9731
|
-
if (!author) return "";
|
|
9732
|
-
return `${typeof author.name === "string" ? author.name : ""} ${typeof author.email === "string" ? author.email : ""}`;
|
|
9733
|
-
};
|
|
9734
|
-
var hashString = (value) => {
|
|
9735
|
-
let hash = 2166136261;
|
|
9736
|
-
for (let i = 0; i < value.length; i += 1) {
|
|
9737
|
-
hash ^= value.charCodeAt(i);
|
|
9738
|
-
hash = Math.imul(hash, 16777619);
|
|
9739
|
-
}
|
|
9740
|
-
return hash >>> 0;
|
|
9741
|
-
};
|
|
9742
|
-
const fallbackAuthorColor = (author) => {
|
|
9743
|
-
return FALLBACK_PALETTE[hashString(authorIdentityKey(author)) % FALLBACK_PALETTE.length];
|
|
9744
|
-
};
|
|
9745
|
-
var isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
|
|
9746
|
-
const composeAuthorColorResolver = (config) => {
|
|
9747
|
-
if (!config || config.enabled === false) return void 0;
|
|
9748
|
-
const overrides = config.overrides && typeof config.overrides === "object" ? config.overrides : void 0;
|
|
9749
|
-
const resolve = typeof config.resolve === "function" ? config.resolve : void 0;
|
|
9750
|
-
return (author) => {
|
|
9751
|
-
const safeAuthor = author ?? {};
|
|
9752
|
-
if (overrides) {
|
|
9753
|
-
if (isNonEmptyString(safeAuthor.email) && isNonEmptyString(overrides[safeAuthor.email])) return overrides[safeAuthor.email];
|
|
9754
|
-
if (isNonEmptyString(safeAuthor.name) && isNonEmptyString(overrides[safeAuthor.name])) return overrides[safeAuthor.name];
|
|
9755
|
-
}
|
|
9756
|
-
if (resolve) try {
|
|
9757
|
-
const resolved = resolve(safeAuthor);
|
|
9758
|
-
if (isNonEmptyString(resolved)) return resolved;
|
|
9759
|
-
} catch {}
|
|
9760
|
-
return fallbackAuthorColor(safeAuthor);
|
|
9761
|
-
};
|
|
9762
|
-
};
|
|
9763
|
-
const TRACKED_CHANGE_CONFIGURABLE_SEMANTIC_COLOR_KEYS = [
|
|
9764
|
-
"insertion",
|
|
9765
|
-
"deletion",
|
|
9766
|
-
"move",
|
|
9767
|
-
"move-from",
|
|
9768
|
-
"move-to",
|
|
9769
|
-
"table-cell-insertion",
|
|
9770
|
-
"table-cell-deletion",
|
|
9771
|
-
"cell-merge",
|
|
9772
|
-
"cell-split",
|
|
9773
|
-
"image-insertion",
|
|
9774
|
-
"image-deletion",
|
|
9775
|
-
"image-property-change"
|
|
9776
|
-
];
|
|
9777
|
-
var CONFIGURABLE_SEMANTIC_COLOR_KEY_SET = new Set(TRACKED_CHANGE_CONFIGURABLE_SEMANTIC_COLOR_KEYS);
|
|
9778
|
-
const DRAWING_DIAGNOSTIC_CODES = {
|
|
9779
|
-
externalImageDeferred: "render.media.external-image-deferred",
|
|
9780
|
-
missingRelationship: "render.drawing.missing-relationship",
|
|
9781
|
-
missingMediaPart: "render.media.missing-part",
|
|
9782
|
-
unsupportedRelationshipType: "render.drawing.unsupported-relationship-type",
|
|
9783
|
-
unsupportedMime: "render.media.unsupported-mime",
|
|
9784
|
-
imageTooLarge: "render.media.image-too-large",
|
|
9785
|
-
unsafeSvg: "render.media.unsafe-svg",
|
|
9786
|
-
unsupportedFormat: "render.media.unsupported-format",
|
|
9787
|
-
embeddedObjectNotSupported: "render.embedded-object-not-supported",
|
|
9788
|
-
unsupportedObject: "render.drawing.unsupported-object",
|
|
9789
|
-
vmlUnsupported: "render.drawing.vml-unsupported",
|
|
9790
|
-
vmlImageUnsupported: "render.drawing.vml-image-unsupported",
|
|
9791
|
-
unsupportedGeometryCommand: "render.drawing.unsupported-geometry-command",
|
|
9792
|
-
anchorUnsupported: "render.drawing.anchor-unsupported",
|
|
9793
|
-
wrapUnsupported: "render.drawing.wrap-unsupported",
|
|
9794
|
-
altContentNoSupportedChoice: "render.drawing.altcontent-no-supported-choice",
|
|
9795
|
-
groupChildUnsupported: "render.drawing.group-child-unsupported"
|
|
9796
|
-
};
|
|
9797
|
-
const DRAWING_DIAGNOSTIC_CODE_ALIASES = {
|
|
9798
|
-
"render.media.missing-relationship": DRAWING_DIAGNOSTIC_CODES.missingRelationship,
|
|
9799
|
-
"render.media.wrong-relationship-type": DRAWING_DIAGNOSTIC_CODES.unsupportedRelationshipType,
|
|
9800
|
-
"render.media.unsupported-target": DRAWING_DIAGNOSTIC_CODES.unsupportedRelationshipType,
|
|
9801
|
-
"render.media.invalid-image-size": DRAWING_DIAGNOSTIC_CODES.imageTooLarge,
|
|
9802
|
-
"render.media-resolver-unavailable": DRAWING_DIAGNOSTIC_CODES.missingMediaPart,
|
|
9803
|
-
"render.chart-not-supported": DRAWING_DIAGNOSTIC_CODES.unsupportedObject,
|
|
9804
|
-
"render.textbox.vml-unsupported": DRAWING_DIAGNOSTIC_CODES.vmlUnsupported
|
|
9805
|
-
};
|
|
9806
|
-
const DRAWING_SUPPORT_TAXONOMY = {
|
|
9807
|
-
inlineBitmap: {
|
|
9808
|
-
family: "inlineBitmap",
|
|
9809
|
-
support: "supported",
|
|
9810
|
-
description: "wp:inline pic:pic with internal media and browser-safe MIME (PNG/JPEG; WebP/SVG once the host media resolver lands).",
|
|
9811
|
-
contract: "ImageRun"
|
|
9812
|
-
},
|
|
9813
|
-
anchoredBitmap: {
|
|
9814
|
-
family: "anchoredBitmap",
|
|
9815
|
-
support: "supported",
|
|
9816
|
-
description: "wp:anchor bitmap with anchor/wrap expressible by ImageAnchor/ImageWrap. Never silently inlined.",
|
|
9817
|
-
contract: "ImageBlock"
|
|
9818
|
-
},
|
|
9819
|
-
imageChildInGroup: {
|
|
9820
|
-
family: "imageChildInGroup",
|
|
9821
|
-
support: "supported",
|
|
9822
|
-
description: "Bitmap child of a supported DrawingML group/drawing wrapper. Supported only when the parent is.",
|
|
9823
|
-
contract: "ImageDrawing"
|
|
9824
|
-
},
|
|
9825
|
-
vectorShape: {
|
|
9826
|
-
family: "vectorShape",
|
|
9827
|
-
support: "supported",
|
|
9828
|
-
description: "Block/floating DrawingML preset/custom shape with the supported geometry/style subset.",
|
|
9829
|
-
contract: "DrawingBlock",
|
|
9830
|
-
drawingKind: "vectorShape"
|
|
9831
|
-
},
|
|
9832
|
-
shapeGroup: {
|
|
9833
|
-
family: "shapeGroup",
|
|
9834
|
-
support: "supported",
|
|
9835
|
-
description: "DrawingML group whose rendered children are supported vector/image children.",
|
|
9836
|
-
contract: "DrawingBlock",
|
|
9837
|
-
drawingKind: "shapeGroup"
|
|
9838
|
-
},
|
|
9839
|
-
chart: {
|
|
9840
|
-
family: "chart",
|
|
9841
|
-
support: "supported",
|
|
9842
|
-
description: "DrawingML chart projected into a ChartDrawing with parsed cached chart XML data. Complete Word chart fidelity remains deferred to chartFidelity.",
|
|
9843
|
-
contract: "DrawingBlock",
|
|
9844
|
-
drawingKind: "chart"
|
|
9845
|
-
},
|
|
9846
|
-
alternateContent: {
|
|
9847
|
-
family: "alternateContent",
|
|
9848
|
-
support: "supported",
|
|
9849
|
-
description: "mc:AlternateContent traversal/select policy. Selected Choice/Fallback maps to its family contract; unselected branches preserved for save/reopen.",
|
|
9850
|
-
contract: "selected-choice"
|
|
9851
|
-
},
|
|
9852
|
-
externalImage: {
|
|
9853
|
-
family: "externalImage",
|
|
9854
|
-
support: "fail-closed",
|
|
9855
|
-
description: "External image relationship (r:link / TargetMode=\"External\"). Not fetched.",
|
|
9856
|
-
contract: "none",
|
|
9857
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.externalImageDeferred
|
|
9858
|
-
},
|
|
9859
|
-
missingRelationship: {
|
|
9860
|
-
family: "missingRelationship",
|
|
9861
|
-
support: "fail-closed",
|
|
9862
|
-
description: "Drawing references a relationship id absent from the owner part .rels.",
|
|
9863
|
-
contract: "none",
|
|
9864
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.missingRelationship
|
|
9865
|
-
},
|
|
9866
|
-
missingMediaPart: {
|
|
9867
|
-
family: "missingMediaPart",
|
|
9868
|
-
support: "fail-closed",
|
|
9869
|
-
description: "Relationship resolves but the target media part bytes are missing or empty.",
|
|
9870
|
-
contract: "none",
|
|
9871
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.missingMediaPart
|
|
9872
|
-
},
|
|
9873
|
-
wrongRelationshipType: {
|
|
9874
|
-
family: "wrongRelationshipType",
|
|
9875
|
-
support: "fail-closed",
|
|
9876
|
-
description: "Relationship exists but is not an image relationship type.",
|
|
9877
|
-
contract: "none",
|
|
9878
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.unsupportedRelationshipType
|
|
9879
|
-
},
|
|
9880
|
-
unsupportedMime: {
|
|
9881
|
-
family: "unsupportedMime",
|
|
9882
|
-
support: "fail-closed",
|
|
9883
|
-
description: "Media MIME outside the supported allowlist (incl. GIF/BMP/ICO).",
|
|
9884
|
-
contract: "none",
|
|
9885
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.unsupportedMime
|
|
9886
|
-
},
|
|
9887
|
-
oversizedMediaPart: {
|
|
9888
|
-
family: "oversizedMediaPart",
|
|
9889
|
-
support: "fail-closed",
|
|
9890
|
-
description: "Media part exceeds the host byte-size policy before bytes are materialized.",
|
|
9891
|
-
contract: "none",
|
|
9892
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.imageTooLarge
|
|
9893
|
-
},
|
|
9894
|
-
unsafeSvg: {
|
|
9895
|
-
family: "unsafeSvg",
|
|
9896
|
-
support: "fail-closed",
|
|
9897
|
-
description: "SVG content rejected by the SVG safety policy.",
|
|
9898
|
-
contract: "none",
|
|
9899
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.unsafeSvg
|
|
9900
|
-
},
|
|
9901
|
-
metafileOrTiff: {
|
|
9902
|
-
family: "metafileOrTiff",
|
|
9903
|
-
support: "fail-closed",
|
|
9904
|
-
description: "EMF/WMF/TIFF and other non-browser-native formats with no approved conversion path.",
|
|
9905
|
-
contract: "none",
|
|
9906
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.unsupportedFormat
|
|
9907
|
-
},
|
|
9908
|
-
embeddedObject: {
|
|
9909
|
-
family: "embeddedObject",
|
|
9910
|
-
support: "fail-closed",
|
|
9911
|
-
description: "OLE / ActiveX / embedded package object.",
|
|
9912
|
-
contract: "none",
|
|
9913
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.embeddedObjectNotSupported
|
|
9914
|
-
},
|
|
9915
|
-
smartArtOrDiagram: {
|
|
9916
|
-
family: "smartArtOrDiagram",
|
|
9917
|
-
support: "fail-closed",
|
|
9918
|
-
description: "SmartArt / diagram / unknown external graphic-data object.",
|
|
9919
|
-
contract: "none",
|
|
9920
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.unsupportedObject
|
|
9921
|
-
},
|
|
9922
|
-
vml: {
|
|
9923
|
-
family: "vml",
|
|
9924
|
-
support: "fail-closed",
|
|
9925
|
-
description: "VML structure outside any supported image-like subset (default fail-closed policy).",
|
|
9926
|
-
contract: "none",
|
|
9927
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.vmlUnsupported
|
|
9928
|
-
},
|
|
9929
|
-
vmlImageLike: {
|
|
9930
|
-
family: "vmlImageLike",
|
|
9931
|
-
support: "fail-closed",
|
|
9932
|
-
description: "Simple VML image references (v:imagedata) / watermark image metadata. Fail-closed unless a later change promotes a named subset with deterministic fixtures and exact oracles.",
|
|
9933
|
-
contract: "none",
|
|
9934
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.vmlImageUnsupported
|
|
9935
|
-
},
|
|
9936
|
-
unsupportedGeometryCommand: {
|
|
9937
|
-
family: "unsupportedGeometryCommand",
|
|
9938
|
-
support: "fail-closed",
|
|
9939
|
-
description: "Custom geometry command the extractor does not implement, e.g. arcTo.",
|
|
9940
|
-
contract: "none",
|
|
9941
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.unsupportedGeometryCommand
|
|
9942
|
-
},
|
|
9943
|
-
unsupportedAnchorFields: {
|
|
9944
|
-
family: "unsupportedAnchorFields",
|
|
9945
|
-
support: "fail-closed",
|
|
9946
|
-
description: "Anchor fields required for honest placement are unsupported (char-relative, alignment modes, etc.).",
|
|
9947
|
-
contract: "none",
|
|
9948
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.anchorUnsupported
|
|
9949
|
-
},
|
|
9950
|
-
unsupportedWrapFields: {
|
|
9951
|
-
family: "unsupportedWrapFields",
|
|
9952
|
-
support: "fail-closed",
|
|
9953
|
-
description: "Wrap fields required for honest placement are unsupported (arbitrary wrap polygons, etc.).",
|
|
9954
|
-
contract: "none",
|
|
9955
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.wrapUnsupported
|
|
9956
|
-
},
|
|
9957
|
-
alternateContentNoSupportedChoice: {
|
|
9958
|
-
family: "alternateContentNoSupportedChoice",
|
|
9959
|
-
support: "fail-closed",
|
|
9960
|
-
description: "mc:AlternateContent with no supported choice and no usable fallback.",
|
|
9961
|
-
contract: "none",
|
|
9962
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.altContentNoSupportedChoice
|
|
9963
|
-
},
|
|
9964
|
-
groupChildUnsupported: {
|
|
9965
|
-
family: "groupChildUnsupported",
|
|
9966
|
-
support: "fail-closed",
|
|
9967
|
-
description: "Unsupported child inside an otherwise-supported group. Supported siblings are not dropped.",
|
|
9968
|
-
contract: "none",
|
|
9969
|
-
diagnostic: DRAWING_DIAGNOSTIC_CODES.groupChildUnsupported
|
|
9970
|
-
},
|
|
9971
|
-
objectEditing: {
|
|
9972
|
-
family: "objectEditing",
|
|
9973
|
-
support: "deferred",
|
|
9974
|
-
description: "Editing/mutation of anchored/vector objects.",
|
|
9975
|
-
contract: "none"
|
|
9976
|
-
},
|
|
9977
|
-
customWrapPolygon: {
|
|
9978
|
-
family: "customWrapPolygon",
|
|
9979
|
-
support: "deferred",
|
|
9980
|
-
description: "Full Word-compatible text wrapping for arbitrary custom wrap polygons.",
|
|
9981
|
-
contract: "none"
|
|
9982
|
-
},
|
|
9983
|
-
chartFidelity: {
|
|
9984
|
-
family: "chartFidelity",
|
|
9985
|
-
support: "deferred",
|
|
9986
|
-
description: "Complete chart fidelity (a dedicated chart effort owns the parsed subset).",
|
|
9987
|
-
contract: "none"
|
|
9988
|
-
},
|
|
9989
|
-
vmlFidelity: {
|
|
9990
|
-
family: "vmlFidelity",
|
|
9991
|
-
support: "deferred",
|
|
9992
|
-
description: "Complete VML fidelity.",
|
|
9993
|
-
contract: "none"
|
|
9994
|
-
},
|
|
9995
|
-
decorativeAccessibilityUi: {
|
|
9996
|
-
family: "decorativeAccessibilityUi",
|
|
9997
|
-
support: "deferred",
|
|
9998
|
-
description: "Full accessibility UI for decorative image semantics beyond preserving source data.",
|
|
9999
|
-
contract: "none"
|
|
10000
|
-
}
|
|
10001
|
-
};
|
|
10002
|
-
const DRAWING_FAMILIES = Object.keys(DRAWING_SUPPORT_TAXONOMY);
|
|
10003
|
-
const PAGE_CHECKPOINT_DEPENDENCY_CLASSES = Object.freeze([
|
|
10004
|
-
"multiple-sections",
|
|
10005
|
-
"furniture-page-tokens",
|
|
10006
|
-
"non-balanceable-multi-column-sections",
|
|
10007
|
-
"body-anchored-objects",
|
|
10008
|
-
"footnotes",
|
|
10009
|
-
"page-references",
|
|
10010
|
-
"keep-constraints",
|
|
10011
|
-
"tables",
|
|
10012
|
-
"furniture-anchored-objects"
|
|
10013
|
-
]);
|
|
10014
9768
|
var _hoisted_1$20 = { class: "superdoc-html-viewer" };
|
|
10015
9769
|
var _hoisted_2$17 = { class: "superdoc-html-viewer__document" };
|
|
10016
9770
|
var _hoisted_3$14 = ["innerHTML"];
|
|
@@ -15426,7 +15180,7 @@ var _sfc_main$20 = {
|
|
|
15426
15180
|
emitCommentPositionsInViewing: isViewingMode() && shouldRenderCommentsInViewing.value,
|
|
15427
15181
|
enableCommentsInViewing: isViewingCommentsVisible.value,
|
|
15428
15182
|
contentControlsChrome: proxy.$superdoc.config.modules?.contentControls?.chrome,
|
|
15429
|
-
resolveTrackedChangeColor: composeAuthorColorResolver(proxy.$superdoc.config.modules?.trackChanges?.authorColors)
|
|
15183
|
+
resolveTrackedChangeColor: require_create_super_doc_ui.composeAuthorColorResolver(proxy.$superdoc.config.modules?.trackChanges?.authorColors)
|
|
15430
15184
|
} : void 0,
|
|
15431
15185
|
permissionResolver: (payload = {}) => proxy.$superdoc.canPerformPermission({
|
|
15432
15186
|
role: proxy.$superdoc.config.role,
|
|
@@ -32600,7 +32354,11 @@ var _sfc_main$2 = {
|
|
|
32600
32354
|
}
|
|
32601
32355
|
};
|
|
32602
32356
|
var IconGrid_default = /* @__PURE__ */ require__plugin_vue_export_helper.__plugin_vue_export_helper_default(_sfc_main$2, [["__scopeId", "data-v-52b0283a"]]);
|
|
32603
|
-
const refocusEditorSurface = (superToolbar) => {
|
|
32357
|
+
const refocusEditorSurface = (superToolbar, preferredEditor = null) => {
|
|
32358
|
+
if (typeof preferredEditor?.focus === "function") {
|
|
32359
|
+
preferredEditor.focus();
|
|
32360
|
+
return;
|
|
32361
|
+
}
|
|
32604
32362
|
const focusHandle = superToolbar?.superdoc?.focus ?? superToolbar?.activeEditor?.focus;
|
|
32605
32363
|
if (typeof focusHandle === "function") {
|
|
32606
32364
|
focusHandle.call(superToolbar?.superdoc ?? superToolbar?.activeEditor);
|
|
@@ -33726,6 +33484,7 @@ const makeDefaultItems = ({ superToolbar, toolbarIcons: toolbarIcons$1, toolbarT
|
|
|
33726
33484
|
return (0, vue.h)(DocumentMode_default, {
|
|
33727
33485
|
options: getDocumentOptionsAfterRole(role, documentOptions),
|
|
33728
33486
|
onSelect: (item) => {
|
|
33487
|
+
const selectedEditor = superToolbar.superdoc?.activeEditor ?? superToolbar.activeEditor;
|
|
33729
33488
|
closeDropdown(renderDocumentButton);
|
|
33730
33489
|
const { label, icon, value } = item;
|
|
33731
33490
|
documentMode.label.value = label;
|
|
@@ -33734,6 +33493,7 @@ const makeDefaultItems = ({ superToolbar, toolbarIcons: toolbarIcons$1, toolbarT
|
|
|
33734
33493
|
item: documentMode,
|
|
33735
33494
|
argument: value
|
|
33736
33495
|
});
|
|
33496
|
+
refocusEditorSurface(superToolbar, selectedEditor);
|
|
33737
33497
|
}
|
|
33738
33498
|
});
|
|
33739
33499
|
}
|
|
@@ -34935,7 +34695,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
34935
34695
|
this.config.colors = shuffleArray(this.config.colors);
|
|
34936
34696
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
34937
34697
|
this.colorIndex = 0;
|
|
34938
|
-
this.version = "2.0.0-next.
|
|
34698
|
+
this.version = "2.0.0-next.34";
|
|
34939
34699
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
34940
34700
|
this.superdocId = config.superdocId || require_uuid.v4_default();
|
|
34941
34701
|
this.colors = this.config.colors ?? [];
|