superdoc 2.19.0-next.1 → 2.19.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.19.0-next.1",
22
+ superdocVersion: "2.19.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.19.0-next.1",
21
+ superdocVersion: "2.19.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
@@ -57,6 +57,32 @@ export interface TrackChangeWordRevisionIds {
57
57
  /** Durable membership of one authored text rewrite; children can be decided individually. */
58
58
  export interface TrackChangeRewriteReviewGroup {
59
59
  kind: 'text-rewrite';
60
+ /**
61
+ * Provenance basis for this review group, distinct from the unrelated flat
62
+ * {@link TrackChangeInfo.origin} (importing platform, e.g. Word/Google
63
+ * Docs). `'authored-operation'` here reflects an authored `text.rewrite`
64
+ * transaction (spec SD-5189 CASE-3).
65
+ */
66
+ groupOrigin: 'authored-operation';
67
+ role: 'parent' | 'child';
68
+ parentId?: string;
69
+ childChangeIds: readonly string[];
70
+ members: readonly {
71
+ id: string;
72
+ type: TrackChangeBroadType;
73
+ subtype: string;
74
+ sourceIds: TrackChangeSourceIds;
75
+ }[];
76
+ }
77
+ /**
78
+ * Durable membership of one document-comparison hunk; children can be
79
+ * decided individually. Distinct from {@link TrackChangeRewriteReviewGroup}:
80
+ * a comparison hunk originates from `diff.apply({changeMode:'tracked'})`,
81
+ * not an authored rewrite transaction (spec SD-4953, SD-5189 CASE-2/CASE-3).
82
+ */
83
+ export interface TrackChangeComparisonHunkReviewGroup {
84
+ kind: 'comparison-hunk';
85
+ groupOrigin: 'comparison-hunk';
60
86
  role: 'parent' | 'child';
61
87
  parentId?: string;
62
88
  childChangeIds: readonly string[];
@@ -67,6 +93,13 @@ export interface TrackChangeRewriteReviewGroup {
67
93
  sourceIds: TrackChangeSourceIds;
68
94
  }[];
69
95
  }
96
+ /**
97
+ * Public review-group union (spec SD-5189 CASE-3). Only the two producer
98
+ * kinds this contract covers today; whether the kernel's other internal
99
+ * review-group kinds (formatting/structural/list-delta variants) also need
100
+ * public projection is an open question left to whoever owns those surfaces.
101
+ */
102
+ export type TrackChangeReviewGroup = TrackChangeRewriteReviewGroup | TrackChangeComparisonHunkReviewGroup;
70
103
  /**
71
104
  * Canonical multi-side source provenance per spec §3 / §4. Each value is
72
105
  * raw, source-format identity (Word `w:id`, `w:rsidR` / `w:rsidDel`, future
@@ -519,7 +552,7 @@ export interface TrackChangeInfo {
519
552
  wordRevisionIds?: TrackChangeWordRevisionIds;
520
553
  /** Stable revision-group id (spec §3, fragment lineage). */
521
554
  revisionGroupId?: string;
522
- reviewGroup?: TrackChangeRewriteReviewGroup;
555
+ reviewGroup?: TrackChangeReviewGroup;
523
556
  /** Set to the retired source id when this change is a partial-split fragment; otherwise `null`. */
524
557
  splitFromId?: string | null;
525
558
  /** Replacement side metadata (`grouped` mode replacements only). */
@@ -651,7 +684,7 @@ export interface TrackChangeDomain {
651
684
  structuralDescriptor?: TrackChangeStructuralDescriptor;
652
685
  /** Stable revision-group id. */
653
686
  revisionGroupId?: string;
654
- reviewGroup?: TrackChangeRewriteReviewGroup;
687
+ reviewGroup?: TrackChangeReviewGroup;
655
688
  /** Set to the retired source id when this list item is a partial-split fragment; otherwise `null`. */
656
689
  splitFromId?: string | null;
657
690
  /**
@@ -149,15 +149,16 @@ export declare class SuperDoc extends EventEmitter<SuperDocEventMap> {
149
149
  * and throw a clear lifecycle error instead.
150
150
  */
151
151
  users: User[];
152
- /** Yjs document for collaboration; set in `#init` when collaboration is enabled, otherwise undefined. */
152
+ /**
153
+ * Not set in v2. SuperDoc owns the collaboration `Y.Doc` inside its
154
+ * collaboration worker and does not expose it on the main thread.
155
+ */
153
156
  ydoc: Y.Doc | undefined;
154
157
  /**
155
- * Provider for the SuperDoc-level collaboration room (separate from
156
- * per-document providers). Widened to `CollaborationProvider` to match
157
- * the runtime, which stores whatever provider the consumer passed via
158
- * `Config.modules.collaboration.provider`. Consumers needing Hocuspocus-
159
- * specific members must narrow before use.
160
- *
158
+ * Collaboration provider facade for the active v2 room. It is not a
159
+ * provider instance: SuperDoc owns the provider inside its collaboration
160
+ * worker, and this object only offers `sendStateless(message)`. It is
161
+ * `undefined` or `null` when no room is open.
161
162
  */
162
163
  provider: CollaborationProvider | undefined;
163
164
  /**
@@ -1023,14 +1023,16 @@ export interface Document {
1023
1023
  isNewFile?: boolean;
1024
1024
  /** Password for this encrypted DOCX. Overrides top-level `Config.password`. */
1025
1025
  password?: string;
1026
- /** The Yjs document for collaboration. */
1026
+ /**
1027
+ * Not set in v2 and cannot be supplied. SuperDoc owns the collaboration
1028
+ * `Y.Doc` inside its worker; configure the room with `collaboration`.
1029
+ */
1027
1030
  ydoc?: YDoc;
1028
1031
  /**
1029
- * The provider for collaboration. Widened from `HocuspocusProvider` to
1030
- * `CollaborationProvider` to match the runtime, which stores whatever
1031
- * provider the consumer passed via `Config.modules.collaboration.provider`
1032
- * (HocuspocusProvider, LiveblocksYjsProvider, TiptapCollabProvider, etc.).
1033
- * Consumers needing Hocuspocus-specific members must narrow before use.
1032
+ * Collaboration provider facade for this document's v2 room. It is not a
1033
+ * provider instance and cannot be supplied: SuperDoc owns the provider
1034
+ * inside its collaboration worker, and this object only offers
1035
+ * `sendStateless(message)`. Configure the room with `collaboration`.
1034
1036
  */
1035
1037
  provider?: CollaborationProvider;
1036
1038
  /**
@@ -1143,19 +1145,30 @@ export interface RuntimeDocument extends Document {
1143
1145
  */
1144
1146
  removeComments?: () => void;
1145
1147
  }
1146
- /** Collaboration module configuration. */
1148
+ /**
1149
+ * SuperDoc v1 collaboration module configuration.
1150
+ *
1151
+ * SuperDoc v2 rejects this configuration at runtime: it owns the `Y.Doc` and
1152
+ * provider inside its collaboration worker, so it neither attaches an external
1153
+ * `{ ydoc, provider }` pair nor opens the internal provider these fields
1154
+ * describe. Configure a room with `document.collaboration`
1155
+ * (`DocumentCollaborationConfig`) instead. To keep an existing provider setup,
1156
+ * see https://docs.superdoc.dev/editor/collaboration/use-your-own-provider
1157
+ *
1158
+ * @deprecated replaceWith=`DocumentCollaborationConfig` removeIn=v3.0
1159
+ */
1147
1160
  export interface CollaborationConfig {
1148
- /** External Yjs document (provider-agnostic mode). */
1161
+ /** SuperDoc v1 external Yjs document. Rejected by v2, which owns its `Y.Doc`. */
1149
1162
  ydoc?: YDoc;
1150
- /** External collaboration provider (provider-agnostic mode). */
1163
+ /** SuperDoc v1 external provider. Rejected by v2, which owns its provider. */
1151
1164
  provider?: CollaborationProvider;
1152
- /** Internal provider type (deprecated). */
1165
+ /** SuperDoc v1 internal provider type. Use `DocumentCollaborationConfig.providerType`. */
1153
1166
  providerType?: 'hocuspocus' | 'superdoc';
1154
- /** WebSocket URL for internal provider (deprecated). */
1167
+ /** SuperDoc v1 internal provider URL. Use `DocumentCollaborationConfig` `serverUrl`. */
1155
1168
  url?: string;
1156
- /** Authentication token for internal provider (deprecated). */
1169
+ /** SuperDoc v1 internal provider token. Use `DocumentCollaborationConfig` `token`. */
1157
1170
  token?: string;
1158
- /** Additional params for internal provider (deprecated). */
1171
+ /** SuperDoc v1 internal provider params. Use `DocumentCollaborationConfig` `params`. */
1159
1172
  params?: object;
1160
1173
  }
1161
1174
  /**
@@ -2548,7 +2561,12 @@ export interface Modules {
2548
2561
  /** Canvas render scale (quality). */
2549
2562
  outputScale?: number;
2550
2563
  } & Record<string, unknown>;
