@superdoc-dev/cli 0.8.0-next.18 → 0.8.0-next.19

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 +138 -39
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -65610,7 +65610,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
65610
65610
  emptyOptions2 = {};
65611
65611
  });
65612
65612
 
65613
- // ../../packages/superdoc/dist/chunks/SuperConverter-D6fPzZYT.es.js
65613
+ // ../../packages/superdoc/dist/chunks/SuperConverter-Dn6cDET4.es.js
65614
65614
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
65615
65615
  const fieldValue = extension$1.config[field];
65616
65616
  if (typeof fieldValue === "function")
@@ -117174,7 +117174,6 @@ var isRegExp = (value) => {
117174
117174
  const attributes = {
117175
117175
  "w:id": String(commentId),
117176
117176
  "w:author": comment.creatorName || comment.importedAuthor?.name,
117177
- "w:email": comment.creatorEmail || comment.importedAuthor?.email,
117178
117177
  "w:date": toIsoNoFractional(comment.createdTime),
117179
117178
  "w:initials": getInitials(comment.creatorName),
117180
117179
  "w:done": comment.resolvedTime ? "1" : "0",
@@ -117184,7 +117183,8 @@ var isRegExp = (value) => {
117184
117183
  "custom:trackedChangeText": comment.trackedChangeText || null,
117185
117184
  "custom:trackedChangeType": comment.trackedChangeType,
117186
117185
  "custom:trackedChangeDisplayType": comment.trackedChangeDisplayType || null,
117187
- "custom:trackedDeletedText": comment.deletedText || null
117186
+ "custom:trackedDeletedText": comment.deletedText || null,
117187
+ "custom:email": comment.creatorEmail || comment.importedAuthor?.email
117188
117188
  };
117189
117189
  if (comment?.parentCommentId) {
117190
117190
  const parentComment = allComments.find((c$1) => c$1.commentId === comment.parentCommentId);
@@ -117223,7 +117223,6 @@ var isRegExp = (value) => {
117223
117223
  commentDef.attributes = {
117224
117224
  "w:id": commentDef.attributes["w:id"],
117225
117225
  "w:author": commentDef.attributes["w:author"],
117226
- "w:email": commentDef.attributes["w:email"],
117227
117226
  "w:date": commentDef.attributes["w:date"],
117228
117227
  "w:initials": commentDef.attributes["w:initials"],
117229
117228
  "custom:internalId": commentDef.attributes["custom:internalId"],
@@ -117232,6 +117231,7 @@ var isRegExp = (value) => {
117232
117231
  "custom:trackedChangeType": commentDef.attributes["custom:trackedChangeType"],
117233
117232
  "custom:trackedChangeDisplayType": commentDef.attributes["custom:trackedChangeDisplayType"],
117234
117233
  "custom:trackedDeletedText": commentDef.attributes["custom:trackedDeletedText"],
117234
+ "custom:email": commentDef.attributes["custom:email"],
117235
117235
  "xmlns:custom": "http://schemas.openxmlformats.org/wordprocessingml/2006/main"
117236
117236
  };
117237
117237
  });
@@ -117365,7 +117365,8 @@ var isRegExp = (value) => {
117365
117365
  updatedXml["word/comments.xml"] = updateCommentsXml(defs, updatedXml["word/comments.xml"]);
117366
117366
  relationships.push(generateRelationship("comments.xml"));
117367
117367
  emittedTargets.add("comments.xml");
117368
- const commentsExtendedXml = updateCommentsExtendedXml(commentsWithParaIds, updatedXml["word/commentsExtended.xml"], threadingProfile || exportStrategy);
117368
+ const effectiveThreadingProfile = threadingProfile?.defaultStyle === "range-based" && threadingProfile?.fileSet?.hasCommentsExtended === false ? "word" : threadingProfile || exportStrategy;
117369
+ const commentsExtendedXml = updateCommentsExtendedXml(commentsWithParaIds, updatedXml["word/commentsExtended.xml"], effectiveThreadingProfile);
117369
117370
  if (commentsExtendedXml !== null) {
117370
117371
  updatedXml["word/commentsExtended.xml"] = commentsExtendedXml;
117371
117372
  relationships.push(generateRelationship("commentsExtended.xml"));
@@ -117855,7 +117856,7 @@ var isRegExp = (value) => {
117855
117856
  if (id2)
117856
117857
  return trackedChanges.filter(({ mark }) => mark.attrs.id === id2);
117857
117858
  return trackedChanges;
117858
- }, DERIVED_ID_LENGTH = 24, groupedCache, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", VALID_CONTROL_TYPES, VALID_LOCK_MODES2, VALID_APPEARANCES, FIELD_LIKE_SDT_TYPES, liveDocumentCountsCache, BIBLIOGRAPHY_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE = "/APA.XSL", DEFAULT_STYLE_NAME = "APA", DEFAULT_VERSION = "6", API_TO_OOXML_SOURCE_TYPE, OOXML_TO_API_SOURCE_TYPE, SIMPLE_FIELD_TO_XML_TAG, XML_TAG_TO_SIMPLE_FIELD, import_lib2, FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", DEFAULT_FONT_SIZE_PT = 10, CURRENT_APP_VERSION = "1.28.0", collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
117859
+ }, DERIVED_ID_LENGTH = 24, groupedCache, SDT_NODE_NAMES, SDT_BLOCK_NAME = "structuredContentBlock", VALID_CONTROL_TYPES, VALID_LOCK_MODES2, VALID_APPEARANCES, FIELD_LIKE_SDT_TYPES, liveDocumentCountsCache, BIBLIOGRAPHY_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE = "/APA.XSL", DEFAULT_STYLE_NAME = "APA", DEFAULT_VERSION = "6", API_TO_OOXML_SOURCE_TYPE, OOXML_TO_API_SOURCE_TYPE, SIMPLE_FIELD_TO_XML_TAG, XML_TAG_TO_SIMPLE_FIELD, import_lib2, FONT_FAMILY_FALLBACKS, DEFAULT_GENERIC_FALLBACK = "sans-serif", DEFAULT_FONT_SIZE_PT = 10, CURRENT_APP_VERSION = "1.29.0", collectRunDefaultProperties = (runProps, { allowOverrideTypeface = true, allowOverrideSize = true, themeResolver, state }) => {
117859
117860
  if (!runProps?.elements?.length || !state)
117860
117861
  return;
117861
117862
  const fontsNode = runProps.elements.find((el) => el.name === "w:rFonts");
@@ -117889,7 +117890,7 @@ var isRegExp = (value) => {
117889
117890
  state.kern = kernNode.attributes["w:val"];
117890
117891
  }
117891
117892
  }, SuperConverter;
117892
- var init_SuperConverter_D6fPzZYT_es = __esm(() => {
117893
+ var init_SuperConverter_Dn6cDET4_es = __esm(() => {
117893
117894
  init_rolldown_runtime_Bg48TavK_es();
117894
117895
  init_jszip_C49i9kUs_es();
117895
117896
  init_xml_js_CqGKpaft_es();
@@ -155318,7 +155319,7 @@ var init_SuperConverter_D6fPzZYT_es = __esm(() => {
155318
155319
  };
155319
155320
  });
155320
155321
 
155321
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-77DlIukc.es.js
155322
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CQu_F9Mr.es.js
155322
155323
  function parseSizeUnit(val = "0") {
155323
155324
  const length3 = val.toString() || "0";
155324
155325
  const value = Number.parseFloat(length3);
@@ -157910,8 +157911,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
157910
157911
  }
157911
157912
  };
157912
157913
  };
157913
- var init_create_headless_toolbar_77DlIukc_es = __esm(() => {
157914
- init_SuperConverter_D6fPzZYT_es();
157914
+ var init_create_headless_toolbar_CQu_F9Mr_es = __esm(() => {
157915
+ init_SuperConverter_Dn6cDET4_es();
157915
157916
  init_constants_CGhJRd87_es();
157916
157917
  init_dist_B8HfvhaK_es();
157917
157918
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -206598,7 +206599,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
206598
206599
  init_remark_gfm_BhnWr3yf_es();
206599
206600
  });
206600
206601
 
206601
- // ../../packages/superdoc/dist/chunks/src-BQyWXTfI.es.js
206602
+ // ../../packages/superdoc/dist/chunks/src-CLao-BLx.es.js
206602
206603
  function deleteProps(obj, propOrProps) {
206603
206604
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
206604
206605
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -207241,7 +207242,7 @@ function prosemirrorToYXmlFragment(doc$12, xmlFragment) {
207241
207242
  }
207242
207243
  function getSuperdocVersion() {
207243
207244
  try {
207244
- return "1.28.0";
207245
+ return "1.29.0";
207245
207246
  } catch {
207246
207247
  return "unknown";
207247
207248
  }
@@ -260048,6 +260049,22 @@ function assertRequiredBlockMeasurePair(label, blocks2, measures) {
260048
260049
  if (blocks2.length !== measures.length)
260049
260050
  throw new Error(`${label} blocks and measures must have the same length.`);
260050
260051
  }
260052
+ function normalizeOptionalBlockMeasurePair(label, blocks2, measures) {
260053
+ const hasBlocks = blocks2 !== undefined;
260054
+ const hasMeasures = measures !== undefined;
260055
+ if (hasBlocks !== hasMeasures) {
260056
+ if (label === "body")
260057
+ throw new Error("blocks and measures must both be provided or both be omitted.");
260058
+ throw new Error(`${label}Blocks and ${label}Measures must both be provided or both be omitted.`);
260059
+ }
260060
+ if (!hasBlocks || !hasMeasures)
260061
+ return;
260062
+ assertRequiredBlockMeasurePair(label, blocks2, measures);
260063
+ return {
260064
+ blocks: blocks2,
260065
+ measures
260066
+ };
260067
+ }
260051
260068
  function createEmptyResolvedLayout(flowMode, pageGap) {
260052
260069
  return {
260053
260070
  version: 1,
@@ -260059,6 +260076,20 @@ function createEmptyResolvedLayout(flowMode, pageGap) {
260059
260076
  function isDomPainterInput(value) {
260060
260077
  return "resolvedLayout" in value && "sourceLayout" in value;
260061
260078
  }
260079
+ function normalizeDomPainterInput(input2) {
260080
+ const body = normalizeOptionalBlockMeasurePair("body", input2.blocks, input2.measures);
260081
+ const header = normalizeOptionalBlockMeasurePair("header", input2.headerBlocks, input2.headerMeasures);
260082
+ const footer = normalizeOptionalBlockMeasurePair("footer", input2.footerBlocks, input2.footerMeasures);
260083
+ return {
260084
+ ...input2,
260085
+ blocks: body?.blocks,
260086
+ measures: body?.measures,
260087
+ headerBlocks: header?.blocks,
260088
+ headerMeasures: header?.measures,
260089
+ footerBlocks: footer?.blocks,
260090
+ footerMeasures: footer?.measures
260091
+ };
260092
+ }
260062
260093
  function buildLegacyPaintInput(layout, legacyState, flowMode, pageGap) {
260063
260094
  let resolvedLayout;
260064
260095
  if (legacyState.resolvedLayout)
@@ -260074,7 +260105,13 @@ function buildLegacyPaintInput(layout, legacyState, flowMode, pageGap) {
260074
260105
  });
260075
260106
  return {
260076
260107
  resolvedLayout,
260077
- sourceLayout: layout
260108
+ sourceLayout: layout,
260109
+ blocks: legacyState.blocks,
260110
+ measures: legacyState.measures,
260111
+ headerBlocks: legacyState.headerBlocks,
260112
+ headerMeasures: legacyState.headerMeasures,
260113
+ footerBlocks: legacyState.footerBlocks,
260114
+ footerMeasures: legacyState.footerMeasures
260078
260115
  };
260079
260116
  }
260080
260117
  function appendToArrayMap(map$12, key2, value) {
@@ -278508,7 +278545,7 @@ var Node$13 = class Node$14 {
278508
278545
  domAvailabilityCache = false;
278509
278546
  return false;
278510
278547
  }
278511
- }, summaryVersion = "1.28.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
278548
+ }, summaryVersion = "1.29.0", nodeKeys, markKeys, transformListsInCopiedContent = (html3) => {
278512
278549
  const container = document.createElement("div");
278513
278550
  container.innerHTML = html3;
278514
278551
  const result = [];
@@ -279091,7 +279128,7 @@ var Node$13 = class Node$14 {
279091
279128
  listener(snapshot2);
279092
279129
  } catch {}
279093
279130
  }
279094
- }, EMITTABLE_BLOCK_TYPES, SDT_BLOCK_NODE_NAMES, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, 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, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, HEADING_PATTERN, OOXML_DEFAULT_FONT_SIZE_PT = 10, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, SYMBOL_FONT_NAMES, RFONTS_FAMILY_ATTRS, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART$1 = "word/settings.xml", WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "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", relsPartDescriptor, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, DEFAULT_LEVEL = 1, SWITCH_PATTERN, TOC_BOOKMARK_PREFIX = "_Toc", DEFAULT_RIGHT_TAB_POS = 9350, TAB_LEADER_MAP, NO_ENTRIES_PLACEHOLDER, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SETTINGS_PART, SPECIAL_NOTE_TYPES, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.28.0", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, cloneExtensionInstance = (extension3) => {
279131
+ }, EMITTABLE_BLOCK_TYPES, SDT_BLOCK_NODE_NAMES, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, 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, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, HEADING_PATTERN, OOXML_DEFAULT_FONT_SIZE_PT = 10, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, SYMBOL_FONT_NAMES, RFONTS_FAMILY_ATTRS, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART$1 = "word/settings.xml", WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "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", relsPartDescriptor, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, DEFAULT_LEVEL = 1, SWITCH_PATTERN, TOC_BOOKMARK_PREFIX = "_Toc", DEFAULT_RIGHT_TAB_POS = 9350, TAB_LEADER_MAP, NO_ENTRIES_PLACEHOLDER, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SETTINGS_PART, SPECIAL_NOTE_TYPES, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.29.0", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, cloneExtensionInstance = (extension3) => {
279095
279132
  const extensionLike = extension3;
279096
279133
  const config2 = extensionLike?.config;
279097
279134
  const ExtensionCtor = extensionLike?.constructor;
@@ -288671,37 +288708,91 @@ menclose::after {
288671
288708
  }, createDomPainter = (options) => {
288672
288709
  if ((options.blocks ?? []).length !== (options.measures ?? []).length)
288673
288710
  throw new Error("DomPainter requires the same number of blocks and measures");
288711
+ const legacyState = {
288712
+ blocks: options.blocks ?? [],
288713
+ measures: options.measures ?? [],
288714
+ headerBlocks: undefined,
288715
+ headerMeasures: undefined,
288716
+ footerBlocks: undefined,
288717
+ footerMeasures: undefined,
288718
+ resolvedLayout: null
288719
+ };
288720
+ let currentPaintInput = null;
288721
+ const resolveDecorationItems = (fragments, kind) => {
288722
+ const input2 = currentPaintInput;
288723
+ if (!input2)
288724
+ return;
288725
+ const decorationBlocks = kind === "header" ? input2.headerBlocks : input2.footerBlocks;
288726
+ const decorationMeasures = kind === "header" ? input2.headerMeasures : input2.footerMeasures;
288727
+ const mergedBlocks = [...input2.blocks ?? [], ...decorationBlocks ?? []];
288728
+ const mergedMeasures = [...input2.measures ?? [], ...decorationMeasures ?? []];
288729
+ if (mergedBlocks.length === 0 || mergedBlocks.length !== mergedMeasures.length)
288730
+ return;
288731
+ const fakeLayout = {
288732
+ pageSize: input2.sourceLayout.pageSize,
288733
+ pages: [{
288734
+ number: 1,
288735
+ fragments: [...fragments]
288736
+ }]
288737
+ };
288738
+ try {
288739
+ return resolveLayout({
288740
+ layout: fakeLayout,
288741
+ flowMode: input2.resolvedLayout.flowMode,
288742
+ blocks: mergedBlocks,
288743
+ measures: mergedMeasures
288744
+ }).pages[0]?.items;
288745
+ } catch {
288746
+ return;
288747
+ }
288748
+ };
288749
+ const wrapProvider = (provider, kind) => {
288750
+ if (!provider)
288751
+ return;
288752
+ return (pageNumber, pageMargins, page) => {
288753
+ const payload = provider(pageNumber, pageMargins, page);
288754
+ if (!payload || payload.items)
288755
+ return payload;
288756
+ const items = resolveDecorationItems(payload.fragments, kind);
288757
+ return items ? {
288758
+ ...payload,
288759
+ items
288760
+ } : payload;
288761
+ };
288762
+ };
288674
288763
  const painter = new DomPainter({
288675
288764
  pageStyles: options.pageStyles,
288676
288765
  layoutMode: options.layoutMode,
288677
288766
  flowMode: options.flowMode,
288678
288767
  pageGap: options.pageGap,
288679
- headerProvider: options.headerProvider,
288680
- footerProvider: options.footerProvider,
288768
+ headerProvider: wrapProvider(options.headerProvider, "header"),
288769
+ footerProvider: wrapProvider(options.footerProvider, "footer"),
288681
288770
  virtualization: options.virtualization,
288682
288771
  ruler: options.ruler,
288683
288772
  onPaintSnapshot: options.onPaintSnapshot
288684
288773
  });
288685
- const legacyState = {
288686
- blocks: options.blocks ?? [],
288687
- measures: options.measures ?? [],
288688
- resolvedLayout: null
288689
- };
288690
288774
  return {
288691
288775
  paint(input2, mount, mapping) {
288692
- const normalizedInput = isDomPainterInput(input2) ? input2 : buildLegacyPaintInput(input2, legacyState, options.flowMode, options.pageGap);
288776
+ const normalizedInput = isDomPainterInput(input2) ? normalizeDomPainterInput(input2) : buildLegacyPaintInput(input2, legacyState, options.flowMode, options.pageGap);
288777
+ currentPaintInput = normalizedInput;
288693
288778
  painter.paint(normalizedInput, mount, mapping);
288694
288779
  },
288695
- setData(blocks2, measures) {
288780
+ setData(blocks2, measures, headerBlocks, headerMeasures, footerBlocks, footerMeasures) {
288696
288781
  assertRequiredBlockMeasurePair("body", blocks2, measures);
288782
+ const normalizedHeader = normalizeOptionalBlockMeasurePair("header", headerBlocks, headerMeasures);
288783
+ const normalizedFooter = normalizeOptionalBlockMeasurePair("footer", footerBlocks, footerMeasures);
288697
288784
  legacyState.blocks = blocks2;
288698
288785
  legacyState.measures = measures;
288786
+ legacyState.headerBlocks = normalizedHeader?.blocks;
288787
+ legacyState.headerMeasures = normalizedHeader?.measures;
288788
+ legacyState.footerBlocks = normalizedFooter?.blocks;
288789
+ legacyState.footerMeasures = normalizedFooter?.measures;
288699
288790
  },
288700
288791
  setResolvedLayout(resolvedLayout) {
288701
288792
  legacyState.resolvedLayout = resolvedLayout;
288702
288793
  },
288703
288794
  setProviders(header, footer) {
288704
- painter.setProviders(header, footer);
288795
+ painter.setProviders(wrapProvider(header, "header"), wrapProvider(footer, "footer"));
288705
288796
  },
288706
288797
  setVirtualizationPins(pageIndices) {
288707
288798
  painter.setVirtualizationPins(pageIndices);
@@ -293571,6 +293662,18 @@ menclose::after {
293571
293662
  this.#footerDecorationProvider = this.createDecorationProvider("footer", layout);
293572
293663
  this.rebuildRegions(layout);
293573
293664
  }
293665
+ resolveAlignedDecorationItems(fragments, slotPageNumber, result, cachedResolvedLayout, contextLabel) {
293666
+ const cachedItems = cachedResolvedLayout?.pages.find((page) => page.number === slotPageNumber)?.items;
293667
+ if (cachedItems && cachedItems.length === fragments.length)
293668
+ return cachedItems;
293669
+ if (cachedItems)
293670
+ console.warn(`[HeaderFooterSessionManager] Resolved items length (${cachedItems.length}) does not match fragments length (${fragments.length}) for ${contextLabel}. Recomputing items.`);
293671
+ const freshItems = resolveHeaderFooterLayout(result.layout, result.blocks, result.measures).pages.find((page) => page.number === slotPageNumber)?.items;
293672
+ if (freshItems && freshItems.length === fragments.length)
293673
+ return freshItems;
293674
+ if (freshItems)
293675
+ console.warn(`[HeaderFooterSessionManager] Fresh resolved items length (${freshItems.length}) does not match fragments length (${fragments.length}) for ${contextLabel}. Dropping items.`);
293676
+ }
293574
293677
  createDecorationProvider(kind, layout) {
293575
293678
  const results = kind === "header" ? this.#headerLayoutResults : this.#footerLayoutResults;
293576
293679
  const layoutsByRId = kind === "header" ? this.#headerLayoutsByRId : this.#footerLayoutsByRId;
@@ -293623,10 +293726,8 @@ menclose::after {
293623
293726
  const slotPage$1 = this.#findPageForNumber(rIdLayout.layout.pages, pageNumber);
293624
293727
  if (slotPage$1) {
293625
293728
  const fragments$1 = slotPage$1.fragments ?? [];
293626
- const resolvedItems = resolvedByRId.get(rIdLayoutKey)?.pages.find((p$12) => p$12.number === slotPage$1.number)?.items;
293627
- if (resolvedItems && resolvedItems.length !== fragments$1.length)
293628
- console.warn(`[HeaderFooterSessionManager] Resolved items length (${resolvedItems.length}) does not match fragments length (${fragments$1.length}) for rId '${rIdLayoutKey}' page ${pageNumber}. Dropping items.`);
293629
- const alignedItems = resolvedItems && resolvedItems.length === fragments$1.length ? resolvedItems : undefined;
293729
+ const resolvedLayout = resolvedByRId.get(rIdLayoutKey);
293730
+ const alignedItems = this.resolveAlignedDecorationItems(fragments$1, slotPage$1.number, rIdLayout, resolvedLayout, `rId '${rIdLayoutKey}' page ${pageNumber}`);
293630
293731
  const pageHeight$1 = page?.size?.h ?? layout.pageSize?.h ?? layoutOptions.pageSize?.h ?? defaultPageSize.h;
293631
293732
  const margins$1 = pageMargins ?? layout.pages[0]?.margins ?? layoutOptions.margins ?? defaultMargins;
293632
293733
  const decorationMargins$1 = kind === "footer" ? this.#stripFootnoteReserveFromBottomMargin(margins$1, page ?? null) : margins$1;
@@ -293672,10 +293773,8 @@ menclose::after {
293672
293773
  if (!slotPage)
293673
293774
  return null;
293674
293775
  const fragments = slotPage.fragments ?? [];
293675
- const resolvedVariantItems = resolvedResults?.[variantIndex]?.pages.find((p$12) => p$12.number === slotPage.number)?.items;
293676
- if (resolvedVariantItems && resolvedVariantItems.length !== fragments.length)
293677
- console.warn(`[HeaderFooterSessionManager] Resolved items length (${resolvedVariantItems.length}) does not match fragments length (${fragments.length}) for variant '${headerFooterType}' page ${pageNumber}. Dropping items.`);
293678
- const alignedVariantItems = resolvedVariantItems && resolvedVariantItems.length === fragments.length ? resolvedVariantItems : undefined;
293776
+ const resolvedVariant = resolvedResults?.[variantIndex];
293777
+ const alignedVariantItems = this.resolveAlignedDecorationItems(fragments, slotPage.number, variant, resolvedVariant, `variant '${headerFooterType}' page ${pageNumber}`);
293679
293778
  const pageHeight = page?.size?.h ?? layout.pageSize?.h ?? layoutOptions.pageSize?.h ?? defaultPageSize.h;
293680
293779
  const margins = pageMargins ?? layout.pages[0]?.margins ?? layoutOptions.margins ?? defaultMargins;
293681
293780
  const decorationMargins = kind === "footer" ? this.#stripFootnoteReserveFromBottomMargin(margins, page ?? null) : margins;
@@ -293955,12 +294054,12 @@ menclose::after {
293955
294054
  return;
293956
294055
  console.log(...args$1);
293957
294056
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
293958
- var init_src_BQyWXTfI_es = __esm(() => {
294057
+ var init_src_CLao_BLx_es = __esm(() => {
293959
294058
  init_rolldown_runtime_Bg48TavK_es();
293960
- init_SuperConverter_D6fPzZYT_es();
294059
+ init_SuperConverter_Dn6cDET4_es();
293961
294060
  init_jszip_C49i9kUs_es();
293962
294061
  init_uuid_qzgm05fK_es();
293963
- init_create_headless_toolbar_77DlIukc_es();
294062
+ init_create_headless_toolbar_CQu_F9Mr_es();
293964
294063
  init_constants_CGhJRd87_es();
293965
294064
  init_dist_B8HfvhaK_es();
293966
294065
  init_unified_Dsuw2be5_es();
@@ -330135,11 +330234,11 @@ var init_zipper_DbkgrypV_es = __esm(() => {
330135
330234
 
330136
330235
  // ../../packages/superdoc/dist/super-editor.es.js
330137
330236
  var init_super_editor_es = __esm(() => {
330138
- init_src_BQyWXTfI_es();
330139
- init_SuperConverter_D6fPzZYT_es();
330237
+ init_src_CLao_BLx_es();
330238
+ init_SuperConverter_Dn6cDET4_es();
330140
330239
  init_jszip_C49i9kUs_es();
330141
330240
  init_xml_js_CqGKpaft_es();
330142
- init_create_headless_toolbar_77DlIukc_es();
330241
+ init_create_headless_toolbar_CQu_F9Mr_es();
330143
330242
  init_constants_CGhJRd87_es();
330144
330243
  init_dist_B8HfvhaK_es();
330145
330244
  init_unified_Dsuw2be5_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.8.0-next.18",
3
+ "version": "0.8.0-next.19",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -26,19 +26,19 @@
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
28
  "@superdoc/super-editor": "0.0.1",
29
- "superdoc": "1.28.0",
30
- "@superdoc/pm-adapter": "0.0.0"
29
+ "@superdoc/pm-adapter": "0.0.0",
30
+ "superdoc": "1.29.0"
31
31
  },
32
32
  "module": "src/index.ts",
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.18",
38
- "@superdoc-dev/cli-darwin-x64": "0.8.0-next.18",
39
- "@superdoc-dev/cli-linux-arm64": "0.8.0-next.18",
40
- "@superdoc-dev/cli-windows-x64": "0.8.0-next.18",
41
- "@superdoc-dev/cli-linux-x64": "0.8.0-next.18"
37
+ "@superdoc-dev/cli-darwin-arm64": "0.8.0-next.19",
38
+ "@superdoc-dev/cli-darwin-x64": "0.8.0-next.19",
39
+ "@superdoc-dev/cli-linux-x64": "0.8.0-next.19",
40
+ "@superdoc-dev/cli-linux-arm64": "0.8.0-next.19",
41
+ "@superdoc-dev/cli-windows-x64": "0.8.0-next.19"
42
42
  },
43
43
  "scripts": {
44
44
  "predev": "node scripts/ensure-superdoc-build.js",