@datocms/cma-client 5.1.9 → 5.1.11

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.
Files changed (226) hide show
  1. package/README.md +575 -0
  2. package/dist/cjs/fieldTypes/boolean.js +2 -2
  3. package/dist/cjs/fieldTypes/boolean.js.map +1 -1
  4. package/dist/cjs/fieldTypes/color.js +2 -2
  5. package/dist/cjs/fieldTypes/color.js.map +1 -1
  6. package/dist/cjs/fieldTypes/date.js +2 -3
  7. package/dist/cjs/fieldTypes/date.js.map +1 -1
  8. package/dist/cjs/fieldTypes/date_time.js +2 -2
  9. package/dist/cjs/fieldTypes/date_time.js.map +1 -1
  10. package/dist/cjs/fieldTypes/file.js +33 -5
  11. package/dist/cjs/fieldTypes/file.js.map +1 -1
  12. package/dist/cjs/fieldTypes/float.js +2 -2
  13. package/dist/cjs/fieldTypes/float.js.map +1 -1
  14. package/dist/cjs/fieldTypes/gallery.js +20 -5
  15. package/dist/cjs/fieldTypes/gallery.js.map +1 -1
  16. package/dist/cjs/fieldTypes/index.js +2 -2
  17. package/dist/cjs/fieldTypes/index.js.map +1 -1
  18. package/dist/cjs/fieldTypes/integer.js +2 -2
  19. package/dist/cjs/fieldTypes/integer.js.map +1 -1
  20. package/dist/cjs/fieldTypes/json.js +2 -3
  21. package/dist/cjs/fieldTypes/json.js.map +1 -1
  22. package/dist/cjs/fieldTypes/lat_lon.js +2 -2
  23. package/dist/cjs/fieldTypes/lat_lon.js.map +1 -1
  24. package/dist/cjs/fieldTypes/link.js +4 -4
  25. package/dist/cjs/fieldTypes/link.js.map +1 -1
  26. package/dist/cjs/fieldTypes/links.js +5 -3
  27. package/dist/cjs/fieldTypes/links.js.map +1 -1
  28. package/dist/cjs/fieldTypes/rich_text.js +4 -6
  29. package/dist/cjs/fieldTypes/rich_text.js.map +1 -1
  30. package/dist/cjs/fieldTypes/seo.js +2 -3
  31. package/dist/cjs/fieldTypes/seo.js.map +1 -1
  32. package/dist/cjs/fieldTypes/single_block.js +7 -7
  33. package/dist/cjs/fieldTypes/single_block.js.map +1 -1
  34. package/dist/cjs/fieldTypes/slug.js +2 -3
  35. package/dist/cjs/fieldTypes/slug.js.map +1 -1
  36. package/dist/cjs/fieldTypes/string.js +2 -2
  37. package/dist/cjs/fieldTypes/string.js.map +1 -1
  38. package/dist/cjs/fieldTypes/structured_text.js +4 -6
  39. package/dist/cjs/fieldTypes/structured_text.js.map +1 -1
  40. package/dist/cjs/fieldTypes/text.js +2 -3
  41. package/dist/cjs/fieldTypes/text.js.map +1 -1
  42. package/dist/cjs/fieldTypes/video.js +2 -2
  43. package/dist/cjs/fieldTypes/video.js.map +1 -1
  44. package/dist/cjs/generated/Client.js +1 -1
  45. package/dist/cjs/generated/Client.js.map +1 -1
  46. package/dist/cjs/generated/resources/Item.js.map +1 -1
  47. package/dist/cjs/generated/resources/Upload.js.map +1 -1
  48. package/dist/cjs/index.js +4 -4
  49. package/dist/cjs/index.js.map +1 -1
  50. package/dist/cjs/utilities/buildBlockRecord.js +8 -7
  51. package/dist/cjs/utilities/buildBlockRecord.js.map +1 -1
  52. package/dist/cjs/utilities/inspectItem.js +397 -0
  53. package/dist/cjs/utilities/inspectItem.js.map +1 -0
  54. package/dist/cjs/utilities/{blocks.js → nonRecursiveBlocks.js} +106 -111
  55. package/dist/cjs/utilities/nonRecursiveBlocks.js.map +1 -0
  56. package/dist/cjs/utilities/{fieldValue.js → normalizedFieldValues.js} +53 -41
  57. package/dist/cjs/utilities/normalizedFieldValues.js.map +1 -0
  58. package/dist/cjs/utilities/recursiveBlocks.js +121 -80
  59. package/dist/cjs/utilities/recursiveBlocks.js.map +1 -1
  60. package/dist/cjs/utilities/schemaRepository.js +2 -2
  61. package/dist/esm/fieldTypes/boolean.d.ts +1 -1
  62. package/dist/esm/fieldTypes/boolean.js +2 -2
  63. package/dist/esm/fieldTypes/boolean.js.map +1 -1
  64. package/dist/esm/fieldTypes/color.d.ts +1 -1
  65. package/dist/esm/fieldTypes/color.js +2 -2
  66. package/dist/esm/fieldTypes/color.js.map +1 -1
  67. package/dist/esm/fieldTypes/date.d.ts +1 -1
  68. package/dist/esm/fieldTypes/date.js +2 -3
  69. package/dist/esm/fieldTypes/date.js.map +1 -1
  70. package/dist/esm/fieldTypes/date_time.d.ts +1 -1
  71. package/dist/esm/fieldTypes/date_time.js +2 -2
  72. package/dist/esm/fieldTypes/date_time.js.map +1 -1
  73. package/dist/esm/fieldTypes/file.d.ts +68 -1
  74. package/dist/esm/fieldTypes/file.js +29 -3
  75. package/dist/esm/fieldTypes/file.js.map +1 -1
  76. package/dist/esm/fieldTypes/float.d.ts +1 -1
  77. package/dist/esm/fieldTypes/float.js +2 -2
  78. package/dist/esm/fieldTypes/float.js.map +1 -1
  79. package/dist/esm/fieldTypes/gallery.d.ts +27 -11
  80. package/dist/esm/fieldTypes/gallery.js +17 -4
  81. package/dist/esm/fieldTypes/gallery.js.map +1 -1
  82. package/dist/esm/fieldTypes/index.d.ts +2 -2
  83. package/dist/esm/fieldTypes/index.js +2 -2
  84. package/dist/esm/fieldTypes/index.js.map +1 -1
  85. package/dist/esm/fieldTypes/integer.d.ts +1 -1
  86. package/dist/esm/fieldTypes/integer.js +2 -2
  87. package/dist/esm/fieldTypes/integer.js.map +1 -1
  88. package/dist/esm/fieldTypes/json.d.ts +1 -1
  89. package/dist/esm/fieldTypes/json.js +2 -3
  90. package/dist/esm/fieldTypes/json.js.map +1 -1
  91. package/dist/esm/fieldTypes/lat_lon.d.ts +1 -1
  92. package/dist/esm/fieldTypes/lat_lon.js +2 -2
  93. package/dist/esm/fieldTypes/lat_lon.js.map +1 -1
  94. package/dist/esm/fieldTypes/link.d.ts +1 -1
  95. package/dist/esm/fieldTypes/link.js +4 -4
  96. package/dist/esm/fieldTypes/link.js.map +1 -1
  97. package/dist/esm/fieldTypes/links.d.ts +1 -1
  98. package/dist/esm/fieldTypes/links.js +5 -3
  99. package/dist/esm/fieldTypes/links.js.map +1 -1
  100. package/dist/esm/fieldTypes/rich_text.d.ts +1 -1
  101. package/dist/esm/fieldTypes/rich_text.js +4 -6
  102. package/dist/esm/fieldTypes/rich_text.js.map +1 -1
  103. package/dist/esm/fieldTypes/seo.d.ts +1 -1
  104. package/dist/esm/fieldTypes/seo.js +2 -3
  105. package/dist/esm/fieldTypes/seo.js.map +1 -1
  106. package/dist/esm/fieldTypes/single_block.d.ts +3 -3
  107. package/dist/esm/fieldTypes/single_block.js +7 -7
  108. package/dist/esm/fieldTypes/single_block.js.map +1 -1
  109. package/dist/esm/fieldTypes/slug.d.ts +1 -1
  110. package/dist/esm/fieldTypes/slug.js +2 -3
  111. package/dist/esm/fieldTypes/slug.js.map +1 -1
  112. package/dist/esm/fieldTypes/string.d.ts +1 -1
  113. package/dist/esm/fieldTypes/string.js +2 -2
  114. package/dist/esm/fieldTypes/string.js.map +1 -1
  115. package/dist/esm/fieldTypes/structured_text.d.ts +1 -1
  116. package/dist/esm/fieldTypes/structured_text.js +4 -6
  117. package/dist/esm/fieldTypes/structured_text.js.map +1 -1
  118. package/dist/esm/fieldTypes/text.d.ts +1 -1
  119. package/dist/esm/fieldTypes/text.js +2 -3
  120. package/dist/esm/fieldTypes/text.js.map +1 -1
  121. package/dist/esm/fieldTypes/video.d.ts +1 -1
  122. package/dist/esm/fieldTypes/video.js +2 -2
  123. package/dist/esm/fieldTypes/video.js.map +1 -1
  124. package/dist/esm/generated/Client.js +1 -1
  125. package/dist/esm/generated/Client.js.map +1 -1
  126. package/dist/esm/generated/resources/Item.d.ts +46 -28
  127. package/dist/esm/generated/resources/Item.js.map +1 -1
  128. package/dist/esm/generated/resources/ScheduledPublication.d.ts +3 -3
  129. package/dist/esm/generated/resources/ScheduledUnpublishing.d.ts +3 -3
  130. package/dist/esm/generated/resources/Upload.d.ts +10 -4
  131. package/dist/esm/generated/resources/Upload.js.map +1 -1
  132. package/dist/esm/index.d.ts +4 -4
  133. package/dist/esm/index.js +4 -4
  134. package/dist/esm/index.js.map +1 -1
  135. package/dist/esm/utilities/buildBlockRecord.d.ts +3 -3
  136. package/dist/esm/utilities/buildBlockRecord.js +9 -8
  137. package/dist/esm/utilities/buildBlockRecord.js.map +1 -1
  138. package/dist/esm/utilities/inspectItem.d.ts +8 -0
  139. package/dist/esm/utilities/inspectItem.js +393 -0
  140. package/dist/esm/utilities/inspectItem.js.map +1 -0
  141. package/dist/esm/utilities/itemDefinition.d.ts +36 -12
  142. package/dist/esm/utilities/nonRecursiveBlocks.d.ts +179 -0
  143. package/dist/esm/utilities/{blocks.js → nonRecursiveBlocks.js} +91 -96
  144. package/dist/esm/utilities/nonRecursiveBlocks.js.map +1 -0
  145. package/dist/{types/utilities/fieldValue.d.ts → esm/utilities/normalizedFieldValues.d.ts} +15 -14
  146. package/dist/esm/utilities/{fieldValue.js → normalizedFieldValues.js} +39 -28
  147. package/dist/esm/utilities/normalizedFieldValues.js.map +1 -0
  148. package/dist/esm/utilities/recursiveBlocks.d.ts +92 -9
  149. package/dist/esm/utilities/recursiveBlocks.js +113 -72
  150. package/dist/esm/utilities/recursiveBlocks.js.map +1 -1
  151. package/dist/esm/utilities/schemaRepository.d.ts +2 -2
  152. package/dist/esm/utilities/schemaRepository.js +2 -2
  153. package/dist/types/fieldTypes/boolean.d.ts +1 -1
  154. package/dist/types/fieldTypes/color.d.ts +1 -1
  155. package/dist/types/fieldTypes/date.d.ts +1 -1
  156. package/dist/types/fieldTypes/date_time.d.ts +1 -1
  157. package/dist/types/fieldTypes/file.d.ts +68 -1
  158. package/dist/types/fieldTypes/float.d.ts +1 -1
  159. package/dist/types/fieldTypes/gallery.d.ts +27 -11
  160. package/dist/types/fieldTypes/index.d.ts +2 -2
  161. package/dist/types/fieldTypes/integer.d.ts +1 -1
  162. package/dist/types/fieldTypes/json.d.ts +1 -1
  163. package/dist/types/fieldTypes/lat_lon.d.ts +1 -1
  164. package/dist/types/fieldTypes/link.d.ts +1 -1
  165. package/dist/types/fieldTypes/links.d.ts +1 -1
  166. package/dist/types/fieldTypes/rich_text.d.ts +1 -1
  167. package/dist/types/fieldTypes/seo.d.ts +1 -1
  168. package/dist/types/fieldTypes/single_block.d.ts +3 -3
  169. package/dist/types/fieldTypes/slug.d.ts +1 -1
  170. package/dist/types/fieldTypes/string.d.ts +1 -1
  171. package/dist/types/fieldTypes/structured_text.d.ts +1 -1
  172. package/dist/types/fieldTypes/text.d.ts +1 -1
  173. package/dist/types/fieldTypes/video.d.ts +1 -1
  174. package/dist/types/generated/resources/Item.d.ts +46 -28
  175. package/dist/types/generated/resources/ScheduledPublication.d.ts +3 -3
  176. package/dist/types/generated/resources/ScheduledUnpublishing.d.ts +3 -3
  177. package/dist/types/generated/resources/Upload.d.ts +10 -4
  178. package/dist/types/index.d.ts +4 -4
  179. package/dist/types/utilities/buildBlockRecord.d.ts +3 -3
  180. package/dist/types/utilities/inspectItem.d.ts +8 -0
  181. package/dist/types/utilities/itemDefinition.d.ts +36 -12
  182. package/dist/types/utilities/nonRecursiveBlocks.d.ts +179 -0
  183. package/dist/{esm/utilities/fieldValue.d.ts → types/utilities/normalizedFieldValues.d.ts} +15 -14
  184. package/dist/types/utilities/recursiveBlocks.d.ts +92 -9
  185. package/dist/types/utilities/schemaRepository.d.ts +2 -2
  186. package/package.json +4 -4
  187. package/src/fieldTypes/boolean.ts +5 -3
  188. package/src/fieldTypes/color.ts +5 -3
  189. package/src/fieldTypes/date.ts +5 -4
  190. package/src/fieldTypes/date_time.ts +5 -3
  191. package/src/fieldTypes/file.ts +98 -4
  192. package/src/fieldTypes/float.ts +5 -3
  193. package/src/fieldTypes/gallery.ts +53 -20
  194. package/src/fieldTypes/index.ts +2 -3
  195. package/src/fieldTypes/integer.ts +5 -3
  196. package/src/fieldTypes/json.ts +5 -4
  197. package/src/fieldTypes/lat_lon.ts +5 -3
  198. package/src/fieldTypes/link.ts +7 -5
  199. package/src/fieldTypes/links.ts +8 -4
  200. package/src/fieldTypes/rich_text.ts +7 -7
  201. package/src/fieldTypes/seo.ts +5 -4
  202. package/src/fieldTypes/single_block.ts +12 -10
  203. package/src/fieldTypes/slug.ts +5 -4
  204. package/src/fieldTypes/string.ts +5 -3
  205. package/src/fieldTypes/structured_text.ts +7 -7
  206. package/src/fieldTypes/text.ts +5 -4
  207. package/src/fieldTypes/video.ts +5 -3
  208. package/src/generated/Client.ts +1 -1
  209. package/src/generated/resources/Item.ts +129 -92
  210. package/src/generated/resources/ScheduledPublication.ts +6 -6
  211. package/src/generated/resources/ScheduledUnpublishing.ts +6 -6
  212. package/src/generated/resources/Upload.ts +36 -10
  213. package/src/index.ts +4 -4
  214. package/src/utilities/buildBlockRecord.ts +24 -31
  215. package/src/utilities/inspectItem.ts +590 -0
  216. package/src/utilities/itemDefinition.ts +53 -35
  217. package/src/utilities/{blocks.ts → nonRecursiveBlocks.ts} +170 -136
  218. package/src/utilities/{fieldValue.ts → normalizedFieldValues.ts} +70 -30
  219. package/src/utilities/recursiveBlocks.ts +186 -171
  220. package/src/utilities/schemaRepository.ts +2 -2
  221. package/dist/cjs/utilities/blocks.js.map +0 -1
  222. package/dist/cjs/utilities/fieldValue.js.map +0 -1
  223. package/dist/esm/utilities/blocks.d.ts +0 -180
  224. package/dist/esm/utilities/blocks.js.map +0 -1
  225. package/dist/esm/utilities/fieldValue.js.map +0 -1
  226. package/dist/types/utilities/blocks.d.ts +0 -180
