superdoc 2.4.0-next.61 → 2.4.0-next.63
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-DNtHxzz_.cjs → create-super-doc-ui-Bom7oDPv.cjs} +110 -20
- package/dist/chunks/{create-super-doc-ui-B_1l545i.es.js → create-super-doc-ui-DbzVC0rr.es.js} +110 -20
- 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.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist-cdn/superdoc.min.js +35 -35
- package/package.json +2 -2
|
@@ -1874,6 +1874,23 @@ INLINE_PROPERTY_REGISTRY.filter((entry) => entry.storage === "mark").map((entry)
|
|
|
1874
1874
|
* `false` when the surface is unavailable (view mode, a pre-ready editor, or a
|
|
1875
1875
|
* host that has not exposed a Document API facade) rather than throwing.
|
|
1876
1876
|
*/
|
|
1877
|
+
function uiBenchNowMs() {
|
|
1878
|
+
return typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
1879
|
+
}
|
|
1880
|
+
function readUiBenchRuntime() {
|
|
1881
|
+
const benchGlobal = globalThis;
|
|
1882
|
+
return {
|
|
1883
|
+
sink: typeof benchGlobal.__superdocV2BenchPipelineTiming === "function" ? benchGlobal.__superdocV2BenchPipelineTiming : null,
|
|
1884
|
+
workerContext: benchGlobal.__superdocV2BenchWorkerMessageContext ?? null
|
|
1885
|
+
};
|
|
1886
|
+
}
|
|
1887
|
+
function emitUiBenchTiming(event) {
|
|
1888
|
+
const { sink } = readUiBenchRuntime();
|
|
1889
|
+
if (!sink) return;
|
|
1890
|
+
try {
|
|
1891
|
+
sink(event);
|
|
1892
|
+
} catch {}
|
|
1893
|
+
}
|
|
1877
1894
|
var sharedUiTrackedChangesCatalogByHost = /* @__PURE__ */ new WeakMap();
|
|
1878
1895
|
function acquireSharedUiTrackedChangesCatalog(host) {
|
|
1879
1896
|
let state = sharedUiTrackedChangesCatalogByHost.get(host);
|
|
@@ -3716,12 +3733,13 @@ function createSuperDocUI(options) {
|
|
|
3716
3733
|
let foregroundAsyncRetryTimer = null;
|
|
3717
3734
|
let pendingSelectionSeedValidationToken = null;
|
|
3718
3735
|
let typingContentInvalidationTimer = null;
|
|
3736
|
+
const pendingAsyncReadSettlements = [];
|
|
3719
3737
|
const scheduleAsyncRefresh = () => {
|
|
3720
3738
|
if (asyncRefreshScheduled || disposed) return;
|
|
3721
3739
|
asyncRefreshScheduled = true;
|
|
3722
3740
|
const run = () => {
|
|
3723
3741
|
asyncRefreshScheduled = false;
|
|
3724
|
-
if (!disposed) recompute();
|
|
3742
|
+
if (!disposed) recompute("async-read-settled");
|
|
3725
3743
|
};
|
|
3726
3744
|
if (typeof queueMicrotask === "function") queueMicrotask(run);
|
|
3727
3745
|
else Promise.resolve().then(run);
|
|
@@ -4275,6 +4293,24 @@ function createSuperDocUI(options) {
|
|
|
4275
4293
|
failureCount: 0,
|
|
4276
4294
|
retryAtMs: 0
|
|
4277
4295
|
});
|
|
4296
|
+
const { sink, workerContext } = readUiBenchRuntime();
|
|
4297
|
+
if (sink) {
|
|
4298
|
+
const settledAtMs = uiBenchNowMs();
|
|
4299
|
+
pendingAsyncReadSettlements.push({
|
|
4300
|
+
key,
|
|
4301
|
+
settledAtMs,
|
|
4302
|
+
commandId: workerContext?.commandId ?? null,
|
|
4303
|
+
commandKind: workerContext?.commandKind ?? null
|
|
4304
|
+
});
|
|
4305
|
+
emitUiBenchTiming({
|
|
4306
|
+
stage: "superdoc-ui-async-read-settled",
|
|
4307
|
+
atMs: settledAtMs,
|
|
4308
|
+
key,
|
|
4309
|
+
settledAtMs,
|
|
4310
|
+
commandId: workerContext?.commandId ?? null,
|
|
4311
|
+
commandKind: workerContext?.commandKind ?? null
|
|
4312
|
+
});
|
|
4313
|
+
}
|
|
4278
4314
|
scheduleAsyncRefresh();
|
|
4279
4315
|
}, () => {
|
|
4280
4316
|
const entry = asyncReads.get(key);
|
|
@@ -6535,31 +6571,57 @@ function createSuperDocUI(options) {
|
|
|
6535
6571
|
diagnostics
|
|
6536
6572
|
};
|
|
6537
6573
|
};
|
|
6538
|
-
const computeState = () => {
|
|
6539
|
-
const
|
|
6540
|
-
const
|
|
6574
|
+
const computeState = (reason = "direct") => {
|
|
6575
|
+
const { sink } = readUiBenchRuntime();
|
|
6576
|
+
const startedAtMs = sink ? uiBenchNowMs() : 0;
|
|
6577
|
+
const phaseMs = {};
|
|
6578
|
+
const measure = (phase, run) => {
|
|
6579
|
+
if (!sink) return run();
|
|
6580
|
+
const phaseStartedAtMs = uiBenchNowMs();
|
|
6581
|
+
try {
|
|
6582
|
+
return run();
|
|
6583
|
+
} finally {
|
|
6584
|
+
phaseMs[phase] = uiBenchNowMs() - phaseStartedAtMs;
|
|
6585
|
+
}
|
|
6586
|
+
};
|
|
6587
|
+
const documentMode = measure("documentMode", readDocumentMode);
|
|
6588
|
+
const selection = measure("selection", computeSelection);
|
|
6541
6589
|
if (selection.status === "ready") pruneSelectionScopedAsyncReads(selection);
|
|
6542
6590
|
reconcilePendingInlineFormat(selection);
|
|
6543
6591
|
const selectionSignature = selectionInlineValueSignature(selection);
|
|
6544
6592
|
for (const [commandId, optimistic] of optimisticInlineToggles) if (!selectionSignature || optimistic.selectionSignature !== selectionSignature) optimisticInlineToggles.delete(commandId);
|
|
6545
6593
|
else if (optimistic.settled && selection.status === "ready") optimisticInlineToggles.delete(commandId);
|
|
6546
|
-
|
|
6594
|
+
const nextState = {
|
|
6547
6595
|
ready: getEditor() != null,
|
|
6548
6596
|
documentMode,
|
|
6549
|
-
document: computeDocument
|
|
6597
|
+
document: measure("document", computeDocument),
|
|
6550
6598
|
selection,
|
|
6551
6599
|
toolbar: {
|
|
6552
6600
|
context: documentMode,
|
|
6553
|
-
commands: computeCommandStates(selection),
|
|
6601
|
+
commands: measure("toolbarCommands", () => computeCommandStates(selection)),
|
|
6554
6602
|
copyFormatActive: painter.mode !== "idle"
|
|
6555
6603
|
},
|
|
6556
|
-
comments: computeComments(selection),
|
|
6557
|
-
trackChanges: computeTrackChanges(selection),
|
|
6558
|
-
contentControls: computeContentControls(selection),
|
|
6559
|
-
zoom: computeZoom
|
|
6560
|
-
fonts: computeFonts
|
|
6561
|
-
styles: computeStyles(selection)
|
|
6562
|
-
};
|
|
6604
|
+
comments: measure("comments", () => computeComments(selection)),
|
|
6605
|
+
trackChanges: measure("trackChanges", () => computeTrackChanges(selection)),
|
|
6606
|
+
contentControls: measure("contentControls", () => computeContentControls(selection)),
|
|
6607
|
+
zoom: measure("zoom", computeZoom),
|
|
6608
|
+
fonts: measure("fonts", computeFonts),
|
|
6609
|
+
styles: measure("styles", () => computeStyles(selection))
|
|
6610
|
+
};
|
|
6611
|
+
if (sink) {
|
|
6612
|
+
const completedAtMs = uiBenchNowMs();
|
|
6613
|
+
emitUiBenchTiming({
|
|
6614
|
+
stage: "superdoc-ui-compute-state",
|
|
6615
|
+
atMs: completedAtMs,
|
|
6616
|
+
reason,
|
|
6617
|
+
startedAtMs,
|
|
6618
|
+
completedAtMs,
|
|
6619
|
+
durationMs: completedAtMs - startedAtMs,
|
|
6620
|
+
phaseMs,
|
|
6621
|
+
asyncReadSettlements: pendingAsyncReadSettlements.splice(0)
|
|
6622
|
+
});
|
|
6623
|
+
}
|
|
6624
|
+
return nextState;
|
|
6563
6625
|
};
|
|
6564
6626
|
const syncOptimisticInlineSelection = (selection) => {
|
|
6565
6627
|
const nextSignature = selectionInlineValueSignature(selection);
|
|
@@ -6644,7 +6706,7 @@ function createSuperDocUI(options) {
|
|
|
6644
6706
|
const unsubscribe = next.subscribe((snapshot) => {
|
|
6645
6707
|
selectionEpoch += 1;
|
|
6646
6708
|
seedCaretSelectionFromHost(snapshot);
|
|
6647
|
-
recompute();
|
|
6709
|
+
recompute("host-selection");
|
|
6648
6710
|
});
|
|
6649
6711
|
if (typeof unsubscribe === "function") detachHostSelection = unsubscribe;
|
|
6650
6712
|
} catch {
|
|
@@ -6752,7 +6814,7 @@ function createSuperDocUI(options) {
|
|
|
6752
6814
|
};
|
|
6753
6815
|
syncCoordinatorEditor();
|
|
6754
6816
|
syncTrackedChangeFocusFromHostReviewTarget(readHostActiveReviewTarget(readHostReviewSource()));
|
|
6755
|
-
state = computeState();
|
|
6817
|
+
state = computeState("initial");
|
|
6756
6818
|
lastOptimisticInlineSelectionSignature = selectionInlineValueSignature(state.selection);
|
|
6757
6819
|
const syncHostEventsSubscription = () => {
|
|
6758
6820
|
const events = (getEditor()?.host)?.events;
|
|
@@ -6820,8 +6882,10 @@ function createSuperDocUI(options) {
|
|
|
6820
6882
|
currentHostEventsSource = null;
|
|
6821
6883
|
}
|
|
6822
6884
|
};
|
|
6823
|
-
const recompute = () => {
|
|
6885
|
+
const recompute = (reason = "unspecified") => {
|
|
6824
6886
|
if (disposed) return;
|
|
6887
|
+
const { sink } = readUiBenchRuntime();
|
|
6888
|
+
const startedAtMs = sink ? uiBenchNowMs() : 0;
|
|
6825
6889
|
editCommandsRecomputeQueued = false;
|
|
6826
6890
|
syncCoordinatorEditor();
|
|
6827
6891
|
syncHostSelectionSubscription();
|
|
@@ -6830,10 +6894,36 @@ function createSuperDocUI(options) {
|
|
|
6830
6894
|
syncHostReviewSubscription();
|
|
6831
6895
|
syncDocumentSelectionFallbackSubscription();
|
|
6832
6896
|
syncHostEventsSubscription();
|
|
6833
|
-
const nextState = computeState();
|
|
6897
|
+
const nextState = computeState(reason);
|
|
6834
6898
|
syncOptimisticInlineSelection(nextState.selection);
|
|
6835
6899
|
state = nextState;
|
|
6836
|
-
|
|
6900
|
+
let listenerTotalMs = 0;
|
|
6901
|
+
let listenerMaxMs = 0;
|
|
6902
|
+
for (const listener of [...listeners]) {
|
|
6903
|
+
if (!sink) {
|
|
6904
|
+
listener(state);
|
|
6905
|
+
continue;
|
|
6906
|
+
}
|
|
6907
|
+
const listenerStartedAtMs = uiBenchNowMs();
|
|
6908
|
+
listener(state);
|
|
6909
|
+
const listenerMs = uiBenchNowMs() - listenerStartedAtMs;
|
|
6910
|
+
listenerTotalMs += listenerMs;
|
|
6911
|
+
listenerMaxMs = Math.max(listenerMaxMs, listenerMs);
|
|
6912
|
+
}
|
|
6913
|
+
if (sink) {
|
|
6914
|
+
const completedAtMs = uiBenchNowMs();
|
|
6915
|
+
emitUiBenchTiming({
|
|
6916
|
+
stage: "superdoc-ui-recompute",
|
|
6917
|
+
atMs: completedAtMs,
|
|
6918
|
+
reason,
|
|
6919
|
+
startedAtMs,
|
|
6920
|
+
completedAtMs,
|
|
6921
|
+
durationMs: completedAtMs - startedAtMs,
|
|
6922
|
+
listenerCount: listeners.size,
|
|
6923
|
+
listenerTotalMs,
|
|
6924
|
+
listenerMaxMs
|
|
6925
|
+
});
|
|
6926
|
+
}
|
|
6837
6927
|
};
|
|
6838
6928
|
/**
|
|
6839
6929
|
* Work that is bound to one specific active editor and cannot survive a swap.
|
|
@@ -7423,7 +7513,7 @@ function createSuperDocUI(options) {
|
|
|
7423
7513
|
if (options && options.success === false) return options;
|
|
7424
7514
|
if (!selection.selectionTarget) return options ? op(input, options) : op(input);
|
|
7425
7515
|
return op(input, {
|
|
7426
|
-
...options
|
|
7516
|
+
...options,
|
|
7427
7517
|
offsetSpace: "selection"
|
|
7428
7518
|
});
|
|
7429
7519
|
};
|
package/dist/chunks/{create-super-doc-ui-B_1l545i.es.js → create-super-doc-ui-DbzVC0rr.es.js}
RENAMED
|
@@ -1874,6 +1874,23 @@ INLINE_PROPERTY_REGISTRY.filter((entry) => entry.storage === "mark").map((entry)
|
|
|
1874
1874
|
* `false` when the surface is unavailable (view mode, a pre-ready editor, or a
|
|
1875
1875
|
* host that has not exposed a Document API facade) rather than throwing.
|
|
1876
1876
|
*/
|
|
1877
|
+
function uiBenchNowMs() {
|
|
1878
|
+
return typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
1879
|
+
}
|
|
1880
|
+
function readUiBenchRuntime() {
|
|
1881
|
+
const benchGlobal = globalThis;
|
|
1882
|
+
return {
|
|
1883
|
+
sink: typeof benchGlobal.__superdocV2BenchPipelineTiming === "function" ? benchGlobal.__superdocV2BenchPipelineTiming : null,
|
|
1884
|
+
workerContext: benchGlobal.__superdocV2BenchWorkerMessageContext ?? null
|
|
1885
|
+
};
|
|
1886
|
+
}
|
|
1887
|
+
function emitUiBenchTiming(event) {
|
|
1888
|
+
const { sink } = readUiBenchRuntime();
|
|
1889
|
+
if (!sink) return;
|
|
1890
|
+
try {
|
|
1891
|
+
sink(event);
|
|
1892
|
+
} catch {}
|
|
1893
|
+
}
|
|
1877
1894
|
var sharedUiTrackedChangesCatalogByHost = /* @__PURE__ */ new WeakMap();
|
|
1878
1895
|
function acquireSharedUiTrackedChangesCatalog(host) {
|
|
1879
1896
|
let state = sharedUiTrackedChangesCatalogByHost.get(host);
|
|
@@ -3716,12 +3733,13 @@ function createSuperDocUI(options) {
|
|
|
3716
3733
|
let foregroundAsyncRetryTimer = null;
|
|
3717
3734
|
let pendingSelectionSeedValidationToken = null;
|
|
3718
3735
|
let typingContentInvalidationTimer = null;
|
|
3736
|
+
const pendingAsyncReadSettlements = [];
|
|
3719
3737
|
const scheduleAsyncRefresh = () => {
|
|
3720
3738
|
if (asyncRefreshScheduled || disposed) return;
|
|
3721
3739
|
asyncRefreshScheduled = true;
|
|
3722
3740
|
const run = () => {
|
|
3723
3741
|
asyncRefreshScheduled = false;
|
|
3724
|
-
if (!disposed) recompute();
|
|
3742
|
+
if (!disposed) recompute("async-read-settled");
|
|
3725
3743
|
};
|
|
3726
3744
|
if (typeof queueMicrotask === "function") queueMicrotask(run);
|
|
3727
3745
|
else Promise.resolve().then(run);
|
|
@@ -4275,6 +4293,24 @@ function createSuperDocUI(options) {
|
|
|
4275
4293
|
failureCount: 0,
|
|
4276
4294
|
retryAtMs: 0
|
|
4277
4295
|
});
|
|
4296
|
+
const { sink, workerContext } = readUiBenchRuntime();
|
|
4297
|
+
if (sink) {
|
|
4298
|
+
const settledAtMs = uiBenchNowMs();
|
|
4299
|
+
pendingAsyncReadSettlements.push({
|
|
4300
|
+
key,
|
|
4301
|
+
settledAtMs,
|
|
4302
|
+
commandId: workerContext?.commandId ?? null,
|
|
4303
|
+
commandKind: workerContext?.commandKind ?? null
|
|
4304
|
+
});
|
|
4305
|
+
emitUiBenchTiming({
|
|
4306
|
+
stage: "superdoc-ui-async-read-settled",
|
|
4307
|
+
atMs: settledAtMs,
|
|
4308
|
+
key,
|
|
4309
|
+
settledAtMs,
|
|
4310
|
+
commandId: workerContext?.commandId ?? null,
|
|
4311
|
+
commandKind: workerContext?.commandKind ?? null
|
|
4312
|
+
});
|
|
4313
|
+
}
|
|
4278
4314
|
scheduleAsyncRefresh();
|
|
4279
4315
|
}, () => {
|
|
4280
4316
|
const entry = asyncReads.get(key);
|
|
@@ -6535,31 +6571,57 @@ function createSuperDocUI(options) {
|
|
|
6535
6571
|
diagnostics
|
|
6536
6572
|
};
|
|
6537
6573
|
};
|
|
6538
|
-
const computeState = () => {
|
|
6539
|
-
const
|
|
6540
|
-
const
|
|
6574
|
+
const computeState = (reason = "direct") => {
|
|
6575
|
+
const { sink } = readUiBenchRuntime();
|
|
6576
|
+
const startedAtMs = sink ? uiBenchNowMs() : 0;
|
|
6577
|
+
const phaseMs = {};
|
|
6578
|
+
const measure = (phase, run) => {
|
|
6579
|
+
if (!sink) return run();
|
|
6580
|
+
const phaseStartedAtMs = uiBenchNowMs();
|
|
6581
|
+
try {
|
|
6582
|
+
return run();
|
|
6583
|
+
} finally {
|
|
6584
|
+
phaseMs[phase] = uiBenchNowMs() - phaseStartedAtMs;
|
|
6585
|
+
}
|
|
6586
|
+
};
|
|
6587
|
+
const documentMode = measure("documentMode", readDocumentMode);
|
|
6588
|
+
const selection = measure("selection", computeSelection);
|
|
6541
6589
|
if (selection.status === "ready") pruneSelectionScopedAsyncReads(selection);
|
|
6542
6590
|
reconcilePendingInlineFormat(selection);
|
|
6543
6591
|
const selectionSignature = selectionInlineValueSignature(selection);
|
|
6544
6592
|
for (const [commandId, optimistic] of optimisticInlineToggles) if (!selectionSignature || optimistic.selectionSignature !== selectionSignature) optimisticInlineToggles.delete(commandId);
|
|
6545
6593
|
else if (optimistic.settled && selection.status === "ready") optimisticInlineToggles.delete(commandId);
|
|
6546
|
-
|
|
6594
|
+
const nextState = {
|
|
6547
6595
|
ready: getEditor() != null,
|
|
6548
6596
|
documentMode,
|
|
6549
|
-
document: computeDocument
|
|
6597
|
+
document: measure("document", computeDocument),
|
|
6550
6598
|
selection,
|
|
6551
6599
|
toolbar: {
|
|
6552
6600
|
context: documentMode,
|
|
6553
|
-
commands: computeCommandStates(selection),
|
|
6601
|
+
commands: measure("toolbarCommands", () => computeCommandStates(selection)),
|
|
6554
6602
|
copyFormatActive: painter.mode !== "idle"
|
|
6555
6603
|
},
|
|
6556
|
-
comments: computeComments(selection),
|
|
6557
|
-
trackChanges: computeTrackChanges(selection),
|
|
6558
|
-
contentControls: computeContentControls(selection),
|
|
6559
|
-
zoom: computeZoom
|
|
6560
|
-
fonts: computeFonts
|
|
6561
|
-
styles: computeStyles(selection)
|
|
6562
|
-
};
|
|
6604
|
+
comments: measure("comments", () => computeComments(selection)),
|
|
6605
|
+
trackChanges: measure("trackChanges", () => computeTrackChanges(selection)),
|
|
6606
|
+
contentControls: measure("contentControls", () => computeContentControls(selection)),
|
|
6607
|
+
zoom: measure("zoom", computeZoom),
|
|
6608
|
+
fonts: measure("fonts", computeFonts),
|
|
6609
|
+
styles: measure("styles", () => computeStyles(selection))
|
|
6610
|
+
};
|
|
6611
|
+
if (sink) {
|
|
6612
|
+
const completedAtMs = uiBenchNowMs();
|
|
6613
|
+
emitUiBenchTiming({
|
|
6614
|
+
stage: "superdoc-ui-compute-state",
|
|
6615
|
+
atMs: completedAtMs,
|
|
6616
|
+
reason,
|
|
6617
|
+
startedAtMs,
|
|
6618
|
+
completedAtMs,
|
|
6619
|
+
durationMs: completedAtMs - startedAtMs,
|
|
6620
|
+
phaseMs,
|
|
6621
|
+
asyncReadSettlements: pendingAsyncReadSettlements.splice(0)
|
|
6622
|
+
});
|
|
6623
|
+
}
|
|
6624
|
+
return nextState;
|
|
6563
6625
|
};
|
|
6564
6626
|
const syncOptimisticInlineSelection = (selection) => {
|
|
6565
6627
|
const nextSignature = selectionInlineValueSignature(selection);
|
|
@@ -6644,7 +6706,7 @@ function createSuperDocUI(options) {
|
|
|
6644
6706
|
const unsubscribe = next.subscribe((snapshot) => {
|
|
6645
6707
|
selectionEpoch += 1;
|
|
6646
6708
|
seedCaretSelectionFromHost(snapshot);
|
|
6647
|
-
recompute();
|
|
6709
|
+
recompute("host-selection");
|
|
6648
6710
|
});
|
|
6649
6711
|
if (typeof unsubscribe === "function") detachHostSelection = unsubscribe;
|
|
6650
6712
|
} catch {
|
|
@@ -6752,7 +6814,7 @@ function createSuperDocUI(options) {
|
|
|
6752
6814
|
};
|
|
6753
6815
|
syncCoordinatorEditor();
|
|
6754
6816
|
syncTrackedChangeFocusFromHostReviewTarget(readHostActiveReviewTarget(readHostReviewSource()));
|
|
6755
|
-
state = computeState();
|
|
6817
|
+
state = computeState("initial");
|
|
6756
6818
|
lastOptimisticInlineSelectionSignature = selectionInlineValueSignature(state.selection);
|
|
6757
6819
|
const syncHostEventsSubscription = () => {
|
|
6758
6820
|
const events = (getEditor()?.host)?.events;
|
|
@@ -6820,8 +6882,10 @@ function createSuperDocUI(options) {
|
|
|
6820
6882
|
currentHostEventsSource = null;
|
|
6821
6883
|
}
|
|
6822
6884
|
};
|
|
6823
|
-
const recompute = () => {
|
|
6885
|
+
const recompute = (reason = "unspecified") => {
|
|
6824
6886
|
if (disposed) return;
|
|
6887
|
+
const { sink } = readUiBenchRuntime();
|
|
6888
|
+
const startedAtMs = sink ? uiBenchNowMs() : 0;
|
|
6825
6889
|
editCommandsRecomputeQueued = false;
|
|
6826
6890
|
syncCoordinatorEditor();
|
|
6827
6891
|
syncHostSelectionSubscription();
|
|
@@ -6830,10 +6894,36 @@ function createSuperDocUI(options) {
|
|
|
6830
6894
|
syncHostReviewSubscription();
|
|
6831
6895
|
syncDocumentSelectionFallbackSubscription();
|
|
6832
6896
|
syncHostEventsSubscription();
|
|
6833
|
-
const nextState = computeState();
|
|
6897
|
+
const nextState = computeState(reason);
|
|
6834
6898
|
syncOptimisticInlineSelection(nextState.selection);
|
|
6835
6899
|
state = nextState;
|
|
6836
|
-
|
|
6900
|
+
let listenerTotalMs = 0;
|
|
6901
|
+
let listenerMaxMs = 0;
|
|
6902
|
+
for (const listener of [...listeners]) {
|
|
6903
|
+
if (!sink) {
|
|
6904
|
+
listener(state);
|
|
6905
|
+
continue;
|
|
6906
|
+
}
|
|
6907
|
+
const listenerStartedAtMs = uiBenchNowMs();
|
|
6908
|
+
listener(state);
|
|
6909
|
+
const listenerMs = uiBenchNowMs() - listenerStartedAtMs;
|
|
6910
|
+
listenerTotalMs += listenerMs;
|
|
6911
|
+
listenerMaxMs = Math.max(listenerMaxMs, listenerMs);
|
|
6912
|
+
}
|
|
6913
|
+
if (sink) {
|
|
6914
|
+
const completedAtMs = uiBenchNowMs();
|
|
6915
|
+
emitUiBenchTiming({
|
|
6916
|
+
stage: "superdoc-ui-recompute",
|
|
6917
|
+
atMs: completedAtMs,
|
|
6918
|
+
reason,
|
|
6919
|
+
startedAtMs,
|
|
6920
|
+
completedAtMs,
|
|
6921
|
+
durationMs: completedAtMs - startedAtMs,
|
|
6922
|
+
listenerCount: listeners.size,
|
|
6923
|
+
listenerTotalMs,
|
|
6924
|
+
listenerMaxMs
|
|
6925
|
+
});
|
|
6926
|
+
}
|
|
6837
6927
|
};
|
|
6838
6928
|
/**
|
|
6839
6929
|
* Work that is bound to one specific active editor and cannot survive a swap.
|
|
@@ -7423,7 +7513,7 @@ function createSuperDocUI(options) {
|
|
|
7423
7513
|
if (options && options.success === false) return options;
|
|
7424
7514
|
if (!selection.selectionTarget) return options ? op(input, options) : op(input);
|
|
7425
7515
|
return op(input, {
|
|
7426
|
-
...options
|
|
7516
|
+
...options,
|
|
7427
7517
|
offsetSpace: "selection"
|
|
7428
7518
|
});
|
|
7429
7519
|
};
|
|
@@ -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.63",
|
|
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.63",
|
|
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-Bom7oDPv.cjs");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
//#region src/public/ui/react.ts
|
|
5
5
|
/**
|
|
@@ -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-DbzVC0rr.es.js";
|
|
2
2
|
import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
3
3
|
//#region src/public/ui/react.ts
|
|
4
4
|
/**
|
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-Bom7oDPv.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 shallowEqual, r as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { n as shallowEqual, r as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-DbzVC0rr.es.js";
|
|
2
2
|
export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };
|
package/dist/superdoc.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const require_blank_docx = require("./chunks/blank-docx-BuFAbRjs.cjs");
|
|
|
4
4
|
const require_eventemitter3 = require("./chunks/eventemitter3-D38u8ta_.cjs");
|
|
5
5
|
const require_uuid = require("./chunks/uuid-BhG0ngwk.cjs");
|
|
6
6
|
const require_jszip = require("./chunks/jszip-RC64TPzL.cjs");
|
|
7
|
-
const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-
|
|
7
|
+
const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-Bom7oDPv.cjs");
|
|
8
8
|
const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-SDR04tiH.cjs");
|
|
9
9
|
const require_constants = require("./chunks/constants-DpXuDx_g.cjs");
|
|
10
10
|
let vue = require("vue");
|
|
@@ -43261,7 +43261,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
43261
43261
|
this.config.colors = shuffleArray(this.config.colors);
|
|
43262
43262
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
43263
43263
|
this.colorIndex = 0;
|
|
43264
|
-
this.version = "2.4.0-next.
|
|
43264
|
+
this.version = "2.4.0-next.63";
|
|
43265
43265
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
43266
43266
|
this.superdocId = config.superdocId || require_uuid.v4();
|
|
43267
43267
|
this.colors = this.config.colors ?? [];
|
package/dist/superdoc.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import { t as blank_default } from "./chunks/blank-docx-DzQccOlW.es.js";
|
|
|
3
3
|
import { t as import_eventemitter3 } from "./chunks/eventemitter3-CMOjDs74.es.js";
|
|
4
4
|
import { t as v4 } from "./chunks/uuid-H0Xcmmhy.es.js";
|
|
5
5
|
import { a as init_dist$1, i as global, n as init_dist$2, o as Buffer, r as process$1, s as init_dist, t as require_jszip_min } from "./chunks/jszip-VxCFV9YS.es.js";
|
|
6
|
-
import { a as DOM_CLASS_NAMES, i as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-
|
|
6
|
+
import { a as DOM_CLASS_NAMES, i as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-DbzVC0rr.es.js";
|
|
7
7
|
import { t as _plugin_vue_export_helper_default } from "./chunks/_plugin-vue_export-helper-BOaGB7Aw.es.js";
|
|
8
8
|
import { t as PDF_TO_CSS_UNITS } from "./chunks/constants-B6VBlmKp.es.js";
|
|
9
9
|
import * as Vue from "vue";
|
|
@@ -43194,7 +43194,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
43194
43194
|
this.config.colors = shuffleArray(this.config.colors);
|
|
43195
43195
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
43196
43196
|
this.colorIndex = 0;
|
|
43197
|
-
this.version = "2.4.0-next.
|
|
43197
|
+
this.version = "2.4.0-next.63";
|
|
43198
43198
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
43199
43199
|
this.superdocId = config.superdocId || v4();
|
|
43200
43200
|
this.colors = this.config.colors ?? [];
|