@spiffcommerce/theme-bridge 1.20.0 → 1.21.1
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.d.ts +11 -10
- package/dist/index.js +119 -118
- package/dist/index.umd.cjs +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,8 @@ declare enum FieldType {
|
|
|
53
53
|
Number = "Number",
|
|
54
54
|
Object = "Object",
|
|
55
55
|
Select = "Select",
|
|
56
|
-
Text = "Text"
|
|
56
|
+
Text = "Text",
|
|
57
|
+
DateRange = "DateRange"
|
|
57
58
|
}
|
|
58
59
|
interface ThemeConfigurationSchema {
|
|
59
60
|
/**
|
|
@@ -98,7 +99,7 @@ interface DefaultValueOption {
|
|
|
98
99
|
defaultValue?: string;
|
|
99
100
|
}
|
|
100
101
|
interface GenericFieldBase extends ConfigurableField {
|
|
101
|
-
type: FieldType.Boolean | FieldType.Color | FieldType.Number;
|
|
102
|
+
type: FieldType.Boolean | FieldType.Color | FieldType.Number | FieldType.DateRange;
|
|
102
103
|
}
|
|
103
104
|
type GenericField = GenericFieldBase & (RequiredOption | DefaultValueOption);
|
|
104
105
|
interface AssetField extends ConfigurableField, RequiredOption {
|
|
@@ -513,29 +514,29 @@ type ThemeVersionGraphQl = Omit<ThemeVersionResource, "configurationSchema"> & {
|
|
|
513
514
|
};
|
|
514
515
|
type ThemeConfigurationSchemaGraphQl = Omit<ThemeConfigurationSchemaResource, "fields" | "customSchemas"> & {
|
|
515
516
|
fields: ThemeConfigurationSchemaFieldGraphQl[];
|
|
516
|
-
customSchemas?: ThemeConfigurationSchemaCustomSchemaGraphQl[];
|
|
517
|
+
customSchemas?: ThemeConfigurationSchemaCustomSchemaGraphQl[] | null;
|
|
517
518
|
};
|
|
518
519
|
type ThemeConfigurationSchemaCustomSchemaGraphQl = Omit<ThemeConfigurationSchemaCustomSchemaResource, "fields"> & {
|
|
519
|
-
fields?: number[];
|
|
520
|
+
fields?: number[] | null;
|
|
520
521
|
};
|
|
521
522
|
type ThemeConfigurationSchemaFieldGraphQl = Omit<ThemeConfigurationSchemaFieldResource, "items" | "fields"> & {
|
|
522
523
|
/** When this field is type `List`, this is the index of the schema for the entries. */
|
|
523
|
-
items?: number;
|
|
524
|
+
items?: number | null;
|
|
524
525
|
/** When this field is type `Object`, this array contains the indices of the schemas for the sub-fields. */
|
|
525
|
-
fields?: number[];
|
|
526
|
+
fields?: number[] | null;
|
|
526
527
|
/** Whether this field is on the root. Otherwise this is a child. */
|
|
527
|
-
root?: boolean;
|
|
528
|
+
root?: boolean | null;
|
|
528
529
|
};
|
|
529
530
|
type ThemeInstallConfigurationGraphQl = Omit<ThemeInstallConfigurationResource, "fields"> & {
|
|
530
531
|
fields: ThemeInstallConfigurationFieldGraphQl[];
|
|
531
532
|
};
|
|
532
533
|
type ThemeInstallConfigurationFieldGraphQl = Omit<ThemeInstallConfigurationFieldResource, "listValues" | "objectValues"> & {
|
|
533
534
|
/** When the type is `List`, this will be the indices of the configured values */
|
|
534
|
-
listValues?: number[];
|
|
535
|
+
listValues?: number[] | null;
|
|
535
536
|
/** When the type is `Object`, this will be the indices of the configured field values */
|
|
536
|
-
objectValues?: number[];
|
|
537
|
+
objectValues?: number[] | null;
|
|
537
538
|
/** Whether this field is on the root. Otherwise this is a child. */
|
|
538
|
-
root?: boolean;
|
|
539
|
+
root?: boolean | null;
|
|
539
540
|
};
|
|
540
541
|
declare function themeVersionConfigurationGraphQlToResource(gql: ThemeConfigurationSchemaGraphQl): ThemeConfigurationSchemaResource;
|
|
541
542
|
declare function themeVersionGraphQlToResource(gql: ThemeVersionGraphQl): ThemeVersionResource;
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ var Ne = Object.defineProperty;
|
|
|
3
3
|
var $e = (e, t, n) => t in e ? Ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
4
|
var B = (e, t, n) => ($e(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
5
5
|
import je from "fs";
|
|
6
|
-
import
|
|
7
|
-
var Q = /* @__PURE__ */ ((e) => (e.Javascript = "Javascript", e.CSS = "CSS", e))(Q || {}), x = /* @__PURE__ */ ((e) => (e.Asset = "Asset", e.Boolean = "Boolean", e.Color = "Color", e.ConversionConfiguration = "ConversionConfiguration", e.Heading = "Heading", e.List = "List", e.Number = "Number", e.Object = "Object", e.Select = "Select", e.Text = "Text", e))(x || {}),
|
|
6
|
+
import Ve from "path";
|
|
7
|
+
var Q = /* @__PURE__ */ ((e) => (e.Javascript = "Javascript", e.CSS = "CSS", e))(Q || {}), x = /* @__PURE__ */ ((e) => (e.Asset = "Asset", e.Boolean = "Boolean", e.Color = "Color", e.ConversionConfiguration = "ConversionConfiguration", e.Heading = "Heading", e.List = "List", e.Number = "Number", e.Object = "Object", e.Select = "Select", e.Text = "Text", e.DateRange = "DateRange", e))(x || {}), He = /* @__PURE__ */ ((e) => (e.Color = "Color", e.ColorProfile = "ColorProfile", e.Data = "Data", e.Environment = "Environment", e.Font = "Font", e.Frame = "Frame", e.Illustration = "Illustration", e.Image = "Image", e.Material = "Material", e.Model = "Model", e.Video = "Video", e))(He || {}), Oe = /* @__PURE__ */ ((e) => (e.Object = "Object", e.Union = "Union", e))(Oe || {}), De = /* @__PURE__ */ ((e) => (e.Manual = "Manual", e.OnStart = "OnStart", e.OnQuit = "OnQuit", e.OnEnd = "OnEnd", e))(De || {}), Ie = /* @__PURE__ */ ((e) => (e.Email = "Email", e.FirstName = "FirstName", e.LastName = "LastName", e.Phone = "Phone", e.Apartment = "Apartment", e.City = "City", e.Country = "Country", e.OrganizationName = "OrganizationName", e.PostCode = "PostCode", e.State = "State", e.StreetAddress = "StreetAddress", e.DesignName = "DesignName", e.PurchaseOrder = "PurchaseOrder", e.DispatchDate = "DispatchDate", e.Stakeholders = "Stakeholders", e))(Ie || {});
|
|
8
8
|
function X(e) {
|
|
9
9
|
return Object.assign({}, ...e.map((t) => {
|
|
10
10
|
if (t.key)
|
|
@@ -39,10 +39,10 @@ function he(e) {
|
|
|
39
39
|
schema: e.schema ?? void 0
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function gt(e) {
|
|
43
43
|
return X(e);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function yt(e) {
|
|
46
46
|
return X(e.fields);
|
|
47
47
|
}
|
|
48
48
|
function L(e, t) {
|
|
@@ -51,7 +51,7 @@ function L(e, t) {
|
|
|
51
51
|
items: void 0,
|
|
52
52
|
fields: void 0
|
|
53
53
|
};
|
|
54
|
-
return e.items !== void 0 && (n.items = L(t[e.items], t)), e.fields !== void 0 && (n.fields = e.fields.map((_) => L(t[_], t))), n;
|
|
54
|
+
return e.items !== void 0 && e.items !== null && (n.items = L(t[e.items], t)), e.fields !== void 0 && e.fields !== null && (n.fields = e.fields.map((_) => L(t[_], t))), n;
|
|
55
55
|
}
|
|
56
56
|
function Fe(e) {
|
|
57
57
|
var _;
|
|
@@ -72,7 +72,7 @@ function Fe(e) {
|
|
|
72
72
|
throw new Error("Failed to map ThemeVersionConfiguration GraphQL type to Resource type. Please ensure you've selected the `root` field on ThemeConfigurationSchemaField");
|
|
73
73
|
return t.fields = n, t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function bt(e) {
|
|
76
76
|
return {
|
|
77
77
|
...e,
|
|
78
78
|
configurationSchema: Fe(e.configurationSchema)
|
|
@@ -84,9 +84,9 @@ function z(e, t) {
|
|
|
84
84
|
listValues: void 0,
|
|
85
85
|
objectValues: void 0
|
|
86
86
|
};
|
|
87
|
-
return e.listValues !== void 0 && (n.listValues = e.listValues.map((_) => z(t[_], t))), e.objectValues !== void 0 && (n.objectValues = e.objectValues.map((_) => z(t[_], t))), n;
|
|
87
|
+
return e.listValues !== void 0 && e.listValues !== null && (n.listValues = e.listValues.map((_) => z(t[_], t))), e.objectValues !== void 0 && e.objectValues !== null && (n.objectValues = e.objectValues.map((_) => z(t[_], t))), n;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function kt(e) {
|
|
90
90
|
const t = {
|
|
91
91
|
...e,
|
|
92
92
|
fields: []
|
|
@@ -97,7 +97,7 @@ function bt(e) {
|
|
|
97
97
|
throw new Error("Failed to map ThemeInstallConfiguration GraphQL type to Resource type. Please ensure you've selected the `root` field on ThemeInstallConfigurationField");
|
|
98
98
|
return t.fields = n, t;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var R, f, me, E, _e, ve, Z, N = {}, ge = [], Le = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, q = Array.isArray;
|
|
101
101
|
function S(e, t) {
|
|
102
102
|
for (var n in t)
|
|
103
103
|
e[n] = t[n];
|
|
@@ -107,11 +107,11 @@ function ye(e) {
|
|
|
107
107
|
var t = e.parentNode;
|
|
108
108
|
t && t.removeChild(e);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Me(e, t, n) {
|
|
111
111
|
var _, o, i, l = {};
|
|
112
112
|
for (i in t)
|
|
113
113
|
i == "key" ? _ = t[i] : i == "ref" ? o = t[i] : l[i] = t[i];
|
|
114
|
-
if (arguments.length > 2 && (l.children = arguments.length > 3 ?
|
|
114
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? R.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null)
|
|
115
115
|
for (i in e.defaultProps)
|
|
116
116
|
l[i] === void 0 && (l[i] = e.defaultProps[i]);
|
|
117
117
|
return O(e, l, _, o, null);
|
|
@@ -120,10 +120,10 @@ function O(e, t, n, _, o) {
|
|
|
120
120
|
var i = { type: e, props: t, key: n, ref: _, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: o ?? ++me, __i: -1, __u: 0 };
|
|
121
121
|
return o == null && f.vnode != null && f.vnode(i), i;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function T(e) {
|
|
124
124
|
return e.children;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function D(e, t) {
|
|
127
127
|
this.props = e, this.context = t;
|
|
128
128
|
}
|
|
129
129
|
function w(e, t) {
|
|
@@ -146,24 +146,24 @@ function be(e) {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
function oe(e) {
|
|
149
|
-
(!e.__d && (e.__d = !0) && E.push(e) && !
|
|
149
|
+
(!e.__d && (e.__d = !0) && E.push(e) && !M.__r++ || _e !== f.debounceRendering) && ((_e = f.debounceRendering) || ve)(M);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
var e, t, n, _, o, i, l, u,
|
|
151
|
+
function M() {
|
|
152
|
+
var e, t, n, _, o, i, l, u, a;
|
|
153
153
|
for (E.sort(Z); e = E.shift(); )
|
|
154
|
-
e.__d && (t = E.length, _ = void 0, i = (o = (n = e).__v).__e, u = [],
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
function ke(e, t, n, _, o, i, l, u,
|
|
158
|
-
var r, d,
|
|
159
|
-
for (n.__d =
|
|
160
|
-
(
|
|
161
|
-
n.__d =
|
|
162
|
-
}
|
|
163
|
-
function
|
|
164
|
-
var _, o, i, l, u,
|
|
165
|
-
for (e.__k = [], _ = 0; _ <
|
|
166
|
-
(o = e.__k[_] = (o = t[_]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? O(null, o, null, null, o) : q(o) ? O(
|
|
154
|
+
e.__d && (t = E.length, _ = void 0, i = (o = (n = e).__v).__e, u = [], a = [], (l = n.__P) && ((_ = S({}, o)).__v = o.__v + 1, f.vnode && f.vnode(_), ee(l, _, o, n.__n, l.ownerSVGElement !== void 0, 32 & o.__u ? [i] : null, u, i ?? w(o), !!(32 & o.__u), a), _.__.__k[_.__i] = _, Se(u, _, a), _.__e != i && be(_)), E.length > t && E.sort(Z));
|
|
155
|
+
M.__r = 0;
|
|
156
|
+
}
|
|
157
|
+
function ke(e, t, n, _, o, i, l, u, a, s, p) {
|
|
158
|
+
var r, d, c, v, k, g = _ && _.__k || ge, h = t.length;
|
|
159
|
+
for (n.__d = a, Ae(n, t, g), a = n.__d, r = 0; r < h; r++)
|
|
160
|
+
(c = n.__k[r]) != null && typeof c != "boolean" && typeof c != "function" && (d = c.__i === -1 ? N : g[c.__i] || N, c.__i = r, ee(e, c, d, o, i, l, u, a, s, p), v = c.__e, c.ref && d.ref != c.ref && (d.ref && te(d.ref, null, c), p.push(c.ref, c.__c || v, c)), k == null && v != null && (k = v), 65536 & c.__u || d.__k === c.__k ? a = Ce(c, a, e) : typeof c.type == "function" && c.__d !== void 0 ? a = c.__d : v && (a = v.nextSibling), c.__d = void 0, c.__u &= -196609);
|
|
161
|
+
n.__d = a, n.__e = k;
|
|
162
|
+
}
|
|
163
|
+
function Ae(e, t, n) {
|
|
164
|
+
var _, o, i, l, u, a = t.length, s = n.length, p = s, r = 0;
|
|
165
|
+
for (e.__k = [], _ = 0; _ < a; _++)
|
|
166
|
+
(o = e.__k[_] = (o = t[_]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? O(null, o, null, null, o) : q(o) ? O(T, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? O(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o) != null ? (o.__ = e, o.__b = e.__b + 1, u = Ue(o, n, l = _ + r, p), o.__i = u, i = null, u !== -1 && (p--, (i = n[u]) && (i.__u |= 131072)), i == null || i.__v === null ? (u == -1 && r--, typeof o.type != "function" && (o.__u |= 65536)) : u !== l && (u === l + 1 ? r++ : u > l ? p > a - l ? r += u - l : r-- : r = u < l && u == l - 1 ? u - l : 0, u !== _ + r && (o.__u |= 65536))) : (i = n[_]) && i.key == null && i.__e && (i.__e == e.__d && (e.__d = w(i)), J(i, i, !1), n[_] = null, p--);
|
|
167
167
|
if (p)
|
|
168
168
|
for (_ = 0; _ < s; _++)
|
|
169
169
|
(i = n[_]) != null && !(131072 & i.__u) && (i.__e == e.__d && (e.__d = w(i)), J(i, i));
|
|
@@ -177,19 +177,19 @@ function Ce(e, t, n) {
|
|
|
177
177
|
}
|
|
178
178
|
return e.__e != t && (n.insertBefore(e.__e, t || null), t = e.__e), t && t.nextSibling;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
var o = e.key, i = e.type, l = n - 1, u = n + 1,
|
|
182
|
-
if (
|
|
180
|
+
function Ue(e, t, n, _) {
|
|
181
|
+
var o = e.key, i = e.type, l = n - 1, u = n + 1, a = t[n];
|
|
182
|
+
if (a === null || a && o == a.key && i === a.type)
|
|
183
183
|
return n;
|
|
184
|
-
if (_ > (
|
|
184
|
+
if (_ > (a != null && !(131072 & a.__u) ? 1 : 0))
|
|
185
185
|
for (; l >= 0 || u < t.length; ) {
|
|
186
186
|
if (l >= 0) {
|
|
187
|
-
if ((
|
|
187
|
+
if ((a = t[l]) && !(131072 & a.__u) && o == a.key && i === a.type)
|
|
188
188
|
return l;
|
|
189
189
|
l--;
|
|
190
190
|
}
|
|
191
191
|
if (u < t.length) {
|
|
192
|
-
if ((
|
|
192
|
+
if ((a = t[u]) && !(131072 & a.__u) && o == a.key && i === a.type)
|
|
193
193
|
return u;
|
|
194
194
|
u++;
|
|
195
195
|
}
|
|
@@ -199,7 +199,7 @@ function Me(e, t, n, _) {
|
|
|
199
199
|
function re(e, t, n) {
|
|
200
200
|
t[0] === "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Le.test(t) ? n : n + "px";
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function H(e, t, n, _, o) {
|
|
203
203
|
var i;
|
|
204
204
|
e:
|
|
205
205
|
if (t === "style")
|
|
@@ -239,27 +239,27 @@ function ie(e) {
|
|
|
239
239
|
function se(e) {
|
|
240
240
|
return this.l[e.type + !0](f.event ? f.event(e) : e);
|
|
241
241
|
}
|
|
242
|
-
function ee(e, t, n, _, o, i, l, u,
|
|
243
|
-
var p, r, d,
|
|
242
|
+
function ee(e, t, n, _, o, i, l, u, a, s) {
|
|
243
|
+
var p, r, d, c, v, k, g, h, y, C, $, P, ne, j, W, b = t.type;
|
|
244
244
|
if (t.constructor !== void 0)
|
|
245
245
|
return null;
|
|
246
|
-
128 & n.__u && (
|
|
246
|
+
128 & n.__u && (a = !!(32 & n.__u), i = [u = t.__e = n.__e]), (p = f.__b) && p(t);
|
|
247
247
|
e:
|
|
248
248
|
if (typeof b == "function")
|
|
249
249
|
try {
|
|
250
|
-
if (h = t.props, y = (p = b.contextType) && _[p.__c], C = p ? y ? y.props.value : p.__ : _, n.__c ? g = (r = t.__c = n.__c).__ = r.__E : ("prototype" in b && b.prototype.render ? t.__c = r = new b(h, C) : (t.__c = r = new
|
|
250
|
+
if (h = t.props, y = (p = b.contextType) && _[p.__c], C = p ? y ? y.props.value : p.__ : _, n.__c ? g = (r = t.__c = n.__c).__ = r.__E : ("prototype" in b && b.prototype.render ? t.__c = r = new b(h, C) : (t.__c = r = new D(h, C), r.constructor = b, r.render = Te), y && y.sub(r), r.props = h, r.state || (r.state = {}), r.context = C, r.__n = _, d = r.__d = !0, r.__h = [], r._sb = []), r.__s == null && (r.__s = r.state), b.getDerivedStateFromProps != null && (r.__s == r.state && (r.__s = S({}, r.__s)), S(r.__s, b.getDerivedStateFromProps(h, r.__s))), c = r.props, v = r.state, r.__v = t, d)
|
|
251
251
|
b.getDerivedStateFromProps == null && r.componentWillMount != null && r.componentWillMount(), r.componentDidMount != null && r.__h.push(r.componentDidMount);
|
|
252
252
|
else {
|
|
253
|
-
if (b.getDerivedStateFromProps == null && h !==
|
|
254
|
-
for (t.__v !== n.__v && (r.props = h, r.state = r.__s, r.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(
|
|
255
|
-
|
|
253
|
+
if (b.getDerivedStateFromProps == null && h !== c && r.componentWillReceiveProps != null && r.componentWillReceiveProps(h, C), !r.__e && (r.shouldComponentUpdate != null && r.shouldComponentUpdate(h, r.__s, C) === !1 || t.__v === n.__v)) {
|
|
254
|
+
for (t.__v !== n.__v && (r.props = h, r.state = r.__s, r.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(V) {
|
|
255
|
+
V && (V.__ = t);
|
|
256
256
|
}), $ = 0; $ < r._sb.length; $++)
|
|
257
257
|
r.__h.push(r._sb[$]);
|
|
258
258
|
r._sb = [], r.__h.length && l.push(r);
|
|
259
259
|
break e;
|
|
260
260
|
}
|
|
261
261
|
r.componentWillUpdate != null && r.componentWillUpdate(h, r.__s, C), r.componentDidUpdate != null && r.__h.push(function() {
|
|
262
|
-
r.componentDidUpdate(
|
|
262
|
+
r.componentDidUpdate(c, v, k);
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
if (r.context = C, r.props = h, r.__P = e, r.__e = !1, P = f.__r, ne = 0, "prototype" in b && b.prototype.render) {
|
|
@@ -270,12 +270,12 @@ function ee(e, t, n, _, o, i, l, u, c, s) {
|
|
|
270
270
|
do
|
|
271
271
|
r.__d = !1, P && P(t), p = r.render(r.props, r.state, r.context), r.state = r.__s;
|
|
272
272
|
while (r.__d && ++ne < 25);
|
|
273
|
-
r.state = r.__s, r.getChildContext != null && (_ = S(S({}, _), r.getChildContext())), d || r.getSnapshotBeforeUpdate == null || (k = r.getSnapshotBeforeUpdate(
|
|
274
|
-
} catch (
|
|
275
|
-
t.__v = null,
|
|
273
|
+
r.state = r.__s, r.getChildContext != null && (_ = S(S({}, _), r.getChildContext())), d || r.getSnapshotBeforeUpdate == null || (k = r.getSnapshotBeforeUpdate(c, v)), ke(e, q(W = p != null && p.type === T && p.key == null ? p.props.children : p) ? W : [W], t, n, _, o, i, l, u, a, s), r.base = t.__e, t.__u &= -161, r.__h.length && l.push(r), g && (r.__E = r.__ = null);
|
|
274
|
+
} catch (V) {
|
|
275
|
+
t.__v = null, a || i != null ? (t.__e = u, t.__u |= a ? 160 : 32, i[i.indexOf(u)] = null) : (t.__e = n.__e, t.__k = n.__k), f.__e(V, t, n);
|
|
276
276
|
}
|
|
277
277
|
else
|
|
278
|
-
i == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e =
|
|
278
|
+
i == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = Re(n.__e, t, n, _, o, i, l, a, s);
|
|
279
279
|
(p = f.diffed) && p(t);
|
|
280
280
|
}
|
|
281
281
|
function Se(e, t, n) {
|
|
@@ -292,12 +292,12 @@ function Se(e, t, n) {
|
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
var s, p, r, d,
|
|
295
|
+
function Re(e, t, n, _, o, i, l, u, a) {
|
|
296
|
+
var s, p, r, d, c, v, k, g = n.props, h = t.props, y = t.type;
|
|
297
297
|
if (y === "svg" && (o = !0), i != null) {
|
|
298
298
|
for (s = 0; s < i.length; s++)
|
|
299
|
-
if ((
|
|
300
|
-
e =
|
|
299
|
+
if ((c = i[s]) && "setAttribute" in c == !!y && (y ? c.localName === y : c.nodeType === 3)) {
|
|
300
|
+
e = c, i[s] = null;
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
@@ -309,19 +309,19 @@ function Te(e, t, n, _, o, i, l, u, c) {
|
|
|
309
309
|
if (y === null)
|
|
310
310
|
g === h || u && e.data === h || (e.data = h);
|
|
311
311
|
else {
|
|
312
|
-
if (i = i &&
|
|
312
|
+
if (i = i && R.call(e.childNodes), g = n.props || N, !u && i != null)
|
|
313
313
|
for (g = {}, s = 0; s < e.attributes.length; s++)
|
|
314
|
-
g[(
|
|
314
|
+
g[(c = e.attributes[s]).name] = c.value;
|
|
315
315
|
for (s in g)
|
|
316
|
-
|
|
316
|
+
c = g[s], s == "children" || (s == "dangerouslySetInnerHTML" ? r = c : s === "key" || s in h || H(e, s, null, c, o));
|
|
317
317
|
for (s in h)
|
|
318
|
-
|
|
318
|
+
c = h[s], s == "children" ? d = c : s == "dangerouslySetInnerHTML" ? p = c : s == "value" ? v = c : s == "checked" ? k = c : s === "key" || u && typeof c != "function" || g[s] === c || H(e, s, c, g[s], o);
|
|
319
319
|
if (p)
|
|
320
320
|
u || r && (p.__html === r.__html || p.__html === e.innerHTML) || (e.innerHTML = p.__html), t.__k = [];
|
|
321
|
-
else if (r && (e.innerHTML = ""), ke(e, q(d) ? d : [d], t, n, _, o && y !== "foreignObject", i, l, i ? i[0] : n.__k && w(n, 0), u,
|
|
321
|
+
else if (r && (e.innerHTML = ""), ke(e, q(d) ? d : [d], t, n, _, o && y !== "foreignObject", i, l, i ? i[0] : n.__k && w(n, 0), u, a), i != null)
|
|
322
322
|
for (s = i.length; s--; )
|
|
323
323
|
i[s] != null && ye(i[s]);
|
|
324
|
-
u || (s = "value", v !== void 0 && (v !== e[s] || y === "progress" && !v || y === "option" && v !== g[s]) &&
|
|
324
|
+
u || (s = "value", v !== void 0 && (v !== e[s] || y === "progress" && !v || y === "option" && v !== g[s]) && H(e, s, v, g[s], !1), s = "checked", k !== void 0 && k !== e[s] && H(e, s, k, g[s], !1));
|
|
325
325
|
}
|
|
326
326
|
return e;
|
|
327
327
|
}
|
|
@@ -348,14 +348,14 @@ function J(e, t, n) {
|
|
|
348
348
|
_[o] && J(_[o], t, n || typeof e.type != "function");
|
|
349
349
|
n || e.__e == null || ye(e.__e), e.__ = e.__e = e.__d = void 0;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Te(e, t, n) {
|
|
352
352
|
return this.constructor(e, n);
|
|
353
353
|
}
|
|
354
354
|
function We(e, t, n) {
|
|
355
355
|
var _, o, i, l;
|
|
356
|
-
f.__ && f.__(e, t), o = (_ = typeof n == "function") ? null : n && n.__k || t.__k, i = [], l = [], ee(t, e = (!_ && n || t).__k =
|
|
356
|
+
f.__ && f.__(e, t), o = (_ = typeof n == "function") ? null : n && n.__k || t.__k, i = [], l = [], ee(t, e = (!_ && n || t).__k = Me(T, null, [e]), o || N, N, t.ownerSVGElement !== void 0, !_ && n ? [n] : o ? null : t.firstChild ? R.call(t.childNodes) : null, i, !_ && n ? n : o ? o.__e : t.firstChild, _, l), Se(i, e, l);
|
|
357
357
|
}
|
|
358
|
-
|
|
358
|
+
R = ge.slice, f = { __e: function(e, t, n, _) {
|
|
359
359
|
for (var o, i, l; t = t.__; )
|
|
360
360
|
if ((o = t.__c) && !o.__)
|
|
361
361
|
try {
|
|
@@ -365,30 +365,30 @@ T = ge.slice, f = { __e: function(e, t, n, _) {
|
|
|
365
365
|
e = u;
|
|
366
366
|
}
|
|
367
367
|
throw e;
|
|
368
|
-
} }, me = 0,
|
|
368
|
+
} }, me = 0, D.prototype.setState = function(e, t) {
|
|
369
369
|
var n;
|
|
370
370
|
n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = S({}, this.state), typeof e == "function" && (e = e(S({}, n), this.props)), e && S(n, e), e != null && this.__v && (t && this._sb.push(t), oe(this));
|
|
371
|
-
},
|
|
371
|
+
}, D.prototype.forceUpdate = function(e) {
|
|
372
372
|
this.__v && (this.__e = !0, e && this.__h.push(e), oe(this));
|
|
373
|
-
},
|
|
373
|
+
}, D.prototype.render = T, E = [], ve = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Z = function(e, t) {
|
|
374
374
|
return e.__v.__b - t.__v.__b;
|
|
375
|
-
},
|
|
376
|
-
var
|
|
375
|
+
}, M.__r = 0;
|
|
376
|
+
var A, m, G, ue, Y = 0, xe = [], I = [], le = f.__b, ae = f.__r, ce = f.diffed, fe = f.__c, pe = f.unmount;
|
|
377
377
|
function Ee(e, t) {
|
|
378
378
|
f.__h && f.__h(m, e, Y || t), Y = 0;
|
|
379
379
|
var n = m.__H || (m.__H = { __: [], __h: [] });
|
|
380
|
-
return e >= n.__.length && n.__.push({ __V:
|
|
380
|
+
return e >= n.__.length && n.__.push({ __V: I }), n.__[e];
|
|
381
381
|
}
|
|
382
382
|
function Be(e) {
|
|
383
383
|
return Y = 1, Ge(we, e);
|
|
384
384
|
}
|
|
385
385
|
function Ge(e, t, n) {
|
|
386
|
-
var _ = Ee(
|
|
386
|
+
var _ = Ee(A++, 2);
|
|
387
387
|
if (_.t = e, !_.__c && (_.__ = [n ? n(t) : we(void 0, t), function(u) {
|
|
388
|
-
var
|
|
389
|
-
|
|
388
|
+
var a = _.__N ? _.__N[0] : _.__[0], s = _.t(a, u);
|
|
389
|
+
a !== s && (_.__N = [s, _.__[1]], _.__c.setState({}));
|
|
390
390
|
}], _.__c = m, !m.u)) {
|
|
391
|
-
var o = function(u,
|
|
391
|
+
var o = function(u, a, s) {
|
|
392
392
|
if (!_.__c.__H)
|
|
393
393
|
return !0;
|
|
394
394
|
var p = _.__c.__H.__.filter(function(d) {
|
|
@@ -397,29 +397,29 @@ function Ge(e, t, n) {
|
|
|
397
397
|
if (p.every(function(d) {
|
|
398
398
|
return !d.__N;
|
|
399
399
|
}))
|
|
400
|
-
return !i || i.call(this, u,
|
|
400
|
+
return !i || i.call(this, u, a, s);
|
|
401
401
|
var r = !1;
|
|
402
402
|
return p.forEach(function(d) {
|
|
403
403
|
if (d.__N) {
|
|
404
|
-
var
|
|
405
|
-
d.__ = d.__N, d.__N = void 0,
|
|
404
|
+
var c = d.__[0];
|
|
405
|
+
d.__ = d.__N, d.__N = void 0, c !== d.__[0] && (r = !0);
|
|
406
406
|
}
|
|
407
|
-
}), !(!r && _.__c.props === u) && (!i || i.call(this, u,
|
|
407
|
+
}), !(!r && _.__c.props === u) && (!i || i.call(this, u, a, s));
|
|
408
408
|
};
|
|
409
409
|
m.u = !0;
|
|
410
410
|
var i = m.shouldComponentUpdate, l = m.componentWillUpdate;
|
|
411
|
-
m.componentWillUpdate = function(u,
|
|
411
|
+
m.componentWillUpdate = function(u, a, s) {
|
|
412
412
|
if (this.__e) {
|
|
413
413
|
var p = i;
|
|
414
|
-
i = void 0, o(u,
|
|
414
|
+
i = void 0, o(u, a, s), i = p;
|
|
415
415
|
}
|
|
416
|
-
l && l.call(this, u,
|
|
416
|
+
l && l.call(this, u, a, s);
|
|
417
417
|
}, m.shouldComponentUpdate = o;
|
|
418
418
|
}
|
|
419
419
|
return _.__N || _.__;
|
|
420
420
|
}
|
|
421
421
|
function Qe(e, t) {
|
|
422
|
-
var n = Ee(
|
|
422
|
+
var n = Ee(A++, 3);
|
|
423
423
|
!f.__s && Je(n.__H, t) && (n.__ = e, n.i = t, m.__H.__h.push(n));
|
|
424
424
|
}
|
|
425
425
|
function ze() {
|
|
@@ -434,16 +434,16 @@ function ze() {
|
|
|
434
434
|
f.__b = function(e) {
|
|
435
435
|
m = null, le && le(e);
|
|
436
436
|
}, f.__r = function(e) {
|
|
437
|
-
|
|
437
|
+
ae && ae(e), A = 0;
|
|
438
438
|
var t = (m = e.__c).__H;
|
|
439
439
|
t && (G === m ? (t.__h = [], m.__h = [], t.__.forEach(function(n) {
|
|
440
|
-
n.__N && (n.__ = n.__N), n.__V =
|
|
441
|
-
})) : (t.__h.forEach(F), t.__h.forEach(K), t.__h = [],
|
|
440
|
+
n.__N && (n.__ = n.__N), n.__V = I, n.__N = n.i = void 0;
|
|
441
|
+
})) : (t.__h.forEach(F), t.__h.forEach(K), t.__h = [], A = 0)), G = m;
|
|
442
442
|
}, f.diffed = function(e) {
|
|
443
|
-
|
|
443
|
+
ce && ce(e);
|
|
444
444
|
var t = e.__c;
|
|
445
445
|
t && t.__H && (t.__H.__h.length && (xe.push(t) !== 1 && ue === f.requestAnimationFrame || ((ue = f.requestAnimationFrame) || Ze)(ze)), t.__H.__.forEach(function(n) {
|
|
446
|
-
n.i && (n.__H = n.i), n.__V !==
|
|
446
|
+
n.i && (n.__H = n.i), n.__V !== I && (n.__ = n.__V), n.i = void 0, n.__V = I;
|
|
447
447
|
})), G = m = null;
|
|
448
448
|
}, f.__c = function(e, t) {
|
|
449
449
|
t.some(function(n) {
|
|
@@ -493,13 +493,13 @@ function we(e, t) {
|
|
|
493
493
|
}
|
|
494
494
|
var Ye = 0;
|
|
495
495
|
function Pe(e, t, n, _, o, i) {
|
|
496
|
-
var l, u,
|
|
496
|
+
var l, u, a = {};
|
|
497
497
|
for (u in t)
|
|
498
|
-
u == "ref" ? l = t[u] :
|
|
499
|
-
var s = { type: e, props:
|
|
498
|
+
u == "ref" ? l = t[u] : a[u] = t[u];
|
|
499
|
+
var s = { type: e, props: a, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --Ye, __i: -1, __u: 0, __source: o, __self: i };
|
|
500
500
|
if (typeof e == "function" && (l = e.defaultProps))
|
|
501
501
|
for (u in l)
|
|
502
|
-
|
|
502
|
+
a[u] === void 0 && (a[u] = l[u]);
|
|
503
503
|
return f.vnode && f.vnode(s), s;
|
|
504
504
|
}
|
|
505
505
|
class Ke {
|
|
@@ -534,16 +534,16 @@ class Ke {
|
|
|
534
534
|
console.log("Navigating to customer portal");
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
let
|
|
537
|
+
let U;
|
|
538
538
|
const Xe = ({
|
|
539
539
|
context: e
|
|
540
540
|
}) => {
|
|
541
541
|
const [t, n] = Be(null);
|
|
542
542
|
return Qe(() => {
|
|
543
543
|
if (t) {
|
|
544
|
-
if (
|
|
544
|
+
if (U === void 0)
|
|
545
545
|
throw new Error("Please call setSpiffDevOptions before requesting the context.");
|
|
546
|
-
|
|
546
|
+
U.setContext({
|
|
547
547
|
...e,
|
|
548
548
|
container: t
|
|
549
549
|
});
|
|
@@ -553,14 +553,14 @@ const Xe = ({
|
|
|
553
553
|
id: "spiffThemeWrapper"
|
|
554
554
|
});
|
|
555
555
|
};
|
|
556
|
-
function
|
|
557
|
-
|
|
556
|
+
function Ct(e, t) {
|
|
557
|
+
U = new Ke(), window.SpiffThemeLoader = U;
|
|
558
558
|
let n;
|
|
559
559
|
typeof e == "string" ? n = document.getElementById(e) : n = e, We(Pe(Xe, {
|
|
560
560
|
context: t
|
|
561
561
|
}), n);
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function St(e) {
|
|
564
564
|
return {
|
|
565
565
|
id: "example",
|
|
566
566
|
themeInstallId: (e == null ? void 0 : e.themeInstallId) ?? "example",
|
|
@@ -593,7 +593,7 @@ const qe = (e) => {
|
|
|
593
593
|
if (Object.keys(e).includes("defaultValue"))
|
|
594
594
|
return e.defaultValue;
|
|
595
595
|
};
|
|
596
|
-
function
|
|
596
|
+
function xt(e, ...t) {
|
|
597
597
|
return e.fields.filter((n) => !n.key || !t.includes(n.key)).map((n) => ({
|
|
598
598
|
key: n.key,
|
|
599
599
|
fallbackToDefaultConfiguration: !1,
|
|
@@ -602,7 +602,7 @@ function St(e, ...t) {
|
|
|
602
602
|
asset: void 0
|
|
603
603
|
}));
|
|
604
604
|
}
|
|
605
|
-
const et = "@spiffcommerce/theme-bridge", tt = "1.
|
|
605
|
+
const et = "@spiffcommerce/theme-bridge", tt = "1.21.1", nt = "module", _t = {
|
|
606
606
|
build: "tsc && vite build",
|
|
607
607
|
preview: "vite preview",
|
|
608
608
|
dev: "ladle serve",
|
|
@@ -612,7 +612,7 @@ const et = "@spiffcommerce/theme-bridge", tt = "1.20.0", nt = "module", _t = {
|
|
|
612
612
|
], ut = {
|
|
613
613
|
import: "./dist/index.js",
|
|
614
614
|
require: "./dist/index.umd.cjs"
|
|
615
|
-
}, lt = {},
|
|
615
|
+
}, lt = {}, at = {
|
|
616
616
|
"@ladle/react": "^4.0.2",
|
|
617
617
|
"@preact/preset-vite": "^2.7.0",
|
|
618
618
|
"@spiffcommerce/core": "^21.0.1",
|
|
@@ -632,9 +632,9 @@ const et = "@spiffcommerce/theme-bridge", tt = "1.20.0", nt = "module", _t = {
|
|
|
632
632
|
vite: "^5.0.8",
|
|
633
633
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
634
634
|
"vite-plugin-externalize-deps": "^0.8.0"
|
|
635
|
-
},
|
|
635
|
+
}, ct = {
|
|
636
636
|
"@spiffcommerce/core": "^21.0.1"
|
|
637
|
-
}, ft = {
|
|
637
|
+
}, ft = "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e", pt = {
|
|
638
638
|
name: et,
|
|
639
639
|
version: tt,
|
|
640
640
|
type: nt,
|
|
@@ -645,10 +645,11 @@ const et = "@spiffcommerce/theme-bridge", tt = "1.20.0", nt = "module", _t = {
|
|
|
645
645
|
files: st,
|
|
646
646
|
exports: ut,
|
|
647
647
|
dependencies: lt,
|
|
648
|
-
devDependencies:
|
|
649
|
-
peerDependencies:
|
|
648
|
+
devDependencies: at,
|
|
649
|
+
peerDependencies: ct,
|
|
650
|
+
packageManager: ft
|
|
650
651
|
};
|
|
651
|
-
function
|
|
652
|
+
function dt(e, t, n) {
|
|
652
653
|
if (t.type === "chunk") {
|
|
653
654
|
if (console.log(`chunk ${e} isEntry: ${t.isEntry}, isDynamicEntry: ${t.isDynamicEntry}, isImplicitEntry: ${t.isImplicitEntry}`), !t.isEntry && !n)
|
|
654
655
|
return null;
|
|
@@ -667,7 +668,7 @@ function pt(e, t, n) {
|
|
|
667
668
|
};
|
|
668
669
|
return null;
|
|
669
670
|
}
|
|
670
|
-
function
|
|
671
|
+
function Et(e) {
|
|
671
672
|
const {
|
|
672
673
|
autoGenerateTargetFiles: t = !0,
|
|
673
674
|
configurationSchema: n,
|
|
@@ -676,37 +677,37 @@ function xt(e) {
|
|
|
676
677
|
} = e ?? {};
|
|
677
678
|
return {
|
|
678
679
|
name: "spiff-theme-plugin",
|
|
679
|
-
version:
|
|
680
|
+
version: pt.version,
|
|
680
681
|
config(i, l) {
|
|
681
682
|
i.base !== void 0 && i.base !== "" && console.warn('You have specified a `base` in your vite configuration other than "". This value will now be overwritten.'), i.base = "";
|
|
682
683
|
},
|
|
683
684
|
writeBundle(i, l) {
|
|
684
|
-
const u = t ? Object.keys(l).map((s) => o != null && o.some((p) => p.filename === s) ? null :
|
|
685
|
+
const u = t ? Object.keys(l).map((s) => o != null && o.some((p) => p.filename === s) ? null : dt(s, l[s], _)).filter((s) => s !== null) : [];
|
|
685
686
|
o && u.push(...o);
|
|
686
|
-
const
|
|
687
|
+
const a = {
|
|
687
688
|
launchData: {
|
|
688
689
|
targetFiles: u
|
|
689
690
|
},
|
|
690
691
|
configurationSchema: n
|
|
691
692
|
};
|
|
692
|
-
je.writeFileSync(
|
|
693
|
+
je.writeFileSync(Ve.join(i.dir, "spiffTheme.json"), JSON.stringify(a, void 0, 4));
|
|
693
694
|
}
|
|
694
695
|
};
|
|
695
696
|
}
|
|
696
697
|
export {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
698
|
+
He as AssetType,
|
|
699
|
+
Ie as ConversionDataType,
|
|
700
|
+
De as ConversionLocation,
|
|
700
701
|
Oe as CustomSchemaType,
|
|
701
702
|
x as FieldType,
|
|
702
703
|
Q as ThemeFileType,
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
704
|
+
St as exampleThemeInstallConfig,
|
|
705
|
+
xt as getDefaultsForSchema,
|
|
706
|
+
Ct as setSpiffDevOptions,
|
|
707
|
+
Et as spiffThemePlugin,
|
|
708
|
+
gt as themeInstallConfigurationFieldsToRecordObject,
|
|
709
|
+
kt as themeInstallConfigurationGraphQlToResource,
|
|
710
|
+
yt as themeInstallConfigurationToRecordObject,
|
|
710
711
|
Fe as themeVersionConfigurationGraphQlToResource,
|
|
711
|
-
|
|
712
|
+
bt as themeVersionGraphQlToResource
|
|
712
713
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("#spiffThemeWrapper{width:100%;height:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
(function(d,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("fs"),require("path")):typeof define=="function"&&define.amd?define(["exports","fs","path"],k):(d=typeof globalThis<"u"?globalThis:d||self,k(d.theme={},d.fs,d.path))})(this,function(d,k,P){"use strict";var lt=Object.defineProperty;var ct=(d,k,P)=>k in d?lt(d,k,{enumerable:!0,configurable:!0,writable:!0,value:P}):d[k]=P;var _e=(d,k,P)=>(ct(d,typeof k!="symbol"?k+"":k,P),P);var O=(e=>(e.Javascript="Javascript",e.CSS="CSS",e))(O||{}),E=(e=>(e.Asset="Asset",e.Boolean="Boolean",e.Color="Color",e.ConversionConfiguration="ConversionConfiguration",e.Heading="Heading",e.List="List",e.Number="Number",e.Object="Object",e.Select="Select",e.Text="Text",e))(E||{}),re=(e=>(e.Color="Color",e.ColorProfile="ColorProfile",e.Data="Data",e.Environment="Environment",e.Font="Font",e.Frame="Frame",e.Illustration="Illustration",e.Image="Image",e.Material="Material",e.Model="Model",e.Video="Video",e))(re||{}),ie=(e=>(e.Object="Object",e.Union="Union",e))(ie||{}),se=(e=>(e.Manual="Manual",e.OnStart="OnStart",e.OnQuit="OnQuit",e.OnEnd="OnEnd",e))(se||{}),ue=(e=>(e.Email="Email",e.FirstName="FirstName",e.LastName="LastName",e.Phone="Phone",e.Apartment="Apartment",e.City="City",e.Country="Country",e.OrganizationName="OrganizationName",e.PostCode="PostCode",e.State="State",e.StreetAddress="StreetAddress",e.DesignName="DesignName",e.PurchaseOrder="PurchaseOrder",e.DispatchDate="DispatchDate",e.Stakeholders="Stakeholders",e))(ue||{});function z(e){return Object.assign({},...e.map(t=>{if(t.key)return{[t.key]:le(t)}}))}function le(e){if(e.type===E.Asset)return e.asset;if(e.type===E.ConversionConfiguration)return e.conversionConfiguration;if(e.type!==E.List&&e.type!==E.Object){if(e.value===void 0)return;if(e.type===E.Number)try{return Number.parseFloat(e.value)}catch{return}else if(e.type===E.Boolean)return e.value==="true";return e.value}if(e.listValues)return e.listValues.map(le);if(e.objectValues)return{...z(e.objectValues),schema:e.schema??void 0}}function He(e){return z(e)}function Fe(e){return z(e.fields)}function V(e,t){const n={...e,items:void 0,fields:void 0};return e.items!==void 0&&(n.items=V(t[e.items],t)),e.fields!==void 0&&(n.fields=e.fields.map(o=>V(t[o],t))),n}function ce(e){var o;const t={...e,fields:[],customSchemas:(o=e.customSchemas)==null?void 0:o.map(_=>{var i;return{..._,fields:(i=_.fields)==null?void 0:i.map(l=>V(e.fields[l],e.fields))}})},n=[];if(e.fields.forEach(_=>{_.root&&n.push(V(_,e.fields))}),e.fields.length>0&&n.length===0)throw new Error("Failed to map ThemeVersionConfiguration GraphQL type to Resource type. Please ensure you've selected the `root` field on ThemeConfigurationSchemaField");return t.fields=n,t}function Le(e){return{...e,configurationSchema:ce(e.configurationSchema)}}function Z(e,t){const n={...e,listValues:void 0,objectValues:void 0};return e.listValues!==void 0&&(n.listValues=e.listValues.map(o=>Z(t[o],t))),e.objectValues!==void 0&&(n.objectValues=e.objectValues.map(o=>Z(t[o],t))),n}function Ae(e){const t={...e,fields:[]},n=[];if(e.fields.forEach(o=>{o.root&&n.push(Z(o,e.fields))}),e.fields.length>0&&n.length===0)throw new Error("Failed to map ThemeInstallConfiguration GraphQL type to Resource type. Please ensure you've selected the `root` field on ThemeInstallConfigurationField");return t.fields=n,t}var I,f,ae,j,fe,pe,J,N={},de=[],Re=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function he(e){var t=e.parentNode;t&&t.removeChild(e)}function Me(e,t,n){var o,_,i,l={};for(i in t)i=="key"?o=t[i]:i=="ref"?_=t[i]:l[i]=t[i];if(arguments.length>2&&(l.children=arguments.length>3?I.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return D(e,l,o,_,null)}function D(e,t,n,o,_){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:_??++ae,__i:-1,__u:0};return _==null&&f.vnode!=null&&f.vnode(i),i}function H(e){return e.children}function F(e,t){this.props=e,this.context=t}function $(e,t){if(t==null)return e.__?$(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?$(e):null}function me(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return me(e)}}function ve(e){(!e.__d&&(e.__d=!0)&&j.push(e)&&!L.__r++||fe!==f.debounceRendering)&&((fe=f.debounceRendering)||pe)(L)}function L(){var e,t,n,o,_,i,l,u,c;for(j.sort(J);e=j.shift();)e.__d&&(t=j.length,o=void 0,i=(_=(n=e).__v).__e,u=[],c=[],(l=n.__P)&&((o=w({},_)).__v=_.__v+1,f.vnode&&f.vnode(o),q(l,o,_,n.__n,l.ownerSVGElement!==void 0,32&_.__u?[i]:null,u,i??$(_),!!(32&_.__u),c),o.__.__k[o.__i]=o,Se(u,o,c),o.__e!=i&&me(o)),j.length>t&&j.sort(J));L.__r=0}function ge(e,t,n,o,_,i,l,u,c,s,p){var r,h,a,g,S,y=o&&o.__k||de,m=t.length;for(n.__d=c,Ue(n,t,y),c=n.__d,r=0;r<m;r++)(a=n.__k[r])!=null&&typeof a!="boolean"&&typeof a!="function"&&(h=a.__i===-1?N:y[a.__i]||N,a.__i=r,q(e,a,h,_,i,l,u,c,s,p),g=a.__e,a.ref&&h.ref!=a.ref&&(h.ref&&K(h.ref,null,a),p.push(a.ref,a.__c||g,a)),S==null&&g!=null&&(S=g),65536&a.__u||h.__k===a.__k?c=ye(a,c,e):typeof a.type=="function"&&a.__d!==void 0?c=a.__d:g&&(c=g.nextSibling),a.__d=void 0,a.__u&=-196609);n.__d=c,n.__e=S}function Ue(e,t,n){var o,_,i,l,u,c=t.length,s=n.length,p=s,r=0;for(e.__k=[],o=0;o<c;o++)(_=e.__k[o]=(_=t[o])==null||typeof _=="boolean"||typeof _=="function"?null:typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?D(null,_,null,null,_):Y(_)?D(H,{children:_},null,null,null):_.constructor===void 0&&_.__b>0?D(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)!=null?(_.__=e,_.__b=e.__b+1,u=We(_,n,l=o+r,p),_.__i=u,i=null,u!==-1&&(p--,(i=n[u])&&(i.__u|=131072)),i==null||i.__v===null?(u==-1&&r--,typeof _.type!="function"&&(_.__u|=65536)):u!==l&&(u===l+1?r++:u>l?p>c-l?r+=u-l:r--:r=u<l&&u==l-1?u-l:0,u!==o+r&&(_.__u|=65536))):(i=n[o])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=$(i)),X(i,i,!1),n[o]=null,p--);if(p)for(o=0;o<s;o++)(i=n[o])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=$(i)),X(i,i))}function ye(e,t,n){var o,_;if(typeof e.type=="function"){for(o=e.__k,_=0;o&&_<o.length;_++)o[_]&&(o[_].__=e,t=ye(o[_],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function We(e,t,n,o){var _=e.key,i=e.type,l=n-1,u=n+1,c=t[n];if(c===null||c&&_==c.key&&i===c.type)return n;if(o>(c!=null&&!(131072&c.__u)?1:0))for(;l>=0||u<t.length;){if(l>=0){if((c=t[l])&&!(131072&c.__u)&&_==c.key&&i===c.type)return l;l--}if(u<t.length){if((c=t[u])&&!(131072&c.__u)&&_==c.key&&i===c.type)return u;u++}}return-1}function be(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Re.test(t)?n:n+"px"}function A(e,t,n,o,_){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||be(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||be(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=Date.now(),e.addEventListener(t,i?Ce:ke,i)):e.removeEventListener(t,i?Ce:ke,i);else{if(_)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function ke(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(f.event?f.event(e):e)}function Ce(e){return this.l[e.type+!0](f.event?f.event(e):e)}function q(e,t,n,o,_,i,l,u,c,s){var p,r,h,a,g,S,y,m,b,x,G,T,De,Q,oe,C=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),i=[u=t.__e=n.__e]),(p=f.__b)&&p(t);e:if(typeof C=="function")try{if(m=t.props,b=(p=C.contextType)&&o[p.__c],x=p?b?b.props.value:p.__:o,n.__c?y=(r=t.__c=n.__c).__=r.__E:("prototype"in C&&C.prototype.render?t.__c=r=new C(m,x):(t.__c=r=new F(m,x),r.constructor=C,r.render=Qe),b&&b.sub(r),r.props=m,r.state||(r.state={}),r.context=x,r.__n=o,h=r.__d=!0,r.__h=[],r._sb=[]),r.__s==null&&(r.__s=r.state),C.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=w({},r.__s)),w(r.__s,C.getDerivedStateFromProps(m,r.__s))),a=r.props,g=r.state,r.__v=t,h)C.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(C.getDerivedStateFromProps==null&&m!==a&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(m,x),!r.__e&&(r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(m,r.__s,x)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(r.props=m,r.state=r.__s,r.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(B){B&&(B.__=t)}),G=0;G<r._sb.length;G++)r.__h.push(r._sb[G]);r._sb=[],r.__h.length&&l.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(m,r.__s,x),r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(a,g,S)})}if(r.context=x,r.props=m,r.__P=e,r.__e=!1,T=f.__r,De=0,"prototype"in C&&C.prototype.render){for(r.state=r.__s,r.__d=!1,T&&T(t),p=r.render(r.props,r.state,r.context),Q=0;Q<r._sb.length;Q++)r.__h.push(r._sb[Q]);r._sb=[]}else do r.__d=!1,T&&T(t),p=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++De<25);r.state=r.__s,r.getChildContext!=null&&(o=w(w({},o),r.getChildContext())),h||r.getSnapshotBeforeUpdate==null||(S=r.getSnapshotBeforeUpdate(a,g)),ge(e,Y(oe=p!=null&&p.type===H&&p.key==null?p.props.children:p)?oe:[oe],t,n,o,_,i,l,u,c,s),r.base=t.__e,t.__u&=-161,r.__h.length&&l.push(r),y&&(r.__E=r.__=null)}catch(B){t.__v=null,c||i!=null?(t.__e=u,t.__u|=c?160:32,i[i.indexOf(u)]=null):(t.__e=n.__e,t.__k=n.__k),f.__e(B,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ge(n.__e,t,n,o,_,i,l,c,s);(p=f.diffed)&&p(t)}function Se(e,t,n){t.__d=void 0;for(var o=0;o<n.length;o++)K(n[o],n[++o],n[++o]);f.__c&&f.__c(t,e),e.some(function(_){try{e=_.__h,_.__h=[],e.some(function(i){i.call(_)})}catch(i){f.__e(i,_.__v)}})}function Ge(e,t,n,o,_,i,l,u,c){var s,p,r,h,a,g,S,y=n.props,m=t.props,b=t.type;if(b==="svg"&&(_=!0),i!=null){for(s=0;s<i.length;s++)if((a=i[s])&&"setAttribute"in a==!!b&&(b?a.localName===b:a.nodeType===3)){e=a,i[s]=null;break}}if(e==null){if(b===null)return document.createTextNode(m);e=_?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,m.is&&m),i=null,u=!1}if(b===null)y===m||u&&e.data===m||(e.data=m);else{if(i=i&&I.call(e.childNodes),y=n.props||N,!u&&i!=null)for(y={},s=0;s<e.attributes.length;s++)y[(a=e.attributes[s]).name]=a.value;for(s in y)a=y[s],s=="children"||(s=="dangerouslySetInnerHTML"?r=a:s==="key"||s in m||A(e,s,null,a,_));for(s in m)a=m[s],s=="children"?h=a:s=="dangerouslySetInnerHTML"?p=a:s=="value"?g=a:s=="checked"?S=a:s==="key"||u&&typeof a!="function"||y[s]===a||A(e,s,a,y[s],_);if(p)u||r&&(p.__html===r.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(r&&(e.innerHTML=""),ge(e,Y(h)?h:[h],t,n,o,_&&b!=="foreignObject",i,l,i?i[0]:n.__k&&$(n,0),u,c),i!=null)for(s=i.length;s--;)i[s]!=null&&he(i[s]);u||(s="value",g!==void 0&&(g!==e[s]||b==="progress"&&!g||b==="option"&&g!==y[s])&&A(e,s,g,y[s],!1),s="checked",S!==void 0&&S!==e[s]&&A(e,s,S,y[s],!1))}return e}function K(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(o){f.__e(o,n)}}function X(e,t,n){var o,_;if(f.unmount&&f.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||K(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){f.__e(i,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(_=0;_<o.length;_++)o[_]&&X(o[_],t,n||typeof e.type!="function");n||e.__e==null||he(e.__e),e.__=e.__e=e.__d=void 0}function Qe(e,t,n){return this.constructor(e,n)}function Be(e,t,n){var o,_,i,l;f.__&&f.__(e,t),_=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],l=[],q(t,e=(!o&&n||t).__k=Me(H,null,[e]),_||N,N,t.ownerSVGElement!==void 0,!o&&n?[n]:_?null:t.firstChild?I.call(t.childNodes):null,i,!o&&n?n:_?_.__e:t.firstChild,o,l),Se(i,e,l)}I=de.slice,f={__e:function(e,t,n,o){for(var _,i,l;t=t.__;)if((_=t.__c)&&!_.__)try{if((i=_.constructor)&&i.getDerivedStateFromError!=null&&(_.setState(i.getDerivedStateFromError(e)),l=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(e,o||{}),l=_.__d),l)return _.__E=_}catch(u){e=u}throw e}},ae=0,F.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},n),this.props)),e&&w(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ve(this))},F.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ve(this))},F.prototype.render=H,j=[],pe=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(e,t){return e.__v.__b-t.__v.__b},L.__r=0;var R,v,ee,Ee,te=0,we=[],M=[],xe=f.__b,Pe=f.__r,je=f.diffed,$e=f.__c,Ne=f.unmount;function Te(e,t){f.__h&&f.__h(v,e,te||t),te=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:M}),n.__[e]}function ze(e){return te=1,Ze(Ve,e)}function Ze(e,t,n){var o=Te(R++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Ve(void 0,t),function(u){var c=o.__N?o.__N[0]:o.__[0],s=o.t(c,u);c!==s&&(o.__N=[s,o.__[1]],o.__c.setState({}))}],o.__c=v,!v.u)){var _=function(u,c,s){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!i||i.call(this,u,c,s);var r=!1;return p.forEach(function(h){if(h.__N){var a=h.__[0];h.__=h.__N,h.__N=void 0,a!==h.__[0]&&(r=!0)}}),!(!r&&o.__c.props===u)&&(!i||i.call(this,u,c,s))};v.u=!0;var i=v.shouldComponentUpdate,l=v.componentWillUpdate;v.componentWillUpdate=function(u,c,s){if(this.__e){var p=i;i=void 0,_(u,c,s),i=p}l&&l.call(this,u,c,s)},v.shouldComponentUpdate=_}return o.__N||o.__}function Je(e,t){var n=Te(R++,3);!f.__s&&Ke(n.__H,t)&&(n.__=e,n.i=t,v.__H.__h.push(n))}function Ye(){for(var e;e=we.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(U),e.__H.__h.forEach(ne),e.__H.__h=[]}catch(t){e.__H.__h=[],f.__e(t,e.__v)}}f.__b=function(e){v=null,xe&&xe(e)},f.__r=function(e){Pe&&Pe(e),R=0;var t=(v=e.__c).__H;t&&(ee===v?(t.__h=[],v.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=M,n.__N=n.i=void 0})):(t.__h.forEach(U),t.__h.forEach(ne),t.__h=[],R=0)),ee=v},f.diffed=function(e){je&&je(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(we.push(t)!==1&&Ee===f.requestAnimationFrame||((Ee=f.requestAnimationFrame)||qe)(Ye)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==M&&(n.__=n.__V),n.i=void 0,n.__V=M})),ee=v=null},f.__c=function(e,t){t.some(function(n){try{n.__h.forEach(U),n.__h=n.__h.filter(function(o){return!o.__||ne(o)})}catch(o){t.some(function(_){_.__h&&(_.__h=[])}),t=[],f.__e(o,n.__v)}}),$e&&$e(e,t)},f.unmount=function(e){Ne&&Ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{U(o)}catch(_){t=_}}),n.__H=void 0,t&&f.__e(t,n.__v))};var Oe=typeof requestAnimationFrame=="function";function qe(e){var t,n=function(){clearTimeout(o),Oe&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);Oe&&(t=requestAnimationFrame(n))}function U(e){var t=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function ne(e){var t=v;e.__c=e.__(),v=t}function Ke(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Ve(e,t){return typeof t=="function"?t(e):t}var Xe=0;function Ie(e,t,n,o,_,i){var l,u,c={};for(u in t)u=="ref"?l=t[u]:c[u]=t[u];var s={type:e,props:c,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Xe,__i:-1,__u:0,__source:_,__self:i};if(typeof e=="function"&&(l=e.defaultProps))for(u in l)c[u]===void 0&&(c[u]=l[u]);return f.vnode&&f.vnode(s),s}class et{constructor(){_e(this,"_context");_e(this,"_getContextCallbacks",[])}async getContext(){return this._context?this._context:new Promise(t=>{this._getContextCallbacks.push(t)})}setContext(t){this._context=t,this._getContextCallbacks.forEach(n=>n(t)),this._getContextCallbacks=[]}configureClient(t){console.log("Client configured")}themeLoaded(){console.log("Theme loaded")}close(){console.log("Theme closed")}addToEcommerceCart(t){console.log("Add to cart",t)}completeQuote(){console.log("Complete quote")}navigateToCustomerPortal(){console.log("Navigating to customer portal")}}let W;const tt=({context:e})=>{const[t,n]=ze(null);return Je(()=>{if(t){if(W===void 0)throw new Error("Please call setSpiffDevOptions before requesting the context.");W.setContext({...e,container:t})}},[t,e]),Ie("div",{ref:n,id:"spiffThemeWrapper"})};function nt(e,t){W=new et,window.SpiffThemeLoader=W;let n;typeof e=="string"?n=document.getElementById(e):n=e,Be(Ie(tt,{context:t}),n)}function ot(e){return{id:"example",themeInstallId:(e==null?void 0:e.themeInstallId)??"example",name:"Example Configuration",createdAt:"2021-01-01T00:00:00Z",updatedAt:"2021-01-01T00:00:00Z",themeVersion:{id:"example",version:"1.0.0",createdAt:"2021-01-01T00:00:00Z",updatedAt:"2021-01-01T00:00:00Z",configurationSchema:{fields:[]},launchData:{targetFiles:[]},theme:{id:"example",name:"Example Theme",createdAt:"2021-01-01T00:00:00Z",updatedAt:"2021-01-01T00:00:00Z"}},fields:[],...e}}const _t=e=>{if(Object.keys(e).includes("defaultValue"))return e.defaultValue};function rt(e,...t){return e.fields.filter(n=>!n.key||!t.includes(n.key)).map(n=>({key:n.key,fallbackToDefaultConfiguration:!1,value:_t(n),type:n.type,asset:void 0}))}const it={name:"@spiffcommerce/theme-bridge",version:"1.20.0",type:"module",scripts:{build:"tsc && vite build",preview:"vite preview",dev:"ladle serve",schema:"node --no-warnings=ExperimentalWarning --loader ts-node/esm scripts/generateSchema.ts"},main:"./dist/index.umd.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["./dist"],exports:{import:"./dist/index.js",require:"./dist/index.umd.cjs"},dependencies:{},devDependencies:{"@ladle/react":"^4.0.2","@preact/preset-vite":"^2.7.0","@spiffcommerce/core":"^21.0.1","@types/node":"^20.11.16","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3",preact:"^10.19.3",prettier:"^3.2.4",rollup:"^4.12.0","ts-json-schema-generator":"^1.5.0","ts-node":"^10.9.2",tsup:"^8.0.1",typescript:"^5.2.2",vite:"^5.0.8","vite-plugin-css-injected-by-js":"^3.4.0","vite-plugin-externalize-deps":"^0.8.0"},peerDependencies:{"@spiffcommerce/core":"^21.0.1"}};function st(e,t,n){if(t.type==="chunk"){if(console.log(`chunk ${e} isEntry: ${t.isEntry}, isDynamicEntry: ${t.isDynamicEntry}, isImplicitEntry: ${t.isImplicitEntry}`),!t.isEntry&&!n)return null;if(!t.isDynamicEntry)return{type:O.Javascript,mimeType:"text/javascript",preload:!t.isEntry,filename:e}}else if(e.endsWith(".css"))return{type:O.CSS,mimeType:"text/css",filename:e};return null}function ut(e){const{autoGenerateTargetFiles:t=!0,configurationSchema:n,includePreloadChunks:o=!1,targetFiles:_}=e??{};return{name:"spiff-theme-plugin",version:it.version,config(i,l){i.base!==void 0&&i.base!==""&&console.warn('You have specified a `base` in your vite configuration other than "". This value will now be overwritten.'),i.base=""},writeBundle(i,l){const u=t?Object.keys(l).map(s=>_!=null&&_.some(p=>p.filename===s)?null:st(s,l[s],o)).filter(s=>s!==null):[];_&&u.push(..._);const c={launchData:{targetFiles:u},configurationSchema:n};k.writeFileSync(P.join(i.dir,"spiffTheme.json"),JSON.stringify(c,void 0,4))}}}d.AssetType=re,d.ConversionDataType=ue,d.ConversionLocation=se,d.CustomSchemaType=ie,d.FieldType=E,d.ThemeFileType=O,d.exampleThemeInstallConfig=ot,d.getDefaultsForSchema=rt,d.setSpiffDevOptions=nt,d.spiffThemePlugin=ut,d.themeInstallConfigurationFieldsToRecordObject=He,d.themeInstallConfigurationGraphQlToResource=Ae,d.themeInstallConfigurationToRecordObject=Fe,d.themeVersionConfigurationGraphQlToResource=ce,d.themeVersionGraphQlToResource=Le,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
(function(p,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("fs"),require("path")):typeof define=="function"&&define.amd?define(["exports","fs","path"],k):(p=typeof globalThis<"u"?globalThis:p||self,k(p.theme={},p.fs,p.path))})(this,function(p,k,P){"use strict";var at=Object.defineProperty;var lt=(p,k,P)=>k in p?at(p,k,{enumerable:!0,configurable:!0,writable:!0,value:P}):p[k]=P;var _e=(p,k,P)=>(lt(p,typeof k!="symbol"?k+"":k,P),P);var D=(e=>(e.Javascript="Javascript",e.CSS="CSS",e))(D||{}),E=(e=>(e.Asset="Asset",e.Boolean="Boolean",e.Color="Color",e.ConversionConfiguration="ConversionConfiguration",e.Heading="Heading",e.List="List",e.Number="Number",e.Object="Object",e.Select="Select",e.Text="Text",e.DateRange="DateRange",e))(E||{}),re=(e=>(e.Color="Color",e.ColorProfile="ColorProfile",e.Data="Data",e.Environment="Environment",e.Font="Font",e.Frame="Frame",e.Illustration="Illustration",e.Image="Image",e.Material="Material",e.Model="Model",e.Video="Video",e))(re||{}),ie=(e=>(e.Object="Object",e.Union="Union",e))(ie||{}),se=(e=>(e.Manual="Manual",e.OnStart="OnStart",e.OnQuit="OnQuit",e.OnEnd="OnEnd",e))(se||{}),ue=(e=>(e.Email="Email",e.FirstName="FirstName",e.LastName="LastName",e.Phone="Phone",e.Apartment="Apartment",e.City="City",e.Country="Country",e.OrganizationName="OrganizationName",e.PostCode="PostCode",e.State="State",e.StreetAddress="StreetAddress",e.DesignName="DesignName",e.PurchaseOrder="PurchaseOrder",e.DispatchDate="DispatchDate",e.Stakeholders="Stakeholders",e))(ue||{});function z(e){return Object.assign({},...e.map(t=>{if(t.key)return{[t.key]:ae(t)}}))}function ae(e){if(e.type===E.Asset)return e.asset;if(e.type===E.ConversionConfiguration)return e.conversionConfiguration;if(e.type!==E.List&&e.type!==E.Object){if(e.value===void 0)return;if(e.type===E.Number)try{return Number.parseFloat(e.value)}catch{return}else if(e.type===E.Boolean)return e.value==="true";return e.value}if(e.listValues)return e.listValues.map(ae);if(e.objectValues)return{...z(e.objectValues),schema:e.schema??void 0}}function He(e){return z(e)}function Fe(e){return z(e.fields)}function O(e,t){const n={...e,items:void 0,fields:void 0};return e.items!==void 0&&e.items!==null&&(n.items=O(t[e.items],t)),e.fields!==void 0&&e.fields!==null&&(n.fields=e.fields.map(o=>O(t[o],t))),n}function le(e){var o;const t={...e,fields:[],customSchemas:(o=e.customSchemas)==null?void 0:o.map(_=>{var i;return{..._,fields:(i=_.fields)==null?void 0:i.map(a=>O(e.fields[a],e.fields))}})},n=[];if(e.fields.forEach(_=>{_.root&&n.push(O(_,e.fields))}),e.fields.length>0&&n.length===0)throw new Error("Failed to map ThemeVersionConfiguration GraphQL type to Resource type. Please ensure you've selected the `root` field on ThemeConfigurationSchemaField");return t.fields=n,t}function Me(e){return{...e,configurationSchema:le(e.configurationSchema)}}function Z(e,t){const n={...e,listValues:void 0,objectValues:void 0};return e.listValues!==void 0&&e.listValues!==null&&(n.listValues=e.listValues.map(o=>Z(t[o],t))),e.objectValues!==void 0&&e.objectValues!==null&&(n.objectValues=e.objectValues.map(o=>Z(t[o],t))),n}function Re(e){const t={...e,fields:[]},n=[];if(e.fields.forEach(o=>{o.root&&n.push(Z(o,e.fields))}),e.fields.length>0&&n.length===0)throw new Error("Failed to map ThemeInstallConfiguration GraphQL type to Resource type. Please ensure you've selected the `root` field on ThemeInstallConfigurationField");return t.fields=n,t}var T,f,ce,j,fe,de,J,N={},pe=[],Le=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function he(e){var t=e.parentNode;t&&t.removeChild(e)}function Ae(e,t,n){var o,_,i,a={};for(i in t)i=="key"?o=t[i]:i=="ref"?_=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?T.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return I(e,a,o,_,null)}function I(e,t,n,o,_){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:_??++ce,__i:-1,__u:0};return _==null&&f.vnode!=null&&f.vnode(i),i}function H(e){return e.children}function F(e,t){this.props=e,this.context=t}function $(e,t){if(t==null)return e.__?$(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?$(e):null}function me(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return me(e)}}function ve(e){(!e.__d&&(e.__d=!0)&&j.push(e)&&!M.__r++||fe!==f.debounceRendering)&&((fe=f.debounceRendering)||de)(M)}function M(){var e,t,n,o,_,i,a,u,l;for(j.sort(J);e=j.shift();)e.__d&&(t=j.length,o=void 0,i=(_=(n=e).__v).__e,u=[],l=[],(a=n.__P)&&((o=w({},_)).__v=_.__v+1,f.vnode&&f.vnode(o),q(a,o,_,n.__n,a.ownerSVGElement!==void 0,32&_.__u?[i]:null,u,i??$(_),!!(32&_.__u),l),o.__.__k[o.__i]=o,Se(u,o,l),o.__e!=i&&me(o)),j.length>t&&j.sort(J));M.__r=0}function ge(e,t,n,o,_,i,a,u,l,s,d){var r,h,c,g,S,y=o&&o.__k||pe,m=t.length;for(n.__d=l,Ue(n,t,y),l=n.__d,r=0;r<m;r++)(c=n.__k[r])!=null&&typeof c!="boolean"&&typeof c!="function"&&(h=c.__i===-1?N:y[c.__i]||N,c.__i=r,q(e,c,h,_,i,a,u,l,s,d),g=c.__e,c.ref&&h.ref!=c.ref&&(h.ref&&K(h.ref,null,c),d.push(c.ref,c.__c||g,c)),S==null&&g!=null&&(S=g),65536&c.__u||h.__k===c.__k?l=ye(c,l,e):typeof c.type=="function"&&c.__d!==void 0?l=c.__d:g&&(l=g.nextSibling),c.__d=void 0,c.__u&=-196609);n.__d=l,n.__e=S}function Ue(e,t,n){var o,_,i,a,u,l=t.length,s=n.length,d=s,r=0;for(e.__k=[],o=0;o<l;o++)(_=e.__k[o]=(_=t[o])==null||typeof _=="boolean"||typeof _=="function"?null:typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?I(null,_,null,null,_):Y(_)?I(H,{children:_},null,null,null):_.constructor===void 0&&_.__b>0?I(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)!=null?(_.__=e,_.__b=e.__b+1,u=We(_,n,a=o+r,d),_.__i=u,i=null,u!==-1&&(d--,(i=n[u])&&(i.__u|=131072)),i==null||i.__v===null?(u==-1&&r--,typeof _.type!="function"&&(_.__u|=65536)):u!==a&&(u===a+1?r++:u>a?d>l-a?r+=u-a:r--:r=u<a&&u==a-1?u-a:0,u!==o+r&&(_.__u|=65536))):(i=n[o])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=$(i)),X(i,i,!1),n[o]=null,d--);if(d)for(o=0;o<s;o++)(i=n[o])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=$(i)),X(i,i))}function ye(e,t,n){var o,_;if(typeof e.type=="function"){for(o=e.__k,_=0;o&&_<o.length;_++)o[_]&&(o[_].__=e,t=ye(o[_],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function We(e,t,n,o){var _=e.key,i=e.type,a=n-1,u=n+1,l=t[n];if(l===null||l&&_==l.key&&i===l.type)return n;if(o>(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||u<t.length;){if(a>=0){if((l=t[a])&&!(131072&l.__u)&&_==l.key&&i===l.type)return a;a--}if(u<t.length){if((l=t[u])&&!(131072&l.__u)&&_==l.key&&i===l.type)return u;u++}}return-1}function be(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Le.test(t)?n:n+"px"}function R(e,t,n,o,_){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||be(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||be(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=Date.now(),e.addEventListener(t,i?Ce:ke,i)):e.removeEventListener(t,i?Ce:ke,i);else{if(_)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function ke(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(f.event?f.event(e):e)}function Ce(e){return this.l[e.type+!0](f.event?f.event(e):e)}function q(e,t,n,o,_,i,a,u,l,s){var d,r,h,c,g,S,y,m,b,x,G,V,Ie,Q,oe,C=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),i=[u=t.__e=n.__e]),(d=f.__b)&&d(t);e:if(typeof C=="function")try{if(m=t.props,b=(d=C.contextType)&&o[d.__c],x=d?b?b.props.value:d.__:o,n.__c?y=(r=t.__c=n.__c).__=r.__E:("prototype"in C&&C.prototype.render?t.__c=r=new C(m,x):(t.__c=r=new F(m,x),r.constructor=C,r.render=Qe),b&&b.sub(r),r.props=m,r.state||(r.state={}),r.context=x,r.__n=o,h=r.__d=!0,r.__h=[],r._sb=[]),r.__s==null&&(r.__s=r.state),C.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=w({},r.__s)),w(r.__s,C.getDerivedStateFromProps(m,r.__s))),c=r.props,g=r.state,r.__v=t,h)C.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(C.getDerivedStateFromProps==null&&m!==c&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(m,x),!r.__e&&(r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(m,r.__s,x)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(r.props=m,r.state=r.__s,r.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(B){B&&(B.__=t)}),G=0;G<r._sb.length;G++)r.__h.push(r._sb[G]);r._sb=[],r.__h.length&&a.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(m,r.__s,x),r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(c,g,S)})}if(r.context=x,r.props=m,r.__P=e,r.__e=!1,V=f.__r,Ie=0,"prototype"in C&&C.prototype.render){for(r.state=r.__s,r.__d=!1,V&&V(t),d=r.render(r.props,r.state,r.context),Q=0;Q<r._sb.length;Q++)r.__h.push(r._sb[Q]);r._sb=[]}else do r.__d=!1,V&&V(t),d=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++Ie<25);r.state=r.__s,r.getChildContext!=null&&(o=w(w({},o),r.getChildContext())),h||r.getSnapshotBeforeUpdate==null||(S=r.getSnapshotBeforeUpdate(c,g)),ge(e,Y(oe=d!=null&&d.type===H&&d.key==null?d.props.children:d)?oe:[oe],t,n,o,_,i,a,u,l,s),r.base=t.__e,t.__u&=-161,r.__h.length&&a.push(r),y&&(r.__E=r.__=null)}catch(B){t.__v=null,l||i!=null?(t.__e=u,t.__u|=l?160:32,i[i.indexOf(u)]=null):(t.__e=n.__e,t.__k=n.__k),f.__e(B,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ge(n.__e,t,n,o,_,i,a,l,s);(d=f.diffed)&&d(t)}function Se(e,t,n){t.__d=void 0;for(var o=0;o<n.length;o++)K(n[o],n[++o],n[++o]);f.__c&&f.__c(t,e),e.some(function(_){try{e=_.__h,_.__h=[],e.some(function(i){i.call(_)})}catch(i){f.__e(i,_.__v)}})}function Ge(e,t,n,o,_,i,a,u,l){var s,d,r,h,c,g,S,y=n.props,m=t.props,b=t.type;if(b==="svg"&&(_=!0),i!=null){for(s=0;s<i.length;s++)if((c=i[s])&&"setAttribute"in c==!!b&&(b?c.localName===b:c.nodeType===3)){e=c,i[s]=null;break}}if(e==null){if(b===null)return document.createTextNode(m);e=_?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,m.is&&m),i=null,u=!1}if(b===null)y===m||u&&e.data===m||(e.data=m);else{if(i=i&&T.call(e.childNodes),y=n.props||N,!u&&i!=null)for(y={},s=0;s<e.attributes.length;s++)y[(c=e.attributes[s]).name]=c.value;for(s in y)c=y[s],s=="children"||(s=="dangerouslySetInnerHTML"?r=c:s==="key"||s in m||R(e,s,null,c,_));for(s in m)c=m[s],s=="children"?h=c:s=="dangerouslySetInnerHTML"?d=c:s=="value"?g=c:s=="checked"?S=c:s==="key"||u&&typeof c!="function"||y[s]===c||R(e,s,c,y[s],_);if(d)u||r&&(d.__html===r.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(r&&(e.innerHTML=""),ge(e,Y(h)?h:[h],t,n,o,_&&b!=="foreignObject",i,a,i?i[0]:n.__k&&$(n,0),u,l),i!=null)for(s=i.length;s--;)i[s]!=null&&he(i[s]);u||(s="value",g!==void 0&&(g!==e[s]||b==="progress"&&!g||b==="option"&&g!==y[s])&&R(e,s,g,y[s],!1),s="checked",S!==void 0&&S!==e[s]&&R(e,s,S,y[s],!1))}return e}function K(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(o){f.__e(o,n)}}function X(e,t,n){var o,_;if(f.unmount&&f.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||K(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){f.__e(i,t)}o.base=o.__P=null,e.__c=void 0}if(o=e.__k)for(_=0;_<o.length;_++)o[_]&&X(o[_],t,n||typeof e.type!="function");n||e.__e==null||he(e.__e),e.__=e.__e=e.__d=void 0}function Qe(e,t,n){return this.constructor(e,n)}function Be(e,t,n){var o,_,i,a;f.__&&f.__(e,t),_=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],a=[],q(t,e=(!o&&n||t).__k=Ae(H,null,[e]),_||N,N,t.ownerSVGElement!==void 0,!o&&n?[n]:_?null:t.firstChild?T.call(t.childNodes):null,i,!o&&n?n:_?_.__e:t.firstChild,o,a),Se(i,e,a)}T=pe.slice,f={__e:function(e,t,n,o){for(var _,i,a;t=t.__;)if((_=t.__c)&&!_.__)try{if((i=_.constructor)&&i.getDerivedStateFromError!=null&&(_.setState(i.getDerivedStateFromError(e)),a=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(e,o||{}),a=_.__d),a)return _.__E=_}catch(u){e=u}throw e}},ce=0,F.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},n),this.props)),e&&w(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ve(this))},F.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ve(this))},F.prototype.render=H,j=[],de=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(e,t){return e.__v.__b-t.__v.__b},M.__r=0;var L,v,ee,Ee,te=0,we=[],A=[],xe=f.__b,Pe=f.__r,je=f.diffed,$e=f.__c,Ne=f.unmount;function Ve(e,t){f.__h&&f.__h(v,e,te||t),te=0;var n=v.__H||(v.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:A}),n.__[e]}function ze(e){return te=1,Ze(Oe,e)}function Ze(e,t,n){var o=Ve(L++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Oe(void 0,t),function(u){var l=o.__N?o.__N[0]:o.__[0],s=o.t(l,u);l!==s&&(o.__N=[s,o.__[1]],o.__c.setState({}))}],o.__c=v,!v.u)){var _=function(u,l,s){if(!o.__c.__H)return!0;var d=o.__c.__H.__.filter(function(h){return h.__c});if(d.every(function(h){return!h.__N}))return!i||i.call(this,u,l,s);var r=!1;return d.forEach(function(h){if(h.__N){var c=h.__[0];h.__=h.__N,h.__N=void 0,c!==h.__[0]&&(r=!0)}}),!(!r&&o.__c.props===u)&&(!i||i.call(this,u,l,s))};v.u=!0;var i=v.shouldComponentUpdate,a=v.componentWillUpdate;v.componentWillUpdate=function(u,l,s){if(this.__e){var d=i;i=void 0,_(u,l,s),i=d}a&&a.call(this,u,l,s)},v.shouldComponentUpdate=_}return o.__N||o.__}function Je(e,t){var n=Ve(L++,3);!f.__s&&Ke(n.__H,t)&&(n.__=e,n.i=t,v.__H.__h.push(n))}function Ye(){for(var e;e=we.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(U),e.__H.__h.forEach(ne),e.__H.__h=[]}catch(t){e.__H.__h=[],f.__e(t,e.__v)}}f.__b=function(e){v=null,xe&&xe(e)},f.__r=function(e){Pe&&Pe(e),L=0;var t=(v=e.__c).__H;t&&(ee===v?(t.__h=[],v.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=A,n.__N=n.i=void 0})):(t.__h.forEach(U),t.__h.forEach(ne),t.__h=[],L=0)),ee=v},f.diffed=function(e){je&&je(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(we.push(t)!==1&&Ee===f.requestAnimationFrame||((Ee=f.requestAnimationFrame)||qe)(Ye)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==A&&(n.__=n.__V),n.i=void 0,n.__V=A})),ee=v=null},f.__c=function(e,t){t.some(function(n){try{n.__h.forEach(U),n.__h=n.__h.filter(function(o){return!o.__||ne(o)})}catch(o){t.some(function(_){_.__h&&(_.__h=[])}),t=[],f.__e(o,n.__v)}}),$e&&$e(e,t)},f.unmount=function(e){Ne&&Ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{U(o)}catch(_){t=_}}),n.__H=void 0,t&&f.__e(t,n.__v))};var De=typeof requestAnimationFrame=="function";function qe(e){var t,n=function(){clearTimeout(o),De&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);De&&(t=requestAnimationFrame(n))}function U(e){var t=v,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),v=t}function ne(e){var t=v;e.__c=e.__(),v=t}function Ke(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Oe(e,t){return typeof t=="function"?t(e):t}var Xe=0;function Te(e,t,n,o,_,i){var a,u,l={};for(u in t)u=="ref"?a=t[u]:l[u]=t[u];var s={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Xe,__i:-1,__u:0,__source:_,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(u in a)l[u]===void 0&&(l[u]=a[u]);return f.vnode&&f.vnode(s),s}class et{constructor(){_e(this,"_context");_e(this,"_getContextCallbacks",[])}async getContext(){return this._context?this._context:new Promise(t=>{this._getContextCallbacks.push(t)})}setContext(t){this._context=t,this._getContextCallbacks.forEach(n=>n(t)),this._getContextCallbacks=[]}configureClient(t){console.log("Client configured")}themeLoaded(){console.log("Theme loaded")}close(){console.log("Theme closed")}addToEcommerceCart(t){console.log("Add to cart",t)}completeQuote(){console.log("Complete quote")}navigateToCustomerPortal(){console.log("Navigating to customer portal")}}let W;const tt=({context:e})=>{const[t,n]=ze(null);return Je(()=>{if(t){if(W===void 0)throw new Error("Please call setSpiffDevOptions before requesting the context.");W.setContext({...e,container:t})}},[t,e]),Te("div",{ref:n,id:"spiffThemeWrapper"})};function nt(e,t){W=new et,window.SpiffThemeLoader=W;let n;typeof e=="string"?n=document.getElementById(e):n=e,Be(Te(tt,{context:t}),n)}function ot(e){return{id:"example",themeInstallId:(e==null?void 0:e.themeInstallId)??"example",name:"Example Configuration",createdAt:"2021-01-01T00:00:00Z",updatedAt:"2021-01-01T00:00:00Z",themeVersion:{id:"example",version:"1.0.0",createdAt:"2021-01-01T00:00:00Z",updatedAt:"2021-01-01T00:00:00Z",configurationSchema:{fields:[]},launchData:{targetFiles:[]},theme:{id:"example",name:"Example Theme",createdAt:"2021-01-01T00:00:00Z",updatedAt:"2021-01-01T00:00:00Z"}},fields:[],...e}}const _t=e=>{if(Object.keys(e).includes("defaultValue"))return e.defaultValue};function rt(e,...t){return e.fields.filter(n=>!n.key||!t.includes(n.key)).map(n=>({key:n.key,fallbackToDefaultConfiguration:!1,value:_t(n),type:n.type,asset:void 0}))}const it={name:"@spiffcommerce/theme-bridge",version:"1.21.1",type:"module",scripts:{build:"tsc && vite build",preview:"vite preview",dev:"ladle serve",schema:"node --no-warnings=ExperimentalWarning --loader ts-node/esm scripts/generateSchema.ts"},main:"./dist/index.umd.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["./dist"],exports:{import:"./dist/index.js",require:"./dist/index.umd.cjs"},dependencies:{},devDependencies:{"@ladle/react":"^4.0.2","@preact/preset-vite":"^2.7.0","@spiffcommerce/core":"^21.0.1","@types/node":"^20.11.16","@typescript-eslint/eslint-plugin":"^7.1.0","@typescript-eslint/parser":"^7.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3",preact:"^10.19.3",prettier:"^3.2.4",rollup:"^4.12.0","ts-json-schema-generator":"^1.5.0","ts-node":"^10.9.2",tsup:"^8.0.1",typescript:"^5.2.2",vite:"^5.0.8","vite-plugin-css-injected-by-js":"^3.4.0","vite-plugin-externalize-deps":"^0.8.0"},peerDependencies:{"@spiffcommerce/core":"^21.0.1"},packageManager:"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"};function st(e,t,n){if(t.type==="chunk"){if(console.log(`chunk ${e} isEntry: ${t.isEntry}, isDynamicEntry: ${t.isDynamicEntry}, isImplicitEntry: ${t.isImplicitEntry}`),!t.isEntry&&!n)return null;if(!t.isDynamicEntry)return{type:D.Javascript,mimeType:"text/javascript",preload:!t.isEntry,filename:e}}else if(e.endsWith(".css"))return{type:D.CSS,mimeType:"text/css",filename:e};return null}function ut(e){const{autoGenerateTargetFiles:t=!0,configurationSchema:n,includePreloadChunks:o=!1,targetFiles:_}=e??{};return{name:"spiff-theme-plugin",version:it.version,config(i,a){i.base!==void 0&&i.base!==""&&console.warn('You have specified a `base` in your vite configuration other than "". This value will now be overwritten.'),i.base=""},writeBundle(i,a){const u=t?Object.keys(a).map(s=>_!=null&&_.some(d=>d.filename===s)?null:st(s,a[s],o)).filter(s=>s!==null):[];_&&u.push(..._);const l={launchData:{targetFiles:u},configurationSchema:n};k.writeFileSync(P.join(i.dir,"spiffTheme.json"),JSON.stringify(l,void 0,4))}}}p.AssetType=re,p.ConversionDataType=ue,p.ConversionLocation=se,p.CustomSchemaType=ie,p.FieldType=E,p.ThemeFileType=D,p.exampleThemeInstallConfig=ot,p.getDefaultsForSchema=rt,p.setSpiffDevOptions=nt,p.spiffThemePlugin=ut,p.themeInstallConfigurationFieldsToRecordObject=He,p.themeInstallConfigurationGraphQlToResource=Re,p.themeInstallConfigurationToRecordObject=Fe,p.themeVersionConfigurationGraphQlToResource=le,p.themeVersionGraphQlToResource=Me,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/theme-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc && vite build",
|
|
@@ -42,5 +42,6 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@spiffcommerce/core": "^21.0.1"
|
|
45
|
-
}
|
|
45
|
+
},
|
|
46
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
46
47
|
}
|