@okf/ootils 1.32.0 → 1.32.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.
@@ -1418,6 +1418,15 @@ declare const UI_CONTENT: {
1418
1418
  */
1419
1419
  declare const genCleanCamelCaseId: (id: string) => string;
1420
1420
 
1421
+ /**
1422
+ * Convert a plain text string into the standard Lexical value shape
1423
+ * used across the platform: { allText, isLexical, editorState }.
1424
+ *
1425
+ * If the value is already Lexical (has `isLexical: true`), returns it as-is.
1426
+ * Each line in the text becomes its own paragraph node.
1427
+ */
1428
+ declare const plainTextToLexical: (value: string | number | any) => any;
1429
+
1421
1430
  /**
1422
1431
  * BlockDef — single source of truth for a tplBlock's cross-cutting configuration.
1423
1432
  *
@@ -1589,8 +1598,12 @@ declare const ELASTIC_MAPPING_PRESETS: {
1589
1598
  readonly result: {
1590
1599
  readonly properties: {
1591
1600
  readonly finalText: {
1592
- readonly type: "text";
1593
- readonly analyzer: "LargeTextAnalyzer";
1601
+ readonly properties: {
1602
+ readonly allText: {
1603
+ readonly type: "text";
1604
+ readonly analyzer: "LargeTextAnalyzer";
1605
+ };
1606
+ };
1594
1607
  };
1595
1608
  };
1596
1609
  };
@@ -1702,4 +1715,4 @@ declare class BlockRegistry {
1702
1715
  /** Singleton instance — the one registry shared across the app. */
1703
1716
  declare const blockRegistry: BlockRegistry;
1704
1717
 
1705
- export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
1718
+ export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/browser.d.ts CHANGED
@@ -1418,6 +1418,15 @@ declare const UI_CONTENT: {
1418
1418
  */
1419
1419
  declare const genCleanCamelCaseId: (id: string) => string;
1420
1420
 
1421
+ /**
1422
+ * Convert a plain text string into the standard Lexical value shape
1423
+ * used across the platform: { allText, isLexical, editorState }.
1424
+ *
1425
+ * If the value is already Lexical (has `isLexical: true`), returns it as-is.
1426
+ * Each line in the text becomes its own paragraph node.
1427
+ */
1428
+ declare const plainTextToLexical: (value: string | number | any) => any;
1429
+
1421
1430
  /**
1422
1431
  * BlockDef — single source of truth for a tplBlock's cross-cutting configuration.
1423
1432
  *
@@ -1589,8 +1598,12 @@ declare const ELASTIC_MAPPING_PRESETS: {
1589
1598
  readonly result: {
1590
1599
  readonly properties: {
1591
1600
  readonly finalText: {
1592
- readonly type: "text";
1593
- readonly analyzer: "LargeTextAnalyzer";
1601
+ readonly properties: {
1602
+ readonly allText: {
1603
+ readonly type: "text";
1604
+ readonly analyzer: "LargeTextAnalyzer";
1605
+ };
1606
+ };
1594
1607
  };
1595
1608
  };
1596
1609
  };
@@ -1702,4 +1715,4 @@ declare class BlockRegistry {
1702
1715
  /** Singleton instance — the one registry shared across the app. */
1703
1716
  declare const blockRegistry: BlockRegistry;
1704
1717
 
1705
- export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
1718
+ export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/browser.js CHANGED
@@ -57,6 +57,7 @@ __export(browser_exports, {
57
57
  isTplAnnotationEnabled: () => isTplAnnotationEnabled,
58
58
  mergeAnnoDataIntoAnnotationsTags: () => mergeAnnoDataIntoAnnotationsTags,
59
59
  parseSpecialConfigSyntax: () => parseSpecialConfigSyntax,
60
+ plainTextToLexical: () => plainTextToLexical,
60
61
  processAuthorAndCommonFilters: () => processAuthorAndCommonFilters,
61
62
  recursivelyExtractBlocks: () => _recursExtractBlocks,
62
63
  segrigateDocs: () => segrigateDocs,
@@ -391,8 +392,9 @@ var ELASTIC_MAPPING_PRESETS = {
391
392
  }
392
393
  }
393
394
  },
394
- // Audio file value (array of one object) — only the transcription.result.finalText
395
- // is indexed as searchable text. Everything else on the audio object is ignored.
395
+ // Audio file value (array of one object) — only the transcription.result.finalText.allText
396
+ // is indexed as searchable text. finalText is stored in Lexical shape; allText is the
397
+ // plain text within it. Everything else on the audio object is ignored by ES.
396
398
  audioTranscription: {
397
399
  properties: {
398
400
  transcription: {
@@ -400,8 +402,12 @@ var ELASTIC_MAPPING_PRESETS = {
400
402
  result: {
401
403
  properties: {
402
404
  finalText: {
403
- type: "text",
404
- analyzer: "LargeTextAnalyzer"
405
+ properties: {
406
+ allText: {
407
+ type: "text",
408
+ analyzer: "LargeTextAnalyzer"
409
+ }
410
+ }
405
411
  }
406
412
  }
407
413
  }
@@ -527,8 +533,8 @@ var AudioInput = {
527
533
  // array index). `searchField` is the ES path — ES flattens arrays of objects
528
534
  // so no index is needed there.
529
535
  fieldPaths: {
530
- plainTextString: "0.transcription.result.finalText",
531
- searchField: "transcription.result.finalText"
536
+ plainTextString: "0.transcription.result.finalText.allText",
537
+ searchField: "transcription.result.finalText.allText"
532
538
  },
533
539
  // Validation
534
540
  validation: {
@@ -2569,6 +2575,38 @@ var genCleanCamelCaseId = (id) => {
2569
2575
  if (/^\d/.test(result)) result = "a" + result;
2570
2576
  return result.slice(0, MAX_LENGTH);
2571
2577
  };
2578
+
2579
+ // src/utils/plainTextToLexical.ts
2580
+ var plainTextToLexical = (value) => {
2581
+ if (!value && value !== 0) return void 0;
2582
+ if (value?.isLexical === true) return value;
2583
+ if (typeof value !== "string" && typeof value !== "number") return void 0;
2584
+ const text = String(value);
2585
+ const lines = text.split(/\r?\n/);
2586
+ const paragraphNodes = lines.map((line) => ({
2587
+ type: "paragraph",
2588
+ children: [
2589
+ {
2590
+ type: "text",
2591
+ text: line
2592
+ }
2593
+ ]
2594
+ }));
2595
+ return {
2596
+ allText: text,
2597
+ isLexical: true,
2598
+ editorState: {
2599
+ root: {
2600
+ children: paragraphNodes,
2601
+ direction: "ltr",
2602
+ format: "",
2603
+ indent: 0,
2604
+ type: "root",
2605
+ version: 1
2606
+ }
2607
+ }
2608
+ };
2609
+ };
2572
2610
  // Annotate the CommonJS export names for ESM import in node:
2573
2611
  0 && (module.exports = {
2574
2612
  BASE_BULLMQ_CONFIG,
@@ -2608,6 +2646,7 @@ var genCleanCamelCaseId = (id) => {
2608
2646
  isTplAnnotationEnabled,
2609
2647
  mergeAnnoDataIntoAnnotationsTags,
2610
2648
  parseSpecialConfigSyntax,
2649
+ plainTextToLexical,
2611
2650
  processAuthorAndCommonFilters,
2612
2651
  recursivelyExtractBlocks,
2613
2652
  segrigateDocs,
package/dist/browser.mjs CHANGED
@@ -324,8 +324,9 @@ var ELASTIC_MAPPING_PRESETS = {
324
324
  }
325
325
  }
326
326
  },
327
- // Audio file value (array of one object) — only the transcription.result.finalText
328
- // is indexed as searchable text. Everything else on the audio object is ignored.
327
+ // Audio file value (array of one object) — only the transcription.result.finalText.allText
328
+ // is indexed as searchable text. finalText is stored in Lexical shape; allText is the
329
+ // plain text within it. Everything else on the audio object is ignored by ES.
329
330
  audioTranscription: {
330
331
  properties: {
331
332
  transcription: {
@@ -333,8 +334,12 @@ var ELASTIC_MAPPING_PRESETS = {
333
334
  result: {
334
335
  properties: {
335
336
  finalText: {
336
- type: "text",
337
- analyzer: "LargeTextAnalyzer"
337
+ properties: {
338
+ allText: {
339
+ type: "text",
340
+ analyzer: "LargeTextAnalyzer"
341
+ }
342
+ }
338
343
  }
339
344
  }
340
345
  }
@@ -460,8 +465,8 @@ var AudioInput = {
460
465
  // array index). `searchField` is the ES path — ES flattens arrays of objects
461
466
  // so no index is needed there.
462
467
  fieldPaths: {
463
- plainTextString: "0.transcription.result.finalText",
464
- searchField: "transcription.result.finalText"
468
+ plainTextString: "0.transcription.result.finalText.allText",
469
+ searchField: "transcription.result.finalText.allText"
465
470
  },
466
471
  // Validation
467
472
  validation: {
@@ -2502,6 +2507,38 @@ var genCleanCamelCaseId = (id) => {
2502
2507
  if (/^\d/.test(result)) result = "a" + result;
2503
2508
  return result.slice(0, MAX_LENGTH);
2504
2509
  };
2510
+
2511
+ // src/utils/plainTextToLexical.ts
2512
+ var plainTextToLexical = (value) => {
2513
+ if (!value && value !== 0) return void 0;
2514
+ if (value?.isLexical === true) return value;
2515
+ if (typeof value !== "string" && typeof value !== "number") return void 0;
2516
+ const text = String(value);
2517
+ const lines = text.split(/\r?\n/);
2518
+ const paragraphNodes = lines.map((line) => ({
2519
+ type: "paragraph",
2520
+ children: [
2521
+ {
2522
+ type: "text",
2523
+ text: line
2524
+ }
2525
+ ]
2526
+ }));
2527
+ return {
2528
+ allText: text,
2529
+ isLexical: true,
2530
+ editorState: {
2531
+ root: {
2532
+ children: paragraphNodes,
2533
+ direction: "ltr",
2534
+ format: "",
2535
+ indent: 0,
2536
+ type: "root",
2537
+ version: 1
2538
+ }
2539
+ }
2540
+ };
2541
+ };
2505
2542
  export {
2506
2543
  BASE_BULLMQ_CONFIG,
2507
2544
  BlockRegistry,
@@ -2540,6 +2577,7 @@ export {
2540
2577
  isTplAnnotationEnabled,
2541
2578
  mergeAnnoDataIntoAnnotationsTags,
2542
2579
  parseSpecialConfigSyntax,
2580
+ plainTextToLexical,
2543
2581
  processAuthorAndCommonFilters,
2544
2582
  _recursExtractBlocks as recursivelyExtractBlocks,
2545
2583
  segrigateDocs,
package/dist/node.d.mts CHANGED
@@ -1425,6 +1425,15 @@ declare const UI_CONTENT: {
1425
1425
  */
1426
1426
  declare const genCleanCamelCaseId: (id: string) => string;
1427
1427
 
1428
+ /**
1429
+ * Convert a plain text string into the standard Lexical value shape
1430
+ * used across the platform: { allText, isLexical, editorState }.
1431
+ *
1432
+ * If the value is already Lexical (has `isLexical: true`), returns it as-is.
1433
+ * Each line in the text becomes its own paragraph node.
1434
+ */
1435
+ declare const plainTextToLexical: (value: string | number | any) => any;
1436
+
1428
1437
  /**
1429
1438
  * BlockDef — single source of truth for a tplBlock's cross-cutting configuration.
1430
1439
  *
@@ -1596,8 +1605,12 @@ declare const ELASTIC_MAPPING_PRESETS: {
1596
1605
  readonly result: {
1597
1606
  readonly properties: {
1598
1607
  readonly finalText: {
1599
- readonly type: "text";
1600
- readonly analyzer: "LargeTextAnalyzer";
1608
+ readonly properties: {
1609
+ readonly allText: {
1610
+ readonly type: "text";
1611
+ readonly analyzer: "LargeTextAnalyzer";
1612
+ };
1613
+ };
1601
1614
  };
1602
1615
  };
1603
1616
  };
@@ -2443,4 +2456,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
2443
2456
  };
2444
2457
  }): Object;
2445
2458
 
2446
- export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTplModelByTenant, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
2459
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTplModelByTenant, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.d.ts CHANGED
@@ -1425,6 +1425,15 @@ declare const UI_CONTENT: {
1425
1425
  */
1426
1426
  declare const genCleanCamelCaseId: (id: string) => string;
1427
1427
 
1428
+ /**
1429
+ * Convert a plain text string into the standard Lexical value shape
1430
+ * used across the platform: { allText, isLexical, editorState }.
1431
+ *
1432
+ * If the value is already Lexical (has `isLexical: true`), returns it as-is.
1433
+ * Each line in the text becomes its own paragraph node.
1434
+ */
1435
+ declare const plainTextToLexical: (value: string | number | any) => any;
1436
+
1428
1437
  /**
1429
1438
  * BlockDef — single source of truth for a tplBlock's cross-cutting configuration.
1430
1439
  *
@@ -1596,8 +1605,12 @@ declare const ELASTIC_MAPPING_PRESETS: {
1596
1605
  readonly result: {
1597
1606
  readonly properties: {
1598
1607
  readonly finalText: {
1599
- readonly type: "text";
1600
- readonly analyzer: "LargeTextAnalyzer";
1608
+ readonly properties: {
1609
+ readonly allText: {
1610
+ readonly type: "text";
1611
+ readonly analyzer: "LargeTextAnalyzer";
1612
+ };
1613
+ };
1601
1614
  };
1602
1615
  };
1603
1616
  };
@@ -2443,4 +2456,4 @@ declare function GET_GLOBAL_BULLMQ_CONFIG({ env, redisCredentials }: {
2443
2456
  };
2444
2457
  }): Object;
2445
2458
 
2446
- export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTplModelByTenant, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
2459
+ export { AIChatSchema, AnnosElasticSyncProducer, AnnotationSchema, BASE_BULLMQ_CONFIG, BaseProducer, BaseWorker, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ChunksElasticSyncProducer, ELASTIC_MAPPING_PRESETS, ElasticSearchConnector, FILTER_IDS, GET_GLOBAL_BULLMQ_CONFIG, GeneratedEntitiesSchema, GeneratedTopicsSchema, MONGO_SCHEMA_PRESETS, MongoConnector, PlatformConfigsSchema, ProducerManager, RedisCacheConnector, SecretManagerConnector, TEMP_removeDuplicateFilters, TplSchema, UI_CONTENT, WorkerManager, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getAIChatModelByTenant, getAnnotationsModelByTenant, getDbByTenant, getFilterKeyForBlock, getGeneratedEntitiesModelByTenant, getGeneratedTopicsModelByTenant, getModelByTenant, getPlatformConfigsModelByTenant, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getTplModelByTenant, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/node.js CHANGED
@@ -2035,6 +2035,7 @@ __export(node_exports, {
2035
2035
  isTplAnnotationEnabled: () => isTplAnnotationEnabled,
2036
2036
  mergeAnnoDataIntoAnnotationsTags: () => mergeAnnoDataIntoAnnotationsTags,
2037
2037
  parseSpecialConfigSyntax: () => parseSpecialConfigSyntax,
2038
+ plainTextToLexical: () => plainTextToLexical,
2038
2039
  processAuthorAndCommonFilters: () => processAuthorAndCommonFilters,
2039
2040
  recursivelyExtractBlocks: () => _recursExtractBlocks,
2040
2041
  segrigateDocs: () => segrigateDocs,
@@ -2369,8 +2370,9 @@ var ELASTIC_MAPPING_PRESETS = {
2369
2370
  }
2370
2371
  }
2371
2372
  },
2372
- // Audio file value (array of one object) — only the transcription.result.finalText
2373
- // is indexed as searchable text. Everything else on the audio object is ignored.
2373
+ // Audio file value (array of one object) — only the transcription.result.finalText.allText
2374
+ // is indexed as searchable text. finalText is stored in Lexical shape; allText is the
2375
+ // plain text within it. Everything else on the audio object is ignored by ES.
2374
2376
  audioTranscription: {
2375
2377
  properties: {
2376
2378
  transcription: {
@@ -2378,8 +2380,12 @@ var ELASTIC_MAPPING_PRESETS = {
2378
2380
  result: {
2379
2381
  properties: {
2380
2382
  finalText: {
2381
- type: "text",
2382
- analyzer: "LargeTextAnalyzer"
2383
+ properties: {
2384
+ allText: {
2385
+ type: "text",
2386
+ analyzer: "LargeTextAnalyzer"
2387
+ }
2388
+ }
2383
2389
  }
2384
2390
  }
2385
2391
  }
@@ -2505,8 +2511,8 @@ var AudioInput = {
2505
2511
  // array index). `searchField` is the ES path — ES flattens arrays of objects
2506
2512
  // so no index is needed there.
2507
2513
  fieldPaths: {
2508
- plainTextString: "0.transcription.result.finalText",
2509
- searchField: "transcription.result.finalText"
2514
+ plainTextString: "0.transcription.result.finalText.allText",
2515
+ searchField: "transcription.result.finalText.allText"
2510
2516
  },
2511
2517
  // Validation
2512
2518
  validation: {
@@ -4168,6 +4174,38 @@ var genCleanCamelCaseId = (id) => {
4168
4174
  return result.slice(0, MAX_LENGTH);
4169
4175
  };
4170
4176
 
4177
+ // src/utils/plainTextToLexical.ts
4178
+ var plainTextToLexical = (value) => {
4179
+ if (!value && value !== 0) return void 0;
4180
+ if (value?.isLexical === true) return value;
4181
+ if (typeof value !== "string" && typeof value !== "number") return void 0;
4182
+ const text = String(value);
4183
+ const lines = text.split(/\r?\n/);
4184
+ const paragraphNodes = lines.map((line) => ({
4185
+ type: "paragraph",
4186
+ children: [
4187
+ {
4188
+ type: "text",
4189
+ text: line
4190
+ }
4191
+ ]
4192
+ }));
4193
+ return {
4194
+ allText: text,
4195
+ isLexical: true,
4196
+ editorState: {
4197
+ root: {
4198
+ children: paragraphNodes,
4199
+ direction: "ltr",
4200
+ format: "",
4201
+ indent: 0,
4202
+ type: "root",
4203
+ version: 1
4204
+ }
4205
+ }
4206
+ };
4207
+ };
4208
+
4171
4209
  // src/node.ts
4172
4210
  var import_MongoConnector3 = __toESM(require_MongoConnector());
4173
4211
  var import_ElasticSearchConnector = __toESM(require_ElasticSearchConnector());
@@ -4615,6 +4653,7 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
4615
4653
  isTplAnnotationEnabled,
4616
4654
  mergeAnnoDataIntoAnnotationsTags,
4617
4655
  parseSpecialConfigSyntax,
4656
+ plainTextToLexical,
4618
4657
  processAuthorAndCommonFilters,
4619
4658
  recursivelyExtractBlocks,
4620
4659
  segrigateDocs,
package/dist/node.mjs CHANGED
@@ -2301,8 +2301,9 @@ var ELASTIC_MAPPING_PRESETS = {
2301
2301
  }
2302
2302
  }
2303
2303
  },
2304
- // Audio file value (array of one object) — only the transcription.result.finalText
2305
- // is indexed as searchable text. Everything else on the audio object is ignored.
2304
+ // Audio file value (array of one object) — only the transcription.result.finalText.allText
2305
+ // is indexed as searchable text. finalText is stored in Lexical shape; allText is the
2306
+ // plain text within it. Everything else on the audio object is ignored by ES.
2306
2307
  audioTranscription: {
2307
2308
  properties: {
2308
2309
  transcription: {
@@ -2310,8 +2311,12 @@ var ELASTIC_MAPPING_PRESETS = {
2310
2311
  result: {
2311
2312
  properties: {
2312
2313
  finalText: {
2313
- type: "text",
2314
- analyzer: "LargeTextAnalyzer"
2314
+ properties: {
2315
+ allText: {
2316
+ type: "text",
2317
+ analyzer: "LargeTextAnalyzer"
2318
+ }
2319
+ }
2315
2320
  }
2316
2321
  }
2317
2322
  }
@@ -2437,8 +2442,8 @@ var AudioInput = {
2437
2442
  // array index). `searchField` is the ES path — ES flattens arrays of objects
2438
2443
  // so no index is needed there.
2439
2444
  fieldPaths: {
2440
- plainTextString: "0.transcription.result.finalText",
2441
- searchField: "transcription.result.finalText"
2445
+ plainTextString: "0.transcription.result.finalText.allText",
2446
+ searchField: "transcription.result.finalText.allText"
2442
2447
  },
2443
2448
  // Validation
2444
2449
  validation: {
@@ -4100,6 +4105,38 @@ var genCleanCamelCaseId = (id) => {
4100
4105
  return result.slice(0, MAX_LENGTH);
4101
4106
  };
4102
4107
 
4108
+ // src/utils/plainTextToLexical.ts
4109
+ var plainTextToLexical = (value) => {
4110
+ if (!value && value !== 0) return void 0;
4111
+ if (value?.isLexical === true) return value;
4112
+ if (typeof value !== "string" && typeof value !== "number") return void 0;
4113
+ const text = String(value);
4114
+ const lines = text.split(/\r?\n/);
4115
+ const paragraphNodes = lines.map((line) => ({
4116
+ type: "paragraph",
4117
+ children: [
4118
+ {
4119
+ type: "text",
4120
+ text: line
4121
+ }
4122
+ ]
4123
+ }));
4124
+ return {
4125
+ allText: text,
4126
+ isLexical: true,
4127
+ editorState: {
4128
+ root: {
4129
+ children: paragraphNodes,
4130
+ direction: "ltr",
4131
+ format: "",
4132
+ indent: 0,
4133
+ type: "root",
4134
+ version: 1
4135
+ }
4136
+ }
4137
+ };
4138
+ };
4139
+
4103
4140
  // src/node.ts
4104
4141
  var import_MongoConnector3 = __toESM(require_MongoConnector());
4105
4142
  var import_ElasticSearchConnector = __toESM(require_ElasticSearchConnector());
@@ -4562,6 +4599,7 @@ export {
4562
4599
  isTplAnnotationEnabled,
4563
4600
  mergeAnnoDataIntoAnnotationsTags,
4564
4601
  parseSpecialConfigSyntax,
4602
+ plainTextToLexical,
4565
4603
  processAuthorAndCommonFilters,
4566
4604
  _recursExtractBlocks as recursivelyExtractBlocks,
4567
4605
  segrigateDocs,
@@ -1418,6 +1418,15 @@ declare const UI_CONTENT: {
1418
1418
  */
1419
1419
  declare const genCleanCamelCaseId: (id: string) => string;
1420
1420
 
1421
+ /**
1422
+ * Convert a plain text string into the standard Lexical value shape
1423
+ * used across the platform: { allText, isLexical, editorState }.
1424
+ *
1425
+ * If the value is already Lexical (has `isLexical: true`), returns it as-is.
1426
+ * Each line in the text becomes its own paragraph node.
1427
+ */
1428
+ declare const plainTextToLexical: (value: string | number | any) => any;
1429
+
1421
1430
  /**
1422
1431
  * BlockDef — single source of truth for a tplBlock's cross-cutting configuration.
1423
1432
  *
@@ -1589,8 +1598,12 @@ declare const ELASTIC_MAPPING_PRESETS: {
1589
1598
  readonly result: {
1590
1599
  readonly properties: {
1591
1600
  readonly finalText: {
1592
- readonly type: "text";
1593
- readonly analyzer: "LargeTextAnalyzer";
1601
+ readonly properties: {
1602
+ readonly allText: {
1603
+ readonly type: "text";
1604
+ readonly analyzer: "LargeTextAnalyzer";
1605
+ };
1606
+ };
1594
1607
  };
1595
1608
  };
1596
1609
  };
@@ -1702,4 +1715,4 @@ declare class BlockRegistry {
1702
1715
  /** Singleton instance — the one registry shared across the app. */
1703
1716
  declare const blockRegistry: BlockRegistry;
1704
1717
 
1705
- export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
1718
+ export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
@@ -1418,6 +1418,15 @@ declare const UI_CONTENT: {
1418
1418
  */
1419
1419
  declare const genCleanCamelCaseId: (id: string) => string;
1420
1420
 
1421
+ /**
1422
+ * Convert a plain text string into the standard Lexical value shape
1423
+ * used across the platform: { allText, isLexical, editorState }.
1424
+ *
1425
+ * If the value is already Lexical (has `isLexical: true`), returns it as-is.
1426
+ * Each line in the text becomes its own paragraph node.
1427
+ */
1428
+ declare const plainTextToLexical: (value: string | number | any) => any;
1429
+
1421
1430
  /**
1422
1431
  * BlockDef — single source of truth for a tplBlock's cross-cutting configuration.
1423
1432
  *
@@ -1589,8 +1598,12 @@ declare const ELASTIC_MAPPING_PRESETS: {
1589
1598
  readonly result: {
1590
1599
  readonly properties: {
1591
1600
  readonly finalText: {
1592
- readonly type: "text";
1593
- readonly analyzer: "LargeTextAnalyzer";
1601
+ readonly properties: {
1602
+ readonly allText: {
1603
+ readonly type: "text";
1604
+ readonly analyzer: "LargeTextAnalyzer";
1605
+ };
1606
+ };
1594
1607
  };
1595
1608
  };
1596
1609
  };
@@ -1702,4 +1715,4 @@ declare class BlockRegistry {
1702
1715
  /** Singleton instance — the one registry shared across the app. */
1703
1716
  declare const blockRegistry: BlockRegistry;
1704
1717
 
1705
- export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
1718
+ export { BASE_BULLMQ_CONFIG, type BlockCapabilities, type BlockDef, BlockRegistry, CHUNKING_PRESETS, ELASTIC_MAPPING_PRESETS, FILTER_IDS, MONGO_SCHEMA_PRESETS, TEMP_removeDuplicateFilters, UI_CONTENT, _self_managed_buildAnnoHierarchyConfig, _self_managed_buildDocHierarchyConfig, _self_managed_getFixedAnnoRollupBlocks, _self_managed_getFixedAnnoTagBlock, autoGenFilterConfigsFromTpl, blockRegistry, buildFilterConfigurations, compareAndGroupBlocks, deleteVal, extractAllBlocksFromTpl, extractAndOrganizeBlocks, genCleanCamelCaseId, genTagId, generateFilterKey, getFilterKeyForBlock, getPlatformContextContent, getRollupPossibilities, getRoutePathToContentTypeLanding, getRoutePathToEditContent, getRoutePathToModerateContent, getRoutePathToMyContent, getRoutePathToPublishedContent, getRoutePathToReviewDashboard, getRoutePathToTCI, getRoutePathToTagCategoryLanding, getVal, isTplAnnotationEnabled, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, plainTextToLexical, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
package/dist/universal.js CHANGED
@@ -57,6 +57,7 @@ __export(universal_exports, {
57
57
  isTplAnnotationEnabled: () => isTplAnnotationEnabled,
58
58
  mergeAnnoDataIntoAnnotationsTags: () => mergeAnnoDataIntoAnnotationsTags,
59
59
  parseSpecialConfigSyntax: () => parseSpecialConfigSyntax,
60
+ plainTextToLexical: () => plainTextToLexical,
60
61
  processAuthorAndCommonFilters: () => processAuthorAndCommonFilters,
61
62
  recursivelyExtractBlocks: () => _recursExtractBlocks,
62
63
  segrigateDocs: () => segrigateDocs,
@@ -391,8 +392,9 @@ var ELASTIC_MAPPING_PRESETS = {
391
392
  }
392
393
  }
393
394
  },
394
- // Audio file value (array of one object) — only the transcription.result.finalText
395
- // is indexed as searchable text. Everything else on the audio object is ignored.
395
+ // Audio file value (array of one object) — only the transcription.result.finalText.allText
396
+ // is indexed as searchable text. finalText is stored in Lexical shape; allText is the
397
+ // plain text within it. Everything else on the audio object is ignored by ES.
396
398
  audioTranscription: {
397
399
  properties: {
398
400
  transcription: {
@@ -400,8 +402,12 @@ var ELASTIC_MAPPING_PRESETS = {
400
402
  result: {
401
403
  properties: {
402
404
  finalText: {
403
- type: "text",
404
- analyzer: "LargeTextAnalyzer"
405
+ properties: {
406
+ allText: {
407
+ type: "text",
408
+ analyzer: "LargeTextAnalyzer"
409
+ }
410
+ }
405
411
  }
406
412
  }
407
413
  }
@@ -527,8 +533,8 @@ var AudioInput = {
527
533
  // array index). `searchField` is the ES path — ES flattens arrays of objects
528
534
  // so no index is needed there.
529
535
  fieldPaths: {
530
- plainTextString: "0.transcription.result.finalText",
531
- searchField: "transcription.result.finalText"
536
+ plainTextString: "0.transcription.result.finalText.allText",
537
+ searchField: "transcription.result.finalText.allText"
532
538
  },
533
539
  // Validation
534
540
  validation: {
@@ -2569,6 +2575,38 @@ var genCleanCamelCaseId = (id) => {
2569
2575
  if (/^\d/.test(result)) result = "a" + result;
2570
2576
  return result.slice(0, MAX_LENGTH);
2571
2577
  };
2578
+
2579
+ // src/utils/plainTextToLexical.ts
2580
+ var plainTextToLexical = (value) => {
2581
+ if (!value && value !== 0) return void 0;
2582
+ if (value?.isLexical === true) return value;
2583
+ if (typeof value !== "string" && typeof value !== "number") return void 0;
2584
+ const text = String(value);
2585
+ const lines = text.split(/\r?\n/);
2586
+ const paragraphNodes = lines.map((line) => ({
2587
+ type: "paragraph",
2588
+ children: [
2589
+ {
2590
+ type: "text",
2591
+ text: line
2592
+ }
2593
+ ]
2594
+ }));
2595
+ return {
2596
+ allText: text,
2597
+ isLexical: true,
2598
+ editorState: {
2599
+ root: {
2600
+ children: paragraphNodes,
2601
+ direction: "ltr",
2602
+ format: "",
2603
+ indent: 0,
2604
+ type: "root",
2605
+ version: 1
2606
+ }
2607
+ }
2608
+ };
2609
+ };
2572
2610
  // Annotate the CommonJS export names for ESM import in node:
2573
2611
  0 && (module.exports = {
2574
2612
  BASE_BULLMQ_CONFIG,
@@ -2608,6 +2646,7 @@ var genCleanCamelCaseId = (id) => {
2608
2646
  isTplAnnotationEnabled,
2609
2647
  mergeAnnoDataIntoAnnotationsTags,
2610
2648
  parseSpecialConfigSyntax,
2649
+ plainTextToLexical,
2611
2650
  processAuthorAndCommonFilters,
2612
2651
  recursivelyExtractBlocks,
2613
2652
  segrigateDocs,
@@ -324,8 +324,9 @@ var ELASTIC_MAPPING_PRESETS = {
324
324
  }
325
325
  }
326
326
  },
327
- // Audio file value (array of one object) — only the transcription.result.finalText
328
- // is indexed as searchable text. Everything else on the audio object is ignored.
327
+ // Audio file value (array of one object) — only the transcription.result.finalText.allText
328
+ // is indexed as searchable text. finalText is stored in Lexical shape; allText is the
329
+ // plain text within it. Everything else on the audio object is ignored by ES.
329
330
  audioTranscription: {
330
331
  properties: {
331
332
  transcription: {
@@ -333,8 +334,12 @@ var ELASTIC_MAPPING_PRESETS = {
333
334
  result: {
334
335
  properties: {
335
336
  finalText: {
336
- type: "text",
337
- analyzer: "LargeTextAnalyzer"
337
+ properties: {
338
+ allText: {
339
+ type: "text",
340
+ analyzer: "LargeTextAnalyzer"
341
+ }
342
+ }
338
343
  }
339
344
  }
340
345
  }
@@ -460,8 +465,8 @@ var AudioInput = {
460
465
  // array index). `searchField` is the ES path — ES flattens arrays of objects
461
466
  // so no index is needed there.
462
467
  fieldPaths: {
463
- plainTextString: "0.transcription.result.finalText",
464
- searchField: "transcription.result.finalText"
468
+ plainTextString: "0.transcription.result.finalText.allText",
469
+ searchField: "transcription.result.finalText.allText"
465
470
  },
466
471
  // Validation
467
472
  validation: {
@@ -2502,6 +2507,38 @@ var genCleanCamelCaseId = (id) => {
2502
2507
  if (/^\d/.test(result)) result = "a" + result;
2503
2508
  return result.slice(0, MAX_LENGTH);
2504
2509
  };
2510
+
2511
+ // src/utils/plainTextToLexical.ts
2512
+ var plainTextToLexical = (value) => {
2513
+ if (!value && value !== 0) return void 0;
2514
+ if (value?.isLexical === true) return value;
2515
+ if (typeof value !== "string" && typeof value !== "number") return void 0;
2516
+ const text = String(value);
2517
+ const lines = text.split(/\r?\n/);
2518
+ const paragraphNodes = lines.map((line) => ({
2519
+ type: "paragraph",
2520
+ children: [
2521
+ {
2522
+ type: "text",
2523
+ text: line
2524
+ }
2525
+ ]
2526
+ }));
2527
+ return {
2528
+ allText: text,
2529
+ isLexical: true,
2530
+ editorState: {
2531
+ root: {
2532
+ children: paragraphNodes,
2533
+ direction: "ltr",
2534
+ format: "",
2535
+ indent: 0,
2536
+ type: "root",
2537
+ version: 1
2538
+ }
2539
+ }
2540
+ };
2541
+ };
2505
2542
  export {
2506
2543
  BASE_BULLMQ_CONFIG,
2507
2544
  BlockRegistry,
@@ -2540,6 +2577,7 @@ export {
2540
2577
  isTplAnnotationEnabled,
2541
2578
  mergeAnnoDataIntoAnnotationsTags,
2542
2579
  parseSpecialConfigSyntax,
2580
+ plainTextToLexical,
2543
2581
  processAuthorAndCommonFilters,
2544
2582
  _recursExtractBlocks as recursivelyExtractBlocks,
2545
2583
  segrigateDocs,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.32.0",
6
+ "version": "1.32.1",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",