2551
- /** Collaboration module configuration. */
2564
+ /**
2565
+ * SuperDoc v1 collaboration module. SuperDoc v2 refuses it at runtime and
2566
+ * attaches nothing; configure `document.collaboration` instead.
2567
+ *
2568
+ * @deprecated replaceWith=`Document.collaboration` removeIn=v3.0
2569
+ */
2552
2570
  collaboration?: CollaborationConfig;
2553
2571
  /**
2554
2572
  * Toolbar module configuration. Pass `true` to configure the toolbar with
package/dist/superdoc.cjs CHANGED
@@ -316,7 +316,7 @@ var shuffleArray = (array) => {
316
316
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
317
317
  function getSuperdocVersion() {
318
318
  try {
319
- return "2.19.0-next.1";
319
+ return "2.19.0-next.2";
320
320
  } catch {
321
321
  return "unknown";
322
322
  }
@@ -5456,13 +5456,13 @@ function resolveProviderExtension(candidate) {
5456
5456
  if (!adapterId) return {
5457
5457
  ok: false,
5458
5458
  reason: "invalid-adapter-id",
5459
- message: "SuperDoc v2 provider extensions require a non-empty v2Collaboration.adapterId."
5459
+ message: "SuperDoc v2 provider extensions require a non-empty collaboration.adapterId."
5460
5460
  };
5461
5461
  const documentId = normalizeNonEmptyString(candidate.documentId);
5462
5462
  if (!documentId) return {
5463
5463
  ok: false,
5464
5464
  reason: "invalid-document-id",
5465
- message: "SuperDoc v2 provider extensions require a non-empty v2Collaboration.documentId."
5465
+ message: "SuperDoc v2 provider extensions require a non-empty collaboration.documentId."
5466
5466
  };
5467
5467
  const roomMode = normalizeRoomMode(candidate.roomMode);
5468
5468
  if (!roomMode) return invalidRoomMode();
@@ -45686,7 +45686,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
45686
45686
  this.config.colors = shuffleArray(this.config.colors);
45687
45687
  this.userColorMap = /* @__PURE__ */ new Map();
45688
45688
  this.colorIndex = 0;
45689
- this.version = "2.19.0-next.1";
45689
+ this.version = "2.19.0-next.2";
45690
45690
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
45691
45691
  this.superdocId = config.superdocId || require_uuid.v4();
45692
45692
  this.colors = this.config.colors ?? [];
@@ -47078,7 +47078,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
47078
47078
  {
47079
47079
  feature: "shell.collaboration",
47080
47080
  status: "supported",
47081
- reason: "v2 single-doc y-websocket collaboration is wired through document.v2Collaboration, including collaboration-ready, awareness-update, and locked event bridges; arbitrary external { ydoc, provider } adapters remain unsupported"
47081
+ reason: "v2 single-doc collaboration (hocuspocus, y-websocket, liveblocks, and registered provider extensions) is wired through document.collaboration, including collaboration-ready, awareness-update, and locked event bridges; external { ydoc, provider } instances remain unsupported"
47082
47082
  },
47083
47083
  {
47084
47084
  feature: "shell.context-menu",
@@ -315,7 +315,7 @@ var shuffleArray = (array) => {
315
315
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
316
316
  function getSuperdocVersion() {
317
317
  try {
318
- return "2.19.0-next.1";
318
+ return "2.19.0-next.2";
319
319
  } catch {
320
320
  return "unknown";
321
321
  }
@@ -5455,13 +5455,13 @@ function resolveProviderExtension(candidate) {
5455
5455
  if (!adapterId) return {
5456
5456
  ok: false,
5457
5457
  reason: "invalid-adapter-id",
5458
- message: "SuperDoc v2 provider extensions require a non-empty v2Collaboration.adapterId."
5458
+ message: "SuperDoc v2 provider extensions require a non-empty collaboration.adapterId."
5459
5459
  };
5460
5460
  const documentId = normalizeNonEmptyString(candidate.documentId);
5461
5461
  if (!documentId) return {
5462
5462
  ok: false,
5463
5463
  reason: "invalid-document-id",
5464
- message: "SuperDoc v2 provider extensions require a non-empty v2Collaboration.documentId."
5464
+ message: "SuperDoc v2 provider extensions require a non-empty collaboration.documentId."
5465
5465
  };
5466
5466
  const roomMode = normalizeRoomMode(candidate.roomMode);
5467
5467
  if (!roomMode) return invalidRoomMode();
@@ -45617,7 +45617,7 @@ var SuperDoc = class extends import_eventemitter3.default {
45617
45617
  this.config.colors = shuffleArray(this.config.colors);
45618
45618
  this.userColorMap = /* @__PURE__ */ new Map();
45619
45619
  this.colorIndex = 0;
45620
- this.version = "2.19.0-next.1";
45620
+ this.version = "2.19.0-next.2";
45621
45621
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
45622
45622
  this.superdocId = config.superdocId || v4();
45623
45623
  this.colors = this.config.colors ?? [];
@@ -47009,7 +47009,7 @@ var SuperDoc = class extends import_eventemitter3.default {
47009
47009
  {
47010
47010
  feature: "shell.collaboration",
47011
47011
  status: "supported",
47012
- reason: "v2 single-doc y-websocket collaboration is wired through document.v2Collaboration, including collaboration-ready, awareness-update, and locked event bridges; arbitrary external { ydoc, provider } adapters remain unsupported"
47012
+ reason: "v2 single-doc collaboration (hocuspocus, y-websocket, liveblocks, and registered provider extensions) is wired through document.collaboration, including collaboration-ready, awareness-update, and locked event bridges; external { ydoc, provider } instances remain unsupported"
47013
47013
  },
47014
47014
  {
47015
47015
  feature: "shell.context-menu",