superdoc 2.25.0-next.14 → 2.25.0-next.16

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.
@@ -7773,15 +7773,25 @@ function createSuperDocUI(options) {
7773
7773
  sizeOptions: DEFAULT_FONT_SIZE_OPTIONS
7774
7774
  };
7775
7775
  };
7776
+ let zoomFitWidth;
7776
7777
  const computeZoom = () => {
7777
7778
  const state = safeCall(superdoc?.getZoomState ? () => superdoc.getZoomState() : void 0, null);
7778
7779
  const value = typeof state?.value === "number" ? state.value : 100;
7779
7780
  const rawMode = state?.mode;
7781
+ const mode = rawMode === "manual" || rawMode === "fit-width" ? rawMode : rawMode === "fixed" ? "manual" : null;
7782
+ const fit = state?.fitWidth;
7783
+ const min = typeof fit?.min === "number" ? fit.min : typeof state?.min === "number" ? state.min : 10;
7784
+ const max = typeof fit?.max === "number" ? fit.max : typeof state?.max === "number" ? state.max : 100;
7785
+ if (!zoomFitWidth || zoomFitWidth.min !== min || zoomFitWidth.max !== max) zoomFitWidth = {
7786
+ min,
7787
+ max
7788
+ };
7780
7789
  return {
7781
- mode: rawMode === "manual" || rawMode === "fit-width" ? rawMode : rawMode === "fixed" ? "manual" : null,
7790
+ mode,
7782
7791
  value,
7783
- min: typeof state?.min === "number" ? state.min : 10,
7784
- max: typeof state?.max === "number" ? state.max : 100
7792
+ fitWidth: zoomFitWidth,
7793
+ min,
7794
+ max
7785
7795
  };
7786
7796
  };
7787
7797
  const readMeasurementUnit = () => {
@@ -7772,15 +7772,25 @@ function createSuperDocUI(options) {
7772
7772
  sizeOptions: DEFAULT_FONT_SIZE_OPTIONS
7773
7773
  };
7774
7774
  };
7775
+ let zoomFitWidth;
7775
7776
  const computeZoom = () => {
7776
7777
  const state = safeCall(superdoc?.getZoomState ? () => superdoc.getZoomState() : void 0, null);
7777
7778
  const value = typeof state?.value === "number" ? state.value : 100;
7778
7779
  const rawMode = state?.mode;
7780
+ const mode = rawMode === "manual" || rawMode === "fit-width" ? rawMode : rawMode === "fixed" ? "manual" : null;
7781
+ const fit = state?.fitWidth;
7782
+ const min = typeof fit?.min === "number" ? fit.min : typeof state?.min === "number" ? state.min : 10;
7783
+ const max = typeof fit?.max === "number" ? fit.max : typeof state?.max === "number" ? state.max : 100;
7784
+ if (!zoomFitWidth || zoomFitWidth.min !== min || zoomFitWidth.max !== max) zoomFitWidth = {
7785
+ min,
7786
+ max
7787
+ };
7779
7788
  return {
7780
- mode: rawMode === "manual" || rawMode === "fit-width" ? rawMode : rawMode === "fixed" ? "manual" : null,
7789
+ mode,
7781
7790
  value,
7782
- min: typeof state?.min === "number" ? state.min : 10,
7783
- max: typeof state?.max === "number" ? state.max : 100
7791
+ fitWidth: zoomFitWidth,
7792
+ min,
7793
+ max
7784
7794
  };
7785
7795
  };
