@cimplify/sdk 0.59.0 → 0.61.0
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/{chunk-TGAROSXB.mjs → chunk-2AU263DK.mjs} +13 -8
- package/dist/{chunk-3QPO2UK5.js → chunk-6DMHVQ42.js} +15 -10
- package/dist/chunk-DKT62WQW.js +53 -0
- package/dist/chunk-XSOYJLMZ.mjs +45 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +19 -20
- package/dist/index.mjs +6 -7
- package/dist/react.d.mts +21 -3
- package/dist/react.d.ts +21 -3
- package/dist/react.js +141 -59
- package/dist/react.mjs +95 -15
- package/dist/server.d.mts +4 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +7 -8
- package/dist/server.mjs +4 -5
- package/dist/{sign-in-CZ2ioBAP.d.mts → sign-in-dr7m09nm.d.mts} +4 -0
- package/dist/{sign-in-CZ2ioBAP.d.ts → sign-in-dr7m09nm.d.ts} +4 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/registry/default-product-layout.json +2 -1
- package/registry/digital-product-layout.json +2 -1
- package/registry/food-product-layout.json +2 -1
- package/registry/index.json +15 -0
- package/registry/product-sheet.json +2 -1
- package/registry/rich-text.json +15 -0
- package/registry/service-product-layout.json +2 -1
- package/registry/wholesale-product-layout.json +2 -1
- package/dist/chunk-LA2T2TPA.js +0 -25
- package/dist/chunk-ZKTXRWP6.mjs +0 -19
package/dist/react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var chunk6DMHVQ42_js = require('./chunk-6DMHVQ42.js');
|
|
5
|
+
require('./chunk-DKT62WQW.js');
|
|
6
6
|
var chunkMW7ICTVK_js = require('./chunk-MW7ICTVK.js');
|
|
7
7
|
var chunkJGBDWEPJ_js = require('./chunk-JGBDWEPJ.js');
|
|
8
8
|
var chunk7Y2O3E4D_js = require('./chunk-7Y2O3E4D.js');
|
|
@@ -21,6 +21,7 @@ var popover = require('@base-ui/react/popover');
|
|
|
21
21
|
var reactDayPicker = require('react-day-picker');
|
|
22
22
|
var dateFns = require('date-fns');
|
|
23
23
|
var tabs = require('@base-ui/react/tabs');
|
|
24
|
+
var xss = require('xss');
|
|
24
25
|
var dialog = require('@base-ui/react/dialog');
|
|
25
26
|
var field = require('@base-ui/react/field');
|
|
26
27
|
var input = require('@base-ui/react/input');
|
|
@@ -2715,7 +2716,7 @@ function CimplifySignInButton({
|
|
|
2715
2716
|
const onClick = async () => {
|
|
2716
2717
|
if (busy || disabled) return;
|
|
2717
2718
|
setBusy(true);
|
|
2718
|
-
await
|
|
2719
|
+
await chunk6DMHVQ42_js.startSignIn({
|
|
2719
2720
|
...signInOpts,
|
|
2720
2721
|
onSuccess: () => {
|
|
2721
2722
|
setBusy(false);
|
|
@@ -5464,7 +5465,7 @@ function VariantSelector({
|
|
|
5464
5465
|
{
|
|
5465
5466
|
"data-cimplify-variant-name": true,
|
|
5466
5467
|
className: cn("flex-1 min-w-0 text-sm", classNames?.name),
|
|
5467
|
-
children:
|
|
5468
|
+
children: chunk6DMHVQ42_js.getVariantDisplayName(variant, productName)
|
|
5468
5469
|
}
|
|
5469
5470
|
),
|
|
5470
5471
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-variant-pricing": true, className: cn("text-sm text-muted-foreground", classNames?.pricing), children: [
|
|
@@ -6937,12 +6938,12 @@ function FieldInput({
|
|
|
6937
6938
|
classNames?.input
|
|
6938
6939
|
);
|
|
6939
6940
|
switch (field.field_type) {
|
|
6940
|
-
case
|
|
6941
|
-
case
|
|
6941
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Text:
|
|
6942
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Url:
|
|
6942
6943
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6943
6944
|
"input",
|
|
6944
6945
|
{
|
|
6945
|
-
type: field.field_type ===
|
|
6946
|
+
type: field.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Url ? "url" : "text",
|
|
6946
6947
|
value: typeof value === "string" ? value : "",
|
|
6947
6948
|
onChange: (e) => onValueChange(e.target.value),
|
|
6948
6949
|
placeholder: field.placeholder,
|
|
@@ -6951,7 +6952,7 @@ function FieldInput({
|
|
|
6951
6952
|
className: inputClass
|
|
6952
6953
|
}
|
|
6953
6954
|
);
|
|
6954
|
-
case
|
|
6955
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Textarea:
|
|
6955
6956
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6956
6957
|
"textarea",
|
|
6957
6958
|
{
|
|
@@ -6964,7 +6965,7 @@ function FieldInput({
|
|
|
6964
6965
|
className: cn(inputClass, "resize-none", classNames?.textarea)
|
|
6965
6966
|
}
|
|
6966
6967
|
);
|
|
6967
|
-
case
|
|
6968
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Number:
|
|
6968
6969
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6969
6970
|
"input",
|
|
6970
6971
|
{
|
|
@@ -6978,7 +6979,7 @@ function FieldInput({
|
|
|
6978
6979
|
className: inputClass
|
|
6979
6980
|
}
|
|
6980
6981
|
);
|
|
6981
|
-
case
|
|
6982
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Select:
|
|
6982
6983
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6983
6984
|
"select",
|
|
6984
6985
|
{
|
|
@@ -6992,7 +6993,7 @@ function FieldInput({
|
|
|
6992
6993
|
]
|
|
6993
6994
|
}
|
|
6994
6995
|
);
|
|
6995
|
-
case
|
|
6996
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Radio:
|
|
6996
6997
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-2", classNames?.radioGroup), children: (field.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6997
6998
|
"label",
|
|
6998
6999
|
{
|
|
@@ -7017,7 +7018,7 @@ function FieldInput({
|
|
|
7017
7018
|
},
|
|
7018
7019
|
opt
|
|
7019
7020
|
)) });
|
|
7020
|
-
case
|
|
7021
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Checkbox:
|
|
7021
7022
|
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cn("flex items-center gap-2 text-sm cursor-pointer", classNames?.checkboxLabel), children: [
|
|
7022
7023
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7023
7024
|
"input",
|
|
@@ -7030,7 +7031,7 @@ function FieldInput({
|
|
|
7030
7031
|
),
|
|
7031
7032
|
field.placeholder || field.name
|
|
7032
7033
|
] });
|
|
7033
|
-
case
|
|
7034
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Color:
|
|
7034
7035
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7035
7036
|
"input",
|
|
7036
7037
|
{
|
|
@@ -7040,7 +7041,7 @@ function FieldInput({
|
|
|
7040
7041
|
className: cn("w-12 h-10 rounded-md border border-input cursor-pointer", classNames?.colorInput)
|
|
7041
7042
|
}
|
|
7042
7043
|
);
|
|
7043
|
-
case
|
|
7044
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Date:
|
|
7044
7045
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7045
7046
|
DatePicker,
|
|
7046
7047
|
{
|
|
@@ -7051,8 +7052,8 @@ function FieldInput({
|
|
|
7051
7052
|
"aria-label": field.name
|
|
7052
7053
|
}
|
|
7053
7054
|
);
|
|
7054
|
-
case
|
|
7055
|
-
case
|
|
7055
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.File:
|
|
7056
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image:
|
|
7056
7057
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7057
7058
|
FileUploadInput,
|
|
7058
7059
|
{
|
|
@@ -7063,7 +7064,7 @@ function FieldInput({
|
|
|
7063
7064
|
classNames
|
|
7064
7065
|
}
|
|
7065
7066
|
);
|
|
7066
|
-
case
|
|
7067
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Email:
|
|
7067
7068
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7068
7069
|
"input",
|
|
7069
7070
|
{
|
|
@@ -7075,7 +7076,7 @@ function FieldInput({
|
|
|
7075
7076
|
className: inputClass
|
|
7076
7077
|
}
|
|
7077
7078
|
);
|
|
7078
|
-
case
|
|
7079
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.DateTime: {
|
|
7079
7080
|
const stringValue = typeof value === "string" ? value : "";
|
|
7080
7081
|
const [datePart, timePartRaw] = stringValue.includes("T") ? stringValue.split("T", 2) : [stringValue, ""];
|
|
7081
7082
|
const timePart = (timePartRaw ?? "").slice(0, 5);
|
|
@@ -7114,7 +7115,7 @@ function FieldInput({
|
|
|
7114
7115
|
)
|
|
7115
7116
|
] });
|
|
7116
7117
|
}
|
|
7117
|
-
case
|
|
7118
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Time:
|
|
7118
7119
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7119
7120
|
TimePicker,
|
|
7120
7121
|
{
|
|
@@ -7125,7 +7126,7 @@ function FieldInput({
|
|
|
7125
7126
|
"aria-label": field.name
|
|
7126
7127
|
}
|
|
7127
7128
|
);
|
|
7128
|
-
case
|
|
7129
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.MultiSelect:
|
|
7129
7130
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7130
7131
|
MultiSelectInput,
|
|
7131
7132
|
{
|
|
@@ -7135,7 +7136,7 @@ function FieldInput({
|
|
|
7135
7136
|
classNames
|
|
7136
7137
|
}
|
|
7137
7138
|
);
|
|
7138
|
-
case
|
|
7139
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.DateRange:
|
|
7139
7140
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7140
7141
|
DateRangeInput,
|
|
7141
7142
|
{
|
|
@@ -7145,7 +7146,7 @@ function FieldInput({
|
|
|
7145
7146
|
classNames
|
|
7146
7147
|
}
|
|
7147
7148
|
);
|
|
7148
|
-
case
|
|
7149
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Address:
|
|
7149
7150
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7150
7151
|
AddressInput,
|
|
7151
7152
|
{
|
|
@@ -7156,7 +7157,7 @@ function FieldInput({
|
|
|
7156
7157
|
inputClass
|
|
7157
7158
|
}
|
|
7158
7159
|
);
|
|
7159
|
-
case
|
|
7160
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Location:
|
|
7160
7161
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7161
7162
|
LocationInput,
|
|
7162
7163
|
{
|
|
@@ -7167,7 +7168,7 @@ function FieldInput({
|
|
|
7167
7168
|
inputClass
|
|
7168
7169
|
}
|
|
7169
7170
|
);
|
|
7170
|
-
case
|
|
7171
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Phone:
|
|
7171
7172
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7172
7173
|
PhoneInput,
|
|
7173
7174
|
{
|
|
@@ -7178,7 +7179,7 @@ function FieldInput({
|
|
|
7178
7179
|
inputClass
|
|
7179
7180
|
}
|
|
7180
7181
|
);
|
|
7181
|
-
case
|
|
7182
|
+
case chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Signature:
|
|
7182
7183
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7183
7184
|
SignatureInput,
|
|
7184
7185
|
{
|
|
@@ -7211,7 +7212,7 @@ function FileUploadInput({
|
|
|
7211
7212
|
const [isUploading, setIsUploading] = React12__default.default.useState(false);
|
|
7212
7213
|
const fileUrl = typeof value === "string" ? value : void 0;
|
|
7213
7214
|
const acceptedFormats = field.validation?.accepted_formats;
|
|
7214
|
-
const accept = acceptedFormats ? acceptedFormats.map((f) => `.${f}`).join(",") : field.field_type ===
|
|
7215
|
+
const accept = acceptedFormats ? acceptedFormats.map((f) => `.${f}`).join(",") : field.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image ? "image/*" : void 0;
|
|
7215
7216
|
const handleFile = async (file) => {
|
|
7216
7217
|
if (!onFileUpload) return;
|
|
7217
7218
|
if (field.validation?.max_size_mb) {
|
|
@@ -7229,7 +7230,7 @@ function FileUploadInput({
|
|
|
7229
7230
|
}
|
|
7230
7231
|
};
|
|
7231
7232
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-2", classNames?.fileInput), children: fileUrl ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
7232
|
-
field.field_type ===
|
|
7233
|
+
field.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image && /* @__PURE__ */ jsxRuntime.jsx("img", { src: fileUrl, alt: "Uploaded", className: "w-16 h-16 object-cover rounded-md border border-border" }),
|
|
7233
7234
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground truncate", children: fileUrl.split("/").pop() }) }),
|
|
7234
7235
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7235
7236
|
"button",
|
|
@@ -7255,7 +7256,7 @@ function FileUploadInput({
|
|
|
7255
7256
|
}
|
|
7256
7257
|
),
|
|
7257
7258
|
isUploading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Uploading..." }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7258
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: field.placeholder || `Upload ${field.field_type ===
|
|
7259
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: field.placeholder || `Upload ${field.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image ? "image" : "file"}` }),
|
|
7259
7260
|
acceptedFormats && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground/60 mt-1", children: [
|
|
7260
7261
|
acceptedFormats.map((f) => f.toUpperCase()).join(", "),
|
|
7261
7262
|
field.validation?.max_size_mb && ` \xB7 Max ${field.validation.max_size_mb}MB`
|
|
@@ -8877,7 +8878,7 @@ function CartLineItemRow({
|
|
|
8877
8878
|
const isOptimistic = item.isOptimistic === true;
|
|
8878
8879
|
const lineTotal = chunk7Y2O3E4D_js.parsePrice(unitPrice) * item.quantity;
|
|
8879
8880
|
const imageUrl = item.product.image_url;
|
|
8880
|
-
const variantLabel = item.variant ?
|
|
8881
|
+
const variantLabel = item.variant ? chunk6DMHVQ42_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
8881
8882
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8882
8883
|
"div",
|
|
8883
8884
|
{
|
|
@@ -8977,7 +8978,7 @@ function CartLineItemRow({
|
|
|
8977
8978
|
input.field_name,
|
|
8978
8979
|
":"
|
|
8979
8980
|
] }),
|
|
8980
|
-
/* @__PURE__ */ jsxRuntime.jsx("dd", { "data-cimplify-cart-input-value": true, className: "text-foreground m-0 truncate", children: input.field_type ===
|
|
8981
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { "data-cimplify-cart-input-value": true, className: "text-foreground m-0 truncate", children: input.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.File || input.field_type === chunk6DMHVQ42_js.INPUT_FIELD_TYPE.Image ? String(input.value).split("/").pop() || "Uploaded file" : String(input.value) })
|
|
8981
8982
|
] }, input.field_id)) }),
|
|
8982
8983
|
(item.lineType === "service" || item.product.type === "service") && item.scheduledStart && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-info": true, className: cn("mt-1.5 flex items-center gap-1.5 text-xs text-muted-foreground", classNames?.serviceInfo), children: [
|
|
8983
8984
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }),
|
|
@@ -9239,6 +9240,85 @@ function SaleBadge({
|
|
|
9239
9240
|
}
|
|
9240
9241
|
);
|
|
9241
9242
|
}
|
|
9243
|
+
var RICH_TEXT_WHITELIST = {
|
|
9244
|
+
p: [],
|
|
9245
|
+
br: [],
|
|
9246
|
+
strong: [],
|
|
9247
|
+
b: [],
|
|
9248
|
+
em: [],
|
|
9249
|
+
i: [],
|
|
9250
|
+
u: [],
|
|
9251
|
+
s: [],
|
|
9252
|
+
strike: [],
|
|
9253
|
+
del: [],
|
|
9254
|
+
h1: [],
|
|
9255
|
+
h2: [],
|
|
9256
|
+
h3: [],
|
|
9257
|
+
h4: [],
|
|
9258
|
+
h5: [],
|
|
9259
|
+
h6: [],
|
|
9260
|
+
ul: [],
|
|
9261
|
+
ol: ["start", "type"],
|
|
9262
|
+
li: [],
|
|
9263
|
+
blockquote: [],
|
|
9264
|
+
code: [],
|
|
9265
|
+
pre: [],
|
|
9266
|
+
hr: [],
|
|
9267
|
+
span: [],
|
|
9268
|
+
a: ["href", "title", "target", "rel"],
|
|
9269
|
+
img: ["src", "alt", "title", "width", "height"]
|
|
9270
|
+
};
|
|
9271
|
+
var FILTER = new xss.FilterXSS({
|
|
9272
|
+
whiteList: RICH_TEXT_WHITELIST,
|
|
9273
|
+
// Drop unknown tags but keep their text content (e.g. a stray <font>Foo</font>
|
|
9274
|
+
// becomes "Foo" rather than vanishing).
|
|
9275
|
+
stripIgnoreTag: true,
|
|
9276
|
+
// Discard the *contents* of these entirely — script/style bodies are never text.
|
|
9277
|
+
stripIgnoreTagBody: ["script", "style"],
|
|
9278
|
+
allowCommentTag: false
|
|
9279
|
+
});
|
|
9280
|
+
function sanitizeRichTextHtml(html) {
|
|
9281
|
+
return FILTER.process(html);
|
|
9282
|
+
}
|
|
9283
|
+
var RICH_TEXT_PROSE = cn(
|
|
9284
|
+
"text-muted-foreground leading-relaxed",
|
|
9285
|
+
"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
9286
|
+
"[&_p]:my-3",
|
|
9287
|
+
"[&_h1]:mt-6 [&_h1]:mb-2 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:leading-snug [&_h1]:text-foreground",
|
|
9288
|
+
"[&_h2]:mt-5 [&_h2]:mb-2 [&_h2]:text-lg [&_h2]:font-semibold [&_h2]:leading-snug [&_h2]:text-foreground",
|
|
9289
|
+
"[&_h3]:mt-4 [&_h3]:mb-1.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-foreground",
|
|
9290
|
+
"[&_h4]:mt-4 [&_h4]:mb-1.5 [&_h4]:text-sm [&_h4]:font-semibold [&_h4]:text-foreground",
|
|
9291
|
+
"[&_h5]:mt-3 [&_h5]:mb-1 [&_h5]:font-semibold [&_h5]:text-foreground",
|
|
9292
|
+
"[&_h6]:mt-3 [&_h6]:mb-1 [&_h6]:font-semibold [&_h6]:text-foreground",
|
|
9293
|
+
"[&_strong]:font-semibold [&_strong]:text-foreground [&_b]:font-semibold [&_b]:text-foreground",
|
|
9294
|
+
"[&_em]:italic [&_i]:italic",
|
|
9295
|
+
"[&_u]:underline [&_s]:line-through [&_del]:line-through",
|
|
9296
|
+
"[&_a]:font-medium [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2",
|
|
9297
|
+
"[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5 [&_ul]:space-y-1",
|
|
9298
|
+
"[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:space-y-1",
|
|
9299
|
+
"[&_li]:pl-1 [&_li>p]:my-0 [&_ul_ul]:my-1 [&_ol_ol]:my-1 [&_ul_ul]:list-[circle]",
|
|
9300
|
+
"[&_blockquote]:my-3 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:italic",
|
|
9301
|
+
"[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em]",
|
|
9302
|
+
"[&_pre]:my-3 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre]:text-[0.85em]",
|
|
9303
|
+
"[&_pre>code]:bg-transparent [&_pre>code]:p-0",
|
|
9304
|
+
"[&_hr]:my-4 [&_hr]:border-border",
|
|
9305
|
+
"[&_img]:my-3 [&_img]:h-auto [&_img]:max-w-full [&_img]:rounded-md"
|
|
9306
|
+
);
|
|
9307
|
+
function RichText({ html, className, ...rest }) {
|
|
9308
|
+
const clean = React12.useMemo(() => html ? sanitizeRichTextHtml(html) : "", [html]);
|
|
9309
|
+
if (!clean) {
|
|
9310
|
+
return null;
|
|
9311
|
+
}
|
|
9312
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9313
|
+
"div",
|
|
9314
|
+
{
|
|
9315
|
+
"data-cimplify-rich-text": true,
|
|
9316
|
+
className: cn(RICH_TEXT_PROSE, className),
|
|
9317
|
+
dangerouslySetInnerHTML: { __html: clean },
|
|
9318
|
+
...rest
|
|
9319
|
+
}
|
|
9320
|
+
);
|
|
9321
|
+
}
|
|
9242
9322
|
function isProductWithDetails(product) {
|
|
9243
9323
|
return "variants" in product;
|
|
9244
9324
|
}
|
|
@@ -9374,12 +9454,12 @@ function ProductSheet({
|
|
|
9374
9454
|
}
|
|
9375
9455
|
)
|
|
9376
9456
|
] }),
|
|
9377
|
-
|
|
9378
|
-
|
|
9457
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9458
|
+
RichText,
|
|
9379
9459
|
{
|
|
9460
|
+
html: fullProduct.description,
|
|
9380
9461
|
"data-cimplify-product-sheet-description": true,
|
|
9381
|
-
className: cn("text-sm
|
|
9382
|
-
dangerouslySetInnerHTML: { __html: fullProduct.description }
|
|
9462
|
+
className: cn("text-sm", classNames?.description)
|
|
9383
9463
|
}
|
|
9384
9464
|
),
|
|
9385
9465
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9533,7 +9613,7 @@ function FoodProductCard({
|
|
|
9533
9613
|
const tags = product.tags || [];
|
|
9534
9614
|
const isSignature = product.metadata?.is_signature === true;
|
|
9535
9615
|
const isNew = product.metadata?.is_new === true;
|
|
9536
|
-
const isComposite = product.type ===
|
|
9616
|
+
const isComposite = product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Composite;
|
|
9537
9617
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
9538
9618
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
9539
9619
|
isSignature && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute top-3 left-3 inline-flex items-center gap-1 text-[11px] font-semibold tracking-wide bg-amber-50 text-amber-700 border border-amber-200/60 px-2 py-0.5 rounded-md", children: [
|
|
@@ -10286,26 +10366,26 @@ var BUILT_IN_CARDS = {
|
|
|
10286
10366
|
["composite" /* Composite */]: CompositeProductCard,
|
|
10287
10367
|
["subscription" /* Subscription */]: SubscriptionCard
|
|
10288
10368
|
};
|
|
10289
|
-
var RENTAL_UNITS = /* @__PURE__ */ new Set([
|
|
10290
|
-
var LEASE_UNITS = /* @__PURE__ */ new Set([
|
|
10369
|
+
var RENTAL_UNITS = /* @__PURE__ */ new Set([chunk6DMHVQ42_js.DURATION_UNIT.Days, chunk6DMHVQ42_js.DURATION_UNIT.Hours]);
|
|
10370
|
+
var LEASE_UNITS = /* @__PURE__ */ new Set([chunk6DMHVQ42_js.DURATION_UNIT.Weeks, chunk6DMHVQ42_js.DURATION_UNIT.Months, chunk6DMHVQ42_js.DURATION_UNIT.Years]);
|
|
10291
10371
|
function resolveCardVariant(product) {
|
|
10292
|
-
if (product.type ===
|
|
10372
|
+
if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Bundle) {
|
|
10293
10373
|
return "bundle" /* Bundle */;
|
|
10294
10374
|
}
|
|
10295
|
-
if (product.type ===
|
|
10375
|
+
if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Composite) {
|
|
10296
10376
|
return "composite" /* Composite */;
|
|
10297
10377
|
}
|
|
10298
10378
|
if (product.quantity_pricing && product.quantity_pricing.length > 1) {
|
|
10299
10379
|
return "wholesale" /* Wholesale */;
|
|
10300
10380
|
}
|
|
10301
|
-
if (product.type ===
|
|
10381
|
+
if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Digital) {
|
|
10302
10382
|
return "digital" /* Digital */;
|
|
10303
10383
|
}
|
|
10304
|
-
if (product.type ===
|
|
10384
|
+
if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Service) {
|
|
10305
10385
|
if (product.duration_unit && RENTAL_UNITS.has(product.duration_unit)) {
|
|
10306
10386
|
return "rental" /* Rental */;
|
|
10307
10387
|
}
|
|
10308
|
-
if (product.duration_unit ===
|
|
10388
|
+
if (product.duration_unit === chunk6DMHVQ42_js.DURATION_UNIT.Nights) {
|
|
10309
10389
|
return "accommodation" /* Accommodation */;
|
|
10310
10390
|
}
|
|
10311
10391
|
if (product.duration_unit && LEASE_UNITS.has(product.duration_unit)) {
|
|
@@ -10316,10 +10396,10 @@ function resolveCardVariant(product) {
|
|
|
10316
10396
|
}
|
|
10317
10397
|
return "standard" /* Standard */;
|
|
10318
10398
|
}
|
|
10319
|
-
if (product.render_hint ===
|
|
10399
|
+
if (product.render_hint === chunk6DMHVQ42_js.RENDER_HINT.Food) {
|
|
10320
10400
|
return "food" /* Food */;
|
|
10321
10401
|
}
|
|
10322
|
-
if (product.render_hint ===
|
|
10402
|
+
if (product.render_hint === chunk6DMHVQ42_js.RENDER_HINT.Physical) {
|
|
10323
10403
|
return "retail" /* Retail */;
|
|
10324
10404
|
}
|
|
10325
10405
|
return "retail" /* Retail */;
|
|
@@ -12625,7 +12705,7 @@ function DefaultProductLayout({
|
|
|
12625
12705
|
className
|
|
12626
12706
|
}) {
|
|
12627
12707
|
const [selectedVariantId, setSelectedVariantId] = React12__default.default.useState();
|
|
12628
|
-
const images =
|
|
12708
|
+
const images = chunk6DMHVQ42_js.resolveGallery(product, selectedVariantId);
|
|
12629
12709
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
12630
12710
|
const onSale = chunk7Y2O3E4D_js.isOnSale(product);
|
|
12631
12711
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
@@ -12657,7 +12737,7 @@ function DefaultProductLayout({
|
|
|
12657
12737
|
] })
|
|
12658
12738
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-semibold" }) }),
|
|
12659
12739
|
/* @__PURE__ */ jsxRuntime.jsx(InventoryBadge, { product }),
|
|
12660
|
-
|
|
12740
|
+
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
12661
12741
|
hasPhysicalDetails && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout-details": true, className: "space-y-1 text-sm text-muted-foreground", children: [
|
|
12662
12742
|
product.sku && /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
12663
12743
|
"SKU: ",
|
|
@@ -12754,7 +12834,7 @@ function FoodProductLayout({
|
|
|
12754
12834
|
" calories"
|
|
12755
12835
|
] })
|
|
12756
12836
|
] }),
|
|
12757
|
-
|
|
12837
|
+
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
12758
12838
|
(ingredients.length > 0 || pairings.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid sm:grid-cols-2 gap-4", children: [
|
|
12759
12839
|
/* @__PURE__ */ jsxRuntime.jsx(MetadataStringList, { items: ingredients, label: "Key Ingredients" }),
|
|
12760
12840
|
/* @__PURE__ */ jsxRuntime.jsx(MetadataStringList, { items: pairings, label: "Pairings" })
|
|
@@ -12819,7 +12899,7 @@ function WholesaleProductLayout({
|
|
|
12819
12899
|
" units"
|
|
12820
12900
|
] })
|
|
12821
12901
|
] }),
|
|
12822
|
-
|
|
12902
|
+
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
12823
12903
|
hasTiers && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12824
12904
|
VolumePricing,
|
|
12825
12905
|
{
|
|
@@ -12908,7 +12988,7 @@ function ServiceProductLayout({
|
|
|
12908
12988
|
" min buffer"
|
|
12909
12989
|
] })
|
|
12910
12990
|
] }),
|
|
12911
|
-
|
|
12991
|
+
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
12912
12992
|
(product.requires_specific_staff || product.requires_specific_resource) && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout-requirements": true, className: "text-sm text-muted-foreground space-y-1", children: [
|
|
12913
12993
|
product.requires_specific_staff && /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Staff selection required" }),
|
|
12914
12994
|
product.requires_specific_resource && /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Resource selection required" })
|
|
@@ -12997,7 +13077,7 @@ function DigitalProductLayout({
|
|
|
12997
13077
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-extrabold tracking-tight", children: product.name }),
|
|
12998
13078
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-bold mt-2 block" })
|
|
12999
13079
|
] }),
|
|
13000
|
-
|
|
13080
|
+
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
13001
13081
|
isDownload && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout-delivery": true, className: "flex items-center gap-3 px-4 py-3 bg-muted rounded-lg", children: [
|
|
13002
13082
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-5 h-5 text-primary shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }),
|
|
13003
13083
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -13136,7 +13216,7 @@ function BundleProductLayout({
|
|
|
13136
13216
|
onSale && baseTotal > 0 && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: baseTotal, className: "text-lg text-muted-foreground line-through" })
|
|
13137
13217
|
] })
|
|
13138
13218
|
] }),
|
|
13139
|
-
|
|
13219
|
+
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
13140
13220
|
components.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bundle-components": true, className: "space-y-3", children: [
|
|
13141
13221
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-semibold", children: "Included in this bundle" }),
|
|
13142
13222
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-border border border-border rounded-lg overflow-hidden", children: components.map((component) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 p-3", children: [
|
|
@@ -13211,7 +13291,7 @@ function CompositeProductLayout({
|
|
|
13211
13291
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "font-semibold text-foreground" })
|
|
13212
13292
|
] })
|
|
13213
13293
|
] }),
|
|
13214
|
-
|
|
13294
|
+
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
13215
13295
|
groups.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-composite-overview": true, className: "flex flex-wrap gap-2", children: groups.map((group) => {
|
|
13216
13296
|
const availableCount = group.components.filter((c) => c.is_available && !c.is_archived).length;
|
|
13217
13297
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-2 bg-muted rounded-lg text-sm", children: [
|
|
@@ -13261,25 +13341,25 @@ function resolveTemplateKey(product) {
|
|
|
13261
13341
|
if (typeof metaTemplate === "string" && metaTemplate.trim()) {
|
|
13262
13342
|
return metaTemplate.trim();
|
|
13263
13343
|
}
|
|
13264
|
-
if (product.type ===
|
|
13344
|
+
if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Bundle) {
|
|
13265
13345
|
return "bundle" /* Bundle */;
|
|
13266
13346
|
}
|
|
13267
|
-
if (product.type ===
|
|
13347
|
+
if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Composite) {
|
|
13268
13348
|
return "composite" /* Composite */;
|
|
13269
13349
|
}
|
|
13270
13350
|
if (product.quantity_pricing && product.quantity_pricing.length > 1) {
|
|
13271
13351
|
return "wholesale" /* Wholesale */;
|
|
13272
13352
|
}
|
|
13273
|
-
if (product.type ===
|
|
13353
|
+
if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Service) {
|
|
13274
13354
|
return "service" /* Service */;
|
|
13275
13355
|
}
|
|
13276
|
-
if (product.type ===
|
|
13356
|
+
if (product.type === chunk6DMHVQ42_js.PRODUCT_TYPE.Digital) {
|
|
13277
13357
|
return "digital" /* Digital */;
|
|
13278
13358
|
}
|
|
13279
|
-
if (product.render_hint ===
|
|
13359
|
+
if (product.render_hint === chunk6DMHVQ42_js.RENDER_HINT.Food) {
|
|
13280
13360
|
return "food" /* Food */;
|
|
13281
13361
|
}
|
|
13282
|
-
if (product.render_hint ===
|
|
13362
|
+
if (product.render_hint === chunk6DMHVQ42_js.RENDER_HINT.Physical) {
|
|
13283
13363
|
return "physical" /* Physical */;
|
|
13284
13364
|
}
|
|
13285
13365
|
return "default" /* Default */;
|
|
@@ -15505,7 +15585,7 @@ function SparkleIcon({ className }) {
|
|
|
15505
15585
|
|
|
15506
15586
|
Object.defineProperty(exports, "getVariantDisplayName", {
|
|
15507
15587
|
enumerable: true,
|
|
15508
|
-
get: function () { return
|
|
15588
|
+
get: function () { return chunk6DMHVQ42_js.getVariantDisplayName; }
|
|
15509
15589
|
});
|
|
15510
15590
|
exports.AccommodationCard = AccommodationCard;
|
|
15511
15591
|
exports.AccountContent = AccountContent;
|
|
@@ -15642,6 +15722,7 @@ exports.RelatedProductsSection = RelatedProductsSection;
|
|
|
15642
15722
|
exports.RentalServiceCard = RentalServiceCard;
|
|
15643
15723
|
exports.ResourcePicker = ResourcePicker;
|
|
15644
15724
|
exports.RetailProductCard = RetailProductCard;
|
|
15725
|
+
exports.RichText = RichText;
|
|
15645
15726
|
exports.SaleBadge = SaleBadge;
|
|
15646
15727
|
exports.ScheduleServiceCard = ScheduleServiceCard;
|
|
15647
15728
|
exports.SearchInput = SearchInput;
|
|
@@ -15677,6 +15758,7 @@ exports.WholesaleProductLayout = WholesaleProductLayout;
|
|
|
15677
15758
|
exports.WishlistButton = WishlistButton;
|
|
15678
15759
|
exports.cn = cn;
|
|
15679
15760
|
exports.roomToResource = roomToResource;
|
|
15761
|
+
exports.sanitizeRichTextHtml = sanitizeRichTextHtml;
|
|
15680
15762
|
exports.useActivityState = useActivityState;
|
|
15681
15763
|
exports.useAds = useAds;
|
|
15682
15764
|
exports.useAttributeDefinitions = useAttributeDefinitions;
|