@okf/ootils 1.3.5 → 1.3.7

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.
@@ -124,5 +124,31 @@ declare const extractAllBlocksFromTpl: ({ tpl, buildersWhitelist }: {
124
124
  tpl: Template;
125
125
  buildersWhitelist?: BuilderType[];
126
126
  }) => ExtractedBlock[];
127
+ /**
128
+ * Recursively extracts blocks from a hierarchical data structure.
129
+ *
130
+ * This is the core traversal function that handles nested sections and blocks.
131
+ * It preserves two critical pieces of metadata:
132
+ *
133
+ * 1. **sectionStack**: Array of parent sections - Essential for display condition handling.
134
+ * When sections have display conditions, we need to know which blocks belong to
135
+ * hidden sections to exclude them from indexes and processing.
136
+ *
137
+ * 2. **blockPath**: Dot-notation path to the block's location - Required for precise updates.
138
+ * Used when modifying block properties or updating valuePaths in display conditions.
139
+ * See 'modifyValuesAndValuePaths' for detailed usage.
140
+ *
141
+ * @param {Object} params - Extraction parameters
142
+ * @param {Block[]} params.data - Array of blocks/sections to process
143
+ * @param {Function} params.cb - Callback function to handle each extracted block
144
+ * @param {Section[]} params.sectionStack - Current stack of parent sections
145
+ * @param {string} params.blockPathPrefix - Current path prefix for building blockPath
146
+ */
147
+ declare const _recursExtractBlocks: ({ data, cb, sectionStack, blockPathPrefix }: {
148
+ data: Block[];
149
+ cb: (block: ExtractedBlock) => void;
150
+ sectionStack?: Section[];
151
+ blockPathPrefix?: string;
152
+ }) => void;
127
153
 
128
- export { deleteVal, extractAllBlocksFromTpl, genTagId, getVal, setVal, toArray };
154
+ export { deleteVal, extractAllBlocksFromTpl, genTagId, getVal, _recursExtractBlocks as recursivelyExtractBlocks, setVal, toArray };
package/dist/universal.js CHANGED
@@ -24,6 +24,7 @@ __export(universal_exports, {
24
24
  extractAllBlocksFromTpl: () => extractAllBlocksFromTpl,
25
25
  genTagId: () => genTagId,
26
26
  getVal: () => getVal,
27
+ recursivelyExtractBlocks: () => _recursExtractBlocks,
27
28
  setVal: () => setVal,
28
29
  toArray: () => toArray
29
30
  });
@@ -309,6 +310,7 @@ var _extractBlocksFromSomeBuilders = ({
309
310
  extractAllBlocksFromTpl,
310
311
  genTagId,
311
312
  getVal,
313
+ recursivelyExtractBlocks,
312
314
  setVal,
313
315
  toArray
314
316
  });
@@ -277,6 +277,7 @@ export {
277
277
  extractAllBlocksFromTpl,
278
278
  genTagId,
279
279
  getVal,
280
+ _recursExtractBlocks as recursivelyExtractBlocks,
280
281
  setVal,
281
282
  toArray
282
283
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.3.5",
6
+ "version": "1.3.7",
7
7
  "description": "Utility functions for both browser and Node.js",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.mjs",
@@ -65,6 +65,7 @@
65
65
  "@semantic-release/npm": "^12.0.1",
66
66
  "@semantic-release/release-notes-generator": "^14.0.3",
67
67
  "@types/ioredis": "^4.28.10",
68
+ "@types/mongoose": "^5.11.97",
68
69
  "@types/node": "^22.13.10",
69
70
  "commitizen": "^4.3.1",
70
71
  "cz-conventional-changelog": "^3.3.0",