superdoc 2.27.0-next.1 → 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.
@@ -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.27.0-next.1",
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.27.0-next.1",
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 = TemporaryCall<'insert', DocumentApiSurface['insert']> | TemporaryCall<'replace', DocumentApiSurface['replace']> | TemporaryCall<'delete', DocumentApiSurface['delete']> | TemporaryCall<'blocks.delete', DocumentApiSurface['blocks']['delete']> | TemporaryCall<'trackChanges.decide', DocumentApiSurface['trackChanges']['decide']> | TemporaryCall<'comments.create', DocumentApiSurface['comments']['create']>;
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 {};
@@ -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';
@@ -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
@@ -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.27.0-next.1";
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.27.0-next.1";
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 ?? [];
@@ -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.27.0-next.1";
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.27.0-next.1";
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 ?? [];