@harbour-enterprises/superdoc 1.18.0-next.23 → 1.18.0-next.24

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.
@@ -59364,7 +59364,7 @@ var SuperConverter = class SuperConverter {
59364
59364
  static getStoredSuperdocVersion(docx) {
59365
59365
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
59366
59366
  }
59367
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.18.0-next.23") {
59367
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.18.0-next.24") {
59368
59368
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
59369
59369
  }
59370
59370
  static generateWordTimestamp() {
@@ -58060,7 +58060,7 @@ var SuperConverter = class SuperConverter {
58060
58060
  static getStoredSuperdocVersion(docx) {
58061
58061
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
58062
58062
  }
58063
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.18.0-next.23") {
58063
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.18.0-next.24") {
58064
58064
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
58065
58065
  }
58066
58066
  static generateWordTimestamp() {
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-Dp2H1eGw.cjs");
2
- const require_SuperConverter = require("./SuperConverter-BbWMX2Yr.cjs");
2
+ const require_SuperConverter = require("./SuperConverter-DvMtX0CH.cjs");
3
3
  const require_jszip = require("./jszip-DCT9QYaK.cjs");
4
4
  const require_uuid = require("./uuid-BZOhSkTa.cjs");
5
5
  const require_constants = require("./constants-7MkJJnfa.cjs");
@@ -264,7 +264,7 @@ var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
264
264
  const COMMUNITY_LICENSE_KEY = "community-and-eval-agplv3";
265
265
  function getSuperdocVersion() {
266
266
  try {
267
- return "1.18.0-next.23";
267
+ return "1.18.0-next.24";
268
268
  } catch {
269
269
  return "unknown";
270
270
  }
@@ -21210,7 +21210,7 @@ const canUseDOM = () => {
21210
21210
  return false;
21211
21211
  }
21212
21212
  };
21213
- var summaryVersion = "1.18.0-next.23";
21213
+ var summaryVersion = "1.18.0-next.24";
21214
21214
  var nodeKeys = [
21215
21215
  "group",
21216
21216
  "content",
@@ -39527,7 +39527,7 @@ var Editor = class Editor extends EventEmitter$1 {
39527
39527
  return migrations.length > 0;
39528
39528
  }
39529
39529
  processCollaborationMigrations() {
39530
- console.debug("[checkVersionMigrations] Current editor version", "1.18.0-next.23");
39530
+ console.debug("[checkVersionMigrations] Current editor version", "1.18.0-next.24");
39531
39531
  if (!this.options.ydoc) return;
39532
39532
  let docVersion = this.options.ydoc.getMap("meta").get("version");
39533
39533
  if (!docVersion) docVersion = "initial";
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, n as __esmMin, r as __export, t as __commonJSMin } from "./rolldown-runtime-B2q5OVn9.es.js";
2
- import { $ as getSchemaTypeByName, $t as INLINE_PROPERTY_BY_KEY, A as insertNewRelationship, At as resolveDocxFontFamily, B as getMarksFromSelection, Bt as getUnderlineCssString, C as calculateResolvedParagraphProperties, Ct as generateDocxRandomId, D as clampRange, Dt as encodeCSSFromRPr, E as generateOrderedListIndex, Et as encodeCSSFromPPr, F as isInTable, Ft as TABLE_FALLBACK_BORDERS, G as getMarkRange, Gt as createDocumentApi, H as isNodeActive, Ht as TrackFormatMarkName, I as posToDOMRect, It as TABLE_FALLBACK_CELL_PADDING, J as findParentNodeClosestToPos, Jt as PUBLIC_MUTATION_STEP_OP_IDS, K as isTextSelection, Kt as derivePropertyStateFromDirect, L as findChildren$1, Lt as isKnownTableStyleId, M as encodeTooltip, Mt as resolveRunProperties, N as sanitizeHref, Nt as resolveTableCellProperties, O as collectChangedRangesThroughTransactions, Ot as encodeMarksFromRPr, P as CommandService, Pt as resolveTableProperties, Q as cleanSchemaItem, Qt as OPERATION_IDS, R as getActiveFormatting, Rt as resolveExistingTableEffectiveStyleId, S as isList, St as isLegacySchemaDefaultBorders, T as docxNumberingHelpers, Tt as decodeRPrFromMarks, U as getSchemaTypeNameByName, Ut as TrackInsertMarkName, V as isActive, Vt as TrackDeleteMarkName, W as isMarkActive, Wt as carbonCopy, X as getMarkType, Xt as PROPERTY_REGISTRY, Y as defaultBlockAt$1, Yt as isPublicMutationStepOp, Z as getNodeType, Zt as COMMAND_CATALOG, _ as ListHelpers, _n as Slice, _t as dropPoint, a as helpers_exports, an as buildResolvedHandle, at as PluginKey, b as changeListLevel, bn as getExtensionConfigField, bt as replaceStep$1, c as createDocFromMarkdown, cn as MAX_PLAN_RESOLVED_TARGETS, ct as TextSelection$1, d as createDocFromHTML, dn as DELETABLE_BLOCK_NODE_TYPES, dt as RemoveMarkStep, en as INLINE_PROPERTY_KEY_SET, et as createDocument, f as InputRule, fn as DOMParser$1, ft as ReplaceAroundStep$1, g as unflattenListsInHtml, gn as Schema$1, gt as canSplit, h as inputRulesPlugin, hn as Mark$1, ht as canJoin, i as translator$1, in as buildDiscoveryResult, it as Plugin, j as UrlValidationConstants, jt as resolveParagraphProperties, k as mergeRanges, kt as DEFAULT_TBL_LOOK, l as markdownToPmFragment, ln as MAX_PLAN_STEPS, lt as AddMarkStep, m as htmlHandler, mn as Fragment$1, mt as Transform, n as kebabCase$1, nn as DocumentApiValidationError, nt as EditorState, o as updateDOMAttributes, on as SNIPPET_CONTEXT_CHARS, ot as Selection, p as handleClipboardPaste, pn as DOMSerializer, pt as ReplaceStep, q as findParentNode, qt as CAPABILITY_REASON_CODES, rn as buildDiscoveryItem, rt as NodeSelection, s as processContent, sn as SNIPPET_MAX_LENGTH, st as SelectionRange, t as SuperConverter, tn as INLINE_PROPERTY_REGISTRY, tt as AllSelection, u as readImageDimensionsFromDataUri, un as MARK_KEYS, ut as Mapping, v as removeLvlOverride, vn as minMax, vt as joinPoint, w as getResolvedParagraphProperties, wt as generateRandomSigned32BitIntStrId, x as updateNumberingProperties, xt as convertBordersToOoxmlFormat, y as translator, yn as callOrGet, yt as liftTarget, z as findMark$1, zt as resolvePreferredNewTableStyleId } from "./SuperConverter-DAG0cqbz.es.js";
2
+ import { $ as getSchemaTypeByName, $t as INLINE_PROPERTY_BY_KEY, A as insertNewRelationship, At as resolveDocxFontFamily, B as getMarksFromSelection, Bt as getUnderlineCssString, C as calculateResolvedParagraphProperties, Ct as generateDocxRandomId, D as clampRange, Dt as encodeCSSFromRPr, E as generateOrderedListIndex, Et as encodeCSSFromPPr, F as isInTable, Ft as TABLE_FALLBACK_BORDERS, G as getMarkRange, Gt as createDocumentApi, H as isNodeActive, Ht as TrackFormatMarkName, I as posToDOMRect, It as TABLE_FALLBACK_CELL_PADDING, J as findParentNodeClosestToPos, Jt as PUBLIC_MUTATION_STEP_OP_IDS, K as isTextSelection, Kt as derivePropertyStateFromDirect, L as findChildren$1, Lt as isKnownTableStyleId, M as encodeTooltip, Mt as resolveRunProperties, N as sanitizeHref, Nt as resolveTableCellProperties, O as collectChangedRangesThroughTransactions, Ot as encodeMarksFromRPr, P as CommandService, Pt as resolveTableProperties, Q as cleanSchemaItem, Qt as OPERATION_IDS, R as getActiveFormatting, Rt as resolveExistingTableEffectiveStyleId, S as isList, St as isLegacySchemaDefaultBorders, T as docxNumberingHelpers, Tt as decodeRPrFromMarks, U as getSchemaTypeNameByName, Ut as TrackInsertMarkName, V as isActive, Vt as TrackDeleteMarkName, W as isMarkActive, Wt as carbonCopy, X as getMarkType, Xt as PROPERTY_REGISTRY, Y as defaultBlockAt$1, Yt as isPublicMutationStepOp, Z as getNodeType, Zt as COMMAND_CATALOG, _ as ListHelpers, _n as Slice, _t as dropPoint, a as helpers_exports, an as buildResolvedHandle, at as PluginKey, b as changeListLevel, bn as getExtensionConfigField, bt as replaceStep$1, c as createDocFromMarkdown, cn as MAX_PLAN_RESOLVED_TARGETS, ct as TextSelection$1, d as createDocFromHTML, dn as DELETABLE_BLOCK_NODE_TYPES, dt as RemoveMarkStep, en as INLINE_PROPERTY_KEY_SET, et as createDocument, f as InputRule, fn as DOMParser$1, ft as ReplaceAroundStep$1, g as unflattenListsInHtml, gn as Schema$1, gt as canSplit, h as inputRulesPlugin, hn as Mark$1, ht as canJoin, i as translator$1, in as buildDiscoveryResult, it as Plugin, j as UrlValidationConstants, jt as resolveParagraphProperties, k as mergeRanges, kt as DEFAULT_TBL_LOOK, l as markdownToPmFragment, ln as MAX_PLAN_STEPS, lt as AddMarkStep, m as htmlHandler, mn as Fragment$1, mt as Transform, n as kebabCase$1, nn as DocumentApiValidationError, nt as EditorState, o as updateDOMAttributes, on as SNIPPET_CONTEXT_CHARS, ot as Selection, p as handleClipboardPaste, pn as DOMSerializer, pt as ReplaceStep, q as findParentNode, qt as CAPABILITY_REASON_CODES, rn as buildDiscoveryItem, rt as NodeSelection, s as processContent, sn as SNIPPET_MAX_LENGTH, st as SelectionRange, t as SuperConverter, tn as INLINE_PROPERTY_REGISTRY, tt as AllSelection, u as readImageDimensionsFromDataUri, un as MARK_KEYS, ut as Mapping, v as removeLvlOverride, vn as minMax, vt as joinPoint, w as getResolvedParagraphProperties, wt as generateRandomSigned32BitIntStrId, x as updateNumberingProperties, xt as convertBordersToOoxmlFormat, y as translator, yn as callOrGet, yt as liftTarget, z as findMark$1, zt as resolvePreferredNewTableStyleId } from "./SuperConverter-IgiRNOfZ.es.js";
3
3
  import { a as init_dist$2, i as global, n as init_dist, o as Buffer$3, r as process$1, s as init_dist$1 } from "./jszip-ChlR43oI.es.js";
4
4
  import { n as v4_default } from "./uuid-qzgm05fK.es.js";
5
5
  import { A as ptToTwips, C as linesToTwips, D as pixelsToTwips, F as twipsToInches, I as twipsToLines, L as twipsToPixels, b as inchesToPixels, c as convertSizeToCSS, h as getArrayBufferFromUrl, j as resolveOpcTargetPath, t as COMMENT_FILE_BASENAMES, x as inchesToTwips, y as halfPointToPoints } from "./constants-CMPtQbp7.es.js";
@@ -263,7 +263,7 @@ var v_click_outside_default = {
263
263
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
264
264
  function getSuperdocVersion() {
265
265
  try {
266
- return "1.18.0-next.23";
266
+ return "1.18.0-next.24";
267
267
  } catch {
268
268
  return "unknown";
269
269
  }
@@ -21191,7 +21191,7 @@ const canUseDOM = () => {
21191
21191
  return false;
21192
21192
  }
21193
21193
  };
21194
- var summaryVersion = "1.18.0-next.23";
21194
+ var summaryVersion = "1.18.0-next.24";
21195
21195
  var nodeKeys = [
21196
21196
  "group",
21197
21197
  "content",
@@ -39504,7 +39504,7 @@ var Editor = class Editor extends EventEmitter$1 {
39504
39504
  return migrations.length > 0;
39505
39505
  }
39506
39506
  processCollaborationMigrations() {
39507
- console.debug("[checkVersionMigrations] Current editor version", "1.18.0-next.23");
39507
+ console.debug("[checkVersionMigrations] Current editor version", "1.18.0-next.24");
39508
39508
  if (!this.options.ydoc) return;
39509
39509
  let docVersion = this.options.ydoc.getMap("meta").get("version");
39510
39510
  if (!docVersion) docVersion = "initial";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_SuperConverter = require("../chunks/SuperConverter-BbWMX2Yr.cjs");
3
+ const require_SuperConverter = require("../chunks/SuperConverter-DvMtX0CH.cjs");
4
4
  require("../chunks/jszip-DCT9QYaK.cjs");
5
5
  require("../chunks/xml-js--DznO7Gk.cjs");
6
6
  require("../chunks/constants-7MkJJnfa.cjs");
@@ -1,4 +1,4 @@
1
- import { t as SuperConverter } from "../chunks/SuperConverter-DAG0cqbz.es.js";
1
+ import { t as SuperConverter } from "../chunks/SuperConverter-IgiRNOfZ.es.js";
2
2
  import "../chunks/jszip-ChlR43oI.es.js";
3
3
  import "../chunks/xml-js-DLE8mr0n.es.js";
4
4
  import "../chunks/constants-CMPtQbp7.es.js";
@@ -1,6 +1,12 @@
1
- import { EditorView } from 'prosemirror-view';
2
- import { EditorState, Transaction } from 'prosemirror-state';
3
- import { Schema, Node as ProseMirrorNode, Mark as ProseMirrorMark } from 'prosemirror-model';
1
+ /**
2
+ * Main type declarations for @superdoc/super-editor
3
+ * This file provides TypeScript types for the JavaScript exports in index.js
4
+ */
5
+
6
+ export type { EditorView } from 'prosemirror-view';
7
+ export type { EditorState, Transaction } from 'prosemirror-state';
8
+ export type { Schema } from 'prosemirror-model';
9
+
4
10
  // ============================================
5
11
  // COMMAND TYPES (inlined from ChainedCommands.ts)
6
12
  // ============================================
@@ -152,6 +158,255 @@ export interface OpenOptions {
152
158
  fonts?: Record<string, unknown>;
153
159
  }
154
160
 
161
+ // ============================================
162
+ // PRESENTATION EDITOR TYPES
163
+ // ============================================
164
+
165
+ /** Page dimensions in points (72 points = 1 inch) */
166
+ export interface PageSize {
167
+ /** Width in points */
168
+ w: number;
169
+ /** Height in points */
170
+ h: number;
171
+ }
172
+
173
+ /** Page margin configuration in points */
174
+ export interface PageMargins {
175
+ top?: number;
176
+ right?: number;
177
+ bottom?: number;
178
+ left?: number;
179
+ header?: number;
180
+ footer?: number;
181
+ }
182
+
183
+ /** Virtualization options for large documents */
184
+ export interface VirtualizationOptions {
185
+ enabled?: boolean;
186
+ window?: number;
187
+ overscan?: number;
188
+ gap?: number;
189
+ paddingTop?: number;
190
+ }
191
+
192
+ /** Tracked changes display mode */
193
+ export type TrackedChangesMode = 'review' | 'original' | 'final' | 'off';
194
+
195
+ /** Override tracked changes behavior */
196
+ export interface TrackedChangesOverrides {
197
+ mode?: TrackedChangesMode;
198
+ enabled?: boolean;
199
+ }
200
+
201
+ /** Layout mode for page rendering */
202
+ export type LayoutMode = 'vertical' | 'horizontal';
203
+
204
+ /** Remote user presence information */
205
+ export interface RemoteUserInfo {
206
+ name?: string;
207
+ email?: string;
208
+ color: string;
209
+ }
210
+
211
+ /** Remote cursor state for collaboration */
212
+ export interface RemoteCursorState {
213
+ clientId: number;
214
+ user: RemoteUserInfo;
215
+ anchor: number;
216
+ head: number;
217
+ updatedAt: number;
218
+ }
219
+
220
+ /** Presence rendering options */
221
+ export interface PresenceOptions {
222
+ enabled?: boolean;
223
+ showLabels?: boolean;
224
+ maxVisible?: number;
225
+ labelFormatter?: (user: RemoteUserInfo) => string;
226
+ highlightOpacity?: number;
227
+ staleTimeout?: number;
228
+ }
229
+
230
+ /** Layout engine configuration */
231
+ export interface LayoutEngineOptions {
232
+ pageSize?: PageSize;
233
+ margins?: PageMargins;
234
+ zoom?: number;
235
+ virtualization?: VirtualizationOptions;
236
+ pageStyles?: Record<string, unknown>;
237
+ debugLabel?: string;
238
+ layoutMode?: LayoutMode;
239
+ trackedChanges?: TrackedChangesOverrides;
240
+ emitCommentPositionsInViewing?: boolean;
241
+ enableCommentsInViewing?: boolean;
242
+ presence?: PresenceOptions;
243
+ ruler?: {
244
+ enabled?: boolean;
245
+ interactive?: boolean;
246
+ onMarginChange?: (side: 'left' | 'right', marginInches: number) => void;
247
+ };
248
+ }
249
+
250
+ /** Options for creating a PresentationEditor instance */
251
+ export interface PresentationEditorOptions {
252
+ /** Host element where the layout-engine powered UI should render (required) */
253
+ element: HTMLElement;
254
+ /** Layout-specific configuration */
255
+ layoutEngineOptions?: LayoutEngineOptions;
256
+ /** Document mode: 'editing', 'viewing', or 'suggesting' */
257
+ documentMode?: 'editing' | 'viewing' | 'suggesting';
258
+ /** Collaboration provider with awareness support */
259
+ collaborationProvider?: {
260
+ awareness?: unknown;
261
+ disconnect?: () => void;
262
+ } | null;
263
+ /** Whether to disable the context menu */
264
+ disableContextMenu?: boolean;
265
+ /** Document content */
266
+ content?: string | object;
267
+ /** Editor extensions */
268
+ extensions?: any[];
269
+ /** Whether the editor is editable */
270
+ editable?: boolean;
271
+ /** Additional options passed to the underlying Editor */
272
+ [key: string]: any;
273
+ }
274
+
275
+ /** Layout error information */
276
+ export interface LayoutError {
277
+ phase: 'initialization' | 'render';
278
+ error: Error;
279
+ timestamp: number;
280
+ }
281
+
282
+ /** Rectangle with page context */
283
+ export interface RangeRect {
284
+ pageIndex: number;
285
+ left: number;
286
+ right: number;
287
+ top: number;
288
+ bottom: number;
289
+ width: number;
290
+ height: number;
291
+ }
292
+
293
+ /** Layout metrics for telemetry */
294
+ export interface LayoutMetrics {
295
+ durationMs: number;
296
+ blockCount: number;
297
+ pageCount: number;
298
+ }
299
+
300
+ /** Position hit result from coordinate mapping */
301
+ export interface PositionHit {
302
+ pos: number;
303
+ layoutEpoch: number;
304
+ blockId: string;
305
+ pageIndex: number;
306
+ column: number;
307
+ lineIndex: number;
308
+ }
309
+
310
+ /** Bounding rectangle dimensions */
311
+ export interface BoundingRect {
312
+ top: number;
313
+ left: number;
314
+ bottom: number;
315
+ right: number;
316
+ width: number;
317
+ height: number;
318
+ }
319
+
320
+ /** A fragment positioned on a page */
321
+ export interface LayoutFragment {
322
+ pmStart: number;
323
+ pmEnd: number;
324
+ x: number;
325
+ y: number;
326
+ width: number;
327
+ height: number;
328
+ blockId: string;
329
+ column?: number;
330
+ }
331
+
332
+ /** A rendered page in the layout */
333
+ export interface LayoutPage {
334
+ number: number;
335
+ fragments: LayoutFragment[];
336
+ margins?: PageMargins;
337
+ size?: PageSize;
338
+ orientation?: 'portrait' | 'landscape';
339
+ sectionIndex?: number;
340
+ footnoteReserved?: number;
341
+ }
342
+
343
+ /** Final layout output from the layout engine */
344
+ export interface Layout {
345
+ pageSize: PageSize;
346
+ pages: LayoutPage[];
347
+ pageGap?: number;
348
+ layoutEpoch?: number;
349
+ }
350
+
351
+ /** A block in the flow document model */
352
+ export interface FlowBlock {
353
+ id: string;
354
+ type: string;
355
+ pmStart: number;
356
+ pmEnd: number;
357
+ [key: string]: unknown;
358
+ }
359
+
360
+ /** Measurement data for a block */
361
+ export interface Measure {
362
+ blockId: string;
363
+ width: number;
364
+ height: number;
365
+ lines?: Array<{
366
+ width: number;
367
+ ascent: number;
368
+ descent: number;
369
+ lineHeight: number;
370
+ }>;
371
+ [key: string]: unknown;
372
+ }
373
+
374
+ /** Section metadata for multi-section documents */
375
+ export interface SectionMetadata {
376
+ sectionIndex: number;
377
+ startPage: number;
378
+ endPage: number;
379
+ [key: string]: unknown;
380
+ }
381
+
382
+ /** Paint snapshot for debugging/testing */
383
+ export interface PaintSnapshot {
384
+ formatVersion: 1;
385
+ pageCount: number;
386
+ lineCount: number;
387
+ markerCount: number;
388
+ tabCount: number;
389
+ pages: Array<{
390
+ index: number;
391
+ pageNumber?: number;
392
+ lineCount: number;
393
+ lines: Array<{
394
+ index: number;
395
+ inTableFragment: boolean;
396
+ inTableParagraph: boolean;
397
+ style: Record<string, unknown>;
398
+ }>;
399
+ }>;
400
+ }
401
+
402
+ /** Payload for layout update events */
403
+ export interface LayoutUpdatePayload {
404
+ blocks: FlowBlock[];
405
+ measures: Measure[];
406
+ layout: Layout;
407
+ metrics?: LayoutMetrics;
408
+ }
409
+
155
410
  // ============================================
156
411
  // EDITOR CLASS
157
412
  // ============================================
@@ -309,13 +564,333 @@ export declare class SuperToolbar {
309
564
  [key: string]: any;
310
565
  }
311
566
 
567
+ /**
568
+ * PresentationEditor provides a paginated, layout-engine-powered editing experience.
569
+ * It wraps a hidden ProseMirror Editor and renders via the layout engine pipeline.
570
+ */
312
571
  export declare class PresentationEditor {
313
- /** Get the painted DOM element for a document position (body only) */
314
- getElementAtPos?: (
572
+ /**
573
+ * Creates a new PresentationEditor instance.
574
+ * @param options - Configuration options including the host element
575
+ */
576
+ constructor(options: PresentationEditorOptions);
577
+
578
+ /**
579
+ * Get a PresentationEditor instance by document ID.
580
+ */
581
+ static getInstance(documentId: string): PresentationEditor | undefined;
582
+
583
+ /**
584
+ * Set zoom globally across all PresentationEditor instances.
585
+ */
586
+ static setGlobalZoom(zoom: number): void;
587
+
588
+ // ============================================
589
+ // Public Getters
590
+ // ============================================
591
+
592
+ /** The underlying ProseMirror Editor instance */
593
+ readonly editor: Editor;
594
+
595
+ /** The visible host element where the editor is rendered */
596
+ readonly element: HTMLElement;
597
+
598
+ /** Command service for the currently active editor (body or header/footer) */
599
+ readonly commands: EditorCommands;
600
+
601
+ /** ProseMirror editor state for the currently active editor */
602
+ readonly state: EditorState;
603
+
604
+ /** Whether the active editor accepts input */
605
+ readonly isEditable: boolean;
606
+
607
+ /** Editor options for the currently active editor */
608
+ readonly options: Record<string, any>;
609
+
610
+ /** The visible host container element */
611
+ readonly visibleHost: HTMLElement;
612
+
613
+ /** Selection overlay element for caret and highlight rendering */
614
+ readonly overlayElement: HTMLElement | null;
615
+
616
+ /** Current zoom level (1 = 100%) */
617
+ readonly zoom: number;
618
+
619
+ // ============================================
620
+ // Public Methods
621
+ // ============================================
622
+
623
+ /**
624
+ * Dispatch a ProseMirror transaction to the currently active editor.
625
+ */
626
+ dispatch(tr: Transaction): void;
627
+
628
+ /**
629
+ * Focus the editor.
630
+ */
631
+ focus(): void;
632
+
633
+ /**
634
+ * Returns the currently active editor (body or header/footer session).
635
+ */
636
+ getActiveEditor(): Editor;
637
+
638
+ /**
639
+ * Undo the last action in the active editor.
640
+ */
641
+ undo(): boolean;
642
+
643
+ /**
644
+ * Redo the last undone action in the active editor.
645
+ */
646
+ redo(): boolean;
647
+
648
+ /**
649
+ * Run a callback against the active editor.
650
+ */
651
+ dispatchInActiveEditor(callback: (editor: Editor) => void): void;
652
+
653
+ /**
654
+ * Set the document mode and update editor editability.
655
+ * @param mode - 'editing', 'viewing', or 'suggesting'
656
+ */
657
+ setDocumentMode(mode: 'editing' | 'viewing' | 'suggesting'): void;
658
+
659
+ /**
660
+ * Override tracked-changes rendering preferences.
661
+ */
662
+ setTrackedChangesOverrides(overrides?: TrackedChangesOverrides): void;
663
+
664
+ /**
665
+ * Update viewing-mode comment rendering behavior.
666
+ */
667
+ setViewingCommentOptions(options?: {
668
+ emitCommentPositionsInViewing?: boolean;
669
+ enableCommentsInViewing?: boolean;
670
+ }): void;
671
+
672
+ /**
673
+ * Toggle the custom context menu.
674
+ */
675
+ setContextMenuDisabled(disabled: boolean): void;
676
+
677
+ /**
678
+ * Subscribe to layout update events. Returns an unsubscribe function.
679
+ */
680
+ onLayoutUpdated(handler: (payload: LayoutUpdatePayload) => void): () => void;
681
+
682
+ /**
683
+ * Subscribe to layout error events. Returns an unsubscribe function.
684
+ */
685
+ onLayoutError(handler: (error: LayoutError) => void): () => void;
686
+
687
+ /**
688
+ * Get the rendered pages.
689
+ */
690
+ getPages(): LayoutPage[];
691
+
692
+ /**
693
+ * Get the most recent layout error (if any).
694
+ */
695
+ getLayoutError(): LayoutError | null;
696
+
697
+ /**
698
+ * Check if layout is healthy.
699
+ */
700
+ isLayoutHealthy(): boolean;
701
+
702
+ /**
703
+ * Get detailed layout health state.
704
+ */
705
+ getLayoutHealthState(): 'healthy' | 'degraded' | 'failed';
706
+
707
+ /**
708
+ * Get layout-relative rects for the current document selection.
709
+ */
710
+ getSelectionRects(relativeTo?: HTMLElement): RangeRect[];
711
+
712
+ /**
713
+ * Convert a document range into layout-based bounding rects.
714
+ */
715
+ getRangeRects(from: number, to: number, relativeTo?: HTMLElement): RangeRect[];
716
+
717
+ /**
718
+ * Get bounds for a document range.
719
+ */
720
+ getSelectionBounds(
721
+ from: number,
722
+ to: number,
723
+ relativeTo?: HTMLElement,
724
+ ): {
725
+ bounds: BoundingRect;
726
+ rects: RangeRect[];
727
+ pageIndex: number;
728
+ } | null;
729
+
730
+ /**
731
+ * Remap comment positions to layout coordinates with bounds and rects.
732
+ */
733
+ getCommentBounds(
734
+ positions: Record<string, { start?: number; end?: number; pos?: number; [key: string]: unknown }>,
735
+ relativeTo?: HTMLElement,
736
+ ): Record<
737
+ string,
738
+ {
739
+ start?: number;
740
+ end?: number;
741
+ pos?: number;
742
+ bounds?: BoundingRect;
743
+ rects?: RangeRect[];
744
+ pageIndex?: number;
745
+ [key: string]: unknown;
746
+ }
747
+ >;
748
+
749
+ /**
750
+ * Get current layout snapshot.
751
+ */
752
+ getLayoutSnapshot(): {
753
+ blocks: FlowBlock[];
754
+ measures: Measure[];
755
+ layout: Layout | null;
756
+ sectionMetadata: SectionMetadata[];
757
+ };
758
+
759
+ /**
760
+ * Get current layout options.
761
+ */
762
+ getLayoutOptions(): LayoutEngineOptions;
763
+
764
+ /**
765
+ * Get current paint snapshot.
766
+ */
767
+ getPaintSnapshot(): PaintSnapshot | null;
768
+
769
+ /**
770
+ * Get section-aware page styles.
771
+ */
772
+ getCurrentSectionPageStyles(): {
773
+ pageSize: { width: number; height: number };
774
+ pageMargins: { left: number; right: number; top: number; bottom: number };
775
+ sectionIndex: number;
776
+ orientation: 'portrait' | 'landscape';
777
+ };
778
+
779
+ /**
780
+ * Get remote cursor states for all collaborators.
781
+ */
782
+ getRemoteCursors(): RemoteCursorState[];
783
+
784
+ /**
785
+ * Set the layout mode (vertical or horizontal).
786
+ */
787
+ setLayoutMode(mode: LayoutMode): void;
788
+
789
+ /**
790
+ * Hit test at client coordinates to find document position.
791
+ */
792
+ hitTest(clientX: number, clientY: number): PositionHit | null;
793
+
794
+ /**
795
+ * Normalize client coordinates to layout coordinates.
796
+ */
797
+ normalizeClientPoint(
798
+ clientX: number,
799
+ clientY: number,
800
+ ): {
801
+ x: number;
802
+ y: number;
803
+ pageIndex?: number;
804
+ pageLocalY?: number;
805
+ } | null;
806
+
807
+ /**
808
+ * Get viewport coordinates at a document position.
809
+ */
810
+ coordsAtPos(
315
811
  pos: number,
316
- options?: { forceRebuild?: boolean; fallbackToCoords?: boolean },
317
- ) => HTMLElement | null;
812
+ ): { left: number; right: number; top: number; bottom: number; width: number; height: number } | null;
813
+
814
+ /**
815
+ * Get the painted DOM element for a document position (body only).
816
+ */
817
+ getElementAtPos(pos: number, options?: { forceRebuild?: boolean; fallbackToCoords?: boolean }): HTMLElement | null;
818
+
819
+ /**
820
+ * Scroll to a document position.
821
+ */
822
+ scrollToPosition(pos: number, options?: { behavior?: ScrollBehavior; block?: ScrollLogicalPosition }): boolean;
823
+
824
+ /**
825
+ * Scroll to a document position (async version).
826
+ */
827
+ scrollToPositionAsync(
828
+ pos: number,
829
+ options?: { behavior?: ScrollBehavior; block?: ScrollLogicalPosition },
830
+ ): Promise<boolean>;
831
+
832
+ /**
833
+ * Scroll to a specific page number.
834
+ */
835
+ scrollToPage(pageNumber: number, scrollBehavior?: ScrollBehavior): Promise<boolean>;
836
+
837
+ /**
838
+ * Get document position at viewport coordinates.
839
+ */
840
+ posAtCoords(coords: {
841
+ left?: number;
842
+ top?: number;
843
+ clientX?: number;
844
+ clientY?: number;
845
+ }): { pos: number; inside: number } | null;
318
846
 
847
+ /**
848
+ * Update zoom level and re-render.
849
+ * @param zoom - Zoom level multiplier (1.0 = 100%)
850
+ */
851
+ setZoom(zoom: number): void;
852
+
853
+ /**
854
+ * Navigate to a document anchor/bookmark.
855
+ */
856
+ goToAnchor(anchor: string): Promise<boolean>;
857
+
858
+ /**
859
+ * Convert layout coordinates back to viewport coordinates.
860
+ */
861
+ denormalizeClientPoint(
862
+ layoutX: number,
863
+ layoutY: number,
864
+ pageIndex?: number,
865
+ height?: number,
866
+ ): { x: number; y: number; height?: number } | null;
867
+
868
+ /**
869
+ * Compute caret position in layout coordinates.
870
+ */
871
+ computeCaretLayoutRect(pos: number): { pageIndex: number; x: number; y: number; height: number } | null;
872
+
873
+ /**
874
+ * Clean up editor and DOM nodes.
875
+ */
876
+ destroy(): void;
877
+
878
+ /**
879
+ * Register an event listener.
880
+ */
881
+ on(event: string, handler: (...args: any[]) => void): void;
882
+
883
+ /**
884
+ * Remove an event listener.
885
+ */
886
+ off(event: string, handler: (...args: any[]) => void): void;
887
+
888
+ /**
889
+ * Emit an event.
890
+ */
891
+ emit(event: string, ...args: any[]): void;
892
+
893
+ /** Allow additional properties */
319
894
  [key: string]: any;
320
895
  }
321
896
 
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_src = require("./chunks/src-C_BYlKtR.cjs");
4
- const require_SuperConverter = require("./chunks/SuperConverter-BbWMX2Yr.cjs");
3
+ const require_src = require("./chunks/src-C9-llU1u.cjs");
4
+ const require_SuperConverter = require("./chunks/SuperConverter-DvMtX0CH.cjs");
5
5
  require("./chunks/jszip-DCT9QYaK.cjs");
6
6
  require("./chunks/xml-js--DznO7Gk.cjs");
7
7
  require("./chunks/constants-7MkJJnfa.cjs");
@@ -1,5 +1,5 @@
1
- import { $ as SectionHelpers, Bt as defineNode, Ht as assertNodeType, Q as trackChangesHelpers_exports, Ut as isNodeType, Vt as isMarkType, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, a as BasicUpload_default, at as CommentsPluginKey, c as Toolbar_default, et as PresentationEditor, i as SuperEditor_default, it as AnnotatorHelpers, n as SlashMenu, nt as getAllowedImageDimensions, o as ContextMenu_default, ot as createOrUpdateTrackedChangeComment, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, st as TrackChangesBasePluginKey, t as Extensions, tt as Editor, zt as defineMark } from "./chunks/src-Bdcvgeb3.es.js";
2
- import { B as getMarksFromSelection, R as getActiveFormatting, a as helpers_exports, r as registeredHandlers, t as SuperConverter } from "./chunks/SuperConverter-DAG0cqbz.es.js";
1
+ import { $ as SectionHelpers, Bt as defineNode, Ht as assertNodeType, Q as trackChangesHelpers_exports, Ut as isNodeType, Vt as isMarkType, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, a as BasicUpload_default, at as CommentsPluginKey, c as Toolbar_default, et as PresentationEditor, i as SuperEditor_default, it as AnnotatorHelpers, n as SlashMenu, nt as getAllowedImageDimensions, o as ContextMenu_default, ot as createOrUpdateTrackedChangeComment, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, st as TrackChangesBasePluginKey, t as Extensions, tt as Editor, zt as defineMark } from "./chunks/src-bVAmi6lL.es.js";
2
+ import { B as getMarksFromSelection, R as getActiveFormatting, a as helpers_exports, r as registeredHandlers, t as SuperConverter } from "./chunks/SuperConverter-IgiRNOfZ.es.js";
3
3
  import "./chunks/jszip-ChlR43oI.es.js";
4
4
  import "./chunks/xml-js-DLE8mr0n.es.js";
5
5
  import "./chunks/constants-CMPtQbp7.es.js";
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_src = require("./chunks/src-C_BYlKtR.cjs");
4
- const require_SuperConverter = require("./chunks/SuperConverter-BbWMX2Yr.cjs");
3
+ const require_src = require("./chunks/src-C9-llU1u.cjs");
4
+ const require_SuperConverter = require("./chunks/SuperConverter-DvMtX0CH.cjs");
5
5
  const require_jszip = require("./chunks/jszip-DCT9QYaK.cjs");
6
6
  require("./chunks/xml-js--DznO7Gk.cjs");
7
7
  const require_uuid = require("./chunks/uuid-BZOhSkTa.cjs");
@@ -20338,7 +20338,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
20338
20338
  this.config.colors = shuffleArray(this.config.colors);
20339
20339
  this.userColorMap = /* @__PURE__ */ new Map();
20340
20340
  this.colorIndex = 0;
20341
- this.version = "1.18.0-next.23";
20341
+ this.version = "1.18.0-next.24";
20342
20342
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
20343
20343
  this.superdocId = config.superdocId || require_uuid.v4_default();
20344
20344
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
- import { $ as SectionHelpers, A as isMounted, At as toUint8Array, B as cNotM, C as resolveWrappedSlot, Ct as getUnixTime, D as warnOnce, Dt as readVarUint8Array, E as throwError, Et as readVarUint, F as changeColor, Ft as pow, G as ellipsis_vertical_solid_default, H as insideModal, I as c, It as v_click_outside_default, J as comment_solid_default, K as xmark_solid_default, L as cB, Lt as getFileObject, M as use_memo_default, Mt as writeVarUint8Array, N as on, Nt as create, O as useSsrAdapter, Ot as createEncoder, P as createId, Pt as min, Q as trackChangesHelpers_exports, R as cE, Rt as comments_module_events, S as configProviderInjectionKey, St as setIfUndefined, T as call, Tt as readVarString, U as insidePopover, V as createKey, W as caret_down_solid_default, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, _ as useRtl, _t as applyAwarenessUpdate, at as CommentsPluginKey, b as useThemeClass, bt as map, ct as getTrackChanges, d as Dropdown_default, dt as toBase64, et as PresentationEditor, f as ConfigProvider_default, ft as isNode, g as _common_default$2, gt as Awareness, h as index_cssr_default$5, ht as varStorage, i as SuperEditor_default, it as AnnotatorHelpers, j as useMergedState, jt as writeVarUint, k as createInjectionKey, kt as length, l as messageApiInjectionKey, lt as createUint8ArrayFromArrayBuffer, m as use_theme_default, mt as onChange, ot as createOrUpdateTrackedChangeComment, p as light_default$1, pt as offChange, q as check_solid_default, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, t as Extensions, tt as Editor, u as messageProviderInjectionKey, ut as fromBase64, v as cssrAnchorMetaName, vt as encodeAwarenessUpdate, w as render, wt as createDecoder, x as useConfig, xt as ObservableV2, y as toString_default, yt as removeAwarenessStates, z as cM } from "./chunks/src-Bdcvgeb3.es.js";
2
- import { a as helpers_exports, r as registeredHandlers, t as SuperConverter } from "./chunks/SuperConverter-DAG0cqbz.es.js";
1
+ import { $ as SectionHelpers, A as isMounted, At as toUint8Array, B as cNotM, C as resolveWrappedSlot, Ct as getUnixTime, D as warnOnce, Dt as readVarUint8Array, E as throwError, Et as readVarUint, F as changeColor, Ft as pow, G as ellipsis_vertical_solid_default, H as insideModal, I as c, It as v_click_outside_default, J as comment_solid_default, K as xmark_solid_default, L as cB, Lt as getFileObject, M as use_memo_default, Mt as writeVarUint8Array, N as on, Nt as create, O as useSsrAdapter, Ot as createEncoder, P as createId, Pt as min, Q as trackChangesHelpers_exports, R as cE, Rt as comments_module_events, S as configProviderInjectionKey, St as setIfUndefined, T as call, Tt as readVarString, U as insidePopover, V as createKey, W as caret_down_solid_default, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, _ as useRtl, _t as applyAwarenessUpdate, at as CommentsPluginKey, b as useThemeClass, bt as map, ct as getTrackChanges, d as Dropdown_default, dt as toBase64, et as PresentationEditor, f as ConfigProvider_default, ft as isNode, g as _common_default$2, gt as Awareness, h as index_cssr_default$5, ht as varStorage, i as SuperEditor_default, it as AnnotatorHelpers, j as useMergedState, jt as writeVarUint, k as createInjectionKey, kt as length, l as messageApiInjectionKey, lt as createUint8ArrayFromArrayBuffer, m as use_theme_default, mt as onChange, ot as createOrUpdateTrackedChangeComment, p as light_default$1, pt as offChange, q as check_solid_default, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, t as Extensions, tt as Editor, u as messageProviderInjectionKey, ut as fromBase64, v as cssrAnchorMetaName, vt as encodeAwarenessUpdate, w as render, wt as createDecoder, x as useConfig, xt as ObservableV2, y as toString_default, yt as removeAwarenessStates, z as cM } from "./chunks/src-bVAmi6lL.es.js";
2
+ import { a as helpers_exports, r as registeredHandlers, t as SuperConverter } from "./chunks/SuperConverter-IgiRNOfZ.es.js";
3
3
  import { a as init_dist$1, i as global, n as init_dist, r as process$1 } from "./chunks/jszip-ChlR43oI.es.js";
4
4
  import "./chunks/xml-js-DLE8mr0n.es.js";
5
5
  import { n as v4_default } from "./chunks/uuid-qzgm05fK.es.js";
@@ -20297,7 +20297,7 @@ var SuperDoc = class extends import_eventemitter3.default {
20297
20297
  this.config.colors = shuffleArray(this.config.colors);
20298
20298
  this.userColorMap = /* @__PURE__ */ new Map();
20299
20299
  this.colorIndex = 0;
20300
- this.version = "1.18.0-next.23";
20300
+ this.version = "1.18.0-next.24";
20301
20301
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
20302
20302
  this.superdocId = config.superdocId || v4_default();
20303
20303
  this.colors = this.config.colors;
@@ -64512,7 +64512,7 @@ while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] &
64512
64512
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
64513
64513
  function getSuperdocVersion() {
64514
64514
  try {
64515
- return "1.18.0-next.23";
64515
+ return "1.18.0-next.24";
64516
64516
  } catch {
64517
64517
  return "unknown";
64518
64518
  }
@@ -67694,7 +67694,7 @@ while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] &
67694
67694
  static getStoredSuperdocVersion(docx) {
67695
67695
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
67696
67696
  }
67697
- static setStoredSuperdocVersion(docx = this.convertedXml, version$2 = "1.18.0-next.23") {
67697
+ static setStoredSuperdocVersion(docx = this.convertedXml, version$2 = "1.18.0-next.24") {
67698
67698
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version$2, false);
67699
67699
  }
67700
67700
  static generateWordTimestamp() {
@@ -97575,7 +97575,7 @@ while (n$2 === a$3[++i$3] && n$2 === a$3[++i$3] && n$2 === a$3[++i$3] && n$2 ===
97575
97575
  return false;
97576
97576
  }
97577
97577
  };
97578
- var summaryVersion = "1.18.0-next.23";
97578
+ var summaryVersion = "1.18.0-next.24";
97579
97579
  var nodeKeys = [
97580
97580
  "group",
97581
97581
  "content",
@@ -126530,7 +126530,7 @@ while (n$2 === a$3[++i$3] && n$2 === a$3[++i$3] && n$2 === a$3[++i$3] && n$2 ===
126530
126530
  return migrations.length > 0;
126531
126531
  }
126532
126532
  processCollaborationMigrations() {
126533
- console.debug("[checkVersionMigrations] Current editor version", "1.18.0-next.23");
126533
+ console.debug("[checkVersionMigrations] Current editor version", "1.18.0-next.24");
126534
126534
  if (!this.options.ydoc) return;
126535
126535
  let docVersion = this.options.ydoc.getMap("meta").get("version");
126536
126536
  if (!docVersion) docVersion = "initial";
@@ -213769,7 +213769,7 @@ js: import "konva/skia-backend";
213769
213769
  this.config.colors = shuffleArray(this.config.colors);
213770
213770
  this.userColorMap = /* @__PURE__ */ new Map();
213771
213771
  this.colorIndex = 0;
213772
- this.version = "1.18.0-next.23";
213772
+ this.version = "1.18.0-next.24";
213773
213773
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
213774
213774
  this.superdocId = config$32.superdocId || v4_default();
213775
213775
  this.colors = this.config.colors;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@harbour-enterprises/superdoc",
3
3
  "type": "module",
4
- "version": "1.18.0-next.23",
4
+ "version": "1.18.0-next.24",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -99,8 +99,8 @@
99
99
  "ws": "^8.18.3",
100
100
  "xml-js": "1.6.11",
101
101
  "@superdoc/common": "1.0.0",
102
- "@superdoc/super-editor": "0.0.1",
103
- "@superdoc-dev/superdoc-yjs-collaboration": "1.0.2"
102
+ "@superdoc-dev/superdoc-yjs-collaboration": "1.0.2",
103
+ "@superdoc/super-editor": "0.0.1"
104
104
  },
105
105
  "publishConfig": {
106
106
  "access": "public"