7786
7796
  const readMeasurementUnit = () => {
@@ -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.25.0-next.14",
22
+ superdocVersion: "2.25.0-next.16",
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.25.0-next.14",
21
+ superdocVersion: "2.25.0-next.16",
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
@@ -11,6 +11,16 @@ export type AffectedRefRemapping = {
11
11
  to: AffectedRef;
12
12
  };
13
13
  export type ReceiptFailureCode = 'NO_OP' | 'INVALID_TARGET' | 'TARGET_NOT_FOUND' | 'CAPABILITY_UNAVAILABLE' | 'PERMISSION_DENIED' | 'STALE_REVISION' | 'REVISION_MISMATCH' | 'CHECK_MISMATCH' | 'MATCH_NOT_FOUND' | 'AMBIGUOUS_MATCH' | 'STYLE_CONFLICT' | 'PRECONDITION_FAILED' | 'COMMENT_CASCADE_PARTIAL' | 'INVALID_INPUT' | 'CROSS_BLOCK_MATCH' | 'SPAN_FRAGMENTED' | 'TARGET_MOVED' | 'PLAN_CONFLICT_OVERLAP' | 'INVALID_STEP_COMBINATION' | 'REVISION_CHANGED_SINCE_COMPILE' | 'INVALID_INSERTION_CONTEXT' | 'DOCUMENT_IDENTITY_CONFLICT' | 'UNSUPPORTED_ENVIRONMENT' | 'INTERNAL_ERROR' | 'PAGE_NUMBERS_NOT_MATERIALIZED' | 'INCOMPATIBLE_DEFINITIONS' | 'NO_COMPATIBLE_PREVIOUS' | 'ALREADY_CONTINUOUS' | 'NO_PREVIOUS_LIST' | 'NO_ADJACENT_SEQUENCE' | 'ALREADY_SAME_SEQUENCE' | 'LEVEL_OUT_OF_RANGE' | 'LEVEL_NOT_FOUND' | 'INVALID_NESTING' | 'INVALID_PLACEMENT' | 'EMPTY_FRAGMENT' | 'INVALID_FRAGMENT' | 'INVALID_PAYLOAD' | 'CAPABILITY_UNSUPPORTED' | 'ADDRESS_STALE' | 'DUPLICATE_ID' | 'INVALID_CONTEXT' | 'RAW_MODE_REQUIRED' | 'PRESERVE_ONLY_VIOLATION' | 'LOCK_VIOLATION' | 'TYPE_MISMATCH' | 'UNSUPPORTED_SOURCE' | 'INVALID_PACKAGE' | 'UNSUPPORTED_TEMPLATE_CONTENT';
14
+ /** Known refusals for a text range whose underlying context is identified. */
15
+ export type TextRangeRejectionReason = 'text-range-in-sdt' | 'text-range-in-field' | 'text-range-in-unsupported-tracked-wrapper';
16
+ /** Content-control creation keeps its existing top-level failure code. */
17
+ export type ContentControlCreationRejectionReason = 'content-control-unsupported-inline-structure' | 'content-control-shared-run-boundary';
18
+ export type DocumentApiRejectionReason = TextRangeRejectionReason | ContentControlCreationRejectionReason;
19
+ export interface DocumentApiRejectionDetails extends Record<string, unknown> {
20
+ reason: DocumentApiRejectionReason;
21
+ }
22
+ /** Read a known failure.details.reason without assuming every failure has one. */
23
+ export declare function getDocumentApiRejectionReason(details: unknown): DocumentApiRejectionReason | undefined;
14
24
  export type ReceiptFailure = {
15
25
  code: ReceiptFailureCode;
16
26
  message: string;
@@ -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-ABeUNZlq.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-BbTRF-Z9.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
@@ -240,6 +240,10 @@ function useSuperDocZoom() {
240
240
  return useSuperDocSlice((ui) => ui.zoom, {
241
241
  mode: null,
242
242
  value: 100,
243
+ fitWidth: {
244
+ min: 10,
245
+ max: 100
246
+ },
243
247
  min: 10,
244
248
  max: 100
245
249
  });
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-CCNvH6mr.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-Cr_04XnJ.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
@@ -239,6 +239,10 @@ function useSuperDocZoom() {
239
239
  return useSuperDocSlice((ui) => ui.zoom, {
240
240
  mode: null,
241
241
  value: 100,
242
+ fitWidth: {
243
+ min: 10,
244
+ max: 100
245
+ },
242
246
  min: 10,
243
247
  max: 100
244
248
  });
@@ -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-ABeUNZlq.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-BbTRF-Z9.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
@@ -311,6 +311,10 @@ function useSuperDocZoom() {
311
311
  return useSuperDocSlice((ui) => ui.zoom, {
312
312
  mode: null,
313
313
  value: 100,
314
+ fitWidth: {
315
+ min: 10,
316
+ max: 100
317
+ },
314
318
  min: 10,
315
319
  max: 100
316
320
  });
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-CCNvH6mr.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-Cr_04XnJ.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
@@ -310,6 +310,10 @@ function useSuperDocZoom() {
310
310
  return useSuperDocSlice((ui) => ui.zoom, {
311
311
  mode: null,
312
312
  value: 100,
313
+ fitWidth: {
314
+ min: 10,
315
+ max: 100
316
+ },
313
317
  min: 10,
314
318
  max: 100
315
319
  });
@@ -1,5 +1,20 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-ABeUNZlq.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-BbTRF-Z9.cjs");
3
+ //#region ../document-api/src/types/receipt.ts
4
+ /** Read a known failure.details.reason without assuming every failure has one. */
5
+ function getDocumentApiRejectionReason(details) {
6
+ if (typeof details !== "object" || details === null || !("reason" in details)) return void 0;
7
+ switch (details.reason) {
8
+ case "text-range-in-sdt":
9
+ case "text-range-in-field":
10
+ case "text-range-in-unsupported-tracked-wrapper":
11
+ case "content-control-unsupported-inline-structure":
12
+ case "content-control-shared-run-boundary": return details.reason;
13
+ default: return;
14
+ }
15
+ }
16
+ //#endregion
3
17
  exports.BUILT_IN_COMMAND_IDS = require_create_super_doc_ui.BUILT_IN_COMMAND_IDS;
4
18
  exports.createSuperDocUI = require_create_super_doc_ui.createSuperDocUI;
19
+ exports.getDocumentApiRejectionReason = getDocumentApiRejectionReason;
5
20
  exports.shallowEqual = require_create_super_doc_ui.shallowEqual;
@@ -1,2 +1,16 @@
1
- import { a as BUILT_IN_COMMAND_IDS, t as createSuperDocUI, u as shallowEqual } from "../chunks/create-super-doc-ui-CCNvH6mr.es.js";
2
- export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };
1
+ import { a as BUILT_IN_COMMAND_IDS, t as createSuperDocUI, u as shallowEqual } from "../chunks/create-super-doc-ui-Cr_04XnJ.es.js";
2
+ //#region ../document-api/src/types/receipt.ts
3
+ /** Read a known failure.details.reason without assuming every failure has one. */
4
+ function getDocumentApiRejectionReason(details) {
5
+ if (typeof details !== "object" || details === null || !("reason" in details)) return void 0;
6
+ switch (details.reason) {
7
+ case "text-range-in-sdt":
8
+ case "text-range-in-field":
9
+ case "text-range-in-unsupported-tracked-wrapper":
10
+ case "content-control-unsupported-inline-structure":
11
+ case "content-control-shared-run-boundary": return details.reason;
12
+ default: return;
13
+ }
14
+ }
15
+ //#endregion
16
+ export { BUILT_IN_COMMAND_IDS, createSuperDocUI, getDocumentApiRejectionReason, shallowEqual };