@superdoc-dev/cli 0.3.0-next.5 → 0.3.0-next.7

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 +142 -16
  2. package/package.json +8 -8
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-BQ8I1JWL.es.js
131318
+ // ../../packages/superdoc/dist/chunks/src-B8eoy16L.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_BQ8I1JWL_es = __esm(() => {
217841
+ var init_src_B8eoy16L_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",
@@ -236801,6 +236902,7 @@ function print() { __p += __j.call(arguments, '') }
236801
236902
  #errorBannerMessage = null;
236802
236903
  #renderScheduled = false;
236803
236904
  #pendingDocChange = false;
236905
+ #focusScrollRafId = null;
236804
236906
  #pendingMapping = null;
236805
236907
  #isRerendering = false;
236806
236908
  #selectionSync = new SelectionSyncCoordinator;
@@ -237124,6 +237226,13 @@ function print() { __p += __j.call(arguments, '') }
237124
237226
  }
237125
237227
  if (win.scrollX !== beforeX || win.scrollY !== beforeY)
237126
237228
  win.scrollTo(beforeX, beforeY);
237229
+ if (this.#focusScrollRafId != null)
237230
+ win.cancelAnimationFrame(this.#focusScrollRafId);
237231
+ this.#focusScrollRafId = win.requestAnimationFrame(() => {
237232
+ this.#focusScrollRafId = null;
237233
+ if (win.scrollX !== beforeX || win.scrollY !== beforeY)
237234
+ win.scrollTo(beforeX, beforeY);
237235
+ });
237127
237236
  };
237128
237237
  }
237129
237238
  get editor() {
@@ -237802,6 +237911,12 @@ function print() { __p += __j.call(arguments, '') }
237802
237911
  return null;
237803
237912
  }
237804
237913
  scrollToPosition(pos, options = {}) {
237914
+ if (this.#focusScrollRafId != null) {
237915
+ const win = this.#visibleHost.ownerDocument?.defaultView;
237916
+ if (win)
237917
+ win.cancelAnimationFrame(this.#focusScrollRafId);
237918
+ this.#focusScrollRafId = null;
237919
+ }
237805
237920
  const doc$2 = this.getActiveEditor()?.state?.doc;
237806
237921
  if (!doc$2)
237807
237922
  return false;
@@ -238019,6 +238134,11 @@ function print() { __p += __j.call(arguments, '') }
238019
238134
  (this.#visibleHost?.ownerDocument?.defaultView ?? window).cancelAnimationFrame(this.#rafHandle);
238020
238135
  this.#rafHandle = null;
238021
238136
  }, "Layout RAF");
238137
+ if (this.#focusScrollRafId != null)
238138
+ safeCleanup(() => {
238139
+ (this.#visibleHost?.ownerDocument?.defaultView ?? window).cancelAnimationFrame(this.#focusScrollRafId);
238140
+ this.#focusScrollRafId = null;
238141
+ }, "Focus scroll RAF");
238022
238142
  if (this.#decorationSyncRafHandle != null)
238023
238143
  safeCleanup(() => {
238024
238144
  (this.#visibleHost?.ownerDocument?.defaultView ?? window).cancelAnimationFrame(this.#decorationSyncRafHandle);
@@ -250791,13 +250911,19 @@ function print() { __p += __j.call(arguments, '') }
250791
250911
  const restoreSelection$1 = () => {
250792
250912
  proxy.$toolbar.activeEditor?.commands?.restoreSelection();
250793
250913
  };
250914
+ const handleToolbarMousedown = (e) => {
250915
+ if (e.target.closest('input, textarea, [contenteditable="true"]'))
250916
+ return;
250917
+ e.preventDefault();
250918
+ };
250794
250919
  return (_ctx, _cache) => {
250795
250920
  return openBlock(), createElementBlock("div", {
250796
250921
  class: "superdoc-toolbar",
250797
250922
  key: unref(toolbarKey),
250798
250923
  role: "toolbar",
250799
250924
  "aria-label": "Toolbar",
250800
- "data-editor-ui-surface": ""
250925
+ "data-editor-ui-surface": "",
250926
+ onMousedown: handleToolbarMousedown
250801
250927
  }, [
250802
250928
  unref(showLeftSide) ? (openBlock(), createBlock(ButtonGroup_default, {
250803
250929
  key: 0,
@@ -250832,10 +250958,10 @@ function print() { __p += __j.call(arguments, '') }
250832
250958
  onItemClicked: restoreSelection$1,
250833
250959
  class: "superdoc-toolbar-group-side"
250834
250960
  }, null, 8, ["toolbar-items", "ui-font-family"])) : createCommentVNode("", true)
250835
- ]);
250961
+ ], 32);
250836
250962
  };
250837
250963
  }
250838
- }, [["__scopeId", "data-v-6f41d6bf"]]);
250964
+ }, [["__scopeId", "data-v-e0242a18"]]);
250839
250965
  toolbarTexts = {
250840
250966
  bold: "Bold",
250841
250967
  fontFamily: "Font",
@@ -251850,7 +251976,7 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
251850
251976
 
251851
251977
  // ../../packages/superdoc/dist/super-editor.es.js
251852
251978
  var init_super_editor_es = __esm(() => {
251853
- init_src_BQ8I1JWL_es();
251979
+ init_src_B8eoy16L_es();
251854
251980
  init_SuperConverter_C2Sw7Q5Z_es();
251855
251981
  init_jszip_ChlR43oI_es();
251856
251982
  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.5",
3
+ "version": "0.3.0-next.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -21,20 +21,20 @@
21
21
  "@types/node": "22.19.2",
22
22
  "typescript": "^5.9.2",
23
23
  "@superdoc/document-api": "0.0.1",
24
+ "@superdoc/pm-adapter": "0.0.0",
24
25
  "@superdoc/super-editor": "0.0.1",
25
- "superdoc": "1.19.0",
26
- "@superdoc/pm-adapter": "0.0.0"
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.5",
34
- "@superdoc-dev/cli-darwin-x64": "0.3.0-next.5",
35
- "@superdoc-dev/cli-linux-x64": "0.3.0-next.5",
36
- "@superdoc-dev/cli-linux-arm64": "0.3.0-next.5",
37
- "@superdoc-dev/cli-windows-x64": "0.3.0-next.5"
33
+ "@superdoc-dev/cli-darwin-arm64": "0.3.0-next.7",
34
+ "@superdoc-dev/cli-darwin-x64": "0.3.0-next.7",
35
+ "@superdoc-dev/cli-linux-x64": "0.3.0-next.7",
36
+ "@superdoc-dev/cli-linux-arm64": "0.3.0-next.7",
37
+ "@superdoc-dev/cli-windows-x64": "0.3.0-next.7"
38
38
  },
39
39
  "scripts": {
40
40
  "dev": "bun run src/index.ts",