superdoc 2.0.0-next.24 → 2.0.0-next.25

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/AGENTS.md CHANGED
@@ -55,8 +55,8 @@ Drop SuperDoc into any HTML page via `<script>` tag. No bundler, no `npm install
55
55
 
56
56
  ### Production pinning and integrity
57
57
 
58
- - The examples above use the v2 `@next` channel. **In production, pin to a specific version** (for example `superdoc@2.0.0-beta.33`) so you control upgrades.
59
- - Add [SRI hashes](https://developer.mozilla.org/docs/Web/Security/Subresource_Integrity) for production. Generate with: `curl -s https://cdn.jsdelivr.net/npm/superdoc@2.0.0-beta.33/dist-cdn/superdoc.min.js | openssl dgst -sha384 -binary | openssl base64 -A | sed 's/^/sha384-/'`. Include `integrity="sha384-..." crossorigin="anonymous"` on each `<script>` and `<link>`.
58
+ - The examples above use the v2 `@next` channel. **In production, pin to a specific published `2.0.0-next.N` version** (for example `superdoc@2.0.0-next.24`) so you control upgrades.
59
+ - Add [SRI hashes](https://developer.mozilla.org/docs/Web/Security/Subresource_Integrity) for production. Generate with: `curl -s https://cdn.jsdelivr.net/npm/superdoc@2.0.0-next.24/dist-cdn/superdoc.min.js | openssl dgst -sha384 -binary | openssl base64 -A | sed 's/^/sha384-/'`. Include `integrity="sha384-..." crossorigin="anonymous"` on each `<script>` and `<link>`.
60
60
  - jsDelivr serves immutable, gzipped responses (~1.5 MB on the wire for `superdoc.min.js`).
61
61
 
62
62
  Unpkg is mirrored automatically: replace `cdn.jsdelivr.net/npm/` with `unpkg.com/`.
@@ -3051,6 +3051,11 @@ function createSuperDocUI(options) {
3051
3051
  if (fromConfig && fromRuntime && fromConfig !== fromRuntime) return fromConfig;
3052
3052
  return fromRuntime ?? fromConfig ?? fromOptions;
3053
3053
  };
3054
+ const commentsReadOnlyForReview = () => {
3055
+ const comments$1 = (((superdoc && typeof superdoc === "object" ? superdoc : null)?.config)?.modules)?.comments;
3056
+ return !!comments$1 && typeof comments$1 === "object" && comments$1.readOnly === true;
3057
+ };
3058
+ const reviewMutationsAreReadOnly = () => readDocumentMode() === "viewing" || commentsReadOnlyForReview();
3054
3059
  const normalizeSelectionInfo = (raw) => raw && typeof raw === "object" ? raw : null;
3055
3060
  const selectionSliceFromInfo = (info, status) => {
3056
3061
  if (!info) return {
@@ -3611,7 +3616,7 @@ function createSuperDocUI(options) {
3611
3616
  const supportsSingle = typeof tcApi?.decide === "function" || typeof tcApi?.[trackCommand.kind] === "function";
3612
3617
  const supportsAll = typeof tcApi?.decide === "function" || typeof tcApi?.[`${trackCommand.kind}All`] === "function";
3613
3618
  const supported = trackCommand.scope === "all" ? supportsAll : supportsSingle;
3614
- const reason = bulkTrackDecisionBlockedReason(trackCommand, tcApi) ?? trackDecisionReason(trackCommand, supported, readonly, selection$1, doc);
3619
+ const reason = bulkTrackDecisionBlockedReason(trackCommand, tcApi) ?? trackDecisionReason(trackCommand, supported, reviewMutationsAreReadOnly(), selection$1, doc);
3615
3620
  return normalizeCommandState({
3616
3621
  enabled: reason == null,
3617
3622
  active: false,
@@ -6118,7 +6123,7 @@ function createSuperDocUI(options) {
6118
6123
  }, id, story);
6119
6124
  };
6120
6125
  const executeTrackDecisionTarget = (kind, target, changeId, story) => {
6121
- if (readDocumentMode() === "viewing") return false;
6126
+ if (reviewMutationsAreReadOnly()) return false;
6122
6127
  const tcApi = getDoc()?.trackChanges;
6123
6128
  if (bulkTrackDecisionBlockedReason({
6124
6129
  kind,
@@ -3051,6 +3051,11 @@ function createSuperDocUI(options) {
3051
3051
  if (fromConfig && fromRuntime && fromConfig !== fromRuntime) return fromConfig;
3052
3052
  return fromRuntime ?? fromConfig ?? fromOptions;
3053
3053
  };
3054
+ const commentsReadOnlyForReview = () => {
3055
+ const comments$1 = (((superdoc && typeof superdoc === "object" ? superdoc : null)?.config)?.modules)?.comments;
3056
+ return !!comments$1 && typeof comments$1 === "object" && comments$1.readOnly === true;
3057
+ };
3058
+ const reviewMutationsAreReadOnly = () => readDocumentMode() === "viewing" || commentsReadOnlyForReview();
3054
3059
  const normalizeSelectionInfo = (raw) => raw && typeof raw === "object" ? raw : null;
3055
3060
  const selectionSliceFromInfo = (info, status) => {
3056
3061
  if (!info) return {
@@ -3611,7 +3616,7 @@ function createSuperDocUI(options) {
3611
3616
  const supportsSingle = typeof tcApi?.decide === "function" || typeof tcApi?.[trackCommand.kind] === "function";
3612
3617
  const supportsAll = typeof tcApi?.decide === "function" || typeof tcApi?.[`${trackCommand.kind}All`] === "function";
3613
3618
  const supported = trackCommand.scope === "all" ? supportsAll : supportsSingle;
3614
- const reason = bulkTrackDecisionBlockedReason(trackCommand, tcApi) ?? trackDecisionReason(trackCommand, supported, readonly, selection$1, doc);
3619
+ const reason = bulkTrackDecisionBlockedReason(trackCommand, tcApi) ?? trackDecisionReason(trackCommand, supported, reviewMutationsAreReadOnly(), selection$1, doc);
3615
3620
  return normalizeCommandState({
3616
3621
  enabled: reason == null,
3617
3622
  active: false,
@@ -6118,7 +6123,7 @@ function createSuperDocUI(options) {
6118
6123
  }, id, story);
6119
6124
  };
6120
6125
  const executeTrackDecisionTarget = (kind, target, changeId, story) => {
6121
- if (readDocumentMode() === "viewing") return false;
6126
+ if (reviewMutationsAreReadOnly()) return false;
6122
6127
  const tcApi = getDoc()?.trackChanges;
6123
6128
  if (bulkTrackDecisionBlockedReason({
6124
6129
  kind,
@@ -7,7 +7,7 @@ const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
7
7
  var PRIVATE_ENGINE_INFO = (0, __superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
8
8
  var ENGINE_INFO = Object.freeze({
9
9
  ...PRIVATE_ENGINE_INFO,
10
- superdocVersion: "2.0.0-next.24",
10
+ superdocVersion: "2.0.0-next.25",
11
11
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
12
12
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
13
13
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -6,7 +6,7 @@ const COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
6
6
  var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
7
7
  var ENGINE_INFO = Object.freeze({
8
8
  ...PRIVATE_ENGINE_INFO,
9
- superdocVersion: "2.0.0-next.24",
9
+ superdocVersion: "2.0.0-next.25",
10
10
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
11
11
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
12
12
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -95,6 +95,14 @@ export declare class PaginationEarlyStop extends Error {
95
95
  constructor();
96
96
  }
97
97
  export declare function isPaginationEarlyStop(error: unknown): error is PaginationEarlyStop;
98
+ /**
99
+ * Break paragraph-only spacing and border adjacency at an in-flow block boundary.
100
+ *
101
+ * Paragraph layout has already included `trailingSpacing` in `cursorY`, so this
102
+ * intentionally does not move the cursor. It only prevents a later paragraph
103
+ * from collapsing spacing or borders through an intervening block.
104
+ */
105
+ export declare function breakParagraphAdjacency(state: PageState): void;
98
106
  export declare function createPaginator(opts: PaginatorOptions): {
99
107
  readonly pages: Page[];
100
108
  readonly states: PageState[];
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../chunks/rolldown-runtime-_dR15c8t.cjs");
3
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DbFtp705.cjs");
3
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-CHZKlLiH.cjs");
4
4
  let react = require("react");
5
5
  var SuperDocUIContext = (0, react.createContext)(null);
6
6
  function SuperDocUIProvider(props) {
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-BMpP-iB6.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-CBs8xQUw.es.js";
2
2
  import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
3
3
  var SuperDocUIContext = createContext(null);
4
4
  function SuperDocUIProvider(props) {
@@ -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-DbFtp705.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-CHZKlLiH.cjs");
3
3
  exports.BUILT_IN_COMMAND_IDS = require_create_super_doc_ui.BUILT_IN_COMMAND_IDS;
4
4
  exports.createSuperDocUI = require_create_super_doc_ui.createSuperDocUI;
5
5
  exports.shallowEqual = require_create_super_doc_ui.shallowEqual;
@@ -1,2 +1,2 @@
1
- import { n as BUILT_IN_COMMAND_IDS, r as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-BMpP-iB6.es.js";
1
+ import { n as BUILT_IN_COMMAND_IDS, r as shallowEqual, t as createSuperDocUI } from "../chunks/create-super-doc-ui-CBs8xQUw.es.js";
2
2
  export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };