@okf/ootils 1.29.3 → 1.30.0
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.
- package/dist/browser.d.mts +199 -1
- package/dist/browser.d.ts +199 -1
- package/dist/browser.js +188 -0
- package/dist/browser.mjs +181 -0
- package/dist/node.d.mts +200 -2
- package/dist/node.d.ts +200 -2
- package/dist/node.js +189 -2
- package/dist/node.mjs +182 -2
- package/dist/universal.d.mts +199 -1
- package/dist/universal.d.ts +199 -1
- package/dist/universal.js +188 -0
- package/dist/universal.mjs +181 -0
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -546,8 +546,7 @@ var init_platformConfigTypes = __esm({
|
|
|
546
546
|
"userAgreement",
|
|
547
547
|
"localeData",
|
|
548
548
|
"theme",
|
|
549
|
-
"ai"
|
|
550
|
-
"onboarding"
|
|
549
|
+
"ai"
|
|
551
550
|
];
|
|
552
551
|
}
|
|
553
552
|
});
|
|
@@ -1948,12 +1947,16 @@ __export(node_exports, {
|
|
|
1948
1947
|
BASE_BULLMQ_CONFIG: () => BASE_BULLMQ_CONFIG,
|
|
1949
1948
|
BaseProducer: () => import_BaseProducer.BaseProducer,
|
|
1950
1949
|
BaseWorker: () => import_BaseWorker.BaseWorker,
|
|
1950
|
+
BlockRegistry: () => BlockRegistry,
|
|
1951
|
+
CHUNKING_PRESETS: () => CHUNKING_PRESETS,
|
|
1951
1952
|
ChunksElasticSyncProducer: () => import_ChunksElasticSyncProducer.ChunksElasticSyncProducer,
|
|
1953
|
+
ELASTIC_MAPPING_PRESETS: () => ELASTIC_MAPPING_PRESETS,
|
|
1952
1954
|
ElasticSearchConnector: () => import_ElasticSearchConnector.ElasticSearchConnector,
|
|
1953
1955
|
FILTER_IDS: () => FILTER_IDS,
|
|
1954
1956
|
GET_GLOBAL_BULLMQ_CONFIG: () => import_GET_GLOBAL_BULLMQ_CONFIG.GET_GLOBAL_BULLMQ_CONFIG,
|
|
1955
1957
|
GeneratedEntitiesSchema: () => GeneratedEntities_default,
|
|
1956
1958
|
GeneratedTopicsSchema: () => GeneratedTopics_default,
|
|
1959
|
+
MONGO_SCHEMA_PRESETS: () => MONGO_SCHEMA_PRESETS,
|
|
1957
1960
|
MongoConnector: () => import_MongoConnector3.MongoConnector,
|
|
1958
1961
|
PlatformConfigsSchema: () => PlatformConfigs_default,
|
|
1959
1962
|
ProducerManager: () => import_ProducerManager.ProducerManager,
|
|
@@ -1968,6 +1971,7 @@ __export(node_exports, {
|
|
|
1968
1971
|
_self_managed_getFixedAnnoRollupBlocks: () => _self_managed_getFixedAnnoRollupBlocks,
|
|
1969
1972
|
_self_managed_getFixedAnnoTagBlock: () => _self_managed_getFixedAnnoTagBlock,
|
|
1970
1973
|
autoGenFilterConfigsFromTpl: () => autoGenFilterConfigsFromTpl,
|
|
1974
|
+
blockRegistry: () => blockRegistry,
|
|
1971
1975
|
buildFilterConfigurations: () => buildFilterConfigurations,
|
|
1972
1976
|
compareAndGroupBlocks: () => compareAndGroupBlocks,
|
|
1973
1977
|
deleteVal: () => deleteVal,
|
|
@@ -1986,12 +1990,14 @@ __export(node_exports, {
|
|
|
1986
1990
|
getPlatformConfigsModelByTenant: () => import_getModelByTenant2.getPlatformConfigsModelByTenant,
|
|
1987
1991
|
getPlatformContextContent: () => getPlatformContextContent,
|
|
1988
1992
|
getRollupPossibilities: () => getRollupPossibilities,
|
|
1993
|
+
getRoutePathToContentTypeLanding: () => getRoutePathToContentTypeLanding,
|
|
1989
1994
|
getRoutePathToEditContent: () => getRoutePathToEditContent,
|
|
1990
1995
|
getRoutePathToModerateContent: () => getRoutePathToModerateContent,
|
|
1991
1996
|
getRoutePathToMyContent: () => getRoutePathToMyContent,
|
|
1992
1997
|
getRoutePathToPublishedContent: () => getRoutePathToPublishedContent,
|
|
1993
1998
|
getRoutePathToReviewDashboard: () => getRoutePathToReviewDashboard,
|
|
1994
1999
|
getRoutePathToTCI: () => getRoutePathToTCI,
|
|
2000
|
+
getRoutePathToTagCategoryLanding: () => getRoutePathToTagCategoryLanding,
|
|
1995
2001
|
getTplModelByTenant: () => import_getModelByTenant2.getTplModelByTenant,
|
|
1996
2002
|
getVal: () => getVal,
|
|
1997
2003
|
mergeAnnoDataIntoAnnotationsTags: () => mergeAnnoDataIntoAnnotationsTags,
|
|
@@ -2618,6 +2624,22 @@ var getRoutePathToTCI = ({
|
|
|
2618
2624
|
return sm_link ? parseSpecialConfigSyntax({ config: sm_link, content: { contentType } }) : standard_link;
|
|
2619
2625
|
};
|
|
2620
2626
|
|
|
2627
|
+
// src/utils/routePathGenerators/getRoutePathToContentTypeLanding.ts
|
|
2628
|
+
var getRoutePathToContentTypeLanding = ({
|
|
2629
|
+
contentType,
|
|
2630
|
+
SELF_MANAGED_BASE_CONFIGS
|
|
2631
|
+
}) => {
|
|
2632
|
+
return SELF_MANAGED_BASE_CONFIGS?.enable ? `/platform-settings/datasetTemplates/${contentType}` : `/platformBuilder/contentTypesManager/${contentType}`;
|
|
2633
|
+
};
|
|
2634
|
+
|
|
2635
|
+
// src/utils/routePathGenerators/getRoutePathToTagCategoryLanding.ts
|
|
2636
|
+
var getRoutePathToTagCategoryLanding = ({
|
|
2637
|
+
contentType,
|
|
2638
|
+
SELF_MANAGED_BASE_CONFIGS
|
|
2639
|
+
}) => {
|
|
2640
|
+
return SELF_MANAGED_BASE_CONFIGS?.enable ? `/platform-settings/dataConnectors/${contentType}` : `/platformBuilder/tagsManager/${contentType}`;
|
|
2641
|
+
};
|
|
2642
|
+
|
|
2621
2643
|
// src/UI_CONTENT.ts
|
|
2622
2644
|
var UI_CONTENT = {
|
|
2623
2645
|
autoGenFilterConfigs: {
|
|
@@ -3801,6 +3823,164 @@ var genCleanCamelCaseId = (id) => {
|
|
|
3801
3823
|
return result.slice(0, MAX_LENGTH);
|
|
3802
3824
|
};
|
|
3803
3825
|
|
|
3826
|
+
// src/blockRegistry/schemaPresets.ts
|
|
3827
|
+
var MONGO_SCHEMA_PRESETS = {
|
|
3828
|
+
object: { type: Object },
|
|
3829
|
+
string: { type: String }
|
|
3830
|
+
};
|
|
3831
|
+
var ELASTIC_MAPPING_PRESETS = {
|
|
3832
|
+
largeText: {
|
|
3833
|
+
properties: {
|
|
3834
|
+
allText: {
|
|
3835
|
+
type: "text",
|
|
3836
|
+
analyzer: "LargeTextAnalyzer"
|
|
3837
|
+
}
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
};
|
|
3841
|
+
var CHUNKING_PRESETS = {
|
|
3842
|
+
// Lexical-shaped text — uses semantic chunking on allText
|
|
3843
|
+
lexicalSemantic: {
|
|
3844
|
+
strategy: "semanticChunking",
|
|
3845
|
+
windowSize: 3,
|
|
3846
|
+
minSimilarityScore: 0.7
|
|
3847
|
+
},
|
|
3848
|
+
// Plain text input — single chunk per field
|
|
3849
|
+
simpleText: {
|
|
3850
|
+
strategy: "simpleChunking"
|
|
3851
|
+
}
|
|
3852
|
+
};
|
|
3853
|
+
|
|
3854
|
+
// src/blockRegistry/blocks/LexicalTextEditor.ts
|
|
3855
|
+
var LexicalTextEditor = {
|
|
3856
|
+
compName: "LexicalTextEditor",
|
|
3857
|
+
// Identity
|
|
3858
|
+
category: "text",
|
|
3859
|
+
qualQuant: "qual",
|
|
3860
|
+
// Schema
|
|
3861
|
+
mongoSchemaType: MONGO_SCHEMA_PRESETS.object,
|
|
3862
|
+
esMapping: ELASTIC_MAPPING_PRESETS.largeText,
|
|
3863
|
+
// Capabilities
|
|
3864
|
+
capabilities: {
|
|
3865
|
+
hasPlainText: true,
|
|
3866
|
+
hasLexicalShape: true,
|
|
3867
|
+
annotation: true,
|
|
3868
|
+
aiAnnotation: true,
|
|
3869
|
+
aiEnrichment: true,
|
|
3870
|
+
aiChatQualField: true,
|
|
3871
|
+
aiChatQuantField: false,
|
|
3872
|
+
searchable: true,
|
|
3873
|
+
directDataImport: true,
|
|
3874
|
+
csvExport: true,
|
|
3875
|
+
translatable: true,
|
|
3876
|
+
documentSummarizer: true,
|
|
3877
|
+
stripFromMainOnAnnoChunkSync: true
|
|
3878
|
+
},
|
|
3879
|
+
// Field paths
|
|
3880
|
+
fieldPaths: {
|
|
3881
|
+
plainTextString: "allText",
|
|
3882
|
+
searchField: "allText",
|
|
3883
|
+
displayValue: "allText"
|
|
3884
|
+
},
|
|
3885
|
+
// Validation
|
|
3886
|
+
validation: {
|
|
3887
|
+
populatedCheckFn: "lexicalTextEditorHasValue",
|
|
3888
|
+
formValidationFn: "lexicalTextEditorHasValue"
|
|
3889
|
+
},
|
|
3890
|
+
// Translation
|
|
3891
|
+
translation: {
|
|
3892
|
+
handlerType: "LexicalBlockHandler"
|
|
3893
|
+
},
|
|
3894
|
+
// Table rendering
|
|
3895
|
+
tableCell: {
|
|
3896
|
+
cellComp: "RichTextAsPlainTextLex",
|
|
3897
|
+
sortPathSuffix: "editorState.root.children.0.children.0.text"
|
|
3898
|
+
},
|
|
3899
|
+
// CSV export
|
|
3900
|
+
csvExport: {
|
|
3901
|
+
transformFn: "KPRichLexicalEditor"
|
|
3902
|
+
},
|
|
3903
|
+
// Slack
|
|
3904
|
+
slackFormat: {
|
|
3905
|
+
handlerFn: "lexicalRichText"
|
|
3906
|
+
},
|
|
3907
|
+
// Batch import
|
|
3908
|
+
batchImport: {
|
|
3909
|
+
valueInjectorFn: "toLexicalValue"
|
|
3910
|
+
},
|
|
3911
|
+
// Content block option — TCI template builder & direct import UI
|
|
3912
|
+
contentBlockOption: {
|
|
3913
|
+
display: "Rich Text Field",
|
|
3914
|
+
icon: "TextAa"
|
|
3915
|
+
},
|
|
3916
|
+
// Chunking config — used by okf-sub CreateChunksHandler
|
|
3917
|
+
chunkingConfig: CHUNKING_PRESETS.lexicalSemantic
|
|
3918
|
+
};
|
|
3919
|
+
|
|
3920
|
+
// src/blockRegistry/registry.ts
|
|
3921
|
+
var BlockRegistry = class {
|
|
3922
|
+
constructor() {
|
|
3923
|
+
this.blocks = /* @__PURE__ */ new Map();
|
|
3924
|
+
this.register(LexicalTextEditor);
|
|
3925
|
+
}
|
|
3926
|
+
/** Register a block descriptor. */
|
|
3927
|
+
register(descriptor) {
|
|
3928
|
+
this.blocks.set(descriptor.compName, descriptor);
|
|
3929
|
+
}
|
|
3930
|
+
/** Get the full descriptor for a block type. Returns undefined if not registered. */
|
|
3931
|
+
getBlock(compType) {
|
|
3932
|
+
return this.blocks.get(compType);
|
|
3933
|
+
}
|
|
3934
|
+
/** Check if a block type is registered in the registry. */
|
|
3935
|
+
isRegistered(compType) {
|
|
3936
|
+
return this.blocks.has(compType);
|
|
3937
|
+
}
|
|
3938
|
+
/**
|
|
3939
|
+
* Get all registered block descriptors that have a given capability set to a truthy value.
|
|
3940
|
+
* Optionally pass a specific value to match (e.g. for enum-style capabilities).
|
|
3941
|
+
*/
|
|
3942
|
+
getBlocksByCapability(capability, value = true) {
|
|
3943
|
+
return Array.from(this.blocks.values()).filter((b) => {
|
|
3944
|
+
const cap = b.capabilities[capability];
|
|
3945
|
+
if (value === true) return !!cap;
|
|
3946
|
+
return cap === value;
|
|
3947
|
+
});
|
|
3948
|
+
}
|
|
3949
|
+
/**
|
|
3950
|
+
* Get compType strings for all registered blocks with a given capability.
|
|
3951
|
+
* Replaces scattered hardcoded arrays like:
|
|
3952
|
+
* const TEXT_FIELD_COMPONENTS = ["TextInput", "LexicalTextEditor", ...]
|
|
3953
|
+
* becomes:
|
|
3954
|
+
* const TEXT_FIELD_COMPONENTS = blockRegistry.getComps('aiTextExtraction')
|
|
3955
|
+
*/
|
|
3956
|
+
getComps(capability, value = true) {
|
|
3957
|
+
return this.getBlocksByCapability(capability, value).map((b) => b.compName);
|
|
3958
|
+
}
|
|
3959
|
+
/** Get all registered blocks in a given category. */
|
|
3960
|
+
getBlocksByCategory(category) {
|
|
3961
|
+
return Array.from(this.blocks.values()).filter((b) => b.category === category);
|
|
3962
|
+
}
|
|
3963
|
+
/** Get compType strings for all qual blocks. */
|
|
3964
|
+
getQualBlocks() {
|
|
3965
|
+
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "qual").map((b) => b.compName);
|
|
3966
|
+
}
|
|
3967
|
+
/** Get compType strings for all quant blocks. */
|
|
3968
|
+
getQuantBlocks() {
|
|
3969
|
+
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "quant").map((b) => b.compName);
|
|
3970
|
+
}
|
|
3971
|
+
/** Check if a specific block has a specific capability. */
|
|
3972
|
+
hasCapability(compType, capability) {
|
|
3973
|
+
const block = this.blocks.get(compType);
|
|
3974
|
+
if (!block) return false;
|
|
3975
|
+
return !!block.capabilities[capability];
|
|
3976
|
+
}
|
|
3977
|
+
/** Get all registered block descriptors. */
|
|
3978
|
+
getAll() {
|
|
3979
|
+
return Array.from(this.blocks.values());
|
|
3980
|
+
}
|
|
3981
|
+
};
|
|
3982
|
+
var blockRegistry = new BlockRegistry();
|
|
3983
|
+
|
|
3804
3984
|
// src/node.ts
|
|
3805
3985
|
var import_MongoConnector3 = __toESM(require_MongoConnector());
|
|
3806
3986
|
var import_ElasticSearchConnector = __toESM(require_ElasticSearchConnector());
|
|
@@ -4192,12 +4372,16 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
|
|
|
4192
4372
|
BASE_BULLMQ_CONFIG,
|
|
4193
4373
|
BaseProducer,
|
|
4194
4374
|
BaseWorker,
|
|
4375
|
+
BlockRegistry,
|
|
4376
|
+
CHUNKING_PRESETS,
|
|
4195
4377
|
ChunksElasticSyncProducer,
|
|
4378
|
+
ELASTIC_MAPPING_PRESETS,
|
|
4196
4379
|
ElasticSearchConnector,
|
|
4197
4380
|
FILTER_IDS,
|
|
4198
4381
|
GET_GLOBAL_BULLMQ_CONFIG,
|
|
4199
4382
|
GeneratedEntitiesSchema,
|
|
4200
4383
|
GeneratedTopicsSchema,
|
|
4384
|
+
MONGO_SCHEMA_PRESETS,
|
|
4201
4385
|
MongoConnector,
|
|
4202
4386
|
PlatformConfigsSchema,
|
|
4203
4387
|
ProducerManager,
|
|
@@ -4212,6 +4396,7 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
|
|
|
4212
4396
|
_self_managed_getFixedAnnoRollupBlocks,
|
|
4213
4397
|
_self_managed_getFixedAnnoTagBlock,
|
|
4214
4398
|
autoGenFilterConfigsFromTpl,
|
|
4399
|
+
blockRegistry,
|
|
4215
4400
|
buildFilterConfigurations,
|
|
4216
4401
|
compareAndGroupBlocks,
|
|
4217
4402
|
deleteVal,
|
|
@@ -4230,12 +4415,14 @@ var import_GET_GLOBAL_BULLMQ_CONFIG = __toESM(require_GET_GLOBAL_BULLMQ_CONFIG()
|
|
|
4230
4415
|
getPlatformConfigsModelByTenant,
|
|
4231
4416
|
getPlatformContextContent,
|
|
4232
4417
|
getRollupPossibilities,
|
|
4418
|
+
getRoutePathToContentTypeLanding,
|
|
4233
4419
|
getRoutePathToEditContent,
|
|
4234
4420
|
getRoutePathToModerateContent,
|
|
4235
4421
|
getRoutePathToMyContent,
|
|
4236
4422
|
getRoutePathToPublishedContent,
|
|
4237
4423
|
getRoutePathToReviewDashboard,
|
|
4238
4424
|
getRoutePathToTCI,
|
|
4425
|
+
getRoutePathToTagCategoryLanding,
|
|
4239
4426
|
getTplModelByTenant,
|
|
4240
4427
|
getVal,
|
|
4241
4428
|
mergeAnnoDataIntoAnnotationsTags,
|
package/dist/node.mjs
CHANGED
|
@@ -551,8 +551,7 @@ var init_platformConfigTypes = __esm({
|
|
|
551
551
|
"userAgreement",
|
|
552
552
|
"localeData",
|
|
553
553
|
"theme",
|
|
554
|
-
"ai"
|
|
555
|
-
"onboarding"
|
|
554
|
+
"ai"
|
|
556
555
|
];
|
|
557
556
|
}
|
|
558
557
|
});
|
|
@@ -2558,6 +2557,22 @@ var getRoutePathToTCI = ({
|
|
|
2558
2557
|
return sm_link ? parseSpecialConfigSyntax({ config: sm_link, content: { contentType } }) : standard_link;
|
|
2559
2558
|
};
|
|
2560
2559
|
|
|
2560
|
+
// src/utils/routePathGenerators/getRoutePathToContentTypeLanding.ts
|
|
2561
|
+
var getRoutePathToContentTypeLanding = ({
|
|
2562
|
+
contentType,
|
|
2563
|
+
SELF_MANAGED_BASE_CONFIGS
|
|
2564
|
+
}) => {
|
|
2565
|
+
return SELF_MANAGED_BASE_CONFIGS?.enable ? `/platform-settings/datasetTemplates/${contentType}` : `/platformBuilder/contentTypesManager/${contentType}`;
|
|
2566
|
+
};
|
|
2567
|
+
|
|
2568
|
+
// src/utils/routePathGenerators/getRoutePathToTagCategoryLanding.ts
|
|
2569
|
+
var getRoutePathToTagCategoryLanding = ({
|
|
2570
|
+
contentType,
|
|
2571
|
+
SELF_MANAGED_BASE_CONFIGS
|
|
2572
|
+
}) => {
|
|
2573
|
+
return SELF_MANAGED_BASE_CONFIGS?.enable ? `/platform-settings/dataConnectors/${contentType}` : `/platformBuilder/tagsManager/${contentType}`;
|
|
2574
|
+
};
|
|
2575
|
+
|
|
2561
2576
|
// src/UI_CONTENT.ts
|
|
2562
2577
|
var UI_CONTENT = {
|
|
2563
2578
|
autoGenFilterConfigs: {
|
|
@@ -3741,6 +3756,164 @@ var genCleanCamelCaseId = (id) => {
|
|
|
3741
3756
|
return result.slice(0, MAX_LENGTH);
|
|
3742
3757
|
};
|
|
3743
3758
|
|
|
3759
|
+
// src/blockRegistry/schemaPresets.ts
|
|
3760
|
+
var MONGO_SCHEMA_PRESETS = {
|
|
3761
|
+
object: { type: Object },
|
|
3762
|
+
string: { type: String }
|
|
3763
|
+
};
|
|
3764
|
+
var ELASTIC_MAPPING_PRESETS = {
|
|
3765
|
+
largeText: {
|
|
3766
|
+
properties: {
|
|
3767
|
+
allText: {
|
|
3768
|
+
type: "text",
|
|
3769
|
+
analyzer: "LargeTextAnalyzer"
|
|
3770
|
+
}
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
};
|
|
3774
|
+
var CHUNKING_PRESETS = {
|
|
3775
|
+
// Lexical-shaped text — uses semantic chunking on allText
|
|
3776
|
+
lexicalSemantic: {
|
|
3777
|
+
strategy: "semanticChunking",
|
|
3778
|
+
windowSize: 3,
|
|
3779
|
+
minSimilarityScore: 0.7
|
|
3780
|
+
},
|
|
3781
|
+
// Plain text input — single chunk per field
|
|
3782
|
+
simpleText: {
|
|
3783
|
+
strategy: "simpleChunking"
|
|
3784
|
+
}
|
|
3785
|
+
};
|
|
3786
|
+
|
|
3787
|
+
// src/blockRegistry/blocks/LexicalTextEditor.ts
|
|
3788
|
+
var LexicalTextEditor = {
|
|
3789
|
+
compName: "LexicalTextEditor",
|
|
3790
|
+
// Identity
|
|
3791
|
+
category: "text",
|
|
3792
|
+
qualQuant: "qual",
|
|
3793
|
+
// Schema
|
|
3794
|
+
mongoSchemaType: MONGO_SCHEMA_PRESETS.object,
|
|
3795
|
+
esMapping: ELASTIC_MAPPING_PRESETS.largeText,
|
|
3796
|
+
// Capabilities
|
|
3797
|
+
capabilities: {
|
|
3798
|
+
hasPlainText: true,
|
|
3799
|
+
hasLexicalShape: true,
|
|
3800
|
+
annotation: true,
|
|
3801
|
+
aiAnnotation: true,
|
|
3802
|
+
aiEnrichment: true,
|
|
3803
|
+
aiChatQualField: true,
|
|
3804
|
+
aiChatQuantField: false,
|
|
3805
|
+
searchable: true,
|
|
3806
|
+
directDataImport: true,
|
|
3807
|
+
csvExport: true,
|
|
3808
|
+
translatable: true,
|
|
3809
|
+
documentSummarizer: true,
|
|
3810
|
+
stripFromMainOnAnnoChunkSync: true
|
|
3811
|
+
},
|
|
3812
|
+
// Field paths
|
|
3813
|
+
fieldPaths: {
|
|
3814
|
+
plainTextString: "allText",
|
|
3815
|
+
searchField: "allText",
|
|
3816
|
+
displayValue: "allText"
|
|
3817
|
+
},
|
|
3818
|
+
// Validation
|
|
3819
|
+
validation: {
|
|
3820
|
+
populatedCheckFn: "lexicalTextEditorHasValue",
|
|
3821
|
+
formValidationFn: "lexicalTextEditorHasValue"
|
|
3822
|
+
},
|
|
3823
|
+
// Translation
|
|
3824
|
+
translation: {
|
|
3825
|
+
handlerType: "LexicalBlockHandler"
|
|
3826
|
+
},
|
|
3827
|
+
// Table rendering
|
|
3828
|
+
tableCell: {
|
|
3829
|
+
cellComp: "RichTextAsPlainTextLex",
|
|
3830
|
+
sortPathSuffix: "editorState.root.children.0.children.0.text"
|
|
3831
|
+
},
|
|
3832
|
+
// CSV export
|
|
3833
|
+
csvExport: {
|
|
3834
|
+
transformFn: "KPRichLexicalEditor"
|
|
3835
|
+
},
|
|
3836
|
+
// Slack
|
|
3837
|
+
slackFormat: {
|
|
3838
|
+
handlerFn: "lexicalRichText"
|
|
3839
|
+
},
|
|
3840
|
+
// Batch import
|
|
3841
|
+
batchImport: {
|
|
3842
|
+
valueInjectorFn: "toLexicalValue"
|
|
3843
|
+
},
|
|
3844
|
+
// Content block option — TCI template builder & direct import UI
|
|
3845
|
+
contentBlockOption: {
|
|
3846
|
+
display: "Rich Text Field",
|
|
3847
|
+
icon: "TextAa"
|
|
3848
|
+
},
|
|
3849
|
+
// Chunking config — used by okf-sub CreateChunksHandler
|
|
3850
|
+
chunkingConfig: CHUNKING_PRESETS.lexicalSemantic
|
|
3851
|
+
};
|
|
3852
|
+
|
|
3853
|
+
// src/blockRegistry/registry.ts
|
|
3854
|
+
var BlockRegistry = class {
|
|
3855
|
+
constructor() {
|
|
3856
|
+
this.blocks = /* @__PURE__ */ new Map();
|
|
3857
|
+
this.register(LexicalTextEditor);
|
|
3858
|
+
}
|
|
3859
|
+
/** Register a block descriptor. */
|
|
3860
|
+
register(descriptor) {
|
|
3861
|
+
this.blocks.set(descriptor.compName, descriptor);
|
|
3862
|
+
}
|
|
3863
|
+
/** Get the full descriptor for a block type. Returns undefined if not registered. */
|
|
3864
|
+
getBlock(compType) {
|
|
3865
|
+
return this.blocks.get(compType);
|
|
3866
|
+
}
|
|
3867
|
+
/** Check if a block type is registered in the registry. */
|
|
3868
|
+
isRegistered(compType) {
|
|
3869
|
+
return this.blocks.has(compType);
|
|
3870
|
+
}
|
|
3871
|
+
/**
|
|
3872
|
+
* Get all registered block descriptors that have a given capability set to a truthy value.
|
|
3873
|
+
* Optionally pass a specific value to match (e.g. for enum-style capabilities).
|
|
3874
|
+
*/
|
|
3875
|
+
getBlocksByCapability(capability, value = true) {
|
|
3876
|
+
return Array.from(this.blocks.values()).filter((b) => {
|
|
3877
|
+
const cap = b.capabilities[capability];
|
|
3878
|
+
if (value === true) return !!cap;
|
|
3879
|
+
return cap === value;
|
|
3880
|
+
});
|
|
3881
|
+
}
|
|
3882
|
+
/**
|
|
3883
|
+
* Get compType strings for all registered blocks with a given capability.
|
|
3884
|
+
* Replaces scattered hardcoded arrays like:
|
|
3885
|
+
* const TEXT_FIELD_COMPONENTS = ["TextInput", "LexicalTextEditor", ...]
|
|
3886
|
+
* becomes:
|
|
3887
|
+
* const TEXT_FIELD_COMPONENTS = blockRegistry.getComps('aiTextExtraction')
|
|
3888
|
+
*/
|
|
3889
|
+
getComps(capability, value = true) {
|
|
3890
|
+
return this.getBlocksByCapability(capability, value).map((b) => b.compName);
|
|
3891
|
+
}
|
|
3892
|
+
/** Get all registered blocks in a given category. */
|
|
3893
|
+
getBlocksByCategory(category) {
|
|
3894
|
+
return Array.from(this.blocks.values()).filter((b) => b.category === category);
|
|
3895
|
+
}
|
|
3896
|
+
/** Get compType strings for all qual blocks. */
|
|
3897
|
+
getQualBlocks() {
|
|
3898
|
+
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "qual").map((b) => b.compName);
|
|
3899
|
+
}
|
|
3900
|
+
/** Get compType strings for all quant blocks. */
|
|
3901
|
+
getQuantBlocks() {
|
|
3902
|
+
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "quant").map((b) => b.compName);
|
|
3903
|
+
}
|
|
3904
|
+
/** Check if a specific block has a specific capability. */
|
|
3905
|
+
hasCapability(compType, capability) {
|
|
3906
|
+
const block = this.blocks.get(compType);
|
|
3907
|
+
if (!block) return false;
|
|
3908
|
+
return !!block.capabilities[capability];
|
|
3909
|
+
}
|
|
3910
|
+
/** Get all registered block descriptors. */
|
|
3911
|
+
getAll() {
|
|
3912
|
+
return Array.from(this.blocks.values());
|
|
3913
|
+
}
|
|
3914
|
+
};
|
|
3915
|
+
var blockRegistry = new BlockRegistry();
|
|
3916
|
+
|
|
3744
3917
|
// src/node.ts
|
|
3745
3918
|
var import_MongoConnector3 = __toESM(require_MongoConnector());
|
|
3746
3919
|
var import_ElasticSearchConnector = __toESM(require_ElasticSearchConnector());
|
|
@@ -4147,12 +4320,16 @@ export {
|
|
|
4147
4320
|
BASE_BULLMQ_CONFIG,
|
|
4148
4321
|
export_BaseProducer as BaseProducer,
|
|
4149
4322
|
export_BaseWorker as BaseWorker,
|
|
4323
|
+
BlockRegistry,
|
|
4324
|
+
CHUNKING_PRESETS,
|
|
4150
4325
|
export_ChunksElasticSyncProducer as ChunksElasticSyncProducer,
|
|
4326
|
+
ELASTIC_MAPPING_PRESETS,
|
|
4151
4327
|
export_ElasticSearchConnector as ElasticSearchConnector,
|
|
4152
4328
|
FILTER_IDS,
|
|
4153
4329
|
export_GET_GLOBAL_BULLMQ_CONFIG as GET_GLOBAL_BULLMQ_CONFIG,
|
|
4154
4330
|
GeneratedEntities_default as GeneratedEntitiesSchema,
|
|
4155
4331
|
GeneratedTopics_default as GeneratedTopicsSchema,
|
|
4332
|
+
MONGO_SCHEMA_PRESETS,
|
|
4156
4333
|
export_MongoConnector as MongoConnector,
|
|
4157
4334
|
PlatformConfigs_default as PlatformConfigsSchema,
|
|
4158
4335
|
export_ProducerManager as ProducerManager,
|
|
@@ -4167,6 +4344,7 @@ export {
|
|
|
4167
4344
|
_self_managed_getFixedAnnoRollupBlocks,
|
|
4168
4345
|
_self_managed_getFixedAnnoTagBlock,
|
|
4169
4346
|
autoGenFilterConfigsFromTpl,
|
|
4347
|
+
blockRegistry,
|
|
4170
4348
|
buildFilterConfigurations,
|
|
4171
4349
|
compareAndGroupBlocks,
|
|
4172
4350
|
deleteVal,
|
|
@@ -4185,12 +4363,14 @@ export {
|
|
|
4185
4363
|
export_getPlatformConfigsModelByTenant as getPlatformConfigsModelByTenant,
|
|
4186
4364
|
getPlatformContextContent,
|
|
4187
4365
|
getRollupPossibilities,
|
|
4366
|
+
getRoutePathToContentTypeLanding,
|
|
4188
4367
|
getRoutePathToEditContent,
|
|
4189
4368
|
getRoutePathToModerateContent,
|
|
4190
4369
|
getRoutePathToMyContent,
|
|
4191
4370
|
getRoutePathToPublishedContent,
|
|
4192
4371
|
getRoutePathToReviewDashboard,
|
|
4193
4372
|
getRoutePathToTCI,
|
|
4373
|
+
getRoutePathToTagCategoryLanding,
|
|
4194
4374
|
export_getTplModelByTenant as getTplModelByTenant,
|
|
4195
4375
|
getVal,
|
|
4196
4376
|
mergeAnnoDataIntoAnnotationsTags,
|