@gem-sdk/core 2.1.13-staging.15 → 2.1.13-staging.18
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.
|
@@ -294,23 +294,27 @@ const RenderChildren = (props)=>{
|
|
|
294
294
|
const WrapRenderChildren = ({ uid, customProps }, codes)=>{
|
|
295
295
|
let liquid = '';
|
|
296
296
|
if (codes?.length) {
|
|
297
|
+
let tempLiquid = '';
|
|
298
|
+
let fileIndex = 0;
|
|
297
299
|
for(let i = 0; i < codes.length; i++){
|
|
298
300
|
const code = codes[i];
|
|
299
301
|
if (code) {
|
|
300
|
-
const newLiquid = liquid + code;
|
|
301
|
-
// Fix limit 256kb
|
|
302
302
|
const textEncoder = new TextEncoder();
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
if (Math.ceil(
|
|
306
|
-
|
|
307
|
-
customProps.extraFiles[fileName] = code;
|
|
308
|
-
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant, form: form %}`;
|
|
303
|
+
const newTempLiquid = tempLiquid + code;
|
|
304
|
+
const newSize = textEncoder.encode(newTempLiquid).length;
|
|
305
|
+
if (Math.ceil(newSize / 1024) < 180) {
|
|
306
|
+
tempLiquid = newTempLiquid;
|
|
309
307
|
} else {
|
|
310
|
-
|
|
308
|
+
const fileName = `gp-section-snippet-${uid}-${fileIndex++}`;
|
|
309
|
+
customProps.extraFiles[fileName] = tempLiquid;
|
|
310
|
+
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant, form: form %}`;
|
|
311
|
+
tempLiquid = code;
|
|
311
312
|
}
|
|
312
313
|
}
|
|
313
314
|
}
|
|
315
|
+
if (tempLiquid) {
|
|
316
|
+
liquid += tempLiquid;
|
|
317
|
+
}
|
|
314
318
|
}
|
|
315
319
|
return liquid;
|
|
316
320
|
};
|
|
@@ -290,23 +290,27 @@ const RenderChildren = (props)=>{
|
|
|
290
290
|
const WrapRenderChildren = ({ uid, customProps }, codes)=>{
|
|
291
291
|
let liquid = '';
|
|
292
292
|
if (codes?.length) {
|
|
293
|
+
let tempLiquid = '';
|
|
294
|
+
let fileIndex = 0;
|
|
293
295
|
for(let i = 0; i < codes.length; i++){
|
|
294
296
|
const code = codes[i];
|
|
295
297
|
if (code) {
|
|
296
|
-
const newLiquid = liquid + code;
|
|
297
|
-
// Fix limit 256kb
|
|
298
298
|
const textEncoder = new TextEncoder();
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
if (Math.ceil(
|
|
302
|
-
|
|
303
|
-
customProps.extraFiles[fileName] = code;
|
|
304
|
-
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant, form: form %}`;
|
|
299
|
+
const newTempLiquid = tempLiquid + code;
|
|
300
|
+
const newSize = textEncoder.encode(newTempLiquid).length;
|
|
301
|
+
if (Math.ceil(newSize / 1024) < 180) {
|
|
302
|
+
tempLiquid = newTempLiquid;
|
|
305
303
|
} else {
|
|
306
|
-
|
|
304
|
+
const fileName = `gp-section-snippet-${uid}-${fileIndex++}`;
|
|
305
|
+
customProps.extraFiles[fileName] = tempLiquid;
|
|
306
|
+
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant, form: form %}`;
|
|
307
|
+
tempLiquid = code;
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
310
|
}
|
|
311
|
+
if (tempLiquid) {
|
|
312
|
+
liquid += tempLiquid;
|
|
313
|
+
}
|
|
310
314
|
}
|
|
311
315
|
return liquid;
|
|
312
316
|
};
|