superdoc 2.26.1-next.6 → 2.27.0-next.2
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-R-76F0BR.es.js → create-super-doc-ui-BCQ5RHxy.es.js} +37 -6
- package/dist/chunks/{create-super-doc-ui-Vhd9kjjb.cjs → create-super-doc-ui-DK14sCrT.cjs} +37 -6
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/types/temporary-mutation.d.ts +25 -4
- package/dist/public/ui-react.cjs +17 -1
- package/dist/public/ui-react.es.js +17 -2
- 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/superdoc/src/core/SuperDoc.d.ts +2 -0
- package/dist/superdoc/src/public/ui/react.d.ts +2 -0
- package/dist/superdoc/src/public/ui/types.d.ts +3 -2
- package/dist/superdoc/src/public/ui-react.d.cts +1 -0
- package/dist/superdoc/src/public/ui-react.d.ts +1 -1
- package/dist/superdoc/src/public/ui.d.cts +14 -0
- package/dist/superdoc/src/public/ui.d.ts +1 -1
- package/dist/superdoc.cjs +7 -3
- package/dist/superdoc.es.js +7 -3
- package/dist-cdn/superdoc.min.js +17 -17
- package/package.json +3 -2
package/dist/chunks/{create-super-doc-ui-R-76F0BR.es.js → create-super-doc-ui-BCQ5RHxy.es.js}
RENAMED
|
@@ -12592,9 +12592,9 @@ function createSuperDocUI(options) {
|
|
|
12592
12592
|
ok: false,
|
|
12593
12593
|
reason: SUPERDOC_UI_REASONS.hostCapabilityUnavailable
|
|
12594
12594
|
};
|
|
12595
|
-
const token =
|
|
12595
|
+
const token = localContentToken();
|
|
12596
12596
|
let active = true;
|
|
12597
|
-
const current = () => active && !disposed && generation === bookmarkNavigationGeneration && getEditor() === editor && getDoc() === doc && getHost() === host &&
|
|
12597
|
+
const current = () => active && !disposed && generation === bookmarkNavigationGeneration && getEditor() === editor && getDoc() === doc && getHost() === host && localContentToken() === token;
|
|
12598
12598
|
const run = async () => {
|
|
12599
12599
|
try {
|
|
12600
12600
|
const directory = await listBookmarks(address.story ? { in: address.story } : {});
|
|
@@ -13705,6 +13705,28 @@ function createSuperDocUI(options) {
|
|
|
13705
13705
|
}
|
|
13706
13706
|
};
|
|
13707
13707
|
activeEditorResetHooks.push(rebindGeometryObservers);
|
|
13708
|
+
const resolveEntityGeometryTarget = (address) => {
|
|
13709
|
+
const comment = address.entityType === "comment";
|
|
13710
|
+
const get = hostMethod(comment ? getDoc()?.comments : getDoc()?.trackChanges, "get");
|
|
13711
|
+
if (!get) return { reason: "unavailable" };
|
|
13712
|
+
const id = address.entityId;
|
|
13713
|
+
const story = comment ? void 0 : readEntityRequestStory({ address });
|
|
13714
|
+
const input = comment ? { commentId: id } : {
|
|
13715
|
+
id,
|
|
13716
|
+
...story ? { story } : {}
|
|
13717
|
+
};
|
|
13718
|
+
const { value, status } = readAsync(`${address.entityType}:geometry:${id}:${storyLocatorSignature(story ?? null)}`, localContentToken(), () => Promise.resolve().then(() => get(input)).catch(() => null), (info) => {
|
|
13719
|
+
const target = readEntityTarget(info);
|
|
13720
|
+
if (!target || !Array.isArray(target.segments) || target.segments.length === 0) return null;
|
|
13721
|
+
if (!comment && target.segments.every((segment) => segment.range?.start === segment.range?.end)) return null;
|
|
13722
|
+
return story && !target.story ? {
|
|
13723
|
+
...target,
|
|
13724
|
+
story
|
|
13725
|
+
} : target;
|
|
13726
|
+
});
|
|
13727
|
+
if (status !== "ready") return { reason: "not-ready" };
|
|
13728
|
+
return value ? { target: value } : { reason: "unresolved" };
|
|
13729
|
+
};
|
|
13708
13730
|
const viewport = {
|
|
13709
13731
|
getRects: async (input) => {
|
|
13710
13732
|
const initialHost = getHost();
|
|
@@ -13748,6 +13770,15 @@ function createSuperDocUI(options) {
|
|
|
13748
13770
|
}
|
|
13749
13771
|
},
|
|
13750
13772
|
getRect: (input) => {
|
|
13773
|
+
const requested = input.target;
|
|
13774
|
+
if (requested?.kind === "entity" && (requested.entityType === "trackedChange" || requested.entityType === "comment") && typeof requested.entityId === "string") {
|
|
13775
|
+
const resolved = resolveEntityGeometryTarget(requested);
|
|
13776
|
+
if ("reason" in resolved) return rectFailure(resolved.reason);
|
|
13777
|
+
return viewport.getRect({
|
|
13778
|
+
target: resolved.target,
|
|
13779
|
+
relativeTo: input.relativeTo
|
|
13780
|
+
});
|
|
13781
|
+
}
|
|
13751
13782
|
const host = getHost();
|
|
13752
13783
|
const getTargetRects = host?.getTargetRects;
|
|
13753
13784
|
if (typeof getTargetRects === "function") {
|
|
@@ -13838,7 +13869,7 @@ function createSuperDocUI(options) {
|
|
|
13838
13869
|
return target && typeof target === "object" ? target : null;
|
|
13839
13870
|
};
|
|
13840
13871
|
const metadataResolveKey = (id) => `metadata:resolve:${id}`;
|
|
13841
|
-
const
|
|
13872
|
+
const localContentToken = () => {
|
|
13842
13873
|
const host = getHost();
|
|
13843
13874
|
const localRevision = safeCall(() => hostMethod(host, "getLocalMutationRevision")?.(), null);
|
|
13844
13875
|
return `${contentToken()}|local:${typeof localRevision === "number" ? localRevision : "unknown"}`;
|
|
@@ -13847,16 +13878,16 @@ function createSuperDocUI(options) {
|
|
|
13847
13878
|
const resolveMetadataTarget = (id) => {
|
|
13848
13879
|
const resolveMetadata = hostMethod(getDoc()?.metadata, "resolve");
|
|
13849
13880
|
if (!resolveMetadata) return null;
|
|
13850
|
-
const { value, status } = readAsync(metadataResolveKey(id),
|
|
13881
|
+
const { value, status } = readAsync(metadataResolveKey(id), localContentToken(), () => resolveMetadata({ id }), readMetadataResolvedTarget);
|
|
13851
13882
|
return status === "ready" ? value : null;
|
|
13852
13883
|
};
|
|
13853
13884
|
const resolveMetadataTargetAsync = async (id) => {
|
|
13854
13885
|
const resolveMetadata = hostMethod(getDoc()?.metadata, "resolve");
|
|
13855
13886
|
if (!resolveMetadata) return null;
|
|
13856
13887
|
try {
|
|
13857
|
-
const token =
|
|
13888
|
+
const token = localContentToken();
|
|
13858
13889
|
const resolved = await Promise.resolve(resolveMetadata({ id }));
|
|
13859
|
-
if (token !==
|
|
13890
|
+
if (token !== localContentToken()) return null;
|
|
13860
13891
|
const target = readMetadataResolvedTarget(resolved);
|
|
13861
13892
|
asyncReads.set(metadataResolveKey(id), {
|
|
13862
13893
|
token,
|
|
@@ -12593,9 +12593,9 @@ function createSuperDocUI(options) {
|
|
|
12593
12593
|
ok: false,
|
|
12594
12594
|
reason: SUPERDOC_UI_REASONS.hostCapabilityUnavailable
|
|
12595
12595
|
};
|
|
12596
|
-
const token =
|
|
12596
|
+
const token = localContentToken();
|
|
12597
12597
|
let active = true;
|
|
12598
|
-
const current = () => active && !disposed && generation === bookmarkNavigationGeneration && getEditor() === editor && getDoc() === doc && getHost() === host &&
|
|
12598
|
+
const current = () => active && !disposed && generation === bookmarkNavigationGeneration && getEditor() === editor && getDoc() === doc && getHost() === host && localContentToken() === token;
|
|
12599
12599
|
const run = async () => {
|
|
12600
12600
|
try {
|
|
12601
12601
|
const directory = await listBookmarks(address.story ? { in: address.story } : {});
|
|
@@ -13706,6 +13706,28 @@ function createSuperDocUI(options) {
|
|
|
13706
13706
|
}
|
|
13707
13707
|
};
|
|
13708
13708
|
activeEditorResetHooks.push(rebindGeometryObservers);
|
|
13709
|
+
const resolveEntityGeometryTarget = (address) => {
|
|
13710
|
+
const comment = address.entityType === "comment";
|
|
13711
|
+
const get = hostMethod(comment ? getDoc()?.comments : getDoc()?.trackChanges, "get");
|
|
13712
|
+
if (!get) return { reason: "unavailable" };
|
|
13713
|
+
const id = address.entityId;
|
|
13714
|
+
const story = comment ? void 0 : readEntityRequestStory({ address });
|
|
13715
|
+
const input = comment ? { commentId: id } : {
|
|
13716
|
+
id,
|
|
13717
|
+
...story ? { story } : {}
|
|
13718
|
+
};
|
|
13719
|
+
const { value, status } = readAsync(`${address.entityType}:geometry:${id}:${storyLocatorSignature(story ?? null)}`, localContentToken(), () => Promise.resolve().then(() => get(input)).catch(() => null), (info) => {
|
|
13720
|
+
const target = readEntityTarget(info);
|
|
13721
|
+
if (!target || !Array.isArray(target.segments) || target.segments.length === 0) return null;
|
|
13722
|
+
if (!comment && target.segments.every((segment) => segment.range?.start === segment.range?.end)) return null;
|
|
13723
|
+
return story && !target.story ? {
|
|
13724
|
+
...target,
|
|
13725
|
+
story
|
|
13726
|
+
} : target;
|
|
13727
|
+
});
|
|
13728
|
+
if (status !== "ready") return { reason: "not-ready" };
|
|
13729
|
+
return value ? { target: value } : { reason: "unresolved" };
|
|
13730
|
+
};
|
|
13709
13731
|
const viewport = {
|
|
13710
13732
|
getRects: async (input) => {
|
|
13711
13733
|
const initialHost = getHost();
|
|
@@ -13749,6 +13771,15 @@ function createSuperDocUI(options) {
|
|
|
13749
13771
|
}
|
|
13750
13772
|
},
|
|
13751
13773
|
getRect: (input) => {
|
|
13774
|
+
const requested = input.target;
|
|
13775
|
+
if (requested?.kind === "entity" && (requested.entityType === "trackedChange" || requested.entityType === "comment") && typeof requested.entityId === "string") {
|
|
13776
|
+
const resolved = resolveEntityGeometryTarget(requested);
|
|
13777
|
+
if ("reason" in resolved) return rectFailure(resolved.reason);
|
|
13778
|
+
return viewport.getRect({
|
|
13779
|
+
target: resolved.target,
|
|
13780
|
+
relativeTo: input.relativeTo
|
|
13781
|
+
});
|
|
13782
|
+
}
|
|
13752
13783
|
const host = getHost();
|
|
13753
13784
|
const getTargetRects = host?.getTargetRects;
|
|
13754
13785
|
if (typeof getTargetRects === "function") {
|
|
@@ -13839,7 +13870,7 @@ function createSuperDocUI(options) {
|
|
|
13839
13870
|
return target && typeof target === "object" ? target : null;
|
|
13840
13871
|
};
|
|
13841
13872
|
const metadataResolveKey = (id) => `metadata:resolve:${id}`;
|
|
13842
|
-
const
|
|
13873
|
+
const localContentToken = () => {
|
|
13843
13874
|
const host = getHost();
|
|
13844
13875
|
const localRevision = safeCall(() => hostMethod(host, "getLocalMutationRevision")?.(), null);
|
|
13845
13876
|
return `${contentToken()}|local:${typeof localRevision === "number" ? localRevision : "unknown"}`;
|
|
@@ -13848,16 +13879,16 @@ function createSuperDocUI(options) {
|
|
|
13848
13879
|
const resolveMetadataTarget = (id) => {
|
|
13849
13880
|
const resolveMetadata = hostMethod(getDoc()?.metadata, "resolve");
|
|
13850
13881
|
if (!resolveMetadata) return null;
|
|
13851
|
-
const { value, status } = readAsync(metadataResolveKey(id),
|
|
13882
|
+
const { value, status } = readAsync(metadataResolveKey(id), localContentToken(), () => resolveMetadata({ id }), readMetadataResolvedTarget);
|
|
13852
13883
|
return status === "ready" ? value : null;
|
|
13853
13884
|
};
|
|
13854
13885
|
const resolveMetadataTargetAsync = async (id) => {
|
|
13855
13886
|
const resolveMetadata = hostMethod(getDoc()?.metadata, "resolve");
|
|
13856
13887
|
if (!resolveMetadata) return null;
|
|
13857
13888
|
try {
|
|
13858
|
-
const token =
|
|
13889
|
+
const token = localContentToken();
|
|
13859
13890
|
const resolved = await Promise.resolve(resolveMetadata({ id }));
|
|
13860
|
-
if (token !==
|
|
13891
|
+
if (token !== localContentToken()) return null;
|
|
13861
13892
|
const target = readMetadataResolvedTarget(resolved);
|
|
13862
13893
|
asyncReads.set(metadataResolveKey(id), {
|
|
13863
13894
|
token,
|
|
@@ -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.
|
|
22
|
+
superdocVersion: "2.27.0-next.2",
|
|
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.
|
|
21
|
+
superdocVersion: "2.27.0-next.2",
|
|
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
|
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
import { DocumentApiSurface } from '../index.js';
|
|
2
|
-
import { ReceiptSuccess } from './receipt.js';
|
|
2
|
+
import { ReceiptFailureResult, ReceiptSuccess } from './receipt.js';
|
|
3
|
+
import { PlainTextInsertInput } from '../insert/insert.js';
|
|
4
|
+
import { ParagraphTextReplaceInput, ReplaceMutationOptions, TextReplaceInput } from '../replace/replace.js';
|
|
5
|
+
import { MutationOptions, TrackedTextMutationOptions } from '../write/write.js';
|
|
6
|
+
import { BodyStoryLocator } from './story.types.js';
|
|
3
7
|
type TemporaryCall<Name extends string, Method extends (...args: never[]) => unknown> = {
|
|
4
8
|
operation: Name;
|
|
5
9
|
input: Parameters<Method>[0];
|
|
6
10
|
options?: Parameters<Method>[1];
|
|
7
11
|
};
|
|
12
|
+
type TemporaryText<Name extends 'insert' | 'replace', Input> = {
|
|
13
|
+
operation: Name;
|
|
14
|
+
input: Input;
|
|
15
|
+
options?: MutationOptions & {
|
|
16
|
+
author?: never;
|
|
17
|
+
};
|
|
18
|
+
} | {
|
|
19
|
+
operation: Name;
|
|
20
|
+
input: Exclude<Input, {
|
|
21
|
+
target: BodyStoryLocator;
|
|
22
|
+
}>;
|
|
23
|
+
options: TrackedTextMutationOptions;
|
|
24
|
+
};
|
|
8
25
|
/** Operations run in order against the temporary document, as one atomic update. */
|
|
9
|
-
export type TemporaryMutationOperation =
|
|
26
|
+
export type TemporaryMutationOperation = TemporaryText<'insert', PlainTextInsertInput> | TemporaryText<'replace', TextReplaceInput> | {
|
|
27
|
+
operation: 'replace';
|
|
28
|
+
input: ParagraphTextReplaceInput;
|
|
29
|
+
options?: ReplaceMutationOptions;
|
|
30
|
+
} | TemporaryCall<'delete', DocumentApiSurface['delete']> | TemporaryCall<'blocks.delete', DocumentApiSurface['blocks']['delete']> | TemporaryCall<'trackChanges.decide', DocumentApiSurface['trackChanges']['decide']> | TemporaryCall<'comments.create', DocumentApiSurface['comments']['create']>;
|
|
10
31
|
export interface TemporaryMutationInput {
|
|
11
32
|
/** Host tag echoed on every temporary mutation and its rollback/commit receipt. */
|
|
12
33
|
tag: string;
|
|
@@ -39,11 +60,11 @@ export interface TemporaryMutationMetadata {
|
|
|
39
60
|
tag: string;
|
|
40
61
|
onNativeEdit?: 'cancel' | 'preserve';
|
|
41
62
|
}
|
|
42
|
-
export type TemporaryMutationReceipt = ReceiptSuccess & {
|
|
63
|
+
export type TemporaryMutationReceipt = (ReceiptSuccess & {
|
|
43
64
|
temporary: TemporaryMutationMetadata;
|
|
44
65
|
revision: {
|
|
45
66
|
before: string;
|
|
46
67
|
after: string;
|
|
47
68
|
};
|
|
48
|
-
};
|
|
69
|
+
}) | ReceiptFailureResult;
|
|
49
70
|
export {};
|
package/dist/public/ui-react.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
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-DK14sCrT.cjs");
|
|
3
3
|
const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
|
+
let use_sync_external_store_shim = require("use-sync-external-store/shim");
|
|
5
6
|
//#region src/public/ui/react.ts
|
|
6
7
|
/**
|
|
7
8
|
* v2-native React bindings for the `superdoc/ui` controller.
|
|
@@ -79,6 +80,20 @@ function useSuperDocUI() {
|
|
|
79
80
|
function useSuperDocHost() {
|
|
80
81
|
return useContextValue().host;
|
|
81
82
|
}
|
|
83
|
+
function useSuperDocDocumentApi() {
|
|
84
|
+
const host = useSuperDocHost();
|
|
85
|
+
const subscribe = (0, react.useCallback)((onActiveEditorChange) => {
|
|
86
|
+
host?.on?.("active-editor-change", onActiveEditorChange);
|
|
87
|
+
return () => {
|
|
88
|
+
host?.off?.("active-editor-change", onActiveEditorChange);
|
|
89
|
+
};
|
|
90
|
+
}, [host]);
|
|
91
|
+
const read = () => readDocumentApi(host);
|
|
92
|
+
return (0, use_sync_external_store_shim.useSyncExternalStore)(subscribe, read, read);
|
|
93
|
+
}
|
|
94
|
+
function readDocumentApi(host) {
|
|
95
|
+
return host?.getDocumentApi?.() ?? null;
|
|
96
|
+
}
|
|
82
97
|
/** Get the stable callback used to bind a running SuperDoc instance. */
|
|
83
98
|
function useSetSuperDoc() {
|
|
84
99
|
return useContextValue().setSuperDoc;
|
|
@@ -256,6 +271,7 @@ exports.useSuperDocCommand = useSuperDocCommand;
|
|
|
256
271
|
exports.useSuperDocComments = useSuperDocComments;
|
|
257
272
|
exports.useSuperDocContentControls = useSuperDocContentControls;
|
|
258
273
|
exports.useSuperDocDocument = useSuperDocDocument;
|
|
274
|
+
exports.useSuperDocDocumentApi = useSuperDocDocumentApi;
|
|
259
275
|
exports.useSuperDocFontOptions = useSuperDocFontOptions;
|
|
260
276
|
exports.useSuperDocFontSizeOptions = useSuperDocFontSizeOptions;
|
|
261
277
|
exports.useSuperDocHost = useSuperDocHost;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-BCQ5RHxy.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
|
+
import { useSyncExternalStore } from "use-sync-external-store/shim";
|
|
4
5
|
//#region src/public/ui/react.ts
|
|
5
6
|
/**
|
|
6
7
|
* v2-native React bindings for the `superdoc/ui` controller.
|
|
@@ -78,6 +79,20 @@ function useSuperDocUI() {
|
|
|
78
79
|
function useSuperDocHost() {
|
|
79
80
|
return useContextValue().host;
|
|
80
81
|
}
|
|
82
|
+
function useSuperDocDocumentApi() {
|
|
83
|
+
const host = useSuperDocHost();
|
|
84
|
+
const subscribe = useCallback((onActiveEditorChange) => {
|
|
85
|
+
host?.on?.("active-editor-change", onActiveEditorChange);
|
|
86
|
+
return () => {
|
|
87
|
+
host?.off?.("active-editor-change", onActiveEditorChange);
|
|
88
|
+
};
|
|
89
|
+
}, [host]);
|
|
90
|
+
const read = () => readDocumentApi(host);
|
|
91
|
+
return useSyncExternalStore(subscribe, read, read);
|
|
92
|
+
}
|
|
93
|
+
function readDocumentApi(host) {
|
|
94
|
+
return host?.getDocumentApi?.() ?? null;
|
|
95
|
+
}
|
|
81
96
|
/** Get the stable callback used to bind a running SuperDoc instance. */
|
|
82
97
|
function useSetSuperDoc() {
|
|
83
98
|
return useContextValue().setSuperDoc;
|
|
@@ -249,4 +264,4 @@ function useSuperDocZoom() {
|
|
|
249
264
|
});
|
|
250
265
|
}
|
|
251
266
|
//#endregion
|
|
252
|
-
export { SuperDocUIProvider, useSetSuperDoc, useSuperDocCommand, useSuperDocComments, useSuperDocContentControls, useSuperDocDocument, useSuperDocFontOptions, useSuperDocFontSizeOptions, useSuperDocHost, useSuperDocSearch, useSuperDocSelection, useSuperDocSlice, useSuperDocToolbar, useSuperDocTrackChanges, useSuperDocUI, useSuperDocZoom };
|
|
267
|
+
export { SuperDocUIProvider, useSetSuperDoc, useSuperDocCommand, useSuperDocComments, useSuperDocContentControls, useSuperDocDocument, useSuperDocDocumentApi, useSuperDocFontOptions, useSuperDocFontSizeOptions, useSuperDocHost, useSuperDocSearch, useSuperDocSelection, useSuperDocSlice, useSuperDocToolbar, useSuperDocTrackChanges, useSuperDocUI, useSuperDocZoom };
|
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-DK14sCrT.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-BCQ5RHxy.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-DK14sCrT.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 { f as shallowEqual, o as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { f as shallowEqual, o as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-BCQ5RHxy.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) {
|
|
@@ -9,6 +9,7 @@ import { normalizeInteractionConfig } from './config/normalize-interaction-confi
|
|
|
9
9
|
import { normalizeSurfacesConfig } from './config/normalize-surfaces-config.js';
|
|
10
10
|
import { EditorRuntimeFocusOptions } from './editor-runtime/types.js';
|
|
11
11
|
import { BorrowedSuperDocUI } from '../public/ui/types.js';
|
|
12
|
+
import { BrowserDocumentApi } from '../public/browser-document-api.js';
|
|
12
13
|
import { AwarenessUser, CanPerformPermissionParams, CollaborationProvider, Config, ContentControlActiveChangePayload, ContentControlClickPayload, DocumentMode, Editor, EditorUpdateEvent, ExportParams, FontsChangedPayload, FontsResolvedPayload, InternalConfig, ListDefinitionsPayload, NavigableAddress, DocumentRendererRuntime, SearchMatch, SuperDocAwarenessUpdatePayload, SuperDocCommentsUpdatePayload, SuperDocCommentsListChangePayload, SuperDocDocumentModeChangePayload, SuperDocDocumentReplacedPayload, SuperDocEditorPayload, SuperDocExceptionPayload, SuperDocFontsApi, SuperDocFormattingMarksChangePayload, SuperDocLockedPayload, SuperDocCollaborationConnectionChangePayload, SuperDocMeasurementUnit, SuperDocMeasurementUnitChangePayload, SuperDocPageMarginsChangePayload, SuperDocPaginationUpdatePayload, SuperDocReadyPayload, SuperDocState, SuperDocTrackedChangesBulkDecisionPayload, SuperDocViewportChangePayload, SuperDocViewportMetrics, SuperDocZoomMode, SuperDocZoomPayload, SuperDocZoomState, SurfaceHandle, SurfaceRequest, UpgradeToCollaborationOptions, UpgradeToCollaborationResult, User, ViewingOptions } from './types/index.js';
|
|
13
14
|
import { WhiteboardData } from './whiteboard/Whiteboard.js';
|
|
14
15
|
type ToolbarLike = {
|
|
@@ -312,6 +313,7 @@ export declare class SuperDoc extends EventEmitter<SuperDocEventMap> {
|
|
|
312
313
|
* superdoc.ui.commands.get('bold').getState(); // { enabled, active, ... }
|
|
313
314
|
*/
|
|
314
315
|
get ui(): BorrowedSuperDocUI;
|
|
316
|
+
getDocumentApi(): BrowserDocumentApi | null;
|
|
315
317
|
get diagnostics(): SuperDocDiagnostics;
|
|
316
318
|
emit<K extends keyof SuperDocEventMap>(event: K, ...args: EventEmitter.ArgumentMap<SuperDocEventMap>[Extract<K, keyof SuperDocEventMap>]): boolean;
|
|
317
319
|
on<K extends keyof SuperDocEventMap>(event: K, fn: EventEmitter.EventListener<SuperDocEventMap, K>, context?: unknown): this;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { toSliceSource, SliceSource } from './slice-source.js';
|
|
3
|
+
import { BrowserDocumentApi } from '../browser-document-api.js';
|
|
3
4
|
import { BorrowedSuperDocUI, CommandExecutionResult, CommandId, CommandState, CommentsSlice, ContentControlsSlice, DocumentSlice, FontFamilyOption, FontSizeOption, SearchSnapshot, SelectionSlice, Subscribable, SuperDocLike, ToolbarSnapshotSlice, TrackChangesSlice, ZoomSlice } from './types.js';
|
|
4
5
|
/** The raw SuperDoc instance (or host stub) handed to the provider. */
|
|
5
6
|
export type SuperDocHost = SuperDocLike;
|
|
@@ -29,6 +30,7 @@ export declare function SuperDocUIProvider(props: SuperDocUIProviderProps): impo
|
|
|
29
30
|
export declare function useSuperDocUI(): BorrowedSuperDocUI | null;
|
|
30
31
|
/** Read the raw bound SuperDoc host, or `null` until one is bound. */
|
|
31
32
|
export declare function useSuperDocHost(): SuperDocHost | null;
|
|
33
|
+
export declare function useSuperDocDocumentApi(): BrowserDocumentApi | null;
|
|
32
34
|
/** Get the stable callback used to bind a running SuperDoc instance. */
|
|
33
35
|
export declare function useSetSuperDoc(): (superdoc: SuperDocHost) => void;
|
|
34
36
|
export { toSliceSource };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommentsListQuery as DocumentApiCommentsListQuery, CommentsListResult, TrackChangesListResult, EntityAddress, TextAddress, BookmarkAddress, TextTarget, ScrollIntoViewInput, ScrollIntoViewOutput, SelectionInfo, SelectionTarget, Receipt, ReceiptFailureCode, ContentControlInfo, ContentControlTarget, StyleCatalogItem, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult } from '../../../../document-api/src/index.js';
|
|
2
|
-
import { PartialBrowserDocumentApi } from '../browser-document-api.js';
|
|
2
|
+
import { BrowserDocumentApi, PartialBrowserDocumentApi } from '../browser-document-api.js';
|
|
3
3
|
import { ExportParams } from '../export-types.js';
|
|
4
4
|
import { DocumentReplacementResult } from '../document-replacement.js';
|
|
5
5
|
import { SuperDocUIReason } from './reasons.js';
|
|
@@ -30,7 +30,7 @@ import { BuiltInCommandId } from './commands.js';
|
|
|
30
30
|
* (`scripts/ensure-types.cjs` `rewriteDocApiPaths`), so no bare private
|
|
31
31
|
* specifier leaks into the emitted `.d.ts`.
|
|
32
32
|
*/
|
|
33
|
-
export type { Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, BookmarkAddress, ScrollIntoViewInput, ScrollIntoViewOutput, DocumentApi, EntityAddress, CommentsListQuery as DocumentApiCommentsListQuery, CommentsListResult, TrackChangesListResult, ContentControlsListResult, ContentControlInfo, ContentControlTarget, RichContentInsertInput, OperationCapabilityResolveResult, SDHtmlMarkdownSupportCheckResult, PictureWatermarkInput, RetainedPictureWatermarkInput, TextWatermark, WatermarkInfo, WatermarkTarget, WatermarksApplyInput, WatermarksApplyResult, WatermarksApplySuccess, WatermarksApplyTarget, } from '../../../../document-api/src/index.js';
|
|
33
|
+
export type { Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, BookmarkAddress, ScrollIntoViewInput, ScrollIntoViewOutput, DocumentApi, EntityAddress, CommentsListQuery as DocumentApiCommentsListQuery, CommentsListResult, TrackChangesListResult, ContentControlsListResult, ContentControlInfo, ContentControlTarget, RichContentInsertInput, OperationCapabilityResolveResult, SDHtmlMarkdownSupportCheckResult, PictureWatermarkInput, RetainedPictureWatermarkInput, TextWatermark, WatermarkInfo, WatermarkTarget, WatermarksApplyInput, WatermarksApplyResult, WatermarksApplySuccess, WatermarksApplyTarget, TemporaryMutationOperation, TemporaryMutationInput, TemporaryMutationReplaceInput, TemporaryMutationHandleInput, TemporaryMutationReceipt, StoryLocator as DocumentStoryLocator, } from '../../../../document-api/src/index.js';
|
|
34
34
|
export type { StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, } from '../../../../document-api/src/index.js';
|
|
35
35
|
export type { ListPresetId } from '../../../../document-api/src/index.js';
|
|
36
36
|
export type { BrowserDocumentApi, PartialBrowserDocumentApi } from '../browser-document-api.js';
|
|
@@ -1544,6 +1544,7 @@ export interface SuperDocLike {
|
|
|
1544
1544
|
* `destroy()` and a reader cannot call it.
|
|
1545
1545
|
*/
|
|
1546
1546
|
ui?: BorrowedSuperDocUI;
|
|
1547
|
+
getDocumentApi?(): BrowserDocumentApi | null;
|
|
1547
1548
|
/** Lifecycle event subscription. */
|
|
1548
1549
|
on?(event: string, handler: (...args: unknown[]) => void): unknown;
|
|
1549
1550
|
/** Lifecycle event unsubscription. */
|
|
@@ -11,6 +11,7 @@ export type { __Cjs_UseSuperDocCommandResult as UseSuperDocCommandResult };
|
|
|
11
11
|
export declare const useSuperDocComments: typeof import('./ui-react.js', { with: { "resolution-mode": "import" } }).useSuperDocComments;
|
|
12
12
|
export declare const useSuperDocContentControls: typeof import('./ui-react.js', { with: { "resolution-mode": "import" } }).useSuperDocContentControls;
|
|
13
13
|
export declare const useSuperDocDocument: typeof import('./ui-react.js', { with: { "resolution-mode": "import" } }).useSuperDocDocument;
|
|
14
|
+
export declare const useSuperDocDocumentApi: typeof import('./ui-react.js', { with: { "resolution-mode": "import" } }).useSuperDocDocumentApi;
|
|
14
15
|
export declare const useSuperDocFontOptions: typeof import('./ui-react.js', { with: { "resolution-mode": "import" } }).useSuperDocFontOptions;
|
|
15
16
|
export declare const useSuperDocFontSizeOptions: typeof import('./ui-react.js', { with: { "resolution-mode": "import" } }).useSuperDocFontSizeOptions;
|
|
16
17
|
export declare const useSuperDocHost: typeof import('./ui-react.js', { with: { "resolution-mode": "import" } }).useSuperDocHost;
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
* - AIDEV-NOTE: `verify-public-facade-emit.cjs` parses this file and verifies
|
|
17
17
|
* the emitted declarations expose exactly these named exports.
|
|
18
18
|
*/
|
|
19
|
-
export { SuperDocUIProvider, useSuperDocUI, useSuperDocHost, useSetSuperDoc, useSuperDocSlice, useSuperDocSelection, useSuperDocSearch, useSuperDocComments, useSuperDocContentControls, useSuperDocTrackChanges, useSuperDocToolbar, useSuperDocCommand, useSuperDocDocument, useSuperDocFontOptions, useSuperDocFontSizeOptions, useSuperDocZoom, } from './ui/react.js';
|
|
19
|
+
export { SuperDocUIProvider, useSuperDocUI, useSuperDocHost, useSetSuperDoc, useSuperDocSlice, useSuperDocSelection, useSuperDocSearch, useSuperDocComments, useSuperDocContentControls, useSuperDocTrackChanges, useSuperDocToolbar, useSuperDocCommand, useSuperDocDocument, useSuperDocDocumentApi, useSuperDocFontOptions, useSuperDocFontSizeOptions, useSuperDocZoom, } from './ui/react.js';
|
|
20
20
|
export type { SuperDocHost, SuperDocUIProviderProps, UseSuperDocCommandResult } from './ui/react.js';
|
|
@@ -39,6 +39,7 @@ import type { DocumentApiRejectionReason as __Cjs_DocumentApiRejectionReason } f
|
|
|
39
39
|
import type { DocumentHandle as __Cjs_DocumentHandle } from './ui.js' with { "resolution-mode": "import" };
|
|
40
40
|
import type { DocumentReplacementResult as __Cjs_DocumentReplacementResult } from './ui.js' with { "resolution-mode": "import" };
|
|
41
41
|
import type { DocumentSlice as __Cjs_DocumentSlice } from './ui.js' with { "resolution-mode": "import" };
|
|
42
|
+
import type { DocumentStoryLocator as __Cjs_DocumentStoryLocator } from './ui.js' with { "resolution-mode": "import" };
|
|
42
43
|
import type { EntityAddress as __Cjs_EntityAddress } from './ui.js' with { "resolution-mode": "import" };
|
|
43
44
|
import type { EqualityFn as __Cjs_EqualityFn } from './ui.js' with { "resolution-mode": "import" };
|
|
44
45
|
import type { FontFamilyOption as __Cjs_FontFamilyOption } from './ui.js' with { "resolution-mode": "import" };
|
|
@@ -98,6 +99,11 @@ import type { SuperDocUIScope as __Cjs_SuperDocUIScope } from './ui.js' with { "
|
|
|
98
99
|
import type { SuperDocUIState as __Cjs_SuperDocUIState } from './ui.js' with { "resolution-mode": "import" };
|
|
99
100
|
import type { TableContextInfo as __Cjs_TableContextInfo } from './ui.js' with { "resolution-mode": "import" };
|
|
100
101
|
import type { TablesHandle as __Cjs_TablesHandle } from './ui.js' with { "resolution-mode": "import" };
|
|
102
|
+
import type { TemporaryMutationHandleInput as __Cjs_TemporaryMutationHandleInput } from './ui.js' with { "resolution-mode": "import" };
|
|
103
|
+
import type { TemporaryMutationInput as __Cjs_TemporaryMutationInput } from './ui.js' with { "resolution-mode": "import" };
|
|
104
|
+
import type { TemporaryMutationOperation as __Cjs_TemporaryMutationOperation } from './ui.js' with { "resolution-mode": "import" };
|
|
105
|
+
import type { TemporaryMutationReceipt as __Cjs_TemporaryMutationReceipt } from './ui.js' with { "resolution-mode": "import" };
|
|
106
|
+
import type { TemporaryMutationReplaceInput as __Cjs_TemporaryMutationReplaceInput } from './ui.js' with { "resolution-mode": "import" };
|
|
101
107
|
import type { TextAddress as __Cjs_TextAddress } from './ui.js' with { "resolution-mode": "import" };
|
|
102
108
|
import type { TextRangeRejectionReason as __Cjs_TextRangeRejectionReason } from './ui.js' with { "resolution-mode": "import" };
|
|
103
109
|
import type { TextTarget as __Cjs_TextTarget } from './ui.js' with { "resolution-mode": "import" };
|
|
@@ -118,6 +124,7 @@ import type { ViewportEntityHit as __Cjs_ViewportEntityHit } from './ui.js' with
|
|
|
118
124
|
import type { ViewportGetRectInput as __Cjs_ViewportGetRectInput } from './ui.js' with { "resolution-mode": "import" };
|
|
119
125
|
import type { ViewportGetRectsInput as __Cjs_ViewportGetRectsInput } from './ui.js' with { "resolution-mode": "import" };
|
|
120
126
|
import type { ViewportGetRectsResult as __Cjs_ViewportGetRectsResult } from './ui.js' with { "resolution-mode": "import" };
|
|
127
|
+
import type { ViewportGetRectTarget as __Cjs_ViewportGetRectTarget } from './ui.js' with { "resolution-mode": "import" };
|
|
121
128
|
import type { ViewportHandle as __Cjs_ViewportHandle } from './ui.js' with { "resolution-mode": "import" };
|
|
122
129
|
import type { ViewportRect as __Cjs_ViewportRect } from './ui.js' with { "resolution-mode": "import" };
|
|
123
130
|
import type { ViewportRectResult as __Cjs_ViewportRectResult } from './ui.js' with { "resolution-mode": "import" };
|
|
@@ -175,6 +182,7 @@ export type { __Cjs_DocumentApiRejectionReason as DocumentApiRejectionReason };
|
|
|
175
182
|
export type { __Cjs_DocumentHandle as DocumentHandle };
|
|
176
183
|
export type { __Cjs_DocumentReplacementResult as DocumentReplacementResult };
|
|
177
184
|
export type { __Cjs_DocumentSlice as DocumentSlice };
|
|
185
|
+
export type { __Cjs_DocumentStoryLocator as DocumentStoryLocator };
|
|
178
186
|
export type { __Cjs_EntityAddress as EntityAddress };
|
|
179
187
|
export type { __Cjs_EqualityFn as EqualityFn };
|
|
180
188
|
export type { __Cjs_FontFamilyOption as FontFamilyOption };
|
|
@@ -236,6 +244,11 @@ export type { __Cjs_SuperDocUIScope as SuperDocUIScope };
|
|
|
236
244
|
export type { __Cjs_SuperDocUIState as SuperDocUIState };
|
|
237
245
|
export type { __Cjs_TableContextInfo as TableContextInfo };
|
|
238
246
|
export type { __Cjs_TablesHandle as TablesHandle };
|
|
247
|
+
export type { __Cjs_TemporaryMutationHandleInput as TemporaryMutationHandleInput };
|
|
248
|
+
export type { __Cjs_TemporaryMutationInput as TemporaryMutationInput };
|
|
249
|
+
export type { __Cjs_TemporaryMutationOperation as TemporaryMutationOperation };
|
|
250
|
+
export type { __Cjs_TemporaryMutationReceipt as TemporaryMutationReceipt };
|
|
251
|
+
export type { __Cjs_TemporaryMutationReplaceInput as TemporaryMutationReplaceInput };
|
|
239
252
|
export type { __Cjs_TextAddress as TextAddress };
|
|
240
253
|
export type { __Cjs_TextRangeRejectionReason as TextRangeRejectionReason };
|
|
241
254
|
export type { __Cjs_TextTarget as TextTarget };
|
|
@@ -256,6 +269,7 @@ export type { __Cjs_ViewportEntityHit as ViewportEntityHit };
|
|
|
256
269
|
export type { __Cjs_ViewportGetRectInput as ViewportGetRectInput };
|
|
257
270
|
export type { __Cjs_ViewportGetRectsInput as ViewportGetRectsInput };
|
|
258
271
|
export type { __Cjs_ViewportGetRectsResult as ViewportGetRectsResult };
|
|
272
|
+
export type { __Cjs_ViewportGetRectTarget as ViewportGetRectTarget };
|
|
259
273
|
export type { __Cjs_ViewportHandle as ViewportHandle };
|
|
260
274
|
export type { __Cjs_ViewportRect as ViewportRect };
|
|
261
275
|
export type { __Cjs_ViewportRectResult as ViewportRectResult };
|
|
@@ -27,5 +27,5 @@ export { createSuperDocUI } from './ui/create-super-doc-ui.js';
|
|
|
27
27
|
export { getDocumentApiRejectionReason } from './ui/rejection-reasons.js';
|
|
28
28
|
export { shallowEqual } from './ui/equality.js';
|
|
29
29
|
export { BUILT_IN_COMMAND_IDS } from './ui/commands.js';
|
|
30
|
-
export type { EqualityFn, SelectorFn, Subscribable, SuperDocUI, BorrowedSuperDocUI, SuperDocUIOptions, SuperDocUIState, SuperDocUIScope, SuperDocLike, SuperDocEditorLike, CommandHandle, CommandState, CommandExecutionResult, WorkflowReceipt, WorkflowActionResult, WorkflowScrollResult, SelectionRestoreResult, SuperDocUIReason, CommandId, CommandsHandle, ContextMenuItem, ContextMenuHandle, WatermarkHandle, SearchController, SearchHandle, SearchQueryOptions, CustomCommandContext, CustomCommandHandle, CustomCommandHandleState, CustomCommandRegistration, CustomCommandRegistrationResult, MetadataHandle, SelectionHandle, TablesHandle, TableContextInfo, ToolbarHandle, BuiltInCommandId, ToolbarCommandId, CommentsHandle, TrackChangesHandle, ContentControlsHandle, BookmarksHandle, BookmarkAddress, ContentControlFocusResult, ContentControlHighlightResult, FontsHandle, ZoomHandle, DocumentHandle, DocumentReplacementResult, ViewportHandle, StylesHandle, ActiveParagraphStyle, SliceStatus, SelectionSlice, SelectionCapture, CommentAnchorCapture, ToolbarSnapshotSlice, CommentsSlice, TrackChangesSlice, ContentControlsSlice, FontsSlice, ZoomSlice, DocumentSlice, StylesSlice, SearchSnapshot, SearchSlice, StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, CommentInfo, CommentsListQuery, TrackChangeInfo, TrackChangePointHit, TrackChangesItem, FontFamilyOption, FontSizeOption, CommentAddress, TrackedChangeAddress, ContentControlViewportAddress, ViewportEntityAddress, ViewportEntityHit, ViewportContext, ViewportRect, ViewportGetRectInput, ViewportGetRectsInput, ViewportGetRectsResult, ViewportRectResult, BrowserDocumentApi, PartialBrowserDocumentApi, DocumentApi, Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, ScrollIntoViewInput, ScrollIntoViewOutput, EntityAddress, CommentsListResult, TrackChangesListResult, ContentControlsListResult, ContentControlInfo, ContentControlTarget, RichContentInsertInput, OperationCapabilityResolveResult, SDHtmlMarkdownSupportCheckResult, PictureWatermarkInput, RetainedPictureWatermarkInput, TextWatermark, WatermarkInfo, WatermarkTarget, WatermarksApplyInput, WatermarksApplyResult, WatermarksApplySuccess, WatermarksApplyTarget, } from './ui/types.js';
|
|
30
|
+
export type { EqualityFn, SelectorFn, Subscribable, SuperDocUI, BorrowedSuperDocUI, SuperDocUIOptions, SuperDocUIState, SuperDocUIScope, SuperDocLike, SuperDocEditorLike, CommandHandle, CommandState, CommandExecutionResult, WorkflowReceipt, WorkflowActionResult, WorkflowScrollResult, SelectionRestoreResult, SuperDocUIReason, CommandId, CommandsHandle, ContextMenuItem, ContextMenuHandle, WatermarkHandle, SearchController, SearchHandle, SearchQueryOptions, CustomCommandContext, CustomCommandHandle, CustomCommandHandleState, CustomCommandRegistration, CustomCommandRegistrationResult, MetadataHandle, SelectionHandle, TablesHandle, TableContextInfo, ToolbarHandle, BuiltInCommandId, ToolbarCommandId, CommentsHandle, TrackChangesHandle, ContentControlsHandle, BookmarksHandle, BookmarkAddress, ContentControlFocusResult, ContentControlHighlightResult, FontsHandle, ZoomHandle, DocumentHandle, DocumentReplacementResult, ViewportHandle, StylesHandle, ActiveParagraphStyle, SliceStatus, SelectionSlice, SelectionCapture, CommentAnchorCapture, ToolbarSnapshotSlice, CommentsSlice, TrackChangesSlice, ContentControlsSlice, FontsSlice, ZoomSlice, DocumentSlice, StylesSlice, SearchSnapshot, SearchSlice, StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, CommentInfo, CommentsListQuery, TrackChangeInfo, TrackChangePointHit, TrackChangesItem, FontFamilyOption, FontSizeOption, CommentAddress, TrackedChangeAddress, ContentControlViewportAddress, ViewportEntityAddress, ViewportEntityHit, ViewportContext, ViewportRect, ViewportGetRectInput, ViewportGetRectTarget, ViewportGetRectsInput, ViewportGetRectsResult, ViewportRectResult, BrowserDocumentApi, PartialBrowserDocumentApi, DocumentApi, Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, ScrollIntoViewInput, ScrollIntoViewOutput, EntityAddress, CommentsListResult, TrackChangesListResult, ContentControlsListResult, ContentControlInfo, ContentControlTarget, RichContentInsertInput, OperationCapabilityResolveResult, SDHtmlMarkdownSupportCheckResult, PictureWatermarkInput, RetainedPictureWatermarkInput, TextWatermark, WatermarkInfo, WatermarkTarget, WatermarksApplyInput, WatermarksApplyResult, WatermarksApplySuccess, WatermarksApplyTarget, TemporaryMutationOperation, TemporaryMutationInput, TemporaryMutationReplaceInput, TemporaryMutationHandleInput, TemporaryMutationReceipt, DocumentStoryLocator, } from './ui/types.js';
|
|
31
31
|
export type { PageMetricsHandle, PageMetricsSnapshot, PageMetricsPage, PageBodyTarget } from './ui/page-metrics.js';
|
package/dist/superdoc.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./chunks/rolldown-runtime-74VwNCz7.cjs");
|
|
3
3
|
const require_blank_docx = require("./chunks/blank-docx-BuFAbRjs.cjs");
|
|
4
|
-
const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-
|
|
4
|
+
const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-DK14sCrT.cjs");
|
|
5
5
|
const require_eventemitter3 = require("./chunks/eventemitter3-C_TAnXOl.cjs");
|
|
6
6
|
const require_uuid = require("./chunks/uuid-BhG0ngwk.cjs");
|
|
7
7
|
const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-BUdjGKyl.cjs");
|
|
@@ -260,7 +260,7 @@ var v_click_outside_default = {
|
|
|
260
260
|
var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
261
261
|
function getSuperdocVersion() {
|
|
262
262
|
try {
|
|
263
|
-
return "2.
|
|
263
|
+
return "2.27.0-next.2";
|
|
264
264
|
} catch {
|
|
265
265
|
return "unknown";
|
|
266
266
|
}
|
|
@@ -46242,7 +46242,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
46242
46242
|
}
|
|
46243
46243
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46244
46244
|
this.colorIndex = 0;
|
|
46245
|
-
this.version = "2.
|
|
46245
|
+
this.version = "2.27.0-next.2";
|
|
46246
46246
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46247
46247
|
this.superdocId = config.superdocId || require_uuid.v4();
|
|
46248
46248
|
this.colors = this.config.colors ?? [];
|
|
@@ -46342,6 +46342,9 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
46342
46342
|
this.#ensureContentControlActiveChangeBridge();
|
|
46343
46343
|
return this.#ui;
|
|
46344
46344
|
}
|
|
46345
|
+
getDocumentApi() {
|
|
46346
|
+
return this.activeEditor?.doc ?? null;
|
|
46347
|
+
}
|
|
46345
46348
|
get diagnostics() {
|
|
46346
46349
|
return this.#diagnostics;
|
|
46347
46350
|
}
|
|
@@ -48436,6 +48439,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
48436
48439
|
this.toolbar?.destroy?.();
|
|
48437
48440
|
this.commentsList?.close();
|
|
48438
48441
|
this.commentsList = null;
|
|
48442
|
+
this.#clearActiveEditorProjection();
|
|
48439
48443
|
if (this.app) {
|
|
48440
48444
|
this.#log("[superdoc] Unmounting app");
|
|
48441
48445
|
this.superdocStore?.reset();
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __toESM$2 } from "./chunks/rolldown-runtime-0pSA04fp.es.js";
|
|
2
2
|
import { t as blank_default } from "./chunks/blank-docx-DzQccOlW.es.js";
|
|
3
|
-
import { _ as isWorkflowRecordingEnabled, a as registerFirstPartyCommandMutation, c as getV2TrackedChangeMutationImpact, d as resolveImageSrc, g as getWorkflowRecording, h as createInteractionHistory, i as readFirstPartyPageNumbers, l as isPlainObject$1, m as closeInteractionHistory, n as executeFirstPartyCommandAsync, p as DOM_CLASS_NAMES, r as executeFirstPartyShortcutAsync, s as applyV2CommentInvalidationFromMutation, t as createSuperDocUI, u as createImageFilePicker, v as recordInteraction } from "./chunks/create-super-doc-ui-
|
|
3
|
+
import { _ as isWorkflowRecordingEnabled, a as registerFirstPartyCommandMutation, c as getV2TrackedChangeMutationImpact, d as resolveImageSrc, g as getWorkflowRecording, h as createInteractionHistory, i as readFirstPartyPageNumbers, l as isPlainObject$1, m as closeInteractionHistory, n as executeFirstPartyCommandAsync, p as DOM_CLASS_NAMES, r as executeFirstPartyShortcutAsync, s as applyV2CommentInvalidationFromMutation, t as createSuperDocUI, u as createImageFilePicker, v as recordInteraction } from "./chunks/create-super-doc-ui-BCQ5RHxy.es.js";
|
|
4
4
|
import { t as import_eventemitter3 } from "./chunks/eventemitter3-DEIiXiH2.es.js";
|
|
5
5
|
import { t as v4 } from "./chunks/uuid-H0Xcmmhy.es.js";
|
|
6
6
|
import { $ as vModelText, A as onActivated, B as renderSlot, C as isRef$1, D as normalizeClass, E as nextTick, F as openBlock, G as toRaw$2, H as resolveDynamicComponent, I as provide$1, J as unref, K as toRef, L as reactive, M as onDeactivated, N as onMounted, O as normalizeProps, P as onScopeDispose$1, Q as vModelSelect, R as ref, S as isReactive$1, T as mergeProps, U as shallowRef$1, V as resolveDirective, W as toDisplayString, X as useSlots, Y as useAttrs, Z as vModelCheckbox, _ as getCurrentInstance, a as computed$1, b as hasInjectionContext, c as createCommentVNode, d as createStaticVNode, et as watch$1, f as createTextVNode, g as effectScope, h as defineComponent, i as Transition, it as withModifiers, j as onBeforeUnmount, k as normalizeStyle, l as createElementBlock, m as defineAsyncComponent, n as Fragment, nt as withDirectives, o as createApp, p as createVNode, q as toRefs, r as Teleport, rt as withKeys, s as createBlock, t as _plugin_vue_export_helper_default, tt as withCtx, u as createElementVNode, v as getCurrentScope, w as markRaw, x as inject$1, y as h, z as renderList } from "./chunks/_plugin-vue_export-helper-7ZiLY07t.es.js";
|
|
@@ -258,7 +258,7 @@ var v_click_outside_default = {
|
|
|
258
258
|
var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
259
259
|
function getSuperdocVersion() {
|
|
260
260
|
try {
|
|
261
|
-
return "2.
|
|
261
|
+
return "2.27.0-next.2";
|
|
262
262
|
} catch {
|
|
263
263
|
return "unknown";
|
|
264
264
|
}
|
|
@@ -46172,7 +46172,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
46172
46172
|
}
|
|
46173
46173
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46174
46174
|
this.colorIndex = 0;
|
|
46175
|
-
this.version = "2.
|
|
46175
|
+
this.version = "2.27.0-next.2";
|
|
46176
46176
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46177
46177
|
this.superdocId = config.superdocId || v4();
|
|
46178
46178
|
this.colors = this.config.colors ?? [];
|
|
@@ -46272,6 +46272,9 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
46272
46272
|
this.#ensureContentControlActiveChangeBridge();
|
|
46273
46273
|
return this.#ui;
|
|
46274
46274
|
}
|
|
46275
|
+
getDocumentApi() {
|
|
46276
|
+
return this.activeEditor?.doc ?? null;
|
|
46277
|
+
}
|
|
46275
46278
|
get diagnostics() {
|
|
46276
46279
|
return this.#diagnostics;
|
|
46277
46280
|
}
|
|
@@ -48366,6 +48369,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
48366
48369
|
this.toolbar?.destroy?.();
|
|
48367
48370
|
this.commentsList?.close();
|
|
48368
48371
|
this.commentsList = null;
|
|
48372
|
+
this.#clearActiveEditorProjection();
|
|
48369
48373
|
if (this.app) {
|
|
48370
48374
|
this.#log("[superdoc] Unmounting app");
|
|
48371
48375
|
this.superdocStore?.reset();
|