superdoc 2.4.0-next.35 → 2.4.0-next.37
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/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/types/track-changes.types.d.ts +17 -0
- package/dist/superdoc.cjs +27 -2
- package/dist/superdoc.es.js +27 -2
- package/dist-cdn/superdoc.min.js +35 -35
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
19
19
|
var PRIVATE_ENGINE_INFO = (0, _superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
|
|
20
20
|
var ENGINE_INFO = Object.freeze({
|
|
21
21
|
...PRIVATE_ENGINE_INFO,
|
|
22
|
-
superdocVersion: "2.4.0-next.
|
|
22
|
+
superdocVersion: "2.4.0-next.37",
|
|
23
23
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
24
24
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
25
25
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -18,7 +18,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
18
18
|
var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
|
|
19
19
|
var ENGINE_INFO = Object.freeze({
|
|
20
20
|
...PRIVATE_ENGINE_INFO,
|
|
21
|
-
superdocVersion: "2.4.0-next.
|
|
21
|
+
superdocVersion: "2.4.0-next.37",
|
|
22
22
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
23
23
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
24
24
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -457,6 +457,16 @@ export interface TrackChangeNavigationTarget {
|
|
|
457
457
|
blockId: string;
|
|
458
458
|
role: 'primary' | 'move-source' | 'move-destination' | 'formatting-carrier' | 'structural-carrier';
|
|
459
459
|
}
|
|
460
|
+
export interface TrackChangeCustomAttribute {
|
|
461
|
+
/** Source-qualified attribute name, preserving the prefix used by the carrier. */
|
|
462
|
+
name: string;
|
|
463
|
+
/** Resolved extension namespace URI. */
|
|
464
|
+
namespaceUri: string;
|
|
465
|
+
/** Attribute local name without its namespace prefix. */
|
|
466
|
+
localName: string;
|
|
467
|
+
/** Decoded XML attribute value. */
|
|
468
|
+
value: string;
|
|
469
|
+
}
|
|
460
470
|
export interface TrackChangeInfo {
|
|
461
471
|
address: TrackedChangeAddress;
|
|
462
472
|
/** Stable SuperDoc logical tracked-change id (spec §3 / §4). */
|
|
@@ -569,6 +579,11 @@ export interface TrackChangeInfo {
|
|
|
569
579
|
* tracked changes. Absent when the change is standalone.
|
|
570
580
|
*/
|
|
571
581
|
overlap?: TrackChangeOverlapInfo;
|
|
582
|
+
/**
|
|
583
|
+
* Unknown extension attributes attached to contributing OOXML revision carriers.
|
|
584
|
+
* Exact duplicates are removed in document order; conflicting values are retained.
|
|
585
|
+
*/
|
|
586
|
+
readonly customAttributes?: readonly TrackChangeCustomAttribute[];
|
|
572
587
|
}
|
|
573
588
|
export interface TrackChangesListQuery {
|
|
574
589
|
limit?: number;
|
|
@@ -694,6 +709,8 @@ export interface TrackChangeDomain {
|
|
|
694
709
|
* stack without an extra `trackChanges.get` round trip.
|
|
695
710
|
*/
|
|
696
711
|
overlap?: TrackChangeOverlapInfo;
|
|
712
|
+
/** Unknown extension attributes attached to the contributing OOXML revision carriers. */
|
|
713
|
+
readonly customAttributes?: readonly TrackChangeCustomAttribute[];
|
|
697
714
|
}
|
|
698
715
|
/**
|
|
699
716
|
* Standardized discovery output for `trackChanges.list`.
|
package/dist/superdoc.cjs
CHANGED
|
@@ -5737,6 +5737,7 @@ function useComment(params) {
|
|
|
5737
5737
|
const trackedChangeLabel = (0, vue.ref)(params.trackedChangeLabel || null);
|
|
5738
5738
|
const trackedChangeDetailLines = (0, vue.ref)(params.trackedChangeDetailLines || null);
|
|
5739
5739
|
const trackedChangeImagePreview = (0, vue.ref)(params.trackedChangeImagePreview || null);
|
|
5740
|
+
const customAttributes = (0, vue.ref)(params.customAttributes ?? null);
|
|
5740
5741
|
const resolvedTime = (0, vue.ref)(params.resolvedTime || null);
|
|
5741
5742
|
const resolvedById = (0, vue.ref)(params.resolvedById || null);
|
|
5742
5743
|
const resolvedByEmail = (0, vue.ref)(params.resolvedByEmail || null);
|
|
@@ -5974,6 +5975,7 @@ function useComment(params) {
|
|
|
5974
5975
|
trackedChangeLabel: trackedChangeLabel.value,
|
|
5975
5976
|
trackedChangeDetailLines: trackedChangeDetailLines.value,
|
|
5976
5977
|
trackedChangeImagePreview: trackedChangeImagePreview.value,
|
|
5978
|
+
customAttributes: customAttributes.value,
|
|
5977
5979
|
deletedText: deletedText.value,
|
|
5978
5980
|
resolvedTime: resolvedTime.value,
|
|
5979
5981
|
resolvedById: resolvedById.value,
|
|
@@ -6024,6 +6026,7 @@ function useComment(params) {
|
|
|
6024
6026
|
trackedChangeLabel,
|
|
6025
6027
|
trackedChangeDetailLines,
|
|
6026
6028
|
trackedChangeImagePreview,
|
|
6029
|
+
customAttributes,
|
|
6027
6030
|
resolvedTime,
|
|
6028
6031
|
resolvedById,
|
|
6029
6032
|
resolvedByEmail,
|
|
@@ -7089,6 +7092,20 @@ var trackedChangeDetailLinesEqual = (a, b) => {
|
|
|
7089
7092
|
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
7090
7093
|
return a.every((line, index) => shallowEqual(line, b[index]));
|
|
7091
7094
|
};
|
|
7095
|
+
var normalizeTrackedChangeCustomAttributes = (attributes) => {
|
|
7096
|
+
if (!Array.isArray(attributes)) return null;
|
|
7097
|
+
return attributes.filter((attribute) => attribute && typeof attribute === "object").map((attribute) => ({
|
|
7098
|
+
name: typeof attribute.name === "string" ? attribute.name : "",
|
|
7099
|
+
namespaceUri: typeof attribute.namespaceUri === "string" ? attribute.namespaceUri : "",
|
|
7100
|
+
localName: typeof attribute.localName === "string" ? attribute.localName : "",
|
|
7101
|
+
value: typeof attribute.value === "string" ? attribute.value : ""
|
|
7102
|
+
})).filter((attribute) => attribute.name && attribute.namespaceUri && attribute.localName);
|
|
7103
|
+
};
|
|
7104
|
+
var trackedChangeCustomAttributesEqual = (left, right) => {
|
|
7105
|
+
if (left === right) return true;
|
|
7106
|
+
if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) return false;
|
|
7107
|
+
return left.every((attribute, index) => shallowEqual(attribute, right[index]));
|
|
7108
|
+
};
|
|
7092
7109
|
var normalizeTrackedChangeImagePreview = (preview) => {
|
|
7093
7110
|
if (!preview || typeof preview !== "object") return null;
|
|
7094
7111
|
const src = typeof preview.src === "string" ? preview.src : null;
|
|
@@ -7815,12 +7832,14 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
7815
7832
|
documentId: params?.documentId ?? null
|
|
7816
7833
|
});
|
|
7817
7834
|
try {
|
|
7818
|
-
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;
|
|
7835
|
+
const { event, changeId, trackedChangeText, trackedChangeType, trackedChangeDisplayType, semanticColorKey, semanticColor, deletedText, trackedChangeLabel, trackedChangeDetailLines, trackedChangeImagePreview, customAttributes, authorId, authorEmail, authorImage, date, author: authorName, importedAuthor, documentId, coords, trackedChangeStory, trackedChangeStoryKind, trackedChangeStoryLabel, trackedChangeAnchorKey, trackedChangeCanonicalId, trackedChangePositionAliases, importedId } = params;
|
|
7819
7836
|
const normalizedChangeId = changeId != null ? String(changeId) : null;
|
|
7820
7837
|
const normalizedTrackedChangeCanonicalId = trackedChangeCanonicalId != null ? String(trackedChangeCanonicalId) : null;
|
|
7821
7838
|
const hasTrackedChangePositionAliases = Object.prototype.hasOwnProperty.call(params, "trackedChangePositionAliases");
|
|
7822
7839
|
const normalizedTrackedChangePositionAliases = hasTrackedChangePositionAliases ? normalizeTrackedChangePositionAliases(trackedChangePositionAliases) : void 0;
|
|
7823
7840
|
const hasImportedId = Object.prototype.hasOwnProperty.call(params, "importedId");
|
|
7841
|
+
const hasCustomAttributes = Object.prototype.hasOwnProperty.call(params, "customAttributes");
|
|
7842
|
+
const normalizedCustomAttributes = hasCustomAttributes ? normalizeTrackedChangeCustomAttributes(customAttributes) : void 0;
|
|
7824
7843
|
const normalizedImportedId = hasImportedId ? importedId != null ? String(importedId) : null : void 0;
|
|
7825
7844
|
const normalizedDocumentId = documentId != null ? String(documentId) : null;
|
|
7826
7845
|
if (!(trackedChangeDisplayType === "tableInsert" || trackedChangeDisplayType === "tableDelete") && normalizedChangeId) {
|
|
@@ -7864,6 +7883,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
7864
7883
|
trackedChangeLabel: normalizedTrackedChangeLabel,
|
|
7865
7884
|
trackedChangeDetailLines: normalizedTrackedChangeDetailLines,
|
|
7866
7885
|
trackedChangeImagePreview: normalizedTrackedChangeImagePreview,
|
|
7886
|
+
...hasCustomAttributes ? { customAttributes: normalizedCustomAttributes } : {},
|
|
7867
7887
|
createdTime: date,
|
|
7868
7888
|
creatorId: authorId ?? null,
|
|
7869
7889
|
creatorName: authorName,
|
|
@@ -7979,6 +7999,10 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
7979
7999
|
target.trackedChangeDetailLines = normalizedTrackedChangeDetailLines;
|
|
7980
8000
|
didChange = true;
|
|
7981
8001
|
}
|
|
8002
|
+
if (hasCustomAttributes && target && !trackedChangeCustomAttributesEqual(target.customAttributes, normalizedCustomAttributes)) {
|
|
8003
|
+
target.customAttributes = normalizedCustomAttributes;
|
|
8004
|
+
didChange = true;
|
|
8005
|
+
}
|
|
7982
8006
|
return applyStoryMetadata(target) || didChange;
|
|
7983
8007
|
};
|
|
7984
8008
|
const updateExistingTrackedChange = (trackedComment) => {
|
|
@@ -8673,6 +8697,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
8673
8697
|
trackedChangeLabel: typeof params.trackedChangeLabel === "string" && params.trackedChangeLabel.length > 0 ? params.trackedChangeLabel : null,
|
|
8674
8698
|
trackedChangeDetailLines: normalizeTrackedChangeDetailLines(params.trackedChangeDetailLines),
|
|
8675
8699
|
trackedChangeImagePreview: normalizeTrackedChangeImagePreview(params.trackedChangeImagePreview),
|
|
8700
|
+
...Object.prototype.hasOwnProperty.call(params, "customAttributes") ? { customAttributes: normalizeTrackedChangeCustomAttributes(params.customAttributes) } : {},
|
|
8676
8701
|
createdTime: params.date,
|
|
8677
8702
|
creatorId: params.authorId ?? null,
|
|
8678
8703
|
creatorName: params.author,
|
|
@@ -43235,7 +43260,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
43235
43260
|
this.config.colors = shuffleArray(this.config.colors);
|
|
43236
43261
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
43237
43262
|
this.colorIndex = 0;
|
|
43238
|
-
this.version = "2.4.0-next.
|
|
43263
|
+
this.version = "2.4.0-next.37";
|
|
43239
43264
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
43240
43265
|
this.superdocId = config.superdocId || require_uuid.v4();
|
|
43241
43266
|
this.colors = this.config.colors ?? [];
|
package/dist/superdoc.es.js
CHANGED
|
@@ -5736,6 +5736,7 @@ function useComment(params) {
|
|
|
5736
5736
|
const trackedChangeLabel = ref(params.trackedChangeLabel || null);
|
|
5737
5737
|
const trackedChangeDetailLines = ref(params.trackedChangeDetailLines || null);
|
|
5738
5738
|
const trackedChangeImagePreview = ref(params.trackedChangeImagePreview || null);
|
|
5739
|
+
const customAttributes = ref(params.customAttributes ?? null);
|
|
5739
5740
|
const resolvedTime = ref(params.resolvedTime || null);
|
|
5740
5741
|
const resolvedById = ref(params.resolvedById || null);
|
|
5741
5742
|
const resolvedByEmail = ref(params.resolvedByEmail || null);
|
|
@@ -5973,6 +5974,7 @@ function useComment(params) {
|
|
|
5973
5974
|
trackedChangeLabel: trackedChangeLabel.value,
|
|
5974
5975
|
trackedChangeDetailLines: trackedChangeDetailLines.value,
|
|
5975
5976
|
trackedChangeImagePreview: trackedChangeImagePreview.value,
|
|
5977
|
+
customAttributes: customAttributes.value,
|
|
5976
5978
|
deletedText: deletedText.value,
|
|
5977
5979
|
resolvedTime: resolvedTime.value,
|
|
5978
5980
|
resolvedById: resolvedById.value,
|
|
@@ -6023,6 +6025,7 @@ function useComment(params) {
|
|
|
6023
6025
|
trackedChangeLabel,
|
|
6024
6026
|
trackedChangeDetailLines,
|
|
6025
6027
|
trackedChangeImagePreview,
|
|
6028
|
+
customAttributes,
|
|
6026
6029
|
resolvedTime,
|
|
6027
6030
|
resolvedById,
|
|
6028
6031
|
resolvedByEmail,
|
|
@@ -7088,6 +7091,20 @@ var trackedChangeDetailLinesEqual = (a, b) => {
|
|
|
7088
7091
|
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
7089
7092
|
return a.every((line, index) => shallowEqual(line, b[index]));
|
|
7090
7093
|
};
|
|
7094
|
+
var normalizeTrackedChangeCustomAttributes = (attributes) => {
|
|
7095
|
+
if (!Array.isArray(attributes)) return null;
|
|
7096
|
+
return attributes.filter((attribute) => attribute && typeof attribute === "object").map((attribute) => ({
|
|
7097
|
+
name: typeof attribute.name === "string" ? attribute.name : "",
|
|
7098
|
+
namespaceUri: typeof attribute.namespaceUri === "string" ? attribute.namespaceUri : "",
|
|
7099
|
+
localName: typeof attribute.localName === "string" ? attribute.localName : "",
|
|
7100
|
+
value: typeof attribute.value === "string" ? attribute.value : ""
|
|
7101
|
+
})).filter((attribute) => attribute.name && attribute.namespaceUri && attribute.localName);
|
|
7102
|
+
};
|
|
7103
|
+
var trackedChangeCustomAttributesEqual = (left, right) => {
|
|
7104
|
+
if (left === right) return true;
|
|
7105
|
+
if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) return false;
|
|
7106
|
+
return left.every((attribute, index) => shallowEqual(attribute, right[index]));
|
|
7107
|
+
};
|
|
7091
7108
|
var normalizeTrackedChangeImagePreview = (preview) => {
|
|
7092
7109
|
if (!preview || typeof preview !== "object") return null;
|
|
7093
7110
|
const src = typeof preview.src === "string" ? preview.src : null;
|
|
@@ -7814,12 +7831,14 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
7814
7831
|
documentId: params?.documentId ?? null
|
|
7815
7832
|
});
|
|
7816
7833
|
try {
|
|
7817
|
-
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;
|
|
7834
|
+
const { event, changeId, trackedChangeText, trackedChangeType, trackedChangeDisplayType, semanticColorKey, semanticColor, deletedText, trackedChangeLabel, trackedChangeDetailLines, trackedChangeImagePreview, customAttributes, authorId, authorEmail, authorImage, date, author: authorName, importedAuthor, documentId, coords, trackedChangeStory, trackedChangeStoryKind, trackedChangeStoryLabel, trackedChangeAnchorKey, trackedChangeCanonicalId, trackedChangePositionAliases, importedId } = params;
|
|
7818
7835
|
const normalizedChangeId = changeId != null ? String(changeId) : null;
|
|
7819
7836
|
const normalizedTrackedChangeCanonicalId = trackedChangeCanonicalId != null ? String(trackedChangeCanonicalId) : null;
|
|
7820
7837
|
const hasTrackedChangePositionAliases = Object.prototype.hasOwnProperty.call(params, "trackedChangePositionAliases");
|
|
7821
7838
|
const normalizedTrackedChangePositionAliases = hasTrackedChangePositionAliases ? normalizeTrackedChangePositionAliases(trackedChangePositionAliases) : void 0;
|
|
7822
7839
|
const hasImportedId = Object.prototype.hasOwnProperty.call(params, "importedId");
|
|
7840
|
+
const hasCustomAttributes = Object.prototype.hasOwnProperty.call(params, "customAttributes");
|
|
7841
|
+
const normalizedCustomAttributes = hasCustomAttributes ? normalizeTrackedChangeCustomAttributes(customAttributes) : void 0;
|
|
7823
7842
|
const normalizedImportedId = hasImportedId ? importedId != null ? String(importedId) : null : void 0;
|
|
7824
7843
|
const normalizedDocumentId = documentId != null ? String(documentId) : null;
|
|
7825
7844
|
if (!(trackedChangeDisplayType === "tableInsert" || trackedChangeDisplayType === "tableDelete") && normalizedChangeId) {
|
|
@@ -7863,6 +7882,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
7863
7882
|
trackedChangeLabel: normalizedTrackedChangeLabel,
|
|
7864
7883
|
trackedChangeDetailLines: normalizedTrackedChangeDetailLines,
|
|
7865
7884
|
trackedChangeImagePreview: normalizedTrackedChangeImagePreview,
|
|
7885
|
+
...hasCustomAttributes ? { customAttributes: normalizedCustomAttributes } : {},
|
|
7866
7886
|
createdTime: date,
|
|
7867
7887
|
creatorId: authorId ?? null,
|
|
7868
7888
|
creatorName: authorName,
|
|
@@ -7978,6 +7998,10 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
7978
7998
|
target.trackedChangeDetailLines = normalizedTrackedChangeDetailLines;
|
|
7979
7999
|
didChange = true;
|
|
7980
8000
|
}
|
|
8001
|
+
if (hasCustomAttributes && target && !trackedChangeCustomAttributesEqual(target.customAttributes, normalizedCustomAttributes)) {
|
|
8002
|
+
target.customAttributes = normalizedCustomAttributes;
|
|
8003
|
+
didChange = true;
|
|
8004
|
+
}
|
|
7981
8005
|
return applyStoryMetadata(target) || didChange;
|
|
7982
8006
|
};
|
|
7983
8007
|
const updateExistingTrackedChange = (trackedComment) => {
|
|
@@ -8672,6 +8696,7 @@ var useCommentsStore = defineStore("comments", () => {
|
|
|
8672
8696
|
trackedChangeLabel: typeof params.trackedChangeLabel === "string" && params.trackedChangeLabel.length > 0 ? params.trackedChangeLabel : null,
|
|
8673
8697
|
trackedChangeDetailLines: normalizeTrackedChangeDetailLines(params.trackedChangeDetailLines),
|
|
8674
8698
|
trackedChangeImagePreview: normalizeTrackedChangeImagePreview(params.trackedChangeImagePreview),
|
|
8699
|
+
...Object.prototype.hasOwnProperty.call(params, "customAttributes") ? { customAttributes: normalizeTrackedChangeCustomAttributes(params.customAttributes) } : {},
|
|
8675
8700
|
createdTime: params.date,
|
|
8676
8701
|
creatorId: params.authorId ?? null,
|
|
8677
8702
|
creatorName: params.author,
|
|
@@ -43168,7 +43193,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
43168
43193
|
this.config.colors = shuffleArray(this.config.colors);
|
|
43169
43194
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
43170
43195
|
this.colorIndex = 0;
|
|
43171
|
-
this.version = "2.4.0-next.
|
|
43196
|
+
this.version = "2.4.0-next.37";
|
|
43172
43197
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
43173
43198
|
this.superdocId = config.superdocId || v4();
|
|
43174
43199
|
this.colors = this.config.colors ?? [];
|