@builder.io/mitosis 0.0.45 → 0.0.46

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 (206) hide show
  1. package/dist/src/__tests__/builder.test.js +71 -68
  2. package/dist/src/__tests__/context.test.js +13 -10
  3. package/dist/src/__tests__/data/basic.raw.jsx +1 -1
  4. package/dist/src/__tests__/data/blocks/button-with-metadata.raw.jsx +1 -1
  5. package/dist/src/__tests__/data/blocks/columns.raw.jsx +2 -2
  6. package/dist/src/__tests__/data/blocks/custom-code.raw.jsx +3 -3
  7. package/dist/src/__tests__/data/blocks/embed.raw.jsx +3 -3
  8. package/dist/src/__tests__/data/blocks/form.raw.jsx +5 -5
  9. package/dist/src/__tests__/data/blocks/image.raw.jsx +4 -4
  10. package/dist/src/__tests__/data/blocks/stamped-io.raw.jsx +4 -4
  11. package/dist/src/__tests__/data/context/component-with-context.lite.jsx +2 -2
  12. package/dist/src/__tests__/data/context/simple.context.lite.js +1 -1
  13. package/dist/src/__tests__/html.test.js +2 -2
  14. package/dist/src/__tests__/liquid.test.js +34 -34
  15. package/dist/src/__tests__/parse-jsx.test.js +1 -1
  16. package/dist/src/__tests__/qwik.test.js +36 -36
  17. package/dist/src/__tests__/react-native.test.js +35 -35
  18. package/dist/src/__tests__/react.test.js +35 -35
  19. package/dist/src/__tests__/solid.test.js +32 -32
  20. package/dist/src/__tests__/vue.test.js +35 -34
  21. package/dist/src/generators/angular.d.ts +4 -7
  22. package/dist/src/generators/angular.js +77 -81
  23. package/dist/src/generators/builder.d.ts +4 -4
  24. package/dist/src/generators/builder.js +57 -57
  25. package/dist/src/generators/context/react.d.ts +3 -1
  26. package/dist/src/generators/context/react.js +20 -17
  27. package/dist/src/generators/html.d.ts +5 -9
  28. package/dist/src/generators/html.js +205 -199
  29. package/dist/src/generators/liquid.d.ts +5 -9
  30. package/dist/src/generators/liquid.js +62 -59
  31. package/dist/src/generators/mitosis.d.ts +6 -7
  32. package/dist/src/generators/mitosis.js +61 -63
  33. package/dist/src/generators/qwik/component.js +13 -13
  34. package/dist/src/generators/qwik/handlers.js +12 -8
  35. package/dist/src/generators/qwik/jsx.js +13 -9
  36. package/dist/src/generators/qwik/styles.js +11 -7
  37. package/dist/src/generators/react-native.d.ts +4 -7
  38. package/dist/src/generators/react-native.js +25 -22
  39. package/dist/src/generators/react.d.ts +4 -8
  40. package/dist/src/generators/react.js +103 -112
  41. package/dist/src/generators/solid.d.ts +4 -8
  42. package/dist/src/generators/solid.js +55 -54
  43. package/dist/src/generators/svelte.d.ts +4 -7
  44. package/dist/src/generators/svelte.js +120 -123
  45. package/dist/src/generators/swift-ui.d.ts +2 -2
  46. package/dist/src/generators/swift-ui.js +62 -62
  47. package/dist/src/generators/template.d.ts +4 -8
  48. package/dist/src/generators/template.js +48 -45
  49. package/dist/src/generators/vue.d.ts +9 -9
  50. package/dist/src/generators/vue.js +169 -169
  51. package/dist/src/helpers/babel-transform.js +9 -9
  52. package/dist/src/helpers/collect-styles.js +39 -39
  53. package/dist/src/helpers/dash-case.js +1 -1
  54. package/dist/src/helpers/generic-format.test.js +2 -2
  55. package/dist/src/helpers/get-components-used.js +2 -2
  56. package/dist/src/helpers/get-components.js +3 -3
  57. package/dist/src/helpers/get-props.js +1 -1
  58. package/dist/src/helpers/get-refs.js +2 -2
  59. package/dist/src/helpers/get-state-object-string.js +5 -5
  60. package/dist/src/helpers/get-state-used.js +1 -1
  61. package/dist/src/helpers/get-styles.js +1 -1
  62. package/dist/src/helpers/getters-to-functions.js +4 -4
  63. package/dist/src/helpers/handle-missing-state.js +1 -1
  64. package/dist/src/helpers/has-component.js +2 -2
  65. package/dist/src/helpers/has-props.js +1 -1
  66. package/dist/src/helpers/is-children.js +1 -1
  67. package/dist/src/helpers/json.d.ts +1 -0
  68. package/dist/src/helpers/json.js +17 -0
  69. package/dist/src/helpers/map-refs.js +4 -4
  70. package/dist/src/helpers/map-to-attributes.js +4 -4
  71. package/dist/src/helpers/map-to-css.js +2 -2
  72. package/dist/src/helpers/parse-node.js +2 -2
  73. package/dist/src/helpers/parse-reactive-script.js +4 -4
  74. package/dist/src/helpers/process-http-requests.js +1 -1
  75. package/dist/src/helpers/process-tag-references.js +4 -4
  76. package/dist/src/helpers/remove-surrounding-block.test.js +1 -1
  77. package/dist/src/helpers/render-imports.js +7 -7
  78. package/dist/src/helpers/replace-idenifiers.js +1 -1
  79. package/dist/src/helpers/strip-meta-properties.js +2 -2
  80. package/dist/src/helpers/trace-reference-to-module-path.js +1 -1
  81. package/dist/src/helpers/traverse-nodes.js +2 -2
  82. package/dist/src/helpers/try-prettier-format.js +1 -1
  83. package/dist/src/index.d.ts +2 -0
  84. package/dist/src/index.js +2 -0
  85. package/dist/src/modules/plugins.d.ts +2 -10
  86. package/dist/src/parsers/angular.js +13 -13
  87. package/dist/src/parsers/builder.js +54 -58
  88. package/dist/src/parsers/context.js +2 -2
  89. package/dist/src/parsers/jsx.js +59 -87
  90. package/dist/src/parsers/liquid.js +191 -194
  91. package/dist/src/plugins/compile-away-builder-components.js +49 -45
  92. package/dist/src/plugins/compile-away-components.js +3 -3
  93. package/dist/src/plugins/map-styles.js +3 -3
  94. package/dist/src/targets.d.ts +24 -0
  95. package/dist/src/targets.js +30 -0
  96. package/dist/src/types/config.d.ts +31 -0
  97. package/dist/src/types/{jsx-lite-component.js → config.js} +0 -0
  98. package/dist/{test/qwik/Todo/Todo.js/low.js → src/types/generators.d.ts} +0 -0
  99. package/dist/src/types/generators.js +1 -0
  100. package/dist/src/types/plugins.d.ts +11 -0
  101. package/dist/src/types/{jsx-lite-context.js → plugins.js} +0 -0
  102. package/dist/test/qwik/{Todo → todo}/Todo.cjs/high.cjs +0 -0
  103. package/dist/test/qwik/{Todo → todo}/Todo.cjs/low.cjs +0 -0
  104. package/dist/test/qwik/{Todo → todo}/Todo.cjs/med.cjs +0 -0
  105. package/dist/test/qwik/{Todo → todo}/Todo.js/high.js +0 -0
  106. package/dist/test/qwik/{qwik/todo → todo}/Todo.js/low.js +0 -0
  107. package/dist/test/qwik/{Todo → todo}/Todo.js/med.js +0 -0
  108. package/dist/test/qwik/{Todo → todo}/Todo.tsx/high.tsx +0 -0
  109. package/dist/test/qwik/{Todo → todo}/Todo.tsx/low.tsx +0 -0
  110. package/dist/test/qwik/{Todo → todo}/Todo.tsx/med.tsx +0 -0
  111. package/dist/test/qwik/{Todos → todos}/Todo.tsx/high.tsx +0 -0
  112. package/dist/test/qwik/{Todos → todos}/Todo.tsx/low.tsx +0 -0
  113. package/dist/test/qwik/{Todos → todos}/Todo.tsx/med.tsx +0 -0
  114. package/dist/tsconfig.tsbuildinfo +1 -1
  115. package/package.json +2 -2
  116. package/dist/src/__tests__/data/blocks/tabs.raw.d.ts +0 -11
  117. package/dist/src/__tests__/data/blocks/tabs.raw.jsx +0 -24
  118. package/dist/src/__tests__/qoot.test.d.ts +0 -1
  119. package/dist/src/__tests__/qoot.test.js +0 -115
  120. package/dist/src/generators/jsx-lite.d.ts +0 -10
  121. package/dist/src/generators/jsx-lite.js +0 -176
  122. package/dist/src/generators/qoot.d.ts +0 -21
  123. package/dist/src/generators/qoot.js +0 -442
  124. package/dist/src/generators/qwik.d.ts +0 -21
  125. package/dist/src/generators/qwik.js +0 -458
  126. package/dist/src/helpers/create-jsx-lite-component.d.ts +0 -2
  127. package/dist/src/helpers/create-jsx-lite-component.js +0 -16
  128. package/dist/src/helpers/create-jsx-lite-context.d.ts +0 -4
  129. package/dist/src/helpers/create-jsx-lite-context.js +0 -18
  130. package/dist/src/helpers/create-jsx-lite-node.d.ts +0 -2
  131. package/dist/src/helpers/create-jsx-lite-node.js +0 -16
  132. package/dist/src/helpers/is-jsx-lite-node.d.ts +0 -2
  133. package/dist/src/helpers/is-jsx-lite-node.js +0 -7
  134. package/dist/src/types/jsx-lite-component.d.ts +0 -63
  135. package/dist/src/types/jsx-lite-context.d.ts +0 -6
  136. package/dist/src/types/jsx-lite-node.d.ts +0 -13
  137. package/dist/src/types/jsx-lite-node.js +0 -2
  138. package/dist/src/types/jsx-lite-styles.d.ts +0 -1
  139. package/dist/src/types/jsx-lite-styles.js +0 -2
  140. package/dist/test/qoot/Todo/bundle.js +0 -88
  141. package/dist/test/qoot/Todo/component.ts +0 -17
  142. package/dist/test/qoot/Todo/onButtonClick.ts +0 -13
  143. package/dist/test/qoot/Todo/onInput2Blur.ts +0 -11
  144. package/dist/test/qoot/Todo/onInput2KeyUp.ts +0 -10
  145. package/dist/test/qoot/Todo/onInputClick.ts +0 -10
  146. package/dist/test/qoot/Todo/onLabelDblClick.ts +0 -11
  147. package/dist/test/qoot/Todo/public.ts +0 -4
  148. package/dist/test/qoot/Todo/template.tsx +0 -46
  149. package/dist/test/qoot/Todos/component.ts +0 -9
  150. package/dist/test/qoot/Todos/onInputClick.ts +0 -14
  151. package/dist/test/qoot/Todos/public.ts +0 -3
  152. package/dist/test/qoot/Todos/template.tsx +0 -30
  153. package/dist/test/qwik/Todo/bundle.js +0 -46
  154. package/dist/test/qwik/Todo/component.ts +0 -17
  155. package/dist/test/qwik/Todo/onButtonClick.ts +0 -10
  156. package/dist/test/qwik/Todo/onInput2Blur.ts +0 -14
  157. package/dist/test/qwik/Todo/onInput2KeyUp.ts +0 -10
  158. package/dist/test/qwik/Todo/onInputClick.ts +0 -13
  159. package/dist/test/qwik/Todo/onLabelDblClick.ts +0 -11
  160. package/dist/test/qwik/Todo/public.ts +0 -3
  161. package/dist/test/qwik/Todo/template.tsx +0 -46
  162. package/dist/test/qwik/Todo.ts +0 -4
  163. package/dist/test/qwik/Todo_component.ts +0 -17
  164. package/dist/test/qwik/Todo_onButtonClick.ts +0 -13
  165. package/dist/test/qwik/Todo_onInput2Blur.ts +0 -14
  166. package/dist/test/qwik/Todo_onInput2KeyUp.ts +0 -10
  167. package/dist/test/qwik/Todo_onInputClick.ts +0 -13
  168. package/dist/test/qwik/Todo_onLabelDblClick.ts +0 -14
  169. package/dist/test/qwik/Todo_template.tsx +0 -46
  170. package/dist/test/qwik/Todos/component.ts +0 -9
  171. package/dist/test/qwik/Todos/onInputClick.ts +0 -14
  172. package/dist/test/qwik/Todos/public.ts +0 -3
  173. package/dist/test/qwik/Todos/template.tsx +0 -30
  174. package/dist/test/qwik/Todos.ts +0 -3
  175. package/dist/test/qwik/Todos_component.ts +0 -9
  176. package/dist/test/qwik/Todos_onInputClick.ts +0 -14
  177. package/dist/test/qwik/Todos_template.tsx +0 -30
  178. package/dist/test/qwik/qwik/Image/high.js +0 -1
  179. package/dist/test/qwik/qwik/Image/low.js +0 -75
  180. package/dist/test/qwik/qwik/Image/med.js +0 -9
  181. package/dist/test/qwik/qwik/Image.slow/high.js +0 -1
  182. package/dist/test/qwik/qwik/Image.slow/low.js +0 -75
  183. package/dist/test/qwik/qwik/Image.slow/med.js +0 -9
  184. package/dist/test/qwik/qwik/button/high.js +0 -8
  185. package/dist/test/qwik/qwik/button/low.js +0 -34
  186. package/dist/test/qwik/qwik/button/med.js +0 -9
  187. package/dist/test/qwik/qwik/hello_world/stylesheet/high.jsx +0 -1
  188. package/dist/test/qwik/qwik/hello_world/stylesheet/low.jsx +0 -24
  189. package/dist/test/qwik/qwik/hello_world/stylesheet/med.jsx +0 -9
  190. package/dist/test/qwik/qwik/page-with-symbol/high.js +0 -1
  191. package/dist/test/qwik/qwik/page-with-symbol/low.js +0 -49
  192. package/dist/test/qwik/qwik/page-with-symbol/med.js +0 -9
  193. package/dist/test/qwik/qwik/svg/high.js +0 -1
  194. package/dist/test/qwik/qwik/svg/low.js +0 -30
  195. package/dist/test/qwik/qwik/svg/med.js +0 -9
  196. package/dist/test/qwik/qwik/todo/Todo.cjs/high.cjs +0 -31
  197. package/dist/test/qwik/qwik/todo/Todo.cjs/low.cjs +0 -1
  198. package/dist/test/qwik/qwik/todo/Todo.cjs/med.cjs +0 -59
  199. package/dist/test/qwik/qwik/todo/Todo.js/high.js +0 -5
  200. package/dist/test/qwik/qwik/todo/Todo.js/med.js +0 -1
  201. package/dist/test/qwik/qwik/todo/Todo.tsx/high.tsx +0 -30
  202. package/dist/test/qwik/qwik/todo/Todo.tsx/low.tsx +0 -1
  203. package/dist/test/qwik/qwik/todo/Todo.tsx/med.tsx +0 -34
  204. package/dist/test/qwik/qwik/todos/Todo.tsx/high.tsx +0 -12
  205. package/dist/test/qwik/qwik/todos/Todo.tsx/low.tsx +0 -24
  206. package/dist/test/qwik/qwik/todos/Todo.tsx/med.tsx +0 -8
