superdoc 1.8.1-next.3 → 1.8.2-next.1

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.
@@ -39009,7 +39009,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39009
39009
  static getStoredSuperdocVersion(docx) {
39010
39010
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
39011
39011
  }
39012
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.8.1-next.3") {
39012
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.8.2-next.1") {
39013
39013
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
39014
39014
  }
39015
39015
  /**
@@ -65404,7 +65404,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
65404
65404
  return false;
65405
65405
  }
65406
65406
  };
65407
- const summaryVersion = "1.8.1-next.3";
65407
+ const summaryVersion = "1.8.2-next.1";
65408
65408
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
65409
65409
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
65410
65410
  function mapAttributes(attrs) {
@@ -68128,7 +68128,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68128
68128
  * Process collaboration migrations
68129
68129
  */
68130
68130
  processCollaborationMigrations() {
68131
- console.debug("[checkVersionMigrations] Current editor version", "1.8.1-next.3");
68131
+ console.debug("[checkVersionMigrations] Current editor version", "1.8.2-next.1");
68132
68132
  if (!this.options.ydoc) return;
68133
68133
  const metaMap = this.options.ydoc.getMap("meta");
68134
68134
  let docVersion = metaMap.get("version");
@@ -83950,22 +83950,26 @@ ${o}
83950
83950
  }
83951
83951
  });
83952
83952
  }