@@ -51,15 +51,15 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
51
51
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
52
52
  };
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.nonRecursiveEveryBlockInFieldValueAsync = exports.nonRecursiveEveryBlockInFieldValue = exports.nonRecursiveSomeBlocksInFieldValueAsync = exports.nonRecursiveSomeBlocksInFieldValue = exports.nonRecursiveReduceBlocksInFieldValueAsync = exports.nonRecursiveReduceBlocksInFieldValue = exports.nonRecursiveFilterBlocksInFieldValueAsync = exports.nonRecursiveFilterBlocksInFieldValue = exports.nonRecursiveFindAllBlocksInFieldValueAsync = exports.nonRecursiveFindAllBlocksInFieldValue = exports.nonRecursiveMapBlocksInFieldValueAsync = exports.nonRecursiveMapBlocksInFieldValue = exports.nonRecursiveVisitBlocksInFieldValueAsync = exports.nonRecursiveVisitBlocksInFieldValue = void 0;
54
+ exports.nonRecursiveEveryBlockInNonLocalizedFieldValueAsync = exports.nonRecursiveEveryBlockInNonLocalizedFieldValue = exports.nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveSomeBlocksInNonLocalizedFieldValue = exports.nonRecursiveReduceBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveReduceBlocksInNonLocalizedFieldValue = exports.nonRecursiveFilterBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveFilterBlocksInNonLocalizedFieldValue = exports.nonRecursiveFindAllBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveFindAllBlocksInNonLocalizedFieldValue = exports.nonRecursiveMapBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveMapBlocksInNonLocalizedFieldValue = exports.nonRecursiveVisitBlocksInNonLocalizedFieldValueAsync = exports.nonRecursiveVisitBlocksInNonLocalizedFieldValue = void 0;
55
55
  const datocms_structured_text_utils_1 = require("datocms-structured-text-utils");
