superdoc 2.28.0-next.13 → 2.28.0-next.14
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-B6Va_J_0.es.js → create-super-doc-ui-BRahDsch.es.js} +70 -0
- package/dist/chunks/{create-super-doc-ui-8dttPeGi.cjs → create-super-doc-ui-CFlvn2wr.cjs} +70 -0
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui-vue.cjs +1 -1
- package/dist/public/ui-vue.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/superdoc/src/public/ui/types.d.ts +19 -1
- package/dist/superdoc/src/public/ui.d.cts +4 -0
- package/dist/superdoc/src/public/ui.d.ts +1 -1
- package/dist/superdoc/src/stores/comments-store.d.ts +4 -7
- package/dist/superdoc/src/stores/superdoc-store.d.ts +12 -21
- package/dist/superdoc.cjs +7 -284
- package/dist/superdoc.es.js +7 -284
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +42 -42
- package/package.json +2 -2
package/dist/chunks/{create-super-doc-ui-B6Va_J_0.es.js → create-super-doc-ui-BRahDsch.es.js}
RENAMED
|
@@ -5774,6 +5774,43 @@ function mutationCommittedEventChangedDocument(event) {
|
|
|
5774
5774
|
if (receipt && typeof receipt === "object" && receipt.status === "NO_OP") return false;
|
|
5775
5775
|
return true;
|
|
5776
5776
|
}
|
|
5777
|
+
function readTxId(value) {
|
|
5778
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
5779
|
+
}
|
|
5780
|
+
function documentChangeScope(stories) {
|
|
5781
|
+
return Array.isArray(stories) && stories.length > 0 ? {
|
|
5782
|
+
kind: "known",
|
|
5783
|
+
stories
|
|
5784
|
+
} : { kind: "unknown" };
|
|
5785
|
+
}
|
|
5786
|
+
function documentChangeFromHostEvent(event) {
|
|
5787
|
+
if (event.type === "collaboration:remote-changed") return {
|
|
5788
|
+
cause: "remote",
|
|
5789
|
+
changeTag: null,
|
|
5790
|
+
txId: null,
|
|
5791
|
+
scope: { kind: "unknown" }
|
|
5792
|
+
};
|
|
5793
|
+
if (event.type !== "mutation:committed") return null;
|
|
5794
|
+
if (event.origin === "history") {
|
|
5795
|
+
const result = isPlainObject(event.result) ? event.result : null;
|
|
5796
|
+
if (!result || result.noop === true) return null;
|
|
5797
|
+
const history = isPlainObject(result.history) ? result.history : null;
|
|
5798
|
+
return {
|
|
5799
|
+
cause: event.direction === "redo" ? "redo" : "undo",
|
|
5800
|
+
changeTag: null,
|
|
5801
|
+
txId: readTxId(history?.txId),
|
|
5802
|
+
scope: documentChangeScope(result.affectedStories)
|
|
5803
|
+
};
|
|
5804
|
+
}
|
|
5805
|
+
if (!mutationCommittedEventChangedDocument(event)) return null;
|
|
5806
|
+
const receipt = isPlainObject(event.receipt) ? event.receipt : {};
|
|
5807
|
+
return {
|
|
5808
|
+
cause: event.cause === "user" ? "user" : "api",
|
|
5809
|
+
changeTag: typeof receipt.changeTag === "string" ? receipt.changeTag : null,
|
|
5810
|
+
txId: readTxId(receipt.txId),
|
|
5811
|
+
scope: documentChangeScope(receipt.affectedStories)
|
|
5812
|
+
};
|
|
5813
|
+
}
|
|
5777
5814
|
function commandResultSucceeded(result) {
|
|
5778
5815
|
if (result === false) return false;
|
|
5779
5816
|
if (result && typeof result === "object" && result.success === false) return false;
|
|
@@ -10195,6 +10232,25 @@ function createSuperDocUI(options) {
|
|
|
10195
10232
|
state = computeState("initial");
|
|
10196
10233
|
lastOptimisticInlineSelectionSignature = selectionInlineValueSignature(state.selection);
|
|
10197
10234
|
let scheduleActiveSearchRefresh = () => {};
|
|
10235
|
+
const documentChangeListeners = /* @__PURE__ */ new Set();
|
|
10236
|
+
let documentChangeEpoch = 0;
|
|
10237
|
+
let documentChangeSeq = 0;
|
|
10238
|
+
const startDocumentChangeEpoch = () => {
|
|
10239
|
+
documentChangeEpoch += 1;
|
|
10240
|
+
documentChangeSeq = 0;
|
|
10241
|
+
};
|
|
10242
|
+
const publishDocumentChange = (event) => {
|
|
10243
|
+
if (documentChangeListeners.size === 0) return;
|
|
10244
|
+
const facts = documentChangeFromHostEvent(event);
|
|
10245
|
+
if (!facts) return;
|
|
10246
|
+
documentChangeSeq += 1;
|
|
10247
|
+
const change = {
|
|
10248
|
+
documentEpoch: `document-${documentChangeEpoch}`,
|
|
10249
|
+
seq: documentChangeSeq,
|
|
10250
|
+
...facts
|
|
10251
|
+
};
|
|
10252
|
+
for (const listener of Array.from(documentChangeListeners)) safeCall(() => listener(change), void 0);
|
|
10253
|
+
};
|
|
10198
10254
|
const syncHostEventsSubscription = () => {
|
|
10199
10255
|
const host = getEditor()?.host;
|
|
10200
10256
|
const events = host?.events;
|
|
@@ -10213,6 +10269,8 @@ function createSuperDocUI(options) {
|
|
|
10213
10269
|
try {
|
|
10214
10270
|
const off = hostMethod(next, "subscribe")?.((event) => {
|
|
10215
10271
|
const type = event?.type;
|
|
10272
|
+
if (type === "collaboration:document-replaced") startDocumentChangeEpoch();
|
|
10273
|
+
publishDocumentChange(event);
|
|
10216
10274
|
const isStandaloneDocumentMutation = type === "document:mutated" && event.hasCommitEvent !== true;
|
|
10217
10275
|
if (type === "collaboration:document-replaced" || isStandaloneDocumentMutation || type === "mutation:committed" && mutationCommittedEventChangedDocument(event) || type === "collaboration:remote-changed") {
|
|
10218
10276
|
for (const [commandId, optimistic] of optimisticInlineToggles) if (optimistic.settled || type === "collaboration:document-replaced") optimisticInlineToggles.delete(commandId);
|
|
@@ -13764,8 +13822,14 @@ function createSuperDocUI(options) {
|
|
|
13764
13822
|
} catch {
|
|
13765
13823
|
return;
|
|
13766
13824
|
}
|
|
13825
|
+
},
|
|
13826
|
+
onChange: (listener) => {
|
|
13827
|
+
if (disposed) return () => {};
|
|
13828
|
+
documentChangeListeners.add(listener);
|
|
13829
|
+
return () => documentChangeListeners.delete(listener);
|
|
13767
13830
|
}
|
|
13768
13831
|
};
|
|
13832
|
+
documentResetHooks.push(startDocumentChangeEpoch);
|
|
13769
13833
|
const resolveVisibleHost = () => {
|
|
13770
13834
|
if (typeof HTMLElement === "undefined") return null;
|
|
13771
13835
|
const mountContainer = (getEditor()?.mount)?.container;
|
|
@@ -15246,6 +15310,11 @@ function createSuperDocUI(options) {
|
|
|
15246
15310
|
const scopeUnsubs = [];
|
|
15247
15311
|
return {
|
|
15248
15312
|
decorations: createDecorationsHandle((handle) => scopeUnsubs.push(() => handle.dispose())),
|
|
15313
|
+
document: { onChange: (listener) => {
|
|
15314
|
+
const unsub = documentHandle.onChange(listener);
|
|
15315
|
+
scopeUnsubs.push(unsub);
|
|
15316
|
+
return unsub;
|
|
15317
|
+
} },
|
|
15249
15318
|
select: (selector, equality) => {
|
|
15250
15319
|
const sub = select(selector, equality);
|
|
15251
15320
|
return {
|
|
@@ -15332,6 +15401,7 @@ function createSuperDocUI(options) {
|
|
|
15332
15401
|
painterCaptureEpoch += 1;
|
|
15333
15402
|
painterCommandDoc = null;
|
|
15334
15403
|
painterModeListeners.clear();
|
|
15404
|
+
documentChangeListeners.clear();
|
|
15335
15405
|
searchRequestGeneration += 1;
|
|
15336
15406
|
customCommands.clear();
|
|
15337
15407
|
};
|
|
@@ -5775,6 +5775,43 @@ function mutationCommittedEventChangedDocument(event) {
|
|
|
5775
5775
|
if (receipt && typeof receipt === "object" && receipt.status === "NO_OP") return false;
|
|
5776
5776
|
return true;
|
|
5777
5777
|
}
|
|
5778
|
+
function readTxId(value) {
|
|
5779
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
5780
|
+
}
|
|
5781
|
+
function documentChangeScope(stories) {
|
|
5782
|
+
return Array.isArray(stories) && stories.length > 0 ? {
|
|
5783
|
+
kind: "known",
|
|
5784
|
+
stories
|
|
5785
|
+
} : { kind: "unknown" };
|
|
5786
|
+
}
|
|
5787
|
+
function documentChangeFromHostEvent(event) {
|
|
5788
|
+
if (event.type === "collaboration:remote-changed") return {
|
|
5789
|
+
cause: "remote",
|
|
5790
|
+
changeTag: null,
|
|
5791
|
+
txId: null,
|
|
5792
|
+
scope: { kind: "unknown" }
|
|
5793
|
+
};
|
|
5794
|
+
if (event.type !== "mutation:committed") return null;
|
|
5795
|
+
if (event.origin === "history") {
|
|
5796
|
+
const result = isPlainObject(event.result) ? event.result : null;
|
|
5797
|
+
if (!result || result.noop === true) return null;
|
|
5798
|
+
const history = isPlainObject(result.history) ? result.history : null;
|
|
5799
|
+
return {
|
|
5800
|
+
cause: event.direction === "redo" ? "redo" : "undo",
|
|
5801
|
+
changeTag: null,
|
|
5802
|
+
txId: readTxId(history?.txId),
|
|
5803
|
+
scope: documentChangeScope(result.affectedStories)
|
|
5804
|
+
};
|
|
5805
|
+
}
|
|
5806
|
+
if (!mutationCommittedEventChangedDocument(event)) return null;
|
|
5807
|
+
const receipt = isPlainObject(event.receipt) ? event.receipt : {};
|
|
5808
|
+
return {
|
|
5809
|
+
cause: event.cause === "user" ? "user" : "api",
|
|
5810
|
+
changeTag: typeof receipt.changeTag === "string" ? receipt.changeTag : null,
|
|
5811
|
+
txId: readTxId(receipt.txId),
|
|
5812
|
+
scope: documentChangeScope(receipt.affectedStories)
|
|
5813
|
+
};
|
|
5814
|
+
}
|
|
5778
5815
|
function commandResultSucceeded(result) {
|
|
5779
5816
|
if (result === false) return false;
|
|
5780
5817
|
if (result && typeof result === "object" && result.success === false) return false;
|
|
@@ -10196,6 +10233,25 @@ function createSuperDocUI(options) {
|
|
|
10196
10233
|
state = computeState("initial");
|
|
10197
10234
|
lastOptimisticInlineSelectionSignature = selectionInlineValueSignature(state.selection);
|
|
10198
10235
|
let scheduleActiveSearchRefresh = () => {};
|
|
10236
|
+
const documentChangeListeners = /* @__PURE__ */ new Set();
|
|
10237
|
+
let documentChangeEpoch = 0;
|
|
10238
|
+
let documentChangeSeq = 0;
|
|
10239
|
+
const startDocumentChangeEpoch = () => {
|
|
10240
|
+
documentChangeEpoch += 1;
|
|
10241
|
+
documentChangeSeq = 0;
|
|
10242
|
+
};
|
|
10243
|
+
const publishDocumentChange = (event) => {
|
|
10244
|
+
if (documentChangeListeners.size === 0) return;
|
|
10245
|
+
const facts = documentChangeFromHostEvent(event);
|
|
10246
|
+
if (!facts) return;
|
|
10247
|
+
documentChangeSeq += 1;
|
|
10248
|
+
const change = {
|
|
10249
|
+
documentEpoch: `document-${documentChangeEpoch}`,
|
|
10250
|
+
seq: documentChangeSeq,
|
|
10251
|
+
...facts
|
|
10252
|
+
};
|
|
10253
|
+
for (const listener of Array.from(documentChangeListeners)) safeCall(() => listener(change), void 0);
|
|
10254
|
+
};
|
|
10199
10255
|
const syncHostEventsSubscription = () => {
|
|
10200
10256
|
const host = getEditor()?.host;
|
|
10201
10257
|
const events = host?.events;
|
|
@@ -10214,6 +10270,8 @@ function createSuperDocUI(options) {
|
|
|
10214
10270
|
try {
|
|
10215
10271
|
const off = hostMethod(next, "subscribe")?.((event) => {
|
|
10216
10272
|
const type = event?.type;
|
|
10273
|
+
if (type === "collaboration:document-replaced") startDocumentChangeEpoch();
|
|
10274
|
+
publishDocumentChange(event);
|
|
10217
10275
|
const isStandaloneDocumentMutation = type === "document:mutated" && event.hasCommitEvent !== true;
|
|
10218
10276
|
if (type === "collaboration:document-replaced" || isStandaloneDocumentMutation || type === "mutation:committed" && mutationCommittedEventChangedDocument(event) || type === "collaboration:remote-changed") {
|
|
10219
10277
|
for (const [commandId, optimistic] of optimisticInlineToggles) if (optimistic.settled || type === "collaboration:document-replaced") optimisticInlineToggles.delete(commandId);
|
|
@@ -13765,8 +13823,14 @@ function createSuperDocUI(options) {
|
|
|
13765
13823
|
} catch {
|
|
13766
13824
|
return;
|
|
13767
13825
|
}
|
|
13826
|
+
},
|
|
13827
|
+
onChange: (listener) => {
|
|
13828
|
+
if (disposed) return () => {};
|
|
13829
|
+
documentChangeListeners.add(listener);
|
|
13830
|
+
return () => documentChangeListeners.delete(listener);
|
|
13768
13831
|
}
|
|
13769
13832
|
};
|
|
13833
|
+
documentResetHooks.push(startDocumentChangeEpoch);
|
|
13770
13834
|
const resolveVisibleHost = () => {
|
|
13771
13835
|
if (typeof HTMLElement === "undefined") return null;
|
|
13772
13836
|
const mountContainer = (getEditor()?.mount)?.container;
|
|
@@ -15247,6 +15311,11 @@ function createSuperDocUI(options) {
|
|
|
15247
15311
|
const scopeUnsubs = [];
|
|
15248
15312
|
return {
|
|
15249
15313
|
decorations: createDecorationsHandle((handle) => scopeUnsubs.push(() => handle.dispose())),
|
|
15314
|
+
document: { onChange: (listener) => {
|
|
15315
|
+
const unsub = documentHandle.onChange(listener);
|
|
15316
|
+
scopeUnsubs.push(unsub);
|
|
15317
|
+
return unsub;
|
|
15318
|
+
} },
|
|
15250
15319
|
select: (selector, equality) => {
|
|
15251
15320
|
const sub = select(selector, equality);
|
|
15252
15321
|
return {
|
|
@@ -15333,6 +15402,7 @@ function createSuperDocUI(options) {
|
|
|
15333
15402
|
painterCaptureEpoch += 1;
|
|
15334
15403
|
painterCommandDoc = null;
|
|
15335
15404
|
painterModeListeners.clear();
|
|
15405
|
+
documentChangeListeners.clear();
|
|
15336
15406
|
searchRequestGeneration += 1;
|
|
15337
15407
|
customCommands.clear();
|
|
15338
15408
|
};
|
|
@@ -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.28.0-next.
|
|
22
|
+
superdocVersion: "2.28.0-next.14",
|
|
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.28.0-next.
|
|
21
|
+
superdocVersion: "2.28.0-next.14",
|
|
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
|
package/dist/public/ui-react.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-CFlvn2wr.cjs");
|
|
3
3
|
const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let use_sync_external_store_shim = require("use-sync-external-store/shim");
|
|
@@ -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-BRahDsch.es.js";
|
|
2
2
|
import { t as toSliceSource } from "../chunks/slice-source-gfOhG2MW.es.js";
|
|
3
3
|
import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { useSyncExternalStore } from "use-sync-external-store/shim";
|
package/dist/public/ui-vue.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-CFlvn2wr.cjs");
|
|
3
3
|
const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
|
|
4
4
|
let superdoc_entry_vue = require("vue");
|
|
5
5
|
//#region src/public/ui/vue.ts
|
package/dist/public/ui-vue.es.js
CHANGED
|
@@ -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-BRahDsch.es.js";
|
|
2
2
|
import { t as toSliceSource } from "../chunks/slice-source-gfOhG2MW.es.js";
|
|
3
3
|
import { computed, inject, onScopeDispose, provide, shallowRef, toRaw, toValue, watch } from "vue";
|
|
4
4
|
//#region src/public/ui/vue.ts
|
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-CFlvn2wr.cjs");
|
|
3
3
|
//#region ../document-api/src/types/receipt.ts
|
|
4
4
|
/** Read a known failure.details.reason without assuming every failure has one. */
|
|
5
5
|
function getDocumentApiRejectionReason(details) {
|
package/dist/public/ui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as shallowEqual, s as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { p as shallowEqual, s as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-BRahDsch.es.js";
|
|
2
2
|
//#region ../document-api/src/types/receipt.ts
|
|
3
3
|
/** Read a known failure.details.reason without assuming every failure has one. */
|
|
4
4
|
function getDocumentApiRejectionReason(details) {
|