@okf/ootils 1.31.4 → 1.31.5

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.js CHANGED
@@ -1669,7 +1669,9 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1669
1669
  }
1670
1670
  return templateBlocksCache.get(tpl.kp_content_type);
1671
1671
  };
1672
+ const isPublishingTpl = (tpl) => tpl?.general?.segment === "publishing";
1672
1673
  extractedBlocks.annoTagBlocks = selectedTpls.map((tpl) => {
1674
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1673
1675
  const allBlocks = getCachedBlocks(tpl);
1674
1676
  const allTagTypes = blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig).map((d) => d.tagType));
1675
1677
  const uniqueTagTypes = [...new Set(allTagTypes)];
@@ -1682,6 +1684,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1682
1684
  };
1683
1685
  });
1684
1686
  extractedBlocks.annoEnabledBlocks = selectedTpls.map((tpl) => {
1687
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1685
1688
  const allBlocks = getCachedBlocks(tpl);
1686
1689
  return {
1687
1690
  contentType: tpl.kp_content_type,
@@ -1689,6 +1692,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1689
1692
  };
1690
1693
  });
1691
1694
  extractedBlocks.annoRollupBlocks = selectedTpls.map((tpl) => {
1695
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1692
1696
  const allBlocks = getCachedBlocks(tpl);
1693
1697
  const uniqueTagTypes = Array.from(new Set(
1694
1698
  blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig)).map((conf) => conf.tagType)
package/dist/browser.mjs CHANGED
@@ -1602,7 +1602,9 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1602
1602
  }
1603
1603
  return templateBlocksCache.get(tpl.kp_content_type);
1604
1604
  };
1605
+ const isPublishingTpl = (tpl) => tpl?.general?.segment === "publishing";
1605
1606
  extractedBlocks.annoTagBlocks = selectedTpls.map((tpl) => {
1607
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1606
1608
  const allBlocks = getCachedBlocks(tpl);
1607
1609
  const allTagTypes = blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig).map((d) => d.tagType));
1608
1610
  const uniqueTagTypes = [...new Set(allTagTypes)];
@@ -1615,6 +1617,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1615
1617
  };
1616
1618
  });
1617
1619
  extractedBlocks.annoEnabledBlocks = selectedTpls.map((tpl) => {
1620
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1618
1621
  const allBlocks = getCachedBlocks(tpl);
1619
1622
  return {
1620
1623
  contentType: tpl.kp_content_type,
@@ -1622,6 +1625,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1622
1625
  };
1623
1626
  });
1624
1627
  extractedBlocks.annoRollupBlocks = selectedTpls.map((tpl) => {
1628
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1625
1629
  const allBlocks = getCachedBlocks(tpl);
1626
1630
  const uniqueTagTypes = Array.from(new Set(
1627
1631
  blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig)).map((conf) => conf.tagType)
package/dist/node.js CHANGED
@@ -3267,7 +3267,9 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
3267
3267
  }
3268
3268
  return templateBlocksCache.get(tpl.kp_content_type);
3269
3269
  };
3270
+ const isPublishingTpl = (tpl) => tpl?.general?.segment === "publishing";
3270
3271
  extractedBlocks.annoTagBlocks = selectedTpls.map((tpl) => {
3272
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
3271
3273
  const allBlocks = getCachedBlocks(tpl);
3272
3274
  const allTagTypes = blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig).map((d) => d.tagType));
3273
3275
  const uniqueTagTypes = [...new Set(allTagTypes)];
@@ -3280,6 +3282,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
3280
3282
  };
3281
3283
  });
3282
3284
  extractedBlocks.annoEnabledBlocks = selectedTpls.map((tpl) => {
3285
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
3283
3286
  const allBlocks = getCachedBlocks(tpl);
3284
3287
  return {
3285
3288
  contentType: tpl.kp_content_type,
@@ -3287,6 +3290,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
3287
3290
  };
3288
3291
  });
3289
3292
  extractedBlocks.annoRollupBlocks = selectedTpls.map((tpl) => {
3293
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
3290
3294
  const allBlocks = getCachedBlocks(tpl);
3291
3295
  const uniqueTagTypes = Array.from(new Set(
3292
3296
  blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig)).map((conf) => conf.tagType)
package/dist/node.mjs CHANGED
@@ -3199,7 +3199,9 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
3199
3199
  }
3200
3200
  return templateBlocksCache.get(tpl.kp_content_type);
3201
3201
  };