@@ -65,10 +65,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
65
65
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
66
66
  }
67
67
  };
68
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
69
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
70
- to[j] = from[i];
71
- return to;
68
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
69
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
70
+ if (ar || !(i in from)) {
71
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
72
+ ar[i] = from[i];
73
+ }
74
+ }
75
+ return to.concat(ar || Array.prototype.slice.call(from));
72
76
  };
73
77
  var __importDefault = (this && this.__importDefault) || function (mod) {
74
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -168,7 +172,7 @@ var getConditionalAttr = function (value, noEnd) {
168
172
  ? getConditionalAttr(statement.substr(index + 2), true)
169
173
  : getValue(statement);
170
174
  if (expression) {
171
- return "{% " + expression + " " + condition + " %} " + branchValue;
175
+ return "{% ".concat(expression, " ").concat(condition, " %} ").concat(branchValue);
172
176
  }
173
177
  return branchValue + '{% endif %}';
174
178
  })
@@ -202,7 +206,7 @@ exports.getLiquidConditionExpresion = getLiquidConditionExpresion;
202
206
  var convertBinding = function (binding, options) {
203
207
  var value = binding;
204
208
  var isShopifyContext = value.replace(/\s/g, '').includes('.liquid');
205
- if (!liquid_1.isValidLiquidBinding(binding)) {
209
+ if (!(0, liquid_1.isValidLiquidBinding)(binding)) {
206
210
  return '';
207
211
  }
208
212
  if (isLiquidConditional(value)) {
@@ -226,13 +230,13 @@ var convertBinding = function (binding, options) {
226
230
  function blockToLiquid(json, options) {
227
231
  var _a, _b, _c, _d;
228
232
  if (options === void 0) { options = {}; }
229
- var block = fast_clone_1.fastClone(json);
233
+ var block = (0, fast_clone_1.fastClone)(json);
230
234
  var bindings = __assign(__assign({}, block.bindings), (_a = block.code) === null || _a === void 0 ? void 0 : _a.bindings);
231
- var hasInvalidHide = bindings.hide && !liquid_1.isValidLiquidBinding(bindings.hide);
232
- var hasInvalidShow = bindings.show && !liquid_1.isValidLiquidBinding(bindings.show);
235
+ var hasInvalidHide = bindings.hide && !(0, liquid_1.isValidLiquidBinding)(bindings.hide);
236
+ var hasInvalidShow = bindings.show && !(0, liquid_1.isValidLiquidBinding)(bindings.show);
233
237
  var hasInvalidRepeat = block.repeat &&
234
238
  block.repeat.collection &&
235
- !liquid_1.isValidLiquidBinding(block.repeat.collection);
239
+ !(0, liquid_1.isValidLiquidBinding)(block.repeat.collection);
236
240
  if (hasInvalidHide || hasInvalidShow || hasInvalidRepeat) {
237
241
  return '';
238
242
  }
@@ -252,7 +256,7 @@ function blockToLiquid(json, options) {
252
256
  valueString = value;
253
257
  }
254
258
  else {
255
- valueString = "{{ " + value + " }}";
259
+ valueString = "{{ ".concat(value, " }}");
256
260
  }
257
261
  // Preserve default styles for those bound
258
262
  if (!value && key.startsWith('style')) {
@@ -265,7 +269,7 @@ function blockToLiquid(json, options) {
265
269
  var name_1 = key.startsWith('properties.')
266
270
  ? key.replace(/^\s*properties\s*\./, '')
267
271
  : key;
268
- lodash_1.set(block.properties, name_1, valueString);
272
+ (0, lodash_1.set)(block.properties, name_1, valueString);
269
273
  }
270
274
  else if (key.startsWith('component.options.') ||
271
275
  key.startsWith('options.')) {
@@ -276,31 +280,31 @@ function blockToLiquid(json, options) {
276
280
  if (!block.component.options) {
277
281
  block.component.options = {};
278
282
  }
279
- lodash_1.set(block.component.options, name_2, valueString);
283
+ (0, lodash_1.set)(block.component.options, name_2, valueString);
280
284
  }
281
285
  else if (key.startsWith('style.')) {
282
286
  var name_3 = key.replace('style.', '');
283
- lodash_1.set(styles, name_3, valueString);
287
+ (0, lodash_1.set)(styles, name_3, valueString);
284
288
  }
285
289
  else if (key === 'attr.style') {
286
290
  if (!block.properties) {
287
291
  block.properties = {};
288
292
  }
289
- lodash_1.set(block.properties, 'style', valueString);
293
+ (0, lodash_1.set)(block.properties, 'style', valueString);
290
294
  }
291
295
  }
292
296
  }
293
297
  // TODO: bindings with {{}} as values
294
298
  var css = blockCss(block, options);
295
299
  var stylesList = [];
296
- if (lodash_1.size(styles)) {
297
- stylesList.push(map_to_css_1.mapToCss(styles, 0));
300
+ if ((0, lodash_1.size)(styles)) {
301
+ stylesList.push((0, map_to_css_1.mapToCss)(styles, 0));
298
302
  }
299
303
  if ((_b = block.properties) === null || _b === void 0 ? void 0 : _b.style) {
300
304
  stylesList.push(block.properties.style);
301
305
  }
302
306
  var bindingClass = ((_c = block.bindings) === null || _c === void 0 ? void 0 : _c.class) && convertBinding(block.bindings.class, options);
303
- var classes = lodash_1.uniq([
307
+ var classes = (0, lodash_1.uniq)([
304
308
  // 'builder-block',
305
309
  block.id,
306
310
  block.class,
@@ -308,20 +312,20 @@ function blockToLiquid(json, options) {
308
312
  (_d = block.properties) === null || _d === void 0 ? void 0 : _d.class,
309
313
  ]).filter(lodash_1.identity);
310
314
  var componentInfo = null;
311
- var attributes = map_to_attributes_1.mapToAttributes(__assign(__assign(__assign({}, block.properties), {
315
+ var attributes = (0, map_to_attributes_1.mapToAttributes)(__assign(__assign(__assign({}, block.properties), {
312
316
  // ['builder-id']: block.id,
313
- class: classes.join(' ') }), (lodash_1.size(stylesList) && {
317
+ class: classes.join(' ') }), ((0, lodash_1.size)(stylesList) && {
314
318
  style: stylesList.join(';'),
315
319
  })));
316
320
  var tag = block.tagName || (block.properties && block.properties.href ? 'a' : 'div');
317
321
  if (options.openingTagOnly) {
318
- return "<" + tag + (attributes ? ' ' + attributes : '') + ">";
322
+ return "<".concat(tag).concat(attributes ? ' ' + attributes : '', ">");
319
323
  }
320
324
  if (block.component && !componentInfo) {
321
- console.warn("Could not find component: " + block.component.name);
325
+ console.warn("Could not find component: ".concat(block.component.name));
322
326
  }
323
327
  var collectionName = block.repeat &&
324
- lodash_1.last((block.repeat.collection || '')
328
+ (0, lodash_1.last)((block.repeat.collection || '')
325
329
  .trim()
326
330
  .split('(')[0]
327
331
  .trim()
@@ -329,23 +333,23 @@ function blockToLiquid(json, options) {
329
333
  if (collectionName) {
330
334
  collectionName = convertBinding(collectionName, options);
331
335
  }
332
- return "\n " + (css.trim() ? "<style>" + css + "</style>" : '') + "\n " + (!options.static &&
336
+ return "\n ".concat(css.trim() ? "<style>".concat(css, "</style>") : '', "\n ").concat(!options.static &&
333
337
  block.repeat &&
334
338
  block.repeat.collection &&
335
- liquid_1.isValidLiquidBinding(block.repeat.collection)
336
- ? "{% for " + (block.repeat.itemName ||
337
- collectionName + '_item') + " in " + convertBinding(block.repeat.collection, options) + " %}"
338
- : '') + "\n " + (!options.static && bindings.hide
339
- ? "{% unless " + (!liquid_1.isValidLiquidBinding(bindings.hide)
339
+ (0, liquid_1.isValidLiquidBinding)(block.repeat.collection)
340
+ ? "{% for ".concat(block.repeat.itemName ||
341
+ collectionName + '_item', " in ").concat(convertBinding(block.repeat.collection, options), " %}")
342
+ : '', "\n ").concat(!options.static && bindings.hide
343
+ ? "{% unless ".concat(!(0, liquid_1.isValidLiquidBinding)(bindings.hide)
340
344
  ? 'false'
341
- : convertBinding(bindings.hide, options)) + " %}"
342
- : '') + "\n " + (!options.static && bindings.show
343
- ? "{% if " + (!liquid_1.isValidLiquidBinding(bindings.show)
345
+ : convertBinding(bindings.hide, options), " %}")
346
+ : '', "\n ").concat(!options.static && bindings.show
347
+ ? "{% if ".concat(!(0, liquid_1.isValidLiquidBinding)(bindings.show)
344
348
  ? 'false'
345
- : convertBinding(bindings.show, options)) + " %}"
346
- : '') + "\n " + (!options.static && bindings.hide ? '{% endunless %}' : '') + "\n " + (!options.static && bindings.show ? '{% endif %}' : '') + "\n " + (!options.static && block.repeat && block.repeat.collection
349
+ : convertBinding(bindings.show, options), " %}")
350
+ : '', "\n ").concat(!options.static && bindings.hide ? '{% endunless %}' : '', "\n ").concat(!options.static && bindings.show ? '{% endif %}' : '', "\n ").concat(!options.static && block.repeat && block.repeat.collection
347
351
  ? '{% endfor %}'
348
- : '') + "\n ";
352
+ : '', "\n ");
349
353
  }
350
354
  exports.blockToLiquid = blockToLiquid;
351
355
  // TODO: make these core functions and share with react, vue, etc
@@ -357,7 +361,7 @@ function blockCss(block, options) {
357
361
  var baseStyles = __assign({}, (self.responsiveStyles && self.responsiveStyles.large));
358
362
  var css = options.emailMode
359
363
  ? ''
360
- : ".builder-block." + self.id + " {" + map_to_css_1.mapToCss(baseStyles) + "}";
364
+ : ".builder-block.".concat(self.id, " {").concat((0, map_to_css_1.mapToCss)(baseStyles), "}");
361
365
  var reversedNames = sizeNames.slice().reverse();
362
366
  if (self.responsiveStyles) {
363
367
  for (var _i = 0, reversedNames_1 = reversedNames; _i < reversedNames_1.length; _i++) {
@@ -371,15 +375,15 @@ function blockCss(block, options) {
371
375
  Object.keys(self.responsiveStyles[size_2]).length) {
372
376
  // TODO: this will not work as expected for a couple things that are handled specially,
373
377
  // e.g. width
374
- css += "\n@media only screen and (max-width: " + sizes[size_2].max + "px) { \n" + (options.emailMode ? '.' : '.builder-block.') + (self.id +
375
- (options.emailMode ? '-subject' : '')) + " {" + map_to_css_1.mapToCss(self.responsiveStyles[size_2], 4, options.emailMode) + " } }";
378
+ css += "\n@media only screen and (max-width: ".concat(sizes[size_2].max, "px) { \n").concat(options.emailMode ? '.' : '.builder-block.').concat(self.id +
379
+ (options.emailMode ? '-subject' : ''), " {").concat((0, map_to_css_1.mapToCss)(self.responsiveStyles[size_2], 4, options.emailMode), " } }");
376
380
  }
377
381
  }
378
382
  }
379
383
  return css;
380
384
  }
381
385
  function humanCase(str) {
382
- return lodash_1.capitalize(lodash_1.kebabCase(str)
386
+ return (0, lodash_1.capitalize)((0, lodash_1.kebabCase)(str)
383
387
  .replace(/[- ]+/g, ' ')
384
388
  .trim());
385
389
  }
@@ -404,10 +408,10 @@ var https = serverOnlyRequire('https');
404
408
  var httpAgent = (http && new http.Agent({ keepAlive: true })) || undefined;
405
409
  var httpsAgent = (https && new https.Agent({ keepAlive: true })) || undefined;
406
410
  var serializedBlockTagName = 'builder-serialized-block';
407
- var serializedBlockCloseTag = "</" + serializedBlockTagName + ">";
411
+ var serializedBlockCloseTag = "</".concat(serializedBlockTagName, ">");
408
412
  var serializeBlock = function (el, close) {
409
413
  if (close === void 0) { close = true; }
410
- var str = "<" + serializedBlockTagName + " block='" + htmlEncode(JSON.stringify(el)) + "'>";
414
+ var str = "<".concat(serializedBlockTagName, " block='").concat(htmlEncode(JSON.stringify(el)), "'>");
411
415
  if (close) {
412
416
  str += serializedBlockCloseTag;
413
417
  }
@@ -420,7 +424,7 @@ var mapArrays = function (source) {
420
424
  }
421
425
  var newArrays = Object.keys(source).reduce(function (acc, key) {
422
426
  var _a;
423
- var orderKey = key.slice(0, -1) + "_order";
427
+ var orderKey = "".concat(key.slice(0, -1), "_order");
424
428
  if (source[orderKey]) {
425
429
  return __assign((_a = {}, _a[key] = source[orderKey].map(function (id) { return source[key][id]; }), _a), acc);
426
430
  }
@@ -436,7 +440,7 @@ var axios = axios_1.default.create({
436
440
  adapter: axiosCache.adapter,
437
441
  });
438
442
  var isSerializedBlock = function (str) {
439
- return str.includes("<" + serializedBlockTagName);
443
+ return str.includes("<".concat(serializedBlockTagName));
440
444
  };
441
445
  var deserializeBlock = function (str) {
442
446
  var parts = [];
@@ -453,7 +457,7 @@ var deserializeBlock = function (str) {
453
457
  return parts.join('');
454
458
  };
455
459
  var stringWithBindingsToLiquid = function (str) {
456
- var separated = exports.separateTagsAndText(str).map(function (item) { return item.text; });
460
+ var separated = (0, exports.separateTagsAndText)(str).map(function (item) { return item.text; });
457
461
  var liquidStr = '';
458
462
  var _loop_1 = function (item) {
459
463
  var tag = parseTag(item);
@@ -472,8 +476,8 @@ var stringWithBindingsToLiquid = function (str) {
472
476
  }
473
477
  }
474
478
  else if (isSerializedBlock(item)) {
475
- var block = lodash_1.attempt(function () { return deserializeBlock(item); });
476
- if (!lodash_1.isError(block)) {
479
+ var block = (0, lodash_1.attempt)(function () { return deserializeBlock(item); });
480
+ if (!(0, lodash_1.isError)(block)) {
477
481
  liquidStr += block;
478
482
  }
479
483
  else {
@@ -497,17 +501,17 @@ var isSimpleLiquidBinding = function (str) {
497
501
  var liquidBindingTemplate = function (str) {
498
502
  return isSimpleLiquidBinding(str)
499
503
  ? str
500
- : "liquid.get(\"" + str.replace(/\n+/g, ' ').replace(/"/g, '\\"') + "\")";
504
+ : "liquid.get(\"".concat(str.replace(/\n+/g, ' ').replace(/"/g, '\\"'), "\")");
501
505
  };
502
506
  var liquidRenderTemplate = function (str) {
503
507
  return isSimpleLiquidBinding(str)
504
508
  ? str
505
- : "liquid(\"" + str.replace(/\n+/g, ' ').replace(/"/g, '\\"') + "\")";
509
+ : "liquid(\"".concat(str.replace(/\n+/g, ' ').replace(/"/g, '\\"'), "\")");
506
510
  };
507
511
  var liquidConditionTemplate = function (str) {
508
512
  return isSimpleLiquidBinding(str)
509
513
  ? str
510
- : "liquid(\"" + str.replace(/\n+/g, ' ').replace(/"/g, '\\"') + "\")";
514
+ : "liquid(\"".concat(str.replace(/\n+/g, ' ').replace(/"/g, '\\"'), "\")");
511
515
  };
512
516
  var isIfTemplate = function (template) {
513
517
  return template.token.type === 'tag' && template.token.name === 'if';
@@ -547,9 +551,9 @@ var createHtmlAttribute = function (attribute, attributeValue) {
547
551
  if (attributeValue === void 0) { attributeValue = null; }
548
552
  var encodedValue = '';
549
553
  if (attributeValue) {
550
- encodedValue = "='" + htmlEncode(JSON.stringify(attributeValue)) + "'";
554
+ encodedValue = "='".concat(htmlEncode(JSON.stringify(attributeValue)), "'");
551
555
  }
552
- return "[" + attribute + "]" + encodedValue;
556
+ return "[".concat(attribute, "]").concat(encodedValue);
553
557
  };
554
558
  var COMMA_TOKEN = '__bldr_comma__';
555
559
  var parseArgList = function (args) {
@@ -579,8 +583,8 @@ var getSubstringTill = function (col, line, str) {
579
583
  };
580
584
  var transpileUnlessToIf = function (unlessTemplate) {
581
585
  var cond = unlessTemplate.impl.cond;
582
- var value = "if " + cond;
583
- var raw = "{% " + value + " %}";
586
+ var value = "if ".concat(cond);
587
+ var raw = "{% ".concat(value, " %}");
584
588
  return __assign(__assign({}, unlessTemplate), { impl: {
585
589
  branches: [
586
590
  {
@@ -590,8 +594,7 @@ var transpileUnlessToIf = function (unlessTemplate) {
590
594
  },
591
595
  ],
592
596
  elseTemplates: unlessTemplate.impl.elseTemplates,
593
- }, token: __assign(__assign({}, unlessTemplate.token), { raw: raw,
594
- value: value }) });
597
+ }, token: __assign(__assign({}, unlessTemplate.token), { raw: raw, value: value }) });
595
598
  };
596
599
  var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0, void 0, void 0, function () {
597
600
  function processTemplate(template, priorConditions) {
@@ -614,20 +617,20 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
614
617
  expression: psuedoTemplate.token.raw,
615
618
  negate: isUnlessTemplate(template),
616
619
  });
617
- isInsideAttribute = new RegExp("<[^>]*" + template.token.value).test(template.token.input);
620
+ isInsideAttribute = new RegExp("<[^>]*".concat(template.token.value)).test(template.token.input);
618
621
  index = 0;
619
622
  _10.label = 2;
620
623
  case 2:
621
624
  if (!(index < psuedoTemplate.impl.branches.length)) return [3 /*break*/, 10];
622
625
  item = psuedoTemplate.impl.branches[index];
623
626
  if (index === 0) {
624
- html += createHtmlAttribute('if', __assign(__assign({ fullRaw: psuedoTemplate.token.raw, cond: item.cond }, (item.negate && { negate: true })), { hash: object_hash_1.default(currentConditions) }));
627
+ html += createHtmlAttribute('if', __assign(__assign({ fullRaw: psuedoTemplate.token.raw, cond: item.cond }, (item.negate && { negate: true })), { hash: (0, object_hash_1.default)(currentConditions) }));
625
628
  }
626
629
  else {
627
630
  html += createHtmlAttribute('elsif', {
628
- fullRaw: "{% elsif " + item.cond + " %}",
631
+ fullRaw: "{% elsif ".concat(item.cond, " %}"),
629
632
  cond: item.cond,
630
- hash: object_hash_1.default(currentConditions),
633
+ hash: (0, object_hash_1.default)(currentConditions),
631
634
  });
632
635
  }
633
636
  if (!isInsideAttribute) return [3 /*break*/, 7];
@@ -678,7 +681,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
678
681
  return [4 /*yield*/, processInnerTemplates(psuedoTemplate.impl.elseTemplates, options, priorConditions.concat({
679
682
  expression: psuedoTemplate.token.raw,
680
683
  negate: !isUnlessTemplate(template),
681
- }), object_hash_1.default(currentConditions))];
684
+ }), (0, object_hash_1.default)(currentConditions))];
682
685
  case 16:
683
686
  html = _f + _10.sent();
684
687
  _10.label = 17;
@@ -695,13 +698,13 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
695
698
  case 19:
696
699
  if (!(index < template.impl.cases.length)) return [3 /*break*/, 29];
697
700
  item = template.impl.cases[index];
698
- condition = template.impl.cond + " == " + item.val;
701
+ condition = "".concat(template.impl.cond, " == ").concat(item.val);
699
702
  if (!(index === 0)) return [3 /*break*/, 24];
700
703
  firstCond = condition;
701
704
  html += createHtmlAttribute('if', {
702
- fullRaw: "{% if " + condition + " %}",
705
+ fullRaw: "{% if ".concat(condition, " %}"),
703
706
  cond: condition,
704
- hash: object_hash_1.default(condition),
707
+ hash: (0, object_hash_1.default)(condition),
705
708
  });
706
709
  _g = 0, _h = item.templates;
707
710
  _10.label = 20;
@@ -718,9 +721,9 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
718
721
  case 23: return [3 /*break*/, 28];
719
722
  case 24:
720
723
  html += createHtmlAttribute('elsif', {
721
- fullRaw: "{% elsif " + condition + " %}",
724
+ fullRaw: "{% elsif ".concat(condition, " %}"),
722
725
  cond: condition,
723
- hash: object_hash_1.default(firstCond),
726
+ hash: (0, object_hash_1.default)(firstCond),
724
727
  });
725
728
  _j = 0, _k = item.templates;
726
729
  _10.label = 25;
@@ -741,7 +744,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
741
744
  if (!(template.impl.elseTemplates && template.impl.elseTemplates.length)) return [3 /*break*/, 33];
742
745
  html += createHtmlAttribute('else', {
743
746
  fullRaw: '{% else %}',
744
- hash: object_hash_1.default(firstCond),
747
+ hash: (0, object_hash_1.default)(firstCond),
745
748
  });
746
749
  _l = 0, _m = template.impl.elseTemplates;
747
750
  _10.label = 30;
@@ -782,7 +785,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
782
785
  return [3 /*break*/, 84];
783
786
  case 39:
784
787
  if (!isOutputTemplate(template)) return [3 /*break*/, 40];
785
- html += createHtmlAttribute('output', __assign(__assign({}, template.value), { raw: template.token.value, fullRaw: "{{" + template.token.value + "}}" }));
788
+ html += createHtmlAttribute('output', __assign(__assign({}, template.value), { raw: template.token.value, fullRaw: "{{".concat(template.token.value, "}}") }));
786
789
  return [3 /*break*/, 84];
787
790
  case 40:
788
791
  name_4 = template.name || '';
@@ -870,7 +873,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
870
873
  .map(function (unwrappedTag) {
871
874
  var trimmedTag = unwrappedTag.trim();
872
875
  if (trimmedTag) {
873
- return "{% " + trimmedTag + " %}";
876
+ return "{% ".concat(trimmedTag, " %}");
874
877
  }
875
878
  return null;
876
879
  })
@@ -878,11 +881,9 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
878
881
  _w = html;
879
882
  _x = exports.parsedLiquidToHtml;
880
883
  _y = exports.liquidToAst;
881
- return [4 /*yield*/, exports.preprocessLiquid(wrappedLiquidTags.join(''))];
882
- case 50: return [4 /*yield*/, _y.apply(void 0, [_10.sent(),
883
- options])];
884
- case 51: return [4 /*yield*/, _x.apply(void 0, [_10.sent(),
885
- options])];
884
+ return [4 /*yield*/, (0, exports.preprocessLiquid)(wrappedLiquidTags.join(''))];
885
+ case 50: return [4 /*yield*/, _y.apply(void 0, [_10.sent(), options])];
886
+ case 51: return [4 /*yield*/, _x.apply(void 0, [_10.sent(), options])];
886
887
  case 52:
887
888
  html = _w + _10.sent();
888
889
  return [3 /*break*/, 84];
@@ -897,13 +898,13 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
897
898
  matched = args.match(/['"]([^'"]+)['"]/);
898
899
  path = matched && matched[1];
899
900
  if (!path) return [3 /*break*/, 64];
900
- return [4 /*yield*/, getShopifyAsset("sections/" + path + ".liquid", options)];
901
+ return [4 /*yield*/, getShopifyAsset("sections/".concat(path, ".liquid"), options)];
901
902
  case 56:
902
903
  currentAsset = _10.sent();
903
904
  if (!(currentAsset &&
904
- !lodash_1.isError(currentAsset) &&
905
+ !(0, lodash_1.isError)(currentAsset) &&
905
906
  themeSettings &&
906
- !lodash_1.isError(themeSettings))) return [3 /*break*/, 62];
907
+ !(0, lodash_1.isError)(themeSettings))) return [3 /*break*/, 62];
907
908
  schemaObject = {};
908
909
  schemaDefault = currentAsset.match(/{%-? schema -?%}([\s\S]*?){%-? endschema -?%}/);
909
910
  defaultSchemaObject_1 = {};
@@ -925,10 +926,10 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
925
926
  sectionSettingsState = Object.assign({}, defaultSchemaObject_1, themeSettings.current.sections[path].settings);
926
927
  themeSettings.current.sections[path].settings = sectionSettingsState;
927
928
  if (!(options.importSections === false)) return [3 /*break*/, 57];
928
- html += serializeBlock(__assign(__assign({ layerName: humanCase(path.replace('-template', '')) + " section", component: {
929
+ html += serializeBlock(__assign(__assign({ layerName: "".concat(humanCase(path.replace('-template', '')), " section"), component: {
929
930
  name: 'Shopify:SectionRef',
930
931
  options: {
931
- section: "sections/" + path + ".liquid",
932
+ section: "sections/".concat(path, ".liquid"),
932
933
  },
933
934
  } }, ((path === 'product-template' || path === 'product') && {
934
935
  properties: {
@@ -943,7 +944,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
943
944
  return [3 /*break*/, 61];
944
945
  case 57:
945
946
  html += serializeBlock({
946
- layerName: "Section: sections/" + path + ".liquid",
947
+ layerName: "Section: sections/".concat(path, ".liquid"),
947
948
  meta: {
948
949
  identifier: 'ShopifySection',
949
950
  },
@@ -954,12 +955,12 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
954
955
  shopifyMetafields: [
955
956
  {
956
957
  path: 'state.section',
957
- as: "_section_" + lodash_1.snakeCase(path),
958
+ as: "_section_".concat((0, lodash_1.snakeCase)(path)),
958
959
  },
959
960
  ],
960
961
  state: {
961
962
  section: mapArrays(themeSettings.current.sections[path]),
962
- _sourceFile: "sections/" + path + ".liquid",
963
+ _sourceFile: "sections/".concat(path, ".liquid"),
963
964
  },
964
965
  },
965
966
  },
@@ -967,11 +968,9 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
967
968
  _z = html;
968
969
  _0 = exports.parsedLiquidToHtml;
969
970
  _1 = exports.liquidToAst;
970
- return [4 /*yield*/, exports.preprocessLiquid(currentAsset)];
971
- case 58: return [4 /*yield*/, _1.apply(void 0, [_10.sent(),
972
- options])];
973
- case 59: return [4 /*yield*/, _0.apply(void 0, [_10.sent(),
974
- options])];
971
+ return [4 /*yield*/, (0, exports.preprocessLiquid)(currentAsset)];
972
+ case 58: return [4 /*yield*/, _1.apply(void 0, [_10.sent(), options])];
973
+ case 59: return [4 /*yield*/, _0.apply(void 0, [_10.sent(), options])];
975
974
  case 60:
976
975
  html = _z + _10.sent();
977
976
  html += serializedBlockCloseTag;
@@ -996,7 +995,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
996
995
  meta: {
997
996
  importedSnippet: args,
998
997
  },
999
- layerName: humanCase(path || '') + " block",
998
+ layerName: "".concat(humanCase(path || ''), " block"),
1000
999
  tagName: 'span',
1001
1000
  component: {
1002
1001
  name: 'Custom Code',
@@ -1018,7 +1017,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
1018
1017
  for (key in assigns_1) {
1019
1018
  if (assigns_1.hasOwnProperty(key)) {
1020
1019
  // TODO: use StateProvider for this. With getters?
1021
- assignString += "\n{% assign " + key + " = " + assigns_1[key] + " %}";
1020
+ assignString += "\n{% assign ".concat(key, " = ").concat(assigns_1[key], " %}");
1022
1021
  }
1023
1022
  }
1024
1023
  auth = options.auth, themeId = options.themeId;
@@ -1026,17 +1025,17 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
1026
1025
  publicKey = auth.publicKey, token = auth.token;
1027
1026
  if (!(publicKey && token)) return [3 /*break*/, 73];
1028
1027
  html += serializeBlock({
1029
- layerName: "Include: " + directory + "/" + path + ".liquid",
1028
+ layerName: "Include: ".concat(directory, "/").concat(path, ".liquid"),
1030
1029
  component: {
1031
1030
  name: 'Builder:StateProvider',
1032
1031
  options: {
1033
1032
  state: {
1034
- _sourceFile: directory + "/" + path + ".liquid",
1033
+ _sourceFile: "".concat(directory, "/").concat(path, ".liquid"),
1035
1034
  },
1036
1035
  },
1037
1036
  },
1038
1037
  }, false);
1039
- return [4 /*yield*/, getShopifyAsset(directory + "/" + path + ".liquid", options)];
1038
+ return [4 /*yield*/, getShopifyAsset("".concat(directory, "/").concat(path, ".liquid"), options)];
1040
1039
  case 68:
1041
1040
  currentAsset = _10.sent();
1042
1041
  if (!currentAsset) return [3 /*break*/, 72];
@@ -1044,10 +1043,9 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
1044
1043
  _2 = html;
1045
1044
  _3 = exports.parsedLiquidToHtml;
1046
1045
  _4 = exports.liquidToAst;
1047
- return [4 /*yield*/, exports.preprocessLiquid(value)];
1046
+ return [4 /*yield*/, (0, exports.preprocessLiquid)(value)];
1048
1047
  case 69: return [4 /*yield*/, _4.apply(void 0, [_10.sent(), options])];
1049
- case 70: return [4 /*yield*/, _3.apply(void 0, [_10.sent(),
1050
- options])];
1048
+ case 70: return [4 /*yield*/, _3.apply(void 0, [_10.sent(), options])];
1051
1049
  case 71:
1052
1050
  html = _2 + _10.sent();
1053
1051
  _10.label = 72;
@@ -1092,15 +1090,14 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
1092
1090
  // first, check to make sure the cycle index isn't greating than the forloop
1093
1091
  // then, calculate the check the remainder of current loop index divided by cycle length
1094
1092
  // if it's equal to the current cycle index, display the cycle value
1095
- newHtml += "\n {% assign remainder = forloop.index0| modulo:" + argList.length + " %}\n {% if forloop.length >= " + i + " and remainder == " + i + " %}\n {{" + argList[i] + "}}\n {% endif %}";
1093
+ newHtml += "\n {% assign remainder = forloop.index0| modulo:".concat(argList.length, " %}\n {% if forloop.length >= ").concat(i, " and remainder == ").concat(i, " %}\n {{").concat(argList[i], "}}\n {% endif %}");
1096
1094
  }
1097
1095
  _7 = html;
1098
1096
  _8 = exports.parsedLiquidToHtml;
1099
1097
  _9 = exports.liquidToAst;
1100
- return [4 /*yield*/, exports.preprocessLiquid(newHtml)];
1098
+ return [4 /*yield*/, (0, exports.preprocessLiquid)(newHtml)];
1101
1099
  case 80: return [4 /*yield*/, _9.apply(void 0, [_10.sent(), options])];
1102
- case 81: return [4 /*yield*/, _8.apply(void 0, [_10.sent(),
1103
- options])];
1100
+ case 81: return [4 /*yield*/, _8.apply(void 0, [_10.sent(), options])];
1104
1101
  case 82:
1105
1102
  html = _7 + _10.sent();
1106
1103
  return [3 /*break*/, 84];
@@ -1121,7 +1118,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
1121
1118
  return [4 /*yield*/, getShopifyAsset('config/settings_data.json', options)];
1122
1119
  case 1:
1123
1120
  themeAsset = _a.sent();
1124
- themeSettings = typeof themeAsset === 'string' && lodash_1.attempt(function () { return JSON.parse(themeAsset); });
1121
+ themeSettings = typeof themeAsset === 'string' && (0, lodash_1.attempt)(function () { return JSON.parse(themeAsset); });
1125
1122
  _i = 0, templates_1 = templates;
1126
1123
  _a.label = 2;
1127
1124
  case 2:
@@ -1141,7 +1138,7 @@ var parsedLiquidToHtml = function (templates, options) { return __awaiter(void 0
1141
1138
  exports.parsedLiquidToHtml = parsedLiquidToHtml;
1142
1139
  var flattenExpressions = function (conditionsArray, value) {
1143
1140
  return (conditionsArray
1144
- .map(function (c) { return (c.negate ? c.expression + " {% else %}" : c.expression); })
1141
+ .map(function (c) { return (c.negate ? "".concat(c.expression, " {% else %}") : c.expression); })
1145
1142
  .join(' ') +
1146
1143
  value +
1147
1144
  conditionsArray.map(function () { return "{% endif %}"; }));
@@ -1168,7 +1165,7 @@ function processInnerTemplates(templates, options, priorConditions, overrideHash
1168
1165
  'track',
1169
1166
  'wbr',
1170
1167
  ]);
1171
- return [4 /*yield*/, exports.parsedLiquidToHtml(templates, options)];
1168
+ return [4 /*yield*/, (0, exports.parsedLiquidToHtml)(templates, options)];
1172
1169
  case 1:
1173
1170
  html = _a.sent();
1174
1171
  processHtml = function (str) {
@@ -1182,7 +1179,7 @@ function processInnerTemplates(templates, options, priorConditions, overrideHash
1182
1179
  if (node.type === 'text') {
1183
1180
  result += node.value;
1184
1181
  }
1185
- else if (lodash_1.isNull(node.endSourceSpan) &&
1182
+ else if ((0, lodash_1.isNull)(node.endSourceSpan) &&
1186
1183
  !selfCloseTags.has(node.name)) {
1187
1184
  var block = {
1188
1185
  tagName: node.name,
@@ -1210,7 +1207,7 @@ function processInnerTemplates(templates, options, priorConditions, overrideHash
1210
1207
  options: {
1211
1208
  name: 'opencondtag',
1212
1209
  tag: node.name,
1213
- hash: overrideHash || object_hash_1.default(priorConditions),
1210
+ hash: overrideHash || (0, object_hash_1.default)(priorConditions),
1214
1211
  },
1215
1212
  },
1216
1213
  };
@@ -1237,7 +1234,7 @@ function processInnerTemplates(templates, options, priorConditions, overrideHash
1237
1234
  result += preErrorTag;
1238
1235
  result += createHtmlAttribute('endopencondtag', {
1239
1236
  hash: overrideHash ||
1240
- (priorConditions.length > 0 && object_hash_1.default(priorConditions)),
1237
+ (priorConditions.length > 0 && (0, object_hash_1.default)(priorConditions)),
1241
1238
  });
1242
1239
  // 3 is length of </>
1243
1240
  var leftovers = str.substring(preErrorTag.length + errorTag.length + 4);
@@ -1292,7 +1289,7 @@ var htmlNodeToBuilder = function (node, index, parentArray, options) { return __
1292
1289
  if (!(node.tag === 'builder-component')) return [3 /*break*/, 2];
1293
1290
  _a = el;
1294
1291
  _c = {};
1295
- return [4 /*yield*/, exports.htmlAstToBuilder(node.children, options)];
1292
+ return [4 /*yield*/, (0, exports.htmlAstToBuilder)(node.children, options)];
1296
1293
  case 1: return [2 /*return*/, _a.apply(void 0, [(_c.children = _h.sent(),
1297
1294
  _c)])];
1298
1295
  case 2:
@@ -1303,7 +1300,7 @@ var htmlNodeToBuilder = function (node, index, parentArray, options) { return __
1303
1300
  case 3:
1304
1301
  _h.trys.push([3, 5, , 6]);
1305
1302
  parsedBlock = JSON.parse(htmlDecode(node.attrsMap.block.replace(/"/g, '\\"')));
1306
- return [4 /*yield*/, exports.htmlAstToBuilder(node.children, options)];
1303
+ return [4 /*yield*/, (0, exports.htmlAstToBuilder)(node.children, options)];
1307
1304
  case 4:
1308
1305
  children = _h.sent();
1309
1306
  element = el(__assign(__assign({}, parsedBlock), (children.length > 0 && { children: children })));
@@ -1324,7 +1321,7 @@ var htmlNodeToBuilder = function (node, index, parentArray, options) { return __
1324
1321
  component: {
1325
1322
  name: 'Text',
1326
1323
  options: {
1327
- text: "Builder serialized block error: " + String(err_1),
1324
+ text: "Builder serialized block error: ".concat(String(err_1)),
1328
1325
  },
1329
1326
  },
1330
1327
  })];
@@ -1336,7 +1333,7 @@ var htmlNodeToBuilder = function (node, index, parentArray, options) { return __
1336
1333
  properties: {},
1337
1334
  bindings: {}
1338
1335
  };
1339
- return [4 /*yield*/, exports.htmlAstToBuilder(node.children, options)];
1336
+ return [4 /*yield*/, (0, exports.htmlAstToBuilder)(node.children, options)];
1340
1337
  case 8:
1341
1338
  element = _b.apply(void 0, [(_d.children = _h.sent(),
1342
1339
  _d)]);
@@ -1357,7 +1354,7 @@ var htmlNodeToBuilder = function (node, index, parentArray, options) { return __
1357
1354
  },
1358
1355
  };
1359
1356
  }
1360
- return [4 /*yield*/, exports.bindingsFromAttrs(psuedoNode, bindings, properties, options)];
1357
+ return [4 /*yield*/, (0, exports.bindingsFromAttrs)(psuedoNode, bindings, properties, options)];
1361
1358
  case 10:
1362
1359
  _h.sent();
1363
1360
  return [2 /*return*/, element];
@@ -1457,14 +1454,14 @@ var getShopifyAsset = function (assetKey, options) { return __awaiter(void 0, vo
1457
1454
  case 1: return [2 /*return*/, _a.sent()];
1458
1455
  case 2:
1459
1456
  shopifyRoot = 'https://cdn.builder.io/api/v1/shopify';
1460
- url = shopifyRoot + "/themes/" + themeId + "/assets.json?asset[key]=" + assetKey + "&apiKey=" + publicKey;
1457
+ url = "".concat(shopifyRoot, "/themes/").concat(themeId, "/assets.json?asset[key]=").concat(assetKey, "&apiKey=").concat(publicKey);
1461
1458
  if (options.cachebust) {
1462
1459
  url += '&cachebust=true';
1463
1460
  }
1464
1461
  assets[key] = axios
1465
1462
  .get(url, {
1466
1463
  headers: {
1467
- Authorization: "Bearer " + token,
1464
+ Authorization: "Bearer ".concat(token),
1468
1465
  },
1469
1466
  })
1470
1467
  .then(function (result) { return result.data && result.data.asset && result.data.asset.value; });
@@ -1496,9 +1493,9 @@ var getTranslation = function (parsedValue, options) {
1496
1493
  _b.label = 2;
1497
1494
  case 2:
1498
1495
  asset_1 = _a;
1499
- parsed = typeof asset_1 === 'string' ? lodash_1.attempt(function () { return JSON.parse(asset_1); }) : asset_1;
1500
- if (parsed && !lodash_1.isError(parsed)) {
1501
- translationValue = lodash_1.get(parsed, initial.replace(/'/g, ''));
1496
+ parsed = typeof asset_1 === 'string' ? (0, lodash_1.attempt)(function () { return JSON.parse(asset_1); }) : asset_1;
1497
+ if (parsed && !(0, lodash_1.isError)(parsed)) {
1498
+ translationValue = (0, lodash_1.get)(parsed, initial.replace(/'/g, ''));
1502
1499
  return [2 /*return*/, translationValue];
1503
1500
  }
1504
1501
  else {
@@ -1570,7 +1567,7 @@ var liquidToAst = function (str, options) {
1570
1567
  _this.tokens.push(token);
1571
1568
  })
1572
1569
  .on('end', function () {
1573
- throw new Error("tag " + token.raw + " not closed");
1570
+ throw new Error("tag ".concat(token.raw, " not closed"));
1574
1571
  });
1575
1572
  stream.start();
1576
1573
  },
@@ -1592,7 +1589,7 @@ var liquidToAst = function (str, options) {
1592
1589
  .on('tag:end' + tag, function () { return stream.stop(); })
1593
1590
  .on('template', function (tpl) { return _this.templates.push(tpl); })
1594
1591
  .on('end', function () {
1595
- throw new Error("tag " + token.raw + " not closed");
1592
+ throw new Error("tag ".concat(token.raw, " not closed"));
1596
1593
  });
1597
1594
  stream.start();
1598
1595
  },
@@ -1606,8 +1603,8 @@ exports.liquidToAst = liquidToAst;
1606
1603
  var bindingsPlaceholder = '__B__';
1607
1604
  var htmlToAst = function (html) {
1608
1605
  // https://github.com/vuejs/vue/blob/dev/src/platforms/web/compiler/modules/class.js#L19
1609
- var ast = compiler.compile("<template>" + html.replace(/(class|style)=/g, bindingsPlaceholder + "$1=") + "</template>").ast.children;
1610
- var processed = exports.postProcessHtmlAstNodes(lodash_1.cloneDeep(ast));
1606
+ var ast = compiler.compile("<template>".concat(html.replace(/(class|style)=/g, "".concat(bindingsPlaceholder, "$1=")), "</template>")).ast.children;
1607
+ var processed = (0, exports.postProcessHtmlAstNodes)((0, lodash_1.cloneDeep)(ast));
1611
1608
  return { htmlNodes: processed, preprocessed: ast };
1612
1609
  };
1613
1610
  exports.htmlToAst = htmlToAst;
@@ -1669,7 +1666,7 @@ var separateTagsAndText = function (text) {
1669
1666
  textItems.push(str.slice(currentIndex, index));
1670
1667
  currentIndex = index + tag.raw.length;
1671
1668
  }
1672
- var lastRaw = lodash_1.last(tags).raw;
1669
+ var lastRaw = (0, lodash_1.last)(tags).raw;
1673
1670
  var lastIndex = text.lastIndexOf(lastRaw) + lastRaw.length;
1674
1671
  textItems.push(str.slice(lastIndex));
1675
1672
  for (var i = 0; i < tags.length; i++) {
@@ -1699,7 +1696,7 @@ var postProcessHtmlAstNodes = function (nodes) {
1699
1696
  }
1700
1697
  updated = false;
1701
1698
  // tslint:disable-next-line:ter-prefer-arrow-callback
1702
- latest = traverse_1.default(latest).forEach(function (current) {
1699
+ latest = (0, traverse_1.default)(latest).forEach(function (current) {
1703
1700
  var _a;
1704
1701
  if ((current === null || current === void 0 ? void 0 : current.name) && current.name.startsWith(bindingsPlaceholder)) {
1705
1702
  this.update(__assign(__assign({}, current), { name: current.name.replace(bindingsPlaceholder, '') }));
@@ -1709,7 +1706,7 @@ var postProcessHtmlAstNodes = function (nodes) {
1709
1706
  return key.startsWith(bindingsPlaceholder);
1710
1707
  });
1711
1708
  if (prop) {
1712
- this.update(__assign(__assign({}, lodash_1.omit(current, prop)), (_a = {}, _a[prop === null || prop === void 0 ? void 0 : prop.replace(bindingsPlaceholder, '')] = current[prop], _a)));
1709
+ this.update(__assign(__assign({}, (0, lodash_1.omit)(current, prop)), (_a = {}, _a[prop === null || prop === void 0 ? void 0 : prop.replace(bindingsPlaceholder, '')] = current[prop], _a)));
1713
1710
  }
1714
1711
  }
1715
1712
  if (!isArrayWithTextNode(current)) {
@@ -1722,10 +1719,10 @@ var postProcessHtmlAstNodes = function (nodes) {
1722
1719
  }
1723
1720
  var parent_1 = current;
1724
1721
  var text = item.text;
1725
- var separated = exports.separateTagsAndText(text);
1722
+ var separated = (0, exports.separateTagsAndText)(text);
1726
1723
  if (separated.length > 1) {
1727
1724
  updated = true;
1728
- this.update(__spreadArray(__spreadArray(__spreadArray([], parent_1.slice(0, parent_1.indexOf(item))), separated), parent_1.slice(parent_1.indexOf(item) + 1)), true);
1725
+ this.update(__spreadArray(__spreadArray(__spreadArray([], parent_1.slice(0, parent_1.indexOf(item)), true), separated, true), parent_1.slice(parent_1.indexOf(item) + 1), true), true);
1729
1726
  break;
1730
1727
  }
1731
1728
  }
@@ -1747,7 +1744,7 @@ var moveCondtionalTagsUp = function (nodes) {
1747
1744
  }
1748
1745
  updated = false;
1749
1746
  // tslint:disable-next-line:ter-prefer-arrow-callback
1750
- nodes = traverse_1.default(nodes).forEach(function (current) {
1747
+ nodes = (0, traverse_1.default)(nodes).forEach(function (current) {
1751
1748
  var _a;
1752
1749
  if (!isBuilderElementArray(current)) {
1753
1750
  return;
@@ -1770,13 +1767,13 @@ var moveCondtionalTagsUp = function (nodes) {
1770
1767
  if (ejectedIndex > -1) {
1771
1768
  var oldBlocks = branch.blocks;
1772
1769
  ejected = (_a = branch.blocks) === null || _a === void 0 ? void 0 : _a[ejectedIndex];
1773
- var newBlocks = __spreadArray(__spreadArray(__spreadArray([], ((oldBlocks === null || oldBlocks === void 0 ? void 0 : oldBlocks.slice(0, ejectedIndex)) || [])), (ejected.children || [])), ((oldBlocks === null || oldBlocks === void 0 ? void 0 : oldBlocks.slice(ejectedIndex + 1)) || []));
1774
- var updatedCondition = __assign(__assign({}, condition), { component: __assign(__assign({}, condition.component), { options: __assign(__assign({}, condition.component.options), { branches: __spreadArray(__spreadArray(__spreadArray([], branches.slice(0, branchIndex)), [
1770
+ var newBlocks = __spreadArray(__spreadArray(__spreadArray([], ((oldBlocks === null || oldBlocks === void 0 ? void 0 : oldBlocks.slice(0, ejectedIndex)) || []), true), (ejected.children || []), true), ((oldBlocks === null || oldBlocks === void 0 ? void 0 : oldBlocks.slice(ejectedIndex + 1)) || []), true);
1771
+ var updatedCondition = __assign(__assign({}, condition), { component: __assign(__assign({}, condition.component), { options: __assign(__assign({}, condition.component.options), { branches: __spreadArray(__spreadArray(__spreadArray([], branches.slice(0, branchIndex), true), [
1775
1772
  __assign(__assign({}, branch), { blocks: newBlocks })
1776
- ]), branches.slice(branchIndex + 1)) }) }) });
1777
- this.update(__spreadArray(__spreadArray(__spreadArray([], current.slice(0, currentIndex)), [
1773
+ ], false), branches.slice(branchIndex + 1), true) }) }) });
1774
+ this.update(__spreadArray(__spreadArray(__spreadArray([], current.slice(0, currentIndex), true), [
1778
1775
  __assign(__assign({}, ejected), { meta: __assign(__assign({}, ejected.meta), { originalIndex: ejectedIndex, branchIndex: branchIndex }), component: __assign(__assign({}, ejected.component), { name: 'Shopify:ConditionalTag' }), children: [updatedCondition] })
1779
- ]), current.slice(currentIndex + 1)), true);
1776
+ ], false), current.slice(currentIndex + 1), true), true);
1780
1777
  break;
1781
1778
  }
1782
1779
  }
@@ -1799,7 +1796,7 @@ var matchConditionalTagsWithEndings = function (nodes) {
1799
1796
  }
1800
1797
  updated = false;
1801
1798
  // tslint:disable-next-line:ter-prefer-arrow-callback
1802
- nodes = traverse_1.default(nodes).forEach(function (current) {
1799
+ nodes = (0, traverse_1.default)(nodes).forEach(function (current) {
1803
1800
  var _a, _b;
1804
1801
  if (!isBuilderElementArray(current)) {
1805
1802
  return;
@@ -1810,7 +1807,7 @@ var matchConditionalTagsWithEndings = function (nodes) {
1810
1807
  return { value: void 0 };
1811
1808
  }
1812
1809
  var conditionalTags = [
1813
- lodash_1.omit(node, 'children'),
1810
+ (0, lodash_1.omit)(node, 'children'),
1814
1811
  ];
1815
1812
  var tag = node;
1816
1813
  var originalIndex = node.meta.originalIndex;
@@ -1818,7 +1815,7 @@ var matchConditionalTagsWithEndings = function (nodes) {
1818
1815
  while (tag.children) {
1819
1816
  tag = tag.children[0];
1820
1817
  if (isOpenConditionalTag(tag)) {
1821
- conditionalTags.push(lodash_1.omit(tag, 'children'));
1818
+ conditionalTags.push((0, lodash_1.omit)(tag, 'children'));
1822
1819
  }
1823
1820
  else {
1824
1821
  break;
@@ -1842,7 +1839,7 @@ var matchConditionalTagsWithEndings = function (nodes) {
1842
1839
  ((_a = el.component) === null || _a === void 0 ? void 0 : _a.options.hash) === ((_b = node.component) === null || _b === void 0 ? void 0 : _b.options.hash);
1843
1840
  }) + 1;
1844
1841
  if (endTag === 0) {
1845
- throw Error("no endTag for a conditional " + ((_a = node.component) === null || _a === void 0 ? void 0 : _a.options.hash));
1842
+ throw Error("no endTag for a conditional ".concat((_a = node.component) === null || _a === void 0 ? void 0 : _a.options.hash));
1846
1843
  }
1847
1844
  }
1848
1845
  // cursor at condition now
@@ -1853,8 +1850,8 @@ var matchConditionalTagsWithEndings = function (nodes) {
1853
1850
  it'll be 2,
1854
1851
  */
1855
1852
  if (originalIndex > 0) {
1856
- var originalBranch = lodash_1.cloneDeep((_b = condition.component) === null || _b === void 0 ? void 0 : _b.options.branches[branchIndex]);
1857
- hoistedCondition = lodash_1.mergeWith({}, condition, {
1853
+ var originalBranch = (0, lodash_1.cloneDeep)((_b = condition.component) === null || _b === void 0 ? void 0 : _b.options.branches[branchIndex]);
1854
+ hoistedCondition = (0, lodash_1.mergeWith)({}, condition, {
1858
1855
  component: {
1859
1856
  options: {
1860
1857
  isHoisted: true,
@@ -1869,12 +1866,12 @@ var matchConditionalTagsWithEndings = function (nodes) {
1869
1866
  return dest;
1870
1867
  }
1871
1868
  });
1872
- condition = lodash_1.mergeWith({}, condition, {
1869
+ condition = (0, lodash_1.mergeWith)({}, condition, {
1873
1870
  component: {
1874
1871
  options: {
1875
- branches: __spreadArray(__spreadArray(__spreadArray([], condition.component.options.branches.slice(0, branchIndex)), [
1872
+ branches: __spreadArray(__spreadArray(__spreadArray([], condition.component.options.branches.slice(0, branchIndex), true), [
1876
1873
  __assign(__assign({}, originalBranch), { blocks: originalBranch.blocks.slice(originalIndex) })
1877
- ]), condition.component.options.branches.slice(branchIndex + 1)),
1874
+ ], false), condition.component.options.branches.slice(branchIndex + 1), true),
1878
1875
  },
1879
1876
  },
1880
1877
  }, function (_, dest) {
@@ -1884,10 +1881,10 @@ var matchConditionalTagsWithEndings = function (nodes) {
1884
1881
  }
1885
1882
  });
1886
1883
  }
1887
- this_1.update(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], current.slice(0, currentIndex)), (hoistedCondition ? [hoistedCondition] : [])), [
1884
+ this_1.update(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], current.slice(0, currentIndex), true), (hoistedCondition ? [hoistedCondition] : []), true), [
1888
1885
  el({
1889
1886
  // TODO: lookout for tempnodes in condition blocks
1890
- children: __spreadArray([condition], current.slice(currentIndex + 1, endTag)),
1887
+ children: __spreadArray([condition], current.slice(currentIndex + 1, endTag), true),
1891
1888
  component: {
1892
1889
  name: 'Shopify:WrapperTag',
1893
1890
  options: {
@@ -1895,7 +1892,7 @@ var matchConditionalTagsWithEndings = function (nodes) {
1895
1892
  },
1896
1893
  },
1897
1894
  })
1898
- ]), current.slice(currentIndex + endTag + 2)), true);
1895
+ ], false), current.slice(currentIndex + endTag + 2), true), true);
1899
1896
  updated = true;
1900
1897
  };
1901
1898
  var this_1 = this;
@@ -1921,7 +1918,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
1921
1918
  }
1922
1919
  updated = false;
1923
1920
  // tslint:disable-next-line:ter-prefer-arrow-callback
1924
- latest = traverse_1.default(latest).forEach(function (current) {
1921
+ latest = (0, traverse_1.default)(latest).forEach(function (current) {
1925
1922
  var _a, _b, _c, _d, _e, _f;
1926
1923
  if (!isBuilderElementArray(current)) {
1927
1924
  return;
@@ -1965,7 +1962,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
1965
1962
  }
1966
1963
  }
1967
1964
  var _j = tempNodeInfo(item), name_9 = _j.name, value = _j.value;
1968
- var parsedValue = value && lodash_1.attempt(function () { return JSON.parse(value); });
1965
+ var parsedValue = value && (0, lodash_1.attempt)(function () { return JSON.parse(value); });
1969
1966
  if (name_9) {
1970
1967
  var isBlockStart = [
1971
1968
  'for',
@@ -1999,7 +1996,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
1999
1996
  return false;
2000
1997
  });
2001
1998
  if (!endTag) {
2002
- console.warn("Did not find end tag for tag: \"" + name_9 + "\"", item.component.options.value);
1999
+ console.warn("Did not find end tag for tag: \"".concat(name_9, "\""), item.component.options.value);
2003
2000
  }
2004
2001
  else {
2005
2002
  updated = true;
@@ -2041,12 +2038,12 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
2041
2038
  var parsedValue_1 = info.value && JSON.parse(info.value);
2042
2039
  branches.push({
2043
2040
  expression: parsedValue_1.cond
2044
- ? "" + (parsedValue_1.negate ? '!' : '') + liquidConditionTemplate(parsedValue_1.cond)
2041
+ ? "".concat(parsedValue_1.negate ? '!' : '').concat(liquidConditionTemplate(parsedValue_1.cond))
2045
2042
  : '',
2046
2043
  blocks: parent_2.slice(parent_2.indexOf(tag) + 1, parent_2.indexOf(nextTag)),
2047
2044
  });
2048
2045
  }
2049
- this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item))), [
2046
+ this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item)), true), [
2050
2047
  el({
2051
2048
  component: {
2052
2049
  name: 'Shopify:Condition',
@@ -2056,7 +2053,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
2056
2053
  },
2057
2054
  },
2058
2055
  })
2059
- ]), parent_2.slice(parent_2.indexOf(endTag) + 1)), true);
2056
+ ], false), parent_2.slice(parent_2.indexOf(endTag) + 1), true), true);
2060
2057
  }
2061
2058
  // else if (name === 'unless') {
2062
2059
  //unless is rewritten as a Shopify:Condition component
@@ -2075,7 +2072,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
2075
2072
  options_1.expression = expression;
2076
2073
  options_1.limit = limit;
2077
2074
  }
2078
- this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item))), [
2075
+ this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item)), true), [
2079
2076
  el({
2080
2077
  component: {
2081
2078
  options: options_1,
@@ -2083,7 +2080,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
2083
2080
  },
2084
2081
  children: parent_2.slice(parent_2.indexOf(item) + 1, parent_2.indexOf(endTag)),
2085
2082
  })
2086
- ]), parent_2.slice(parent_2.indexOf(endTag) + 1)), true);
2083
+ ], false), parent_2.slice(parent_2.indexOf(endTag) + 1), true), true);
2087
2084
  }
2088
2085
  else if (name_9 === 'form') {
2089
2086
  var allTags = [item].concat(midTags).concat([endTag]);
@@ -2107,7 +2104,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
2107
2104
  options_2.customAttributes = args;
2108
2105
  }
2109
2106
  }
2110
- this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item))), [
2107
+ this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item)), true), [
2111
2108
  el({
2112
2109
  component: {
2113
2110
  options: options_2,
@@ -2115,7 +2112,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
2115
2112
  },
2116
2113
  children: parent_2.slice(parent_2.indexOf(item) + 1, parent_2.indexOf(endTag)),
2117
2114
  })
2118
- ]), parent_2.slice(parent_2.indexOf(endTag) + 1)), true);
2115
+ ], false), parent_2.slice(parent_2.indexOf(endTag) + 1), true), true);
2119
2116
  }
2120
2117
  else if (name_9 === 'for') {
2121
2118
  var options_3 = {
@@ -2125,7 +2122,7 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
2125
2122
  expression: parsedValue.fullRaw,
2126
2123
  },
2127
2124
  };
2128
- this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item))), [
2125
+ this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item)), true), [
2129
2126
  el({
2130
2127
  component: {
2131
2128
  options: options_3,
@@ -2133,20 +2130,20 @@ var postProcessBuilderTree = function (nodes, options) { return __awaiter(void 0
2133
2130
  },
2134
2131
  children: parent_2.slice(parent_2.indexOf(item) + 1, parent_2.indexOf(endTag)),
2135
2132
  })
2136
- ]), parent_2.slice(parent_2.indexOf(endTag) + 1)), true);
2133
+ ], false), parent_2.slice(parent_2.indexOf(endTag) + 1), true), true);
2137
2134
  }
2138
2135
  else {
2139
- this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item))), [
2136
+ this_2.update(__spreadArray(__spreadArray(__spreadArray([], parent_2.slice(0, parent_2.indexOf(item)), true), [
2140
2137
  el(__assign(__assign({ component: {
2141
2138
  name: 'Core:Fragment',
2142
2139
  }, bindings: {} }, (name_9 === 'for' &&
2143
- !lodash_1.isError(parsedValue) && {
2140
+ !(0, lodash_1.isError)(parsedValue) && {
2144
2141
  repeat: {
2145
2142
  itemName: parsedValue.variable,
2146
2143
  collection: liquidBindingTemplate(parsedValue.collection),
2147
2144
  },
2148
2145
  })), { children: parent_2.slice(parent_2.indexOf(item) + 1, parent_2.indexOf(endTag)) }))
2149
- ]), parent_2.slice(parent_2.indexOf(endTag) + 1)), true);
2146
+ ], false), parent_2.slice(parent_2.indexOf(endTag) + 1), true), true);
2150
2147
  }
2151
2148
  return "break";
2152
2149
  }
@@ -2180,7 +2177,7 @@ var htmlAstToBuilder = function (nodes, options) { return __awaiter(void 0, void
2180
2177
  return [4 /*yield*/, Promise.all(nodes
2181
2178
  .filter(function (node) { return isTextNode(node) || isElement(node); })
2182
2179
  .map(function (node, index, nodes) {
2183
- return exports.htmlNodeToBuilder(node, index, nodes, options);
2180
+ return (0, exports.htmlNodeToBuilder)(node, index, nodes, options);
2184
2181
  }))];
2185
2182
  case 1:
2186
2183
  els = _a.apply(void 0, [_b.apply(void 0, [_c.sent()])]);
@@ -2193,10 +2190,10 @@ var processedAstToBuilder = function (nodes, options) { return __awaiter(void 0,
2193
2190
  var els, processed;
2194
2191
  return __generator(this, function (_a) {
2195
2192
  switch (_a.label) {
2196
- case 0: return [4 /*yield*/, exports.htmlAstToBuilder(nodes, options)];
2193
+ case 0: return [4 /*yield*/, (0, exports.htmlAstToBuilder)(nodes, options)];
2197
2194
  case 1:
2198
2195
  els = _a.sent();
2199
- return [4 /*yield*/, exports.postProcessBuilderTree(fast_clone_1.fastClone(els), options)];
2196
+ return [4 /*yield*/, (0, exports.postProcessBuilderTree)((0, fast_clone_1.fastClone)(els), options)];
2200
2197
  case 2:
2201
2198
  processed = _a.sent();
2202
2199
  return [2 /*return*/, { blocks: processed, preprocessed: els }];
@@ -2206,12 +2203,12 @@ var processedAstToBuilder = function (nodes, options) { return __awaiter(void 0,
2206
2203
  exports.processedAstToBuilder = processedAstToBuilder;
2207
2204
  var htmlDebugString = function (els) {
2208
2205
  var str = els.map(function (el) { return htmlDebugNodeString(el); }).join('\n');
2209
- return exports.tryFormat(str);
2206
+ return (0, exports.tryFormat)(str);
2210
2207
  };
2211
2208
  exports.htmlDebugString = htmlDebugString;
2212
2209
  var tryFormat = function (str) {
2213
2210
  try {
2214
- return standalone_1.format(str, {
2211
+ return (0, standalone_1.format)(str, {
2215
2212
  parser: 'html',
2216
2213
  htmlWhitespaceSensitivity: 'ignore',
2217
2214
  plugins: [htmlParser],
@@ -2249,13 +2246,13 @@ var htmlDebugNodeString = function (el) {
2249
2246
  properties.push(['@' + property, String(value)]);
2250
2247
  }
2251
2248
  }
2252
- return "<" + tagName + " " + properties.reduce(function (memo, tuple) {
2253
- return memo + (" " + tuple[0] + "=\"" + (tuple[1] || '').replace(/"/g, '`') + "\"");
2254
- }, '') + "\n " + (el.children && el.children.length
2255
- ? ">" + el.children
2249
+ return "<".concat(tagName, " ").concat(properties.reduce(function (memo, tuple) {
2250
+ return memo + " ".concat(tuple[0], "=\"").concat((tuple[1] || '').replace(/"/g, '`'), "\"");
2251
+ }, ''), "\n ").concat(el.children && el.children.length
2252
+ ? ">".concat(el.children
2256
2253
  .map(function (child) { return htmlDebugNodeString(child); })
2257
- .join('\n') + "</" + tagName + ">"
2258
- : '/>') + "\n ";
2254
+ .join('\n'), "</").concat(tagName, ">")
2255
+ : '/>', "\n ");
2259
2256
  };
2260
2257
  /**
2261
2258
  * This function is the first step, before we turn the liquid into an AST.
@@ -2292,7 +2289,7 @@ var preprocessLiquid = function (liquid, options) {
2292
2289
  capturedVariableName: capturedVariableName,
2293
2290
  capturedContents: capturedContents,
2294
2291
  });
2295
- capturedVariableReplaceRegex = new RegExp("{{-?\\s*" + capturedVariableName.trim() + "\\s*-?}}", 'gi');
2292
+ capturedVariableReplaceRegex = new RegExp("{{-?\\s*".concat(capturedVariableName.trim(), "\\s*-?}}"), 'gi');
2296
2293
  processedLiquid = processedLiquid.replace(capturedVariableReplaceRegex, capturedContents);
2297
2294
  }
2298
2295
  else if (capturedContentContainsCaptureTag) {
@@ -2314,7 +2311,7 @@ var preprocessLiquid = function (liquid, options) {
2314
2311
  if (allCaptureGroupMatches.length) {
2315
2312
  for (_i = 0, allCaptureGroupMatches_1 = allCaptureGroupMatches; _i < allCaptureGroupMatches_1.length; _i++) {
2316
2313
  captureMatch = allCaptureGroupMatches_1[_i];
2317
- captureReplacement = "{% capture " + captureMatch.capturedVariableName + " %}{% raw %}" + captureMatch.capturedContents + "{% endraw %}{% endcapture %}";
2314
+ captureReplacement = "{% capture ".concat(captureMatch.capturedVariableName, " %}{% raw %}").concat(captureMatch.capturedContents, "{% endraw %}{% endcapture %}");
2318
2315
  processedLiquid = processedLiquid.replace(captureMatch.match, captureReplacement);
2319
2316
  }
2320
2317
  }
@@ -2324,7 +2321,7 @@ var preprocessLiquid = function (liquid, options) {
2324
2321
  .trim()
2325
2322
  .replace(/'/g, '')
2326
2323
  .replace(/"/g, '');
2327
- return "{% include '" + templateNameCleaned + "', " + templateNameCleaned + ": " + withMatch + " %}";
2324
+ return "{% include '".concat(templateNameCleaned, "', ").concat(templateNameCleaned, ": ").concat(withMatch, " %}");
2328
2325
  });
2329
2326
  includesWithAndValuesRegex = /{%-?\s*include\s*([\S]+?)\s*with\s*(([\S]+?:\s*[\S]+?,?\s*)+)-?%}/gi;
2330
2327
  processedLiquid = processedLiquid.replace(includesWithAndValuesRegex, function (fullIncludesMatch, templateName, allKeysAndValues) {
@@ -2335,17 +2332,17 @@ var preprocessLiquid = function (liquid, options) {
2335
2332
  var allKeysAndValuesCleaned = allKeysAndValues
2336
2333
  .trim()
2337
2334
  .replace(/\s+/g, ' ');
2338
- return "{% include '" + templateNameCleaned + "', " + allKeysAndValuesCleaned + " %}";
2335
+ return "{% include '".concat(templateNameCleaned, "', ").concat(allKeysAndValuesCleaned, " %}");
2339
2336
  });
2340
2337
  templateContainsRegex = /{%-?(.+?)template\s+contains\s+(.+?)-?%}/gi;
2341
2338
  processedLiquid = processedLiquid.replace(templateContainsRegex, function (fullTemplateMatch, templatePrefixText, templatePostfixText) {
2342
- return "{% " + templatePrefixText + " template.name contains " + templatePostfixText + " %}";
2339
+ return "{% ".concat(templatePrefixText, " template.name contains ").concat(templatePostfixText, " %}");
2343
2340
  });
2344
2341
  booleanHTMLAttributes = ['checked', 'disabled', 'selected'];
2345
2342
  _loop_4 = function (booleanAttribute) {
2346
- var booleanAttributeRegex = new RegExp("<[\\s\\S]*?(" + booleanAttribute + "{%)[\\s\\S]*?>", 'gi');
2343
+ var booleanAttributeRegex = new RegExp("<[\\s\\S]*?(".concat(booleanAttribute, "{%)[\\s\\S]*?>"), 'gi');
2347
2344
  processedLiquid = processedLiquid.replace(booleanAttributeRegex, function (fullMatch, attributeMatch) {
2348
- return fullMatch.replace("" + attributeMatch, booleanAttribute + " {%");
2345
+ return fullMatch.replace("".concat(attributeMatch), "".concat(booleanAttribute, " {%"));
2349
2346
  });
2350
2347
  };
2351
2348
  for (_a = 0, booleanHTMLAttributes_1 = booleanHTMLAttributes; _a < booleanHTMLAttributes_1.length; _a++) {
@@ -2355,12 +2352,12 @@ var preprocessLiquid = function (liquid, options) {
2355
2352
  return [4 /*yield*/, getShopifyAsset('config/settings_data.json', options)];
2356
2353
  case 1:
2357
2354
  themeAsset = _e.sent();
2358
- themeSettings = typeof themeAsset === 'string' && lodash_1.attempt(function () { return JSON.parse(themeAsset); });
2359
- if (themeSettings && !lodash_1.isError(themeSettings)) {
2355
+ themeSettings = typeof themeAsset === 'string' && (0, lodash_1.attempt)(function () { return JSON.parse(themeAsset); });
2356
+ if (themeSettings && !(0, lodash_1.isError)(themeSettings)) {
2360
2357
  contentForIndexTemplates = ((_b = themeSettings.current) === null || _b === void 0 ? void 0 : _b.content_for_index) ||
2361
2358
  ((_d = (_c = themeSettings.presets) === null || _c === void 0 ? void 0 : _c.Default) === null || _d === void 0 ? void 0 : _d.content_for_index);
2362
2359
  if (contentForIndexTemplates.length) {
2363
- contentForIndexLiquidStrings_1 = contentForIndexTemplates.map(function (template) { return "{% section '" + template + "' %}"; });
2360
+ contentForIndexLiquidStrings_1 = contentForIndexTemplates.map(function (template) { return "{% section '".concat(template, "' %}"); });
2364
2361
  contentForIndexRegex = /{{\s*content_for_index\s*}}/gi;
2365
2362
  processedLiquid = processedLiquid.replace(contentForIndexRegex, function (fullMatch) {
2366
2363
  return fullMatch.replace(fullMatch, contentForIndexLiquidStrings_1.join(''));
@@ -2383,7 +2380,7 @@ var liquidToBuilder = function (liquid, options) {
2383
2380
  if (options.log) {
2384
2381
  console.log('liquidToBuilder: liquid', { liquid: liquid });
2385
2382
  }
2386
- return [4 /*yield*/, exports.preprocessLiquid(liquid, options)];
2383
+ return [4 /*yield*/, (0, exports.preprocessLiquid)(liquid, options)];
2387
2384
  case 1:
2388
2385
  preprocessedLiquid = _a.sent();
2389
2386
  if (options.log) {
@@ -2391,19 +2388,19 @@ var liquidToBuilder = function (liquid, options) {
2391
2388
  }
2392
2389
  scriptRe = /<script[\s\S]*?>[\s\S]*?<\/script>/gi;
2393
2390
  scriptsInLiquid = preprocessedLiquid.match(scriptRe);
2394
- parsedTemplateItems = exports.liquidToAst(preprocessedLiquid.replace(scriptRe, ''), options);
2391
+ parsedTemplateItems = (0, exports.liquidToAst)(preprocessedLiquid.replace(scriptRe, ''), options);
2395
2392
  if (options.log) {
2396
2393
  console.log('liquidToBuilder: parsed liquid', parsedTemplateItems);
2397
2394
  }
2398
- return [4 /*yield*/, exports.parsedLiquidToHtml(parsedTemplateItems, options)];
2395
+ return [4 /*yield*/, (0, exports.parsedLiquidToHtml)(parsedTemplateItems, options)];
2399
2396
  case 2:
2400
2397
  html = _a.sent();
2401
2398
  return [4 /*yield*/, getShopifyAsset('config/settings_data.json', options)];
2402
2399
  case 3:
2403
2400
  themeAsset = _a.sent();
2404
- themeSettings = typeof themeAsset === 'string' && lodash_1.attempt(function () { return JSON.parse(themeAsset); });
2401
+ themeSettings = typeof themeAsset === 'string' && (0, lodash_1.attempt)(function () { return JSON.parse(themeAsset); });
2405
2402
  if (themeSettings &&
2406
- !lodash_1.isError(themeSettings) &&
2403
+ !(0, lodash_1.isError)(themeSettings) &&
2407
2404
  options.importSections !== false) {
2408
2405
  serialized = serializeBlock({
2409
2406
  layerName: "Theme Settings",
@@ -2414,21 +2411,21 @@ var liquidToBuilder = function (liquid, options) {
2414
2411
  { path: 'state.settings', as: '_theme_settings' },
2415
2412
  ],
2416
2413
  state: {
2417
- settings: mapArrays(lodash_1.omit(themeSettings.current, 'sections')),
2414
+ settings: mapArrays((0, lodash_1.omit)(themeSettings.current, 'sections')),
2418
2415
  },
2419
2416
  },
2420
2417
  },
2421
2418
  }, false);
2422
- html = "" + serialized + html + serializedBlockCloseTag;
2419
+ html = "".concat(serialized).concat(html).concat(serializedBlockCloseTag);
2423
2420
  }
2424
2421
  if (options.log) {
2425
2422
  console.log('liquidToBuilder: html', { html: html });
2426
2423
  }
2427
- htmlNodes = exports.htmlToAst(html).htmlNodes;
2424
+ htmlNodes = (0, exports.htmlToAst)(html).htmlNodes;
2428
2425
  if (options.log) {
2429
2426
  console.log('liquidToBuilder: parsed html', htmlNodes);
2430
2427
  }
2431
- return [4 /*yield*/, exports.processedAstToBuilder(htmlNodes, options)];
2428
+ return [4 /*yield*/, (0, exports.processedAstToBuilder)(htmlNodes, options)];
2432
2429
  case 4:
2433
2430
  blocks = (_a.sent()).blocks;
2434
2431
  if (Array.isArray(scriptsInLiquid) && scriptsInLiquid.length > 0) {
@@ -2471,9 +2468,9 @@ var htmlToBuilder = function (html) { return __awaiter(void 0, void 0, void 0, f
2471
2468
  return __generator(this, function (_a) {
2472
2469
  switch (_a.label) {
2473
2470
  case 0:
2474
- htmlNodes = exports.htmlToAst(html).htmlNodes;
2471
+ htmlNodes = (0, exports.htmlToAst)(html).htmlNodes;
2475
2472
  console.log('procesed', htmlNodes);
2476
- return [4 /*yield*/, exports.processedAstToBuilder(htmlNodes, {})];
2473
+ return [4 /*yield*/, (0, exports.processedAstToBuilder)(htmlNodes, {})];
2477
2474
  case 1:
2478
2475
  blocks = (_a.sent()).blocks;
2479
2476
  console.log('blocks', blocks);
@@ -2506,15 +2503,15 @@ var bindingsFromAttrs = function (node, bindings, properties, options) { return
2506
2503
  }
2507
2504
  i++;
2508
2505
  }
2509
- throw new Error(cursor + " no matching closing tag");
2506
+ throw new Error("".concat(cursor, " no matching closing tag"));
2510
2507
  };
2511
2508
  getConditionalValue = function (conditions, value, defaultValue) {
2512
2509
  return conditions.length > 0
2513
- ? "/*start*/" + (conditions
2510
+ ? "/*start*/".concat(conditions
2514
2511
  .map(function (c) {
2515
- return "" + (c.negate ? '!' : '') + liquidConditionTemplate(c.expression);
2512
+ return "".concat(c.negate ? '!' : '').concat(liquidConditionTemplate(c.expression));
2516
2513
  })
2517
- .join('&&') + (" ? " + value + " : (" + defaultValue + ")")) + "/*end*/"
2514
+ .join('&&') + " ? ".concat(value, " : (").concat(defaultValue, ")"), "/*end*/")
2518
2515
  : value;
2519
2516
  };
2520
2517
  parseAttrsInRange = function (start, end, conditions) { return __awaiter(void 0, void 0, void 0, function () {
@@ -2594,7 +2591,7 @@ var bindingsFromAttrs = function (node, bindings, properties, options) { return
2594
2591
  properties[key] = translation;
2595
2592
  }
2596
2593
  else {
2597
- bindings[key] = getConditionalValue(conditions, "'" + translation + "'", bindings[key]);
2594
+ bindings[key] = getConditionalValue(conditions, "'".concat(translation, "'"), bindings[key]);
2598
2595
  }
2599
2596
  }
2600
2597
  _b.label = 12;
@@ -2614,7 +2611,7 @@ var bindingsFromAttrs = function (node, bindings, properties, options) { return
2614
2611
  else {
2615
2612
  if (conditions.length > 0) {
2616
2613
  useKey = key === 'style' ? 'attr.style' : key;
2617
- bindings[useKey] = getConditionalValue(conditions, "'" + value + "'", bindings[useKey]);
2614
+ bindings[useKey] = getConditionalValue(conditions, "'".concat(value, "'"), bindings[useKey]);
2618
2615
  }
2619
2616
  else {
2620
2617
  properties[key] = value;