@okf/ootils 1.36.0 → 1.36.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.
@@ -1185,6 +1185,10 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1185
1185
  source: {
1186
1186
  filterType: string;
1187
1187
  profileTypes: any[];
1188
+ pinnedOptions: {
1189
+ display: string;
1190
+ value: null;
1191
+ }[];
1188
1192
  options?: undefined;
1189
1193
  };
1190
1194
  target: {
@@ -1204,6 +1208,7 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1204
1208
  value: any;
1205
1209
  }[];
1206
1210
  profileTypes?: undefined;
1211
+ pinnedOptions?: undefined;
1207
1212
  };
1208
1213
  target: {
1209
1214
  filterType: string;
@@ -1470,6 +1475,10 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1470
1475
  source: {
1471
1476
  filterType: string;
1472
1477
  profileTypes: any[];
1478
+ pinnedOptions: {
1479
+ display: string;
1480
+ value: null;
1481
+ }[];
1473
1482
  options?: undefined;
1474
1483
  };
1475
1484
  target: {
@@ -1489,6 +1498,7 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1489
1498
  value: any;
1490
1499
  }[];
1491
1500
  profileTypes?: undefined;
1501
+ pinnedOptions?: undefined;
1492
1502
  };
1493
1503
  target: {
1494
1504
  filterType: string;
package/dist/browser.d.ts CHANGED
@@ -1185,6 +1185,10 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1185
1185
  source: {
1186
1186
  filterType: string;
1187
1187
  profileTypes: any[];
1188
+ pinnedOptions: {
1189
+ display: string;
1190
+ value: null;
1191
+ }[];
1188
1192
  options?: undefined;
1189
1193
  };
1190
1194
  target: {
@@ -1204,6 +1208,7 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1204
1208
  value: any;
1205
1209
  }[];
1206
1210
  profileTypes?: undefined;
1211
+ pinnedOptions?: undefined;
1207
1212
  };
1208
1213
  target: {
1209
1214
  filterType: string;
@@ -1470,6 +1475,10 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1470
1475
  source: {
1471
1476
  filterType: string;
1472
1477
  profileTypes: any[];
1478
+ pinnedOptions: {
1479
+ display: string;
1480
+ value: null;
1481
+ }[];
1473
1482
  options?: undefined;
1474
1483
  };
1475
1484
  target: {
@@ -1489,6 +1498,7 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1489
1498
  value: any;
1490
1499
  }[];
1491
1500
  profileTypes?: undefined;
1501
+ pinnedOptions?: undefined;
1492
1502
  };
1493
1503
  target: {
1494
1504
  filterType: string;
package/dist/browser.js CHANGED
@@ -2095,7 +2095,10 @@ var processAuthorAndCommonFilters = (allTpls, filterScopes, annoEnabledBlocks =
2095
2095
  }),
2096
2096
  source: {
2097
2097
  filterType: "usersType",
2098
- profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type)
2098
+ profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type),
2099
+ pinnedOptions: [
2100
+ { display: "AI", value: null }
2101
+ ]
2099
2102
  },
2100
2103
  target: {
2101
2104
  filterType: "valuePathType",
@@ -2359,6 +2362,9 @@ var sortFiltersHierarchically = (filters) => {
2359
2362
  };
2360
2363
 
2361
2364
  // src/utils/autoGenFilterConfigsFromTpl/utils/_self_managed_buildDocHierarchyConfig.ts
2365
+ var injectFilterOptionsBy = (filters) => filters.map(
2366
+ (f) => f.parentFilterId ? { ...f, source: { ...f.source, filterOptionsBy: { filterId: f.parentFilterId } } } : f
2367
+ );
2362
2368
  var _self_managed_buildDocHierarchyConfig = ({
2363
2369
  combinedDocumentBlocks,
2364
2370
  docRollupBlocks,
@@ -2371,27 +2377,11 @@ var _self_managed_buildDocHierarchyConfig = ({
2371
2377
  const commonGroup = allGroups.find(
2372
2378
  (g) => g.contentTypes.length === selectedTpls.length
2373
2379
  );
2374
- const commonFilterConfigs = commonGroup ? sortFiltersHierarchically(
2375
- attachParentFields(
2376
- buildFilterConfigurations({
2377
- groups: [commonGroup],
2378
- type: "tags",
2379
- selectedTpls,
2380
- allTpls,
2381
- isRollup: false,
2382
- isAnno: false
2383
- }).flatMap((s) => s.configs),
2384
- allTpls
2385
- )
2386
- ) : [];
2387
- const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
2388
- (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
2389
- ) : [];
2390
- const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
2391
- const groupFilterConfigs = sortFiltersHierarchically(
2380
+ const commonFilterConfigs = commonGroup ? injectFilterOptionsBy(
2381
+ sortFiltersHierarchically(
2392
2382
  attachParentFields(
2393
2383
  buildFilterConfigurations({
2394
- groups: [group],
2384
+ groups: [commonGroup],
2395
2385
  type: "tags",
2396
2386
  selectedTpls,
2397
2387
  allTpls,
@@ -2400,6 +2390,26 @@ var _self_managed_buildDocHierarchyConfig = ({
2400
2390
  }).flatMap((s) => s.configs),
2401
2391
  allTpls
2402
2392
  )
2393
+ )
2394
+ ) : [];
2395
+ const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
2396
+ (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
2397
+ ) : [];
2398
+ const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
2399
+ const groupFilterConfigs = injectFilterOptionsBy(
2400
+ sortFiltersHierarchically(
2401
+ attachParentFields(
2402
+ buildFilterConfigurations({
2403
+ groups: [group],
2404
+ type: "tags",
2405
+ selectedTpls,
2406
+ allTpls,
2407
+ isRollup: false,
2408
+ isAnno: false
2409
+ }).flatMap((s) => s.configs),
2410
+ allTpls
2411
+ )
2412
+ )
2403
2413
  );
2404
2414
  const display = group.contentTypes.map((ct) => {
2405
2415
  const tplData = allTpls.find(
@@ -2458,8 +2468,10 @@ var _self_managed_buildDocHierarchyConfig = ({
2458
2468
  (f) => !rollupSourceKeys.has(JSON.stringify(f.source))
2459
2469
  );
2460
2470
  const combined = [...dedupedFilters, ...rollupConfigs];
2461
- const combinedWithParents = sortFiltersHierarchically(
2462
- attachParentFields(combined, allTpls)
2471
+ const combinedWithParents = injectFilterOptionsBy(
2472
+ sortFiltersHierarchically(
2473
+ attachParentFields(combined, allTpls)
2474
+ )
2463
2475
  );
2464
2476
  const rollupFilterIds = new Set(rollupConfigs.map((r) => r.filterId));
2465
2477
  const filtersWithParents = combinedWithParents.filter(
package/dist/browser.mjs CHANGED
@@ -2026,7 +2026,10 @@ var processAuthorAndCommonFilters = (allTpls, filterScopes, annoEnabledBlocks =
2026
2026
  }),
2027
2027
  source: {
2028
2028
  filterType: "usersType",
2029
- profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type)
2029
+ profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type),
2030
+ pinnedOptions: [
2031
+ { display: "AI", value: null }
2032
+ ]
2030
2033
  },
2031
2034
  target: {
2032
2035
  filterType: "valuePathType",
@@ -2290,6 +2293,9 @@ var sortFiltersHierarchically = (filters) => {
2290
2293
  };
2291
2294
 
2292
2295
  // src/utils/autoGenFilterConfigsFromTpl/utils/_self_managed_buildDocHierarchyConfig.ts
2296
+ var injectFilterOptionsBy = (filters) => filters.map(
2297
+ (f) => f.parentFilterId ? { ...f, source: { ...f.source, filterOptionsBy: { filterId: f.parentFilterId } } } : f
2298
+ );
2293
2299
  var _self_managed_buildDocHierarchyConfig = ({
2294
2300
  combinedDocumentBlocks,
2295
2301
  docRollupBlocks,
@@ -2302,27 +2308,11 @@ var _self_managed_buildDocHierarchyConfig = ({
2302
2308
  const commonGroup = allGroups.find(
2303
2309
  (g) => g.contentTypes.length === selectedTpls.length
2304
2310
  );
2305
- const commonFilterConfigs = commonGroup ? sortFiltersHierarchically(
2306
- attachParentFields(
2307
- buildFilterConfigurations({
2308
- groups: [commonGroup],
2309
- type: "tags",
2310
- selectedTpls,
2311
- allTpls,
2312
- isRollup: false,
2313
- isAnno: false
2314
- }).flatMap((s) => s.configs),
2315
- allTpls
2316
- )
2317
- ) : [];
2318
- const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
2319
- (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
2320
- ) : [];
2321
- const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
2322
- const groupFilterConfigs = sortFiltersHierarchically(
2311
+ const commonFilterConfigs = commonGroup ? injectFilterOptionsBy(
2312
+ sortFiltersHierarchically(
2323
2313
  attachParentFields(
2324
2314
  buildFilterConfigurations({
2325
- groups: [group],
2315
+ groups: [commonGroup],
2326
2316
  type: "tags",
2327
2317
  selectedTpls,
2328
2318
  allTpls,
@@ -2331,6 +2321,26 @@ var _self_managed_buildDocHierarchyConfig = ({
2331
2321
  }).flatMap((s) => s.configs),
2332
2322
  allTpls
2333
2323
  )
2324
+ )
2325
+ ) : [];
2326
+ const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
2327
+ (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
2328
+ ) : [];
2329
+ const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
2330
+ const groupFilterConfigs = injectFilterOptionsBy(
2331
+ sortFiltersHierarchically(
2332
+ attachParentFields(
2333
+ buildFilterConfigurations({
2334
+ groups: [group],
2335
+ type: "tags",
2336
+ selectedTpls,
2337
+ allTpls,
2338
+ isRollup: false,
2339
+ isAnno: false
2340
+ }).flatMap((s) => s.configs),
2341
+ allTpls
2342
+ )
2343
+ )
2334
2344
  );
2335
2345
  const display = group.contentTypes.map((ct) => {
2336
2346
  const tplData = allTpls.find(
@@ -2389,8 +2399,10 @@ var _self_managed_buildDocHierarchyConfig = ({
2389
2399
  (f) => !rollupSourceKeys.has(JSON.stringify(f.source))
2390
2400
  );
2391
2401
  const combined = [...dedupedFilters, ...rollupConfigs];
2392
- const combinedWithParents = sortFiltersHierarchically(
2393
- attachParentFields(combined, allTpls)
2402
+ const combinedWithParents = injectFilterOptionsBy(
2403
+ sortFiltersHierarchically(
2404
+ attachParentFields(combined, allTpls)
2405
+ )
2394
2406
  );
2395
2407
  const rollupFilterIds = new Set(rollupConfigs.map((r) => r.filterId));
2396
2408
  const filtersWithParents = combinedWithParents.filter(
package/dist/node.d.mts CHANGED
@@ -1192,6 +1192,10 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1192
1192
  source: {
1193
1193
  filterType: string;
1194
1194
  profileTypes: any[];
1195
+ pinnedOptions: {
1196
+ display: string;
1197
+ value: null;
1198
+ }[];
1195
1199
  options?: undefined;
1196
1200
  };
1197
1201
  target: {
@@ -1211,6 +1215,7 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1211
1215
  value: any;
1212
1216
  }[];
1213
1217
  profileTypes?: undefined;
1218
+ pinnedOptions?: undefined;
1214
1219
  };
1215
1220
  target: {
1216
1221
  filterType: string;
@@ -1477,6 +1482,10 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1477
1482
  source: {
1478
1483
  filterType: string;
1479
1484
  profileTypes: any[];
1485
+ pinnedOptions: {
1486
+ display: string;
1487
+ value: null;
1488
+ }[];
1480
1489
  options?: undefined;
1481
1490
  };
1482
1491
  target: {
@@ -1496,6 +1505,7 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1496
1505
  value: any;
1497
1506
  }[];
1498
1507
  profileTypes?: undefined;
1508
+ pinnedOptions?: undefined;
1499
1509
  };
1500
1510
  target: {
1501
1511
  filterType: string;
package/dist/node.d.ts CHANGED
@@ -1192,6 +1192,10 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1192
1192
  source: {
1193
1193
  filterType: string;
1194
1194
  profileTypes: any[];
1195
+ pinnedOptions: {
1196
+ display: string;
1197
+ value: null;
1198
+ }[];
1195
1199
  options?: undefined;
1196
1200
  };
1197
1201
  target: {
@@ -1211,6 +1215,7 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1211
1215
  value: any;
1212
1216
  }[];
1213
1217
  profileTypes?: undefined;
1218
+ pinnedOptions?: undefined;
1214
1219
  };
1215
1220
  target: {
1216
1221
  filterType: string;
@@ -1477,6 +1482,10 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1477
1482
  source: {
1478
1483
  filterType: string;
1479
1484
  profileTypes: any[];
1485
+ pinnedOptions: {
1486
+ display: string;
1487
+ value: null;
1488
+ }[];
1480
1489
  options?: undefined;
1481
1490
  };
1482
1491
  target: {
@@ -1496,6 +1505,7 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1496
1505
  value: any;
1497
1506
  }[];
1498
1507
  profileTypes?: undefined;
1508
+ pinnedOptions?: undefined;
1499
1509
  };
1500
1510
  target: {
1501
1511
  filterType: string;
package/dist/node.js CHANGED
@@ -3701,7 +3701,10 @@ var processAuthorAndCommonFilters = (allTpls, filterScopes, annoEnabledBlocks =
3701
3701
  }),
3702
3702
  source: {
3703
3703
  filterType: "usersType",
3704
- profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type)
3704
+ profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type),
3705
+ pinnedOptions: [
3706
+ { display: "AI", value: null }
3707
+ ]
3705
3708
  },
3706
3709
  target: {
3707
3710
  filterType: "valuePathType",
@@ -3965,6 +3968,9 @@ var sortFiltersHierarchically = (filters) => {
3965
3968
  };
3966
3969
 
3967
3970
  // src/utils/autoGenFilterConfigsFromTpl/utils/_self_managed_buildDocHierarchyConfig.ts
3971
+ var injectFilterOptionsBy = (filters) => filters.map(
3972
+ (f) => f.parentFilterId ? { ...f, source: { ...f.source, filterOptionsBy: { filterId: f.parentFilterId } } } : f
3973
+ );
3968
3974
  var _self_managed_buildDocHierarchyConfig = ({
3969
3975
  combinedDocumentBlocks,
3970
3976
  docRollupBlocks,
@@ -3977,27 +3983,11 @@ var _self_managed_buildDocHierarchyConfig = ({
3977
3983
  const commonGroup = allGroups.find(
3978
3984
  (g) => g.contentTypes.length === selectedTpls.length
3979
3985
  );
3980
- const commonFilterConfigs = commonGroup ? sortFiltersHierarchically(
3981
- attachParentFields(
3982
- buildFilterConfigurations({
3983
- groups: [commonGroup],
3984
- type: "tags",
3985
- selectedTpls,
3986
- allTpls,
3987
- isRollup: false,
3988
- isAnno: false
3989
- }).flatMap((s) => s.configs),
3990
- allTpls
3991
- )
3992
- ) : [];
3993
- const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
3994
- (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
3995
- ) : [];
3996
- const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
3997
- const groupFilterConfigs = sortFiltersHierarchically(
3986
+ const commonFilterConfigs = commonGroup ? injectFilterOptionsBy(
3987
+ sortFiltersHierarchically(
3998
3988
  attachParentFields(
3999
3989
  buildFilterConfigurations({
4000
- groups: [group],
3990
+ groups: [commonGroup],
4001
3991
  type: "tags",
4002
3992
  selectedTpls,
4003
3993
  allTpls,
@@ -4006,6 +3996,26 @@ var _self_managed_buildDocHierarchyConfig = ({
4006
3996
  }).flatMap((s) => s.configs),
4007
3997
  allTpls
4008
3998
  )
3999
+ )
4000
+ ) : [];
4001
+ const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
4002
+ (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
4003
+ ) : [];
4004
+ const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
4005
+ const groupFilterConfigs = injectFilterOptionsBy(
4006
+ sortFiltersHierarchically(
4007
+ attachParentFields(
4008
+ buildFilterConfigurations({
4009
+ groups: [group],
4010
+ type: "tags",
4011
+ selectedTpls,
4012
+ allTpls,
4013
+ isRollup: false,
4014
+ isAnno: false
4015
+ }).flatMap((s) => s.configs),
4016
+ allTpls
4017
+ )
4018
+ )
4009
4019
  );
4010
4020
  const display = group.contentTypes.map((ct) => {
4011
4021
  const tplData = allTpls.find(
@@ -4064,8 +4074,10 @@ var _self_managed_buildDocHierarchyConfig = ({
4064
4074
  (f) => !rollupSourceKeys.has(JSON.stringify(f.source))
4065
4075
  );
4066
4076
  const combined = [...dedupedFilters, ...rollupConfigs];
4067
- const combinedWithParents = sortFiltersHierarchically(
4068
- attachParentFields(combined, allTpls)
4077
+ const combinedWithParents = injectFilterOptionsBy(
4078
+ sortFiltersHierarchically(
4079
+ attachParentFields(combined, allTpls)
4080
+ )
4069
4081
  );
4070
4082
  const rollupFilterIds = new Set(rollupConfigs.map((r) => r.filterId));
4071
4083
  const filtersWithParents = combinedWithParents.filter(
package/dist/node.mjs CHANGED
@@ -3631,7 +3631,10 @@ var processAuthorAndCommonFilters = (allTpls, filterScopes, annoEnabledBlocks =
3631
3631
  }),
3632
3632
  source: {
3633
3633
  filterType: "usersType",
3634
- profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type)
3634
+ profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type),
3635
+ pinnedOptions: [
3636
+ { display: "AI", value: null }
3637
+ ]
3635
3638
  },
3636
3639
  target: {
3637
3640
  filterType: "valuePathType",
@@ -3895,6 +3898,9 @@ var sortFiltersHierarchically = (filters) => {
3895
3898
  };
3896
3899
 
3897
3900
  // src/utils/autoGenFilterConfigsFromTpl/utils/_self_managed_buildDocHierarchyConfig.ts
3901
+ var injectFilterOptionsBy = (filters) => filters.map(
3902
+ (f) => f.parentFilterId ? { ...f, source: { ...f.source, filterOptionsBy: { filterId: f.parentFilterId } } } : f
3903
+ );
3898
3904
  var _self_managed_buildDocHierarchyConfig = ({
3899
3905
  combinedDocumentBlocks,
3900
3906
  docRollupBlocks,
@@ -3907,27 +3913,11 @@ var _self_managed_buildDocHierarchyConfig = ({
3907
3913
  const commonGroup = allGroups.find(
3908
3914
  (g) => g.contentTypes.length === selectedTpls.length
3909
3915
  );
3910
- const commonFilterConfigs = commonGroup ? sortFiltersHierarchically(
3911
- attachParentFields(
3912
- buildFilterConfigurations({
3913
- groups: [commonGroup],
3914
- type: "tags",
3915
- selectedTpls,
3916
- allTpls,
3917
- isRollup: false,
3918
- isAnno: false
3919
- }).flatMap((s) => s.configs),
3920
- allTpls
3921
- )
3922
- ) : [];
3923
- const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
3924
- (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
3925
- ) : [];
3926
- const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
3927
- const groupFilterConfigs = sortFiltersHierarchically(
3916
+ const commonFilterConfigs = commonGroup ? injectFilterOptionsBy(
3917
+ sortFiltersHierarchically(
3928
3918
  attachParentFields(
3929
3919
  buildFilterConfigurations({
3930
- groups: [group],
3920
+ groups: [commonGroup],
3931
3921
  type: "tags",
3932
3922
  selectedTpls,
3933
3923
  allTpls,
@@ -3936,6 +3926,26 @@ var _self_managed_buildDocHierarchyConfig = ({
3936
3926
  }).flatMap((s) => s.configs),
3937
3927
  allTpls
3938
3928
  )
3929
+ )
3930
+ ) : [];
3931
+ const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
3932
+ (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
3933
+ ) : [];
3934
+ const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
3935
+ const groupFilterConfigs = injectFilterOptionsBy(
3936
+ sortFiltersHierarchically(
3937
+ attachParentFields(
3938
+ buildFilterConfigurations({
3939
+ groups: [group],
3940
+ type: "tags",
3941
+ selectedTpls,
3942
+ allTpls,
3943
+ isRollup: false,
3944
+ isAnno: false
3945
+ }).flatMap((s) => s.configs),
3946
+ allTpls
3947
+ )
3948
+ )
3939
3949
  );
3940
3950
  const display = group.contentTypes.map((ct) => {
3941
3951
  const tplData = allTpls.find(
@@ -3994,8 +4004,10 @@ var _self_managed_buildDocHierarchyConfig = ({
3994
4004
  (f) => !rollupSourceKeys.has(JSON.stringify(f.source))
3995
4005
  );
3996
4006
  const combined = [...dedupedFilters, ...rollupConfigs];
3997
- const combinedWithParents = sortFiltersHierarchically(
3998
- attachParentFields(combined, allTpls)
4007
+ const combinedWithParents = injectFilterOptionsBy(
4008
+ sortFiltersHierarchically(
4009
+ attachParentFields(combined, allTpls)
4010
+ )
3999
4011
  );
4000
4012
  const rollupFilterIds = new Set(rollupConfigs.map((r) => r.filterId));
4001
4013
  const filtersWithParents = combinedWithParents.filter(
@@ -1185,6 +1185,10 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1185
1185
  source: {
1186
1186
  filterType: string;
1187
1187
  profileTypes: any[];
1188
+ pinnedOptions: {
1189
+ display: string;
1190
+ value: null;
1191
+ }[];
1188
1192
  options?: undefined;
1189
1193
  };
1190
1194
  target: {
@@ -1204,6 +1208,7 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1204
1208
  value: any;
1205
1209
  }[];
1206
1210
  profileTypes?: undefined;
1211
+ pinnedOptions?: undefined;
1207
1212
  };
1208
1213
  target: {
1209
1214
  filterType: string;
@@ -1470,6 +1475,10 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1470
1475
  source: {
1471
1476
  filterType: string;
1472
1477
  profileTypes: any[];
1478
+ pinnedOptions: {
1479
+ display: string;
1480
+ value: null;
1481
+ }[];
1473
1482
  options?: undefined;
1474
1483
  };
1475
1484
  target: {
@@ -1489,6 +1498,7 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1489
1498
  value: any;
1490
1499
  }[];
1491
1500
  profileTypes?: undefined;
1501
+ pinnedOptions?: undefined;
1492
1502
  };
1493
1503
  target: {
1494
1504
  filterType: string;
@@ -1185,6 +1185,10 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1185
1185
  source: {
1186
1186
  filterType: string;
1187
1187
  profileTypes: any[];
1188
+ pinnedOptions: {
1189
+ display: string;
1190
+ value: null;
1191
+ }[];
1188
1192
  options?: undefined;
1189
1193
  };
1190
1194
  target: {
@@ -1204,6 +1208,7 @@ declare const processAuthorAndCommonFilters: (allTpls: any[], filterScopes: stri
1204
1208
  value: any;
1205
1209
  }[];
1206
1210
  profileTypes?: undefined;
1211
+ pinnedOptions?: undefined;
1207
1212
  };
1208
1213
  target: {
1209
1214
  filterType: string;
@@ -1470,6 +1475,10 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1470
1475
  source: {
1471
1476
  filterType: string;
1472
1477
  profileTypes: any[];
1478
+ pinnedOptions: {
1479
+ display: string;
1480
+ value: null;
1481
+ }[];
1473
1482
  options?: undefined;
1474
1483
  };
1475
1484
  target: {
@@ -1489,6 +1498,7 @@ declare const autoGenFilterConfigsFromTpl: ({ selectedTpls, allTpls, filterScope
1489
1498
  value: any;
1490
1499
  }[];
1491
1500
  profileTypes?: undefined;
1501
+ pinnedOptions?: undefined;
1492
1502
  };
1493
1503
  target: {
1494
1504
  filterType: string;
package/dist/universal.js CHANGED
@@ -2095,7 +2095,10 @@ var processAuthorAndCommonFilters = (allTpls, filterScopes, annoEnabledBlocks =
2095
2095
  }),
2096
2096
  source: {
2097
2097
  filterType: "usersType",
2098
- profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type)
2098
+ profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type),
2099
+ pinnedOptions: [
2100
+ { display: "AI", value: null }
2101
+ ]
2099
2102
  },
2100
2103
  target: {
2101
2104
  filterType: "valuePathType",
@@ -2359,6 +2362,9 @@ var sortFiltersHierarchically = (filters) => {
2359
2362
  };
2360
2363
 
2361
2364
  // src/utils/autoGenFilterConfigsFromTpl/utils/_self_managed_buildDocHierarchyConfig.ts
2365
+ var injectFilterOptionsBy = (filters) => filters.map(
2366
+ (f) => f.parentFilterId ? { ...f, source: { ...f.source, filterOptionsBy: { filterId: f.parentFilterId } } } : f
2367
+ );
2362
2368
  var _self_managed_buildDocHierarchyConfig = ({
2363
2369
  combinedDocumentBlocks,
2364
2370
  docRollupBlocks,
@@ -2371,27 +2377,11 @@ var _self_managed_buildDocHierarchyConfig = ({
2371
2377
  const commonGroup = allGroups.find(
2372
2378
  (g) => g.contentTypes.length === selectedTpls.length
2373
2379
  );
2374
- const commonFilterConfigs = commonGroup ? sortFiltersHierarchically(
2375
- attachParentFields(
2376
- buildFilterConfigurations({
2377
- groups: [commonGroup],
2378
- type: "tags",
2379
- selectedTpls,
2380
- allTpls,
2381
- isRollup: false,
2382
- isAnno: false
2383
- }).flatMap((s) => s.configs),
2384
- allTpls
2385
- )
2386
- ) : [];
2387
- const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
2388
- (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
2389
- ) : [];
2390
- const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
2391
- const groupFilterConfigs = sortFiltersHierarchically(
2380
+ const commonFilterConfigs = commonGroup ? injectFilterOptionsBy(
2381
+ sortFiltersHierarchically(
2392
2382
  attachParentFields(
2393
2383
  buildFilterConfigurations({
2394
- groups: [group],
2384
+ groups: [commonGroup],
2395
2385
  type: "tags",
2396
2386
  selectedTpls,
2397
2387
  allTpls,
@@ -2400,6 +2390,26 @@ var _self_managed_buildDocHierarchyConfig = ({
2400
2390
  }).flatMap((s) => s.configs),
2401
2391
  allTpls
2402
2392
  )
2393
+ )
2394
+ ) : [];
2395
+ const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
2396
+ (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
2397
+ ) : [];
2398
+ const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
2399
+ const groupFilterConfigs = injectFilterOptionsBy(
2400
+ sortFiltersHierarchically(
2401
+ attachParentFields(
2402
+ buildFilterConfigurations({
2403
+ groups: [group],
2404
+ type: "tags",
2405
+ selectedTpls,
2406
+ allTpls,
2407
+ isRollup: false,
2408
+ isAnno: false
2409
+ }).flatMap((s) => s.configs),
2410
+ allTpls
2411
+ )
2412
+ )
2403
2413
  );
2404
2414
  const display = group.contentTypes.map((ct) => {
2405
2415
  const tplData = allTpls.find(
@@ -2458,8 +2468,10 @@ var _self_managed_buildDocHierarchyConfig = ({
2458
2468
  (f) => !rollupSourceKeys.has(JSON.stringify(f.source))
2459
2469
  );
2460
2470
  const combined = [...dedupedFilters, ...rollupConfigs];
2461
- const combinedWithParents = sortFiltersHierarchically(
2462
- attachParentFields(combined, allTpls)
2471
+ const combinedWithParents = injectFilterOptionsBy(
2472
+ sortFiltersHierarchically(
2473
+ attachParentFields(combined, allTpls)
2474
+ )
2463
2475
  );
2464
2476
  const rollupFilterIds = new Set(rollupConfigs.map((r) => r.filterId));
2465
2477
  const filtersWithParents = combinedWithParents.filter(
@@ -2026,7 +2026,10 @@ var processAuthorAndCommonFilters = (allTpls, filterScopes, annoEnabledBlocks =
2026
2026
  }),
2027
2027
  source: {
2028
2028
  filterType: "usersType",
2029
- profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type)
2029
+ profileTypes: allProfileTpls.map((tpl) => tpl.kp_content_type),
2030
+ pinnedOptions: [
2031
+ { display: "AI", value: null }
2032
+ ]
2030
2033
  },
2031
2034
  target: {
2032
2035
  filterType: "valuePathType",
@@ -2290,6 +2293,9 @@ var sortFiltersHierarchically = (filters) => {
2290
2293
  };
2291
2294
 
2292
2295
  // src/utils/autoGenFilterConfigsFromTpl/utils/_self_managed_buildDocHierarchyConfig.ts
2296
+ var injectFilterOptionsBy = (filters) => filters.map(
2297
+ (f) => f.parentFilterId ? { ...f, source: { ...f.source, filterOptionsBy: { filterId: f.parentFilterId } } } : f
2298
+ );
2293
2299
  var _self_managed_buildDocHierarchyConfig = ({
2294
2300
  combinedDocumentBlocks,
2295
2301
  docRollupBlocks,
@@ -2302,27 +2308,11 @@ var _self_managed_buildDocHierarchyConfig = ({
2302
2308
  const commonGroup = allGroups.find(
2303
2309
  (g) => g.contentTypes.length === selectedTpls.length
2304
2310
  );
2305
- const commonFilterConfigs = commonGroup ? sortFiltersHierarchically(
2306
- attachParentFields(
2307
- buildFilterConfigurations({
2308
- groups: [commonGroup],
2309
- type: "tags",
2310
- selectedTpls,
2311
- allTpls,
2312
- isRollup: false,
2313
- isAnno: false
2314
- }).flatMap((s) => s.configs),
2315
- allTpls
2316
- )
2317
- ) : [];
2318
- const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
2319
- (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
2320
- ) : [];
2321
- const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
2322
- const groupFilterConfigs = sortFiltersHierarchically(
2311
+ const commonFilterConfigs = commonGroup ? injectFilterOptionsBy(
2312
+ sortFiltersHierarchically(
2323
2313
  attachParentFields(
2324
2314
  buildFilterConfigurations({
2325
- groups: [group],
2315
+ groups: [commonGroup],
2326
2316
  type: "tags",
2327
2317
  selectedTpls,
2328
2318
  allTpls,
@@ -2331,6 +2321,26 @@ var _self_managed_buildDocHierarchyConfig = ({
2331
2321
  }).flatMap((s) => s.configs),
2332
2322
  allTpls
2333
2323
  )
2324
+ )
2325
+ ) : [];
2326
+ const multiDatasetGroups = selectedTpls.length >= 2 ? allGroups.filter(
2327
+ (g) => g.contentTypes.length > 1 && g.contentTypes.length < selectedTpls.length
2328
+ ) : [];
2329
+ const sharedAcrossMultiple = multiDatasetGroups.map((group) => {
2330
+ const groupFilterConfigs = injectFilterOptionsBy(
2331
+ sortFiltersHierarchically(
2332
+ attachParentFields(
2333
+ buildFilterConfigurations({
2334
+ groups: [group],
2335
+ type: "tags",
2336
+ selectedTpls,
2337
+ allTpls,
2338
+ isRollup: false,
2339
+ isAnno: false
2340
+ }).flatMap((s) => s.configs),
2341
+ allTpls
2342
+ )
2343
+ )
2334
2344
  );
2335
2345
  const display = group.contentTypes.map((ct) => {
2336
2346
  const tplData = allTpls.find(
@@ -2389,8 +2399,10 @@ var _self_managed_buildDocHierarchyConfig = ({
2389
2399
  (f) => !rollupSourceKeys.has(JSON.stringify(f.source))
2390
2400
  );
2391
2401
  const combined = [...dedupedFilters, ...rollupConfigs];
2392
- const combinedWithParents = sortFiltersHierarchically(
2393
- attachParentFields(combined, allTpls)
2402
+ const combinedWithParents = injectFilterOptionsBy(
2403
+ sortFiltersHierarchically(
2404
+ attachParentFields(combined, allTpls)
2405
+ )
2394
2406
  );
2395
2407
  const rollupFilterIds = new Set(rollupConfigs.map((r) => r.filterId));
2396
2408
  const filtersWithParents = combinedWithParents.filter(
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.36.0",
6
+ "version": "1.36.1",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",