83953
- function processTocChildren(children, metadata, context, outputArrays, paragraphConverter) {
83953
+ function processTocChildren(children, metadata, context, outputArrays) {
83954
+ const paragraphConverter = context.converters.paragraphToFlowBlocks;
83954
83955
  const { docPartGallery, docPartObjectId, tocInstruction } = metadata;
83955
83956
  const { blocks: blocks2, recordBlockKind } = outputArrays;
83956
83957
  children.forEach((child) => {
83957
83958
  if (child.type === "paragraph") {
83958
- const paragraphBlocks = paragraphConverter(
83959
- child,
83960
- context.nextBlockId,
83961
- context.positions,
83962
- context.defaultFont,
83963
- context.defaultSize,
83964
- context.styleContext,
83965
- context.trackedChanges,
83966
- context.bookmarks,
83967
- context.hyperlinkConfig
83968
- );
83959
+ const paragraphBlocks = paragraphConverter({
83960
+ para: child,
83961
+ nextBlockId: context.nextBlockId,
83962
+ positions: context.positions,
83963
+ defaultFont: context.defaultFont,
83964
+ defaultSize: context.defaultSize,
83965
+ styleContext: context.styleContext,
83966
+ trackedChangesConfig: context.trackedChangesConfig,
83967
+ bookmarks: context.bookmarks,
83968
+ hyperlinkConfig: context.hyperlinkConfig,
83969
+ converters: context.converters,
83970
+ enableComments: context.enableComments,
83971
+ converterContext: context.converterContext
83972
+ });
83969
83973
  applyTocMetadata(paragraphBlocks, {
83970
83974
  gallery: docPartGallery,
83971
83975
  uniqueId: docPartObjectId,
@@ -83986,8 +83990,7 @@ ${o}
83986
83990
  child.content,
83987
83991
  { docPartGallery, docPartObjectId, tocInstruction: finalInstruction, sdtMetadata: metadata.sdtMetadata },
83988
83992
  context,
83989
- outputArrays,
83990
- paragraphConverter
83993
+ outputArrays
83991
83994
  );
83992
83995
  }
83993
83996
  });
@@ -84005,17 +84008,17 @@ ${o}
84005
84008
  trackedChangesConfig,
84006
84009
  bookmarks,
84007
84010
  hyperlinkConfig,
84008
- converters
84011
+ converters: converters2,
84012
+ converterContext,
84013
+ themeColors,
84014
+ enableComments
84009
84015
  } = context;
84010
84016
  const tocInstruction = getNodeInstruction(node2);
84011
- const paragraphToFlowBlocks2 = converters?.paragraphToFlowBlocks;
84012
- if (!paragraphToFlowBlocks2) {
84013
- return;
84014
- }
84017
+ const paragraphToFlowBlocks2 = converters2.paragraphToFlowBlocks;
84015
84018
  node2.content.forEach((child) => {
84016
84019
  if (child.type === "paragraph") {
84017
- const paragraphBlocks = paragraphToFlowBlocks2(
84018
- child,
84020
+ const paragraphBlocks = paragraphToFlowBlocks2({
84021
+ para: child,
84019
84022
  nextBlockId,
84020
84023
  positions,
84021
84024
  defaultFont,
@@ -84023,8 +84026,12 @@ ${o}
84023
84026
  styleContext,
84024
84027
  trackedChangesConfig,
84025
84028
  bookmarks,
84026
- hyperlinkConfig
84027
- );
84029
+ themeColors,
84030
+ hyperlinkConfig,
84031
+ converters: converters2,
84032
+ enableComments,
84033
+ converterContext
84034
+ });
84028
84035
  paragraphBlocks.forEach((block) => {
84029
84036
  if (block.kind === "paragraph") {
84030
84037
  if (!block.attrs) block.attrs = {};
@@ -84064,12 +84071,11 @@ ${o}
84064
84071
  bookmarks,
84065
84072
  hyperlinkConfig,
84066
84073
  sectionState,
84067
- converters
84074
+ converters: converters2,
84075
+ themeColors,
84076
+ enableComments
84068
84077
  } = context;
84069
- const paragraphToFlowBlocks2 = converters?.paragraphToFlowBlocks;
84070
- if (!paragraphToFlowBlocks2) {
84071
- return;
84072
- }
84078
+ const paragraphToFlowBlocks2 = converters2.paragraphToFlowBlocks;
84073
84079
  children.forEach((child) => {
84074
84080
  if (child.type !== "paragraph") {
84075
84081
  return;
@@ -84086,8 +84092,8 @@ ${o}
84086
84092
  sectionState.currentSectionIndex++;
84087
84093
  }
84088
84094
  }
84089
- const paragraphBlocks = paragraphToFlowBlocks2(
84090
- child,
84095
+ const paragraphBlocks = paragraphToFlowBlocks2({
84096
+ para: child,
84091
84097
  nextBlockId,
84092
84098
  positions,
84093
84099
  defaultFont,
@@ -84096,10 +84102,11 @@ ${o}
84096
84102
  trackedChangesConfig,
84097
84103
  bookmarks,
84098
84104
  hyperlinkConfig,
84099
- void 0,
84100
- // themeColors - not available in NodeHandlerContext
84101
- context.converterContext
84102
- );
84105
+ themeColors,
84106
+ converterContext: context.converterContext,
84107
+ enableComments,
84108
+ converters: converters2
84109
+ });
84103
84110
  paragraphBlocks.forEach((block) => {
84104
84111
  blocks2.push(block);
84105
84112
  recordBlockKind(block.kind);
@@ -84120,17 +84127,17 @@ ${o}
84120
84127
  trackedChangesConfig,
84121
84128
  bookmarks,
84122
84129
  hyperlinkConfig,
84123
- converters
84130
+ converters: converters2,
84131
+ converterContext,
84132
+ enableComments,
84133
+ themeColors
84124
84134
  } = context;
84125
84135
  const structuredContentMetadata = resolveNodeSdtMetadata(node2, "structuredContentBlock");
84126
- const paragraphToFlowBlocks2 = converters?.paragraphToFlowBlocks;
84127
- if (!paragraphToFlowBlocks2) {
84128
- return;
84129
- }
84136
+ const paragraphToFlowBlocks2 = converters2.paragraphToFlowBlocks;
84130
84137
  node2.content.forEach((child) => {
84131
84138
  if (child.type === "paragraph") {
84132
- const paragraphBlocks = paragraphToFlowBlocks2(
84133
- child,
84139
+ const paragraphBlocks = paragraphToFlowBlocks2({
84140
+ para: child,
84134
84141
  nextBlockId,
84135
84142
  positions,
84136
84143
  defaultFont,
@@ -84138,8 +84145,12 @@ ${o}
84138
84145
  styleContext,
84139
84146
  trackedChangesConfig,
84140
84147
  bookmarks,
84141
- hyperlinkConfig
84142
- );
84148
+ hyperlinkConfig,
84149
+ themeColors,
84150
+ enableComments,
84151
+ converters: converters2,
84152
+ converterContext
84153
+ });
84143
84154
  applySdtMetadataToParagraphBlocks(
84144
84155
  paragraphBlocks.filter((b2) => b2.kind === "paragraph"),
84145
84156
  structuredContentMetadata
@@ -84149,10 +84160,10 @@ ${o}
84149
84160
  recordBlockKind(block.kind);
84150
84161
  });
84151
84162
  } else if (child.type === "table") {
84152
- const tableNodeToBlock2 = converters?.tableNodeToBlock;
84163
+ const tableNodeToBlock2 = converters2?.tableNodeToBlock;
84153
84164
  if (tableNodeToBlock2) {
84154
- const tableBlock = tableNodeToBlock2(
84155
- child,
84165
+ const tableBlock = tableNodeToBlock2({
84166
+ node: child,
84156
84167
  nextBlockId,
84157
84168
  positions,
84158
84169
  defaultFont,
@@ -84160,8 +84171,12 @@ ${o}
84160
84171
  styleContext,
84161
84172
  trackedChangesConfig,
84162
84173
  bookmarks,
84163
- hyperlinkConfig
84164
- );
84174
+ hyperlinkConfig,
84175
+ themeColors,
84176
+ enableComments,
84177
+ converters: converters2,
84178
+ converterContext
84179
+ });
84165
84180
  if (tableBlock) {
84166
84181
  applySdtMetadataToTableBlock(tableBlock, structuredContentMetadata);
84167
84182
  blocks2.push(tableBlock);
@@ -84171,19 +84186,22 @@ ${o}
84171
84186
  }
84172
84187
  });
84173
84188
  }
84174
- function processParagraphChild(child, sectionMetadata, context, output, converters) {
84175
- const paragraphBlocks = converters.paragraphToFlowBlocks(
84176
- child,
84177
- context.nextBlockId,
84178
- context.positions,
84179
- context.defaultFont,
84180
- context.defaultSize,
84181
- context.styleContext,
84182
- void 0,
84189
+ function processParagraphChild(child, sectionMetadata, context, output, converters2) {
84190
+ const paragraphBlocks = converters2.paragraphToFlowBlocks({
84191
+ para: child,
84192
+ nextBlockId: context.nextBlockId,
84193
+ positions: context.positions,
84194
+ defaultFont: context.defaultFont,
84195
+ defaultSize: context.defaultSize,
84196
+ styleContext: context.styleContext,
84197
+ trackedChangesConfig: void 0,
84183
84198
  // trackedChanges
84184
- context.bookmarks,
84185
- context.hyperlinkConfig
84186
- );
84199
+ bookmarks: context.bookmarks,
84200
+ hyperlinkConfig: context.hyperlinkConfig,
84201
+ converters: converters2,
84202
+ enableComments: context.enableComments,
84203
+ converterContext: context.converterContext
84204
+ });
84187
84205
  applySdtMetadataToParagraphBlocks(
84188
84206
  paragraphBlocks.filter((b2) => b2.kind === "paragraph"),
84189
84207
  sectionMetadata
@@ -84193,26 +84211,29 @@ ${o}
84193
84211
  output.recordBlockKind(block.kind);
84194
84212
  });
84195
84213
  }
84196
- function processTableChild(child, sectionMetadata, context, output, converters) {
84197
- const tableBlock = converters.tableNodeToBlock(
84198
- child,
84199
- context.nextBlockId,
84200
- context.positions,
84201
- context.defaultFont,
84202
- context.defaultSize,
84203
- context.styleContext,
84204
- void 0,
84205
- void 0,
84206
- context.hyperlinkConfig
84207
- );
84214
+ function processTableChild(child, sectionMetadata, context, output, converters2) {
84215
+ const tableBlock = converters2.tableNodeToBlock({
84216
+ node: child,
84217
+ nextBlockId: context.nextBlockId,
84218
+ positions: context.positions,
84219
+ defaultFont: context.defaultFont,
84220
+ defaultSize: context.defaultSize,
84221
+ styleContext: context.styleContext,
84222
+ trackedChangesConfig: context.trackedChangesConfig,
84223
+ bookmarks: context.bookmarks,
84224
+ hyperlinkConfig: context.hyperlinkConfig,
84225
+ enableComments: context.enableComments,
84226
+ converters: converters2,
84227
+ converterContext: context.converterContext
84228
+ });
84208
84229
  if (tableBlock) {
84209
84230
  applySdtMetadataToTableBlock(tableBlock, sectionMetadata);
84210
84231
  output.blocks.push(tableBlock);
84211
84232
  output.recordBlockKind(tableBlock.kind);
84212
84233
  }
84213
84234
  }
84214
- function processImageChild(child, sectionMetadata, context, output, converters) {
84215
- const imageBlock = converters.imageNodeToBlock(child, context.nextBlockId, context.positions);
84235
+ function processImageChild(child, sectionMetadata, context, output, converters2) {
84236
+ const imageBlock = converters2.imageNodeToBlock(child, context.nextBlockId, context.positions);
84216
84237
  if (imageBlock && imageBlock.kind === "image") {
84217
84238
  if (sectionMetadata) {
84218
84239
  if (!imageBlock.attrs) imageBlock.attrs = {};
@@ -84222,22 +84243,25 @@ ${o}
84222
84243
  output.recordBlockKind(imageBlock.kind);
84223
84244
  }
84224
84245
  }
84225
- function processNestedStructuredContent(child, sectionMetadata, context, output, converters) {
84246
+ function processNestedStructuredContent(child, sectionMetadata, context, output, converters2) {
84226
84247
  const nestedMetadata = resolveNodeSdtMetadata(child, "structuredContentBlock");
84227
84248
  child.content?.forEach((grandchild) => {
84228
84249
  if (grandchild.type === "paragraph") {
84229
- const paragraphBlocks = converters.paragraphToFlowBlocks(
84230
- grandchild,
84231
- context.nextBlockId,
84232
- context.positions,
84233
- context.defaultFont,
84234
- context.defaultSize,
84235
- context.styleContext,
84236
- void 0,
84237
- // trackedChanges
84238
- context.bookmarks,
84239
- context.hyperlinkConfig
84240
- );
84250
+ const paragraphBlocks = converters2.paragraphToFlowBlocks({
84251
+ para: grandchild,
84252
+ nextBlockId: context.nextBlockId,
84253
+ positions: context.positions,
84254
+ defaultFont: context.defaultFont,
84255
+ defaultSize: context.defaultSize,
84256
+ styleContext: context.styleContext,
84257
+ trackedChangesConfig: context.trackedChangesConfig,
84258
+ bookmarks: context.bookmarks,
84259
+ hyperlinkConfig: context.hyperlinkConfig,
84260
+ converters: converters2,
84261
+ enableComments: context.enableComments,
84262
+ converterContext: context.converterContext,
84263
+ themeColors: context.themeColors
84264
+ });
84241
84265
  const paraOnly = paragraphBlocks.filter((b2) => b2.kind === "paragraph");
84242
84266
  applySdtMetadataToParagraphBlocks(paraOnly, nestedMetadata);
84243
84267
  applySdtMetadataToParagraphBlocks(paraOnly, sectionMetadata);
@@ -84246,17 +84270,21 @@ ${o}
84246
84270
  output.recordBlockKind(block.kind);
84247
84271
  });
84248
84272
  } else if (grandchild.type === "table") {
84249
- const tableBlock = converters.tableNodeToBlock(
84250
- grandchild,
84251
- context.nextBlockId,
84252
- context.positions,
84253
- context.defaultFont,
84254
- context.defaultSize,
84255
- context.styleContext,
84256
- void 0,
84257
- void 0,
84258
- context.hyperlinkConfig
84259
- );
84273
+ const tableBlock = converters2.tableNodeToBlock({
84274
+ node: grandchild,
84275
+ nextBlockId: context.nextBlockId,
84276
+ positions: context.positions,
84277
+ defaultFont: context.defaultFont,
84278
+ defaultSize: context.defaultSize,
84279
+ styleContext: context.styleContext,
84280
+ trackedChangesConfig: context.trackedChangesConfig,
84281
+ bookmarks: context.bookmarks,
84282
+ hyperlinkConfig: context.hyperlinkConfig,
84283
+ enableComments: context.enableComments,
84284
+ themeColors: context.themeColors,
84285
+ converters: converters2,
84286
+ converterContext: context.converterContext
84287
+ });
84260
84288
  if (tableBlock) {
84261
84289
  if (nestedMetadata) applySdtMetadataToTableBlock(tableBlock, nestedMetadata);
84262
84290
  applySdtMetadataToTableBlock(tableBlock, sectionMetadata);
@@ -84266,7 +84294,7 @@ ${o}
84266
84294
  }
84267
84295
  });
84268
84296
  }
84269
- function processDocumentPartObject(child, sectionMetadata, context, output, converters) {
84297
+ function processDocumentPartObject(child, sectionMetadata, context, output, converters2) {
84270
84298
  const docPartGallery = getDocPartGallery(child);
84271
84299
  const docPartObjectId = getDocPartObjectId(child);
84272
84300
  const tocInstruction = getNodeInstruction(child);
@@ -84283,10 +84311,13 @@ ${o}
84283
84311
  defaultSize: context.defaultSize,
84284
84312
  styleContext: context.styleContext,
84285
84313
  bookmarks: context.bookmarks,
84286
- hyperlinkConfig: context.hyperlinkConfig
84314
+ hyperlinkConfig: context.hyperlinkConfig,
84315
+ enableComments: context.enableComments,
84316
+ themeColors: context.themeColors,
84317
+ converters: converters2,
84318
+ converterContext: context.converterContext
84287
84319
  },
84288
- { blocks: output.blocks, recordBlockKind: output.recordBlockKind },
84289
- converters.paragraphToFlowBlocks
84320
+ { blocks: output.blocks, recordBlockKind: output.recordBlockKind }
84290
84321
  );
84291
84322
  for (let i2 = blocksBeforeToc; i2 < output.blocks.length; i2++) {
84292
84323
  const block = output.blocks[i2];
@@ -84304,18 +84335,18 @@ ${o}
84304
84335
  }
84305
84336
  }
84306
84337
  }
84307
- function processDocumentSectionChildren(children, sectionMetadata, context, output, converters) {
84338
+ function processDocumentSectionChildren(children, sectionMetadata, context, output, converters2) {
84308
84339
  children.forEach((child) => {
84309
84340
  if (child.type === "paragraph") {
84310
- processParagraphChild(child, sectionMetadata, context, output, converters);
84341
+ processParagraphChild(child, sectionMetadata, context, output, converters2);
84311
84342
  } else if (child.type === "table") {
84312
- processTableChild(child, sectionMetadata, context, output, converters);
84343
+ processTableChild(child, sectionMetadata, context, output, converters2);
84313
84344
  } else if (child.type === "image") {
84314
- processImageChild(child, sectionMetadata, context, output, converters);
84345
+ processImageChild(child, sectionMetadata, context, output, converters2);
84315
84346
  } else if (child.type === "structuredContentBlock" && Array.isArray(child.content)) {
84316
- processNestedStructuredContent(child, sectionMetadata, context, output, converters);
84347
+ processNestedStructuredContent(child, sectionMetadata, context, output, converters2);
84317
84348
  } else if (child.type === "documentPartObject" && Array.isArray(child.content)) {
84318
- processDocumentPartObject(child, sectionMetadata, context, output, converters);
84349
+ processDocumentPartObject(child, sectionMetadata, context, output, converters2);
84319
84350
  }
84320
84351
  });
84321
84352
  }
@@ -84331,14 +84362,13 @@ ${o}
84331
84362
  styleContext,
84332
84363
  bookmarks,
84333
84364
  hyperlinkConfig,
84334
- converters
84365
+ converters: converters2,
84366
+ enableComments,
84367
+ converterContext,
84368
+ trackedChangesConfig,
84369
+ themeColors
84335
84370
  } = context;
84336
84371
  const sectionMetadata = resolveNodeSdtMetadata(node2, "documentSection");
84337
- const convertersToUse = {
84338
- paragraphToFlowBlocks: converters?.paragraphToFlowBlocks || (() => []),
84339
- tableNodeToBlock: converters?.tableNodeToBlock || (() => null),
84340
- imageNodeToBlock: converters?.imageNodeToBlock || (() => null)
84341
- };
84342
84372
  processDocumentSectionChildren(
84343
84373
  node2.content,
84344
84374
  sectionMetadata,
@@ -84349,10 +84379,14 @@ ${o}
84349
84379
  defaultSize,
84350
84380
  styleContext,
84351
84381
  bookmarks,
84352
- hyperlinkConfig
84382
+ trackedChangesConfig,
84383
+ hyperlinkConfig,
84384
+ themeColors,
84385
+ enableComments,
84386
+ converterContext
84353
84387
  },
84354
84388
  { blocks: blocks2, recordBlockKind },
84355
- convertersToUse
84389
+ converters2
84356
84390
  );
84357
84391
  }
84358
84392
  function handleDocumentPartObjectNode(node2, context) {
@@ -84367,15 +84401,18 @@ ${o}
84367
84401
  styleContext,
84368
84402
  bookmarks,
84369
84403
  hyperlinkConfig,
84370
- converters,
84371
- trackedChangesConfig
84404
+ converters: converters2,
84405
+ converterContext,
84406
+ enableComments,
84407
+ trackedChangesConfig,
84408
+ themeColors
84372
84409
  } = context;
84373
84410
  const docPartGallery = getDocPartGallery(node2);
84374
84411
  const docPartObjectId = getDocPartObjectId(node2);
84375
84412
  const tocInstruction = getNodeInstruction(node2);
84376
84413
  const docPartSdtMetadata = resolveNodeSdtMetadata(node2, "docPartObject");
84377
- const paragraphToFlowBlocks2 = converters?.paragraphToFlowBlocks;
84378
- if (docPartGallery === "Table of Contents" && paragraphToFlowBlocks2) {
84414
+ const paragraphToFlowBlocks2 = converters2.paragraphToFlowBlocks;
84415
+ if (docPartGallery === "Table of Contents") {
84379
84416
  processTocChildren(
84380
84417
  Array.from(node2.content),
84381
84418
  { docPartGallery, docPartObjectId, tocInstruction, sdtMetadata: docPartSdtMetadata },
@@ -84386,16 +84423,19 @@ ${o}
84386
84423
  defaultSize,
84387
84424
  styleContext,
84388
84425
  bookmarks,
84389
- hyperlinkConfig
84426
+ hyperlinkConfig,
84427
+ enableComments,
84428
+ trackedChangesConfig,
84429
+ converters: converters2,
84430
+ converterContext
84390
84431
  },
84391
- { blocks: blocks2, recordBlockKind },
84392
- paragraphToFlowBlocks2
84432
+ { blocks: blocks2, recordBlockKind }
84393
84433
  );
84394
84434
  } else if (paragraphToFlowBlocks2) {
84395
84435
  for (const child of node2.content) {
84396
84436
  if (child.type === "paragraph") {
84397
- const childBlocks = paragraphToFlowBlocks2(
84398
- child,
84437
+ const childBlocks = paragraphToFlowBlocks2({
84438
+ para: child,
84399
84439
  nextBlockId,
84400
84440
  positions,
84401
84441
  defaultFont,
@@ -84403,8 +84443,12 @@ ${o}
84403
84443
  styleContext,
84404
84444
  trackedChangesConfig,
84405
84445
  bookmarks,
84406
- hyperlinkConfig
84407
- );
84446
+ hyperlinkConfig,
84447
+ converters: converters2,
84448
+ themeColors,
84449
+ enableComments,
84450
+ converterContext
84451
+ });
84408
84452
  for (const block of childBlocks) {
84409
84453
  blocks2.push(block);
84410
84454
  recordBlockKind(block.kind);
@@ -84890,7 +84934,21 @@ ${o}
84890
84934
  const runAttrs = computeRunAttrs(runProperties, converterContext);
84891
84935
  return { ...run2, ...runAttrs };
84892
84936
  };
84893
- function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG$1, themeColors, converters, converterContext, enableComments = true) {
84937
+ function paragraphToFlowBlocks({
84938
+ para,
84939
+ nextBlockId,
84940
+ positions,
84941
+ defaultFont,
84942
+ defaultSize,
84943
+ styleContext,
84944
+ trackedChangesConfig,
84945
+ bookmarks,
84946
+ hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG$1,
84947
+ themeColors,
84948
+ converters: converters2,
84949
+ converterContext,
84950
+ enableComments = true
84951
+ }) {
84894
84952
  const paragraphProps = typeof para.attrs?.paragraphProperties === "object" && para.attrs.paragraphProperties !== null ? para.attrs.paragraphProperties : {};
84895
84953
  const baseBlockId = nextBlockId("paragraph");
84896
84954
  const { paragraphAttrs, resolvedParagraphProperties } = computeParagraphAttrs(para, converterContext);
@@ -85251,14 +85309,14 @@ ${o}
85251
85309
  const anchorParagraphId = nextId();
85252
85310
  flushParagraph();
85253
85311
  const mergedMarks = [...node2.marks ?? [], ...inheritedMarks ?? []];
85254
- const trackedMeta = trackedChanges?.enabled ? collectTrackedChangeFromMarks(mergedMarks) : void 0;
85255
- if (shouldHideTrackedNode(trackedMeta, trackedChanges)) {
85312
+ const trackedMeta = trackedChangesConfig?.enabled ? collectTrackedChangeFromMarks(mergedMarks) : void 0;
85313
+ if (shouldHideTrackedNode(trackedMeta, trackedChangesConfig)) {
85256
85314
  return;
85257
85315
  }
85258
- if (converters?.imageNodeToBlock) {
85259
- const imageBlock = converters.imageNodeToBlock(node2, nextBlockId, positions, trackedMeta, trackedChanges);
85316
+ if (converters2?.imageNodeToBlock) {
85317
+ const imageBlock = converters2.imageNodeToBlock(node2, nextBlockId, positions, trackedMeta, trackedChangesConfig);
85260
85318
  if (imageBlock && imageBlock.kind === "image") {
85261
- annotateBlockWithTrackedChange(imageBlock, trackedMeta, trackedChanges);
85319
+ annotateBlockWithTrackedChange(imageBlock, trackedMeta, trackedChangesConfig);
85262
85320
  blocks2.push(attachAnchorParagraphId(imageBlock, anchorParagraphId));
85263
85321
  }
85264
85322
  }
@@ -85278,7 +85336,7 @@ ${o}
85278
85336
  const hrIndentRight = typeof indent2?.right === "number" ? indent2.right : void 0;
85279
85337
  const hasIndent = typeof hrIndentLeft === "number" && hrIndentLeft !== 0 || typeof hrIndentRight === "number" && hrIndentRight !== 0;
85280
85338
  const hrNode = hasIndent ? { ...node2, attrs: { ...attrs, hrIndentLeft, hrIndentRight } } : node2;
85281
- const convert2 = converters?.contentBlockNodeToDrawingBlock ?? contentBlockNodeToDrawingBlock;
85339
+ const convert2 = converters2?.contentBlockNodeToDrawingBlock ?? contentBlockNodeToDrawingBlock;
85282
85340
  const drawingBlock = convert2(hrNode, nextBlockId, positions);
85283
85341
  if (drawingBlock) {
85284
85342
  blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
@@ -85296,8 +85354,8 @@ ${o}
85296
85354
  }
85297
85355
  const anchorParagraphId = nextId();
85298
85356
  flushParagraph();
85299
- if (converters?.vectorShapeNodeToDrawingBlock) {
85300
- const drawingBlock = converters.vectorShapeNodeToDrawingBlock(node2, nextBlockId, positions);
85357
+ if (converters2?.vectorShapeNodeToDrawingBlock) {
85358
+ const drawingBlock = converters2.vectorShapeNodeToDrawingBlock(node2, nextBlockId, positions);
85301
85359
  if (drawingBlock) {
85302
85360
  blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
85303
85361
  }
@@ -85314,8 +85372,8 @@ ${o}
85314
85372
  }
85315
85373
  const anchorParagraphId = nextId();
85316
85374
  flushParagraph();
85317
- if (converters?.shapeGroupNodeToDrawingBlock) {
85318
- const drawingBlock = converters.shapeGroupNodeToDrawingBlock(node2, nextBlockId, positions);
85375
+ if (converters2?.shapeGroupNodeToDrawingBlock) {
85376
+ const drawingBlock = converters2.shapeGroupNodeToDrawingBlock(node2, nextBlockId, positions);
85319
85377
  if (drawingBlock) {
85320
85378
  blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
85321
85379
  }
@@ -85332,8 +85390,8 @@ ${o}
85332
85390
  }
85333
85391
  const anchorParagraphId = nextId();
85334
85392
  flushParagraph();
85335
- if (converters?.shapeContainerNodeToDrawingBlock) {
85336
- const drawingBlock = converters.shapeContainerNodeToDrawingBlock(node2, nextBlockId, positions);
85393
+ if (converters2?.shapeContainerNodeToDrawingBlock) {
85394
+ const drawingBlock = converters2.shapeContainerNodeToDrawingBlock(node2, nextBlockId, positions);
85337
85395
  if (drawingBlock) {
85338
85396
  blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
85339
85397
  }
@@ -85350,8 +85408,8 @@ ${o}
85350
85408
  }
85351
85409
  const anchorParagraphId = nextId();
85352
85410
  flushParagraph();
85353
- if (converters?.shapeTextboxNodeToDrawingBlock) {
85354
- const drawingBlock = converters.shapeTextboxNodeToDrawingBlock(node2, nextBlockId, positions);
85411
+ if (converters2?.shapeTextboxNodeToDrawingBlock) {
85412
+ const drawingBlock = converters2.shapeTextboxNodeToDrawingBlock(node2, nextBlockId, positions);
85355
85413
  if (drawingBlock) {
85356
85414
  blocks2.push(attachAnchorParagraphId(drawingBlock, anchorParagraphId));
85357
85415
  }
@@ -85365,20 +85423,22 @@ ${o}
85365
85423
  }
85366
85424
  const anchorParagraphId = nextId();
85367
85425
  flushParagraph();
85368
- if (converters?.tableNodeToBlock) {
85369
- const tableBlock = converters.tableNodeToBlock(
85370
- node2,
85426
+ if (converters2?.tableNodeToBlock) {
85427
+ const tableBlock = converters2.tableNodeToBlock({
85428
+ node: node2,
85371
85429
  nextBlockId,
85372
85430
  positions,
85373
85431
  defaultFont,
85374
85432
  defaultSize,
85375
85433
  styleContext,
85376
- trackedChanges,
85434
+ trackedChangesConfig,
85377
85435
  bookmarks,
85378
85436
  hyperlinkConfig,
85379
85437
  themeColors,
85380
- ...converterContext !== void 0 ? [converterContext] : []
85381
- );
85438
+ converterContext,
85439
+ converters: converters2,
85440
+ enableComments
85441
+ });
85382
85442
  if (tableBlock) {
85383
85443
  blocks2.push(attachAnchorParagraphId(tableBlock, anchorParagraphId));
85384
85444
  }
@@ -85455,7 +85515,7 @@ ${o}
85455
85515
  block.runs = mergeAdjacentRuns(block.runs);
85456
85516
  }
85457
85517
  });
85458
- if (!trackedChanges) {
85518
+ if (!trackedChangesConfig) {
85459
85519
  return blocks2;
85460
85520
  }
85461
85521
  const processedBlocks = [];
@@ -85466,20 +85526,20 @@ ${o}
85466
85526
  }
85467
85527
  const filteredRuns = applyTrackedChangesModeToRuns(
85468
85528
  block.runs,
85469
- trackedChanges,
85529
+ trackedChangesConfig,
85470
85530
  hyperlinkConfig,
85471
85531
  applyMarksToRun,
85472
85532
  themeColors,
85473
85533
  enableComments
85474
85534
  );
85475
- if (trackedChanges.enabled && filteredRuns.length === 0) {
85535
+ if (trackedChangesConfig.enabled && filteredRuns.length === 0) {
85476
85536
  return;
85477
85537
  }
85478
85538
  block.runs = filteredRuns;
85479
85539
  block.attrs = {
85480
85540
  ...block.attrs ?? {},
85481
- trackedChangesMode: trackedChanges.mode,
85482
- trackedChangesEnabled: trackedChanges.enabled
85541
+ trackedChangesMode: trackedChangesConfig.mode,
85542
+ trackedChangesEnabled: trackedChangesConfig.enabled
85483
85543
  };
85484
85544
  processedBlocks.push(block);
85485
85545
  });
@@ -85498,7 +85558,10 @@ ${o}
85498
85558
  bookmarks,
85499
85559
  hyperlinkConfig,
85500
85560
  sectionState,
85501
- converters
85561
+ converters: converters2,
85562
+ converterContext,
85563
+ themeColors,
85564
+ enableComments
85502
85565
  } = context;
85503
85566
  const { ranges: sectionRanges, currentSectionIndex, currentParagraphIndex } = sectionState;
85504
85567
  if (sectionRanges.length > 0) {
@@ -85513,12 +85576,9 @@ ${o}
85513
85576
  sectionState.currentSectionIndex++;
85514
85577
  }
85515
85578
  }
85516
- const paragraphToFlowBlocks2 = converters?.paragraphToFlowBlocks;
85517
- if (!paragraphToFlowBlocks2) {
85518
- return;
85519
- }
85520
- const paragraphBlocks = paragraphToFlowBlocks2(
85521
- node2,
85579
+ const paragraphToFlowBlocks2 = converters2.paragraphToFlowBlocks;
85580
+ const paragraphBlocks = paragraphToFlowBlocks2({
85581
+ para: node2,
85522
85582
  nextBlockId,
85523
85583
  positions,
85524
85584
  defaultFont,
@@ -85527,10 +85587,11 @@ ${o}
85527
85587
  trackedChangesConfig,
85528
85588
  bookmarks,
85529
85589
  hyperlinkConfig,
85530
- void 0,
85531
- // themeColors - not available in NodeHandlerContext
85532
- context.converterContext
85533
- );
85590
+ themeColors,
85591
+ converterContext,
85592
+ converters: converters2,
85593
+ enableComments
85594
+ });
85534
85595
  paragraphBlocks.forEach((block) => {
85535
85596
  blocks2.push(block);
85536
85597
  recordBlockKind(block.kind);
@@ -85903,7 +85964,7 @@ ${o}
85903
85964
  ...tableProperties && { tableInfo: { tableProperties, rowIndex, cellIndex, numCells, numRows } },
85904
85965
  ...cellBackgroundColor && { backgroundColor: cellBackgroundColor }
85905
85966
  } : context.converterContext;
85906
- const paragraphToFlowBlocks2 = context.converters?.paragraphToFlowBlocks ?? context.paragraphToFlowBlocks;
85967
+ const paragraphToFlowBlocks2 = context.converters.paragraphToFlowBlocks;
85907
85968
  const tableNodeToBlock2 = context.converters?.tableNodeToBlock;
85908
85969
  const appendParagraphBlocks = (paragraphBlocks, sdtMetadata) => {
85909
85970
  applySdtMetadataToParagraphBlocks(
@@ -85919,19 +85980,21 @@ ${o}
85919
85980
  for (const childNode of cellNode.content) {
85920
85981
  if (childNode.type === "paragraph") {
85921
85982
  if (!paragraphToFlowBlocks2) continue;
85922
- const paragraphBlocks = paragraphToFlowBlocks2(
85923
- childNode,
85924
- context.nextBlockId,
85925
- context.positions,
85926
- context.defaultFont,
85927
- context.defaultSize,
85928
- context.styleContext,
85929
- context.trackedChanges,
85930
- context.bookmarks,
85931
- context.hyperlinkConfig,
85932
- context.themeColors,
85933
- cellConverterContext
85934
- );
85983
+ const paragraphBlocks = paragraphToFlowBlocks2({
85984
+ para: childNode,
85985
+ nextBlockId: context.nextBlockId,
85986
+ positions: context.positions,
85987
+ defaultFont: context.defaultFont,
85988
+ defaultSize: context.defaultSize,
85989
+ styleContext: context.styleContext,
85990
+ trackedChangesConfig: context.trackedChangesConfig,
85991
+ bookmarks: context.bookmarks,
85992
+ hyperlinkConfig: context.hyperlinkConfig,
85993
+ themeColors: context.themeColors,
85994
+ converterContext: cellConverterContext,
85995
+ converters: context.converters,
85996
+ enableComments: context.enableComments
85997
+ });
85935
85998
  appendParagraphBlocks(paragraphBlocks);
85936
85999
  continue;
85937
86000
  }
@@ -85940,38 +86003,40 @@ ${o}
85940
86003
  for (const nestedNode of childNode.content) {
85941
86004
  if (nestedNode.type === "paragraph") {
85942
86005
  if (!paragraphToFlowBlocks2) continue;
85943
- const paragraphBlocks = paragraphToFlowBlocks2(
85944
- nestedNode,
85945
- context.nextBlockId,
85946
- context.positions,
85947
- context.defaultFont,
85948
- context.defaultSize,
85949
- context.styleContext,
85950
- context.trackedChanges,
85951
- context.bookmarks,
85952
- context.hyperlinkConfig,
85953
- context.themeColors,
85954
- cellConverterContext
85955
- );
86006
+ const paragraphBlocks = paragraphToFlowBlocks2({
86007
+ para: nestedNode,
86008
+ nextBlockId: context.nextBlockId,
86009
+ positions: context.positions,
86010
+ defaultFont: context.defaultFont,
86011
+ defaultSize: context.defaultSize,
86012
+ styleContext: context.styleContext,
86013
+ trackedChangesConfig: context.trackedChangesConfig,
86014
+ bookmarks: context.bookmarks,
86015
+ hyperlinkConfig: context.hyperlinkConfig,
86016
+ themeColors: context.themeColors,
86017
+ converterContext: cellConverterContext,
86018
+ converters: context.converters,
86019
+ enableComments: context.enableComments
86020
+ });
85956
86021
  appendParagraphBlocks(paragraphBlocks, structuredContentMetadata);
85957
86022
  continue;
85958
86023
  }
85959
86024
  if (nestedNode.type === "table" && tableNodeToBlock2) {
85960
- const tableBlock = tableNodeToBlock2(
85961
- nestedNode,
85962
- context.nextBlockId,
85963
- context.positions,
85964
- context.defaultFont,
85965
- context.defaultSize,
85966
- context.styleContext,
85967
- context.trackedChanges,
85968
- context.bookmarks,
85969
- context.hyperlinkConfig,
85970
- context.themeColors,
85971
- paragraphToFlowBlocks2,
85972
- context.converterContext,
85973
- { converters: context.converters }
85974
- );
86025
+ const tableBlock = tableNodeToBlock2({
86026
+ node: nestedNode,
86027
+ nextBlockId: context.nextBlockId,
86028
+ positions: context.positions,
86029
+ defaultFont: context.defaultFont,
86030
+ defaultSize: context.defaultSize,
86031
+ styleContext: context.styleContext,
86032
+ trackedChangesConfig: context.trackedChangesConfig,
86033
+ bookmarks: context.bookmarks,
86034
+ hyperlinkConfig: context.hyperlinkConfig,
86035
+ themeColors: context.themeColors,
86036
+ converterContext: context.converterContext,
86037
+ converters: context.converters,
86038
+ enableComments: context.enableComments
86039
+ });
85975
86040
  if (tableBlock && tableBlock.kind === "table") {
85976
86041
  applySdtMetadataToTableBlock(tableBlock, structuredContentMetadata);
85977
86042
  blocks2.push(tableBlock);
@@ -85982,21 +86047,21 @@ ${o}
85982
86047
  continue;
85983
86048
  }
85984
86049
  if (childNode.type === "table" && tableNodeToBlock2) {
85985
- const tableBlock = tableNodeToBlock2(
85986
- childNode,
85987
- context.nextBlockId,
85988
- context.positions,
85989
- context.defaultFont,
85990
- context.defaultSize,
85991
- context.styleContext,
85992
- context.trackedChanges,
85993
- context.bookmarks,
85994
- context.hyperlinkConfig,
85995
- context.themeColors,
85996
- paragraphToFlowBlocks2,
85997
- context.converterContext,
85998
- { converters: context.converters }
85999
- );
86050
+ const tableBlock = tableNodeToBlock2({
86051
+ node: childNode,
86052
+ nextBlockId: context.nextBlockId,
86053
+ positions: context.positions,
86054
+ defaultFont: context.defaultFont,
86055
+ defaultSize: context.defaultSize,
86056
+ styleContext: context.styleContext,
86057
+ trackedChangesConfig: context.trackedChangesConfig,
86058
+ bookmarks: context.bookmarks,
86059
+ hyperlinkConfig: context.hyperlinkConfig,
86060
+ themeColors: context.themeColors,
86061
+ converterContext: context.converterContext,
86062
+ converters: context.converters,
86063
+ enableComments: context.enableComments
86064
+ });
86000
86065
  if (tableBlock && tableBlock.kind === "table") {
86001
86066
  blocks2.push(tableBlock);
86002
86067
  }
@@ -86004,8 +86069,8 @@ ${o}
86004
86069
  }
86005
86070
  if (childNode.type === "image" && context.converters?.imageNodeToBlock) {
86006
86071
  const mergedMarks = [...childNode.marks ?? []];
86007
- const trackedMeta = context.trackedChanges ? collectTrackedChangeFromMarks(mergedMarks) : void 0;
86008
- if (shouldHideTrackedNode(trackedMeta, context.trackedChanges)) {
86072
+ const trackedMeta = context.trackedChangesConfig ? collectTrackedChangeFromMarks(mergedMarks) : void 0;
86073
+ if (shouldHideTrackedNode(trackedMeta, context.trackedChangesConfig)) {
86009
86074
  continue;
86010
86075
  }
86011
86076
  const imageBlock = context.converters.imageNodeToBlock(
@@ -86013,10 +86078,10 @@ ${o}
86013
86078
  context.nextBlockId,
86014
86079
  context.positions,
86015
86080
  trackedMeta,
86016
- context.trackedChanges
86081
+ context.trackedChangesConfig
86017
86082
  );
86018
86083
  if (imageBlock && imageBlock.kind === "image") {
86019
- annotateBlockWithTrackedChange(imageBlock, trackedMeta, context.trackedChanges);
86084
+ annotateBlockWithTrackedChange(imageBlock, trackedMeta, context.trackedChangesConfig);
86020
86085
  blocks2.push(imageBlock);
86021
86086
  }
86022
86087
  continue;
@@ -86206,23 +86271,37 @@ ${o}
86206
86271
  }
86207
86272
  return { anchor, wrap: wrap2 };
86208
86273
  }
86209
- function tableNodeToBlock$1(node2, nextBlockId, positions, defaultFont, defaultSize, _styleContext, trackedChanges, bookmarks, hyperlinkConfig, themeColors, paragraphToFlowBlocks2, converterContext, options) {
86274
+ function tableNodeToBlock({
86275
+ node: node2,
86276
+ nextBlockId,
86277
+ positions,
86278
+ defaultFont,
86279
+ defaultSize,
86280
+ styleContext,
86281
+ trackedChangesConfig,
86282
+ bookmarks,
86283
+ hyperlinkConfig,
86284
+ themeColors,
86285
+ converterContext,
86286
+ converters: converters2,
86287
+ enableComments
86288
+ }) {
86210
86289
  if (!Array.isArray(node2.content) || node2.content.length === 0) return null;
86211
- const paragraphConverter = paragraphToFlowBlocks2 ?? options?.converters?.paragraphToFlowBlocks;
86290
+ const paragraphConverter = converters2.paragraphToFlowBlocks;
86212
86291
  if (!paragraphConverter) return null;
86213
86292
  const parserDeps = {
86214
86293
  nextBlockId,
86215
86294
  positions,
86216
86295
  defaultFont,
86217
86296
  defaultSize,
86218
- styleContext: _styleContext,
86219
- trackedChanges,
86297
+ styleContext,
86298
+ trackedChangesConfig,
86220
86299
  bookmarks,
86221
86300
  hyperlinkConfig,
86222
86301
  themeColors,
86223
- paragraphToFlowBlocks: paragraphConverter,
86224
86302
  converterContext,
86225
- converters: options?.converters
86303
+ converters: converters2,
86304
+ enableComments
86226
86305
  };
86227
86306
  const hydratedTableStyle = hydrateTableStyleAttrs(node2, converterContext);
86228
86307
  const defaultCellPadding = hydratedTableStyle?.cellPadding;
@@ -86345,11 +86424,12 @@ ${o}
86345
86424
  trackedChangesConfig,
86346
86425
  bookmarks,
86347
86426
  hyperlinkConfig,
86348
- converters,
86349
- converterContext
86427
+ converters: converters2,
86428
+ converterContext,
86429
+ enableComments
86350
86430
  } = context;
86351
- const tableBlock = tableNodeToBlock$1(
86352
- node2,
86431
+ const tableBlock = tableNodeToBlock({
86432
+ node: node2,
86353
86433
  nextBlockId,
86354
86434
  positions,
86355
86435
  defaultFont,
@@ -86358,12 +86438,11 @@ ${o}
86358
86438
  trackedChangesConfig,
86359
86439
  bookmarks,
86360
86440
  hyperlinkConfig,
86361
- void 0,
86362
- // themeColors
86363
- converters?.paragraphToFlowBlocks,
86441
+ themeColors: void 0,
86364
86442
  converterContext,
86365
- { converters }
86366
- );
86443
+ converters: converters2,
86444
+ enableComments
86445
+ });
86367
86446
  if (tableBlock) {
86368
86447
  blocks2.push(tableBlock);
86369
86448
  recordBlockKind(tableBlock.kind);
@@ -86422,6 +86501,16 @@ ${o}
86422
86501
  shapeContainer: handleShapeContainerNode,
86423
86502
  shapeTextbox: handleShapeTextboxNode
86424
86503
  };
86504
+ const converters = {
86505
+ contentBlockNodeToDrawingBlock,
86506
+ imageNodeToBlock,
86507
+ vectorShapeNodeToDrawingBlock,
86508
+ shapeGroupNodeToDrawingBlock,
86509
+ shapeContainerNodeToDrawingBlock,
86510
+ shapeTextboxNodeToDrawingBlock,
86511
+ tableNodeToBlock,
86512
+ paragraphToFlowBlocks
86513
+ };
86425
86514
  function toFlowBlocks(pmDoc, options) {
86426
86515
  const defaultFont = options?.defaultFont ?? DEFAULT_FONT;
86427
86516
  const defaultSize = options?.defaultSize ?? DEFAULT_SIZE;
@@ -86456,8 +86545,21 @@ ${o}
86456
86545
  enableRichHyperlinks: options?.enableRichHyperlinks ?? false
86457
86546
  };
86458
86547
  const enableComments = options?.enableComments ?? true;
86459
- const themeColors = options?.themeColors;
86460
- const converterContext = options?.converterContext;
86548
+ const converterContext = options?.converterContext ?? {
86549
+ translatedNumbering: {},
86550
+ translatedLinkedStyles: {
86551
+ docDefaults: {
86552
+ runProperties: {
86553
+ fontFamily: {
86554
+ ascii: defaultFont
86555
+ },
86556
+ fontSize: pxToPt(defaultSize) ?? 12
86557
+ }
86558
+ },
86559
+ latentStyles: {},
86560
+ styles: {}
86561
+ }
86562
+ };
86461
86563
  if (!doc2.content) {
86462
86564
  return { blocks: [], bookmarks: /* @__PURE__ */ new Map() };
86463
86565
  }
@@ -86477,44 +86579,6 @@ ${o}
86477
86579
  blocks2.push(sectionBreak);
86478
86580
  recordBlockKind(sectionBreak.kind);
86479
86581
  }
86480
- const paragraphConverter = (para, nextBlockId2, positions2, defaultFont2, defaultSize2, context, trackedChanges, bookmarks2, hyperlinkConfig2, themeColorsParam, converterCtx) => paragraphToFlowBlocks(
86481
- para,
86482
- nextBlockId2,
86483
- positions2,
86484
- defaultFont2,
86485
- defaultSize2,
86486
- context,
86487
- trackedChanges,
86488
- bookmarks2,
86489
- hyperlinkConfig2,
86490
- themeColorsParam ?? themeColors,
86491
- converterCtx ?? converterContext,
86492
- enableComments
86493
- );
86494
- const tableConverter = (node2, nextBlockId2, positions2, defaultFont2, defaultSize2, context, trackedChanges, bookmarks2, hyperlinkConfig2, themeColorsParam, converterCtx) => tableNodeToBlock(
86495
- node2,
86496
- nextBlockId2,
86497
- positions2,
86498
- defaultFont2,
86499
- defaultSize2,
86500
- context,
86501
- trackedChanges,
86502
- bookmarks2,
86503
- hyperlinkConfig2,
86504
- themeColorsParam ?? themeColors,
86505
- paragraphConverter,
86506
- converterCtx ?? converterContext,
86507
- {
86508
- converters: {
86509
- paragraphToFlowBlocks: paragraphConverter,
86510
- imageNodeToBlock,
86511
- vectorShapeNodeToDrawingBlock,
86512
- shapeGroupNodeToDrawingBlock,
86513
- shapeContainerNodeToDrawingBlock,
86514
- shapeTextboxNodeToDrawingBlock
86515
- }
86516
- }
86517
- );
86518
86582
  const handlerContext = {
86519
86583
  blocks: blocks2,
86520
86584
  recordBlockKind,
@@ -86533,16 +86597,8 @@ ${o}
86533
86597
  currentSectionIndex: 0,
86534
86598
  currentParagraphIndex: 0
86535
86599
  },
86536
- converters: {
86537
- // Type assertion needed due to signature mismatch between actual function and type definition
86538
- paragraphToFlowBlocks: paragraphConverter,
86539
- tableNodeToBlock: tableConverter,
86540
- imageNodeToBlock,
86541
- vectorShapeNodeToDrawingBlock,
86542
- shapeGroupNodeToDrawingBlock,
86543
- shapeContainerNodeToDrawingBlock,
86544
- shapeTextboxNodeToDrawingBlock
86545
- }
86600
+ converters,
86601
+ themeColors: options?.themeColors
86546
86602
  };
86547
86603
  doc2.content.forEach((node2) => {
86548
86604
  const handler2 = nodeHandlers$1[node2.type];
@@ -86595,82 +86651,6 @@ ${o}
86595
86651
  }
86596
86652
  return result;
86597
86653
  }
86598
- function paragraphToFlowBlocks(para, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig = DEFAULT_HYPERLINK_CONFIG$1, themeColors, converterContext, enableComments = true) {
86599
- return paragraphToFlowBlocks$1(
86600
- para,
86601
- nextBlockId,
86602
- positions,
86603
- defaultFont,
86604
- defaultSize,
86605
- styleContext,
86606
- trackedChanges,
86607
- bookmarks,
86608
- hyperlinkConfig,
86609
- themeColors,
86610
- {
86611
- contentBlockNodeToDrawingBlock,
86612
- imageNodeToBlock,
86613
- vectorShapeNodeToDrawingBlock,
86614
- shapeGroupNodeToDrawingBlock,
86615
- shapeContainerNodeToDrawingBlock,
86616
- shapeTextboxNodeToDrawingBlock,
86617
- tableNodeToBlock: (node2, nextBlockId2, positions2, defaultFont2, defaultSize2, styleContext2, trackedChanges2, bookmarks2, hyperlinkConfig2, themeColors2, converterCtx) => tableNodeToBlock$1(
86618
- node2,
86619
- nextBlockId2,
86620
- positions2,
86621
- defaultFont2,
86622
- defaultSize2,
86623
- styleContext2,
86624
- trackedChanges2,
86625
- bookmarks2,
86626
- hyperlinkConfig2,
86627
- themeColors2,
86628
- paragraphToFlowBlocks,
86629
- converterCtx ?? converterContext,
86630
- {
86631
- converters: {
86632
- // Type assertion needed due to signature mismatch between actual function and type definition
86633
- paragraphToFlowBlocks: paragraphToFlowBlocks$1,
86634
- imageNodeToBlock,
86635
- vectorShapeNodeToDrawingBlock,
86636
- shapeGroupNodeToDrawingBlock,
86637
- shapeContainerNodeToDrawingBlock,
86638
- shapeTextboxNodeToDrawingBlock
86639
- }
86640
- }
86641
- )
86642
- },
86643
- converterContext,
86644
- enableComments
86645
- );
86646
- }
86647
- function tableNodeToBlock(node2, nextBlockId, positions, defaultFont, defaultSize, styleContext, trackedChanges, bookmarks, hyperlinkConfig, themeColors, _paragraphToFlowBlocksParam, converterContext, options) {
86648
- return tableNodeToBlock$1(
86649
- node2,
86650
- nextBlockId,
86651
- positions,
86652
- defaultFont,
86653
- defaultSize,
86654
- styleContext,
86655
- trackedChanges,
86656
- bookmarks,
86657
- hyperlinkConfig,
86658
- themeColors,
86659
- paragraphToFlowBlocks,
86660
- converterContext,
86661
- options ?? {
86662
- converters: {
86663
- // Type assertion needed due to signature mismatch between actual function and type definition
86664
- paragraphToFlowBlocks: paragraphToFlowBlocks$1,
86665
- imageNodeToBlock,
86666
- vectorShapeNodeToDrawingBlock,
86667
- shapeGroupNodeToDrawingBlock,
86668
- shapeContainerNodeToDrawingBlock,
86669
- shapeTextboxNodeToDrawingBlock
86670
- }
86671
- }
86672
- );
86673
- }
86674
86654
  function buildFootnotesInput(editorState, converter, converterContext, themeColors) {
86675
86655
  if (!editorState) return null;
86676
86656
  const footnoteNumberById = converterContext?.footnoteNumberById;
@@ -152179,7 +152159,7 @@ ${reason}`);
152179
152159
  this.config.colors = shuffleArray(this.config.colors);
152180
152160
  this.userColorMap = /* @__PURE__ */ new Map();
152181
152161
  this.colorIndex = 0;
152182
- this.version = "1.8.1-next.3";
152162
+ this.version = "1.8.2-next.1";
152183
152163
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
152184
152164
  this.superdocId = config2.superdocId || v4();
152185
152165
  this.colors = this.config.colors;