56
- function getFieldType(field) {
57
- return 'attributes' in field ? field.attributes.field_type : field.field_type;
58
- }
59
- function* iterateBlocks(field, value) {
60
- const fieldType = getFieldType(field);
56
+ const normalizedFieldValues_1 = require("./normalizedFieldValues");
57
+ function* iterateBlocks(fieldType, nonLocalizedFieldValue) {
58
+ if ((0, normalizedFieldValues_1.isLocalizedFieldValue)(nonLocalizedFieldValue)) {
59
+ throw new Error('A non-localized field value is required!');
60
+ }
61
61
  if (fieldType === 'rich_text') {
62
- const richTextValue = value;
62
+ const richTextValue = nonLocalizedFieldValue;
63
63
  if (richTextValue) {
64
64
  for (let index = 0; index < richTextValue.length; index++) {
65
65
  const item = richTextValue[index];
@@ -69,14 +69,14 @@ function* iterateBlocks(field, value) {
69
69
  return;
70
70
  }
71
71
  if (fieldType === 'single_block') {
72
- const singleBlockValue = value;
72
+ const singleBlockValue = nonLocalizedFieldValue;
73
73
  if (singleBlockValue) {
74
74
  yield { item: singleBlockValue, path: [] };
75
75
  }
76
76
  return;
77
77
  }
78
78
  if (fieldType === 'structured_text') {
79
- const structuredTextValue = value;
79
+ const structuredTextValue = nonLocalizedFieldValue;
80
80
  if (structuredTextValue) {
81
81
  const foundNodes = (0, datocms_structured_text_utils_1.collectNodes)(structuredTextValue.document, (node) => node.type === 'block' || node.type === 'inlineBlock');
82
82
  for (const { node, path } of foundNodes) {
@@ -88,11 +88,10 @@ function* iterateBlocks(field, value) {
88
88
  return;
89
89
  }
90
90
  }
91
- function iterateBlocksAsync(field, value) {
91
+ function iterateBlocksAsync(fieldType, nonLocalizedFieldValue) {
92
92
  return __asyncGenerator(this, arguments, function* iterateBlocksAsync_1() {
93
- const fieldType = getFieldType(field);
94
93
  if (fieldType === 'rich_text') {
95
- const richTextValue = value;
94
+ const richTextValue = nonLocalizedFieldValue;
96
95
  if (richTextValue) {
97
96
  for (let index = 0; index < richTextValue.length; index++) {
98
97
  const item = richTextValue[index];
@@ -102,14 +101,14 @@ function iterateBlocksAsync(field, value) {
102
101
  return yield __await(void 0);
103
102
  }
104
103
  if (fieldType === 'single_block') {
105
- const singleBlockValue = value;
104
+ const singleBlockValue = nonLocalizedFieldValue;
106
105
  if (singleBlockValue) {
107
106
  yield yield __await({ item: singleBlockValue, path: [] });
108
107
  }
109
108
  return yield __await(void 0);
110
109
  }
111
110
  if (fieldType === 'structured_text') {
112
- const structuredTextValue = value;
111
+ const structuredTextValue = nonLocalizedFieldValue;
113
112
  if (structuredTextValue) {
114
113
  const foundNodes = yield __await((0, datocms_structured_text_utils_1.collectNodesAsync)(structuredTextValue.document, (node) => __awaiter(this, void 0, void 0, function* () { return node.type === 'block' || node.type === 'inlineBlock'; })));
115
114
  for (const { node, path } of foundNodes) {
@@ -126,30 +125,30 @@ function iterateBlocksAsync(field, value) {
126
125
  * Visit every block in a field value, calling the visitor function for each block found.
127
126
  * Supports rich text, single block, and structured text field types.
128
127
  *
129
- * @param field - The DatoCMS field definition that determines how blocks are processed
130
- * @param value - The field value containing blocks to visit
128
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
129
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to visit
131
130
  * @param visitor - Synchronous function called for each block. Receives the block item and its path
132
131
  */
133
- function nonRecursiveVisitBlocksInFieldValue(field, value, visitor) {
134
- for (const { item, path } of iterateBlocks(field, value)) {
132
+ function nonRecursiveVisitBlocksInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, visitor) {
133
+ for (const { item, path } of iterateBlocks(fieldType, nonLocalizedFieldValue)) {
135
134
  visitor(item, path);
136
135
  }
137
136
  }
138
- exports.nonRecursiveVisitBlocksInFieldValue = nonRecursiveVisitBlocksInFieldValue;
137
+ exports.nonRecursiveVisitBlocksInNonLocalizedFieldValue = nonRecursiveVisitBlocksInNonLocalizedFieldValue;
139
138
  /**
140
139
  * Visit every block in a field value, calling the visitor function for each block found.
141
140
  * Supports rich text, single block, and structured text field types.
142
141
  *
143
- * @param field - The DatoCMS field definition that determines how blocks are processed
144
- * @param value - The field value containing blocks to visit
142
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
143
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to visit
145
144
  * @param visitor - Asynchronous function called for each block. Receives the block item and its path
146
145
  * @returns Promise that resolves when all blocks have been visited
147
146
  */
148
- function nonRecursiveVisitBlocksInFieldValueAsync(field, value, visitor) {
147
+ function nonRecursiveVisitBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, visitor) {
149
148
  var _a, e_1, _b, _c;
150
149
  return __awaiter(this, void 0, void 0, function* () {
151
150
  try {
152
- for (var _d = true, _e = __asyncValues(iterateBlocksAsync(field, value)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
151
+ for (var _d = true, _e = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
153
152
  _c = _f.value;
154
153
  _d = false;
155
154
  try {
@@ -170,31 +169,30 @@ function nonRecursiveVisitBlocksInFieldValueAsync(field, value, visitor) {
170
169
  }
171
170
  });
172
171
  }
173
- exports.nonRecursiveVisitBlocksInFieldValueAsync = nonRecursiveVisitBlocksInFieldValueAsync;
172
+ exports.nonRecursiveVisitBlocksInNonLocalizedFieldValueAsync = nonRecursiveVisitBlocksInNonLocalizedFieldValueAsync;
174
173
  /**
175
174
  * Transform blocks in a field value by applying a mapping function to each block.
176
175
  * Creates a new field value structure with transformed blocks while preserving the original structure.
177
176
  * Supports rich text, single block, and structured text field types.
178
177
  *
179
- * @param field - The DatoCMS field definition that determines how blocks are processed
180
- * @param value - The field value containing blocks to transform
178
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
179
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to transform
181
180
  * @param mapper - Synchronous function that transforms each block. Receives block item and path, returns new block
182
181
  * @returns The new field value with transformed blocks
183
182
  */
184
- function nonRecursiveMapBlocksInFieldValue(field, value, mapper) {
185
- const fieldType = getFieldType(field);
183
+ function nonRecursiveMapBlocksInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, mapper) {
186
184
  if (fieldType === 'rich_text') {
187
- const richTextValue = value;
185
+ const richTextValue = nonLocalizedFieldValue;
188
186
  return richTextValue
189
187
  ? richTextValue.map((item, index) => mapper(item, [index]))
190
188
  : richTextValue;
191
189
  }
192
190
  if (fieldType === 'single_block') {
193
- const singleBlockValue = value;
191
+ const singleBlockValue = nonLocalizedFieldValue;
194
192
  return singleBlockValue ? mapper(singleBlockValue, []) : null;
195
193
  }
196
194
  if (fieldType === 'structured_text') {
197
- const structuredTextValue = value;
195
+ const structuredTextValue = nonLocalizedFieldValue;
198
196
  if (!structuredTextValue) {
199
197
  return null;
200
198
  }
@@ -208,34 +206,33 @@ function nonRecursiveMapBlocksInFieldValue(field, value, mapper) {
208
206
  }),
209
207
  };
210
208
  }
211
- return value;
209
+ return nonLocalizedFieldValue;
212
210
  }
213
- exports.nonRecursiveMapBlocksInFieldValue = nonRecursiveMapBlocksInFieldValue;
211
+ exports.nonRecursiveMapBlocksInNonLocalizedFieldValue = nonRecursiveMapBlocksInNonLocalizedFieldValue;
214
212
  /**
215
213
  * Transform blocks in a field value by applying a mapping function to each block.
216
214
  * Creates a new field value structure with transformed blocks while preserving the original structure.
217
215
  * Supports rich text, single block, and structured text field types.
218
216
  *
219
- * @param field - The DatoCMS field definition that determines how blocks are processed
220
- * @param value - The field value containing blocks to transform
217
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
218
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to transform
221
219
  * @param mapper - Asynchronous function that transforms each block. Receives block item and path, returns new block
222
220
  * @returns Promise that resolves to the new field value with transformed blocks
223
221
  */
224
- function nonRecursiveMapBlocksInFieldValueAsync(field, value, mapper) {
222
+ function nonRecursiveMapBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, mapper) {
225
223
  return __awaiter(this, void 0, void 0, function* () {
226
- const fieldType = getFieldType(field);
227
224
  if (fieldType === 'rich_text') {
228
- const richTextValue = value;
225
+ const richTextValue = nonLocalizedFieldValue;
229
226
  return richTextValue
230
227
  ? yield Promise.all(richTextValue.map((item, index) => mapper(item, [index])))
231
228
  : richTextValue;
232
229
  }
233
230
  if (fieldType === 'single_block') {
234
- const singleBlockValue = value;
231
+ const singleBlockValue = nonLocalizedFieldValue;
235
232
  return singleBlockValue ? yield mapper(singleBlockValue, []) : null;
236
233
  }
237
234
  if (fieldType === 'structured_text') {
238
- const structuredTextValue = value;
235
+ const structuredTextValue = nonLocalizedFieldValue;
239
236
  if (!structuredTextValue) {
240
237
  return null;
241
238
  }
@@ -249,44 +246,44 @@ function nonRecursiveMapBlocksInFieldValueAsync(field, value, mapper) {
249
246
  })),
250
247
  };
251
248
  }
252
- return value;
249
+ return nonLocalizedFieldValue;
253
250
  });
254
251
  }
255
- exports.nonRecursiveMapBlocksInFieldValueAsync = nonRecursiveMapBlocksInFieldValueAsync;
252
+ exports.nonRecursiveMapBlocksInNonLocalizedFieldValueAsync = nonRecursiveMapBlocksInNonLocalizedFieldValueAsync;
256
253
  /**
257
254
  * Find all blocks that match the predicate function.
258
- * Searches through all blocks in the field value and returns all matches.
255
+ * Searches through all blocks in the non-localized field value and returns all matches.
259
256
  *
260
- * @param field - The DatoCMS field definition that determines how blocks are processed
261
- * @param value - The field value containing blocks to search
257
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
258
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to search
262
259
  * @param predicate - Synchronous function that tests each block. Should return true for matching blocks
263
260
  * @returns Array of objects, each containing a matching block and its path
264
261
  */
265
- function nonRecursiveFindAllBlocksInFieldValue(field, value, predicate) {
262
+ function nonRecursiveFindAllBlocksInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, predicate) {
266
263
  const results = [];
267
- for (const { item, path } of iterateBlocks(field, value)) {
264
+ for (const { item, path } of iterateBlocks(fieldType, nonLocalizedFieldValue)) {
268
265
  if (predicate(item, path)) {
269
266
  results.push({ item, path });
270
267
  }
271
268
  }
272
269
  return results;
273
270
  }
274
- exports.nonRecursiveFindAllBlocksInFieldValue = nonRecursiveFindAllBlocksInFieldValue;
271
+ exports.nonRecursiveFindAllBlocksInNonLocalizedFieldValue = nonRecursiveFindAllBlocksInNonLocalizedFieldValue;
275
272
  /**
276
273
  * Find all blocks that match the predicate function.
277
- * Searches through all blocks in the field value and returns all matches.
274
+ * Searches through all blocks in the non-localized field value and returns all matches.
278
275
  *
279
- * @param field - The DatoCMS field definition that determines how blocks are processed
280
- * @param value - The field value containing blocks to search
276
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
277
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to search
281
278
  * @param predicate - Asynchronous function that tests each block. Should return true for matching blocks
282
279
  * @returns Promise that resolves to an array of objects, each containing a matching block and its path
283
280
  */
284
- function nonRecursiveFindAllBlocksInFieldValueAsync(field, value, predicate) {
281
+ function nonRecursiveFindAllBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, predicate) {
285
282
  var _a, e_2, _b, _c;
286
283
  return __awaiter(this, void 0, void 0, function* () {
287
284
  const results = [];
288
285
  try {
289
- for (var _d = true, _e = __asyncValues(iterateBlocksAsync(field, value)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
286
+ for (var _d = true, _e = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
290
287
  _c = _f.value;
291
288
  _d = false;
292
289
  try {
@@ -310,30 +307,29 @@ function nonRecursiveFindAllBlocksInFieldValueAsync(field, value, predicate) {
310
307
  return results;
311
308
  });
312
309
  }
313
- exports.nonRecursiveFindAllBlocksInFieldValueAsync = nonRecursiveFindAllBlocksInFieldValueAsync;
310
+ exports.nonRecursiveFindAllBlocksInNonLocalizedFieldValueAsync = nonRecursiveFindAllBlocksInNonLocalizedFieldValueAsync;
314
311
  /**
315
312
  * Filter blocks in a field value, removing those that don't match the predicate.
316
313
  * Creates a new field value containing only blocks that pass the predicate test.
317
314
  * Preserves the original field value structure and hierarchy.
318
315
  *
319
- * @param field - The DatoCMS field definition that determines how blocks are processed
320
- * @param value - The field value containing blocks to filter
316
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
317
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to filter
321
318
  * @param predicate - Synchronous function that tests each block. Blocks returning false are removed
322
319
  * @returns The new field value with filtered blocks
323
320
  */
324
- function nonRecursiveFilterBlocksInFieldValue(field, value, predicate) {
325
- const fieldType = getFieldType(field);
321
+ function nonRecursiveFilterBlocksInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, predicate) {
326
322
  if (fieldType === 'rich_text') {
327
323
  const filteredItems = [];
328
- for (const { item, path } of iterateBlocks(field, value)) {
324
+ for (const { item, path } of iterateBlocks(fieldType, nonLocalizedFieldValue)) {
329
325
  if (predicate(item, path)) {
330
326
  filteredItems.push(item);
331
327
  }
332
328
  }
333
- return value ? filteredItems : value;
329
+ return filteredItems;
334
330
  }
335
331
  if (fieldType === 'single_block') {
336
- for (const { item, path } of iterateBlocks(field, value)) {
332
+ for (const { item, path } of iterateBlocks(fieldType, nonLocalizedFieldValue)) {
337
333
  if (predicate(item, path)) {
338
334
  return item;
339
335
  }
@@ -341,7 +337,7 @@ function nonRecursiveFilterBlocksInFieldValue(field, value, predicate) {
341
337
  return null;
342
338
  }
343
339
  if (fieldType === 'structured_text') {
344
- const structuredTextValue = value;
340
+ const structuredTextValue = nonLocalizedFieldValue;
345
341
  if (!structuredTextValue) {
346
342
  return null;
347
343
  }
@@ -358,27 +354,26 @@ function nonRecursiveFilterBlocksInFieldValue(field, value, predicate) {
358
354
  }
359
355
  : null;
360
356
  }
361
- return value;
357
+ return nonLocalizedFieldValue;
362
358
  }
363
- exports.nonRecursiveFilterBlocksInFieldValue = nonRecursiveFilterBlocksInFieldValue;
359
+ exports.nonRecursiveFilterBlocksInNonLocalizedFieldValue = nonRecursiveFilterBlocksInNonLocalizedFieldValue;
364
360
  /**
365
361
  * Filter blocks in a field value, removing those that don't match the predicate.
366
362
  * Creates a new field value containing only blocks that pass the predicate test.
367
363
  * Preserves the original field value structure and hierarchy.
368
364
  *
369
- * @param field - The DatoCMS field definition that determines how blocks are processed
370
- * @param value - The field value containing blocks to filter
365
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
366
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to filter
371
367
  * @param predicate - Asynchronous function that tests each block. Blocks returning false are removed
372
368
  * @returns Promise that resolves to the new field value with filtered blocks
373
369
  */
374
- function nonRecursiveFilterBlocksInFieldValueAsync(field, value, predicate) {
370
+ function nonRecursiveFilterBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, predicate) {
375
371
  var _a, e_3, _b, _c, _d, e_4, _e, _f;
376
372
  return __awaiter(this, void 0, void 0, function* () {
377
- const fieldType = getFieldType(field);
378
373
  if (fieldType === 'rich_text') {
379
374
  const filteredItems = [];
380
375
  try {
381
- for (var _g = true, _h = __asyncValues(iterateBlocksAsync(field, value)), _j; _j = yield _h.next(), _a = _j.done, !_a;) {
376
+ for (var _g = true, _h = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _j; _j = yield _h.next(), _a = _j.done, !_a;) {
382
377
  _c = _j.value;
383
378
  _g = false;
384
379
  try {
@@ -399,11 +394,11 @@ function nonRecursiveFilterBlocksInFieldValueAsync(field, value, predicate) {
399
394
  }
400
395
  finally { if (e_3) throw e_3.error; }
401
396
  }
402
- return value ? filteredItems : value;
397
+ return filteredItems;
403
398
  }
404
399
  if (fieldType === 'single_block') {
405
400
  try {
406
- for (var _k = true, _l = __asyncValues(iterateBlocksAsync(field, value)), _m; _m = yield _l.next(), _d = _m.done, !_d;) {
401
+ for (var _k = true, _l = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _m; _m = yield _l.next(), _d = _m.done, !_d;) {
407
402
  _f = _m.value;
408
403
  _k = false;
409
404
  try {
@@ -427,7 +422,7 @@ function nonRecursiveFilterBlocksInFieldValueAsync(field, value, predicate) {
427
422
  return null;
428
423
  }
429
424
  if (fieldType === 'structured_text') {
430
- const structuredTextValue = value;
425
+ const structuredTextValue = nonLocalizedFieldValue;
431
426
  if (!structuredTextValue) {
432
427
  return null;
433
428
  }
@@ -444,46 +439,46 @@ function nonRecursiveFilterBlocksInFieldValueAsync(field, value, predicate) {
444
439
  }
445
440
  : null;
446
441
  }
447
- return value;
442
+ return nonLocalizedFieldValue;
448
443
  });
449
444
  }
450
- exports.nonRecursiveFilterBlocksInFieldValueAsync = nonRecursiveFilterBlocksInFieldValueAsync;
445
+ exports.nonRecursiveFilterBlocksInNonLocalizedFieldValueAsync = nonRecursiveFilterBlocksInNonLocalizedFieldValueAsync;
451
446
  /**
452
447
  * Reduce all blocks in a field value to a single value by applying a reducer function.
453
- * Processes each block in the field value and accumulates the results into a single value.
448
+ * Processes each block in the non-localized field value and accumulates the results into a single value.
454
449
  *
455
450
  * @template R - The type of the accumulated result
456
- * @param field - The DatoCMS field definition that determines how blocks are processed
457
- * @param value - The field value containing blocks to reduce
451
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
452
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to reduce
458
453
  * @param reducer - Synchronous function that processes each block and updates the accumulator
459
454
  * @param initialValue - The initial value for the accumulator
460
455
  * @returns The final accumulated value
461
456
  */
462
- function nonRecursiveReduceBlocksInFieldValue(field, value, reducer, initialValue) {
457
+ function nonRecursiveReduceBlocksInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, reducer, initialValue) {
463
458
  let accumulator = initialValue;
464
- for (const { item, path } of iterateBlocks(field, value)) {
459
+ for (const { item, path } of iterateBlocks(fieldType, nonLocalizedFieldValue)) {
465
460
  accumulator = reducer(accumulator, item, path);
466
461
  }
467
462
  return accumulator;
468
463
  }
469
- exports.nonRecursiveReduceBlocksInFieldValue = nonRecursiveReduceBlocksInFieldValue;
464
+ exports.nonRecursiveReduceBlocksInNonLocalizedFieldValue = nonRecursiveReduceBlocksInNonLocalizedFieldValue;
470
465
  /**
471
466
  * Reduce all blocks in a field value to a single value by applying a reducer function.
472
- * Processes each block in the field value and accumulates the results into a single value.
467
+ * Processes each block in the non-localized field value and accumulates the results into a single value.
473
468
  *
474
469
  * @template R - The type of the accumulated result
475
- * @param field - The DatoCMS field definition that determines how blocks are processed
476
- * @param value - The field value containing blocks to reduce
470
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
471
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to reduce
477
472
  * @param reducer - Asynchronous function that processes each block and updates the accumulator
478
473
  * @param initialValue - The initial value for the accumulator
479
474
  * @returns Promise that resolves to the final accumulated value
480
475
  */
481
- function nonRecursiveReduceBlocksInFieldValueAsync(field, value, reducer, initialValue) {
476
+ function nonRecursiveReduceBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, reducer, initialValue) {
482
477
  var _a, e_5, _b, _c;
483
478
  return __awaiter(this, void 0, void 0, function* () {
484
479
  let accumulator = initialValue;
485
480
  try {
486
- for (var _d = true, _e = __asyncValues(iterateBlocksAsync(field, value)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
481
+ for (var _d = true, _e = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
487
482
  _c = _f.value;
488
483
  _d = false;
489
484
  try {
@@ -505,39 +500,39 @@ function nonRecursiveReduceBlocksInFieldValueAsync(field, value, reducer, initia
505
500
  return accumulator;
506
501
  });
507
502
  }
508
- exports.nonRecursiveReduceBlocksInFieldValueAsync = nonRecursiveReduceBlocksInFieldValueAsync;
503
+ exports.nonRecursiveReduceBlocksInNonLocalizedFieldValueAsync = nonRecursiveReduceBlocksInNonLocalizedFieldValueAsync;
509
504
  /**
510
- * Check if any block in the field value matches the predicate function.
505
+ * Check if any block in the non-localized field value matches the predicate function.
511
506
  * Returns true as soon as the first matching block is found (short-circuit evaluation).
512
507
  *
513
- * @param field - The DatoCMS field definition that determines how blocks are processed
514
- * @param value - The field value containing blocks to test
508
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
509
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to test
515
510
  * @param predicate - Synchronous function that tests each block. Should return true for matching blocks
516
511
  * @returns True if any block matches, false otherwise
517
512
  */
518
- function nonRecursiveSomeBlocksInFieldValue(field, value, predicate) {
519
- for (const { item, path } of iterateBlocks(field, value)) {
513
+ function nonRecursiveSomeBlocksInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, predicate) {
514
+ for (const { item, path } of iterateBlocks(fieldType, nonLocalizedFieldValue)) {
520
515
  if (predicate(item, path)) {
521
516
  return true;
522
517
  }
523
518
  }
524
519
  return false;
525
520
  }
526
- exports.nonRecursiveSomeBlocksInFieldValue = nonRecursiveSomeBlocksInFieldValue;
521
+ exports.nonRecursiveSomeBlocksInNonLocalizedFieldValue = nonRecursiveSomeBlocksInNonLocalizedFieldValue;
527
522
  /**
528
- * Check if any block in the field value matches the predicate function.
523
+ * Check if any block in the non-localized field value matches the predicate function.
529
524
  * Returns true as soon as the first matching block is found (short-circuit evaluation).
530
525
  *
531
- * @param field - The DatoCMS field definition that determines how blocks are processed
532
- * @param value - The field value containing blocks to test
526
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
527
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to test
533
528
  * @param predicate - Asynchronous function that tests each block. Should return true for matching blocks
534
529
  * @returns Promise that resolves to true if any block matches, false otherwise
535
530
  */
536
- function nonRecursiveSomeBlocksInFieldValueAsync(field, value, predicate) {
531
+ function nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, predicate) {
537
532
  var _a, e_6, _b, _c;
538
533
  return __awaiter(this, void 0, void 0, function* () {
539
534
  try {
540
- for (var _d = true, _e = __asyncValues(iterateBlocksAsync(field, value)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
535
+ for (var _d = true, _e = __asyncValues(iterateBlocksAsync(fieldType, nonLocalizedFieldValue)), _f; _f = yield _e.next(), _a = _f.done, !_a;) {
541
536
  _c = _f.value;
542
537
  _d = false;
543
538
  try {
@@ -561,37 +556,37 @@ function nonRecursiveSomeBlocksInFieldValueAsync(field, value, predicate) {
561
556
  return false;
562
557
  });
563
558
  }
564
- exports.nonRecursiveSomeBlocksInFieldValueAsync = nonRecursiveSomeBlocksInFieldValueAsync;
559
+ exports.nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync = nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync;
565
560
  /**
566
- * Check if every block in the field value matches the predicate function.
561
+ * Check if every block in the non-localized field value matches the predicate function.
567
562
  * Returns false as soon as the first non-matching block is found (short-circuit evaluation).
568
563
  *
569
- * @param field - The DatoCMS field definition that determines how blocks are processed
570
- * @param value - The field value containing blocks to test
564
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
565
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to test
571
566
  * @param predicate - Synchronous function that tests each block. Should return true for valid blocks
572
567
  * @returns True if all blocks match, false otherwise
573
568
  */
574
- function nonRecursiveEveryBlockInFieldValue(field, value, predicate) {
575
- return !nonRecursiveSomeBlocksInFieldValue(field, value, (item, path) => {
569
+ function nonRecursiveEveryBlockInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, predicate) {
570
+ return !nonRecursiveSomeBlocksInNonLocalizedFieldValue(fieldType, nonLocalizedFieldValue, (item, path) => {
576
571
  return !predicate(item, path);
577
572
  });
578
573
  }
579
- exports.nonRecursiveEveryBlockInFieldValue = nonRecursiveEveryBlockInFieldValue;
574
+ exports.nonRecursiveEveryBlockInNonLocalizedFieldValue = nonRecursiveEveryBlockInNonLocalizedFieldValue;
580
575
  /**
581
- * Check if every block in the field value matches the predicate function.
576
+ * Check if every block in the non-localized field value matches the predicate function.
582
577
  * Returns false as soon as the first non-matching block is found (short-circuit evaluation).
583
578
  *
584
- * @param field - The DatoCMS field definition that determines how blocks are processed
585
- * @param value - The field value containing blocks to test
579
+ * @param fieldType - The type of DatoCMS field definition that determines how the value is processed
580
+ * @param nonLocalizedFieldValue - The non-localized field value containing blocks to test
586
581
  * @param predicate - Asynchronous function that tests each block. Should return true for valid blocks
587
582
  * @returns Promise that resolves to true if all blocks match, false otherwise
588
583
  */
589
- function nonRecursiveEveryBlockInFieldValueAsync(field, value, predicate) {
584
+ function nonRecursiveEveryBlockInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, predicate) {
590
585
  return __awaiter(this, void 0, void 0, function* () {
591
- return !(yield nonRecursiveSomeBlocksInFieldValueAsync(field, value, (item, path) => __awaiter(this, void 0, void 0, function* () {
586
+ return !(yield nonRecursiveSomeBlocksInNonLocalizedFieldValueAsync(fieldType, nonLocalizedFieldValue, (item, path) => __awaiter(this, void 0, void 0, function* () {
592
587
  return !(yield predicate(item, path));
593
588
  })));
594
589
  });
595
590
  }
596
- exports.nonRecursiveEveryBlockInFieldValueAsync = nonRecursiveEveryBlockInFieldValueAsync;
597
- //# sourceMappingURL=blocks.js.map
591
+ exports.nonRecursiveEveryBlockInNonLocalizedFieldValueAsync = nonRecursiveEveryBlockInNonLocalizedFieldValueAsync;
592
+ //# sourceMappingURL=nonRecursiveBlocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nonRecursiveBlocks.js","sourceRoot":"","sources":["../../../src/utilities/nonRecursiveBlocks.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iFAQuC;AAcvC,mEAAgE;AAehE,QAAQ,CAAC,CAAC,aAAa,CACrB,SAAuC,EACvC,sBAA+B;IAE/B,IAAI,IAAA,6CAAqB,EAAC,sBAAsB,CAAC,EAAE;QACjD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;KAC7D;IAED,IAAI,SAAS,KAAK,WAAW,EAAE;QAC7B,MAAM,aAAa,GAAG,sBAA+C,CAAC;QACtE,IAAI,aAAa,EAAE;YACjB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBACzD,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAE,CAAC;gBACnC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;aAC/B;SACF;QACD,OAAO;KACR;IAED,IAAI,SAAS,KAAK,cAAc,EAAE;QAChC,MAAM,gBAAgB,GAAG,sBAAkD,CAAC;QAC5E,IA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