superdoc 2.25.0-next.4 → 2.25.0-next.5

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.
@@ -13009,6 +13009,23 @@ function createSuperDocUI(options) {
13009
13009
  success: false,
13010
13010
  reason: "not-reachable"
13011
13011
  };
13012
+ const editor = getEditor(), host = getHost();
13013
+ const readiness = editor?.documentMutationReadiness;
13014
+ if (typeof readiness?.whenPainted === "function") {
13015
+ try {
13016
+ await readiness.whenPainted.call(readiness);
13017
+ } catch {
13018
+ return {
13019
+ success: false,
13020
+ reason: "not-reachable"
13021
+ };
13022
+ }
13023
+ if (getEditor() !== editor || getHost() !== host) return {
13024
+ success: false,
13025
+ reason: "not-ready"
13026
+ };
13027
+ }
13028
+ host?.getMountedHandle?.()?.focus?.focus({ preventScroll: true });
13012
13029
  activateContentControlChrome(id);
13013
13030
  return { success: true };
13014
13031
  }
@@ -13008,6 +13008,23 @@ function createSuperDocUI(options) {
13008
13008
  success: false,
13009
13009
  reason: "not-reachable"
13010
13010
  };
13011
+ const editor = getEditor(), host = getHost();
13012
+ const readiness = editor?.documentMutationReadiness;
13013
+ if (typeof readiness?.whenPainted === "function") {
13014
+ try {
13015
+ await readiness.whenPainted.call(readiness);
13016
+ } catch {
13017
+ return {
13018
+ success: false,
13019
+ reason: "not-reachable"
13020
+ };
13021
+ }
13022
+ if (getEditor() !== editor || getHost() !== host) return {
13023
+ success: false,
13024
+ reason: "not-ready"
13025
+ };
13026
+ }
13027
+ host?.getMountedHandle?.()?.focus?.focus({ preventScroll: true });
13011
13028
  activateContentControlChrome(id);
13012
13029
  return { success: true };
13013
13030
  }
@@ -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.4",
22
+ superdocVersion: "2.25.0-next.5",
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.4",
21
+ superdocVersion: "2.25.0-next.5",
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
@@ -20,7 +20,7 @@ export type { FootnotePreferredReserveCandidate, FootnoteWindowScoreInput, Footn
20
20
  export { computeDisplayPageNumber } from '../../layout-engine/src/index.js';
21
21
  export type { DisplayPageInfo, HeaderFooterConstraints } from '../../layout-engine/src/index.js';
22
22
  export { clearRemeasureTextCaches, remeasureParagraph } from './remeasure.js';
23
- export { findCharacterAtX, measureCharacterX } from './text-measurement.js';
23
+ export { findCharacterAtX, measureCharacterX, measureInlineImageCaretTextBox, getRunFontString, } from './text-measurement.js';
24
24
  export { sliceRunsForLine } from '../../contracts/src/index.js';
25
25
  export { clickToPositionDom, findPageElement } from './dom-mapping.js';
26
26
  export { isListItem, getWordLayoutConfig, calculateTextStartIndent, extractParagraphIndent } from './list-indent-utils.js';
@@ -1,3 +1,4 @@
1
+ import { LayoutMeasurementContext } from './measurement-environment.js';
1
2
  import { FlowBlock, Line, Run } from '../../contracts/src/index.js';
2
3
  import { FontMeasureContext } from '../../../shared/font-system/src/index.js';
3
4
  /**
@@ -7,6 +8,13 @@ import { FontMeasureContext } from '../../../shared/font-system/src/index.js';
7
8
  * @returns CSS font string (e.g., "italic bold 16px Arial")
8
9
  */
9
10
  export declare function getRunFontString(run: Run, fontContext?: FontMeasureContext): string;
11
+ /** Native caret text box for inline-image paragraphs, including wrapped text lines. */
12
+ export declare function measureInlineImageCaretTextBox(block: FlowBlock, line: Line, charOffset: number, fontContext?: FontMeasureContext, measurementContext?: LayoutMeasurementContext): {
13
+ ascent: number;
14
+ height: number;
15
+ bottomAligned: boolean;
16
+ bottomInset: number;
17
+ } | null;
10
18
  export declare function measureCharacterX(block: FlowBlock, line: Line, charOffset: number, availableWidthOverride?: number, alignmentOverride?: string, fontContext?: FontMeasureContext): number;
11
19
  /**
12
20
  * Convert a character offset within a line back to a ProseMirror position.
@@ -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-C-oN_R2a.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-B-A8sK47.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-D5waZHl3.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-CrH79xw6.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-C-oN_R2a.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-B-A8sK47.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-D5waZHl3.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-CrH79xw6.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-C-oN_R2a.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-B-A8sK47.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-D5waZHl3.es.js";
1
+ import { a as BUILT_IN_COMMAND_IDS, t as createSuperDocUI, u as shallowEqual } from "../chunks/create-super-doc-ui-CrH79xw6.es.js";
2
2
  export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };