@okf/ootils 1.46.0 → 1.47.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.
@@ -2005,8 +2005,39 @@ declare class BlockRegistry {
2005
2005
  comp: string;
2006
2006
  props?: any;
2007
2007
  }): boolean;
2008
- /** Check if a specific block has a specific capability. */
2009
- hasCapability(compType: string, capability: keyof BlockCapabilities): boolean;
2008
+ /**
2009
+ * Check if a specific block has a specific capability.
2010
+ *
2011
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
2012
+ * optional third arg to honour per-instance overrides — today the only one is
2013
+ * the annotation kill-switch: an annotation-capable block type returns `false`
2014
+ * for the `annotation` capability when the instance sets
2015
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
2016
+ * (and the no-instance form) fall through to the plain type-level check, so
2017
+ * existing 2-arg callers are unaffected.
2018
+ */
2019
+ hasCapability(compType: string, capability: keyof BlockCapabilities, block?: {
2020
+ props?: any;
2021
+ }): boolean;
2022
+ /**
2023
+ * Per-instance annotation kill-switch.
2024
+ *
2025
+ * A block type may be annotation-capable at the registry level (e.g.
2026
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
2027
+ * block instance can be opted out of annotation entirely by setting
2028
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
2029
+ * to stop annotation on any field, add that prop — no code change.
2030
+ *
2031
+ * The single home for this `props.annotations.disable` path (note: `annotations`
2032
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
2033
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
2034
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
2035
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
2036
+ * type-level `false` isn't enough on its own.
2037
+ */
2038
+ isAnnotationDisabledForBlock(block: {
2039
+ props?: any;
2040
+ }): boolean;
2010
2041
  /**
2011
2042
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
2012
2043
  * Useful for callers that need to know whether to query `valuePath.0` for existence
@@ -2028,7 +2059,15 @@ declare class BlockRegistry {
2028
2059
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
2029
2060
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
2030
2061
  *
2031
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
2062
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
2063
+ * `props.annotations.disable: true`, regardless of type-level capability. This
2064
+ * is the single, config-only way to turn off annotation for a specific field —
2065
+ * and because this method is the central gate used across every repo, the
2066
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
2067
+ * chunking/anno sync, filters).
2068
+ *
2069
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
2070
+ * auto-enabled unless explicitly disabled on the instance.
2032
2071
  */