3202
+ const isPublishingTpl = (tpl) => tpl?.general?.segment === "publishing";
3202
3203
  extractedBlocks.annoTagBlocks = selectedTpls.map((tpl) => {
3204
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
3203
3205
  const allBlocks = getCachedBlocks(tpl);
3204
3206
  const allTagTypes = blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig).map((d) => d.tagType));
3205
3207
  const uniqueTagTypes = [...new Set(allTagTypes)];
@@ -3212,6 +3214,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
3212
3214
  };
3213
3215
  });
3214
3216
  extractedBlocks.annoEnabledBlocks = selectedTpls.map((tpl) => {
3217
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
3215
3218
  const allBlocks = getCachedBlocks(tpl);
3216
3219
  return {
3217
3220
  contentType: tpl.kp_content_type,
@@ -3219,6 +3222,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
3219
3222
  };
3220
3223
  });
3221
3224
  extractedBlocks.annoRollupBlocks = selectedTpls.map((tpl) => {
3225
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
3222
3226
  const allBlocks = getCachedBlocks(tpl);
3223
3227
  const uniqueTagTypes = Array.from(new Set(
3224
3228
  blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig)).map((conf) => conf.tagType)
package/dist/universal.js CHANGED
@@ -1669,7 +1669,9 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1669
1669
  }
1670
1670
  return templateBlocksCache.get(tpl.kp_content_type);
1671
1671
  };
1672
+ const isPublishingTpl = (tpl) => tpl?.general?.segment === "publishing";
1672
1673
  extractedBlocks.annoTagBlocks = selectedTpls.map((tpl) => {
1674
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1673
1675
  const allBlocks = getCachedBlocks(tpl);
1674
1676
  const allTagTypes = blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig).map((d) => d.tagType));
1675
1677
  const uniqueTagTypes = [...new Set(allTagTypes)];
@@ -1682,6 +1684,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1682
1684
  };
1683
1685
  });
1684
1686
  extractedBlocks.annoEnabledBlocks = selectedTpls.map((tpl) => {
1687
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1685
1688
  const allBlocks = getCachedBlocks(tpl);
1686
1689
  return {
1687
1690
  contentType: tpl.kp_content_type,
@@ -1689,6 +1692,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1689
1692
  };
1690
1693
  });
1691
1694
  extractedBlocks.annoRollupBlocks = selectedTpls.map((tpl) => {
1695
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1692
1696
  const allBlocks = getCachedBlocks(tpl);
1693
1697
  const uniqueTagTypes = Array.from(new Set(
1694
1698
  blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig)).map((conf) => conf.tagType)
@@ -1602,7 +1602,9 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1602
1602
  }
1603
1603
  return templateBlocksCache.get(tpl.kp_content_type);
1604
1604
  };
1605
+ const isPublishingTpl = (tpl) => tpl?.general?.segment === "publishing";
1605
1606
  extractedBlocks.annoTagBlocks = selectedTpls.map((tpl) => {
1607
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1606
1608
  const allBlocks = getCachedBlocks(tpl);
1607
1609
  const allTagTypes = blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig).map((d) => d.tagType));
1608
1610
  const uniqueTagTypes = [...new Set(allTagTypes)];
@@ -1615,6 +1617,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1615
1617
  };
1616
1618
  });
1617
1619
  extractedBlocks.annoEnabledBlocks = selectedTpls.map((tpl) => {
1620
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1618
1621
  const allBlocks = getCachedBlocks(tpl);
1619
1622
  return {
1620
1623
  contentType: tpl.kp_content_type,
@@ -1622,6 +1625,7 @@ var extractAndOrganizeBlocks = (selectedTpls, allTpls, { smTagTypesConfig } = {}
1622
1625
  };
1623
1626
  });
1624
1627
  extractedBlocks.annoRollupBlocks = selectedTpls.map((tpl) => {
1628
+ if (!isPublishingTpl(tpl)) return { contentType: tpl.kp_content_type, blocks: [] };
1625
1629
  const allBlocks = getCachedBlocks(tpl);
1626
1630
  const uniqueTagTypes = Array.from(new Set(
1627
1631
  blockRegistry.getAnnotationEnabledBlocks(allBlocks).flatMap((block) => blockRegistry.getTagTypesConfig(block, smTagTypesConfig)).map((conf) => conf.tagType)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.31.4",
6
+ "version": "1.31.5",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",