@rebuy/rebuy 2.18.0 → 2.18.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1399 -1028
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +1360 -999
- package/dist/index.mjs.map +3 -3
- package/dist/schema/checkout-and-beyond.js +575 -377
- package/dist/schema/checkout-and-beyond.js.map +3 -3
- package/dist/schema/checkout-and-beyond.mjs +544 -356
- package/dist/schema/checkout-and-beyond.mjs.map +3 -3
- package/dist/schema/metadata.d.ts +659 -659
- package/dist/schema/metadata.d.ts.map +1 -1
- package/dist/schema/product.d.ts +377 -377
- package/dist/schema/product.d.ts.map +1 -1
- package/dist/schema/shop-config.js +75 -58
- package/dist/schema/shop-config.js.map +2 -2
- package/dist/schema/shop-config.mjs +65 -58
- package/dist/schema/shop-config.mjs.map +2 -2
- package/dist/schema/shopConfig.d.ts +59 -77
- package/dist/schema/shopConfig.d.ts.map +1 -1
- package/dist/schema/user-config.js +79 -62
- package/dist/schema/user-config.js.map +3 -3
- package/dist/schema/user-config.mjs +69 -62
- package/dist/schema/user-config.mjs.map +3 -3
- package/dist/schema/userConfig.d.ts +63 -81
- package/dist/schema/userConfig.d.ts.map +1 -1
- package/dist/schema/widget-data.js +617 -413
- package/dist/schema/widget-data.js.map +3 -3
- package/dist/schema/widget-data.mjs +605 -411
- package/dist/schema/widget-data.mjs.map +3 -3
- package/dist/schema/widgetData.d.ts +195 -377
- package/dist/schema/widgetData.d.ts.map +1 -1
- package/dist/schema/widgets/abTestingPlaceholder.d.ts +5 -5
- package/dist/schema/widgets/abTestingPlaceholder.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +53 -101
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +3 -137
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +3 -135
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +26 -218
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/constants.d.ts +1 -27
- package/dist/schema/widgets/checkout-and-beyond/constants.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts +34 -38
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +48 -111
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +67 -138
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +3 -135
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts +12 -19
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts +26 -23
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +45 -67
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +33 -62
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +80 -181
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts +45 -160
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +12 -23
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/table.d.ts +2 -134
- package/dist/schema/widgets/checkout-and-beyond/table.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +507 -210
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/utils.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +33 -65
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts.map +1 -1
- package/dist/schema/widgets/checkoutExtension.d.ts +5 -5
- package/dist/schema/widgets/checkoutExtension.d.ts.map +1 -1
- package/dist/schema/widgets/contentBlock.d.ts +124 -254
- package/dist/schema/widgets/contentBlock.d.ts.map +1 -1
- package/dist/schema/widgets/giftWithPurchase.d.ts +5 -5
- package/dist/schema/widgets/giftWithPurchase.d.ts.map +1 -1
- package/dist/schema/widgets/lineItemEditor.d.ts +5 -5
- package/dist/schema/widgets/lineItemEditor.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/common.d.ts +2 -2
- package/dist/schema/widgets/post-purchase-offer/common.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts +1 -13
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts +2455 -1077
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +2240 -721
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +2228 -698
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +2236 -717
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts.map +1 -1
- package/dist/schema/widgets/progressBar.d.ts +5 -5
- package/dist/schema/widgets/progressBar.d.ts.map +1 -1
- package/dist/schema/widgets/rebuyButton.d.ts +88 -166
- package/dist/schema/widgets/rebuyButton.d.ts.map +1 -1
- package/dist/schema/widgets/rebuyMonetize.d.ts +5 -5
- package/dist/schema/widgets/rebuyMonetize.d.ts.map +1 -1
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
@@ -135,6 +145,7 @@ __export(src_exports, {
|
|
|
135
145
|
directions: () => directions,
|
|
136
146
|
editorModes: () => editorModes,
|
|
137
147
|
enabled: () => enabled,
|
|
148
|
+
enumOf: () => enumOf,
|
|
138
149
|
extensionWidgetTypes: () => extensionWidgetTypes,
|
|
139
150
|
find: () => find,
|
|
140
151
|
firstAvailableVariant: () => firstAvailableVariant,
|
|
@@ -236,8 +247,8 @@ function stripHtml(str) {
|
|
|
236
247
|
}
|
|
237
248
|
function getIdFromGraphUrl(graphId, objectType) {
|
|
238
249
|
let id = null;
|
|
239
|
-
const
|
|
240
|
-
const matches = graphId.match(
|
|
250
|
+
const regex5 = new RegExp(`gid://shopify/${objectType}/(.*)`);
|
|
251
|
+
const matches = graphId.match(regex5);
|
|
241
252
|
if (matches != null) {
|
|
242
253
|
const matchedId = matches[1];
|
|
243
254
|
if (!isNaN(Number(matchedId))) {
|
|
@@ -246,8 +257,8 @@ function getIdFromGraphUrl(graphId, objectType) {
|
|
|
246
257
|
}
|
|
247
258
|
return id;
|
|
248
259
|
}
|
|
249
|
-
function variantAvailable(
|
|
250
|
-
return !(
|
|
260
|
+
function variantAvailable(variant9) {
|
|
261
|
+
return !(variant9.inventory_management && variant9.inventory_policy === "deny" && variant9.inventory_quantity <= 0);
|
|
251
262
|
}
|
|
252
263
|
function firstAvailableVariant(product) {
|
|
253
264
|
let selectedVariant = product.variants[0];
|
|
@@ -293,7 +304,7 @@ function convertProductToStorefrontFormat(product) {
|
|
|
293
304
|
const minVariantCompareAtPrice = variantMinMaxPriceObject(product, "compare_at_price", "min");
|
|
294
305
|
const maxVariantCompareAtPrice = variantMinMaxPriceObject(product, "compare_at_price", "max");
|
|
295
306
|
const selectedOptions = selectedVariantOptions(product, defaultVariant);
|
|
296
|
-
const variants = product.variants.map((
|
|
307
|
+
const variants = product.variants.map((variant9) => convertVariantToStorefrontFormat(product, variant9));
|
|
297
308
|
return {
|
|
298
309
|
collections: null,
|
|
299
310
|
compareAtPriceRange: {
|
|
@@ -336,15 +347,15 @@ function convertToNodes(arr) {
|
|
|
336
347
|
]
|
|
337
348
|
};
|
|
338
349
|
}
|
|
339
|
-
function convertVariantToStorefrontFormat(product,
|
|
340
|
-
const selectedOptions = selectedVariantOptions(product,
|
|
341
|
-
const image = productImageObject(product,
|
|
350
|
+
function convertVariantToStorefrontFormat(product, variant9) {
|
|
351
|
+
const selectedOptions = selectedVariantOptions(product, variant9);
|
|
352
|
+
const image = productImageObject(product, variant9.image_id);
|
|
342
353
|
return {
|
|
343
|
-
availableForSale: variantAvailable(
|
|
344
|
-
compareAtPriceV2: variantPriceObject(
|
|
345
|
-
id: `gid://shopify/ProductVariant/${
|
|
354
|
+
availableForSale: variantAvailable(variant9),
|
|
355
|
+
compareAtPriceV2: variantPriceObject(variant9, "compare_at_price"),
|
|
356
|
+
id: `gid://shopify/ProductVariant/${variant9.id}`,
|
|
346
357
|
image,
|
|
347
|
-
priceV2: variantPriceObject(
|
|
358
|
+
priceV2: variantPriceObject(variant9, "price"),
|
|
348
359
|
product: {
|
|
349
360
|
handle: product.handle,
|
|
350
361
|
id: product.id,
|
|
@@ -352,8 +363,8 @@ function convertVariantToStorefrontFormat(product, variant) {
|
|
|
352
363
|
vendor: product.vendor
|
|
353
364
|
},
|
|
354
365
|
selectedOptions: [selectedOptions],
|
|
355
|
-
sku:
|
|
356
|
-
title:
|
|
366
|
+
sku: variant9.sku,
|
|
367
|
+
title: variant9.title
|
|
357
368
|
};
|
|
358
369
|
}
|
|
359
370
|
function variantMinMaxPriceObject(product, key = "price", operator = "min") {
|
|
@@ -370,25 +381,25 @@ function variantMinMaxPriceObject(product, key = "price", operator = "min") {
|
|
|
370
381
|
}
|
|
371
382
|
return priceObject;
|
|
372
383
|
}
|
|
373
|
-
function variantPriceObject(
|
|
374
|
-
if (
|
|
384
|
+
function variantPriceObject(variant9, key = "price") {
|
|
385
|
+
if (variant9[key] != null) {
|
|
375
386
|
return {
|
|
376
|
-
amount:
|
|
387
|
+
amount: variant9[key],
|
|
377
388
|
currencyCode: "USD"
|
|
378
389
|
};
|
|
379
390
|
}
|
|
380
391
|
return null;
|
|
381
392
|
}
|
|
382
|
-
function selectedVariantOptions(product,
|
|
393
|
+
function selectedVariantOptions(product, variant9) {
|
|
383
394
|
const selectedOptions = {};
|
|
384
|
-
if (
|
|
385
|
-
selectedOptions[product.options[0].name] =
|
|
395
|
+
if (variant9.option1 != null) {
|
|
396
|
+
selectedOptions[product.options[0].name] = variant9.option1;
|
|
386
397
|
}
|
|
387
|
-
if (
|
|
388
|
-
selectedOptions[product.options[1].name] =
|
|
398
|
+
if (variant9.option2 != null) {
|
|
399
|
+
selectedOptions[product.options[1].name] = variant9.option2;
|
|
389
400
|
}
|
|
390
|
-
if (
|
|
391
|
-
selectedOptions[product.options[2].name] =
|
|
401
|
+
if (variant9.option3 != null) {
|
|
402
|
+
selectedOptions[product.options[2].name] = variant9.option3;
|
|
392
403
|
}
|
|
393
404
|
return selectedOptions;
|
|
394
405
|
}
|
|
@@ -424,8 +435,8 @@ function queryStringToObject(str) {
|
|
|
424
435
|
function utmObjectFromString(str) {
|
|
425
436
|
const utmKeys = ["utm_campaign", "utm_medium", "utm_source", "utm_term", "utm_content"];
|
|
426
437
|
const matches = {};
|
|
427
|
-
const
|
|
428
|
-
const queryObject = queryStringToObject(
|
|
438
|
+
const url6 = new URL(str);
|
|
439
|
+
const queryObject = queryStringToObject(url6.search);
|
|
429
440
|
for (const [key, value] of Object.entries(queryObject)) {
|
|
430
441
|
if (utmKeys.includes(key)) {
|
|
431
442
|
matches[key] = value;
|
|
@@ -510,8 +521,8 @@ var stagingDomains = [
|
|
|
510
521
|
"dash-ext-hoke.myshopify.com"
|
|
511
522
|
];
|
|
512
523
|
var makeCall = async (key, method, path, data, origin, options = {}) => {
|
|
513
|
-
const
|
|
514
|
-
const requestUrl = new URL(
|
|
524
|
+
const url6 = `${origin}${path}`;
|
|
525
|
+
const requestUrl = new URL(url6);
|
|
515
526
|
const fetchOptions = options?.fetch ?? {};
|
|
516
527
|
const requestData = {};
|
|
517
528
|
if (typeof data == "object" && data != null) {
|
|
@@ -941,289 +952,303 @@ var RebuyClient = class {
|
|
|
941
952
|
};
|
|
942
953
|
|
|
943
954
|
// src/schema/metadata.ts
|
|
944
|
-
var
|
|
955
|
+
var v2 = __toESM(require("valibot"), 1);
|
|
945
956
|
|
|
946
957
|
// src/schema/product.ts
|
|
947
|
-
var
|
|
948
|
-
var
|
|
949
|
-
var CacheInfo =
|
|
950
|
-
cachedAtTime:
|
|
951
|
-
cacheExpires:
|
|
952
|
-
cacheKey:
|
|
953
|
-
cacheKeyReadable:
|
|
954
|
-
cacheType:
|
|
955
|
-
loadedOptions:
|
|
958
|
+
var v = __toESM(require("valibot"), 1);
|
|
959
|
+
var vDatetime = v.pipe(v.string(), v.isoTimestamp());
|
|
960
|
+
var CacheInfo = v.object({
|
|
961
|
+
cachedAtTime: v.union([v.string(), v.number()]),
|
|
962
|
+
cacheExpires: v.optional(v.union([v.string(), v.number()])),
|
|
963
|
+
cacheKey: v.string(),
|
|
964
|
+
cacheKeyReadable: v.string(),
|
|
965
|
+
cacheType: v.optional(v.string()),
|
|
966
|
+
loadedOptions: v.optional(v.record(v.string(), v.boolean()))
|
|
956
967
|
});
|
|
957
|
-
var Category =
|
|
958
|
-
adminGraphqlApiId:
|
|
959
|
-
fullName:
|
|
960
|
-
name:
|
|
968
|
+
var Category = v.object({
|
|
969
|
+
adminGraphqlApiId: v.string(),
|
|
970
|
+
fullName: v.string(),
|
|
971
|
+
name: v.string()
|
|
961
972
|
});
|
|
962
|
-
var Metafield =
|
|
963
|
-
key:
|
|
964
|
-
namespace:
|
|
965
|
-
type:
|
|
966
|
-
value:
|
|
973
|
+
var Metafield = v.object({
|
|
974
|
+
key: v.string(),
|
|
975
|
+
namespace: v.string(),
|
|
976
|
+
type: v.string(),
|
|
977
|
+
value: v.string()
|
|
967
978
|
});
|
|
968
|
-
var Image =
|
|
969
|
-
adminGraphqlApiId:
|
|
970
|
-
alt:
|
|
971
|
-
createdAt:
|
|
972
|
-
height:
|
|
973
|
-
id:
|
|
974
|
-
metafields:
|
|
975
|
-
position:
|
|
976
|
-
productId:
|
|
977
|
-
src:
|
|
978
|
-
updatedAt:
|
|
979
|
-
variantIds:
|
|
980
|
-
width:
|
|
979
|
+
var Image = v.object({
|
|
980
|
+
adminGraphqlApiId: v.string(),
|
|
981
|
+
alt: v.nullable(v.string()),
|
|
982
|
+
createdAt: v.optional(vDatetime),
|
|
983
|
+
height: v.number(),
|
|
984
|
+
id: v.number(),
|
|
985
|
+
metafields: v.optional(v.array(Metafield)),
|
|
986
|
+
position: v.number(),
|
|
987
|
+
productId: v.number(),
|
|
988
|
+
src: v.pipe(v.string(), v.url()),
|
|
989
|
+
updatedAt: v.optional(vDatetime),
|
|
990
|
+
variantIds: v.array(v.number()),
|
|
991
|
+
width: v.number()
|
|
981
992
|
});
|
|
982
|
-
var Media =
|
|
983
|
-
adminGraphqlApiId:
|
|
984
|
-
alt:
|
|
985
|
-
createdAt:
|
|
986
|
-
id:
|
|
987
|
-
mediaContentType:
|
|
988
|
-
position:
|
|
989
|
-
previewImage:
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
993
|
+
var Media = v.object({
|
|
994
|
+
adminGraphqlApiId: v.string(),
|
|
995
|
+
alt: v.nullable(v.string()),
|
|
996
|
+
createdAt: vDatetime,
|
|
997
|
+
id: v.number(),
|
|
998
|
+
mediaContentType: v.string(),
|
|
999
|
+
position: v.number(),
|
|
1000
|
+
previewImage: v.object({
|
|
1001
|
+
height: v.number(),
|
|
1002
|
+
src: v.pipe(v.string(), v.url()),
|
|
1003
|
+
status: v.string(),
|
|
1004
|
+
width: v.number()
|
|
1005
|
+
}),
|
|
1006
|
+
productId: v.number(),
|
|
1007
|
+
status: v.string(),
|
|
1008
|
+
updatedAt: vDatetime,
|
|
1009
|
+
variantIds: v.array(v.number())
|
|
994
1010
|
});
|
|
995
|
-
var Option =
|
|
996
|
-
id:
|
|
997
|
-
name:
|
|
998
|
-
position:
|
|
999
|
-
productId:
|
|
1000
|
-
values:
|
|
1011
|
+
var Option = v.object({
|
|
1012
|
+
id: v.number(),
|
|
1013
|
+
name: v.string(),
|
|
1014
|
+
position: v.number(),
|
|
1015
|
+
productId: v.number(),
|
|
1016
|
+
values: v.array(v.string())
|
|
1001
1017
|
});
|
|
1002
|
-
var PriceAdjustment =
|
|
1003
|
-
orderCount:
|
|
1004
|
-
position:
|
|
1005
|
-
value:
|
|
1006
|
-
valueType:
|
|
1018
|
+
var PriceAdjustment = v.object({
|
|
1019
|
+
orderCount: v.optional(v.number()),
|
|
1020
|
+
position: v.number(),
|
|
1021
|
+
value: v.string(),
|
|
1022
|
+
valueType: v.string()
|
|
1007
1023
|
});
|
|
1008
|
-
var Ratings =
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1024
|
+
var Ratings = v.union([
|
|
1025
|
+
v.object({ judgemeAverageStarRating: v.number(), judgemeTotalReviews: v.number() }),
|
|
1026
|
+
v.object({ junipAverageStarRating: v.number(), junipTotalReviews: v.number() }),
|
|
1027
|
+
v.object({ klaviyoAverageStarRating: v.number(), klaviyoTotalReviews: v.number() }),
|
|
1028
|
+
v.object({ looxAverageStarRating: v.number(), looxTotalReviews: v.number() }),
|
|
1029
|
+
v.object({ okendoAverageStarRating: v.number(), okendoTotalReviews: v.number() }),
|
|
1030
|
+
v.object({ opinewAverageStarRating: v.number(), opinewTotalReviews: v.number() }),
|
|
1031
|
+
v.object({ reviewsioAverageStarRating: v.number(), reviewsioTotalReviews: v.number() }),
|
|
1032
|
+
v.object({ stampedAverageStarRating: v.number(), stampedTotalReviews: v.number() }),
|
|
1033
|
+
v.object({ yotpoAverageStarRating: v.number(), yotpoTotalReviews: v.number() })
|
|
1018
1034
|
]);
|
|
1019
|
-
var SellingPlan =
|
|
1020
|
-
description:
|
|
1021
|
-
id:
|
|
1022
|
-
name:
|
|
1023
|
-
options:
|
|
1024
|
-
orderIntervalFrequency:
|
|
1025
|
-
orderIntervalUnitType:
|
|
1026
|
-
position:
|
|
1027
|
-
priceAdjustments:
|
|
1028
|
-
shopifyVariantId:
|
|
1035
|
+
var SellingPlan = v.object({
|
|
1036
|
+
description: v.optional(v.string()),
|
|
1037
|
+
id: v.number(),
|
|
1038
|
+
name: v.string(),
|
|
1039
|
+
options: v.array(v.object({ name: v.string(), position: v.number(), value: v.string() })),
|
|
1040
|
+
orderIntervalFrequency: v.optional(v.string()),
|
|
1041
|
+
orderIntervalUnitType: v.optional(v.string()),
|
|
1042
|
+
position: v.optional(v.number()),
|
|
1043
|
+
priceAdjustments: v.array(PriceAdjustment),
|
|
1044
|
+
shopifyVariantId: v.optional(v.string())
|
|
1029
1045
|
});
|
|
1030
|
-
var SellingPlanAllocation =
|
|
1031
|
-
compareAtPrice:
|
|
1032
|
-
perDeliveryPrice:
|
|
1033
|
-
price:
|
|
1034
|
-
priceAdjustments:
|
|
1035
|
-
sellingPlanGroupId:
|
|
1036
|
-
sellingPlanId:
|
|
1046
|
+
var SellingPlanAllocation = v.object({
|
|
1047
|
+
compareAtPrice: v.number(),
|
|
1048
|
+
perDeliveryPrice: v.number(),
|
|
1049
|
+
price: v.number(),
|
|
1050
|
+
priceAdjustments: v.array(PriceAdjustment),
|
|
1051
|
+
sellingPlanGroupId: v.string(),
|
|
1052
|
+
sellingPlanId: v.number()
|
|
1037
1053
|
});
|
|
1038
|
-
var SellingPlanGroup =
|
|
1039
|
-
appId:
|
|
1040
|
-
description:
|
|
1041
|
-
discountAmount:
|
|
1042
|
-
discountType:
|
|
1043
|
-
id:
|
|
1044
|
-
name:
|
|
1045
|
-
options:
|
|
1046
|
-
requiresSellingPlan:
|
|
1047
|
-
sellingPlans:
|
|
1048
|
-
variants:
|
|
1054
|
+
var SellingPlanGroup = v.object({
|
|
1055
|
+
appId: v.optional(v.string()),
|
|
1056
|
+
description: v.optional(v.string()),
|
|
1057
|
+
discountAmount: v.optional(v.number()),
|
|
1058
|
+
discountType: v.optional(v.string()),
|
|
1059
|
+
id: v.string(),
|
|
1060
|
+
name: v.string(),
|
|
1061
|
+
options: v.array(Option),
|
|
1062
|
+
requiresSellingPlan: v.optional(v.boolean()),
|
|
1063
|
+
sellingPlans: v.array(SellingPlan),
|
|
1064
|
+
variants: v.array(v.number())
|
|
1049
1065
|
});
|
|
1050
|
-
var Variant =
|
|
1051
|
-
adminGraphqlApiId:
|
|
1052
|
-
barcode:
|
|
1053
|
-
compareAtPrice:
|
|
1054
|
-
createdAt:
|
|
1055
|
-
fulfillmentService:
|
|
1056
|
-
grams:
|
|
1057
|
-
id:
|
|
1058
|
-
imageId:
|
|
1059
|
-
inventoryItemId:
|
|
1060
|
-
inventoryManagement:
|
|
1061
|
-
inventoryPolicy:
|
|
1062
|
-
inventoryQuantity:
|
|
1063
|
-
link:
|
|
1064
|
-
oldInventoryQuantity:
|
|
1065
|
-
option1:
|
|
1066
|
-
option2:
|
|
1067
|
-
option3:
|
|
1068
|
-
position:
|
|
1069
|
-
price:
|
|
1070
|
-
productId:
|
|
1071
|
-
requiresShipping:
|
|
1072
|
-
sellingPlanAllocations:
|
|
1073
|
-
sku:
|
|
1074
|
-
taxable:
|
|
1075
|
-
taxCode:
|
|
1076
|
-
title:
|
|
1077
|
-
updatedAt:
|
|
1078
|
-
weight:
|
|
1079
|
-
weightUnit:
|
|
1066
|
+
var Variant = v.object({
|
|
1067
|
+
adminGraphqlApiId: v.string(),
|
|
1068
|
+
barcode: v.nullable(v.string()),
|
|
1069
|
+
compareAtPrice: v.nullable(v.string()),
|
|
1070
|
+
createdAt: vDatetime,
|
|
1071
|
+
fulfillmentService: v.nullish(v.string()),
|
|
1072
|
+
grams: v.number(),
|
|
1073
|
+
id: v.number(),
|
|
1074
|
+
imageId: v.nullable(v.number()),
|
|
1075
|
+
inventoryItemId: v.optional(v.number()),
|
|
1076
|
+
inventoryManagement: v.nullable(v.string()),
|
|
1077
|
+
inventoryPolicy: v.string(),
|
|
1078
|
+
inventoryQuantity: v.number(),
|
|
1079
|
+
link: v.pipe(v.string(), v.url()),
|
|
1080
|
+
oldInventoryQuantity: v.optional(v.number()),
|
|
1081
|
+
option1: v.string(),
|
|
1082
|
+
option2: v.nullable(v.string()),
|
|
1083
|
+
option3: v.nullable(v.string()),
|
|
1084
|
+
position: v.number(),
|
|
1085
|
+
price: v.string(),
|
|
1086
|
+
productId: v.number(),
|
|
1087
|
+
requiresShipping: v.boolean(),
|
|
1088
|
+
sellingPlanAllocations: v.optional(v.array(SellingPlanAllocation)),
|
|
1089
|
+
sku: v.nullable(v.string()),
|
|
1090
|
+
taxable: v.boolean(),
|
|
1091
|
+
taxCode: v.optional(v.string()),
|
|
1092
|
+
title: v.string(),
|
|
1093
|
+
updatedAt: vDatetime,
|
|
1094
|
+
weight: v.number(),
|
|
1095
|
+
weightUnit: v.optional(v.string())
|
|
1080
1096
|
});
|
|
1081
|
-
var Product =
|
|
1082
|
-
adminGraphqlApiId:
|
|
1083
|
-
bodyHtml:
|
|
1097
|
+
var Product = v.object({
|
|
1098
|
+
adminGraphqlApiId: v.string(),
|
|
1099
|
+
bodyHtml: v.nullable(v.string()),
|
|
1084
1100
|
cacheInfo: CacheInfo,
|
|
1085
|
-
category:
|
|
1086
|
-
collectionIds:
|
|
1087
|
-
createdAt:
|
|
1088
|
-
description:
|
|
1089
|
-
handle:
|
|
1090
|
-
hasVariantsThatRequiresComponents:
|
|
1091
|
-
id:
|
|
1092
|
-
image:
|
|
1093
|
-
images:
|
|
1094
|
-
link:
|
|
1095
|
-
media:
|
|
1096
|
-
metafields:
|
|
1097
|
-
options:
|
|
1098
|
-
owner:
|
|
1099
|
-
productType:
|
|
1100
|
-
publishedAt:
|
|
1101
|
-
publishedScope:
|
|
1102
|
-
purchaseOptions:
|
|
1103
|
-
ratings:
|
|
1104
|
-
selectedIndexPurchasedOption:
|
|
1105
|
-
sellingPlanAllocation:
|
|
1106
|
-
sellingPlanGroups:
|
|
1107
|
-
status:
|
|
1108
|
-
tags:
|
|
1109
|
-
templateSuffix:
|
|
1110
|
-
title:
|
|
1111
|
-
updatedAt:
|
|
1112
|
-
variantGids:
|
|
1113
|
-
variantIds:
|
|
1114
|
-
variants:
|
|
1115
|
-
vendor:
|
|
1101
|
+
category: v.nullish(Category),
|
|
1102
|
+
collectionIds: v.array(v.number()),
|
|
1103
|
+
createdAt: vDatetime,
|
|
1104
|
+
description: v.string(),
|
|
1105
|
+
handle: v.string(),
|
|
1106
|
+
hasVariantsThatRequiresComponents: v.optional(v.boolean()),
|
|
1107
|
+
id: v.number(),
|
|
1108
|
+
image: v.nullable(Image),
|
|
1109
|
+
images: v.nullable(v.array(Image)),
|
|
1110
|
+
link: v.pipe(v.string(), v.url()),
|
|
1111
|
+
media: v.optional(v.array(Media)),
|
|
1112
|
+
metafields: v.optional(v.array(Metafield)),
|
|
1113
|
+
options: v.array(Option),
|
|
1114
|
+
owner: v.union([v.string(), v.number()]),
|
|
1115
|
+
productType: v.string(),
|
|
1116
|
+
publishedAt: v.nullable(vDatetime),
|
|
1117
|
+
publishedScope: v.optional(v.string()),
|
|
1118
|
+
purchaseOptions: v.optional(v.array(v.object({ discountOptions: v.array(v.never()) }))),
|
|
1119
|
+
ratings: v.optional(Ratings),
|
|
1120
|
+
selectedIndexPurchasedOption: v.optional(v.number()),
|
|
1121
|
+
sellingPlanAllocation: v.optional(SellingPlanAllocation),
|
|
1122
|
+
sellingPlanGroups: v.optional(v.array(SellingPlanGroup)),
|
|
1123
|
+
status: v.string(),
|
|
1124
|
+
tags: v.string(),
|
|
1125
|
+
templateSuffix: v.nullable(v.string()),
|
|
1126
|
+
title: v.string(),
|
|
1127
|
+
updatedAt: vDatetime,
|
|
1128
|
+
variantGids: v.optional(v.array(v.object({ adminGraphqlApiId: v.string(), updatedAt: vDatetime }))),
|
|
1129
|
+
variantIds: v.optional(v.array(v.object({ id: v.number() }))),
|
|
1130
|
+
variants: v.array(Variant),
|
|
1131
|
+
vendor: v.string()
|
|
1116
1132
|
});
|
|
1117
1133
|
|
|
1118
1134
|
// src/schema/metadata.ts
|
|
1119
|
-
var BaseRule =
|
|
1120
|
-
operator:
|
|
1121
|
-
type:
|
|
1122
|
-
value:
|
|
1135
|
+
var BaseRule = v2.object({
|
|
1136
|
+
operator: v2.string(),
|
|
1137
|
+
type: v2.string(),
|
|
1138
|
+
value: v2.union([v2.string(), v2.number()])
|
|
1123
1139
|
});
|
|
1124
|
-
var Rule =
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1140
|
+
var Rule = v2.object({
|
|
1141
|
+
...BaseRule.entries,
|
|
1142
|
+
conditions: v2.optional(v2.array(v2.object({ type: v2.string(), value: v2.union([v2.string(), v2.number()]) }))),
|
|
1143
|
+
products: v2.optional(
|
|
1144
|
+
v2.array(
|
|
1145
|
+
v2.object({
|
|
1146
|
+
productId: v2.number(),
|
|
1147
|
+
subRules: v2.optional(v2.object({ logic: v2.array(v2.object({ rules: v2.array(BaseRule) })) })),
|
|
1148
|
+
variantIds: v2.array(v2.number())
|
|
1149
|
+
})
|
|
1150
|
+
)
|
|
1151
|
+
)
|
|
1133
1152
|
});
|
|
1134
|
-
var Output =
|
|
1135
|
-
channel:
|
|
1136
|
-
collectionId:
|
|
1137
|
-
collectionSort:
|
|
1138
|
-
collectionSortType:
|
|
1139
|
-
days:
|
|
1140
|
-
discount:
|
|
1141
|
-
endpoint:
|
|
1142
|
-
key:
|
|
1143
|
-
operator:
|
|
1144
|
-
productPrice:
|
|
1145
|
-
products:
|
|
1146
|
-
productWithTagsSort:
|
|
1147
|
-
trendingSort:
|
|
1148
|
-
type:
|
|
1149
|
-
value:
|
|
1153
|
+
var Output = v2.object({
|
|
1154
|
+
channel: v2.optional(v2.string()),
|
|
1155
|
+
collectionId: v2.optional(v2.number()),
|
|
1156
|
+
collectionSort: v2.optional(v2.string()),
|
|
1157
|
+
collectionSortType: v2.nullish(v2.string()),
|
|
1158
|
+
days: v2.optional(v2.string()),
|
|
1159
|
+
discount: v2.optional(v2.object({ amount: v2.string(), type: v2.string() })),
|
|
1160
|
+
endpoint: v2.optional(v2.string()),
|
|
1161
|
+
key: v2.optional(v2.string()),
|
|
1162
|
+
operator: v2.optional(v2.string()),
|
|
1163
|
+
productPrice: v2.optional(v2.object({ amount: v2.string(), type: v2.string() })),
|
|
1164
|
+
products: v2.optional(v2.array(v2.object({ productId: v2.number(), variantIds: v2.array(v2.number()) }))),
|
|
1165
|
+
productWithTagsSort: v2.optional(v2.string()),
|
|
1166
|
+
trendingSort: v2.optional(v2.string()),
|
|
1167
|
+
type: v2.string(),
|
|
1168
|
+
value: v2.optional(v2.union([v2.string(), v2.number(), v2.boolean()]))
|
|
1150
1169
|
});
|
|
1151
|
-
var MatchedRule =
|
|
1152
|
-
collapsed:
|
|
1153
|
-
exitIfMatched:
|
|
1154
|
-
index:
|
|
1155
|
-
logic:
|
|
1156
|
-
output:
|
|
1170
|
+
var MatchedRule = v2.object({
|
|
1171
|
+
collapsed: v2.optional(v2.boolean()),
|
|
1172
|
+
exitIfMatched: v2.boolean(),
|
|
1173
|
+
index: v2.number(),
|
|
1174
|
+
logic: v2.array(v2.object({ rules: v2.array(Rule) })),
|
|
1175
|
+
output: v2.array(Output)
|
|
1157
1176
|
});
|
|
1158
|
-
var Metadata =
|
|
1159
|
-
cacheInfo:
|
|
1160
|
-
cartItems:
|
|
1161
|
-
errors:
|
|
1162
|
-
filteredInputProducts:
|
|
1163
|
-
filteredOosProducts:
|
|
1164
|
-
globalExcludedProducts:
|
|
1165
|
-
inputProducts:
|
|
1166
|
-
matchedRules:
|
|
1167
|
-
topSellersFilled:
|
|
1168
|
-
unevaluatedRules:
|
|
1169
|
-
unmatchedRules:
|
|
1170
|
-
widget:
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1177
|
+
var Metadata = v2.object({
|
|
1178
|
+
cacheInfo: v2.optional(CacheInfo),
|
|
1179
|
+
cartItems: v2.optional(v2.array(v2.never())),
|
|
1180
|
+
errors: v2.optional(v2.array(v2.never())),
|
|
1181
|
+
filteredInputProducts: v2.optional(v2.array(v2.never())),
|
|
1182
|
+
filteredOosProducts: v2.optional(v2.array(Product)),
|
|
1183
|
+
globalExcludedProducts: v2.optional(v2.array(Product)),
|
|
1184
|
+
inputProducts: v2.optional(v2.array(v2.never())),
|
|
1185
|
+
matchedRules: v2.optional(v2.array(MatchedRule)),
|
|
1186
|
+
topSellersFilled: v2.optional(v2.boolean()),
|
|
1187
|
+
unevaluatedRules: v2.optional(v2.array(MatchedRule)),
|
|
1188
|
+
unmatchedRules: v2.optional(v2.array(MatchedRule)),
|
|
1189
|
+
widget: v2.optional(
|
|
1190
|
+
v2.object({
|
|
1191
|
+
discount: v2.optional(v2.object({ amount: v2.string(), type: v2.string() })),
|
|
1192
|
+
language: v2.optional(v2.record(v2.string(), v2.string()))
|
|
1193
|
+
})
|
|
1194
|
+
)
|
|
1174
1195
|
});
|
|
1175
1196
|
|
|
1176
1197
|
// src/schema/shopConfig.ts
|
|
1177
|
-
var
|
|
1178
|
-
var
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1198
|
+
var v3 = __toESM(require("valibot"), 1);
|
|
1199
|
+
var coerceNumber = v3.pipe(
|
|
1200
|
+
v3.unknown(),
|
|
1201
|
+
v3.transform((value) => Number(value))
|
|
1202
|
+
);
|
|
1203
|
+
var ShopConfig = v3.object({
|
|
1204
|
+
activeExperiments: v3.array(
|
|
1205
|
+
v3.object({
|
|
1206
|
+
data: v3.array(
|
|
1207
|
+
v3.object({
|
|
1208
|
+
aliasName: v3.string(),
|
|
1209
|
+
cssInput: v3.nullish(v3.string()),
|
|
1210
|
+
elementId: coerceNumber,
|
|
1211
|
+
id: coerceNumber,
|
|
1212
|
+
javascriptInput: v3.nullish(v3.string()),
|
|
1213
|
+
traffic: coerceNumber
|
|
1189
1214
|
})
|
|
1190
1215
|
),
|
|
1191
|
-
id:
|
|
1192
|
-
name:
|
|
1193
|
-
pageTarget:
|
|
1194
|
-
pageTargetUrl:
|
|
1195
|
-
placeholderId:
|
|
1196
|
-
type:
|
|
1216
|
+
id: coerceNumber,
|
|
1217
|
+
name: v3.string(),
|
|
1218
|
+
pageTarget: v3.nullable(v3.string()),
|
|
1219
|
+
pageTargetUrl: v3.nullable(v3.string()),
|
|
1220
|
+
placeholderId: v3.nullable(coerceNumber),
|
|
1221
|
+
type: v3.string()
|
|
1197
1222
|
})
|
|
1198
1223
|
),
|
|
1199
|
-
activePackages:
|
|
1200
|
-
|
|
1201
|
-
cancelledAt:
|
|
1202
|
-
id:
|
|
1203
|
-
installedAt:
|
|
1204
|
-
isActive:
|
|
1205
|
-
isBillable:
|
|
1206
|
-
packageId:
|
|
1207
|
-
packageName:
|
|
1208
|
-
shortName:
|
|
1209
|
-
trialDays:
|
|
1210
|
-
uninstalledAt:
|
|
1224
|
+
activePackages: v3.array(
|
|
1225
|
+
v3.object({
|
|
1226
|
+
cancelledAt: v3.nullable(v3.string()),
|
|
1227
|
+
id: v3.number(),
|
|
1228
|
+
installedAt: v3.nullable(v3.string()),
|
|
1229
|
+
isActive: v3.boolean(),
|
|
1230
|
+
isBillable: v3.boolean(),
|
|
1231
|
+
packageId: v3.number(),
|
|
1232
|
+
packageName: v3.string(),
|
|
1233
|
+
shortName: v3.string(),
|
|
1234
|
+
trialDays: v3.number(),
|
|
1235
|
+
uninstalledAt: v3.nullable(v3.string())
|
|
1211
1236
|
})
|
|
1212
1237
|
),
|
|
1213
|
-
apiKey:
|
|
1214
|
-
billingVersion:
|
|
1215
|
-
cacheKey:
|
|
1216
|
-
carousel:
|
|
1217
|
-
currency:
|
|
1218
|
-
currencySymbol:
|
|
1219
|
-
domain:
|
|
1220
|
-
enabledJquery:
|
|
1221
|
-
enabledPresentmentCurrencies:
|
|
1222
|
-
hasSmartCollectionsEnabled:
|
|
1223
|
-
hasSmartSearchEnabled:
|
|
1224
|
-
id:
|
|
1225
|
-
integrations:
|
|
1226
|
-
|
|
1238
|
+
apiKey: v3.string(),
|
|
1239
|
+
billingVersion: v3.nullable(v3.string()),
|
|
1240
|
+
cacheKey: coerceNumber,
|
|
1241
|
+
carousel: v3.picklist(["flickity", "splide"]),
|
|
1242
|
+
currency: v3.string(),
|
|
1243
|
+
currencySymbol: v3.string(),
|
|
1244
|
+
domain: v3.string(),
|
|
1245
|
+
enabledJquery: v3.boolean(),
|
|
1246
|
+
enabledPresentmentCurrencies: v3.array(v3.string()),
|
|
1247
|
+
hasSmartCollectionsEnabled: v3.boolean(),
|
|
1248
|
+
hasSmartSearchEnabled: v3.boolean(),
|
|
1249
|
+
id: coerceNumber,
|
|
1250
|
+
integrations: v3.record(
|
|
1251
|
+
v3.picklist([
|
|
1227
1252
|
"attentive",
|
|
1228
1253
|
"judgeme",
|
|
1229
1254
|
"junip",
|
|
@@ -1236,56 +1261,55 @@ var ShopConfig = import_v43.z.object({
|
|
|
1236
1261
|
"stamped",
|
|
1237
1262
|
"yotpo"
|
|
1238
1263
|
]),
|
|
1239
|
-
|
|
1264
|
+
v3.union([v3.boolean(), v3.unknown()])
|
|
1240
1265
|
),
|
|
1241
|
-
markets:
|
|
1242
|
-
enabled:
|
|
1266
|
+
markets: v3.object({
|
|
1267
|
+
enabled: v3.boolean()
|
|
1243
1268
|
}),
|
|
1244
|
-
moneyFormat:
|
|
1245
|
-
myshopifyDomain:
|
|
1246
|
-
primaryLocale:
|
|
1247
|
-
productGroupsEnabled:
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1269
|
+
moneyFormat: v3.string(),
|
|
1270
|
+
myshopifyDomain: v3.string(),
|
|
1271
|
+
primaryLocale: v3.string(),
|
|
1272
|
+
productGroupsEnabled: v3.pipe(
|
|
1273
|
+
v3.picklist(["no", "yes"]),
|
|
1274
|
+
v3.transform((value) => value === "yes")
|
|
1275
|
+
),
|
|
1276
|
+
rechargeCustomDomain: v3.nullable(v3.string()),
|
|
1277
|
+
sellingPlansEnabled: v3.boolean(),
|
|
1278
|
+
shopId: v3.number(),
|
|
1279
|
+
shopifySellingPlansEnabled: v3.boolean(),
|
|
1280
|
+
shopName: v3.string(),
|
|
1281
|
+
storefrontAccessToken: v3.nullable(v3.string()),
|
|
1282
|
+
useRebuyIcons: v3.boolean()
|
|
1255
1283
|
});
|
|
1256
1284
|
|
|
1257
1285
|
// src/schema/userConfig.ts
|
|
1258
|
-
var
|
|
1259
|
-
var UserConfig =
|
|
1286
|
+
var v4 = __toESM(require("valibot"), 1);
|
|
1287
|
+
var UserConfig = v4.object({
|
|
1260
1288
|
shop: ShopConfig,
|
|
1261
|
-
smartCart:
|
|
1262
|
-
smartFlows:
|
|
1289
|
+
smartCart: v4.unknown(),
|
|
1290
|
+
smartFlows: v4.array(v4.unknown())
|
|
1263
1291
|
});
|
|
1264
1292
|
|
|
1265
1293
|
// src/schema/widgetData.ts
|
|
1266
|
-
var
|
|
1294
|
+
var v30 = __toESM(require("valibot"), 1);
|
|
1267
1295
|
|
|
1268
1296
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1269
|
-
var
|
|
1270
|
-
var ABTestingPlaceholder =
|
|
1271
|
-
type:
|
|
1297
|
+
var v5 = __toESM(require("valibot"), 1);
|
|
1298
|
+
var ABTestingPlaceholder = v5.looseObject({
|
|
1299
|
+
type: v5.literal("placeholder")
|
|
1272
1300
|
});
|
|
1273
1301
|
|
|
1274
1302
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
1275
|
-
var
|
|
1276
|
-
var import_v47 = require("zod/v4");
|
|
1303
|
+
var import_es_toolkit = require("es-toolkit");
|
|
1277
1304
|
|
|
1278
1305
|
// src/schema/widgets/checkout-and-beyond/common.ts
|
|
1279
|
-
var
|
|
1306
|
+
var enumOf = (values) => Object.fromEntries(values.map((value) => [value, value]));
|
|
1280
1307
|
var borderRadii = ["none", "small", "base", "large", "fullyRounded"];
|
|
1281
|
-
var
|
|
1282
|
-
var BorderRadius = borderRadius.enum;
|
|
1308
|
+
var BorderRadius = enumOf(borderRadii);
|
|
1283
1309
|
var borderStyles = ["none", "base", "dotted", "dashed"];
|
|
1284
|
-
var
|
|
1285
|
-
var BorderStyle = borderStyle.enum;
|
|
1310
|
+
var BorderStyle = enumOf(borderStyles);
|
|
1286
1311
|
var borderWidths = ["base", "medium", "thick"];
|
|
1287
|
-
var
|
|
1288
|
-
var BorderWidth = borderWidth.enum;
|
|
1312
|
+
var BorderWidth = enumOf(borderWidths);
|
|
1289
1313
|
var buttonActions = [
|
|
1290
1314
|
"addToOrder",
|
|
1291
1315
|
"declineAllOffers",
|
|
@@ -1303,8 +1327,7 @@ var buttonActions = [
|
|
|
1303
1327
|
"showVariants",
|
|
1304
1328
|
"switchToSubscription"
|
|
1305
1329
|
];
|
|
1306
|
-
var
|
|
1307
|
-
var ButtonAction = buttonAction.enum;
|
|
1330
|
+
var ButtonAction = enumOf(buttonActions);
|
|
1308
1331
|
var buttonFields = [
|
|
1309
1332
|
"activePage",
|
|
1310
1333
|
"addedToCart",
|
|
@@ -1325,14 +1348,11 @@ var buttonFields = [
|
|
|
1325
1348
|
"switchToSubscriptionNoDiscount",
|
|
1326
1349
|
"switchToSubscriptionWithDiscount"
|
|
1327
1350
|
];
|
|
1328
|
-
var
|
|
1329
|
-
var ButtonField = buttonField.enum;
|
|
1351
|
+
var ButtonField = enumOf(buttonFields);
|
|
1330
1352
|
var buttonStyles = ["primary", "secondary", "plain", "custom"];
|
|
1331
|
-
var
|
|
1332
|
-
var ButtonStyle = buttonStyle.enum;
|
|
1353
|
+
var ButtonStyle = enumOf(buttonStyles);
|
|
1333
1354
|
var directions = ["columns", "rows", "grid"];
|
|
1334
|
-
var
|
|
1335
|
-
var Direction = direction.enum;
|
|
1355
|
+
var Direction = enumOf(directions);
|
|
1336
1356
|
var editorModes = [
|
|
1337
1357
|
"checkoutExtension",
|
|
1338
1358
|
"postPurchaseOffer",
|
|
@@ -1341,11 +1361,9 @@ var editorModes = [
|
|
|
1341
1361
|
"ordersIndexPage",
|
|
1342
1362
|
"customerProfilePage"
|
|
1343
1363
|
];
|
|
1344
|
-
var
|
|
1345
|
-
var EditorMode = editorMode.enum;
|
|
1364
|
+
var EditorMode = enumOf(editorModes);
|
|
1346
1365
|
var horizontalAlignments = ["start", "center", "end"];
|
|
1347
|
-
var
|
|
1348
|
-
var HorizontalAlignment = horizontalAlignment.enum;
|
|
1366
|
+
var HorizontalAlignment = enumOf(horizontalAlignments);
|
|
1349
1367
|
var languageKeys = [
|
|
1350
1368
|
"ar",
|
|
1351
1369
|
"cs",
|
|
@@ -1374,14 +1392,11 @@ var languageKeys = [
|
|
|
1374
1392
|
"vi",
|
|
1375
1393
|
"zh"
|
|
1376
1394
|
];
|
|
1377
|
-
var
|
|
1378
|
-
var LanguageKey = languageKey.enum;
|
|
1395
|
+
var LanguageKey = enumOf(languageKeys);
|
|
1379
1396
|
var objectFits = ["cover", "contain"];
|
|
1380
|
-
var
|
|
1381
|
-
var ObjectFit = objectFit.enum;
|
|
1397
|
+
var ObjectFit = enumOf(objectFits);
|
|
1382
1398
|
var popoverPositions = ["inlineStart", "inlineEnd", "blockStart", "blockEnd"];
|
|
1383
|
-
var
|
|
1384
|
-
var PopoverPosition = popoverPosition.enum;
|
|
1399
|
+
var PopoverPosition = enumOf(popoverPositions);
|
|
1385
1400
|
var popoverPositionMap = {
|
|
1386
1401
|
bottom: "blockEnd",
|
|
1387
1402
|
left: "inlineStart",
|
|
@@ -1389,11 +1404,9 @@ var popoverPositionMap = {
|
|
|
1389
1404
|
top: "blockStart"
|
|
1390
1405
|
};
|
|
1391
1406
|
var productTypes = ["one-time", "subscription", "both"];
|
|
1392
|
-
var
|
|
1393
|
-
var ProductType = productType.enum;
|
|
1407
|
+
var ProductType = enumOf(productTypes);
|
|
1394
1408
|
var quantityInputs = ["select", "number"];
|
|
1395
|
-
var
|
|
1396
|
-
var QuantityInput = quantityInput.enum;
|
|
1409
|
+
var QuantityInput = enumOf(quantityInputs);
|
|
1397
1410
|
var sectionTypes = [
|
|
1398
1411
|
"button",
|
|
1399
1412
|
"carousel",
|
|
@@ -1410,32 +1423,23 @@ var sectionTypes = [
|
|
|
1410
1423
|
"text",
|
|
1411
1424
|
"variants"
|
|
1412
1425
|
];
|
|
1413
|
-
var
|
|
1414
|
-
var SectionType = sectionType.enum;
|
|
1426
|
+
var SectionType = enumOf(sectionTypes);
|
|
1415
1427
|
var spacings = ["none", "extraTight", "tight", "base", "loose", "extraLoose"];
|
|
1416
|
-
var
|
|
1417
|
-
var Spacing = spacing.enum;
|
|
1428
|
+
var Spacing = enumOf(spacings);
|
|
1418
1429
|
var textAlignments = ["start", "center", "end"];
|
|
1419
|
-
var
|
|
1420
|
-
var TextAlignment = textAlignment.enum;
|
|
1430
|
+
var TextAlignment = enumOf(textAlignments);
|
|
1421
1431
|
var textColorNames = ["base", "subdued", "accent", "decorative", "success", "warning", "critical"];
|
|
1422
|
-
var
|
|
1423
|
-
var TextColorName = textColorName.enum;
|
|
1432
|
+
var TextColorName = enumOf(textColorNames);
|
|
1424
1433
|
var textSizeNames = ["extraSmall", "small", "base", "medium", "large", "extraLarge"];
|
|
1425
|
-
var
|
|
1426
|
-
var TextSizeName = textSizeName.enum;
|
|
1434
|
+
var TextSizeName = enumOf(textSizeNames);
|
|
1427
1435
|
var variantSelectors = ["menu", "radio", "button"];
|
|
1428
|
-
var
|
|
1429
|
-
var VariantSelector = variantSelector.enum;
|
|
1436
|
+
var VariantSelector = enumOf(variantSelectors);
|
|
1430
1437
|
var reviewsSizes = ["small", "default", "large"];
|
|
1431
|
-
var
|
|
1432
|
-
var ReviewsSize = reviewsSize.enum;
|
|
1438
|
+
var ReviewsSize = enumOf(reviewsSizes);
|
|
1433
1439
|
var variantModes = ["multiple", "single"];
|
|
1434
|
-
var
|
|
1435
|
-
var VariantMode = variantMode.enum;
|
|
1440
|
+
var VariantMode = enumOf(variantModes);
|
|
1436
1441
|
var verticalAlignments = ["top", "middle", "bottom"];
|
|
1437
|
-
var
|
|
1438
|
-
var VerticalAlignment = verticalAlignment.enum;
|
|
1442
|
+
var VerticalAlignment = enumOf(verticalAlignments);
|
|
1439
1443
|
|
|
1440
1444
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
1441
1445
|
var DEFAULT_ENDPOINTS = [
|
|
@@ -1458,7 +1462,7 @@ var STATIC_ENDPOINTS = [
|
|
|
1458
1462
|
{ label: "Products Search", value: "/products/search" },
|
|
1459
1463
|
{ label: "Similar Products (AI)", value: "/products/similar_products" }
|
|
1460
1464
|
];
|
|
1461
|
-
var COMBINED_ENDPOINTS = (0,
|
|
1465
|
+
var COMBINED_ENDPOINTS = (0, import_es_toolkit.uniqBy)([...DEFAULT_ENDPOINTS, ...STATIC_ENDPOINTS], (item) => item.value);
|
|
1462
1466
|
var targetAreas = {
|
|
1463
1467
|
[EditorMode.checkoutExtension]: [
|
|
1464
1468
|
{ icon: "splitscreen_top", label: "Header Area", width: "984px" },
|
|
@@ -1510,27 +1514,26 @@ var widgetTypes = [
|
|
|
1510
1514
|
"ui_extension_line_item_editor",
|
|
1511
1515
|
"ui_extension_progress_bar"
|
|
1512
1516
|
];
|
|
1513
|
-
var
|
|
1514
|
-
var WidgetType = widgetType.enum;
|
|
1517
|
+
var WidgetType = enumOf(widgetTypes);
|
|
1515
1518
|
|
|
1516
1519
|
// src/schema/widgets/checkoutExtension.ts
|
|
1517
|
-
var
|
|
1518
|
-
var CheckoutExtension =
|
|
1519
|
-
type:
|
|
1520
|
+
var v6 = __toESM(require("valibot"), 1);
|
|
1521
|
+
var CheckoutExtension = v6.looseObject({
|
|
1522
|
+
type: v6.optional(v6.literal(WidgetType.shopify_checkout_extension), WidgetType.shopify_checkout_extension)
|
|
1520
1523
|
});
|
|
1521
1524
|
|
|
1522
1525
|
// src/schema/widgets/contentBlock.ts
|
|
1523
|
-
var
|
|
1526
|
+
var v24 = __toESM(require("valibot"), 1);
|
|
1524
1527
|
|
|
1525
1528
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1526
|
-
var
|
|
1529
|
+
var v23 = __toESM(require("valibot"), 1);
|
|
1527
1530
|
|
|
1528
1531
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1529
1532
|
var import_uuid10 = require("uuid");
|
|
1530
|
-
var
|
|
1533
|
+
var v22 = __toESM(require("valibot"), 1);
|
|
1531
1534
|
|
|
1532
1535
|
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1533
|
-
var
|
|
1536
|
+
var v7 = __toESM(require("valibot"), 1);
|
|
1534
1537
|
var ruleTypes = [
|
|
1535
1538
|
"cart",
|
|
1536
1539
|
"cart_count",
|
|
@@ -1549,8 +1552,7 @@ var ruleTypes = [
|
|
|
1549
1552
|
"product_type",
|
|
1550
1553
|
"product_vendor"
|
|
1551
1554
|
];
|
|
1552
|
-
var
|
|
1553
|
-
var RuleType = ruleType.enum;
|
|
1555
|
+
var RuleType = enumOf(ruleTypes);
|
|
1554
1556
|
var ruleOperators = [
|
|
1555
1557
|
"after",
|
|
1556
1558
|
"anything",
|
|
@@ -1564,48 +1566,71 @@ var ruleOperators = [
|
|
|
1564
1566
|
"greater_than",
|
|
1565
1567
|
"less_than"
|
|
1566
1568
|
];
|
|
1567
|
-
var
|
|
1568
|
-
var
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1569
|
+
var RuleOperator = enumOf(ruleOperators);
|
|
1570
|
+
var RuleCondition = v7.object({
|
|
1571
|
+
operator: v7.optional(v7.picklist(ruleOperators), RuleOperator.anything),
|
|
1572
|
+
products: v7.optional(
|
|
1573
|
+
v7.union([
|
|
1574
|
+
v7.array(v7.unknown()),
|
|
1575
|
+
v7.pipe(
|
|
1576
|
+
v7.strictObject({}),
|
|
1577
|
+
v7.transform(() => [])
|
|
1578
|
+
)
|
|
1579
|
+
]),
|
|
1580
|
+
() => []
|
|
1581
|
+
),
|
|
1582
|
+
type: v7.optional(v7.picklist(ruleTypes), RuleType.cart_subtotal),
|
|
1583
|
+
value: v7.optional(
|
|
1584
|
+
v7.pipe(
|
|
1585
|
+
v7.unknown(),
|
|
1586
|
+
v7.transform((value) => String(value))
|
|
1587
|
+
),
|
|
1588
|
+
""
|
|
1589
|
+
)
|
|
1574
1590
|
});
|
|
1575
|
-
var RuleLogicBlock =
|
|
1576
|
-
rules:
|
|
1591
|
+
var RuleLogicBlock = v7.object({
|
|
1592
|
+
rules: v7.optional(v7.array(RuleCondition), () => [])
|
|
1577
1593
|
});
|
|
1578
|
-
var CABRule =
|
|
1579
|
-
dataSourceId:
|
|
1580
|
-
enabled:
|
|
1581
|
-
ruleset:
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1594
|
+
var CABRule = v7.object({
|
|
1595
|
+
dataSourceId: v7.optional(v7.nullable(v7.number()), null),
|
|
1596
|
+
enabled: v7.optional(v7.boolean(), false),
|
|
1597
|
+
ruleset: v7.optional(
|
|
1598
|
+
v7.union([
|
|
1599
|
+
v7.array(
|
|
1600
|
+
v7.object({
|
|
1601
|
+
exitIfMatched: v7.optional(v7.boolean(), true),
|
|
1602
|
+
logic: v7.optional(v7.array(RuleLogicBlock), () => []),
|
|
1603
|
+
output: v7.optional(
|
|
1604
|
+
v7.array(
|
|
1605
|
+
v7.object({
|
|
1606
|
+
key: v7.optional(v7.string(), "should_show"),
|
|
1607
|
+
type: v7.optional(v7.literal("data_json"), "data_json"),
|
|
1608
|
+
value: v7.optional(v7.string(), "true")
|
|
1609
|
+
})
|
|
1610
|
+
),
|
|
1611
|
+
() => [{ key: "should_show", type: "data_json", value: "true" }]
|
|
1612
|
+
)
|
|
1613
|
+
})
|
|
1614
|
+
),
|
|
1615
|
+
v7.pipe(
|
|
1616
|
+
v7.strictObject({}),
|
|
1617
|
+
v7.transform(() => [])
|
|
1618
|
+
)
|
|
1619
|
+
]),
|
|
1620
|
+
() => []
|
|
1621
|
+
)
|
|
1597
1622
|
});
|
|
1598
1623
|
|
|
1599
1624
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1600
|
-
var
|
|
1625
|
+
var v21 = __toESM(require("valibot"), 1);
|
|
1601
1626
|
|
|
1602
1627
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1603
1628
|
var import_uuid3 = require("uuid");
|
|
1604
|
-
var
|
|
1629
|
+
var v10 = __toESM(require("valibot"), 1);
|
|
1605
1630
|
|
|
1606
1631
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1607
1632
|
var import_uuid = require("uuid");
|
|
1608
|
-
var
|
|
1633
|
+
var v8 = __toESM(require("valibot"), 1);
|
|
1609
1634
|
|
|
1610
1635
|
// src/schema/widgets/checkout-and-beyond/regex.ts
|
|
1611
1636
|
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
@@ -1614,7 +1639,8 @@ var HEX_COLOR_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
|
1614
1639
|
var HTML_TAGS_REGEX = /<\/?[^>]+>/g;
|
|
1615
1640
|
|
|
1616
1641
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
1617
|
-
var
|
|
1642
|
+
var import_es_toolkit2 = require("es-toolkit");
|
|
1643
|
+
var import_compat = require("es-toolkit/compat");
|
|
1618
1644
|
var isHTML = (html = "") => {
|
|
1619
1645
|
if (typeof window !== "undefined") {
|
|
1620
1646
|
const parser = new DOMParser();
|
|
@@ -1625,450 +1651,646 @@ var isHTML = (html = "") => {
|
|
|
1625
1651
|
return HTML_TAGS_REGEX.test(html);
|
|
1626
1652
|
};
|
|
1627
1653
|
var hasHTMLInDoc = (doc) => doc.content.some(({ content = [] }) => content.some(({ text }) => isHTML(text)));
|
|
1628
|
-
var checkForHTML = (input) => !((0,
|
|
1654
|
+
var checkForHTML = (input) => !((0, import_compat.isString)(input) && isHTML(input) || (0, import_es_toolkit2.isPlainObject)(input) && hasHTMLInDoc(input));
|
|
1629
1655
|
var NO_HTML = { message: "HTML is not supported" };
|
|
1630
|
-
var isButtonType = (section) => (0,
|
|
1631
|
-
var isCarouselType = (section) => (0,
|
|
1632
|
-
var isCartLineType = (section) => (0,
|
|
1633
|
-
var isDataSourceType = (section) => (0,
|
|
1634
|
-
var isImageType = (section) => (0,
|
|
1635
|
-
var isLayoutType = (section) => (0,
|
|
1636
|
-
var isOffersType = (section) => (0,
|
|
1637
|
-
var isOverlayType = (section) => isLayoutType(section) && (0,
|
|
1638
|
-
var isProductType = (section) => (0,
|
|
1639
|
-
var isProductsType = (section) => (0,
|
|
1640
|
-
var isQuantityType = (section) => (0,
|
|
1641
|
-
var isReviewsType = (section) => (0,
|
|
1642
|
-
var isTableType = (section) => (0,
|
|
1643
|
-
var isTextType = (section) => (0,
|
|
1644
|
-
var isVariantsType = (section) => (0,
|
|
1645
|
-
var hasOnlyNumericKeys = (input) => !!(0,
|
|
1646
|
-
var numericObjectToArray = (input) => (0,
|
|
1656
|
+
var isButtonType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.button;
|
|
1657
|
+
var isCarouselType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.carousel;
|
|
1658
|
+
var isCartLineType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.cartLine;
|
|
1659
|
+
var isDataSourceType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.dataSource;
|
|
1660
|
+
var isImageType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.image;
|
|
1661
|
+
var isLayoutType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.layout;
|
|
1662
|
+
var isOffersType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.offers;
|
|
1663
|
+
var isOverlayType = (section) => isLayoutType(section) && (0, import_compat.get)(section, "buttonField") === ButtonField.overlayContent;
|
|
1664
|
+
var isProductType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.product;
|
|
1665
|
+
var isProductsType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.products;
|
|
1666
|
+
var isQuantityType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.quantity;
|
|
1667
|
+
var isReviewsType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.reviews;
|
|
1668
|
+
var isTableType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.table;
|
|
1669
|
+
var isTextType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.text;
|
|
1670
|
+
var isVariantsType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.variants;
|
|
1671
|
+
var hasOnlyNumericKeys = (input) => !!(0, import_compat.size)(input) && (0, import_compat.every)(input, (_, key) => ARRAY_INDEX_STRING.test(key) && Number.isSafeInteger(Number(key)));
|
|
1672
|
+
var numericObjectToArray = (input) => (0, import_compat.toPairs)(input).sort(([a], [b]) => Number(a) - Number(b)).map(([_, value]) => value);
|
|
1647
1673
|
var convertNumericObjects = (input) => {
|
|
1648
|
-
if ((0,
|
|
1649
|
-
if ((0,
|
|
1674
|
+
if ((0, import_compat.isArray)(input)) return (0, import_compat.map)(input, convertNumericObjects);
|
|
1675
|
+
if ((0, import_es_toolkit2.isPlainObject)(input)) {
|
|
1650
1676
|
const obj = input;
|
|
1651
|
-
return hasOnlyNumericKeys(obj) ? (0,
|
|
1677
|
+
return hasOnlyNumericKeys(obj) ? (0, import_compat.map)(numericObjectToArray(obj), convertNumericObjects) : (0, import_es_toolkit2.mapValues)(obj, convertNumericObjects);
|
|
1652
1678
|
}
|
|
1653
1679
|
return input;
|
|
1654
1680
|
};
|
|
1655
1681
|
|
|
1656
1682
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1657
|
-
var CABImageSection =
|
|
1658
|
-
altText:
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1683
|
+
var CABImageSection = v8.object({
|
|
1684
|
+
altText: v8.optional(
|
|
1685
|
+
v8.pipe(
|
|
1686
|
+
v8.string(),
|
|
1687
|
+
v8.check((value) => checkForHTML(value), NO_HTML.message)
|
|
1688
|
+
),
|
|
1689
|
+
""
|
|
1690
|
+
),
|
|
1691
|
+
aspectRatio: v8.optional(v8.nullable(v8.literal(1)), null),
|
|
1692
|
+
border: v8.lazy(() => CABBorder),
|
|
1693
|
+
buttonField: v8.optional(v8.picklist(buttonFields)),
|
|
1694
|
+
category: v8.optional(v8.nullable(v8.picklist(["gallery", "icons", "payment-methods", "secure-checkout"])), null),
|
|
1695
|
+
name: v8.optional(v8.string()),
|
|
1696
|
+
naturalHeight: v8.optional(v8.number(), 0),
|
|
1697
|
+
naturalWidth: v8.optional(v8.number(), 0),
|
|
1698
|
+
objectFit: v8.optional(v8.picklist(objectFits), ObjectFit.cover),
|
|
1699
|
+
rule: v8.optional(CABRule),
|
|
1700
|
+
sectionId: v8.optional(v8.pipe(v8.string(), v8.uuid()), () => (0, import_uuid.v7)()),
|
|
1701
|
+
sectionType: v8.optional(v8.literal(SectionType.image), SectionType.image),
|
|
1702
|
+
source: v8.optional(
|
|
1703
|
+
v8.union([v8.pipe(v8.string(), v8.url()), v8.literal(""), v8.pipe(v8.string(), v8.regex(DYNAMIC_TOKEN_REGEX))]),
|
|
1704
|
+
""
|
|
1705
|
+
),
|
|
1706
|
+
width: v8.optional(v8.number(), 100)
|
|
1672
1707
|
});
|
|
1673
1708
|
|
|
1674
1709
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
1675
|
-
var
|
|
1710
|
+
var import_compat2 = require("es-toolkit/compat");
|
|
1676
1711
|
var import_uuid2 = require("uuid");
|
|
1677
|
-
var
|
|
1678
|
-
var enumOrOmit = (...vals) =>
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
}),
|
|
1692
|
-
type:
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1712
|
+
var v9 = __toESM(require("valibot"), 1);
|
|
1713
|
+
var enumOrOmit = (...vals) => v9.optional(
|
|
1714
|
+
v9.pipe(
|
|
1715
|
+
v9.string(),
|
|
1716
|
+
v9.transform(
|
|
1717
|
+
(val) => vals.includes(val) ? val : void 0
|
|
1718
|
+
)
|
|
1719
|
+
)
|
|
1720
|
+
);
|
|
1721
|
+
var TiptapText = v9.object({
|
|
1722
|
+
marks: v9.optional(
|
|
1723
|
+
v9.union([
|
|
1724
|
+
v9.array(
|
|
1725
|
+
v9.variant("type", [
|
|
1726
|
+
v9.object({ type: v9.literal("bold") }),
|
|
1727
|
+
v9.object({ type: v9.literal("italic") }),
|
|
1728
|
+
v9.object({
|
|
1729
|
+
attrs: v9.object({
|
|
1730
|
+
class: v9.nullable(v9.string()),
|
|
1731
|
+
href: v9.union([
|
|
1732
|
+
v9.pipe(v9.string(), v9.url()),
|
|
1733
|
+
v9.literal("#"),
|
|
1734
|
+
v9.pipe(v9.string(), v9.regex(DYNAMIC_TOKEN_REGEX))
|
|
1735
|
+
]),
|
|
1736
|
+
rel: v9.optional(v9.string(), "noopener noreferrer nofollow"),
|
|
1737
|
+
target: v9.optional(v9.string(), "_blank")
|
|
1738
|
+
}),
|
|
1739
|
+
type: v9.literal("link")
|
|
1699
1740
|
}),
|
|
1700
|
-
type:
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1741
|
+
v9.object({ type: v9.literal("strike") }),
|
|
1742
|
+
v9.object({
|
|
1743
|
+
attrs: v9.object({
|
|
1744
|
+
color: v9.optional(enumOrOmit(...textColorNames), TextColorName.base),
|
|
1745
|
+
fontSize: v9.optional(enumOrOmit(...textSizeNames), TextSizeName.base)
|
|
1746
|
+
}),
|
|
1747
|
+
type: v9.literal("textStyle")
|
|
1748
|
+
})
|
|
1749
|
+
])
|
|
1750
|
+
),
|
|
1751
|
+
v9.pipe(
|
|
1752
|
+
v9.strictObject({}),
|
|
1753
|
+
v9.transform(() => [])
|
|
1754
|
+
)
|
|
1755
|
+
])
|
|
1756
|
+
),
|
|
1757
|
+
text: v9.optional(v9.string(), ""),
|
|
1758
|
+
type: v9.optional(v9.literal("text"), "text")
|
|
1708
1759
|
});
|
|
1709
|
-
var TiptapParagraph =
|
|
1710
|
-
attrs:
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1760
|
+
var TiptapParagraph = v9.object({
|
|
1761
|
+
attrs: v9.optional(
|
|
1762
|
+
v9.object({
|
|
1763
|
+
textAlign: enumOrOmit(...textAlignments)
|
|
1764
|
+
}),
|
|
1765
|
+
{ textAlign: TextAlignment.start }
|
|
1766
|
+
),
|
|
1767
|
+
content: v9.optional(
|
|
1768
|
+
v9.union([
|
|
1769
|
+
v9.array(TiptapText),
|
|
1770
|
+
v9.pipe(
|
|
1771
|
+
v9.strictObject({}),
|
|
1772
|
+
v9.transform(() => [])
|
|
1773
|
+
)
|
|
1774
|
+
]),
|
|
1775
|
+
() => []
|
|
1776
|
+
),
|
|
1777
|
+
type: v9.optional(v9.literal("paragraph"), "paragraph")
|
|
1715
1778
|
});
|
|
1716
|
-
var TiptapDocument =
|
|
1717
|
-
attrs:
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1779
|
+
var TiptapDocument = v9.object({
|
|
1780
|
+
attrs: v9.optional(
|
|
1781
|
+
v9.object({
|
|
1782
|
+
blockSpacing: enumOrOmit(...spacings)
|
|
1783
|
+
}),
|
|
1784
|
+
{ blockSpacing: Spacing.base }
|
|
1785
|
+
),
|
|
1786
|
+
content: v9.optional(
|
|
1787
|
+
v9.union([
|
|
1788
|
+
v9.array(TiptapParagraph),
|
|
1789
|
+
v9.pipe(
|
|
1790
|
+
v9.strictObject({}),
|
|
1791
|
+
v9.transform(() => [])
|
|
1792
|
+
)
|
|
1793
|
+
]),
|
|
1794
|
+
() => [v9.parse(TiptapParagraph, {})]
|
|
1795
|
+
),
|
|
1796
|
+
type: v9.optional(v9.literal("doc"), "doc")
|
|
1722
1797
|
});
|
|
1723
|
-
var CABTextSection =
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1798
|
+
var CABTextSection = v9.pipe(
|
|
1799
|
+
v9.object({
|
|
1800
|
+
buttonField: v9.optional(v9.picklist(buttonFields)),
|
|
1801
|
+
content: v9.optional(
|
|
1802
|
+
v9.optional(
|
|
1803
|
+
v9.record(
|
|
1804
|
+
v9.string(),
|
|
1805
|
+
v9.optional(
|
|
1806
|
+
v9.pipe(
|
|
1807
|
+
v9.union([v9.string(), TiptapDocument]),
|
|
1808
|
+
v9.check(checkForHTML, NO_HTML.message)
|
|
1809
|
+
)
|
|
1810
|
+
)
|
|
1811
|
+
),
|
|
1812
|
+
{ en: v9.parse(TiptapDocument, {}) }
|
|
1813
|
+
)
|
|
1814
|
+
),
|
|
1815
|
+
name: v9.optional(v9.string()),
|
|
1816
|
+
optionId: v9.optional(v9.number()),
|
|
1817
|
+
rule: v9.optional(CABRule),
|
|
1818
|
+
sectionId: v9.optional(v9.pipe(v9.string(), v9.uuid()), () => (0, import_uuid2.v7)()),
|
|
1819
|
+
sectionType: v9.optional(v9.literal(SectionType.text), SectionType.text)
|
|
1820
|
+
}),
|
|
1821
|
+
v9.check(({ buttonField, content }) => {
|
|
1822
|
+
if (buttonField !== ButtonField.destinationUrl || !content) return true;
|
|
1823
|
+
let valid = true;
|
|
1824
|
+
(0, import_compat2.forEach)(content, (value) => {
|
|
1825
|
+
if (value && (0, import_compat2.isString)(value)) {
|
|
1735
1826
|
if (DYNAMIC_TOKEN_REGEX.test(value)) return;
|
|
1736
1827
|
try {
|
|
1737
1828
|
new URL(value);
|
|
1738
1829
|
} catch {
|
|
1739
|
-
|
|
1740
|
-
code: "custom",
|
|
1741
|
-
message: "Invalid URL",
|
|
1742
|
-
path: ["content", lang]
|
|
1743
|
-
});
|
|
1830
|
+
valid = false;
|
|
1744
1831
|
}
|
|
1745
1832
|
}
|
|
1746
1833
|
});
|
|
1747
|
-
|
|
1748
|
-
})
|
|
1834
|
+
return valid;
|
|
1835
|
+
}, "Invalid URL")
|
|
1836
|
+
);
|
|
1749
1837
|
|
|
1750
1838
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1751
|
-
var CABButtonContent =
|
|
1752
|
-
() =>
|
|
1839
|
+
var CABButtonContent = v10.lazy(
|
|
1840
|
+
() => v10.variant("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
1753
1841
|
);
|
|
1754
|
-
var CABButtonSection =
|
|
1755
|
-
action:
|
|
1756
|
-
buttonStyle:
|
|
1757
|
-
custom:
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1842
|
+
var CABButtonSection = v10.object({
|
|
1843
|
+
action: v10.optional(v10.union([v10.literal(""), v10.picklist(buttonActions)]), ""),
|
|
1844
|
+
buttonStyle: v10.optional(v10.picklist(buttonStyles), ButtonStyle.primary),
|
|
1845
|
+
custom: v10.optional(
|
|
1846
|
+
v10.object({
|
|
1847
|
+
color: v10.optional(v10.pipe(v10.string(), v10.regex(HEX_COLOR_REGEX)), "#005bd3"),
|
|
1848
|
+
height: v10.optional(v10.number(), 52),
|
|
1849
|
+
width: v10.optional(v10.number(), 300)
|
|
1850
|
+
}),
|
|
1851
|
+
{
|
|
1852
|
+
color: "#005bd3",
|
|
1853
|
+
height: 52,
|
|
1854
|
+
width: 300
|
|
1855
|
+
}
|
|
1856
|
+
),
|
|
1857
|
+
disableDowngrade: v10.optional(v10.boolean(), false),
|
|
1858
|
+
name: v10.optional(v10.string()),
|
|
1859
|
+
optionId: v10.optional(v10.number()),
|
|
1860
|
+
popover: v10.optional(
|
|
1861
|
+
v10.optional(
|
|
1862
|
+
v10.object({
|
|
1863
|
+
alignment: v10.optional(v10.picklist(textAlignments), TextAlignment.center),
|
|
1864
|
+
position: v10.optional(v10.picklist(popoverPositions), PopoverPosition.blockStart)
|
|
1865
|
+
})
|
|
1866
|
+
),
|
|
1867
|
+
() => ({
|
|
1868
|
+
alignment: TextAlignment.center,
|
|
1869
|
+
position: PopoverPosition.blockStart
|
|
1870
|
+
})
|
|
1871
|
+
),
|
|
1872
|
+
rule: v10.optional(CABRule),
|
|
1873
|
+
sectionId: v10.optional(v10.pipe(v10.string(), v10.uuid()), () => (0, import_uuid3.v7)()),
|
|
1874
|
+
sections: v10.optional(
|
|
1875
|
+
v10.union([
|
|
1876
|
+
v10.array(CABButtonContent),
|
|
1877
|
+
v10.pipe(
|
|
1878
|
+
v10.strictObject({}),
|
|
1879
|
+
v10.transform(() => [])
|
|
1880
|
+
)
|
|
1881
|
+
]),
|
|
1882
|
+
() => []
|
|
1883
|
+
),
|
|
1884
|
+
sectionType: v10.optional(v10.literal(SectionType.button), SectionType.button)
|
|
1780
1885
|
});
|
|
1781
1886
|
|
|
1782
1887
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
1783
|
-
var
|
|
1888
|
+
var v15 = __toESM(require("valibot"), 1);
|
|
1784
1889
|
|
|
1785
1890
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
1786
|
-
var
|
|
1891
|
+
var v14 = __toESM(require("valibot"), 1);
|
|
1787
1892
|
|
|
1788
1893
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
1789
1894
|
var import_uuid4 = require("uuid");
|
|
1790
|
-
var
|
|
1791
|
-
var CABIntegrations =
|
|
1792
|
-
judgeme:
|
|
1793
|
-
junip:
|
|
1794
|
-
klaviyo:
|
|
1795
|
-
loox:
|
|
1796
|
-
okendo:
|
|
1797
|
-
opinew:
|
|
1798
|
-
reviewsio:
|
|
1799
|
-
stamped:
|
|
1800
|
-
yotpo:
|
|
1895
|
+
var v11 = __toESM(require("valibot"), 1);
|
|
1896
|
+
var CABIntegrations = v11.object({
|
|
1897
|
+
judgeme: v11.optional(v11.boolean(), false),
|
|
1898
|
+
junip: v11.optional(v11.boolean(), false),
|
|
1899
|
+
klaviyo: v11.optional(v11.boolean(), false),
|
|
1900
|
+
loox: v11.optional(v11.boolean(), false),
|
|
1901
|
+
okendo: v11.optional(v11.boolean(), false),
|
|
1902
|
+
opinew: v11.optional(v11.boolean(), false),
|
|
1903
|
+
reviewsio: v11.optional(v11.boolean(), false),
|
|
1904
|
+
stamped: v11.optional(v11.boolean(), false),
|
|
1905
|
+
yotpo: v11.optional(v11.boolean(), false)
|
|
1801
1906
|
});
|
|
1802
|
-
var CABDataSourceSection =
|
|
1803
|
-
dataSourceId:
|
|
1804
|
-
dataSourcePath:
|
|
1805
|
-
integrations:
|
|
1806
|
-
limit:
|
|
1807
|
-
name:
|
|
1808
|
-
productType:
|
|
1809
|
-
sectionId:
|
|
1810
|
-
sectionType:
|
|
1907
|
+
var CABDataSourceSection = v11.object({
|
|
1908
|
+
dataSourceId: v11.optional(v11.nullable(v11.number()), null),
|
|
1909
|
+
dataSourcePath: v11.optional(v11.string(), DEFAULT_ENDPOINTS[0].value),
|
|
1910
|
+
integrations: v11.optional(CABIntegrations),
|
|
1911
|
+
limit: v11.optional(v11.number(), 1),
|
|
1912
|
+
name: v11.optional(v11.string(), DEFAULT_ENDPOINTS[0].label),
|
|
1913
|
+
productType: v11.optional(v11.picklist(productTypes)),
|
|
1914
|
+
sectionId: v11.optional(v11.pipe(v11.string(), v11.uuid()), () => (0, import_uuid4.v7)()),
|
|
1915
|
+
sectionType: v11.optional(v11.literal(SectionType.dataSource), SectionType.dataSource)
|
|
1811
1916
|
});
|
|
1812
1917
|
|
|
1813
1918
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
1814
1919
|
var import_uuid6 = require("uuid");
|
|
1815
|
-
var
|
|
1920
|
+
var v13 = __toESM(require("valibot"), 1);
|
|
1816
1921
|
|
|
1817
1922
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
1818
1923
|
var import_uuid5 = require("uuid");
|
|
1819
|
-
var
|
|
1820
|
-
var CABVariantContent =
|
|
1821
|
-
() =>
|
|
1924
|
+
var v12 = __toESM(require("valibot"), 1);
|
|
1925
|
+
var CABVariantContent = v12.lazy(
|
|
1926
|
+
() => v12.variant("sectionType", [CABButtonSection, CABTextSection])
|
|
1822
1927
|
);
|
|
1823
|
-
var CABProductSection =
|
|
1824
|
-
name:
|
|
1825
|
-
productId:
|
|
1826
|
-
sectionId:
|
|
1827
|
-
sections:
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1928
|
+
var CABProductSection = v12.object({
|
|
1929
|
+
name: v12.optional(v12.string()),
|
|
1930
|
+
productId: v12.optional(v12.nullable(v12.number()), null),
|
|
1931
|
+
sectionId: v12.optional(v12.pipe(v12.string(), v12.uuid()), () => (0, import_uuid5.v7)()),
|
|
1932
|
+
sections: v12.optional(
|
|
1933
|
+
v12.union([
|
|
1934
|
+
v12.array(CABVariantContent),
|
|
1935
|
+
v12.pipe(
|
|
1936
|
+
v12.strictObject({}),
|
|
1937
|
+
v12.transform(() => [])
|
|
1938
|
+
)
|
|
1939
|
+
]),
|
|
1940
|
+
() => []
|
|
1941
|
+
),
|
|
1942
|
+
sectionType: v12.optional(v12.literal(SectionType.product), SectionType.product),
|
|
1943
|
+
selectors: v12.optional(
|
|
1944
|
+
v12.record(v12.string(), v12.optional(v12.picklist(variantSelectors), VariantSelector.menu)),
|
|
1945
|
+
() => ({})
|
|
1946
|
+
),
|
|
1947
|
+
variantMode: v12.optional(v12.picklist(variantModes), VariantMode.multiple)
|
|
1831
1948
|
});
|
|
1832
1949
|
|
|
1833
1950
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
1834
|
-
var CABProductsSection =
|
|
1835
|
-
name:
|
|
1836
|
-
sectionId:
|
|
1837
|
-
sections:
|
|
1838
|
-
|
|
1951
|
+
var CABProductsSection = v13.object({
|
|
1952
|
+
name: v13.optional(v13.string()),
|
|
1953
|
+
sectionId: v13.optional(v13.pipe(v13.string(), v13.uuid()), () => (0, import_uuid6.v7)()),
|
|
1954
|
+
sections: v13.optional(
|
|
1955
|
+
v13.union([
|
|
1956
|
+
v13.array(v13.lazy(() => CABProductSection)),
|
|
1957
|
+
v13.pipe(
|
|
1958
|
+
v13.strictObject({}),
|
|
1959
|
+
v13.transform(() => [])
|
|
1960
|
+
)
|
|
1961
|
+
]),
|
|
1962
|
+
() => []
|
|
1963
|
+
),
|
|
1964
|
+
sectionType: v13.optional(v13.literal(SectionType.products), SectionType.products)
|
|
1839
1965
|
});
|
|
1840
1966
|
|
|
1841
1967
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
1842
|
-
var CABOffersSection =
|
|
1843
|
-
() =>
|
|
1844
|
-
|
|
1845
|
-
|
|
1968
|
+
var CABOffersSection = v14.lazy(
|
|
1969
|
+
() => v14.object({
|
|
1970
|
+
...CABLayoutSection.entries,
|
|
1971
|
+
sections: v14.optional(
|
|
1972
|
+
v14.union([
|
|
1973
|
+
v14.array(v14.lazy(() => CABSection)),
|
|
1974
|
+
v14.pipe(
|
|
1975
|
+
v14.strictObject({}),
|
|
1976
|
+
v14.transform(() => [])
|
|
1977
|
+
)
|
|
1978
|
+
]),
|
|
1979
|
+
() => [v14.parse(CABDataSourceSection, {}), v14.parse(CABProductsSection, {})]
|
|
1980
|
+
),
|
|
1981
|
+
sectionType: v14.optional(v14.literal(SectionType.offers), SectionType.offers)
|
|
1846
1982
|
})
|
|
1847
1983
|
);
|
|
1848
1984
|
|
|
1849
1985
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
1850
|
-
var CABCarouselSection =
|
|
1851
|
-
() =>
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1986
|
+
var CABCarouselSection = v15.lazy(
|
|
1987
|
+
() => v15.object({
|
|
1988
|
+
...CABLayoutSection.entries,
|
|
1989
|
+
autoAdvanceInterval: v15.optional(v15.number(), 0),
|
|
1990
|
+
itemsAtOnce: v15.optional(v15.pipe(v15.number(), v15.minValue(1)), 1),
|
|
1991
|
+
sections: v15.optional(
|
|
1992
|
+
v15.union([
|
|
1993
|
+
v15.array(v15.lazy(() => CABSection)),
|
|
1994
|
+
v15.pipe(
|
|
1995
|
+
v15.strictObject({}),
|
|
1996
|
+
v15.transform(() => [])
|
|
1997
|
+
)
|
|
1998
|
+
]),
|
|
1999
|
+
() => [v15.parse(CABOffersSection, {})]
|
|
2000
|
+
),
|
|
2001
|
+
sectionType: v15.optional(v15.literal(SectionType.carousel), SectionType.carousel)
|
|
1856
2002
|
})
|
|
1857
2003
|
);
|
|
1858
2004
|
|
|
1859
2005
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
1860
|
-
var
|
|
1861
|
-
var CABCartLineSection =
|
|
1862
|
-
() =>
|
|
1863
|
-
|
|
1864
|
-
|
|
2006
|
+
var v16 = __toESM(require("valibot"), 1);
|
|
2007
|
+
var CABCartLineSection = v16.lazy(
|
|
2008
|
+
() => v16.object({
|
|
2009
|
+
...CABLayoutSection.entries,
|
|
2010
|
+
sections: v16.optional(
|
|
2011
|
+
v16.union([
|
|
2012
|
+
v16.array(v16.lazy(() => CABSection)),
|
|
2013
|
+
v16.pipe(
|
|
2014
|
+
v16.strictObject({}),
|
|
2015
|
+
v16.transform(() => [])
|
|
2016
|
+
)
|
|
2017
|
+
]),
|
|
2018
|
+
() => [v16.parse(CABButtonSection, { action: ButtonAction.switchToSubscription })]
|
|
2019
|
+
),
|
|
2020
|
+
sectionType: v16.optional(v16.literal(SectionType.cartLine), SectionType.cartLine)
|
|
1865
2021
|
})
|
|
1866
2022
|
);
|
|
1867
2023
|
|
|
1868
2024
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
1869
2025
|
var import_uuid7 = require("uuid");
|
|
1870
|
-
var
|
|
1871
|
-
var CABQuantitySection =
|
|
1872
|
-
errorMessages:
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
2026
|
+
var v17 = __toESM(require("valibot"), 1);
|
|
2027
|
+
var CABQuantitySection = v17.object({
|
|
2028
|
+
errorMessages: v17.optional(
|
|
2029
|
+
v17.record(
|
|
2030
|
+
v17.string(),
|
|
2031
|
+
v17.object({
|
|
2032
|
+
max: v17.optional(v17.string()),
|
|
2033
|
+
min: v17.optional(v17.string()),
|
|
2034
|
+
neg: v17.optional(v17.string())
|
|
2035
|
+
})
|
|
2036
|
+
),
|
|
2037
|
+
{
|
|
2038
|
+
en: {
|
|
2039
|
+
max: "Maximum quantity allowed is {{max}}",
|
|
2040
|
+
min: "Minimum quantity required is {{min}}",
|
|
2041
|
+
neg: "Quantity cannot be negative"
|
|
2042
|
+
}
|
|
1884
2043
|
}
|
|
1885
|
-
|
|
1886
|
-
inputType:
|
|
1887
|
-
max:
|
|
1888
|
-
min:
|
|
1889
|
-
name:
|
|
1890
|
-
rule:
|
|
1891
|
-
sectionId:
|
|
1892
|
-
sectionType:
|
|
2044
|
+
),
|
|
2045
|
+
inputType: v17.optional(v17.picklist(quantityInputs), QuantityInput.select),
|
|
2046
|
+
max: v17.optional(v17.pipe(v17.number(), v17.minValue(1), v17.maxValue(100)), 10),
|
|
2047
|
+
min: v17.optional(v17.pipe(v17.number(), v17.minValue(1)), 1),
|
|
2048
|
+
name: v17.optional(v17.string()),
|
|
2049
|
+
rule: v17.optional(CABRule),
|
|
2050
|
+
sectionId: v17.optional(v17.pipe(v17.string(), v17.uuid()), () => (0, import_uuid7.v7)()),
|
|
2051
|
+
sectionType: v17.optional(v17.literal(SectionType.quantity), SectionType.quantity)
|
|
1893
2052
|
});
|
|
1894
2053
|
|
|
1895
2054
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
1896
2055
|
var import_uuid8 = require("uuid");
|
|
1897
|
-
var
|
|
1898
|
-
var CABReviewsSection =
|
|
1899
|
-
color:
|
|
1900
|
-
name:
|
|
1901
|
-
rule:
|
|
1902
|
-
sectionId:
|
|
1903
|
-
sectionType:
|
|
1904
|
-
size:
|
|
2056
|
+
var v18 = __toESM(require("valibot"), 1);
|
|
2057
|
+
var CABReviewsSection = v18.object({
|
|
2058
|
+
color: v18.optional(v18.string(), "#fadb14"),
|
|
2059
|
+
name: v18.optional(v18.string()),
|
|
2060
|
+
rule: v18.optional(CABRule),
|
|
2061
|
+
sectionId: v18.optional(v18.pipe(v18.string(), v18.uuid()), () => (0, import_uuid8.v7)()),
|
|
2062
|
+
sectionType: v18.optional(v18.literal(SectionType.reviews), SectionType.reviews),
|
|
2063
|
+
size: v18.optional(v18.picklist(reviewsSizes), ReviewsSize.default)
|
|
1905
2064
|
});
|
|
1906
2065
|
|
|
1907
2066
|
// src/schema/widgets/checkout-and-beyond/table.ts
|
|
1908
|
-
var
|
|
1909
|
-
var CABTableSection =
|
|
1910
|
-
() =>
|
|
1911
|
-
|
|
2067
|
+
var v19 = __toESM(require("valibot"), 1);
|
|
2068
|
+
var CABTableSection = v19.lazy(
|
|
2069
|
+
() => v19.object({
|
|
2070
|
+
...CABLayoutSection.entries,
|
|
2071
|
+
sectionType: v19.optional(v19.literal(SectionType.table), SectionType.table)
|
|
1912
2072
|
})
|
|
1913
2073
|
);
|
|
1914
2074
|
|
|
1915
2075
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
1916
|
-
var
|
|
2076
|
+
var import_compat3 = require("es-toolkit/compat");
|
|
1917
2077
|
var import_uuid9 = require("uuid");
|
|
1918
|
-
var
|
|
1919
|
-
var CABVariantsSection =
|
|
1920
|
-
name:
|
|
1921
|
-
rule:
|
|
1922
|
-
sectionId:
|
|
1923
|
-
sectionType:
|
|
1924
|
-
selector:
|
|
1925
|
-
variantMode:
|
|
2078
|
+
var v20 = __toESM(require("valibot"), 1);
|
|
2079
|
+
var CABVariantsSection = v20.object({
|
|
2080
|
+
name: v20.optional(v20.string()),
|
|
2081
|
+
rule: v20.optional(CABRule),
|
|
2082
|
+
sectionId: v20.optional(v20.pipe(v20.string(), v20.uuid()), () => (0, import_uuid9.v7)()),
|
|
2083
|
+
sectionType: v20.optional(v20.literal(SectionType.variants), SectionType.variants),
|
|
2084
|
+
selector: v20.optional(v20.picklist((0, import_compat3.slice)(variantSelectors, 0, 3)), VariantSelector.menu),
|
|
2085
|
+
variantMode: v20.optional(v20.picklist(variantModes), VariantMode.multiple)
|
|
1926
2086
|
});
|
|
1927
2087
|
|
|
1928
2088
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1929
|
-
var CABBorder =
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
2089
|
+
var CABBorder = v21.optional(
|
|
2090
|
+
v21.object({
|
|
2091
|
+
radius: v21.optional(v21.picklist(borderRadii), BorderRadius.base),
|
|
2092
|
+
style: v21.optional(v21.picklist(borderStyles), BorderStyle.none),
|
|
2093
|
+
width: v21.optional(v21.picklist(borderWidths), BorderWidth.base)
|
|
2094
|
+
}),
|
|
2095
|
+
{
|
|
2096
|
+
radius: BorderRadius.base,
|
|
2097
|
+
style: BorderStyle.none,
|
|
2098
|
+
width: BorderWidth.base
|
|
2099
|
+
}
|
|
2100
|
+
);
|
|
2101
|
+
var isSectionLike = (input) => typeof input === "object" && input !== null && "sectionType" in input;
|
|
2102
|
+
var CABSection = v21.lazy(
|
|
2103
|
+
() => v21.pipe(
|
|
2104
|
+
v21.custom(isSectionLike, "Invalid section"),
|
|
2105
|
+
v21.transform((input) => {
|
|
2106
|
+
const section = input;
|
|
2107
|
+
switch (section.sectionType) {
|
|
2108
|
+
case "button":
|
|
2109
|
+
return v21.parse(CABButtonSection, section);
|
|
2110
|
+
case "carousel":
|
|
2111
|
+
return v21.parse(CABCarouselSection, section);
|
|
2112
|
+
case "cartLine":
|
|
2113
|
+
return v21.parse(CABCartLineSection, section);
|
|
2114
|
+
case "dataSource":
|
|
2115
|
+
return v21.parse(CABDataSourceSection, section);
|
|
2116
|
+
case "image":
|
|
2117
|
+
return v21.parse(CABImageSection, section);
|
|
2118
|
+
case "layout":
|
|
2119
|
+
return v21.parse(CABLayoutSection, section);
|
|
2120
|
+
case "offers":
|
|
2121
|
+
return v21.parse(CABOffersSection, section);
|
|
2122
|
+
case "product":
|
|
2123
|
+
return v21.parse(CABProductSection, section);
|
|
2124
|
+
case "products":
|
|
2125
|
+
return v21.parse(CABProductsSection, section);
|
|
2126
|
+
case "quantity":
|
|
2127
|
+
return v21.parse(CABQuantitySection, section);
|
|
2128
|
+
case "reviews":
|
|
2129
|
+
return v21.parse(CABReviewsSection, section);
|
|
2130
|
+
case "table":
|
|
2131
|
+
return v21.parse(CABTableSection, section);
|
|
2132
|
+
case "text":
|
|
2133
|
+
return v21.parse(CABTextSection, section);
|
|
2134
|
+
case "variants":
|
|
2135
|
+
return v21.parse(CABVariantsSection, section);
|
|
2136
|
+
default:
|
|
2137
|
+
throw new Error("Invalid section type");
|
|
2138
|
+
}
|
|
2139
|
+
})
|
|
2140
|
+
)
|
|
1955
2141
|
);
|
|
1956
2142
|
|
|
1957
2143
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1958
|
-
var GridItem =
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
2144
|
+
var GridItem = v22.union([
|
|
2145
|
+
v22.literal("auto"),
|
|
2146
|
+
v22.literal("fill"),
|
|
2147
|
+
v22.pipe(v22.string(), v22.regex(/^\d+%$/)),
|
|
2148
|
+
v22.number()
|
|
2149
|
+
]);
|
|
2150
|
+
var CABLayoutSection = v22.object({
|
|
2151
|
+
alignment: v22.optional(
|
|
2152
|
+
v22.object({
|
|
2153
|
+
horizontal: v22.optional(v22.picklist(horizontalAlignments), HorizontalAlignment.start),
|
|
2154
|
+
vertical: v22.optional(v22.picklist(verticalAlignments), VerticalAlignment.top)
|
|
2155
|
+
}),
|
|
2156
|
+
{
|
|
2157
|
+
horizontal: HorizontalAlignment.start,
|
|
2158
|
+
vertical: VerticalAlignment.top
|
|
2159
|
+
}
|
|
2160
|
+
),
|
|
2161
|
+
border: v22.optional(
|
|
2162
|
+
v22.lazy(() => CABBorder),
|
|
2163
|
+
() => v22.parse(CABBorder, void 0)
|
|
2164
|
+
),
|
|
2165
|
+
buttonField: v22.optional(v22.picklist(buttonFields)),
|
|
2166
|
+
direction: v22.optional(v22.picklist(directions), Direction.rows),
|
|
2167
|
+
grid: v22.optional(
|
|
2168
|
+
v22.optional(
|
|
2169
|
+
v22.object({
|
|
2170
|
+
columns: v22.optional(v22.union([v22.array(GridItem), v22.undefined()]), () => ["auto"]),
|
|
2171
|
+
rows: v22.optional(v22.union([v22.array(GridItem), v22.undefined()]), () => ["auto"])
|
|
2172
|
+
}),
|
|
2173
|
+
{ columns: ["auto"], rows: ["auto"] }
|
|
2174
|
+
)
|
|
2175
|
+
),
|
|
2176
|
+
name: v22.optional(v22.string()),
|
|
2177
|
+
padding: v22.optional(v22.picklist(spacings), Spacing.none),
|
|
2178
|
+
rule: v22.optional(CABRule),
|
|
2179
|
+
sectionId: v22.optional(v22.pipe(v22.string(), v22.uuid()), () => (0, import_uuid10.v7)()),
|
|
2180
|
+
sections: v22.optional(
|
|
2181
|
+
v22.union([
|
|
2182
|
+
v22.array(v22.lazy(() => CABSection)),
|
|
2183
|
+
v22.pipe(
|
|
2184
|
+
v22.strictObject({}),
|
|
2185
|
+
v22.transform(() => [])
|
|
2186
|
+
)
|
|
2187
|
+
]),
|
|
2188
|
+
() => []
|
|
2189
|
+
),
|
|
2190
|
+
sectionType: v22.optional(v22.literal(SectionType.layout), SectionType.layout),
|
|
2191
|
+
spacing: v22.optional(v22.picklist(spacings), Spacing.base),
|
|
2192
|
+
width: v22.optional(v22.number(), 100)
|
|
1982
2193
|
});
|
|
1983
2194
|
|
|
1984
2195
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1985
|
-
var TargetArea =
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2196
|
+
var TargetArea = v23.optional(
|
|
2197
|
+
v23.object({
|
|
2198
|
+
fill: v23.optional(v23.boolean()),
|
|
2199
|
+
flip: v23.optional(v23.picklist(["both", "horizontal", "vertical"])),
|
|
2200
|
+
icon: v23.string(),
|
|
2201
|
+
label: v23.string(),
|
|
2202
|
+
width: v23.string()
|
|
2203
|
+
}),
|
|
2204
|
+
targetAreas[EditorMode.checkoutExtension][1]
|
|
2205
|
+
);
|
|
2206
|
+
var CABRootSection = v23.object({
|
|
2207
|
+
...CABLayoutSection.entries,
|
|
2208
|
+
editorMode: v23.optional(v23.picklist(editorModes), EditorMode.checkoutExtension),
|
|
2209
|
+
previewMode: v23.optional(v23.boolean(), false),
|
|
2210
|
+
storeId: v23.optional(v23.nullable(v23.number()), null),
|
|
2211
|
+
targetArea: v23.nullable(TargetArea),
|
|
2212
|
+
type: v23.optional(v23.picklist(widgetTypes), WidgetType.ui_extension_content_block),
|
|
2213
|
+
version: v23.optional(v23.literal(2), 2),
|
|
2214
|
+
widgetId: v23.optional(v23.nullable(v23.number()), null)
|
|
2000
2215
|
});
|
|
2001
2216
|
|
|
2002
2217
|
// src/schema/widgets/contentBlock.ts
|
|
2003
|
-
var ContentBlockV1 =
|
|
2004
|
-
blockSpacing:
|
|
2005
|
-
imageBlocks:
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2218
|
+
var ContentBlockV1 = v24.object({
|
|
2219
|
+
blockSpacing: v24.optional(v24.picklist(spacings)),
|
|
2220
|
+
imageBlocks: v24.optional(
|
|
2221
|
+
v24.union([
|
|
2222
|
+
v24.array(
|
|
2223
|
+
v24.object({
|
|
2224
|
+
altText: v24.nullable(v24.string()),
|
|
2225
|
+
description: v24.nullable(v24.string()),
|
|
2226
|
+
id: v24.pipe(v24.string(), v24.uuid()),
|
|
2227
|
+
imagePlacement: v24.picklist(["top", "right", "bottom", "left"]),
|
|
2228
|
+
imageSize: v24.number(),
|
|
2229
|
+
imageUrl: v24.pipe(v24.string(), v24.url()),
|
|
2230
|
+
textAlignment: v24.picklist(["left", "center", "right"]),
|
|
2231
|
+
textSize: v24.picklist(textSizeNames)
|
|
2232
|
+
})
|
|
2233
|
+
),
|
|
2234
|
+
v24.pipe(
|
|
2235
|
+
v24.strictObject({}),
|
|
2236
|
+
v24.transform(() => [])
|
|
2237
|
+
)
|
|
2238
|
+
])
|
|
2239
|
+
),
|
|
2240
|
+
imageLayout: v24.optional(v24.picklist(["row", "column"])),
|
|
2241
|
+
language: v24.object({
|
|
2242
|
+
description: v24.string(),
|
|
2243
|
+
superTitle: v24.string(),
|
|
2244
|
+
title: v24.string()
|
|
2025
2245
|
}),
|
|
2026
|
-
previewMode:
|
|
2027
|
-
type:
|
|
2028
|
-
version:
|
|
2246
|
+
previewMode: v24.boolean(),
|
|
2247
|
+
type: v24.optional(v24.literal(WidgetType.ui_extension_content_block), WidgetType.ui_extension_content_block),
|
|
2248
|
+
version: v24.literal(1)
|
|
2029
2249
|
});
|
|
2030
|
-
var ContentBlock =
|
|
2250
|
+
var ContentBlock = v24.variant("version", [
|
|
2031
2251
|
ContentBlockV1,
|
|
2032
|
-
|
|
2033
|
-
|
|
2252
|
+
v24.object({
|
|
2253
|
+
...CABRootSection.entries,
|
|
2254
|
+
type: v24.optional(v24.literal(WidgetType.ui_extension_content_block), WidgetType.ui_extension_content_block)
|
|
2034
2255
|
})
|
|
2035
2256
|
]);
|
|
2036
2257
|
|
|
2037
2258
|
// src/schema/widgets/giftWithPurchase.ts
|
|
2038
|
-
var
|
|
2039
|
-
var GiftWithPurchase =
|
|
2040
|
-
type:
|
|
2259
|
+
var v25 = __toESM(require("valibot"), 1);
|
|
2260
|
+
var GiftWithPurchase = v25.looseObject({
|
|
2261
|
+
type: v25.optional(v25.literal(WidgetType.gift_with_purchase), WidgetType.gift_with_purchase)
|
|
2041
2262
|
});
|
|
2042
2263
|
|
|
2043
2264
|
// src/schema/widgets/lineItemEditor.ts
|
|
2044
|
-
var
|
|
2045
|
-
var LineItemEditor =
|
|
2046
|
-
type:
|
|
2265
|
+
var v26 = __toESM(require("valibot"), 1);
|
|
2266
|
+
var LineItemEditor = v26.looseObject({
|
|
2267
|
+
type: v26.optional(v26.literal(WidgetType.ui_extension_line_item_editor), WidgetType.ui_extension_line_item_editor)
|
|
2047
2268
|
});
|
|
2048
2269
|
|
|
2049
2270
|
// src/schema/widgets/progressBar.ts
|
|
2050
|
-
var
|
|
2051
|
-
var ProgressBar =
|
|
2052
|
-
type:
|
|
2271
|
+
var v27 = __toESM(require("valibot"), 1);
|
|
2272
|
+
var ProgressBar = v27.looseObject({
|
|
2273
|
+
type: v27.optional(v27.literal(WidgetType.ui_extension_progress_bar), WidgetType.ui_extension_progress_bar)
|
|
2053
2274
|
});
|
|
2054
2275
|
|
|
2055
2276
|
// src/schema/widgets/rebuyButton.ts
|
|
2056
|
-
var
|
|
2057
|
-
var RebuyButtonV1 =
|
|
2058
|
-
type:
|
|
2059
|
-
version:
|
|
2277
|
+
var v28 = __toESM(require("valibot"), 1);
|
|
2278
|
+
var RebuyButtonV1 = v28.looseObject({
|
|
2279
|
+
type: v28.optional(v28.literal(WidgetType.ui_extension_button), WidgetType.ui_extension_button),
|
|
2280
|
+
version: v28.literal(1)
|
|
2060
2281
|
});
|
|
2061
|
-
var RebuyButton =
|
|
2282
|
+
var RebuyButton = v28.variant("version", [
|
|
2062
2283
|
RebuyButtonV1,
|
|
2063
|
-
|
|
2064
|
-
|
|
2284
|
+
v28.object({
|
|
2285
|
+
...CABRootSection.entries,
|
|
2286
|
+
type: v28.optional(v28.literal(WidgetType.ui_extension_button), WidgetType.ui_extension_button)
|
|
2065
2287
|
})
|
|
2066
2288
|
]);
|
|
2067
2289
|
|
|
2068
2290
|
// src/schema/widgets/rebuyMonetize.ts
|
|
2069
|
-
var
|
|
2070
|
-
var RebuyMonetize =
|
|
2071
|
-
type:
|
|
2291
|
+
var v29 = __toESM(require("valibot"), 1);
|
|
2292
|
+
var RebuyMonetize = v29.looseObject({
|
|
2293
|
+
type: v29.optional(v29.literal(WidgetType.ui_extension_ad), WidgetType.ui_extension_ad)
|
|
2072
2294
|
});
|
|
2073
2295
|
|
|
2074
2296
|
// src/schema/widgetData.ts
|
|
@@ -2082,7 +2304,7 @@ var extensionWidgetTypes = [
|
|
|
2082
2304
|
WidgetType.ui_extension_line_item_editor,
|
|
2083
2305
|
WidgetType.ui_extension_progress_bar
|
|
2084
2306
|
];
|
|
2085
|
-
var WidgetData =
|
|
2307
|
+
var WidgetData = v30.variant("type", [
|
|
2086
2308
|
ABTestingPlaceholder,
|
|
2087
2309
|
CheckoutExtension,
|
|
2088
2310
|
ContentBlock,
|
|
@@ -2094,16 +2316,21 @@ var WidgetData = import_v432.z.discriminatedUnion("type", [
|
|
|
2094
2316
|
]);
|
|
2095
2317
|
|
|
2096
2318
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
2097
|
-
var
|
|
2098
|
-
var
|
|
2099
|
-
var strictNumber =
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2319
|
+
var import_compat4 = require("es-toolkit/compat");
|
|
2320
|
+
var v31 = __toESM(require("valibot"), 1);
|
|
2321
|
+
var strictNumber = v31.union([
|
|
2322
|
+
v31.number(),
|
|
2323
|
+
v31.pipe(
|
|
2324
|
+
v31.string(),
|
|
2325
|
+
v31.transform((value) => (0, import_compat4.toNumber)((0, import_compat4.replace)((0, import_compat4.toString)(value), /[^0-9.]/g, "")) || 0)
|
|
2326
|
+
),
|
|
2327
|
+
v31.pipe(
|
|
2328
|
+
v31.unknown(),
|
|
2329
|
+
v31.transform(() => 0)
|
|
2330
|
+
)
|
|
2103
2331
|
]);
|
|
2104
2332
|
|
|
2105
2333
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
2106
|
-
var import_v434 = require("zod/v4");
|
|
2107
2334
|
var blockTypes = [
|
|
2108
2335
|
"callout_banner",
|
|
2109
2336
|
"image",
|
|
@@ -2114,144 +2341,190 @@ var blockTypes = [
|
|
|
2114
2341
|
"text",
|
|
2115
2342
|
"timer"
|
|
2116
2343
|
];
|
|
2117
|
-
var
|
|
2118
|
-
var BlockType = blockType.enum;
|
|
2344
|
+
var BlockType = enumOf(blockTypes);
|
|
2119
2345
|
|
|
2120
2346
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
2121
|
-
var
|
|
2347
|
+
var import_compat5 = require("es-toolkit/compat");
|
|
2122
2348
|
var import_uuid11 = require("uuid");
|
|
2123
|
-
var
|
|
2124
|
-
var TextAlignment2 =
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2349
|
+
var v32 = __toESM(require("valibot"), 1);
|
|
2350
|
+
var TextAlignment2 = v32.union([
|
|
2351
|
+
v32.picklist(["leading", "center", "trailing"]),
|
|
2352
|
+
v32.pipe(
|
|
2353
|
+
v32.unknown(),
|
|
2354
|
+
v32.transform(() => "leading")
|
|
2355
|
+
)
|
|
2356
|
+
]);
|
|
2357
|
+
var TextSize = v32.union([
|
|
2358
|
+
v32.picklist(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
2359
|
+
v32.pipe(
|
|
2360
|
+
v32.unknown(),
|
|
2361
|
+
v32.transform(() => "medium")
|
|
2362
|
+
)
|
|
2128
2363
|
]);
|
|
2129
|
-
var CalloutBannerBlock =
|
|
2130
|
-
id:
|
|
2131
|
-
name:
|
|
2132
|
-
settings:
|
|
2133
|
-
superTitle:
|
|
2134
|
-
title:
|
|
2364
|
+
var CalloutBannerBlock = v32.object({
|
|
2365
|
+
id: v32.optional(v32.string(), () => (0, import_uuid11.v4)()),
|
|
2366
|
+
name: v32.optional(v32.string()),
|
|
2367
|
+
settings: v32.object({
|
|
2368
|
+
superTitle: v32.optional(v32.union([v32.string(), TiptapDocument]), () => "Limited-time Offer"),
|
|
2369
|
+
title: v32.optional(v32.union([v32.string(), TiptapDocument]), () => "Add this customer favorite to your order")
|
|
2135
2370
|
}),
|
|
2136
|
-
styles:
|
|
2137
|
-
superTitleEmphasized:
|
|
2138
|
-
superTitleSize:
|
|
2139
|
-
textAlignment:
|
|
2140
|
-
titleEmphasized:
|
|
2141
|
-
titleSize:
|
|
2371
|
+
styles: v32.object({
|
|
2372
|
+
superTitleEmphasized: v32.optional(v32.boolean(), false),
|
|
2373
|
+
superTitleSize: v32.optional(TextSize, "large"),
|
|
2374
|
+
textAlignment: v32.optional(TextAlignment2, "center"),
|
|
2375
|
+
titleEmphasized: v32.optional(v32.boolean(), true),
|
|
2376
|
+
titleSize: v32.optional(TextSize, "large")
|
|
2142
2377
|
}),
|
|
2143
|
-
type:
|
|
2378
|
+
type: v32.optional(v32.literal(BlockType.callout_banner), BlockType.callout_banner)
|
|
2144
2379
|
});
|
|
2145
|
-
var ImageBlock =
|
|
2146
|
-
id:
|
|
2147
|
-
name:
|
|
2148
|
-
settings:
|
|
2149
|
-
|
|
2380
|
+
var ImageBlock = v32.object({
|
|
2381
|
+
id: v32.optional(v32.string(), () => (0, import_uuid11.v4)()),
|
|
2382
|
+
name: v32.optional(v32.string()),
|
|
2383
|
+
settings: v32.union([
|
|
2384
|
+
v32.object({
|
|
2150
2385
|
/** This isn't used in the post-purchase offer widget */
|
|
2151
|
-
alt:
|
|
2152
|
-
image:
|
|
2153
|
-
imageSize:
|
|
2154
|
-
imageType:
|
|
2386
|
+
alt: v32.optional(v32.string(), ""),
|
|
2387
|
+
image: v32.optional(v32.union([v32.literal(""), v32.pipe(v32.string(), v32.url())]), ""),
|
|
2388
|
+
imageSize: v32.optional(v32.number(), 20),
|
|
2389
|
+
imageType: v32.optional(v32.picklist(["URL", "UPLOAD"]), "URL")
|
|
2155
2390
|
}),
|
|
2156
|
-
|
|
2391
|
+
v32.pipe(
|
|
2392
|
+
v32.array(v32.never()),
|
|
2393
|
+
v32.transform(() => ({}))
|
|
2394
|
+
)
|
|
2157
2395
|
]),
|
|
2158
|
-
type:
|
|
2396
|
+
type: v32.optional(v32.literal(BlockType.image), BlockType.image)
|
|
2159
2397
|
});
|
|
2160
|
-
var ImageContentBlock =
|
|
2161
|
-
id:
|
|
2162
|
-
name:
|
|
2163
|
-
settings:
|
|
2164
|
-
alt:
|
|
2165
|
-
description:
|
|
2398
|
+
var ImageContentBlock = v32.object({
|
|
2399
|
+
id: v32.optional(v32.string(), () => (0, import_uuid11.v4)()),
|
|
2400
|
+
name: v32.optional(v32.string()),
|
|
2401
|
+
settings: v32.object({
|
|
2402
|
+
alt: v32.optional(v32.string(), ""),
|
|
2403
|
+
description: v32.optional(
|
|
2404
|
+
v32.union([v32.string(), TiptapDocument, v32.null_()]),
|
|
2166
2405
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
2167
2406
|
),
|
|
2168
|
-
descriptionSize:
|
|
2169
|
-
horizontalAlignment:
|
|
2170
|
-
image:
|
|
2171
|
-
imagePlacement:
|
|
2172
|
-
imageSize:
|
|
2173
|
-
superTitle:
|
|
2174
|
-
superTitleSize:
|
|
2407
|
+
descriptionSize: v32.optional(TextSize, "medium"),
|
|
2408
|
+
horizontalAlignment: v32.optional(TextAlignment2, "leading"),
|
|
2409
|
+
image: v32.optional(v32.union([v32.literal(""), v32.pipe(v32.string(), v32.url())]), ""),
|
|
2410
|
+
imagePlacement: v32.optional(v32.picklist(["bottom", "left", "right", "top"]), "left"),
|
|
2411
|
+
imageSize: v32.optional(v32.number(), 20),
|
|
2412
|
+
superTitle: v32.optional(v32.union([v32.string(), TiptapDocument]), "Lorem Ipsum!"),
|
|
2413
|
+
superTitleSize: v32.optional(TextSize, "medium"),
|
|
2175
2414
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2176
|
-
swapContent:
|
|
2177
|
-
title:
|
|
2178
|
-
titleSize:
|
|
2415
|
+
swapContent: v32.optional(v32.boolean(), false),
|
|
2416
|
+
title: v32.optional(v32.nullable(v32.union([v32.string(), TiptapDocument])), "Lorem ipsum dolor sit amet"),
|
|
2417
|
+
titleSize: v32.optional(TextSize, "medium")
|
|
2179
2418
|
}),
|
|
2180
|
-
type:
|
|
2419
|
+
type: v32.optional(v32.literal(BlockType.image_content), BlockType.image_content)
|
|
2181
2420
|
});
|
|
2182
|
-
var PayButtonBlock =
|
|
2183
|
-
id:
|
|
2184
|
-
name:
|
|
2185
|
-
settings:
|
|
2186
|
-
|
|
2187
|
-
label:
|
|
2421
|
+
var PayButtonBlock = v32.object({
|
|
2422
|
+
id: v32.optional(v32.string(), () => (0, import_uuid11.v4)()),
|
|
2423
|
+
name: v32.optional(v32.string()),
|
|
2424
|
+
settings: v32.union([
|
|
2425
|
+
v32.object({
|
|
2426
|
+
label: v32.optional(v32.string(), "Pay Now")
|
|
2188
2427
|
}),
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2428
|
+
v32.pipe(
|
|
2429
|
+
v32.array(v32.never()),
|
|
2430
|
+
v32.transform(() => ({
|
|
2431
|
+
label: "Pay Now"
|
|
2432
|
+
}))
|
|
2433
|
+
)
|
|
2192
2434
|
]),
|
|
2193
|
-
styles:
|
|
2194
|
-
|
|
2195
|
-
buttonWidth:
|
|
2435
|
+
styles: v32.union([
|
|
2436
|
+
v32.object({
|
|
2437
|
+
buttonWidth: v32.optional(v32.pipe(v32.number(), v32.minValue(10), v32.maxValue(100)), 50)
|
|
2196
2438
|
}),
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2439
|
+
v32.pipe(
|
|
2440
|
+
v32.array(v32.never()),
|
|
2441
|
+
v32.transform(() => ({
|
|
2442
|
+
buttonWidth: 50
|
|
2443
|
+
}))
|
|
2444
|
+
)
|
|
2200
2445
|
]),
|
|
2201
|
-
type:
|
|
2446
|
+
type: v32.optional(v32.literal(BlockType.pay_button), BlockType.pay_button)
|
|
2202
2447
|
});
|
|
2203
|
-
var ProductInformationBlock =
|
|
2448
|
+
var ProductInformationBlock = v32.object({
|
|
2204
2449
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2205
|
-
hideProductImage:
|
|
2206
|
-
id:
|
|
2207
|
-
name:
|
|
2208
|
-
type:
|
|
2450
|
+
hideProductImage: v32.optional(v32.boolean(), false),
|
|
2451
|
+
id: v32.optional(v32.string(), () => (0, import_uuid11.v4)()),
|
|
2452
|
+
name: v32.optional(v32.string()),
|
|
2453
|
+
type: v32.optional(v32.literal(BlockType.product_information), BlockType.product_information)
|
|
2209
2454
|
});
|
|
2210
|
-
var SeparatorBlock =
|
|
2211
|
-
id:
|
|
2212
|
-
name:
|
|
2213
|
-
type:
|
|
2455
|
+
var SeparatorBlock = v32.object({
|
|
2456
|
+
id: v32.optional(v32.string(), () => (0, import_uuid11.v4)()),
|
|
2457
|
+
name: v32.optional(v32.string()),
|
|
2458
|
+
type: v32.optional(v32.literal(BlockType.separator), BlockType.separator)
|
|
2214
2459
|
});
|
|
2215
|
-
var TextBlock =
|
|
2216
|
-
id:
|
|
2217
|
-
name:
|
|
2218
|
-
settings:
|
|
2219
|
-
description:
|
|
2460
|
+
var TextBlock = v32.object({
|
|
2461
|
+
id: v32.optional(v32.string(), () => (0, import_uuid11.v4)()),
|
|
2462
|
+
name: v32.optional(v32.string()),
|
|
2463
|
+
settings: v32.object({
|
|
2464
|
+
description: v32.optional(
|
|
2465
|
+
v32.union([v32.string(), TiptapDocument]),
|
|
2220
2466
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
2221
2467
|
),
|
|
2222
2468
|
/** This isn't used in the post-purchase offer widget */
|
|
2223
|
-
descriptionSize:
|
|
2224
|
-
horizontalAlignment:
|
|
2225
|
-
superTitle:
|
|
2469
|
+
descriptionSize: v32.optional(TextSize, "medium"),
|
|
2470
|
+
horizontalAlignment: v32.optional(TextAlignment2, "leading"),
|
|
2471
|
+
superTitle: v32.optional(v32.union([v32.string(), TiptapDocument]), "Super Title"),
|
|
2226
2472
|
/** This isn't used in the post-purchase offer widget */
|
|
2227
|
-
superTitleSize:
|
|
2228
|
-
title:
|
|
2473
|
+
superTitleSize: v32.optional(TextSize, "medium"),
|
|
2474
|
+
title: v32.optional(v32.nullable(v32.union([v32.string(), TiptapDocument])), "Lorem ipsum dolor sit amet."),
|
|
2229
2475
|
/** This isn't used in the post-purchase offer widget */
|
|
2230
|
-
titleSize:
|
|
2476
|
+
titleSize: v32.optional(TextSize, "medium")
|
|
2231
2477
|
}),
|
|
2232
|
-
type:
|
|
2478
|
+
type: v32.optional(v32.literal(BlockType.text), BlockType.text)
|
|
2233
2479
|
});
|
|
2234
|
-
var TimerBlock =
|
|
2235
|
-
id:
|
|
2236
|
-
name:
|
|
2237
|
-
settings:
|
|
2238
|
-
durationMinutes:
|
|
2239
|
-
durationSeconds:
|
|
2240
|
-
|
|
2241
|
-
|
|
2480
|
+
var TimerBlock = v32.object({
|
|
2481
|
+
id: v32.optional(v32.string(), () => (0, import_uuid11.v4)()),
|
|
2482
|
+
name: v32.optional(v32.string()),
|
|
2483
|
+
settings: v32.object({
|
|
2484
|
+
durationMinutes: v32.optional(v32.pipe(v32.number(), v32.minValue(0)), 10),
|
|
2485
|
+
durationSeconds: v32.optional(
|
|
2486
|
+
v32.union([
|
|
2487
|
+
v32.pipe(v32.number(), v32.minValue(0)),
|
|
2488
|
+
v32.pipe(
|
|
2489
|
+
v32.unknown(),
|
|
2490
|
+
v32.transform(() => 0)
|
|
2491
|
+
)
|
|
2492
|
+
]),
|
|
2493
|
+
0
|
|
2494
|
+
),
|
|
2495
|
+
endOffer: v32.optional(v32.boolean(), true),
|
|
2496
|
+
title: v32.optional(v32.union([v32.string(), TiptapDocument]), "Hurry \u2014 your special offer ends in:")
|
|
2242
2497
|
}),
|
|
2243
|
-
styles:
|
|
2244
|
-
textAlignment:
|
|
2245
|
-
timerBackgroundColor:
|
|
2246
|
-
timerEmphasized:
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2498
|
+
styles: v32.object({
|
|
2499
|
+
textAlignment: v32.optional(TextAlignment2, "center"),
|
|
2500
|
+
timerBackgroundColor: v32.optional(v32.picklist(["info", "warning", "success", "critical"]), "warning"),
|
|
2501
|
+
timerEmphasized: v32.optional(
|
|
2502
|
+
v32.union([
|
|
2503
|
+
v32.boolean(),
|
|
2504
|
+
v32.pipe(
|
|
2505
|
+
v32.unknown(),
|
|
2506
|
+
v32.transform(() => true)
|
|
2507
|
+
)
|
|
2508
|
+
]),
|
|
2509
|
+
true
|
|
2510
|
+
),
|
|
2511
|
+
timerSize: v32.optional(TextSize, "medium"),
|
|
2512
|
+
timerWidth: v32.optional(v32.pipe(v32.number(), v32.minValue(10), v32.maxValue(100)), 100),
|
|
2513
|
+
titleEmphasized: v32.optional(
|
|
2514
|
+
v32.union([
|
|
2515
|
+
v32.boolean(),
|
|
2516
|
+
v32.pipe(
|
|
2517
|
+
v32.unknown(),
|
|
2518
|
+
v32.transform(() => true)
|
|
2519
|
+
)
|
|
2520
|
+
]),
|
|
2521
|
+
false
|
|
2522
|
+
),
|
|
2523
|
+
titleSize: v32.optional(TextSize, "medium")
|
|
2251
2524
|
}),
|
|
2252
|
-
type:
|
|
2525
|
+
type: v32.optional(v32.literal(BlockType.timer), BlockType.timer)
|
|
2253
2526
|
});
|
|
2254
|
-
var PostPurchaseBlock =
|
|
2527
|
+
var PostPurchaseBlock = v32.variant("type", [
|
|
2255
2528
|
CalloutBannerBlock,
|
|
2256
2529
|
ImageBlock,
|
|
2257
2530
|
ImageContentBlock,
|
|
@@ -2261,221 +2534,319 @@ var PostPurchaseBlock = import_v435.z.discriminatedUnion("type", [
|
|
|
2261
2534
|
TextBlock,
|
|
2262
2535
|
TimerBlock
|
|
2263
2536
|
]);
|
|
2264
|
-
var isCalloutBannerBlock = (block) => (0,
|
|
2265
|
-
var isImageBlock = (block) => (0,
|
|
2266
|
-
var isImageContentBlock = (block) => (0,
|
|
2267
|
-
var isPayButtonBlock = (block) => (0,
|
|
2268
|
-
var isProductInformationBlock = (block) => (0,
|
|
2269
|
-
var isSeparatorBlock = (block) => (0,
|
|
2270
|
-
var isTextBlock = (block) => (0,
|
|
2271
|
-
var isTimerBlock = (block) => (0,
|
|
2537
|
+
var isCalloutBannerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.callout_banner);
|
|
2538
|
+
var isImageBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.image);
|
|
2539
|
+
var isImageContentBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.image_content);
|
|
2540
|
+
var isPayButtonBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.pay_button);
|
|
2541
|
+
var isProductInformationBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.product_information);
|
|
2542
|
+
var isSeparatorBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.separator);
|
|
2543
|
+
var isTextBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.text);
|
|
2544
|
+
var isTimerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.timer);
|
|
2272
2545
|
|
|
2273
2546
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
2274
|
-
var
|
|
2547
|
+
var v35 = __toESM(require("valibot"), 1);
|
|
2275
2548
|
|
|
2276
2549
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
2277
|
-
var
|
|
2550
|
+
var v34 = __toESM(require("valibot"), 1);
|
|
2278
2551
|
|
|
2279
2552
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
2280
|
-
var
|
|
2281
|
-
var PostPurchaseSettings =
|
|
2282
|
-
advance:
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2553
|
+
var v33 = __toESM(require("valibot"), 1);
|
|
2554
|
+
var PostPurchaseSettings = v33.object({
|
|
2555
|
+
advance: v33.optional(v33.optional(v33.object({ removePartialOrder: v33.optional(v33.boolean(), true) })), () => ({
|
|
2556
|
+
removePartialOrder: true
|
|
2557
|
+
})),
|
|
2558
|
+
blocks: v33.optional(
|
|
2559
|
+
v33.union([
|
|
2560
|
+
v33.array(PostPurchaseBlock),
|
|
2561
|
+
v33.pipe(
|
|
2562
|
+
v33.unknown(),
|
|
2563
|
+
v33.transform(() => [])
|
|
2564
|
+
)
|
|
2565
|
+
]),
|
|
2566
|
+
() => [
|
|
2567
|
+
v33.parse(PostPurchaseBlock, { settings: {}, styles: {}, type: BlockType.timer }),
|
|
2568
|
+
v33.parse(PostPurchaseBlock, { settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
2569
|
+
v33.parse(PostPurchaseBlock, { type: BlockType.product_information })
|
|
2570
|
+
]
|
|
2571
|
+
),
|
|
2572
|
+
columnLayout: v33.optional(v33.boolean()),
|
|
2573
|
+
discount: v33.object({
|
|
2574
|
+
amount: v33.optional(strictNumber, 30),
|
|
2575
|
+
shouldShowSavingText: v33.optional(v33.boolean(), true),
|
|
2576
|
+
type: v33.optional(v33.picklist(["none", "fixed_amount", "percentage"]), "none")
|
|
2293
2577
|
}),
|
|
2294
|
-
discountedFrom:
|
|
2295
|
-
endpoint:
|
|
2296
|
-
integrations:
|
|
2297
|
-
judgeme:
|
|
2298
|
-
junip:
|
|
2299
|
-
klaviyo:
|
|
2300
|
-
loox:
|
|
2301
|
-
okendo:
|
|
2302
|
-
opinew:
|
|
2303
|
-
reviewsio:
|
|
2304
|
-
stamped:
|
|
2305
|
-
yotpo:
|
|
2578
|
+
discountedFrom: v33.optional(v33.picklist(["price", "compare_at_price"]), "price"),
|
|
2579
|
+
endpoint: v33.optional(v33.string()),
|
|
2580
|
+
integrations: v33.object({
|
|
2581
|
+
judgeme: v33.optional(v33.boolean(), false),
|
|
2582
|
+
junip: v33.optional(v33.boolean(), false),
|
|
2583
|
+
klaviyo: v33.optional(v33.boolean(), false),
|
|
2584
|
+
loox: v33.optional(v33.boolean(), false),
|
|
2585
|
+
okendo: v33.optional(v33.boolean(), false),
|
|
2586
|
+
opinew: v33.optional(v33.boolean(), false),
|
|
2587
|
+
reviewsio: v33.optional(v33.boolean(), false),
|
|
2588
|
+
stamped: v33.optional(v33.boolean(), false),
|
|
2589
|
+
yotpo: v33.optional(v33.boolean(), false)
|
|
2306
2590
|
}),
|
|
2307
|
-
key:
|
|
2308
|
-
language:
|
|
2309
|
-
description:
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2591
|
+
key: v33.optional(v33.string()),
|
|
2592
|
+
language: v33.object({
|
|
2593
|
+
description: v33.optional(
|
|
2594
|
+
v33.union([
|
|
2595
|
+
v33.string(),
|
|
2596
|
+
v33.pipe(
|
|
2597
|
+
v33.unknown(),
|
|
2598
|
+
v33.transform(() => "")
|
|
2599
|
+
)
|
|
2600
|
+
]),
|
|
2601
|
+
""
|
|
2602
|
+
),
|
|
2603
|
+
descriptionEnabled: v33.optional(v33.boolean(), false),
|
|
2604
|
+
descriptionRte: v33.optional(
|
|
2605
|
+
v33.object({
|
|
2606
|
+
content: v33.array(v33.unknown()),
|
|
2607
|
+
type: v33.string()
|
|
2608
|
+
})
|
|
2609
|
+
),
|
|
2610
|
+
descriptionSpacing: v33.optional(v33.picklist(["none", "xtight", "tight", "default", "loose", "xloose"])),
|
|
2611
|
+
displayCtaPrice: v33.optional(v33.boolean(), true),
|
|
2612
|
+
global: v33.optional(
|
|
2613
|
+
v33.optional(
|
|
2614
|
+
v33.object({
|
|
2615
|
+
declineAll: v33.optional(v33.string(), "Decline All"),
|
|
2616
|
+
declineThisOffer: v33.optional(v33.string(), "Decline this offer"),
|
|
2617
|
+
free: v33.optional(v33.string(), "Free"),
|
|
2618
|
+
notAvailable: v33.optional(v33.string(), "Not available"),
|
|
2619
|
+
payNow: v33.optional(v33.string(), "Pay Now"),
|
|
2620
|
+
payNowUpgradeToSubscription: v33.optional(v33.string(), "Upgrade to Subscription"),
|
|
2621
|
+
quantity: v33.optional(v33.string(), "Quantity"),
|
|
2622
|
+
/** This isn't configurable in the admin-nextjs editor */
|
|
2623
|
+
recurringShipping: v33.optional(v33.string(), "Recurring shipping"),
|
|
2624
|
+
recurringSubtotal: v33.optional(v33.string(), "Recurring subtotal"),
|
|
2625
|
+
reviewsPlural: v33.optional(v33.string(), "Reviews"),
|
|
2626
|
+
reviewsSingular: v33.optional(v33.string(), "Review"),
|
|
2627
|
+
save: v33.optional(
|
|
2628
|
+
v33.union([
|
|
2629
|
+
v33.string(),
|
|
2630
|
+
v33.pipe(
|
|
2631
|
+
v33.unknown(),
|
|
2632
|
+
v33.transform(() => "Save")
|
|
2633
|
+
)
|
|
2634
|
+
]),
|
|
2635
|
+
"Save"
|
|
2636
|
+
),
|
|
2637
|
+
shipping: v33.optional(v33.string(), "Shipping"),
|
|
2638
|
+
subtotal: v33.optional(v33.string(), "Subtotal"),
|
|
2639
|
+
taxes: v33.optional(v33.string(), "Taxes"),
|
|
2640
|
+
total: v33.optional(v33.string(), "Total")
|
|
2641
|
+
})
|
|
2642
|
+
),
|
|
2643
|
+
() => ({
|
|
2644
|
+
declineAll: "Decline All",
|
|
2645
|
+
declineThisOffer: "Decline this offer",
|
|
2646
|
+
free: "Free",
|
|
2647
|
+
notAvailable: "Not available",
|
|
2648
|
+
payNow: "Pay Now",
|
|
2649
|
+
payNowUpgradeToSubscription: "Upgrade to Subscription",
|
|
2650
|
+
quantity: "Quantity",
|
|
2651
|
+
/** This isn't configurable in the admin-nextjs editor */
|
|
2652
|
+
recurringShipping: "Recurring shipping",
|
|
2653
|
+
recurringSubtotal: "Recurring subtotal",
|
|
2654
|
+
reviewsPlural: "Reviews",
|
|
2655
|
+
reviewsSingular: "Review",
|
|
2656
|
+
save: "Save",
|
|
2657
|
+
shipping: "Shipping",
|
|
2658
|
+
subtotal: "Subtotal",
|
|
2659
|
+
taxes: "Taxes",
|
|
2660
|
+
total: "Total"
|
|
2661
|
+
})
|
|
2662
|
+
),
|
|
2663
|
+
globalTranslation: v33.optional(v33.string(), "english")
|
|
2355
2664
|
}),
|
|
2356
|
-
metafields:
|
|
2665
|
+
metafields: v33.optional(v33.boolean(), false),
|
|
2357
2666
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2358
|
-
offer:
|
|
2359
|
-
count:
|
|
2360
|
-
}),
|
|
2361
|
-
offersLayout: import_v436.z.object({
|
|
2362
|
-
itemsPerPage: import_v436.z.number().optional(),
|
|
2363
|
-
type: import_v436.z.enum(["list", "grid", "carousel"]).default("list")
|
|
2364
|
-
}).optional().default({
|
|
2365
|
-
type: "list"
|
|
2667
|
+
offer: v33.object({
|
|
2668
|
+
count: v33.optional(v33.number(), 1)
|
|
2366
2669
|
}),
|
|
2670
|
+
offersLayout: v33.optional(
|
|
2671
|
+
v33.optional(
|
|
2672
|
+
v33.object({
|
|
2673
|
+
itemsPerPage: v33.optional(v33.number()),
|
|
2674
|
+
type: v33.optional(v33.picklist(["list", "grid", "carousel"]), "list")
|
|
2675
|
+
})
|
|
2676
|
+
),
|
|
2677
|
+
{
|
|
2678
|
+
type: "list"
|
|
2679
|
+
}
|
|
2680
|
+
),
|
|
2367
2681
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2368
|
-
previewMode:
|
|
2369
|
-
productLimit:
|
|
2370
|
-
productOptions:
|
|
2682
|
+
previewMode: v33.optional(v33.boolean(), false),
|
|
2683
|
+
productLimit: v33.optional(v33.number(), 1),
|
|
2684
|
+
productOptions: v33.object({
|
|
2371
2685
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2372
|
-
hideOutOfStockVariants:
|
|
2373
|
-
matchVariant:
|
|
2374
|
-
showDeclineAll:
|
|
2375
|
-
showShipping:
|
|
2376
|
-
showSubtotal:
|
|
2377
|
-
showTaxes:
|
|
2378
|
-
showTotal:
|
|
2379
|
-
showVariantSelectors:
|
|
2380
|
-
variantSelectorDisplayMode:
|
|
2686
|
+
hideOutOfStockVariants: v33.optional(v33.boolean(), false),
|
|
2687
|
+
matchVariant: v33.optional(v33.boolean(), true),
|
|
2688
|
+
showDeclineAll: v33.optional(v33.picklist(["above", "below", "both", "none"])),
|
|
2689
|
+
showShipping: v33.optional(v33.boolean(), true),
|
|
2690
|
+
showSubtotal: v33.optional(v33.boolean(), true),
|
|
2691
|
+
showTaxes: v33.optional(v33.boolean(), true),
|
|
2692
|
+
showTotal: v33.optional(v33.boolean(), true),
|
|
2693
|
+
showVariantSelectors: v33.optional(v33.boolean(), true),
|
|
2694
|
+
variantSelectorDisplayMode: v33.optional(v33.picklist(["separate", "single"]), "separate")
|
|
2381
2695
|
}),
|
|
2382
|
-
productType:
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2696
|
+
productType: v33.optional(
|
|
2697
|
+
v33.union([
|
|
2698
|
+
v33.picklist(["one-time", "subscription", "both"]),
|
|
2699
|
+
v33.pipe(
|
|
2700
|
+
v33.literal(""),
|
|
2701
|
+
v33.transform(() => "one-time")
|
|
2702
|
+
)
|
|
2703
|
+
]),
|
|
2704
|
+
"one-time"
|
|
2705
|
+
),
|
|
2706
|
+
productTypeSelector: v33.optional(v33.picklist(["dropdown", "radio"]), "radio"),
|
|
2707
|
+
quantityInputs: v33.object({
|
|
2708
|
+
defaultQuantity: v33.optional(
|
|
2709
|
+
v33.union([
|
|
2710
|
+
v33.number(),
|
|
2711
|
+
v33.pipe(
|
|
2712
|
+
v33.null_(),
|
|
2713
|
+
v33.transform(() => 1)
|
|
2714
|
+
)
|
|
2715
|
+
]),
|
|
2716
|
+
1
|
|
2717
|
+
),
|
|
2718
|
+
enabled: v33.optional(v33.boolean(), true),
|
|
2719
|
+
maxValue: v33.optional(
|
|
2720
|
+
v33.union([
|
|
2721
|
+
v33.number(),
|
|
2722
|
+
v33.pipe(
|
|
2723
|
+
v33.null_(),
|
|
2724
|
+
v33.transform(() => 15)
|
|
2725
|
+
)
|
|
2726
|
+
]),
|
|
2727
|
+
15
|
|
2728
|
+
),
|
|
2729
|
+
minValue: v33.optional(
|
|
2730
|
+
v33.union([
|
|
2731
|
+
v33.pipe(v33.number(), v33.minValue(0)),
|
|
2732
|
+
v33.pipe(
|
|
2733
|
+
v33.unknown(),
|
|
2734
|
+
v33.transform(() => 0)
|
|
2735
|
+
)
|
|
2736
|
+
]),
|
|
2737
|
+
1
|
|
2738
|
+
)
|
|
2389
2739
|
}),
|
|
2390
|
-
shipping:
|
|
2391
|
-
amount:
|
|
2740
|
+
shipping: v33.object({
|
|
2741
|
+
amount: v33.optional(strictNumber, 10),
|
|
2392
2742
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2393
|
-
enabled:
|
|
2394
|
-
title:
|
|
2395
|
-
type:
|
|
2743
|
+
enabled: v33.optional(v33.boolean(), true),
|
|
2744
|
+
title: v33.optional(v33.string(), "Shipping Fees"),
|
|
2745
|
+
type: v33.optional(v33.picklist(["free", "fixed_amount"]), "free")
|
|
2396
2746
|
}),
|
|
2397
|
-
styles:
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
/** This isn't configurable in the admin-nextjs editor */
|
|
2413
|
-
enabled: import_v436.z.boolean().default(true),
|
|
2414
|
-
/** This isn't configurable in the admin-nextjs editor */
|
|
2415
|
-
recurringAmount: strictNumber.default(2),
|
|
2416
|
-
shippingTitle: import_v436.z.string().default("Shipping Fees"),
|
|
2417
|
-
type: import_v436.z.enum(["free", "fixed_amount"]).default("free")
|
|
2747
|
+
styles: v33.optional(
|
|
2748
|
+
v33.object({
|
|
2749
|
+
starColor: v33.optional(v33.string(), "#fadb14"),
|
|
2750
|
+
starSize: v33.optional(
|
|
2751
|
+
v33.union([
|
|
2752
|
+
v33.picklist(["small", "medium", "large"]),
|
|
2753
|
+
v33.pipe(
|
|
2754
|
+
v33.unknown(),
|
|
2755
|
+
v33.transform(() => "large")
|
|
2756
|
+
)
|
|
2757
|
+
]),
|
|
2758
|
+
"large"
|
|
2759
|
+
),
|
|
2760
|
+
starStrokeColor: v33.optional(v33.string(), "#fadb14"),
|
|
2761
|
+
strokeWidth: v33.optional(v33.string(), "1")
|
|
2418
2762
|
})
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2763
|
+
),
|
|
2764
|
+
subImages: v33.optional(v33.nullable(v33.number()), 8),
|
|
2765
|
+
subscription: v33.optional(
|
|
2766
|
+
v33.optional(
|
|
2767
|
+
v33.object({
|
|
2768
|
+
discount: v33.object({
|
|
2769
|
+
amount: v33.optional(strictNumber, 30),
|
|
2770
|
+
shouldShowSavingText: v33.optional(v33.boolean(), true),
|
|
2771
|
+
type: v33.optional(v33.picklist(["none", "fixed_amount", "percentage"]), "none")
|
|
2772
|
+
}),
|
|
2773
|
+
shipping: v33.object({
|
|
2774
|
+
amount: v33.optional(strictNumber, 1),
|
|
2775
|
+
/** This isn't configurable in the admin-nextjs editor */
|
|
2776
|
+
enabled: v33.optional(v33.boolean(), true),
|
|
2777
|
+
/** This isn't configurable in the admin-nextjs editor */
|
|
2778
|
+
recurringAmount: v33.optional(strictNumber, 2),
|
|
2779
|
+
shippingTitle: v33.optional(v33.string(), "Shipping Fees"),
|
|
2780
|
+
type: v33.optional(v33.picklist(["free", "fixed_amount"]), "free")
|
|
2781
|
+
})
|
|
2782
|
+
})
|
|
2783
|
+
),
|
|
2784
|
+
{
|
|
2785
|
+
discount: {
|
|
2786
|
+
amount: 30,
|
|
2787
|
+
shouldShowSavingText: true,
|
|
2788
|
+
type: "none"
|
|
2789
|
+
},
|
|
2790
|
+
shipping: {
|
|
2791
|
+
amount: 1,
|
|
2792
|
+
/** This isn't configurable in the admin-nextjs editor */
|
|
2793
|
+
enabled: true,
|
|
2794
|
+
/** This isn't configurable in the admin-nextjs editor */
|
|
2795
|
+
recurringAmount: 2,
|
|
2796
|
+
shippingTitle: "Shipping Fees",
|
|
2797
|
+
type: "free"
|
|
2798
|
+
}
|
|
2433
2799
|
}
|
|
2434
|
-
|
|
2435
|
-
subscriptionIsDefault:
|
|
2800
|
+
),
|
|
2801
|
+
subscriptionIsDefault: v33.optional(v33.boolean()),
|
|
2436
2802
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2437
|
-
template:
|
|
2438
|
-
type:
|
|
2439
|
-
upgradeToSubscription:
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2803
|
+
template: v33.optional(v33.string(), ""),
|
|
2804
|
+
type: v33.optional(v33.literal("shopify_post_purchase_extension"), "shopify_post_purchase_extension"),
|
|
2805
|
+
upgradeToSubscription: v33.optional(
|
|
2806
|
+
v33.optional(
|
|
2807
|
+
v33.object({
|
|
2808
|
+
acceptButtonText: v33.optional(v33.string(), "Upgrade"),
|
|
2809
|
+
allow: v33.optional(v33.boolean(), false),
|
|
2810
|
+
emailRefundNotice: v33.optional(v33.boolean(), false),
|
|
2811
|
+
errorBannerText: v33.optional(v33.string(), "This subscription cannot be added - limit one per order")
|
|
2812
|
+
})
|
|
2813
|
+
),
|
|
2814
|
+
() => ({
|
|
2815
|
+
acceptButtonText: "Upgrade",
|
|
2816
|
+
allow: false,
|
|
2817
|
+
emailRefundNotice: false,
|
|
2818
|
+
errorBannerText: "This subscription cannot be added - limit one per order"
|
|
2819
|
+
})
|
|
2820
|
+
)
|
|
2450
2821
|
});
|
|
2451
2822
|
|
|
2452
2823
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
2453
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
2454
|
-
id:
|
|
2455
|
-
name:
|
|
2824
|
+
var PostPurchaseWidgetLinkedFlow = v34.object({
|
|
2825
|
+
id: v34.number(),
|
|
2826
|
+
name: v34.string()
|
|
2456
2827
|
});
|
|
2457
|
-
var PostPurchaseWidget =
|
|
2458
|
-
classification:
|
|
2459
|
-
createdAtTime:
|
|
2460
|
-
customEndpointName:
|
|
2461
|
-
id:
|
|
2462
|
-
lastViewed:
|
|
2463
|
-
linkedCustomEndpointId:
|
|
2464
|
-
linkedFlows:
|
|
2465
|
-
name:
|
|
2466
|
-
owner:
|
|
2828
|
+
var PostPurchaseWidget = v34.object({
|
|
2829
|
+
classification: v34.optional(v34.literal("post_purchase_offer_page"), "post_purchase_offer_page"),
|
|
2830
|
+
createdAtTime: v34.optional(v34.pipe(v34.string(), v34.isoTimestamp())),
|
|
2831
|
+
customEndpointName: v34.nullish(v34.string()),
|
|
2832
|
+
id: v34.optional(v34.number(), 0),
|
|
2833
|
+
lastViewed: v34.nullish(v34.pipe(v34.string(), v34.isoTimestamp())),
|
|
2834
|
+
linkedCustomEndpointId: v34.nullish(v34.number()),
|
|
2835
|
+
linkedFlows: v34.optional(v34.array(PostPurchaseWidgetLinkedFlow)),
|
|
2836
|
+
name: v34.optional(v34.string(), ""),
|
|
2837
|
+
owner: v34.nullish(v34.number()),
|
|
2467
2838
|
settings: PostPurchaseSettings
|
|
2468
2839
|
});
|
|
2469
2840
|
|
|
2470
2841
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
2471
|
-
var PostPurchaseOffer =
|
|
2472
|
-
|
|
2473
|
-
errors:
|
|
2474
|
-
message:
|
|
2475
|
-
successful:
|
|
2842
|
+
var PostPurchaseOffer = v35.variant("successful", [
|
|
2843
|
+
v35.strictObject({
|
|
2844
|
+
errors: v35.array(v35.object({ message: v35.string() })),
|
|
2845
|
+
message: v35.string(),
|
|
2846
|
+
successful: v35.literal(false)
|
|
2476
2847
|
}),
|
|
2477
|
-
|
|
2478
|
-
successful:
|
|
2848
|
+
v35.strictObject({
|
|
2849
|
+
successful: v35.literal(true),
|
|
2479
2850
|
widget: PostPurchaseWidget
|
|
2480
2851
|
})
|
|
2481
2852
|
]);
|