2033
2072
  getAnnotationEnabledBlocks(allBlocks: Array<{
2034
2073
  comp: string;
package/dist/browser.d.ts CHANGED
@@ -2005,8 +2005,39 @@ declare class BlockRegistry {
2005
2005
  comp: string;
2006
2006
  props?: any;
2007
2007
  }): boolean;
2008
- /** Check if a specific block has a specific capability. */
2009
- hasCapability(compType: string, capability: keyof BlockCapabilities): boolean;
2008
+ /**
2009
+ * Check if a specific block has a specific capability.
2010
+ *
2011
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
2012
+ * optional third arg to honour per-instance overrides — today the only one is
2013
+ * the annotation kill-switch: an annotation-capable block type returns `false`
2014
+ * for the `annotation` capability when the instance sets
2015
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
2016
+ * (and the no-instance form) fall through to the plain type-level check, so
2017
+ * existing 2-arg callers are unaffected.
2018
+ */
2019
+ hasCapability(compType: string, capability: keyof BlockCapabilities, block?: {
2020
+ props?: any;
2021
+ }): boolean;
2022
+ /**
2023
+ * Per-instance annotation kill-switch.
2024
+ *
2025
+ * A block type may be annotation-capable at the registry level (e.g.
2026
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
2027
+ * block instance can be opted out of annotation entirely by setting
2028
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
2029
+ * to stop annotation on any field, add that prop — no code change.
2030
+ *
2031
+ * The single home for this `props.annotations.disable` path (note: `annotations`
2032
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
2033
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
2034
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
2035
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
2036
+ * type-level `false` isn't enough on its own.
2037
+ */
2038
+ isAnnotationDisabledForBlock(block: {
2039
+ props?: any;
2040
+ }): boolean;
2010
2041
  /**
2011
2042
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
2012
2043
  * Useful for callers that need to know whether to query `valuePath.0` for existence
@@ -2028,7 +2059,15 @@ declare class BlockRegistry {
2028
2059
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
2029
2060
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
2030
2061
  *
2031
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
2062
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
2063
+ * `props.annotations.disable: true`, regardless of type-level capability. This
2064
+ * is the single, config-only way to turn off annotation for a specific field —
2065
+ * and because this method is the central gate used across every repo, the
2066
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
2067
+ * chunking/anno sync, filters).
2068
+ *
2069
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
2070
+ * auto-enabled unless explicitly disabled on the instance.
2032
2071
  */
2033
2072
  getAnnotationEnabledBlocks(allBlocks: Array<{
2034
2073
  comp: string;
package/dist/browser.js CHANGED
@@ -625,11 +625,44 @@ var BlockRegistry = class {
625
625
  return value === cond.equals;
626
626
  });
627
627
  }
628
- /** Check if a specific block has a specific capability. */
629
- hasCapability(compType, capability) {
630
- const block = this.blocks.get(compType);
631
- if (!block) return false;
632
- return !!block.capabilities[capability];
628
+ /**
629
+ * Check if a specific block has a specific capability.
630
+ *
631
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
632
+ * optional third arg to honour per-instance overrides — today the only one is
633
+ * the annotation kill-switch: an annotation-capable block type returns `false`
634
+ * for the `annotation` capability when the instance sets
635
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
636
+ * (and the no-instance form) fall through to the plain type-level check, so
637
+ * existing 2-arg callers are unaffected.
638
+ */
639
+ hasCapability(compType, capability, block) {
640
+ const def = this.blocks.get(compType);
641
+ if (!def) return false;
642
+ if (!def.capabilities[capability]) return false;
643
+ if (capability === "annotation" && block && this.isAnnotationDisabledForBlock(block)) {
644
+ return false;
645
+ }
646
+ return true;
647
+ }
648
+ /**
649
+ * Per-instance annotation kill-switch.
650
+ *
651
+ * A block type may be annotation-capable at the registry level (e.g.
652
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
653
+ * block instance can be opted out of annotation entirely by setting
654
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
655
+ * to stop annotation on any field, add that prop — no code change.
656
+ *
657
+ * The single home for this `props.annotations.disable` path (note: `annotations`
658
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
659
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
660
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
661
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
662
+ * type-level `false` isn't enough on its own.
663
+ */
664
+ isAnnotationDisabledForBlock(block) {
665
+ return block?.props?.annotations?.disable === true;
633
666
  }
634
667
  /**
635
668
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
@@ -659,10 +692,19 @@ var BlockRegistry = class {
659
692
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
660
693
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
661
694
  *
662
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
695
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
696
+ * `props.annotations.disable: true`, regardless of type-level capability. This
697
+ * is the single, config-only way to turn off annotation for a specific field —
698
+ * and because this method is the central gate used across every repo, the
699
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
700
+ * chunking/anno sync, filters).
701
+ *
702
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
703
+ * auto-enabled unless explicitly disabled on the instance.
663
704
  */
664
705
  getAnnotationEnabledBlocks(allBlocks) {
665
706
  return allBlocks.filter((block) => {
707
+ if (this.isAnnotationDisabledForBlock(block)) return false;
666
708
  const blockDef = this.blocks.get(block.comp);
667
709
  if (blockDef) return !!blockDef.capabilities.annotation;
668
710
  return block.props?.annotation?.enable === true;
@@ -2637,6 +2679,9 @@ var _self_managed_buildDocHierarchyConfig = ({
2637
2679
  };
2638
2680
  }).filter((g) => g.filters.length > 0);
2639
2681
  const commonFilterIds = new Set(commonFilterConfigs.map((f) => f.filterId));
2682
+ const selectedContentTypes = new Set(
2683
+ selectedTpls.map((t) => t.kp_content_type)
2684
+ );
2640
2685
  const perDataset = selectedTpls.map((tpl) => {
2641
2686
  const tplBlocks = combinedDocumentBlocks.find(
2642
2687
  (b) => b.contentType === tpl.kp_content_type
@@ -2704,7 +2749,7 @@ var _self_managed_buildDocHierarchyConfig = ({
2704
2749
  }
2705
2750
  const childByParentId = {};
2706
2751
  for (const r of rollupsWithParents) {
2707
- if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType") {
2752
+ if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType" && !selectedContentTypes.has(r.source.tagType)) {
2708
2753
  childByParentId[r.parentFilterId] = r;
2709
2754
  }
2710
2755
  }
package/dist/browser.mjs CHANGED
@@ -553,11 +553,44 @@ var BlockRegistry = class {
553
553
  return value === cond.equals;
554
554
  });
555
555
  }
556
- /** Check if a specific block has a specific capability. */
557
- hasCapability(compType, capability) {
558
- const block = this.blocks.get(compType);
559
- if (!block) return false;
560
- return !!block.capabilities[capability];
556
+ /**
557
+ * Check if a specific block has a specific capability.
558
+ *
559
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
560
+ * optional third arg to honour per-instance overrides — today the only one is
561
+ * the annotation kill-switch: an annotation-capable block type returns `false`
562
+ * for the `annotation` capability when the instance sets
563
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
564
+ * (and the no-instance form) fall through to the plain type-level check, so
565
+ * existing 2-arg callers are unaffected.
566
+ */
567
+ hasCapability(compType, capability, block) {
568
+ const def = this.blocks.get(compType);
569
+ if (!def) return false;
570
+ if (!def.capabilities[capability]) return false;
571
+ if (capability === "annotation" && block && this.isAnnotationDisabledForBlock(block)) {
572
+ return false;
573
+ }
574
+ return true;
575
+ }
576
+ /**
577
+ * Per-instance annotation kill-switch.
578
+ *
579
+ * A block type may be annotation-capable at the registry level (e.g.
580
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
581
+ * block instance can be opted out of annotation entirely by setting
582
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
583
+ * to stop annotation on any field, add that prop — no code change.
584
+ *
585
+ * The single home for this `props.annotations.disable` path (note: `annotations`
586
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
587
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
588
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
589
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
590
+ * type-level `false` isn't enough on its own.
591
+ */
592
+ isAnnotationDisabledForBlock(block) {
593
+ return block?.props?.annotations?.disable === true;
561
594
  }
562
595
  /**
563
596
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
@@ -587,10 +620,19 @@ var BlockRegistry = class {
587
620
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
588
621
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
589
622
  *
590
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
623
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
624
+ * `props.annotations.disable: true`, regardless of type-level capability. This
625
+ * is the single, config-only way to turn off annotation for a specific field —
626
+ * and because this method is the central gate used across every repo, the
627
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
628
+ * chunking/anno sync, filters).
629
+ *
630
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
631
+ * auto-enabled unless explicitly disabled on the instance.
591
632
  */
592
633
  getAnnotationEnabledBlocks(allBlocks) {
593
634
  return allBlocks.filter((block) => {
635
+ if (this.isAnnotationDisabledForBlock(block)) return false;
594
636
  const blockDef = this.blocks.get(block.comp);
595
637
  if (blockDef) return !!blockDef.capabilities.annotation;
596
638
  return block.props?.annotation?.enable === true;
@@ -2565,6 +2607,9 @@ var _self_managed_buildDocHierarchyConfig = ({
2565
2607
  };
2566
2608
  }).filter((g) => g.filters.length > 0);
2567
2609
  const commonFilterIds = new Set(commonFilterConfigs.map((f) => f.filterId));
2610
+ const selectedContentTypes = new Set(
2611
+ selectedTpls.map((t) => t.kp_content_type)
2612
+ );
2568
2613
  const perDataset = selectedTpls.map((tpl) => {
2569
2614
  const tplBlocks = combinedDocumentBlocks.find(
2570
2615
  (b) => b.contentType === tpl.kp_content_type
@@ -2632,7 +2677,7 @@ var _self_managed_buildDocHierarchyConfig = ({
2632
2677
  }
2633
2678
  const childByParentId = {};
2634
2679
  for (const r of rollupsWithParents) {
2635
- if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType") {
2680
+ if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType" && !selectedContentTypes.has(r.source.tagType)) {
2636
2681
  childByParentId[r.parentFilterId] = r;
2637
2682
  }
2638
2683
  }
package/dist/node.d.mts CHANGED
@@ -2013,8 +2013,39 @@ declare class BlockRegistry {
2013
2013
  comp: string;
2014
2014
  props?: any;
2015
2015
  }): boolean;
2016
- /** Check if a specific block has a specific capability. */
2017
- hasCapability(compType: string, capability: keyof BlockCapabilities): boolean;
2016
+ /**
2017
+ * Check if a specific block has a specific capability.
2018
+ *
2019
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
2020
+ * optional third arg to honour per-instance overrides — today the only one is
2021
+ * the annotation kill-switch: an annotation-capable block type returns `false`
2022
+ * for the `annotation` capability when the instance sets
2023
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
2024
+ * (and the no-instance form) fall through to the plain type-level check, so
2025
+ * existing 2-arg callers are unaffected.
2026
+ */
2027
+ hasCapability(compType: string, capability: keyof BlockCapabilities, block?: {
2028
+ props?: any;
2029
+ }): boolean;
2030
+ /**
2031
+ * Per-instance annotation kill-switch.
2032
+ *
2033
+ * A block type may be annotation-capable at the registry level (e.g.
2034
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
2035
+ * block instance can be opted out of annotation entirely by setting
2036
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
2037
+ * to stop annotation on any field, add that prop — no code change.
2038
+ *
2039
+ * The single home for this `props.annotations.disable` path (note: `annotations`
2040
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
2041
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
2042
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
2043
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
2044
+ * type-level `false` isn't enough on its own.
2045
+ */
2046
+ isAnnotationDisabledForBlock(block: {
2047
+ props?: any;
2048
+ }): boolean;
2018
2049
  /**
2019
2050
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
2020
2051
  * Useful for callers that need to know whether to query `valuePath.0` for existence
@@ -2036,7 +2067,15 @@ declare class BlockRegistry {
2036
2067
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
2037
2068
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
2038
2069
  *
2039
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
2070
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
2071
+ * `props.annotations.disable: true`, regardless of type-level capability. This
2072
+ * is the single, config-only way to turn off annotation for a specific field —
2073
+ * and because this method is the central gate used across every repo, the
2074
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
2075
+ * chunking/anno sync, filters).
2076
+ *
2077
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
2078
+ * auto-enabled unless explicitly disabled on the instance.
2040
2079
  */
2041
2080
  getAnnotationEnabledBlocks(allBlocks: Array<{
2042
2081
  comp: string;
package/dist/node.d.ts CHANGED
@@ -2013,8 +2013,39 @@ declare class BlockRegistry {
2013
2013
  comp: string;
2014
2014
  props?: any;
2015
2015
  }): boolean;
2016
- /** Check if a specific block has a specific capability. */
2017
- hasCapability(compType: string, capability: keyof BlockCapabilities): boolean;
2016
+ /**
2017
+ * Check if a specific block has a specific capability.
2018
+ *
2019
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
2020
+ * optional third arg to honour per-instance overrides — today the only one is
2021
+ * the annotation kill-switch: an annotation-capable block type returns `false`
2022
+ * for the `annotation` capability when the instance sets
2023
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
2024
+ * (and the no-instance form) fall through to the plain type-level check, so
2025
+ * existing 2-arg callers are unaffected.
2026
+ */
2027
+ hasCapability(compType: string, capability: keyof BlockCapabilities, block?: {
2028
+ props?: any;
2029
+ }): boolean;
2030
+ /**
2031
+ * Per-instance annotation kill-switch.
2032
+ *
2033
+ * A block type may be annotation-capable at the registry level (e.g.
2034
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
2035
+ * block instance can be opted out of annotation entirely by setting
2036
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
2037
+ * to stop annotation on any field, add that prop — no code change.
2038
+ *
2039
+ * The single home for this `props.annotations.disable` path (note: `annotations`
2040
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
2041
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
2042
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
2043
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
2044
+ * type-level `false` isn't enough on its own.
2045
+ */
2046
+ isAnnotationDisabledForBlock(block: {
2047
+ props?: any;
2048
+ }): boolean;
2018
2049
  /**
2019
2050
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
2020
2051
  * Useful for callers that need to know whether to query `valuePath.0` for existence
@@ -2036,7 +2067,15 @@ declare class BlockRegistry {
2036
2067
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
2037
2068
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
2038
2069
  *
2039
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
2070
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
2071
+ * `props.annotations.disable: true`, regardless of type-level capability. This
2072
+ * is the single, config-only way to turn off annotation for a specific field —
2073
+ * and because this method is the central gate used across every repo, the
2074
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
2075
+ * chunking/anno sync, filters).
2076
+ *
2077
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
2078
+ * auto-enabled unless explicitly disabled on the instance.
2040
2079
  */
2041
2080
  getAnnotationEnabledBlocks(allBlocks: Array<{
2042
2081
  comp: string;
package/dist/node.js CHANGED
@@ -3063,11 +3063,44 @@ var BlockRegistry = class {
3063
3063
  return value === cond.equals;
3064
3064
  });
3065
3065
  }
3066
- /** Check if a specific block has a specific capability. */
3067
- hasCapability(compType, capability) {
3068
- const block = this.blocks.get(compType);
3069
- if (!block) return false;
3070
- return !!block.capabilities[capability];
3066
+ /**
3067
+ * Check if a specific block has a specific capability.
3068
+ *
3069
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
3070
+ * optional third arg to honour per-instance overrides — today the only one is
3071
+ * the annotation kill-switch: an annotation-capable block type returns `false`
3072
+ * for the `annotation` capability when the instance sets
3073
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
3074
+ * (and the no-instance form) fall through to the plain type-level check, so
3075
+ * existing 2-arg callers are unaffected.
3076
+ */
3077
+ hasCapability(compType, capability, block) {
3078
+ const def = this.blocks.get(compType);
3079
+ if (!def) return false;
3080
+ if (!def.capabilities[capability]) return false;
3081
+ if (capability === "annotation" && block && this.isAnnotationDisabledForBlock(block)) {
3082
+ return false;
3083
+ }
3084
+ return true;
3085
+ }
3086
+ /**
3087
+ * Per-instance annotation kill-switch.
3088
+ *
3089
+ * A block type may be annotation-capable at the registry level (e.g.
3090
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
3091
+ * block instance can be opted out of annotation entirely by setting
3092
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
3093
+ * to stop annotation on any field, add that prop — no code change.
3094
+ *
3095
+ * The single home for this `props.annotations.disable` path (note: `annotations`
3096
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
3097
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
3098
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
3099
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
3100
+ * type-level `false` isn't enough on its own.
3101
+ */
3102
+ isAnnotationDisabledForBlock(block) {
3103
+ return block?.props?.annotations?.disable === true;
3071
3104
  }
3072
3105
  /**
3073
3106
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
@@ -3097,10 +3130,19 @@ var BlockRegistry = class {
3097
3130
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
3098
3131
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
3099
3132
  *
3100
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
3133
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
3134
+ * `props.annotations.disable: true`, regardless of type-level capability. This
3135
+ * is the single, config-only way to turn off annotation for a specific field —
3136
+ * and because this method is the central gate used across every repo, the
3137
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
3138
+ * chunking/anno sync, filters).
3139
+ *
3140
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
3141
+ * auto-enabled unless explicitly disabled on the instance.
3101
3142
  */
3102
3143
  getAnnotationEnabledBlocks(allBlocks) {
3103
3144
  return allBlocks.filter((block) => {
3145
+ if (this.isAnnotationDisabledForBlock(block)) return false;
3104
3146
  const blockDef = this.blocks.get(block.comp);
3105
3147
  if (blockDef) return !!blockDef.capabilities.annotation;
3106
3148
  return block.props?.annotation?.enable === true;
@@ -4480,6 +4522,9 @@ var _self_managed_buildDocHierarchyConfig = ({
4480
4522
  };
4481
4523
  }).filter((g) => g.filters.length > 0);
4482
4524
  const commonFilterIds = new Set(commonFilterConfigs.map((f) => f.filterId));
4525
+ const selectedContentTypes = new Set(
4526
+ selectedTpls.map((t) => t.kp_content_type)
4527
+ );
4483
4528
  const perDataset = selectedTpls.map((tpl) => {
4484
4529
  const tplBlocks = combinedDocumentBlocks.find(
4485
4530
  (b) => b.contentType === tpl.kp_content_type
@@ -4547,7 +4592,7 @@ var _self_managed_buildDocHierarchyConfig = ({
4547
4592
  }
4548
4593
  const childByParentId = {};
4549
4594
  for (const r of rollupsWithParents) {
4550
- if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType") {
4595
+ if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType" && !selectedContentTypes.has(r.source.tagType)) {
4551
4596
  childByParentId[r.parentFilterId] = r;
4552
4597
  }
4553
4598
  }
package/dist/node.mjs CHANGED
@@ -2971,11 +2971,44 @@ var BlockRegistry = class {
2971
2971
  return value === cond.equals;
2972
2972
  });
2973
2973
  }
2974
- /** Check if a specific block has a specific capability. */
2975
- hasCapability(compType, capability) {
2976
- const block = this.blocks.get(compType);
2977
- if (!block) return false;
2978
- return !!block.capabilities[capability];
2974
+ /**
2975
+ * Check if a specific block has a specific capability.
2976
+ *
2977
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
2978
+ * optional third arg to honour per-instance overrides — today the only one is
2979
+ * the annotation kill-switch: an annotation-capable block type returns `false`
2980
+ * for the `annotation` capability when the instance sets
2981
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
2982
+ * (and the no-instance form) fall through to the plain type-level check, so
2983
+ * existing 2-arg callers are unaffected.
2984
+ */
2985
+ hasCapability(compType, capability, block) {
2986
+ const def = this.blocks.get(compType);
2987
+ if (!def) return false;
2988
+ if (!def.capabilities[capability]) return false;
2989
+ if (capability === "annotation" && block && this.isAnnotationDisabledForBlock(block)) {
2990
+ return false;
2991
+ }
2992
+ return true;
2993
+ }
2994
+ /**
2995
+ * Per-instance annotation kill-switch.
2996
+ *
2997
+ * A block type may be annotation-capable at the registry level (e.g.
2998
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
2999
+ * block instance can be opted out of annotation entirely by setting
3000
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
3001
+ * to stop annotation on any field, add that prop — no code change.
3002
+ *
3003
+ * The single home for this `props.annotations.disable` path (note: `annotations`
3004
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
3005
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
3006
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
3007
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
3008
+ * type-level `false` isn't enough on its own.
3009
+ */
3010
+ isAnnotationDisabledForBlock(block) {
3011
+ return block?.props?.annotations?.disable === true;
2979
3012
  }
2980
3013
  /**
2981
3014
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
@@ -3005,10 +3038,19 @@ var BlockRegistry = class {
3005
3038
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
3006
3039
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
3007
3040
  *
3008
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
3041
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
3042
+ * `props.annotations.disable: true`, regardless of type-level capability. This
3043
+ * is the single, config-only way to turn off annotation for a specific field —
3044
+ * and because this method is the central gate used across every repo, the
3045
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
3046
+ * chunking/anno sync, filters).
3047
+ *
3048
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
3049
+ * auto-enabled unless explicitly disabled on the instance.
3009
3050
  */
3010
3051
  getAnnotationEnabledBlocks(allBlocks) {
3011
3052
  return allBlocks.filter((block) => {
3053
+ if (this.isAnnotationDisabledForBlock(block)) return false;
3012
3054
  const blockDef = this.blocks.get(block.comp);
3013
3055
  if (blockDef) return !!blockDef.capabilities.annotation;
3014
3056
  return block.props?.annotation?.enable === true;
@@ -4388,6 +4430,9 @@ var _self_managed_buildDocHierarchyConfig = ({
4388
4430
  };
4389
4431
  }).filter((g) => g.filters.length > 0);
4390
4432
  const commonFilterIds = new Set(commonFilterConfigs.map((f) => f.filterId));
4433
+ const selectedContentTypes = new Set(
4434
+ selectedTpls.map((t) => t.kp_content_type)
4435
+ );
4391
4436
  const perDataset = selectedTpls.map((tpl) => {
4392
4437
  const tplBlocks = combinedDocumentBlocks.find(
4393
4438
  (b) => b.contentType === tpl.kp_content_type
@@ -4455,7 +4500,7 @@ var _self_managed_buildDocHierarchyConfig = ({
4455
4500
  }
4456
4501
  const childByParentId = {};
4457
4502
  for (const r of rollupsWithParents) {
4458
- if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType") {
4503
+ if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType" && !selectedContentTypes.has(r.source.tagType)) {
4459
4504
  childByParentId[r.parentFilterId] = r;
4460
4505
  }
4461
4506
  }
@@ -2005,8 +2005,39 @@ declare class BlockRegistry {
2005
2005
  comp: string;
2006
2006
  props?: any;
2007
2007
  }): boolean;
2008
- /** Check if a specific block has a specific capability. */
2009
- hasCapability(compType: string, capability: keyof BlockCapabilities): boolean;
2008
+ /**
2009
+ * Check if a specific block has a specific capability.
2010
+ *
2011
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
2012
+ * optional third arg to honour per-instance overrides — today the only one is
2013
+ * the annotation kill-switch: an annotation-capable block type returns `false`
2014
+ * for the `annotation` capability when the instance sets
2015
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
2016
+ * (and the no-instance form) fall through to the plain type-level check, so
2017
+ * existing 2-arg callers are unaffected.
2018
+ */
2019
+ hasCapability(compType: string, capability: keyof BlockCapabilities, block?: {
2020
+ props?: any;
2021
+ }): boolean;
2022
+ /**
2023
+ * Per-instance annotation kill-switch.
2024
+ *
2025
+ * A block type may be annotation-capable at the registry level (e.g.
2026
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
2027
+ * block instance can be opted out of annotation entirely by setting
2028
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
2029
+ * to stop annotation on any field, add that prop — no code change.
2030
+ *
2031
+ * The single home for this `props.annotations.disable` path (note: `annotations`
2032
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
2033
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
2034
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
2035
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
2036
+ * type-level `false` isn't enough on its own.
2037
+ */
2038
+ isAnnotationDisabledForBlock(block: {
2039
+ props?: any;
2040
+ }): boolean;
2010
2041
  /**
2011
2042
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
2012
2043
  * Useful for callers that need to know whether to query `valuePath.0` for existence
@@ -2028,7 +2059,15 @@ declare class BlockRegistry {
2028
2059
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
2029
2060
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
2030
2061
  *
2031
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
2062
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
2063
+ * `props.annotations.disable: true`, regardless of type-level capability. This
2064
+ * is the single, config-only way to turn off annotation for a specific field —
2065
+ * and because this method is the central gate used across every repo, the
2066
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
2067
+ * chunking/anno sync, filters).
2068
+ *
2069
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
2070
+ * auto-enabled unless explicitly disabled on the instance.
2032
2071
  */
2033
2072
  getAnnotationEnabledBlocks(allBlocks: Array<{
2034
2073
  comp: string;
@@ -2005,8 +2005,39 @@ declare class BlockRegistry {
2005
2005
  comp: string;
2006
2006
  props?: any;
2007
2007
  }): boolean;
2008
- /** Check if a specific block has a specific capability. */
2009
- hasCapability(compType: string, capability: keyof BlockCapabilities): boolean;
2008
+ /**
2009
+ * Check if a specific block has a specific capability.
2010
+ *
2011
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
2012
+ * optional third arg to honour per-instance overrides — today the only one is
2013
+ * the annotation kill-switch: an annotation-capable block type returns `false`
2014
+ * for the `annotation` capability when the instance sets
2015
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
2016
+ * (and the no-instance form) fall through to the plain type-level check, so
2017
+ * existing 2-arg callers are unaffected.
2018
+ */
2019
+ hasCapability(compType: string, capability: keyof BlockCapabilities, block?: {
2020
+ props?: any;
2021
+ }): boolean;
2022
+ /**
2023
+ * Per-instance annotation kill-switch.
2024
+ *
2025
+ * A block type may be annotation-capable at the registry level (e.g.
2026
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
2027
+ * block instance can be opted out of annotation entirely by setting
2028
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
2029
+ * to stop annotation on any field, add that prop — no code change.
2030
+ *
2031
+ * The single home for this `props.annotations.disable` path (note: `annotations`
2032
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
2033
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
2034
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
2035
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
2036
+ * type-level `false` isn't enough on its own.
2037
+ */
2038
+ isAnnotationDisabledForBlock(block: {
2039
+ props?: any;
2040
+ }): boolean;
2010
2041
  /**
2011
2042
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
2012
2043
  * Useful for callers that need to know whether to query `valuePath.0` for existence
@@ -2028,7 +2059,15 @@ declare class BlockRegistry {
2028
2059
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
2029
2060
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
2030
2061
  *
2031
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
2062
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
2063
+ * `props.annotations.disable: true`, regardless of type-level capability. This
2064
+ * is the single, config-only way to turn off annotation for a specific field —
2065
+ * and because this method is the central gate used across every repo, the
2066
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
2067
+ * chunking/anno sync, filters).
2068
+ *
2069
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
2070
+ * auto-enabled unless explicitly disabled on the instance.
2032
2071
  */
2033
2072
  getAnnotationEnabledBlocks(allBlocks: Array<{
2034
2073
  comp: string;
package/dist/universal.js CHANGED
@@ -625,11 +625,44 @@ var BlockRegistry = class {
625
625
  return value === cond.equals;
626
626
  });
627
627
  }
628
- /** Check if a specific block has a specific capability. */
629
- hasCapability(compType, capability) {
630
- const block = this.blocks.get(compType);
631
- if (!block) return false;
632
- return !!block.capabilities[capability];
628
+ /**
629
+ * Check if a specific block has a specific capability.
630
+ *
631
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
632
+ * optional third arg to honour per-instance overrides — today the only one is
633
+ * the annotation kill-switch: an annotation-capable block type returns `false`
634
+ * for the `annotation` capability when the instance sets
635
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
636
+ * (and the no-instance form) fall through to the plain type-level check, so
637
+ * existing 2-arg callers are unaffected.
638
+ */
639
+ hasCapability(compType, capability, block) {
640
+ const def = this.blocks.get(compType);
641
+ if (!def) return false;
642
+ if (!def.capabilities[capability]) return false;
643
+ if (capability === "annotation" && block && this.isAnnotationDisabledForBlock(block)) {
644
+ return false;
645
+ }
646
+ return true;
647
+ }
648
+ /**
649
+ * Per-instance annotation kill-switch.
650
+ *
651
+ * A block type may be annotation-capable at the registry level (e.g.
652
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
653
+ * block instance can be opted out of annotation entirely by setting
654
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
655
+ * to stop annotation on any field, add that prop — no code change.
656
+ *
657
+ * The single home for this `props.annotations.disable` path (note: `annotations`
658
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
659
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
660
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
661
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
662
+ * type-level `false` isn't enough on its own.
663
+ */
664
+ isAnnotationDisabledForBlock(block) {
665
+ return block?.props?.annotations?.disable === true;
633
666
  }
634
667
  /**
635
668
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
@@ -659,10 +692,19 @@ var BlockRegistry = class {
659
692
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
660
693
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
661
694
  *
662
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
695
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
696
+ * `props.annotations.disable: true`, regardless of type-level capability. This
697
+ * is the single, config-only way to turn off annotation for a specific field —
698
+ * and because this method is the central gate used across every repo, the
699
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
700
+ * chunking/anno sync, filters).
701
+ *
702
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
703
+ * auto-enabled unless explicitly disabled on the instance.
663
704
  */
664
705
  getAnnotationEnabledBlocks(allBlocks) {
665
706
  return allBlocks.filter((block) => {
707
+ if (this.isAnnotationDisabledForBlock(block)) return false;
666
708
  const blockDef = this.blocks.get(block.comp);
667
709
  if (blockDef) return !!blockDef.capabilities.annotation;
668
710
  return block.props?.annotation?.enable === true;
@@ -2637,6 +2679,9 @@ var _self_managed_buildDocHierarchyConfig = ({
2637
2679
  };
2638
2680
  }).filter((g) => g.filters.length > 0);
2639
2681
  const commonFilterIds = new Set(commonFilterConfigs.map((f) => f.filterId));
2682
+ const selectedContentTypes = new Set(
2683
+ selectedTpls.map((t) => t.kp_content_type)
2684
+ );
2640
2685
  const perDataset = selectedTpls.map((tpl) => {
2641
2686
  const tplBlocks = combinedDocumentBlocks.find(
2642
2687
  (b) => b.contentType === tpl.kp_content_type
@@ -2704,7 +2749,7 @@ var _self_managed_buildDocHierarchyConfig = ({
2704
2749
  }
2705
2750
  const childByParentId = {};
2706
2751
  for (const r of rollupsWithParents) {
2707
- if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType") {
2752
+ if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType" && !selectedContentTypes.has(r.source.tagType)) {
2708
2753
  childByParentId[r.parentFilterId] = r;
2709
2754
  }
2710
2755
  }
@@ -553,11 +553,44 @@ var BlockRegistry = class {
553
553
  return value === cond.equals;
554
554
  });
555
555
  }
556
- /** Check if a specific block has a specific capability. */
557
- hasCapability(compType, capability) {
558
- const block = this.blocks.get(compType);
559
- if (!block) return false;
560
- return !!block.capabilities[capability];
556
+ /**
557
+ * Check if a specific block has a specific capability.
558
+ *
559
+ * Type-level by default (keyed off `compType`). Pass the block INSTANCE as the
560
+ * optional third arg to honour per-instance overrides — today the only one is
561
+ * the annotation kill-switch: an annotation-capable block type returns `false`
562
+ * for the `annotation` capability when the instance sets
563
+ * `props.annotations.disable: true` in its tpl config. All other capabilities
564
+ * (and the no-instance form) fall through to the plain type-level check, so
565
+ * existing 2-arg callers are unaffected.
566
+ */
567
+ hasCapability(compType, capability, block) {
568
+ const def = this.blocks.get(compType);
569
+ if (!def) return false;
570
+ if (!def.capabilities[capability]) return false;
571
+ if (capability === "annotation" && block && this.isAnnotationDisabledForBlock(block)) {
572
+ return false;
573
+ }
574
+ return true;
575
+ }
576
+ /**
577
+ * Per-instance annotation kill-switch.
578
+ *
579
+ * A block type may be annotation-capable at the registry level (e.g.
580
+ * LexicalTextEditor has `capabilities.annotation === true`), but an individual
581
+ * block instance can be opted out of annotation entirely by setting
582
+ * `props.annotations.disable: true` in its tpl config. Generic and config-only:
583
+ * to stop annotation on any field, add that prop — no code change.
584
+ *
585
+ * The single home for this `props.annotations.disable` path (note: `annotations`
586
+ * plural, distinct from the legacy singular `annotation.enable`). Consumed
587
+ * internally by `hasCapability` and `getAnnotationEnabledBlocks`, and directly
588
+ * by consumers that must actively suppress annotation UI (e.g. the FE block
589
+ * generators forcing disableViewHighlights/disableCreateHighlights), where a
590
+ * type-level `false` isn't enough on its own.
591
+ */
592
+ isAnnotationDisabledForBlock(block) {
593
+ return block?.props?.annotations?.disable === true;
561
594
  }
562
595
  /**
563
596
  * Returns true if the block stores its value as an array (Mongo schema type is Array).
@@ -587,10 +620,19 @@ var BlockRegistry = class {
587
620
  * For backwards compat with un-migrated blocks (e.g. deprecated KPRichInput/RichTextEditor),
588
621
  * falls back to the legacy per-instance `props.annotation.enable` toggle.
589
622
  *
590
- * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is auto-enabled.
623
+ * Per-instance kill-switch: any block is excluded when its tpl config sets
624
+ * `props.annotations.disable: true`, regardless of type-level capability. This
625
+ * is the single, config-only way to turn off annotation for a specific field —
626
+ * and because this method is the central gate used across every repo, the
627
+ * switch applies everywhere (annotate UI, AI auto-annotation, explorer,
628
+ * chunking/anno sync, filters).
629
+ *
630
+ * Today: every registered annotation-capable block (e.g. LexicalTextEditor) is
631
+ * auto-enabled unless explicitly disabled on the instance.
591
632
  */
592
633
  getAnnotationEnabledBlocks(allBlocks) {
593
634
  return allBlocks.filter((block) => {
635
+ if (this.isAnnotationDisabledForBlock(block)) return false;
594
636
  const blockDef = this.blocks.get(block.comp);
595
637
  if (blockDef) return !!blockDef.capabilities.annotation;
596
638
  return block.props?.annotation?.enable === true;
@@ -2565,6 +2607,9 @@ var _self_managed_buildDocHierarchyConfig = ({
2565
2607
  };
2566
2608
  }).filter((g) => g.filters.length > 0);
2567
2609
  const commonFilterIds = new Set(commonFilterConfigs.map((f) => f.filterId));
2610
+ const selectedContentTypes = new Set(
2611
+ selectedTpls.map((t) => t.kp_content_type)
2612
+ );
2568
2613
  const perDataset = selectedTpls.map((tpl) => {
2569
2614
  const tplBlocks = combinedDocumentBlocks.find(
2570
2615
  (b) => b.contentType === tpl.kp_content_type
@@ -2632,7 +2677,7 @@ var _self_managed_buildDocHierarchyConfig = ({
2632
2677
  }
2633
2678
  const childByParentId = {};
2634
2679
  for (const r of rollupsWithParents) {
2635
- if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType") {
2680
+ if (r.parentFilterId && r.isTagRollup && r.source?.filterType === "tagType" && !selectedContentTypes.has(r.source.tagType)) {
2636
2681
  childByParentId[r.parentFilterId] = r;
2637
2682
  }
2638
2683
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.46.0",
6
+ "version": "1.47.1",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",