superdoc 2.23.0-next.1 → 2.23.0-next.10

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/chunks/{create-super-doc-ui-MSiU8Kg0.cjs → create-super-doc-ui-CbiiPcgr.cjs} +5 -1
  2. package/dist/chunks/{create-super-doc-ui-DmGX1w-i.es.js → create-super-doc-ui-DHW9Toxn.es.js} +5 -1
  3. package/dist/collaboration-upgrade-engine.cjs +1 -1
  4. package/dist/collaboration-upgrade-engine.es.js +1 -1
  5. package/dist/document-api/src/capabilities/capabilities.d.ts +7 -0
  6. package/dist/document-api/src/types/clipboard.d.ts +25 -0
  7. package/dist/document-api/src/types/sd-contract.d.ts +1 -1
  8. package/dist/layout-engine/contracts/src/index.d.ts +2 -0
  9. package/dist/layout-engine/layout-engine/src/index.d.ts +2 -0
  10. package/dist/layout-engine/painters/dom/src/paragraph/list-marker.d.ts +3 -1
  11. package/dist/layout-engine/painters/dom/src/table/border-utils.d.ts +1 -1
  12. package/dist/layout-engine/style-engine/src/normalize/index.d.ts +1 -1
  13. package/dist/layout-engine/style-engine/src/normalize/run-attrs.d.ts +12 -0
  14. package/dist/public/ui-react.cjs +1 -1
  15. package/dist/public/ui-react.es.js +1 -1
  16. package/dist/public/ui-vue.cjs +1 -1
  17. package/dist/public/ui-vue.es.js +1 -1
  18. package/dist/public/ui.cjs +1 -1
  19. package/dist/public/ui.es.js +1 -1
  20. package/dist/shared/common/list-marker-utils.d.ts +1 -1
  21. package/dist/style.css +106 -114
  22. package/dist/style.layered.css +106 -114
  23. package/dist/superdoc/src/core/collaboration/permissions.d.ts +1 -0
  24. package/dist/superdoc.cjs +95 -47
  25. package/dist/superdoc.es.js +95 -47
  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 +43 -42
  29. package/package.json +2 -2
