@okf/ootils 1.31.3 → 1.31.4
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 +9 -1
- package/dist/browser.d.ts +9 -1
- package/dist/browser.js +206 -195
- package/dist/browser.mjs +205 -195
- package/dist/node.d.mts +9 -1
- package/dist/node.d.ts +9 -1
- package/dist/node.js +206 -195
- package/dist/node.mjs +205 -195
- package/dist/universal.d.mts +9 -1
- package/dist/universal.d.ts +9 -1
- package/dist/universal.js +206 -195
- package/dist/universal.mjs +205 -195
- package/package.json +1 -1
package/dist/node.mjs
CHANGED
|
@@ -2286,6 +2286,210 @@ var _extractBlocksFromSomeBuilders = ({
|
|
|
2286
2286
|
}
|
|
2287
2287
|
};
|
|
2288
2288
|
|
|
2289
|
+
// src/blockRegistry/schemaPresets.ts
|
|
2290
|
+
var MONGO_SCHEMA_PRESETS = {
|
|
2291
|
+
object: { type: Object },
|
|
2292
|
+
string: { type: String }
|
|
2293
|
+
};
|
|
2294
|
+
var ELASTIC_MAPPING_PRESETS = {
|
|
2295
|
+
largeText: {
|
|
2296
|
+
properties: {
|
|
2297
|
+
allText: {
|
|
2298
|
+
type: "text",
|
|
2299
|
+
analyzer: "LargeTextAnalyzer"
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
};
|
|
2304
|
+
var CHUNKING_PRESETS = {
|
|
2305
|
+
// Lexical-shaped text — uses semantic chunking on allText
|
|
2306
|
+
lexicalSemantic: {
|
|
2307
|
+
strategy: "semanticChunking",
|
|
2308
|
+
windowSize: 3,
|
|
2309
|
+
minSimilarityScore: 0.7
|
|
2310
|
+
},
|
|
2311
|
+
// Plain text input — single chunk per field
|
|
2312
|
+
simpleText: {
|
|
2313
|
+
strategy: "simpleChunking"
|
|
2314
|
+
}
|
|
2315
|
+
};
|
|
2316
|
+
|
|
2317
|
+
// src/blockRegistry/blocks/LexicalTextEditor.ts
|
|
2318
|
+
var LexicalTextEditor = {
|
|
2319
|
+
compName: "LexicalTextEditor",
|
|
2320
|
+
// Identity
|
|
2321
|
+
category: "text",
|
|
2322
|
+
qualQuant: "qual",
|
|
2323
|
+
// Schema
|
|
2324
|
+
mongoSchemaType: MONGO_SCHEMA_PRESETS.object,
|
|
2325
|
+
esMapping: ELASTIC_MAPPING_PRESETS.largeText,
|
|
2326
|
+
// Capabilities
|
|
2327
|
+
capabilities: {
|
|
2328
|
+
hasPlainText: true,
|
|
2329
|
+
annotation: true,
|
|
2330
|
+
aiAnnotation: true,
|
|
2331
|
+
aiEnrichment: true,
|
|
2332
|
+
searchable: true,
|
|
2333
|
+
directDataImport: true,
|
|
2334
|
+
csvExport: true,
|
|
2335
|
+
translatable: true,
|
|
2336
|
+
documentSummarizer: true,
|
|
2337
|
+
stripFromMainOnAnnoChunkSync: true,
|
|
2338
|
+
excludeFromListingProjection: true
|
|
2339
|
+
},
|
|
2340
|
+
// Field paths
|
|
2341
|
+
fieldPaths: {
|
|
2342
|
+
plainTextString: "allText",
|
|
2343
|
+
searchField: "allText",
|
|
2344
|
+
displayValue: "allText"
|
|
2345
|
+
},
|
|
2346
|
+
// Validation
|
|
2347
|
+
validation: {
|
|
2348
|
+
populatedCheckFn: "lexicalTextEditorHasValue",
|
|
2349
|
+
formValidationFn: "lexicalTextEditorHasValue"
|
|
2350
|
+
},
|
|
2351
|
+
// Translation
|
|
2352
|
+
translation: {
|
|
2353
|
+
handlerType: "LexicalBlockHandler"
|
|
2354
|
+
},
|
|
2355
|
+
// Table rendering
|
|
2356
|
+
tableCell: {
|
|
2357
|
+
cellComp: "RichTextAsPlainTextLex",
|
|
2358
|
+
sortPathSuffix: "editorState.root.children.0.children.0.text"
|
|
2359
|
+
},
|
|
2360
|
+
// CSV export
|
|
2361
|
+
csvExport: {
|
|
2362
|
+
transformFn: "KPRichLexicalEditor"
|
|
2363
|
+
},
|
|
2364
|
+
// Slack
|
|
2365
|
+
slackFormat: {
|
|
2366
|
+
handlerFn: "lexicalRichText"
|
|
2367
|
+
},
|
|
2368
|
+
// Batch import
|
|
2369
|
+
batchImport: {
|
|
2370
|
+
valueInjectorFn: "toLexicalValue"
|
|
2371
|
+
},
|
|
2372
|
+
// Content block option — TCI template builder & direct import UI
|
|
2373
|
+
contentBlockOption: {
|
|
2374
|
+
display: "Rich Text Field",
|
|
2375
|
+
icon: "TextAa",
|
|
2376
|
+
directImportGroupsIdx: [2, 2]
|
|
2377
|
+
},
|
|
2378
|
+
// Chunking config — used by okf-sub CreateChunksHandler
|
|
2379
|
+
chunkingConfig: CHUNKING_PRESETS.lexicalSemantic
|
|
2380
|
+
};
|
|
2381
|
+
|
|
2382
|
+
// src/blockRegistry/registry.ts
|
|
2383
|
+
var BlockRegistry = class {
|
|
2384
|
+
constructor() {
|
|
2385
|
+
this.blocks = /* @__PURE__ */ new Map();
|
|
2386
|
+
this.register(LexicalTextEditor);
|
|
2387
|
+
}
|
|
2388
|
+
/** Register a block descriptor. */
|
|
2389
|
+
register(descriptor) {
|
|
2390
|
+
this.blocks.set(descriptor.compName, descriptor);
|
|
2391
|
+
}
|
|
2392
|
+
/** Get the full descriptor for a block type. Returns undefined if not registered. */
|
|
2393
|
+
getBlock(compType) {
|
|
2394
|
+
return this.blocks.get(compType);
|
|
2395
|
+
}
|
|
2396
|
+
/** Check if a block type is registered in the registry. */
|
|
2397
|
+
isRegistered(compType) {
|
|
2398
|
+
return this.blocks.has(compType);
|
|
2399
|
+
}
|
|
2400
|
+
/**
|
|
2401
|
+
* Get all registered block descriptors that have a given capability set to a truthy value.
|
|
2402
|
+
* Optionally pass a specific value to match (e.g. for enum-style capabilities).
|
|
2403
|
+
*/
|
|
2404
|
+
getBlocksByCapability(capability, value = true) {
|
|
2405
|
+
return Array.from(this.blocks.values()).filter((b) => {
|
|
2406
|
+
const cap = b.capabilities[capability];
|
|
2407
|
+
if (value === true) return !!cap;
|
|
2408
|
+
return cap === value;
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* Get compType strings for all registered blocks with a given capability.
|
|
2413
|
+
* Replaces scattered hardcoded arrays like:
|
|
2414
|
+
* const TEXT_FIELD_COMPONENTS = ["TextInput", "LexicalTextEditor", ...]
|
|
2415
|
+
* becomes:
|
|
2416
|
+
* const TEXT_FIELD_COMPONENTS = blockRegistry.getComps('aiTextExtraction')
|
|
2417
|
+
*/
|
|
2418
|
+
getComps(capability, value = true) {
|
|
2419
|
+
return this.getBlocksByCapability(capability, value).map((b) => b.compName);
|
|
2420
|
+
}
|
|
2421
|
+
/** Get all registered blocks in a given category. */
|
|
2422
|
+
getBlocksByCategory(category) {
|
|
2423
|
+
return Array.from(this.blocks.values()).filter((b) => b.category === category);
|
|
2424
|
+
}
|
|
2425
|
+
/** Get compType strings for all qual blocks. */
|
|
2426
|
+
getQualBlocks() {
|
|
2427
|
+
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "qual").map((b) => b.compName);
|
|
2428
|
+
}
|
|
2429
|
+
/** Get compType strings for all quant blocks. */
|
|
2430
|
+
getQuantBlocks() {
|
|
2431
|
+
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "quant").map((b) => b.compName);
|
|
2432
|
+
}
|
|
2433
|
+
/** Check if a specific block has a specific capability. */
|
|
2434
|
+
hasCapability(compType, capability) {
|
|
2435
|
+
const block = this.blocks.get(compType);
|
|
2436
|
+
if (!block) return false;
|
|
2437
|
+
return !!block.capabilities[capability];
|
|
2438
|
+
}
|
|
2439
|
+
/** Get all registered block descriptors. */
|
|
2440
|
+
getAll() {
|
|
2441
|
+
return Array.from(this.blocks.values());
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* Get compName strings for all registered blocks that have a chunking config.
|
|
2445
|
+
* Used by chunking pipelines and prompt-string injection (e.g. searchChunks tool
|
|
2446
|
+
* description) to know which fields actually have chunks to search.
|
|
2447
|
+
*/
|
|
2448
|
+
getCompsWithChunking() {
|
|
2449
|
+
return Array.from(this.blocks.values()).filter((b) => !!b.chunkingConfig).map((b) => b.compName);
|
|
2450
|
+
}
|
|
2451
|
+
/**
|
|
2452
|
+
* Filter a list of block instances down to those where annotation is enabled.
|
|
2453
|
+
* A block is annotation-enabled if its registry capability `annotation` is true.
|
|
2454
|
+
* For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
|
|
2455
|
+
* falls back to the legacy per-instance `props.annotation.enable` toggle.
|
|
2456
|
+
*
|
|
2457
|
+
* Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
|
|
2458
|
+
*/
|
|
2459
|
+
getAnnotationEnabledBlocks(allBlocks) {
|
|
2460
|
+
return allBlocks.filter((block) => {
|
|
2461
|
+
const blockDef = this.blocks.get(block.comp);
|
|
2462
|
+
if (blockDef) return !!blockDef.capabilities.annotation;
|
|
2463
|
+
return block.props?.annotation?.enable === true;
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
/**
|
|
2467
|
+
* Resolve the tagTypesConfig for a block instance.
|
|
2468
|
+
*
|
|
2469
|
+
* Resolution order:
|
|
2470
|
+
* 1. `hardCodedTagTypesConfigForSM` — the intended self-managed default, which takes
|
|
2471
|
+
* priority over per-instance values (justifies not persisting per-block on self-managed).
|
|
2472
|
+
* Sourced from `GET_SELF_MANAGED_BASE_CONFIGS().annotation_tagTypesConfig` on BE,
|
|
2473
|
+
* or `platformConfigs.SELF_MANAGED_BASE_CONFIGS.annotation_tagTypesConfig` on FE.
|
|
2474
|
+
* Pass null/undefined for non-SM tenants.
|
|
2475
|
+
* 2. `block.props.annotation.tagTypesConfig` — legacy per-instance persisted value.
|
|
2476
|
+
* 3. Empty array.
|
|
2477
|
+
*/
|
|
2478
|
+
getTagTypesConfig(block, hardCodedTagTypesConfigForSM) {
|
|
2479
|
+
return hardCodedTagTypesConfigForSM || block.props?.annotation?.tagTypesConfig || [];
|
|
2480
|
+
}
|
|
2481
|
+
};
|
|
2482
|
+
var blockRegistry = new BlockRegistry();
|
|
2483
|
+
|
|
2484
|
+
// src/utils/isTplAnnotationEnabled.ts
|
|
2485
|
+
var isTplAnnotationEnabled = (tpl) => {
|
|
2486
|
+
if (tpl?.general?.segment !== "publishing") return false;
|
|
2487
|
+
const allBlocks = extractAllBlocksFromTpl({ tpl }).filter(
|
|
2488
|
+
(b) => typeof b.comp === "string"
|
|
2489
|
+
);
|
|
2490
|
+
return blockRegistry.getAnnotationEnabledBlocks(allBlocks).length > 0;
|
|
2491
|
+
};
|
|
2492
|
+
|
|
2289
2493
|
// src/utils/getRollupPossibilities.ts
|
|
2290
2494
|
var MAX_DEPTH_ROLLUP_POSSIBILITIES = 10;
|
|
2291
2495
|
function getRollupPossibilities({
|
|
@@ -2985,201 +3189,6 @@ var compareAndGroupBlocks = (blocksPerTpl) => {
|
|
|
2985
3189
|
return Array.from(templateGroupToFilters.values());
|
|
2986
3190
|
};
|
|
2987
3191
|
|
|
2988
|
-
// src/blockRegistry/schemaPresets.ts
|
|
2989
|
-
var MONGO_SCHEMA_PRESETS = {
|
|
2990
|
-
object: { type: Object },
|
|
2991
|
-
string: { type: String }
|
|
2992
|
-
};
|
|
2993
|
-
var ELASTIC_MAPPING_PRESETS = {
|
|
2994
|
-
largeText: {
|
|
2995
|
-
properties: {
|
|
2996
|
-
allText: {
|
|
2997
|
-
type: "text",
|
|
2998
|
-
analyzer: "LargeTextAnalyzer"
|
|
2999
|
-
}
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
};
|
|
3003
|
-
var CHUNKING_PRESETS = {
|
|
3004
|
-
// Lexical-shaped text — uses semantic chunking on allText
|
|
3005
|
-
lexicalSemantic: {
|
|
3006
|
-
strategy: "semanticChunking",
|
|
3007
|
-
windowSize: 3,
|
|
3008
|
-
minSimilarityScore: 0.7
|
|
3009
|
-
},
|
|
3010
|
-
// Plain text input — single chunk per field
|
|
3011
|
-
simpleText: {
|
|
3012
|
-
strategy: "simpleChunking"
|
|
3013
|
-
}
|
|
3014
|
-
};
|
|
3015
|
-
|
|
3016
|
-
// src/blockRegistry/blocks/LexicalTextEditor.ts
|
|
3017
|
-
var LexicalTextEditor = {
|
|
3018
|
-
compName: "LexicalTextEditor",
|
|
3019
|
-
// Identity
|
|
3020
|
-
category: "text",
|
|
3021
|
-
qualQuant: "qual",
|
|
3022
|
-
// Schema
|
|
3023
|
-
mongoSchemaType: MONGO_SCHEMA_PRESETS.object,
|
|
3024
|
-
esMapping: ELASTIC_MAPPING_PRESETS.largeText,
|
|
3025
|
-
// Capabilities
|
|
3026
|
-
capabilities: {
|
|
3027
|
-
hasPlainText: true,
|
|
3028
|
-
annotation: true,
|
|
3029
|
-
aiAnnotation: true,
|
|
3030
|
-
aiEnrichment: true,
|
|
3031
|
-
searchable: true,
|
|
3032
|
-
directDataImport: true,
|
|
3033
|
-
csvExport: true,
|
|
3034
|
-
translatable: true,
|
|
3035
|
-
documentSummarizer: true,
|
|
3036
|
-
stripFromMainOnAnnoChunkSync: true,
|
|
3037
|
-
excludeFromListingProjection: true
|
|
3038
|
-
},
|
|
3039
|
-
// Field paths
|
|
3040
|
-
fieldPaths: {
|
|
3041
|
-
plainTextString: "allText",
|
|
3042
|
-
searchField: "allText",
|
|
3043
|
-
displayValue: "allText"
|
|
3044
|
-
},
|
|
3045
|
-
// Validation
|
|
3046
|
-
validation: {
|
|
3047
|
-
populatedCheckFn: "lexicalTextEditorHasValue",
|
|
3048
|
-
formValidationFn: "lexicalTextEditorHasValue"
|
|
3049
|
-
},
|
|
3050
|
-
// Translation
|
|
3051
|
-
translation: {
|
|
3052
|
-
handlerType: "LexicalBlockHandler"
|
|
3053
|
-
},
|
|
3054
|
-
// Table rendering
|
|
3055
|
-
tableCell: {
|
|
3056
|
-
cellComp: "RichTextAsPlainTextLex",
|
|
3057
|
-
sortPathSuffix: "editorState.root.children.0.children.0.text"
|
|
3058
|
-
},
|
|
3059
|
-
// CSV export
|
|
3060
|
-
csvExport: {
|
|
3061
|
-
transformFn: "KPRichLexicalEditor"
|
|
3062
|
-
},
|
|
3063
|
-
// Slack
|
|
3064
|
-
slackFormat: {
|
|
3065
|
-
handlerFn: "lexicalRichText"
|
|
3066
|
-
},
|
|
3067
|
-
// Batch import
|
|
3068
|
-
batchImport: {
|
|
3069
|
-
valueInjectorFn: "toLexicalValue"
|
|
3070
|
-
},
|
|
3071
|
-
// Content block option — TCI template builder & direct import UI
|
|
3072
|
-
contentBlockOption: {
|
|
3073
|
-
display: "Rich Text Field",
|
|
3074
|
-
icon: "TextAa",
|
|
3075
|
-
directImportGroupsIdx: [2, 2]
|
|
3076
|
-
},
|
|
3077
|
-
// Chunking config — used by okf-sub CreateChunksHandler
|
|
3078
|
-
chunkingConfig: CHUNKING_PRESETS.lexicalSemantic
|
|
3079
|
-
};
|
|
3080
|
-
|
|
3081
|
-
// src/blockRegistry/registry.ts
|
|
3082
|
-
var BlockRegistry = class {
|
|
3083
|
-
constructor() {
|
|
3084
|
-
this.blocks = /* @__PURE__ */ new Map();
|
|
3085
|
-
this.register(LexicalTextEditor);
|
|
3086
|
-
}
|
|
3087
|
-
/** Register a block descriptor. */
|
|
3088
|
-
register(descriptor) {
|
|
3089
|
-
this.blocks.set(descriptor.compName, descriptor);
|
|
3090
|
-
}
|
|
3091
|
-
/** Get the full descriptor for a block type. Returns undefined if not registered. */
|
|
3092
|
-
getBlock(compType) {
|
|
3093
|
-
return this.blocks.get(compType);
|
|
3094
|
-
}
|
|
3095
|
-
/** Check if a block type is registered in the registry. */
|
|
3096
|
-
isRegistered(compType) {
|
|
3097
|
-
return this.blocks.has(compType);
|
|
3098
|
-
}
|
|
3099
|
-
/**
|
|
3100
|
-
* Get all registered block descriptors that have a given capability set to a truthy value.
|
|
3101
|
-
* Optionally pass a specific value to match (e.g. for enum-style capabilities).
|
|
3102
|
-
*/
|
|
3103
|
-
getBlocksByCapability(capability, value = true) {
|
|
3104
|
-
return Array.from(this.blocks.values()).filter((b) => {
|
|
3105
|
-
const cap = b.capabilities[capability];
|
|
3106
|
-
if (value === true) return !!cap;
|
|
3107
|
-
return cap === value;
|
|
3108
|
-
});
|
|
3109
|
-
}
|
|
3110
|
-
/**
|
|
3111
|
-
* Get compType strings for all registered blocks with a given capability.
|
|
3112
|
-
* Replaces scattered hardcoded arrays like:
|
|
3113
|
-
* const TEXT_FIELD_COMPONENTS = ["TextInput", "LexicalTextEditor", ...]
|
|
3114
|
-
* becomes:
|
|
3115
|
-
* const TEXT_FIELD_COMPONENTS = blockRegistry.getComps('aiTextExtraction')
|
|
3116
|
-
*/
|
|
3117
|
-
getComps(capability, value = true) {
|
|
3118
|
-
return this.getBlocksByCapability(capability, value).map((b) => b.compName);
|
|
3119
|
-
}
|
|
3120
|
-
/** Get all registered blocks in a given category. */
|
|
3121
|
-
getBlocksByCategory(category) {
|
|
3122
|
-
return Array.from(this.blocks.values()).filter((b) => b.category === category);
|
|
3123
|
-
}
|
|
3124
|
-
/** Get compType strings for all qual blocks. */
|
|
3125
|
-
getQualBlocks() {
|
|
3126
|
-
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "qual").map((b) => b.compName);
|
|
3127
|
-
}
|
|
3128
|
-
/** Get compType strings for all quant blocks. */
|
|
3129
|
-
getQuantBlocks() {
|
|
3130
|
-
return Array.from(this.blocks.values()).filter((b) => b.qualQuant === "quant").map((b) => b.compName);
|
|
3131
|
-
}
|
|
3132
|
-
/** Check if a specific block has a specific capability. */
|
|
3133
|
-
hasCapability(compType, capability) {
|
|
3134
|
-
const block = this.blocks.get(compType);
|
|
3135
|
-
if (!block) return false;
|
|
3136
|
-
return !!block.capabilities[capability];
|
|
3137
|
-
}
|
|
3138
|
-
/** Get all registered block descriptors. */
|
|
3139
|
-
getAll() {
|
|
3140
|
-
return Array.from(this.blocks.values());
|
|
3141
|
-
}
|
|
3142
|
-
/**
|
|
3143
|
-
* Get compName strings for all registered blocks that have a chunking config.
|
|
3144
|
-
* Used by chunking pipelines and prompt-string injection (e.g. searchChunks tool
|
|
3145
|
-
* description) to know which fields actually have chunks to search.
|
|
3146
|
-
*/
|
|
3147
|
-
getCompsWithChunking() {
|
|
3148
|
-
return Array.from(this.blocks.values()).filter((b) => !!b.chunkingConfig).map((b) => b.compName);
|
|
3149
|
-
}
|
|
3150
|
-
/**
|
|
3151
|
-
* Filter a list of block instances down to those where annotation is enabled.
|
|
3152
|
-
* A block is annotation-enabled if its registry capability `annotation` is true.
|
|
3153
|
-
* For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
|
|
3154
|
-
* falls back to the legacy per-instance `props.annotation.enable` toggle.
|
|
3155
|
-
*
|
|
3156
|
-
* Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
|
|
3157
|
-
*/
|
|
3158
|
-
getAnnotationEnabledBlocks(allBlocks) {
|
|
3159
|
-
return allBlocks.filter((block) => {
|
|
3160
|
-
const blockDef = this.blocks.get(block.comp);
|
|
3161
|
-
if (blockDef) return !!blockDef.capabilities.annotation;
|
|
3162
|
-
return block.props?.annotation?.enable === true;
|
|
3163
|
-
});
|
|
3164
|
-
}
|
|
3165
|
-
/**
|
|
3166
|
-
* Resolve the tagTypesConfig for a block instance.
|
|
3167
|
-
*
|
|
3168
|
-
* Resolution order:
|
|
3169
|
-
* 1. `hardCodedTagTypesConfigForSM` — the intended self-managed default, which takes
|
|
3170
|
-
* priority over per-instance values (justifies not persisting per-block on self-managed).
|
|
3171
|
-
* Sourced from `GET_SELF_MANAGED_BASE_CONFIGS().annotation_tagTypesConfig` on BE,
|
|
3172
|
-
* or `platformConfigs.SELF_MANAGED_BASE_CONFIGS.annotation_tagTypesConfig` on FE.
|
|
3173
|
-
* Pass null/undefined for non-SM tenants.
|
|
3174
|
-
* 2. `block.props.annotation.tagTypesConfig` — legacy per-instance persisted value.
|
|
3175
|
-
* 3. Empty array.
|
|
3176
|
-
*/
|
|
3177
|
-
getTagTypesConfig(block, hardCodedTagTypesConfigForSM) {
|
|
3178
|
-
return hardCodedTagTypesConfigForSM || block.props?.annotation?.tagTypesConfig || [];
|
|
3179
|
-
}
|
|
3180
|
-
};
|
|
3181
|
-
var blockRegistry = new BlockRegistry();
|
|
3182
|
-
|
|
3183
3192
|
// src/utils/autoGenFilterConfigsFromTpl/utils/extractAndOrganizeBlocks.ts
|
|
3184
3193
|
var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}) => {
|
|
3185
3194
|
const extractedBlocks = {};
|
|
@@ -4443,6 +4452,7 @@ export {
|
|
|
4443
4452
|
getRoutePathToTagCategoryLanding,
|
|
4444
4453
|
export_getTplModelByTenant as getTplModelByTenant,
|
|
4445
4454
|
getVal,
|
|
4455
|
+
isTplAnnotationEnabled,
|
|
4446
4456
|
mergeAnnoDataIntoAnnotationsTags,
|
|
4447
4457
|
parseSpecialConfigSyntax,
|
|
4448
4458
|
processAuthorAndCommonFilters,
|
package/dist/universal.d.mts
CHANGED
|
@@ -214,6 +214,14 @@ declare const _recursExtractBlocks: ({ data, cb, sectionStack, blockPathPrefix }
|
|
|
214
214
|
blockPathPrefix?: string;
|
|
215
215
|
}) => void;
|
|
216
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Returns true if annotation is enabled on this tpl. Two conditions must be met:
|
|
219
|
+
* 1. The tpl is in the publishing segment (annotation only makes sense for publishing).
|
|
220
|
+
* 2. At least one block on the tpl has the annotation capability in the registry
|
|
221
|
+
* (or legacy props.annotation.enable for unregistered blocks).
|
|
222
|
+
*/
|
|
223
|
+
declare const isTplAnnotationEnabled: (tpl: any) => boolean;
|
|
224
|
+
|
|
217
225
|
/**
|
|
218
226
|
* Calculates all possible rollup relationships for a tag type
|
|
219
227
|
*
|
|
@@ -1649,4 +1657,4 @@ declare class BlockRegistry {
|
|
|
1649
1657
|
/** Singleton instance — the one registry shared across the app. */
|
|
1650
1658
|
declare const blockRegistry: BlockRegistry;
|
|
1651
1659
|
|
|
1652
|
-
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, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
|
|
1660
|
+
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 };
|
package/dist/universal.d.ts
CHANGED
|
@@ -214,6 +214,14 @@ declare const _recursExtractBlocks: ({ data, cb, sectionStack, blockPathPrefix }
|
|
|
214
214
|
blockPathPrefix?: string;
|
|
215
215
|
}) => void;
|
|
216
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Returns true if annotation is enabled on this tpl. Two conditions must be met:
|
|
219
|
+
* 1. The tpl is in the publishing segment (annotation only makes sense for publishing).
|
|
220
|
+
* 2. At least one block on the tpl has the annotation capability in the registry
|
|
221
|
+
* (or legacy props.annotation.enable for unregistered blocks).
|
|
222
|
+
*/
|
|
223
|
+
declare const isTplAnnotationEnabled: (tpl: any) => boolean;
|
|
224
|
+
|
|
217
225
|
/**
|
|
218
226
|
* Calculates all possible rollup relationships for a tag type
|
|
219
227
|
*
|
|
@@ -1649,4 +1657,4 @@ declare class BlockRegistry {
|
|
|
1649
1657
|
/** Singleton instance — the one registry shared across the app. */
|
|
1650
1658
|
declare const blockRegistry: BlockRegistry;
|
|
1651
1659
|
|
|
1652
|
-
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, mergeAnnoDataIntoAnnotationsTags, parseSpecialConfigSyntax, processAuthorAndCommonFilters, _recursExtractBlocks as recursivelyExtractBlocks, segrigateDocs, setVal, toArray };
|
|
1660
|
+
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 };
|