@superdoc-dev/cli 0.3.0-next.6 → 0.3.0-next.8

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 (2) hide show
  1. package/dist/index.js +146 -13
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -131315,7 +131315,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
131315
131315
  init_remark_gfm_z_sDF4ss_es();
131316
131316
  });
131317
131317
 
131318
- // ../../packages/superdoc/dist/chunks/src-CIT7og3M.es.js
131318
+ // ../../packages/superdoc/dist/chunks/src-CN3DqjnS.es.js
131319
131319
  function deleteProps(obj, propOrProps) {
131320
131320
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
131321
131321
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -157685,6 +157685,87 @@ function deepEquals(a2, b$1) {
157685
157685
  }
157686
157686
  return false;
157687
157687
  }
157688
+ function omitKeys(attrs, keysToOmit) {
157689
+ const result = {};
157690
+ for (const [key$1, value] of Object.entries(attrs))
157691
+ if (!keysToOmit.has(key$1))
157692
+ result[key$1] = value;
157693
+ return result;
157694
+ }
157695
+ function normalizeParagraphAttrs(attrs) {
157696
+ return omitKeys(attrs, VOLATILE_PARAGRAPH_ATTRS);
157697
+ }
157698
+ function normalizeImageNodeJSON(nodeJSON) {
157699
+ const attrs = nodeJSON.attrs;
157700
+ if (!attrs?.originalAttributes)
157701
+ return nodeJSON;
157702
+ const originalAttributes = attrs.originalAttributes;
157703
+ const cleanedOriginalAttributes = omitKeys(originalAttributes, VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS);
157704
+ return {
157705
+ ...nodeJSON,
157706
+ attrs: {
157707
+ ...attrs,
157708
+ originalAttributes: cleanedOriginalAttributes
157709
+ }
157710
+ };
157711
+ }
157712
+ function normalizeInlineNodeJSON(nodeJSON) {
157713
+ if (nodeJSON.type === "image")
157714
+ return normalizeImageNodeJSON(nodeJSON);
157715
+ return nodeJSON;
157716
+ }
157717
+ function normalizeInlineNodeAttrs(typeName, attrs) {
157718
+ if (typeName !== "image")
157719
+ return attrs;
157720
+ const originalAttributes = attrs.originalAttributes;
157721
+ if (!originalAttributes)
157722
+ return attrs;
157723
+ return {
157724
+ ...attrs,
157725
+ originalAttributes: omitKeys(originalAttributes, VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS)
157726
+ };
157727
+ }
157728
+ function semanticInlineNodeKey(node3) {
157729
+ return JSON.stringify(normalizeInlineNodeJSON(node3.toJSON()));
157730
+ }
157731
+ function normalizeParagraphNodeJSON(nodeJSON) {
157732
+ const attrs = nodeJSON.attrs ?? {};
157733
+ const content3 = nodeJSON.content;
157734
+ return {
157735
+ ...nodeJSON,
157736
+ attrs: normalizeParagraphAttrs(attrs),
157737
+ ...content3 ? { content: content3.map(normalizeContentNodeJSON) } : {}
157738
+ };
157739
+ }
157740
+ function normalizeContentNodeJSON(nodeJSON) {
157741
+ const content3 = nodeJSON.content;
157742
+ if (!content3)
157743
+ return normalizeInlineNodeJSON(nodeJSON);
157744
+ return {
157745
+ ...nodeJSON,
157746
+ content: content3.map(normalizeContentNodeJSON)
157747
+ };
157748
+ }
157749
+ function normalizeDocJSON(docJSON) {
157750
+ const content3 = docJSON.content;
157751
+ if (!content3)
157752
+ return docJSON;
157753
+ return {
157754
+ ...docJSON,
157755
+ content: content3.map(normalizeDocNodeJSON)
157756
+ };
157757
+ }
157758
+ function normalizeDocNodeJSON(nodeJSON) {
157759
+ if (nodeJSON.type === "paragraph")
157760
+ return normalizeParagraphNodeJSON(nodeJSON);
157761
+ const content3 = nodeJSON.content;
157762
+ if (content3)
157763
+ return {
157764
+ ...nodeJSON,
157765
+ content: content3.map(normalizeDocNodeJSON)
157766
+ };
157767
+ return nodeJSON;
157768
+ }
157688
157769
  function myersDiff(oldSeq, newSeq, isEqual$1) {
157689
157770
  const oldLen = oldSeq.length;
157690
157771
  const newLen = newSeq.length;
@@ -157939,7 +158020,7 @@ function getInlineDiff(oldContent, newContent, oldParagraphEndPos) {
157939
158020
  buildDeleted: (token, oldIdx) => buildInlineDiff("deleted", token, oldIdx),
157940
158021
  buildModified: (oldToken, newToken, oldIdx) => {
157941
158022
  if (oldToken.kind !== "text" && newToken.kind !== "text") {
157942
- const attrsDiff = getAttributesDiff(oldToken.node.attrs, newToken.node.attrs);
158023
+ const attrsDiff = getAttributesDiff(normalizeInlineNodeAttrs(oldToken.node.type.name, oldToken.node.attrs), normalizeInlineNodeAttrs(newToken.node.type.name, newToken.node.attrs));
157943
158024
  return {
157944
158025
  action: "modified",
157945
158026
  idx: oldIdx,
@@ -157972,15 +158053,15 @@ function inlineComparator(a2, b$1) {
157972
158053
  if (a2.kind === "text" && b$1.kind === "text")
157973
158054
  return a2.char === b$1.char;
157974
158055
  if (a2.kind === "inlineNode" && b$1.kind === "inlineNode")
157975
- return a2.node.type.name === b$1.node.type.name;
158056
+ return semanticInlineNodeKey(a2.node) === semanticInlineNodeKey(b$1.node);
157976
158057
  return false;
157977
158058
  }
157978
158059
  function shouldProcessEqualAsModification$3(oldToken, newToken) {
157979
158060
  if (oldToken.kind === "text" && newToken.kind === "text")
157980
158061
  return Boolean(getAttributesDiff(oldToken.runAttrs, newToken.runAttrs)) || oldToken.marks?.length !== newToken.marks?.length || Boolean(getMarksDiff(oldToken.marks, newToken.marks));
157981
158062
  if (oldToken.kind === "inlineNode" && newToken.kind === "inlineNode") {
157982
- const oldJSON = oldToken.node.toJSON();
157983
- const newJSON = newToken.node.toJSON();
158063
+ const oldJSON = normalizeInlineNodeJSON(oldToken.node.toJSON());
158064
+ const newJSON = normalizeInlineNodeJSON(newToken.node.toJSON());
157984
158065
  return JSON.stringify(oldJSON) !== JSON.stringify(newJSON);
157985
158066
  }
157986
158067
  return false;
@@ -158160,18 +158241,28 @@ function createParagraphSnapshot(paragraph2, paragraphPos, depth) {
158160
158241
  depth,
158161
158242
  text: text5,
158162
158243
  endPos: paragraphPos + 1 + paragraph2.content.size,
158163
- fullText: text5.map((token) => token.kind === "text" ? token.char : "").join("")
158244
+ fullText: text5.map((token) => token.kind === "text" ? token.char : "").join(""),
158245
+ contentSignature: buildContentSignature(text5)
158164
158246
  };
158165
158247
  }
158248
+ function buildContentSignature(tokens) {
158249
+ return tokens.map((token) => {
158250
+ if (token.kind === "text")
158251
+ return token.char;
158252
+ return `\x00${semanticInlineNodeKey(token.node)}\x00`;
158253
+ }).join("");
158254
+ }
158166
158255
  function shouldProcessEqualAsModification$1(oldParagraph, newParagraph) {
158167
- return JSON.stringify(oldParagraph.node.toJSON()) !== JSON.stringify(newParagraph.node.toJSON());
158256
+ const oldNormalized = normalizeParagraphNodeJSON(oldParagraph.node.toJSON());
158257
+ const newNormalized = normalizeParagraphNodeJSON(newParagraph.node.toJSON());
158258
+ return JSON.stringify(oldNormalized) !== JSON.stringify(newNormalized);
158168
158259
  }
158169
158260
  function paragraphComparator(oldParagraph, newParagraph) {
158170
158261
  const oldId = oldParagraph?.node?.attrs?.paraId;
158171
158262
  const newId = newParagraph?.node?.attrs?.paraId;
158172
158263
  if (oldId && newId && oldId === newId)
158173
158264
  return true;
158174
- return oldParagraph?.fullText === newParagraph?.fullText;
158265
+ return (oldParagraph?.contentSignature ?? oldParagraph?.fullText) === (newParagraph?.contentSignature ?? newParagraph?.fullText);
158175
158266
  }
158176
158267
  function buildAddedParagraphDiff(paragraph2, oldNodes, oldIdx) {
158177
158268
  return {
@@ -158193,7 +158284,7 @@ function buildDeletedParagraphDiff(paragraph2) {
158193
158284
  }
158194
158285
  function buildModifiedParagraphDiff(oldParagraph, newParagraph) {
158195
158286
  const contentDiff = getInlineDiff(oldParagraph.text, newParagraph.text, oldParagraph.endPos);
158196
- const attrsDiff = getAttributesDiff(oldParagraph.node.attrs, newParagraph.node.attrs);
158287
+ const attrsDiff = getAttributesDiff(normalizeParagraphAttrs(oldParagraph.node.attrs), normalizeParagraphAttrs(newParagraph.node.attrs));
158197
158288
  if (contentDiff.length === 0 && !attrsDiff)
158198
158289
  return null;
158199
158290
  return {
@@ -159364,7 +159455,7 @@ function canonicalizeComment(comment2) {
159364
159455
  }
159365
159456
  function buildCanonicalDiffableState(doc$2, comments, styles, numbering) {
159366
159457
  return {
159367
- body: doc$2.toJSON(),
159458
+ body: normalizeDocJSON(doc$2.toJSON()),
159368
159459
  comments: comments.map(canonicalizeComment),
159369
159460
  styles: styles ? styles : null,
159370
159461
  numbering: numbering ? numbering : null
@@ -198680,7 +198771,7 @@ var Node$13 = class Node$14 {
198680
198771
  return;
198681
198772
  const candidate = run2.pmEnd;
198682
198773
  return typeof candidate === "number" ? candidate : undefined;
198683
- }, engines_exports, DEFAULT_HEADER_FOOTER_MARGIN_PX = 0, LINK_MARK_NAME = "link", COMMENT_MARK_NAME, SUPPORTED_INLINE_TYPES, cacheByEditor, OBJECT_REPLACEMENT_CHAR = "", LINE_NUMBER_RESTART_VALUES, PAGE_NUMBER_FORMAT_VALUES, SECTION_ORIENTATION_VALUES, SECTION_VERTICAL_ALIGN_VALUES, readSectPrHeaderFooterRefs, PIXELS_PER_INCH$2 = 96, BULLET_FORMATS$1, LOCK_MODE_TO_SDT_LOCK, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", VALID_CONTROL_TYPES, VALID_LOCK_MODES, VALID_APPEARANCES, SNIPPET_PADDING = 30, DUAL_KIND_TYPES, KNOWN_BLOCK_PM_NODE_TYPES, KNOWN_INLINE_PM_NODE_TYPES, MAX_PATTERN_LENGTH = 1024, TOGGLE_MARK_SPECS, CORE_MARK_NAMES, METADATA_MARK_NAMES, CSS_NAMED_COLORS, HEADING_STYLE_DEPTH, BULLET_FORMATS, MARK_PRIORITY, remarkProcessor, DEFAULT_UNFLATTEN_LISTS = true, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, registry, VALID_CREATE_POSITIONS, REF_HANDLERS, STEP_INTERACTION_MATRIX, MATRIX_EXEMPT_OPS, DEFAULT_INLINE_POLICY, CORE_SET_MARK_KEYS, BOOLEAN_INLINE_MARK_KEYS, TEXT_STYLE_KEYS, PRESERVE_RUN_PROPERTIES_META_KEY = "sdPreserveRunPropertiesKeys", CONTENT_CAPABILITIES, INLINE_CAPABILITIES, SDT_LOCK_TO_LOCK_MODE, STUB_WHERE, EMPTY_RESOLUTION, CONTAINER_NODE_TYPES, VALID_EDGE_NODE_TYPES3, FALLBACK_STORE_KEY = "__documentApiComments", STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL2, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, PARAGRAPH_NODE_TYPES, ALIGNMENT_TO_JUSTIFICATION, DERIVED_ID_LENGTH = 24, groupedCache, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES, SETTINGS_PART_PATH = "word/settings.xml", POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART = "word/settings.xml", TABLE_ADAPTER_DISPATCH, ROW_OPS, TABLE_SCOPED_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", RELS_XMLNS$1 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, DOCUMENT_RELS_PATH$1 = "word/_rels/document.xml.rels", RELS_XMLNS2 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", WORDPROCESSINGML_XMLNS = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", OFFICE_DOCUMENT_RELS_XMLNS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", RELATIONSHIP_ID_PATTERN, HEADER_FILE_PATTERN$1, FOOTER_FILE_PATTERN$1, HISTORY_UNSAFE_OPS, IGNORED_ATTRIBUTE_KEYS, TRACK_CHANGE_MARK_NAMES, TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS, SIMILARITY_THRESHOLD = 0.65, MIN_LENGTH_FOR_SIMILARITY = 4, COMMENT_ATTRS_DIFF_IGNORED_KEYS, setNestedValue = (target, path2, value) => {
198774
+ }, engines_exports, DEFAULT_HEADER_FOOTER_MARGIN_PX = 0, LINK_MARK_NAME = "link", COMMENT_MARK_NAME, SUPPORTED_INLINE_TYPES, cacheByEditor, OBJECT_REPLACEMENT_CHAR = "", LINE_NUMBER_RESTART_VALUES, PAGE_NUMBER_FORMAT_VALUES, SECTION_ORIENTATION_VALUES, SECTION_VERTICAL_ALIGN_VALUES, readSectPrHeaderFooterRefs, PIXELS_PER_INCH$2 = 96, BULLET_FORMATS$1, LOCK_MODE_TO_SDT_LOCK, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", VALID_CONTROL_TYPES, VALID_LOCK_MODES, VALID_APPEARANCES, SNIPPET_PADDING = 30, DUAL_KIND_TYPES, KNOWN_BLOCK_PM_NODE_TYPES, KNOWN_INLINE_PM_NODE_TYPES, MAX_PATTERN_LENGTH = 1024, TOGGLE_MARK_SPECS, CORE_MARK_NAMES, METADATA_MARK_NAMES, CSS_NAMED_COLORS, HEADING_STYLE_DEPTH, BULLET_FORMATS, MARK_PRIORITY, remarkProcessor, DEFAULT_UNFLATTEN_LISTS = true, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, registry, VALID_CREATE_POSITIONS, REF_HANDLERS, STEP_INTERACTION_MATRIX, MATRIX_EXEMPT_OPS, DEFAULT_INLINE_POLICY, CORE_SET_MARK_KEYS, BOOLEAN_INLINE_MARK_KEYS, TEXT_STYLE_KEYS, PRESERVE_RUN_PROPERTIES_META_KEY = "sdPreserveRunPropertiesKeys", CONTENT_CAPABILITIES, INLINE_CAPABILITIES, SDT_LOCK_TO_LOCK_MODE, STUB_WHERE, EMPTY_RESOLUTION, CONTAINER_NODE_TYPES, VALID_EDGE_NODE_TYPES3, FALLBACK_STORE_KEY = "__documentApiComments", STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL2, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, PARAGRAPH_NODE_TYPES, ALIGNMENT_TO_JUSTIFICATION, DERIVED_ID_LENGTH = 24, groupedCache, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES, SETTINGS_PART_PATH = "word/settings.xml", POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART = "word/settings.xml", TABLE_ADAPTER_DISPATCH, ROW_OPS, TABLE_SCOPED_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", RELS_XMLNS$1 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, DOCUMENT_RELS_PATH$1 = "word/_rels/document.xml.rels", RELS_XMLNS2 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", WORDPROCESSINGML_XMLNS = "http://schemas.openxmlformats.org/wordprocessingml/2006/main", OFFICE_DOCUMENT_RELS_XMLNS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", RELATIONSHIP_ID_PATTERN, HEADER_FILE_PATTERN$1, FOOTER_FILE_PATTERN$1, HISTORY_UNSAFE_OPS, IGNORED_ATTRIBUTE_KEYS, TRACK_CHANGE_MARK_NAMES, TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS, VOLATILE_PARAGRAPH_ATTRS, VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS, SIMILARITY_THRESHOLD = 0.65, MIN_LENGTH_FOR_SIMILARITY = 4, COMMENT_ATTRS_DIFF_IGNORED_KEYS, setNestedValue = (target, path2, value) => {
198684
198775
  if (!path2.includes(".")) {
198685
198776
  target[path2] = value;
198686
198777
  return;
@@ -217747,7 +217838,7 @@ var Node$13 = class Node$14 {
217747
217838
  return false;
217748
217839
  return Boolean(checker(attrs));
217749
217840
  }, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
217750
- var init_src_CIT7og3M_es = __esm(() => {
217841
+ var init_src_CN3DqjnS_es = __esm(() => {
217751
217842
  init_rolldown_runtime_B2q5OVn9_es();
217752
217843
  init_SuperConverter_C2Sw7Q5Z_es();
217753
217844
  init_jszip_ChlR43oI_es();
@@ -226948,6 +227039,16 @@ function print() { __p += __j.call(arguments, '') }
226948
227039
  "trackFormat"
226949
227040
  ]);
226950
227041
  TRACK_CHANGE_IGNORED_ATTRIBUTE_KEYS = new Set(["id", "sourceId"]);
227042
+ VOLATILE_PARAGRAPH_ATTRS = new Set([
227043
+ "paraId",
227044
+ "textId",
227045
+ "rsidR",
227046
+ "rsidRDefault",
227047
+ "rsidP",
227048
+ "rsidRPr",
227049
+ "rsidDel"
227050
+ ]);
227051
+ VOLATILE_IMAGE_ORIGINAL_ATTR_KEYS = new Set(["wp14:anchorId", "wp14:editId"]);
226951
227052
  COMMENT_ATTRS_DIFF_IGNORED_KEYS = [
226952
227053
  "textJson",
226953
227054
  "elements",
@@ -236823,6 +236924,7 @@ function print() { __p += __j.call(arguments, '') }
236823
236924
  #editorListeners = [];
236824
236925
  #scrollHandler = null;
236825
236926
  #scrollContainer = null;
236927
+ #scrollContainerValidated = false;
236826
236928
  #sectionMetadata = [];
236827
236929
  #documentMode = "editing";
236828
236930
  #inputBridge = null;
@@ -238379,6 +238481,36 @@ function print() { __p += __j.call(arguments, '') }
238379
238481
  }
238380
238482
  return win;
238381
238483
  }
238484
+ #revalidateScrollContainer() {
238485
+ if (this.#scrollContainerValidated)
238486
+ return;
238487
+ this.#scrollContainerValidated = true;
238488
+ if (!(this.#scrollContainer instanceof Element))
238489
+ return;
238490
+ if (this.#scrollContainer.scrollHeight > this.#scrollContainer.clientHeight + 1)
238491
+ return;
238492
+ const win = this.#scrollContainer.ownerDocument?.defaultView;
238493
+ const viewportHeight = win?.innerHeight ?? 0;
238494
+ if (this.#scrollContainer.clientHeight <= viewportHeight)
238495
+ return;
238496
+ let el = this.#scrollContainer.parentElement;
238497
+ let next2 = win ?? null;
238498
+ while (el) {
238499
+ const { overflowY } = getComputedStyle(el);
238500
+ if ((overflowY === "auto" || overflowY === "scroll") && el.scrollHeight > el.clientHeight + 1) {
238501
+ next2 = el;
238502
+ break;
238503
+ }
238504
+ el = el.parentElement;
238505
+ }
238506
+ if (!next2 || next2 === this.#scrollContainer)
238507
+ return;
238508
+ this.#scrollContainer.removeEventListener("scroll", this.#scrollHandler);
238509
+ this.#scrollContainer = next2;
238510
+ if (next2 instanceof Element)
238511
+ next2.addEventListener("scroll", this.#scrollHandler, { passive: true });
238512
+ this.#domPainter?.setScrollContainer?.(next2 instanceof HTMLElement ? next2 : null);
238513
+ }
238382
238514
  #setupDragHandlers() {
238383
238515
  this.#dragDropManager?.destroy();
238384
238516
  this.#dragDropManager = new DragDropManager;
@@ -238895,6 +239027,7 @@ function print() { __p += __j.call(arguments, '') }
238895
239027
  this.#epochMapper.onLayoutComplete(layoutEpoch);
238896
239028
  this.#selectionSync.onLayoutComplete(layoutEpoch);
238897
239029
  layoutCompleted = true;
239030
+ this.#revalidateScrollContainer();
238898
239031
  this.#updatePermissionOverlay();
238899
239032
  this.#layoutError = null;
238900
239033
  this.#layoutErrorState = "healthy";
@@ -251875,7 +252008,7 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
251875
252008
 
251876
252009
  // ../../packages/superdoc/dist/super-editor.es.js
251877
252010
  var init_super_editor_es = __esm(() => {
251878
- init_src_CIT7og3M_es();
252011
+ init_src_CN3DqjnS_es();
251879
252012
  init_SuperConverter_C2Sw7Q5Z_es();
251880
252013
  init_jszip_ChlR43oI_es();
251881
252014
  init_xml_js_BtmJ6bNs_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.3.0-next.6",
3
+ "version": "0.3.0-next.8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -20,21 +20,21 @@
20
20
  "@types/bun": "^1.3.8",
21
21
  "@types/node": "22.19.2",
22
22
  "typescript": "^5.9.2",
23
- "@superdoc/document-api": "0.0.1",
24
23
  "@superdoc/pm-adapter": "0.0.0",
25
- "superdoc": "1.19.0",
26
- "@superdoc/super-editor": "0.0.1"
24
+ "@superdoc/document-api": "0.0.1",
25
+ "@superdoc/super-editor": "0.0.1",
26
+ "superdoc": "1.19.0"
27
27
  },
28
28
  "module": "src/index.ts",
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@superdoc-dev/cli-darwin-arm64": "0.3.0-next.6",
34
- "@superdoc-dev/cli-linux-x64": "0.3.0-next.6",
35
- "@superdoc-dev/cli-darwin-x64": "0.3.0-next.6",
36
- "@superdoc-dev/cli-linux-arm64": "0.3.0-next.6",
37
- "@superdoc-dev/cli-windows-x64": "0.3.0-next.6"
33
+ "@superdoc-dev/cli-darwin-arm64": "0.3.0-next.8",
34
+ "@superdoc-dev/cli-darwin-x64": "0.3.0-next.8",
35
+ "@superdoc-dev/cli-linux-x64": "0.3.0-next.8",
36
+ "@superdoc-dev/cli-windows-x64": "0.3.0-next.8",
37
+ "@superdoc-dev/cli-linux-arm64": "0.3.0-next.8"
38
38
  },
39
39
  "scripts": {
40
40
  "dev": "bun run src/index.ts",