@@ -5090,8 +5090,12 @@ function selectionBlockRange(selection) {
5090
5090
  */
5091
5091
  function selectionBlockIds(selection) {
5092
5092
  const ids = [];
5093
+ const seen = /* @__PURE__ */ new Set();
5093
5094
  const push = (id) => {
5094
- if (typeof id === "string" && id.length > 0 && !ids.includes(id)) ids.push(id);
5095
+ if (typeof id === "string" && id.length > 0 && !seen.has(id)) {
5096
+ seen.add(id);
5097
+ ids.push(id);
5098
+ }
5095
5099
  };
5096
5100
  const target = selection.target;
5097
5101
  const segments = target && Array.isArray(target.segments) ? target.segments : [];
@@ -5089,8 +5089,12 @@ function selectionBlockRange(selection) {
5089
5089
  */
5090
5090
  function selectionBlockIds(selection) {
5091
5091
  const ids = [];
5092
+ const seen = /* @__PURE__ */ new Set();
5092
5093
  const push = (id) => {
5093
- if (typeof id === "string" && id.length > 0 && !ids.includes(id)) ids.push(id);
5094
+ if (typeof id === "string" && id.length > 0 && !seen.has(id)) {
5095
+ seen.add(id);
5096
+ ids.push(id);
5097
+ }
5094
5098
  };
5095
5099
  const target = selection.target;
5096
5100
  const segments = target && Array.isArray(target.segments) ? target.segments : [];
@@ -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.23.0-next.1",
22
+ superdocVersion: "2.23.0-next.10",
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.23.0-next.1",
21
+ superdocVersion: "2.23.0-next.10",
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
@@ -51,6 +51,13 @@ export type OperationCapabilities = Record<OperationId, OperationRuntimeCapabili
51
51
  export interface PlanEngineCapabilities {
52
52
  /** Step op codes the engine can execute (e.g., 'text.rewrite', 'format.apply'). */
53
53
  supportedStepOps: readonly string[];
54
+ /** Proven targeting modes; operation-specific restrictions remain in unsupported cells. */
55
+ supportedTargets?: readonly string[];
56
+ /** Named unsupported combinations with stable, discoverable reasons. */
57
+ unsupported?: readonly {
58
+ cell: string;
59
+ reason: string;
60
+ }[];
54
61
  /** Non-uniform style resolution strategies available for `onNonUniform`. */
55
62
  supportedNonUniformStrategies: readonly string[];
56
63
  /** Mark names that `setMarks` can override (e.g., 'bold', 'italic'). */
@@ -222,6 +222,31 @@ export interface SDPasteTableCell {
222
222
  bottomPt?: number;
223
223
  leftPt?: number;
224
224
  };
225
+ /** Direct vertical cell alignment. */
226
+ verticalAlign?: 'top' | 'center' | 'bottom';
227
+ /** Direct per-edge cell borders in OOXML-compatible form. */
228
+ borders?: {
229
+ top?: {
230
+ lineStyle: string;
231
+ lineWeightPt: number;
232
+ color: string;
233
+ };
234
+ right?: {
235
+ lineStyle: string;
236
+ lineWeightPt: number;
237
+ color: string;
238
+ };
239
+ bottom?: {
240
+ lineStyle: string;
241
+ lineWeightPt: number;
242
+ color: string;
243
+ };
244
+ left?: {
245
+ lineStyle: string;
246
+ lineWeightPt: number;
247
+ color: string;
248
+ };
249
+ };
225
250
  sourcePath?: readonly (string | number)[];
226
251
  }
227
252
  export interface SDPasteTableRow {
@@ -2,7 +2,7 @@ import { BlockNodeAddress } from './base.js';
2
2
  import { SelectionTarget, TextAddress } from './address.js';
3
3
  import { ReceiptEffects, ReceiptSuccess, TextMutationRange } from './receipt.js';
4
4
  import { BodyStoryLocator } from './story.types.js';
5
- export type SDErrorCode = 'INVALID_PAYLOAD' | 'INVALID_TARGET' | 'TARGET_NOT_FOUND' | 'ADDRESS_STALE' | 'PRECONDITION_FAILED' | 'REVISION_MISMATCH' | 'CHECK_MISMATCH' | 'INVALID_CONTEXT' | 'INVALID_NESTING' | 'INVALID_PLACEMENT' | 'DUPLICATE_ID' | 'CAPABILITY_UNSUPPORTED' | 'RAW_MODE_REQUIRED' | 'PRESERVE_ONLY_VIOLATION' | 'NO_OP' | 'UNSUPPORTED_ENVIRONMENT' | 'INTERNAL_ERROR';
5
+ export type SDErrorCode = 'INVALID_PAYLOAD' | 'INVALID_TARGET' | 'TARGET_NOT_FOUND' | 'ADDRESS_STALE' | 'PERMISSION_DENIED' | 'PRECONDITION_FAILED' | 'REVISION_MISMATCH' | 'CHECK_MISMATCH' | 'INVALID_CONTEXT' | 'INVALID_NESTING' | 'INVALID_PLACEMENT' | 'DUPLICATE_ID' | 'CAPABILITY_UNSUPPORTED' | 'RAW_MODE_REQUIRED' | 'PRESERVE_ONLY_VIOLATION' | 'NO_OP' | 'UNSUPPORTED_ENVIRONMENT' | 'INTERNAL_ERROR';
6
6
  export declare const SD_HTML_MARKDOWN_OUTCOMES: readonly ["preserved", "preserved-with-warnings", "simplified", "rejected", "no-op", "invalid-target", "outdated"];
7
7
  export type SDHtmlMarkdownOutcome = (typeof SD_HTML_MARKDOWN_OUTCOMES)[number];
8
8
  export interface SDError {
@@ -2254,6 +2254,8 @@ export type Line = {
2254
2254
  lineHeight: number;
2255
2255
  /** Maximum available width for this line (used during measurement). */
2256
2256
  maxWidth?: number;
2257
+ /** First-line list prefix displacement imposed by a left float exclusion. */
2258
+ listMarkerOffsetX?: number;
2257
2259
  /** Content width before justify compression (used for negative word-spacing calculation). */
2258
2260
  naturalWidth?: number;
2259
2261
  /** Number of spaces in the line (pre-computed for efficiency in justify calculations). */
@@ -167,6 +167,8 @@ export type LayoutOptions = {
167
167
  startContext?: {
168
168
  /** Physical page-number offset for emitted `Page.number` values. */
169
169
  pageNumberOffset?: number;
170
+ /** The resumed first paragraph follows an omitted authored pageBreakBefore block. */
171
+ startsAfterPageBreakBefore?: boolean;
170
172
  /** Display/effective page counter to stamp on the first emitted page. */
171
173
  activePageCounter?: number;
172
174
  /** Active section index at the page boundary. */
@@ -9,8 +9,9 @@ type PainterListTextStartParams = {
9
9
  hangingIndentPx: number;
10
10
  firstLineIndentPx: number;
11
11
  markerTextWidthPx?: number;
12
+ markerOffsetX?: number;
12
13
  };
13
- export declare const resolvePainterListMarkerGeometry: ({ wordLayout, indentLeftPx, hangingIndentPx, firstLineIndentPx, markerTextWidthPx, }: PainterListTextStartParams) => ResolvedListMarkerGeometry | undefined;
14
+ export declare const resolvePainterListMarkerGeometry: ({ wordLayout, indentLeftPx, hangingIndentPx, firstLineIndentPx, markerTextWidthPx, markerOffsetX, }: PainterListTextStartParams) => ResolvedListMarkerGeometry | undefined;
14
15
  export declare const resolvePainterListTextStartPx: ({ wordLayout, indentLeftPx, hangingIndentPx, firstLineIndentPx, markerTextWidthPx, }: PainterListTextStartParams) => number | undefined;
15
16
  type MarkerRunStyle = {
16
17
  fontFamily?: string | null;
@@ -31,6 +32,7 @@ export declare const renderLegacyListMarker: (params: {
31
32
  markerLayout: MinimalMarker;
32
33
  markerMeasure: ParagraphMeasure["marker"];
33
34
  markerTextWidthPx?: number;
35
+ markerOffsetX?: number;
34
36
  indentLeftPx: number;
35
37
  hangingIndentPx: number;
36
38
  firstLineIndentPx: number;
@@ -54,7 +54,7 @@ export declare const applyBorder: (element: HTMLElement, side: BorderSide, borde
54
54
  * ```
55
55
  */
56
56
  export declare const applyCellBorders: (element: HTMLElement, borders?: CellBorders, useSvgOverlay?: boolean) => void;
57
- /** Paints cell-only border patterns that CSS borders cannot represent. */
57
+ /** Paints cell border patterns and fractional strokes that native CSS cannot represent. */
58
58
  export declare const createCellBorderOverlay: (doc: Document, borders: CellBorders | undefined, geometry: {
59
59
  left: string;
60
60
  top: string;
@@ -7,7 +7,7 @@
7
7
  * ProseMirror or v1 editor runtime.
8
8
  */
9
9
  export { normalizeParagraphAttrsFromOoxml } from './paragraph-attrs.js';
10
- export { normalizeRunAttrsFromOoxml, type NormalizeRunAttrsContext } from './run-attrs.js';
10
+ export { normalizeRunAttrsFromOoxml, splitEastAsianFontSegments, type NormalizeRunAttrsContext } from './run-attrs.js';
11
11
  export type { TextRunStyleAttrs, ParagraphAttrs } from './types.js';
12
12
  export { applyThemeTintShade, normalizeHexColor, resolveThemeColor } from './colors.js';
13
13
  export { PX_PER_EIGHTH_POINT, PX_PER_POINT, PX_PER_TWIP, eighthPointsToPx, halfPointsToPx, twipsToPx, } from './units.js';
@@ -2,6 +2,8 @@ import { RunProperties } from '../ooxml/types.js';
2
2
  import { WordThemeColorPalette, WordThemeFontScheme } from '../ooxml/word-style-model/parse-theme.js';
3
3
  import { TextRunStyleAttrs } from './types.js';
4
4
  export interface NormalizeRunAttrsContext {
5
+ /** Font track selected from the text segment, independently of run language. */
6
+ fontScript?: 'eastAsia';
5
7
  /** Compiled theme color palette from the Word style model. */
6
8
  themeColors?: WordThemeColorPalette;
7
9
  /** Compiled theme font scheme. */
@@ -20,3 +22,13 @@ export interface NormalizeRunAttrsContext {
20
22
  backgroundColor?: string;
21
23
  }
22
24
  export declare function normalizeRunAttrsFromOoxml(props: RunProperties | null | undefined, context?: NormalizeRunAttrsContext): TextRunStyleAttrs;
25
+ interface FontScriptSegment {
26
+ text: string;
27
+ fontScript?: 'eastAsia';
28
+ }
29
+ /**
30
+ * Preserve Latin and East Asian font attribution across compatible text leaves.
31
+ * Iteration uses code points so supplementary Han and combining marks stay intact.
32
+ */
33
+ export declare function splitEastAsianFontSegments(text: string, precedingFontScript?: 'eastAsia'): FontScriptSegment[];
34
+ export {};
@@ -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-MSiU8Kg0.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-CbiiPcgr.cjs");
3
3
  const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
4
4
  let react = require("react");
5
5
  //#region src/public/ui/react.ts
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-DmGX1w-i.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-DHW9Toxn.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
4
  //#region src/public/ui/react.ts
@@ -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-MSiU8Kg0.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-CbiiPcgr.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
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-DmGX1w-i.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-DHW9Toxn.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
@@ -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-MSiU8Kg0.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-CbiiPcgr.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 { a as BUILT_IN_COMMAND_IDS, t as createSuperDocUI, u as shallowEqual } from "../chunks/create-super-doc-ui-DmGX1w-i.es.js";
1
+ import { a as BUILT_IN_COMMAND_IDS, t as createSuperDocUI, u as shallowEqual } from "../chunks/create-super-doc-ui-DHW9Toxn.es.js";
2
2
  export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };
@@ -145,7 +145,7 @@ export type ResolvedListMarkerGeometry = {
145
145
  * @param measureMarkerText - Callback used when marker glyph width is not precomputed
146
146
  * @returns Resolved list prefix geometry, or undefined when the paragraph has no marker
147
147
  */
148
- export declare function resolveListMarkerGeometry(wordLayout: MinimalWordLayout | undefined, indentLeft: number, firstLine: number, hanging: number, measureMarkerText: MarkerTextMeasurer): ResolvedListMarkerGeometry | undefined;
148
+ export declare function resolveListMarkerGeometry(wordLayout: MinimalWordLayout | undefined, indentLeft: number, firstLine: number, hanging: number, measureMarkerText: MarkerTextMeasurer, markerOffsetX?: number): ResolvedListMarkerGeometry | undefined;
149
149
  /**
150
150
  * Convenience wrapper that returns only the text-start X coordinate from
151
151
  * {@link resolveListMarkerGeometry}. Falls back to `wordLayout.textStartPx`