superdoc 2.24.0-next.9 → 2.24.0

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.
Files changed (29) hide show
  1. package/dist/collaboration-upgrade-engine.cjs +1 -1
  2. package/dist/collaboration-upgrade-engine.es.js +1 -1
  3. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  4. package/dist/document-api/src/contract/operation-definitions.d.ts +19 -1
  5. package/dist/document-api/src/get/get.d.ts +2 -1
  6. package/dist/document-api/src/index.d.ts +9 -6
  7. package/dist/document-api/src/inline-semantics/token-sets.d.ts +11 -0
  8. package/dist/document-api/src/styles/apply.d.ts +5 -0
  9. package/dist/document-api/src/styles/catalog.d.ts +40 -19
  10. package/dist/document-api/src/styles/create.d.ts +160 -0
  11. package/dist/document-api/src/styles/index.d.ts +8 -4
  12. package/dist/document-api/src/styles/registry.d.ts +34 -2
  13. package/dist/document-api/src/styles/schema.d.ts +24 -5
  14. package/dist/document-api/src/styles/theme.d.ts +32 -0
  15. package/dist/document-api/src/styles/validation.d.ts +11 -2
  16. package/dist/document-api/src/templates/apply.d.ts +13 -15
  17. package/dist/document-api/src/types/fragment.d.ts +3 -0
  18. package/dist/document-api/src/types/query-match.types.d.ts +43 -5
  19. package/dist/document-api/src/types/sd-props.d.ts +54 -14
  20. package/dist/document-api/src/types/sd-styles.d.ts +58 -3
  21. package/dist/style.css +22 -22
  22. package/dist/style.layered.css +22 -22
  23. package/dist/superdoc/src/core/editor-runtime/v2/v2-session-shortcut-routes.d.ts +2 -0
  24. package/dist/superdoc.cjs +11 -8
  25. package/dist/superdoc.es.js +11 -8
  26. package/dist-cdn/style.layered.css +1 -1
  27. package/dist-cdn/superdoc.min.css +1 -1
  28. package/dist-cdn/superdoc.min.js +18 -18
  29. package/package.json +2 -2
@@ -45,6 +45,8 @@ export interface CreateV2SessionShortcutRoutesDeps {
45
45
  resolveToolbarElement: () => HTMLElement | null | undefined;
46
46
  /** Resolve the live public Document API facade, or null when unavailable. */
47
47
  getDocumentApi: () => ReferenceDocumentApi | null | undefined;
48
+ /** Scope each first-party mutation after its asynchronous list has resolved. */
49
+ runReferenceMutation?: (memberPath: 'toc.update' | 'fields.rebuild' | 'index.rebuild', input: unknown) => unknown;
48
50
  /**
49
51
  * The built-in page-number command. When present, the PAGE shortcut runs it,
50
52
  * so the shortcut and the toolbar control insert and place the caret the same way.
package/dist/superdoc.cjs CHANGED
@@ -304,7 +304,7 @@ var awarenessStatesToArray = (context, states) => {
304
304
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
305
305
  function getSuperdocVersion() {
306
306
  try {
307
- return "2.24.0-next.9";
307
+ return "2.24.0";
308
308
  } catch {
309
309
  return "unknown";
310
310
  }
@@ -21117,9 +21117,10 @@ function createV2SessionShortcutRoutes(deps) {
21117
21117
  handled: false,
21118
21118
  reason: "document-api-unavailable"
21119
21119
  };
21120
- let ran = runListThenApply(doc.toc?.list, doc.toc?.update);
21121
- ran = runListThenApply(doc.fields?.list, doc.fields?.rebuild) || ran;
21122
- ran = runListThenApply(doc.index?.list, doc.index?.rebuild) || ran;
21120
+ const apply = (memberPath, mutation) => isFn(mutation) ? (input) => deps.runReferenceMutation ? deps.runReferenceMutation(memberPath, input) : mutation(input) : void 0;
21121
+ let ran = runListThenApply(doc.toc?.list, apply("toc.update", doc.toc?.update));
21122
+ ran = runListThenApply(doc.fields?.list, apply("fields.rebuild", doc.fields?.rebuild)) || ran;
21123
+ ran = runListThenApply(doc.index?.list, apply("index.rebuild", doc.index?.rebuild)) || ran;
21123
21124
  return ran ? true : {
21124
21125
  handled: false,
21125
21126
  reason: "field-update-workflow-unavailable"
@@ -22488,7 +22489,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
22488
22489
  console.warn("[SuperDoc] v2 session-shortcut unbind failed", err);
22489
22490
  }
22490
22491
  };
22491
- const installV2SessionShortcutBinding = ({ documentId, bindSessionShortcuts, documentApi }) => {
22492
+ const installV2SessionShortcutBinding = ({ documentId, bindSessionShortcuts, documentApi, firstPartyCommandMutation }) => {
22492
22493
  if (!documentId) return;
22493
22494
  clearV2SessionShortcutBinding(documentId);
22494
22495
  if (typeof bindSessionShortcuts !== "function") return;
@@ -22496,6 +22497,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
22496
22497
  routes: createV2SessionShortcutRoutes({
22497
22498
  resolveToolbarElement: () => proxy.$superdoc?.toolbar?.toolbarContainer ?? null,
22498
22499
  getDocumentApi: () => documentApi ?? null,
22500
+ ...firstPartyCommandMutation ? { runReferenceMutation: (memberPath, input) => firstPartyCommandMutation.run(memberPath, [input]) } : {},
22499
22501
  pageNumberCommand: {
22500
22502
  isEnabled: () => getSuperDocUI()?.commands.get("page-number-insert").getState().enabled === true,
22501
22503
  execute: () => {
@@ -23002,7 +23004,8 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
23002
23004
  installV2SessionShortcutBinding({
23003
23005
  documentId,
23004
23006
  bindSessionShortcuts,
23005
- documentApi
23007
+ documentApi,
23008
+ firstPartyCommandMutation
23006
23009
  });
23007
23010
  if (collaborationProvider && resolveDocumentV2Collaboration(getDocument(documentId)).state === "valid") onEditorCollaborationReady({ editor: facade });
23008
23011
  if (pageMetrics && pageLayout) syncV2RulerActiveEditor();
@@ -24817,7 +24820,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
24817
24820
  ], 38);
24818
24821
  };
24819
24822
  }
24820
- }, [["__scopeId", "data-v-f53aafe0"]]);
24823
+ }, [["__scopeId", "data-v-38ecd481"]]);
24821
24824
  //#endregion
24822
24825
  //#region src/core/create-app.js
24823
24826
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -46621,7 +46624,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
46621
46624
  }
46622
46625
  this.userColorMap = /* @__PURE__ */ new Map();
46623
46626
  this.colorIndex = 0;
46624
- this.version = "2.24.0-next.9";
46627
+ this.version = "2.24.0";
46625
46628
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46626
46629
  this.superdocId = config.superdocId || require_uuid.v4();
46627
46630
  this.colors = this.config.colors ?? [];
@@ -302,7 +302,7 @@ var awarenessStatesToArray = (context, states) => {
302
302
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
303
303
  function getSuperdocVersion() {
304
304
  try {
305
- return "2.24.0-next.9";
305
+ return "2.24.0";
306
306
  } catch {
307
307
  return "unknown";
308
308
  }
@@ -21084,9 +21084,10 @@ function createV2SessionShortcutRoutes(deps) {
21084
21084
  handled: false,
21085
21085
  reason: "document-api-unavailable"
21086
21086
  };
21087
- let ran = runListThenApply(doc.toc?.list, doc.toc?.update);
21088
- ran = runListThenApply(doc.fields?.list, doc.fields?.rebuild) || ran;
21089
- ran = runListThenApply(doc.index?.list, doc.index?.rebuild) || ran;
21087
+ const apply = (memberPath, mutation) => isFn(mutation) ? (input) => deps.runReferenceMutation ? deps.runReferenceMutation(memberPath, input) : mutation(input) : void 0;
21088
+ let ran = runListThenApply(doc.toc?.list, apply("toc.update", doc.toc?.update));
21089
+ ran = runListThenApply(doc.fields?.list, apply("fields.rebuild", doc.fields?.rebuild)) || ran;
21090
+ ran = runListThenApply(doc.index?.list, apply("index.rebuild", doc.index?.rebuild)) || ran;
21090
21091
  return ran ? true : {
21091
21092
  handled: false,
21092
21093
  reason: "field-update-workflow-unavailable"
@@ -22447,7 +22448,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22447
22448
  console.warn("[SuperDoc] v2 session-shortcut unbind failed", err);
22448
22449
  }
22449
22450
  };
22450
- const installV2SessionShortcutBinding = ({ documentId, bindSessionShortcuts, documentApi }) => {
22451
+ const installV2SessionShortcutBinding = ({ documentId, bindSessionShortcuts, documentApi, firstPartyCommandMutation }) => {
22451
22452
  if (!documentId) return;
22452
22453
  clearV2SessionShortcutBinding(documentId);
22453
22454
  if (typeof bindSessionShortcuts !== "function") return;
@@ -22455,6 +22456,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22455
22456
  routes: createV2SessionShortcutRoutes({
22456
22457
  resolveToolbarElement: () => proxy.$superdoc?.toolbar?.toolbarContainer ?? null,
22457
22458
  getDocumentApi: () => documentApi ?? null,
22459
+ ...firstPartyCommandMutation ? { runReferenceMutation: (memberPath, input) => firstPartyCommandMutation.run(memberPath, [input]) } : {},
22458
22460
  pageNumberCommand: {
22459
22461
  isEnabled: () => getSuperDocUI()?.commands.get("page-number-insert").getState().enabled === true,
22460
22462
  execute: () => {
@@ -22961,7 +22963,8 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22961
22963
  installV2SessionShortcutBinding({
22962
22964
  documentId,
22963
22965
  bindSessionShortcuts,
22964
- documentApi
22966
+ documentApi,
22967
+ firstPartyCommandMutation
22965
22968
  });
22966
22969
  if (collaborationProvider && resolveDocumentV2Collaboration(getDocument(documentId)).state === "valid") onEditorCollaborationReady({ editor: facade });
22967
22970
  if (pageMetrics && pageLayout) syncV2RulerActiveEditor();
@@ -24776,7 +24779,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
24776
24779
  ], 38);
24777
24780
  };
24778
24781
  }
24779
- }, [["__scopeId", "data-v-f53aafe0"]]);
24782
+ }, [["__scopeId", "data-v-38ecd481"]]);
24780
24783
  //#endregion
24781
24784
  //#region src/core/create-app.js
24782
24785
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -46550,7 +46553,7 @@ var SuperDoc = class extends import_eventemitter3.default {
46550
46553
  }
46551
46554
  this.userColorMap = /* @__PURE__ */ new Map();
46552
46555
  this.colorIndex = 0;
46553
- this.version = "2.24.0-next.9";
46556
+ this.version = "2.24.0";
46554
46557
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46555
46558
  this.superdocId = config.superdocId || v4();
46556
46559
  this.colors = this.config.colors ?? [];