@spiffcommerce/theme-bridge 1.10.5 → 1.10.6
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 +4 -1
- package/dist/index.js +397 -319
- package/dist/index.umd.cjs +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DesignCreationMessage, SpiffCommerceClient } from '@spiffcommerce/core';
|
|
2
|
+
import { OutputPlugin } from 'rollup';
|
|
2
3
|
|
|
3
4
|
interface ThemeConfigurationFile {
|
|
4
5
|
/**
|
|
@@ -297,4 +298,6 @@ type SpiffDevOptions = Omit<ThemeContextTransaction, "container"> | Omit<ThemeCo
|
|
|
297
298
|
declare function setSpiffDevOptions(container: HTMLElement | string, context: SpiffDevOptions): void;
|
|
298
299
|
declare function exampleThemeInstallConfig(opts?: Partial<ThemeInstallConfigurationResource>): ThemeInstallConfigurationResource;
|
|
299
300
|
|
|
300
|
-
|
|
301
|
+
declare function spiffThemePlugin(configSchema?: ThemeConfigurationSchema): OutputPlugin;
|
|
302
|
+
|
|
303
|
+
export { type AssetResource, AssetType, type BundleDesignCreationMessage, type DesignCreationMessageWithQuantity, FieldType, type SpiffDevOptions, type SpiffThemeLoader, type ThemeConfigurationFile, type ThemeConfigurationLaunchData, type ThemeConfigurationLaunchDataTargetFile, type ThemeConfigurationSchema, type ThemeConfigurationSchemaField, type ThemeConfigurationSchemaFieldResource, type ThemeConfigurationSchemaResource, type ThemeContext, type ThemeContextBundle, type ThemeContextBundleOptions, type ThemeContextBundleOptionsExisting, type ThemeContextBundleOptionsNew, type ThemeContextTransaction, type ThemeContextWorkflowOptions, type ThemeContextWorkflowOptionsExternalProduct, type ThemeContextWorkflowOptionsIntegrationProduct, type ThemeContextWorkflowOptionsTransaction, ThemeFileType, type ThemeInstallConfigurationField, type ThemeInstallConfigurationResource, type ThemeLaunchDataResource, type ThemeLaunchDataTargetFileResource, type ThemeResource, type ThemeVersionResource, exampleThemeInstallConfig, setSpiffDevOptions, spiffThemePlugin };
|
package/dist/index.js
CHANGED
|
@@ -1,426 +1,428 @@
|
|
|
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
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
2
|
+
var Ce = Object.defineProperty;
|
|
3
|
+
var Se = (e, _, t) => _ in e ? Ce(e, _, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[_] = t;
|
|
4
|
+
var B = (e, _, t) => (Se(e, typeof _ != "symbol" ? _ + "" : _, t), t);
|
|
5
|
+
import we from "fs";
|
|
6
|
+
import Ee from "path";
|
|
7
|
+
var O = /* @__PURE__ */ ((e) => (e.Javascript = "Javascript", e.CSS = "CSS", e))(O || {}), He = /* @__PURE__ */ ((e) => (e.Asset = "Asset", e.Boolean = "Boolean", e.Color = "Color", e.Heading = "Heading", e.Number = "Number", e.Select = "Select", e.Text = "Text", e))(He || {}), $e = /* @__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))($e || {}), A, f, ae, S, Y, fe, Z, H = {}, pe = [], Pe = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, G = Array.isArray;
|
|
8
|
+
function C(e, _) {
|
|
9
|
+
for (var t in _)
|
|
10
|
+
e[t] = _[t];
|
|
11
|
+
return e;
|
|
12
|
+
}
|
|
13
|
+
function de(e) {
|
|
14
|
+
var _ = e.parentNode;
|
|
15
|
+
_ && _.removeChild(e);
|
|
16
|
+
}
|
|
17
|
+
function De(e, _, t) {
|
|
18
|
+
var n, o, i, c = {};
|
|
19
|
+
for (i in _)
|
|
20
|
+
i == "key" ? n = _[i] : i == "ref" ? o = _[i] : c[i] = _[i];
|
|
21
|
+
if (arguments.length > 2 && (c.children = arguments.length > 3 ? A.call(arguments, 2) : t), typeof e == "function" && e.defaultProps != null)
|
|
22
|
+
for (i in e.defaultProps)
|
|
23
|
+
c[i] === void 0 && (c[i] = e.defaultProps[i]);
|
|
24
|
+
return T(e, c, n, o, null);
|
|
25
|
+
}
|
|
26
|
+
function T(e, _, t, n, o) {
|
|
27
|
+
var i = { type: e, props: _, key: t, ref: n, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: o ?? ++ae, __i: -1, __u: 0 };
|
|
28
|
+
return o == null && f.vnode != null && f.vnode(i), i;
|
|
29
|
+
}
|
|
30
|
+
function F(e) {
|
|
31
|
+
return e.children;
|
|
32
|
+
}
|
|
33
|
+
function I(e, _) {
|
|
34
|
+
this.props = e, this.context = _;
|
|
35
|
+
}
|
|
36
|
+
function w(e, _) {
|
|
37
|
+
if (_ == null)
|
|
38
|
+
return e.__ ? w(e.__, e.__i + 1) : null;
|
|
39
|
+
for (var t; _ < e.__k.length; _++)
|
|
40
|
+
if ((t = e.__k[_]) != null && t.__e != null)
|
|
39
41
|
return t.__e;
|
|
40
|
-
return typeof
|
|
41
|
-
}
|
|
42
|
-
function
|
|
43
|
-
var
|
|
44
|
-
if ((
|
|
45
|
-
for (
|
|
46
|
-
if ((t =
|
|
47
|
-
|
|
42
|
+
return typeof e.type == "function" ? w(e) : null;
|
|
43
|
+
}
|
|
44
|
+
function he(e) {
|
|
45
|
+
var _, t;
|
|
46
|
+
if ((e = e.__) != null && e.__c != null) {
|
|
47
|
+
for (e.__e = e.__c.base = null, _ = 0; _ < e.__k.length; _++)
|
|
48
|
+
if ((t = e.__k[_]) != null && t.__e != null) {
|
|
49
|
+
e.__e = e.__c.base = t.__e;
|
|
48
50
|
break;
|
|
49
51
|
}
|
|
50
|
-
return
|
|
52
|
+
return he(e);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
|
-
function
|
|
54
|
-
(!
|
|
55
|
-
}
|
|
56
|
-
function
|
|
57
|
-
var
|
|
58
|
-
for (S.sort(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
function
|
|
63
|
-
var
|
|
64
|
-
for (t.__d =
|
|
65
|
-
(a = t.__k[
|
|
66
|
-
t.__d =
|
|
67
|
-
}
|
|
68
|
-
function
|
|
69
|
-
var n,
|
|
70
|
-
for (
|
|
71
|
-
(
|
|
72
|
-
if (
|
|
73
|
-
for (n = 0; n <
|
|
74
|
-
(i = t[n]) != null && !(131072 & i.__u) && (i.__e ==
|
|
75
|
-
}
|
|
76
|
-
function
|
|
77
|
-
var n,
|
|
78
|
-
if (typeof
|
|
79
|
-
for (n =
|
|
80
|
-
n[
|
|
81
|
-
return
|
|
55
|
+
function ee(e) {
|
|
56
|
+
(!e.__d && (e.__d = !0) && S.push(e) && !L.__r++ || Y !== f.debounceRendering) && ((Y = f.debounceRendering) || fe)(L);
|
|
57
|
+
}
|
|
58
|
+
function L() {
|
|
59
|
+
var e, _, t, n, o, i, c, l, u;
|
|
60
|
+
for (S.sort(Z); e = S.shift(); )
|
|
61
|
+
e.__d && (_ = S.length, n = void 0, i = (o = (t = e).__v).__e, l = [], u = [], (c = t.__P) && ((n = C({}, o)).__v = o.__v + 1, f.vnode && f.vnode(n), K(c, n, o, t.__n, c.ownerSVGElement !== void 0, 32 & o.__u ? [i] : null, l, i ?? w(o), !!(32 & o.__u), u), n.__.__k[n.__i] = n, ge(l, n, u), n.__e != i && he(n)), S.length > _ && S.sort(Z));
|
|
62
|
+
L.__r = 0;
|
|
63
|
+
}
|
|
64
|
+
function ve(e, _, t, n, o, i, c, l, u, s, p) {
|
|
65
|
+
var r, d, a, m, k, g = n && n.__k || pe, h = _.length;
|
|
66
|
+
for (t.__d = u, Ne(t, _, g), u = t.__d, r = 0; r < h; r++)
|
|
67
|
+
(a = t.__k[r]) != null && typeof a != "boolean" && typeof a != "function" && (d = a.__i === -1 ? H : g[a.__i] || H, a.__i = r, K(e, a, d, o, i, c, l, u, s, p), m = a.__e, a.ref && d.ref != a.ref && (d.ref && Q(d.ref, null, a), p.push(a.ref, a.__c || m, a)), k == null && m != null && (k = m), 65536 & a.__u || d.__k === a.__k ? u = me(a, u, e) : typeof a.type == "function" && a.__d !== void 0 ? u = a.__d : m && (u = m.nextSibling), a.__d = void 0, a.__u &= -196609);
|
|
68
|
+
t.__d = u, t.__e = k;
|
|
69
|
+
}
|
|
70
|
+
function Ne(e, _, t) {
|
|
71
|
+
var n, o, i, c, l, u = _.length, s = t.length, p = s, r = 0;
|
|
72
|
+
for (e.__k = [], n = 0; n < u; n++)
|
|
73
|
+
(o = e.__k[n] = (o = _[n]) == null || typeof o == "boolean" || typeof o == "function" ? null : typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? T(null, o, null, null, o) : G(o) ? T(F, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? T(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o) != null ? (o.__ = e, o.__b = e.__b + 1, l = Te(o, t, c = n + r, p), o.__i = l, i = null, l !== -1 && (p--, (i = t[l]) && (i.__u |= 131072)), i == null || i.__v === null ? (l == -1 && r--, typeof o.type != "function" && (o.__u |= 65536)) : l !== c && (l === c + 1 ? r++ : l > c ? p > u - c ? r += l - c : r-- : r = l < c && l == c - 1 ? l - c : 0, l !== n + r && (o.__u |= 65536))) : (i = t[n]) && i.key == null && i.__e && (i.__e == e.__d && (e.__d = w(i)), z(i, i, !1), t[n] = null, p--);
|
|
74
|
+
if (p)
|
|
75
|
+
for (n = 0; n < s; n++)
|
|
76
|
+
(i = t[n]) != null && !(131072 & i.__u) && (i.__e == e.__d && (e.__d = w(i)), z(i, i));
|
|
77
|
+
}
|
|
78
|
+
function me(e, _, t) {
|
|
79
|
+
var n, o;
|
|
80
|
+
if (typeof e.type == "function") {
|
|
81
|
+
for (n = e.__k, o = 0; n && o < n.length; o++)
|
|
82
|
+
n[o] && (n[o].__ = e, _ = me(n[o], _, t));
|
|
83
|
+
return _;
|
|
82
84
|
}
|
|
83
|
-
return
|
|
85
|
+
return e.__e != _ && (t.insertBefore(e.__e, _ || null), _ = e.__e), _ && _.nextSibling;
|
|
84
86
|
}
|
|
85
|
-
function
|
|
86
|
-
var
|
|
87
|
-
if (
|
|
87
|
+
function Te(e, _, t, n) {
|
|
88
|
+
var o = e.key, i = e.type, c = t - 1, l = t + 1, u = _[t];
|
|
89
|
+
if (u === null || u && o == u.key && i === u.type)
|
|
88
90
|
return t;
|
|
89
|
-
if (n > (
|
|
90
|
-
for (; c >= 0 || l <
|
|
91
|
+
if (n > (u != null && !(131072 & u.__u) ? 1 : 0))
|
|
92
|
+
for (; c >= 0 || l < _.length; ) {
|
|
91
93
|
if (c >= 0) {
|
|
92
|
-
if ((
|
|
94
|
+
if ((u = _[c]) && !(131072 & u.__u) && o == u.key && i === u.type)
|
|
93
95
|
return c;
|
|
94
96
|
c--;
|
|
95
97
|
}
|
|
96
|
-
if (l <
|
|
97
|
-
if ((
|
|
98
|
+
if (l < _.length) {
|
|
99
|
+
if ((u = _[l]) && !(131072 & u.__u) && o == u.key && i === u.type)
|
|
98
100
|
return l;
|
|
99
101
|
l++;
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
return -1;
|
|
103
105
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
+
function _e(e, _, t) {
|
|
107
|
+
_[0] === "-" ? e.setProperty(_, t ?? "") : e[_] = t == null ? "" : typeof t != "number" || Pe.test(_) ? t : t + "px";
|
|
106
108
|
}
|
|
107
|
-
function N(
|
|
109
|
+
function N(e, _, t, n, o) {
|
|
108
110
|
var i;
|
|
109
|
-
|
|
110
|
-
if (
|
|
111
|
+
e:
|
|
112
|
+
if (_ === "style")
|
|
111
113
|
if (typeof t == "string")
|
|
112
|
-
|
|
114
|
+
e.style.cssText = t;
|
|
113
115
|
else {
|
|
114
|
-
if (typeof n == "string" && (
|
|
115
|
-
for (
|
|
116
|
-
t &&
|
|
116
|
+
if (typeof n == "string" && (e.style.cssText = n = ""), n)
|
|
117
|
+
for (_ in n)
|
|
118
|
+
t && _ in t || _e(e.style, _, "");
|
|
117
119
|
if (t)
|
|
118
|
-
for (
|
|
119
|
-
n && t[
|
|
120
|
+
for (_ in t)
|
|
121
|
+
n && t[_] === n[_] || _e(e.style, _, t[_]);
|
|
120
122
|
}
|
|
121
|
-
else if (
|
|
122
|
-
i =
|
|
123
|
+
else if (_[0] === "o" && _[1] === "n")
|
|
124
|
+
i = _ !== (_ = _.replace(/(PointerCapture)$|Capture$/, "$1")), _ = _.toLowerCase() in e ? _.toLowerCase().slice(2) : _.slice(2), e.l || (e.l = {}), e.l[_ + i] = t, t ? n ? t.u = n.u : (t.u = Date.now(), e.addEventListener(_, i ? ne : te, i)) : e.removeEventListener(_, i ? ne : te, i);
|
|
123
125
|
else {
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
else if (
|
|
126
|
+
if (o)
|
|
127
|
+
_ = _.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
128
|
+
else if (_ !== "width" && _ !== "height" && _ !== "href" && _ !== "list" && _ !== "form" && _ !== "tabIndex" && _ !== "download" && _ !== "rowSpan" && _ !== "colSpan" && _ !== "role" && _ in e)
|
|
127
129
|
try {
|
|
128
|
-
_
|
|
129
|
-
break
|
|
130
|
+
e[_] = t ?? "";
|
|
131
|
+
break e;
|
|
130
132
|
} catch {
|
|
131
133
|
}
|
|
132
|
-
typeof t == "function" || (t == null || t === !1 &&
|
|
134
|
+
typeof t == "function" || (t == null || t === !1 && _[4] !== "-" ? e.removeAttribute(_) : e.setAttribute(_, t));
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
|
-
function
|
|
136
|
-
var
|
|
137
|
-
if (
|
|
138
|
-
if (
|
|
137
|
+
function te(e) {
|
|
138
|
+
var _ = this.l[e.type + !1];
|
|
139
|
+
if (e.t) {
|
|
140
|
+
if (e.t <= _.u)
|
|
139
141
|
return;
|
|
140
142
|
} else
|
|
141
|
-
|
|
142
|
-
return
|
|
143
|
+
e.t = Date.now();
|
|
144
|
+
return _(f.event ? f.event(e) : e);
|
|
143
145
|
}
|
|
144
|
-
function
|
|
145
|
-
return this.l[
|
|
146
|
+
function ne(e) {
|
|
147
|
+
return this.l[e.type + !0](f.event ? f.event(e) : e);
|
|
146
148
|
}
|
|
147
|
-
function
|
|
148
|
-
var
|
|
149
|
-
if (
|
|
149
|
+
function K(e, _, t, n, o, i, c, l, u, s) {
|
|
150
|
+
var p, r, d, a, m, k, g, h, y, x, $, E, X, P, V, b = _.type;
|
|
151
|
+
if (_.constructor !== void 0)
|
|
150
152
|
return null;
|
|
151
|
-
128 & t.__u && (
|
|
152
|
-
|
|
153
|
+
128 & t.__u && (u = !!(32 & t.__u), i = [l = _.__e = t.__e]), (p = f.__b) && p(_);
|
|
154
|
+
e:
|
|
153
155
|
if (typeof b == "function")
|
|
154
156
|
try {
|
|
155
|
-
if (h =
|
|
156
|
-
b.getDerivedStateFromProps == null &&
|
|
157
|
+
if (h = _.props, y = (p = b.contextType) && n[p.__c], x = p ? y ? y.props.value : p.__ : n, t.__c ? g = (r = _.__c = t.__c).__ = r.__E : ("prototype" in b && b.prototype.render ? _.__c = r = new b(h, x) : (_.__c = r = new I(h, x), r.constructor = b, r.render = je), y && y.sub(r), r.props = h, r.state || (r.state = {}), r.context = x, r.__n = 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 = C({}, r.__s)), C(r.__s, b.getDerivedStateFromProps(h, r.__s))), a = r.props, m = r.state, r.__v = _, d)
|
|
158
|
+
b.getDerivedStateFromProps == null && r.componentWillMount != null && r.componentWillMount(), r.componentDidMount != null && r.__h.push(r.componentDidMount);
|
|
157
159
|
else {
|
|
158
|
-
if (b.getDerivedStateFromProps == null && h !== a &&
|
|
159
|
-
for (
|
|
160
|
-
D && (D.__ =
|
|
161
|
-
}), $ = 0; $ <
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
break
|
|
160
|
+
if (b.getDerivedStateFromProps == null && h !== a && r.componentWillReceiveProps != null && r.componentWillReceiveProps(h, x), !r.__e && (r.shouldComponentUpdate != null && r.shouldComponentUpdate(h, r.__s, x) === !1 || _.__v === t.__v)) {
|
|
161
|
+
for (_.__v !== t.__v && (r.props = h, r.state = r.__s, r.__d = !1), _.__e = t.__e, _.__k = t.__k, _.__k.forEach(function(D) {
|
|
162
|
+
D && (D.__ = _);
|
|
163
|
+
}), $ = 0; $ < r._sb.length; $++)
|
|
164
|
+
r.__h.push(r._sb[$]);
|
|
165
|
+
r._sb = [], r.__h.length && c.push(r);
|
|
166
|
+
break e;
|
|
165
167
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
r.componentWillUpdate != null && r.componentWillUpdate(h, r.__s, x), r.componentDidUpdate != null && r.__h.push(function() {
|
|
169
|
+
r.componentDidUpdate(a, m, k);
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
|
-
if (
|
|
171
|
-
for (
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
if (r.context = x, r.props = h, r.__P = e, r.__e = !1, E = f.__r, X = 0, "prototype" in b && b.prototype.render) {
|
|
173
|
+
for (r.state = r.__s, r.__d = !1, E && E(_), p = r.render(r.props, r.state, r.context), P = 0; P < r._sb.length; P++)
|
|
174
|
+
r.__h.push(r._sb[P]);
|
|
175
|
+
r._sb = [];
|
|
174
176
|
} else
|
|
175
177
|
do
|
|
176
|
-
|
|
177
|
-
while (
|
|
178
|
-
|
|
178
|
+
r.__d = !1, E && E(_), p = r.render(r.props, r.state, r.context), r.state = r.__s;
|
|
179
|
+
while (r.__d && ++X < 25);
|
|
180
|
+
r.state = r.__s, r.getChildContext != null && (n = C(C({}, n), r.getChildContext())), d || r.getSnapshotBeforeUpdate == null || (k = r.getSnapshotBeforeUpdate(a, m)), ve(e, G(V = p != null && p.type === F && p.key == null ? p.props.children : p) ? V : [V], _, t, n, o, i, c, l, u, s), r.base = _.__e, _.__u &= -161, r.__h.length && c.push(r), g && (r.__E = r.__ = null);
|
|
179
181
|
} catch (D) {
|
|
180
|
-
|
|
182
|
+
_.__v = null, u || i != null ? (_.__e = l, _.__u |= u ? 160 : 32, i[i.indexOf(l)] = null) : (_.__e = t.__e, _.__k = t.__k), f.__e(D, _, t);
|
|
181
183
|
}
|
|
182
184
|
else
|
|
183
|
-
i == null &&
|
|
184
|
-
(
|
|
185
|
+
i == null && _.__v === t.__v ? (_.__k = t.__k, _.__e = t.__e) : _.__e = Ie(t.__e, _, t, n, o, i, c, u, s);
|
|
186
|
+
(p = f.diffed) && p(_);
|
|
185
187
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
+
function ge(e, _, t) {
|
|
189
|
+
_.__d = void 0;
|
|
188
190
|
for (var n = 0; n < t.length; n++)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
+
Q(t[n], t[++n], t[++n]);
|
|
192
|
+
f.__c && f.__c(_, e), e.some(function(o) {
|
|
191
193
|
try {
|
|
192
|
-
|
|
193
|
-
i.call(
|
|
194
|
+
e = o.__h, o.__h = [], e.some(function(i) {
|
|
195
|
+
i.call(o);
|
|
194
196
|
});
|
|
195
197
|
} catch (i) {
|
|
196
|
-
|
|
198
|
+
f.__e(i, o.__v);
|
|
197
199
|
}
|
|
198
200
|
});
|
|
199
201
|
}
|
|
200
|
-
function
|
|
201
|
-
var
|
|
202
|
-
if (y === "svg" && (
|
|
203
|
-
for (
|
|
204
|
-
if ((a = i[
|
|
205
|
-
|
|
202
|
+
function Ie(e, _, t, n, o, i, c, l, u) {
|
|
203
|
+
var s, p, r, d, a, m, k, g = t.props, h = _.props, y = _.type;
|
|
204
|
+
if (y === "svg" && (o = !0), i != null) {
|
|
205
|
+
for (s = 0; s < i.length; s++)
|
|
206
|
+
if ((a = i[s]) && "setAttribute" in a == !!y && (y ? a.localName === y : a.nodeType === 3)) {
|
|
207
|
+
e = a, i[s] = null;
|
|
206
208
|
break;
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
|
-
if (
|
|
211
|
+
if (e == null) {
|
|
210
212
|
if (y === null)
|
|
211
213
|
return document.createTextNode(h);
|
|
212
|
-
|
|
214
|
+
e = o ? document.createElementNS("http://www.w3.org/2000/svg", y) : document.createElement(y, h.is && h), i = null, l = !1;
|
|
213
215
|
}
|
|
214
216
|
if (y === null)
|
|
215
|
-
g === h || l &&
|
|
217
|
+
g === h || l && e.data === h || (e.data = h);
|
|
216
218
|
else {
|
|
217
|
-
if (i = i &&
|
|
218
|
-
for (g = {},
|
|
219
|
-
g[(a =
|
|
220
|
-
for (
|
|
221
|
-
a = g[
|
|
222
|
-
for (
|
|
223
|
-
a = h[
|
|
224
|
-
if (
|
|
225
|
-
l ||
|
|
226
|
-
else if (
|
|
227
|
-
for (
|
|
228
|
-
i[
|
|
229
|
-
l || (
|
|
219
|
+
if (i = i && A.call(e.childNodes), g = t.props || H, !l && i != null)
|
|
220
|
+
for (g = {}, s = 0; s < e.attributes.length; s++)
|
|
221
|
+
g[(a = e.attributes[s]).name] = a.value;
|
|
222
|
+
for (s in g)
|
|
223
|
+
a = g[s], s == "children" || (s == "dangerouslySetInnerHTML" ? r = a : s === "key" || s in h || N(e, s, null, a, o));
|
|
224
|
+
for (s in h)
|
|
225
|
+
a = h[s], s == "children" ? d = a : s == "dangerouslySetInnerHTML" ? p = a : s == "value" ? m = a : s == "checked" ? k = a : s === "key" || l && typeof a != "function" || g[s] === a || N(e, s, a, g[s], o);
|
|
226
|
+
if (p)
|
|
227
|
+
l || r && (p.__html === r.__html || p.__html === e.innerHTML) || (e.innerHTML = p.__html), _.__k = [];
|
|
228
|
+
else if (r && (e.innerHTML = ""), ve(e, G(d) ? d : [d], _, t, n, o && y !== "foreignObject", i, c, i ? i[0] : t.__k && w(t, 0), l, u), i != null)
|
|
229
|
+
for (s = i.length; s--; )
|
|
230
|
+
i[s] != null && de(i[s]);
|
|
231
|
+
l || (s = "value", m !== void 0 && (m !== e[s] || y === "progress" && !m || y === "option" && m !== g[s]) && N(e, s, m, g[s], !1), s = "checked", k !== void 0 && k !== e[s] && N(e, s, k, g[s], !1));
|
|
230
232
|
}
|
|
231
|
-
return
|
|
233
|
+
return e;
|
|
232
234
|
}
|
|
233
|
-
function
|
|
235
|
+
function Q(e, _, t) {
|
|
234
236
|
try {
|
|
235
|
-
typeof
|
|
237
|
+
typeof e == "function" ? e(_) : e.current = _;
|
|
236
238
|
} catch (n) {
|
|
237
|
-
|
|
239
|
+
f.__e(n, t);
|
|
238
240
|
}
|
|
239
241
|
}
|
|
240
|
-
function
|
|
241
|
-
var n,
|
|
242
|
-
if (
|
|
242
|
+
function z(e, _, t) {
|
|
243
|
+
var n, o;
|
|
244
|
+
if (f.unmount && f.unmount(e), (n = e.ref) && (n.current && n.current !== e.__e || Q(n, null, _)), (n = e.__c) != null) {
|
|
243
245
|
if (n.componentWillUnmount)
|
|
244
246
|
try {
|
|
245
247
|
n.componentWillUnmount();
|
|
246
248
|
} catch (i) {
|
|
247
|
-
|
|
249
|
+
f.__e(i, _);
|
|
248
250
|
}
|
|
249
|
-
n.base = n.__P = null,
|
|
251
|
+
n.base = n.__P = null, e.__c = void 0;
|
|
250
252
|
}
|
|
251
|
-
if (n =
|
|
252
|
-
for (
|
|
253
|
-
n[
|
|
254
|
-
t ||
|
|
253
|
+
if (n = e.__k)
|
|
254
|
+
for (o = 0; o < n.length; o++)
|
|
255
|
+
n[o] && z(n[o], _, t || typeof e.type != "function");
|
|
256
|
+
t || e.__e == null || de(e.__e), e.__ = e.__e = e.__d = void 0;
|
|
255
257
|
}
|
|
256
|
-
function
|
|
257
|
-
return this.constructor(
|
|
258
|
+
function je(e, _, t) {
|
|
259
|
+
return this.constructor(e, t);
|
|
258
260
|
}
|
|
259
|
-
function
|
|
260
|
-
var n,
|
|
261
|
-
|
|
261
|
+
function Ue(e, _, t) {
|
|
262
|
+
var n, o, i, c;
|
|
263
|
+
f.__ && f.__(e, _), o = (n = typeof t == "function") ? null : t && t.__k || _.__k, i = [], c = [], K(_, e = (!n && t || _).__k = De(F, null, [e]), o || H, H, _.ownerSVGElement !== void 0, !n && t ? [t] : o ? null : _.firstChild ? A.call(_.childNodes) : null, i, !n && t ? t : o ? o.__e : _.firstChild, n, c), ge(i, e, c);
|
|
262
264
|
}
|
|
263
|
-
|
|
264
|
-
for (var
|
|
265
|
-
if ((
|
|
265
|
+
A = pe.slice, f = { __e: function(e, _, t, n) {
|
|
266
|
+
for (var o, i, c; _ = _.__; )
|
|
267
|
+
if ((o = _.__c) && !o.__)
|
|
266
268
|
try {
|
|
267
|
-
if ((i =
|
|
268
|
-
return
|
|
269
|
+
if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(e)), c = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, n || {}), c = o.__d), c)
|
|
270
|
+
return o.__E = o;
|
|
269
271
|
} catch (l) {
|
|
270
|
-
|
|
272
|
+
e = l;
|
|
271
273
|
}
|
|
272
|
-
throw
|
|
273
|
-
} },
|
|
274
|
+
throw e;
|
|
275
|
+
} }, ae = 0, I.prototype.setState = function(e, _) {
|
|
274
276
|
var t;
|
|
275
|
-
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s =
|
|
276
|
-
},
|
|
277
|
-
this.__v && (this.__e = !0,
|
|
278
|
-
},
|
|
279
|
-
return
|
|
280
|
-
},
|
|
281
|
-
var
|
|
282
|
-
function
|
|
283
|
-
|
|
277
|
+
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = C({}, this.state), typeof e == "function" && (e = e(C({}, t), this.props)), e && C(t, e), e != null && this.__v && (_ && this._sb.push(_), ee(this));
|
|
278
|
+
}, I.prototype.forceUpdate = function(e) {
|
|
279
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), ee(this));
|
|
280
|
+
}, I.prototype.render = F, S = [], fe = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Z = function(e, _) {
|
|
281
|
+
return e.__v.__b - _.__v.__b;
|
|
282
|
+
}, L.__r = 0;
|
|
283
|
+
var M, v, q, oe, J = 0, ye = [], j = [], re = f.__b, ie = f.__r, le = f.diffed, se = f.__c, ce = f.unmount;
|
|
284
|
+
function be(e, _) {
|
|
285
|
+
f.__h && f.__h(v, e, J || _), J = 0;
|
|
284
286
|
var t = v.__H || (v.__H = { __: [], __h: [] });
|
|
285
|
-
return
|
|
287
|
+
return e >= t.__.length && t.__.push({ __V: j }), t.__[e];
|
|
286
288
|
}
|
|
287
|
-
function
|
|
288
|
-
return
|
|
289
|
+
function Le(e) {
|
|
290
|
+
return J = 1, Me(ke, e);
|
|
289
291
|
}
|
|
290
|
-
function
|
|
291
|
-
var n =
|
|
292
|
-
if (n.t =
|
|
293
|
-
var
|
|
294
|
-
|
|
292
|
+
function Me(e, _, t) {
|
|
293
|
+
var n = be(M++, 2);
|
|
294
|
+
if (n.t = e, !n.__c && (n.__ = [t ? t(_) : ke(void 0, _), function(l) {
|
|
295
|
+
var u = n.__N ? n.__N[0] : n.__[0], s = n.t(u, l);
|
|
296
|
+
u !== s && (n.__N = [s, n.__[1]], n.__c.setState({}));
|
|
295
297
|
}], n.__c = v, !v.u)) {
|
|
296
|
-
var
|
|
298
|
+
var o = function(l, u, s) {
|
|
297
299
|
if (!n.__c.__H)
|
|
298
300
|
return !0;
|
|
299
|
-
var
|
|
300
|
-
return
|
|
301
|
+
var p = n.__c.__H.__.filter(function(d) {
|
|
302
|
+
return d.__c;
|
|
301
303
|
});
|
|
302
|
-
if (
|
|
303
|
-
return !
|
|
304
|
+
if (p.every(function(d) {
|
|
305
|
+
return !d.__N;
|
|
304
306
|
}))
|
|
305
|
-
return !i || i.call(this, l,
|
|
306
|
-
var
|
|
307
|
-
return
|
|
308
|
-
if (
|
|
309
|
-
var a =
|
|
310
|
-
|
|
307
|
+
return !i || i.call(this, l, u, s);
|
|
308
|
+
var r = !1;
|
|
309
|
+
return p.forEach(function(d) {
|
|
310
|
+
if (d.__N) {
|
|
311
|
+
var a = d.__[0];
|
|
312
|
+
d.__ = d.__N, d.__N = void 0, a !== d.__[0] && (r = !0);
|
|
311
313
|
}
|
|
312
|
-
}), !(!
|
|
314
|
+
}), !(!r && n.__c.props === l) && (!i || i.call(this, l, u, s));
|
|
313
315
|
};
|
|
314
316
|
v.u = !0;
|
|
315
317
|
var i = v.shouldComponentUpdate, c = v.componentWillUpdate;
|
|
316
|
-
v.componentWillUpdate = function(l,
|
|
318
|
+
v.componentWillUpdate = function(l, u, s) {
|
|
317
319
|
if (this.__e) {
|
|
318
|
-
var
|
|
319
|
-
i = void 0,
|
|
320
|
+
var p = i;
|
|
321
|
+
i = void 0, o(l, u, s), i = p;
|
|
320
322
|
}
|
|
321
|
-
c && c.call(this, l,
|
|
322
|
-
}, v.shouldComponentUpdate =
|
|
323
|
+
c && c.call(this, l, u, s);
|
|
324
|
+
}, v.shouldComponentUpdate = o;
|
|
323
325
|
}
|
|
324
326
|
return n.__N || n.__;
|
|
325
327
|
}
|
|
326
|
-
function
|
|
327
|
-
var t =
|
|
328
|
-
!
|
|
328
|
+
function We(e, _) {
|
|
329
|
+
var t = be(M++, 3);
|
|
330
|
+
!f.__s && Ve(t.__H, _) && (t.__ = e, t.i = _, v.__H.__h.push(t));
|
|
329
331
|
}
|
|
330
|
-
function
|
|
331
|
-
for (var
|
|
332
|
-
if (
|
|
332
|
+
function Ae() {
|
|
333
|
+
for (var e; e = ye.shift(); )
|
|
334
|
+
if (e.__P && e.__H)
|
|
333
335
|
try {
|
|
334
|
-
|
|
335
|
-
} catch (
|
|
336
|
-
|
|
336
|
+
e.__H.__h.forEach(U), e.__H.__h.forEach(R), e.__H.__h = [];
|
|
337
|
+
} catch (_) {
|
|
338
|
+
e.__H.__h = [], f.__e(_, e.__v);
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
|
-
|
|
340
|
-
v = null,
|
|
341
|
-
},
|
|
342
|
-
|
|
343
|
-
var
|
|
344
|
-
|
|
345
|
-
t.__N && (t.__ = t.__N), t.__V =
|
|
346
|
-
})) : (
|
|
347
|
-
},
|
|
348
|
-
|
|
349
|
-
var
|
|
350
|
-
|
|
351
|
-
t.i && (t.__H = t.i), t.__V !==
|
|
352
|
-
})),
|
|
353
|
-
},
|
|
354
|
-
|
|
341
|
+
f.__b = function(e) {
|
|
342
|
+
v = null, re && re(e);
|
|
343
|
+
}, f.__r = function(e) {
|
|
344
|
+
ie && ie(e), M = 0;
|
|
345
|
+
var _ = (v = e.__c).__H;
|
|
346
|
+
_ && (q === v ? (_.__h = [], v.__h = [], _.__.forEach(function(t) {
|
|
347
|
+
t.__N && (t.__ = t.__N), t.__V = j, t.__N = t.i = void 0;
|
|
348
|
+
})) : (_.__h.forEach(U), _.__h.forEach(R), _.__h = [], M = 0)), q = v;
|
|
349
|
+
}, f.diffed = function(e) {
|
|
350
|
+
le && le(e);
|
|
351
|
+
var _ = e.__c;
|
|
352
|
+
_ && _.__H && (_.__H.__h.length && (ye.push(_) !== 1 && oe === f.requestAnimationFrame || ((oe = f.requestAnimationFrame) || Fe)(Ae)), _.__H.__.forEach(function(t) {
|
|
353
|
+
t.i && (t.__H = t.i), t.__V !== j && (t.__ = t.__V), t.i = void 0, t.__V = j;
|
|
354
|
+
})), q = v = null;
|
|
355
|
+
}, f.__c = function(e, _) {
|
|
356
|
+
_.some(function(t) {
|
|
355
357
|
try {
|
|
356
|
-
t.__h.forEach(
|
|
357
|
-
return !n.__ ||
|
|
358
|
+
t.__h.forEach(U), t.__h = t.__h.filter(function(n) {
|
|
359
|
+
return !n.__ || R(n);
|
|
358
360
|
});
|
|
359
361
|
} catch (n) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}),
|
|
362
|
+
_.some(function(o) {
|
|
363
|
+
o.__h && (o.__h = []);
|
|
364
|
+
}), _ = [], f.__e(n, t.__v);
|
|
363
365
|
}
|
|
364
|
-
}),
|
|
365
|
-
},
|
|
366
|
-
|
|
367
|
-
var
|
|
366
|
+
}), se && se(e, _);
|
|
367
|
+
}, f.unmount = function(e) {
|
|
368
|
+
ce && ce(e);
|
|
369
|
+
var _, t = e.__c;
|
|
368
370
|
t && t.__H && (t.__H.__.forEach(function(n) {
|
|
369
371
|
try {
|
|
370
|
-
|
|
371
|
-
} catch (
|
|
372
|
-
|
|
372
|
+
U(n);
|
|
373
|
+
} catch (o) {
|
|
374
|
+
_ = o;
|
|
373
375
|
}
|
|
374
|
-
}), t.__H = void 0,
|
|
376
|
+
}), t.__H = void 0, _ && f.__e(_, t.__v));
|
|
375
377
|
};
|
|
376
|
-
var
|
|
377
|
-
function
|
|
378
|
-
var
|
|
379
|
-
clearTimeout(n),
|
|
378
|
+
var ue = typeof requestAnimationFrame == "function";
|
|
379
|
+
function Fe(e) {
|
|
380
|
+
var _, t = function() {
|
|
381
|
+
clearTimeout(n), ue && cancelAnimationFrame(_), setTimeout(e);
|
|
380
382
|
}, n = setTimeout(t, 100);
|
|
381
|
-
|
|
383
|
+
ue && (_ = requestAnimationFrame(t));
|
|
382
384
|
}
|
|
383
|
-
function
|
|
384
|
-
var
|
|
385
|
-
typeof t == "function" && (
|
|
385
|
+
function U(e) {
|
|
386
|
+
var _ = v, t = e.__c;
|
|
387
|
+
typeof t == "function" && (e.__c = void 0, t()), v = _;
|
|
386
388
|
}
|
|
387
|
-
function
|
|
388
|
-
var
|
|
389
|
-
|
|
389
|
+
function R(e) {
|
|
390
|
+
var _ = v;
|
|
391
|
+
e.__c = e.__(), v = _;
|
|
390
392
|
}
|
|
391
|
-
function
|
|
392
|
-
return !
|
|
393
|
-
return t !==
|
|
393
|
+
function Ve(e, _) {
|
|
394
|
+
return !e || e.length !== _.length || _.some(function(t, n) {
|
|
395
|
+
return t !== e[n];
|
|
394
396
|
});
|
|
395
397
|
}
|
|
396
|
-
function
|
|
397
|
-
return typeof
|
|
398
|
+
function ke(e, _) {
|
|
399
|
+
return typeof _ == "function" ? _(e) : _;
|
|
398
400
|
}
|
|
399
|
-
var
|
|
400
|
-
function
|
|
401
|
-
var c, l,
|
|
402
|
-
for (l in
|
|
403
|
-
l == "ref" ? c =
|
|
404
|
-
var
|
|
405
|
-
if (typeof
|
|
401
|
+
var Be = 0;
|
|
402
|
+
function xe(e, _, t, n, o, i) {
|
|
403
|
+
var c, l, u = {};
|
|
404
|
+
for (l in _)
|
|
405
|
+
l == "ref" ? c = _[l] : u[l] = _[l];
|
|
406
|
+
var s = { type: e, props: u, key: t, ref: c, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --Be, __i: -1, __u: 0, __source: o, __self: i };
|
|
407
|
+
if (typeof e == "function" && (c = e.defaultProps))
|
|
406
408
|
for (l in c)
|
|
407
|
-
|
|
408
|
-
return
|
|
409
|
+
u[l] === void 0 && (u[l] = c[l]);
|
|
410
|
+
return f.vnode && f.vnode(s), s;
|
|
409
411
|
}
|
|
410
|
-
class
|
|
412
|
+
class qe {
|
|
411
413
|
constructor() {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
+
B(this, "_context");
|
|
415
|
+
B(this, "_getContextCallbacks", []);
|
|
414
416
|
}
|
|
415
417
|
async getContext() {
|
|
416
|
-
return this._context ? this._context : new Promise((
|
|
417
|
-
this._getContextCallbacks.push(
|
|
418
|
+
return this._context ? this._context : new Promise((_) => {
|
|
419
|
+
this._getContextCallbacks.push(_);
|
|
418
420
|
});
|
|
419
421
|
}
|
|
420
|
-
setContext(
|
|
421
|
-
this._context =
|
|
422
|
+
setContext(_) {
|
|
423
|
+
this._context = _, this._getContextCallbacks.forEach((t) => t(_)), this._getContextCallbacks = [];
|
|
422
424
|
}
|
|
423
|
-
configureClient(
|
|
425
|
+
configureClient(_) {
|
|
424
426
|
console.log("Client configured");
|
|
425
427
|
}
|
|
426
428
|
themeLoaded() {
|
|
@@ -429,40 +431,40 @@ class B_ {
|
|
|
429
431
|
close() {
|
|
430
432
|
console.log("Theme closed");
|
|
431
433
|
}
|
|
432
|
-
addToEcommerceCart(
|
|
433
|
-
console.log("Add to cart",
|
|
434
|
+
addToEcommerceCart(_) {
|
|
435
|
+
console.log("Add to cart", _);
|
|
434
436
|
}
|
|
435
437
|
}
|
|
436
438
|
let W;
|
|
437
|
-
const
|
|
438
|
-
context:
|
|
439
|
+
const Oe = ({
|
|
440
|
+
context: e
|
|
439
441
|
}) => {
|
|
440
|
-
const [
|
|
441
|
-
return
|
|
442
|
-
if (
|
|
442
|
+
const [_, t] = Le(null);
|
|
443
|
+
return We(() => {
|
|
444
|
+
if (_) {
|
|
443
445
|
if (W === void 0)
|
|
444
446
|
throw new Error("Please call setSpiffDevOptions before requesting the context.");
|
|
445
447
|
W.setContext({
|
|
446
|
-
...
|
|
447
|
-
container:
|
|
448
|
+
...e,
|
|
449
|
+
container: _
|
|
448
450
|
});
|
|
449
451
|
}
|
|
450
|
-
}, [
|
|
452
|
+
}, [_, e]), xe("div", {
|
|
451
453
|
ref: t,
|
|
452
454
|
id: "spiffThemeWrapper"
|
|
453
455
|
});
|
|
454
456
|
};
|
|
455
|
-
function
|
|
456
|
-
W = new
|
|
457
|
+
function i_(e, _) {
|
|
458
|
+
W = new qe(), window.SpiffThemeLoader = W;
|
|
457
459
|
let t;
|
|
458
|
-
typeof
|
|
459
|
-
context:
|
|
460
|
+
typeof e == "string" ? t = document.getElementById(e) : t = e, Ue(xe(Oe, {
|
|
461
|
+
context: _
|
|
460
462
|
}), t);
|
|
461
463
|
}
|
|
462
|
-
function
|
|
464
|
+
function l_(e) {
|
|
463
465
|
return {
|
|
464
466
|
id: "example",
|
|
465
|
-
themeInstallId: (
|
|
467
|
+
themeInstallId: (e == null ? void 0 : e.themeInstallId) ?? "example",
|
|
466
468
|
name: "Example Configuration",
|
|
467
469
|
createdAt: "2021-01-01T00:00:00Z",
|
|
468
470
|
updatedAt: "2021-01-01T00:00:00Z",
|
|
@@ -485,13 +487,89 @@ function R_(_) {
|
|
|
485
487
|
}
|
|
486
488
|
},
|
|
487
489
|
fields: [],
|
|
488
|
-
...
|
|
490
|
+
...e
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
const Ze = "@spiffcommerce/theme-bridge", ze = "1.10.5", Je = "module", Re = {
|
|
494
|
+
build: "tsc && vite build",
|
|
495
|
+
preview: "vite preview",
|
|
496
|
+
dev: "ladle serve",
|
|
497
|
+
schema: "node --no-warnings=ExperimentalWarning --loader ts-node/esm scripts/generateSchema.ts"
|
|
498
|
+
}, Ge = "./dist/index.umd.cjs", Ke = "./dist/index.js", Qe = "./dist/index.d.ts", Xe = [
|
|
499
|
+
"./dist"
|
|
500
|
+
], Ye = {
|
|
501
|
+
import: "./dist/index.js",
|
|
502
|
+
require: "./dist/index.umd.cjs"
|
|
503
|
+
}, e_ = {}, __ = {
|
|
504
|
+
"@ladle/react": "^4.0.2",
|
|
505
|
+
"@preact/preset-vite": "^2.7.0",
|
|
506
|
+
"@spiffcommerce/core": "^19.1.0",
|
|
507
|
+
"@types/node": "^20.11.16",
|
|
508
|
+
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
509
|
+
"@typescript-eslint/parser": "^7.1.0",
|
|
510
|
+
eslint: "^8.57.0",
|
|
511
|
+
"eslint-config-prettier": "^9.1.0",
|
|
512
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
513
|
+
preact: "^10.19.3",
|
|
514
|
+
prettier: "^3.2.4",
|
|
515
|
+
rollup: "^4.12.0",
|
|
516
|
+
"ts-json-schema-generator": "^1.5.0",
|
|
517
|
+
"ts-node": "^10.9.2",
|
|
518
|
+
tsup: "^8.0.1",
|
|
519
|
+
typescript: "^5.2.2",
|
|
520
|
+
vite: "^5.0.8",
|
|
521
|
+
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
522
|
+
"vite-plugin-externalize-deps": "^0.8.0"
|
|
523
|
+
}, t_ = {
|
|
524
|
+
name: Ze,
|
|
525
|
+
version: ze,
|
|
526
|
+
type: Je,
|
|
527
|
+
scripts: Re,
|
|
528
|
+
main: Ge,
|
|
529
|
+
module: Ke,
|
|
530
|
+
types: Qe,
|
|
531
|
+
files: Xe,
|
|
532
|
+
exports: Ye,
|
|
533
|
+
dependencies: e_,
|
|
534
|
+
devDependencies: __
|
|
535
|
+
};
|
|
536
|
+
function s_(e) {
|
|
537
|
+
return {
|
|
538
|
+
name: "spiff-theme-plugin",
|
|
539
|
+
version: t_.version,
|
|
540
|
+
writeBundle(_, t) {
|
|
541
|
+
const n = {
|
|
542
|
+
launchData: {
|
|
543
|
+
targetFiles: Object.keys(t).map((o) => {
|
|
544
|
+
const i = t[o];
|
|
545
|
+
if (i.type === "chunk") {
|
|
546
|
+
if (!i.isDynamicEntry)
|
|
547
|
+
return {
|
|
548
|
+
type: O.Javascript,
|
|
549
|
+
mimeType: "text/javascript",
|
|
550
|
+
preload: !i.isEntry,
|
|
551
|
+
filename: o
|
|
552
|
+
};
|
|
553
|
+
} else if (o.endsWith(".css"))
|
|
554
|
+
return {
|
|
555
|
+
type: O.CSS,
|
|
556
|
+
mimeType: "text/css",
|
|
557
|
+
filename: o
|
|
558
|
+
};
|
|
559
|
+
return null;
|
|
560
|
+
}).filter((o) => o !== null)
|
|
561
|
+
},
|
|
562
|
+
configurationSchema: e
|
|
563
|
+
};
|
|
564
|
+
we.writeFileSync(Ee.join(_.dir, "spiffTheme.json"), JSON.stringify(n, void 0, 4));
|
|
565
|
+
}
|
|
489
566
|
};
|
|
490
567
|
}
|
|
491
568
|
export {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
569
|
+
$e as AssetType,
|
|
570
|
+
He as FieldType,
|
|
571
|
+
O as ThemeFileType,
|
|
572
|
+
l_ as exampleThemeInstallConfig,
|
|
573
|
+
i_ as setSpiffDevOptions,
|
|
574
|
+
s_ as spiffThemePlugin
|
|
497
575
|
};
|
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(b,k){typeof exports=="object"&&typeof module<"u"?k(exports):typeof define=="function"&&define.amd?define(["exports"],k):(b=typeof globalThis<"u"?globalThis:b||self,k(b.theme={}))})(this,function(b){"use strict";var Z_=Object.defineProperty;var j_=(b,k,S)=>k in b?Z_(b,k,{enumerable:!0,configurable:!0,writable:!0,value:S}):b[k]=S;var Y=(b,k,S)=>(j_(b,typeof k!="symbol"?k+"":k,S),S);var k=(_=>(_.Javascript="Javascript",_.CSS="CSS",_))(k||{}),S=(_=>(_.Asset="Asset",_.Boolean="Boolean",_.Color="Color",_.Heading="Heading",_.Number="Number",_.Select="Select",_.Text="Text",_))(S||{}),__=(_=>(_.Color="Color",_.ColorProfile="ColorProfile",_.Data="Data",_.Environment="Environment",_.Font="Font",_.Frame="Frame",_.Illustration="Illustration",_.Image="Image",_.Material="Material",_.Model="Model",_.Video="Video",_))(__||{}),D,s,e_,H,t_,n_,Z,P={},o_=[],w_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,j=Array.isArray;function E(_,e){for(var t in e)_[t]=e[t];return _}function r_(_){var e=_.parentNode;e&&e.removeChild(_)}function H_(_,e,t){var n,r,i,u={};for(i in e)i=="key"?n=e[i]:i=="ref"?r=e[i]:u[i]=e[i];if(arguments.length>2&&(u.children=arguments.length>3?D.call(arguments,2):t),typeof _=="function"&&_.defaultProps!=null)for(i in _.defaultProps)u[i]===void 0&&(u[i]=_.defaultProps[i]);return N(_,u,n,r,null)}function N(_,e,t,n,r){var i={type:_,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++e_,__i:-1,__u:0};return r==null&&s.vnode!=null&&s.vnode(i),i}function I(_){return _.children}function M(_,e){this.props=_,this.context=e}function $(_,e){if(e==null)return _.__?$(_.__,_.__i+1):null;for(var t;e<_.__k.length;e++)if((t=_.__k[e])!=null&&t.__e!=null)return t.__e;return typeof _.type=="function"?$(_):null}function i_(_){var e,t;if((_=_.__)!=null&&_.__c!=null){for(_.__e=_.__c.base=null,e=0;e<_.__k.length;e++)if((t=_.__k[e])!=null&&t.__e!=null){_.__e=_.__c.base=t.__e;break}return i_(_)}}function l_(_){(!_.__d&&(_.__d=!0)&&H.push(_)&&!U.__r++||t_!==s.debounceRendering)&&((t_=s.debounceRendering)||n_)(U)}function U(){var _,e,t,n,r,i,u,l,c;for(H.sort(Z);_=H.shift();)_.__d&&(e=H.length,n=void 0,i=(r=(t=_).__v).__e,l=[],c=[],(u=t.__P)&&((n=E({},r)).__v=r.__v+1,s.vnode&&s.vnode(n),R(u,n,r,t.__n,u.ownerSVGElement!==void 0,32&r.__u?[i]:null,l,i??$(r),!!(32&r.__u),c),n.__.__k[n.__i]=n,d_(l,n,c),n.__e!=i&&i_(n)),H.length>e&&H.sort(Z));U.__r=0}function f_(_,e,t,n,r,i,u,l,c,f,d){var o,p,a,m,x,g=n&&n.__k||o_,h=e.length;for(t.__d=c,$_(t,e,g),c=t.__d,o=0;o<h;o++)(a=t.__k[o])!=null&&typeof a!="boolean"&&typeof a!="function"&&(p=a.__i===-1?P:g[a.__i]||P,a.__i=o,R(_,a,p,r,i,u,l,c,f,d),m=a.__e,a.ref&&p.ref!=a.ref&&(p.ref&&z(p.ref,null,a),d.push(a.ref,a.__c||m,a)),x==null&&m!=null&&(x=m),65536&a.__u||p.__k===a.__k?c=u_(a,c,_):typeof a.type=="function"&&a.__d!==void 0?c=a.__d:m&&(c=m.nextSibling),a.__d=void 0,a.__u&=-196609);t.__d=c,t.__e=x}function $_(_,e,t){var n,r,i,u,l,c=e.length,f=t.length,d=f,o=0;for(_.__k=[],n=0;n<c;n++)(r=_.__k[n]=(r=e[n])==null||typeof r=="boolean"||typeof r=="function"?null:typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?N(null,r,null,null,r):j(r)?N(I,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?N(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=_,r.__b=_.__b+1,l=P_(r,t,u=n+o,d),r.__i=l,i=null,l!==-1&&(d--,(i=t[l])&&(i.__u|=131072)),i==null||i.__v===null?(l==-1&&o--,typeof r.type!="function"&&(r.__u|=65536)):l!==u&&(l===u+1?o++:l>u?d>c-u?o+=l-u:o--:o=l<u&&l==u-1?l-u:0,l!==n+o&&(r.__u|=65536))):(i=t[n])&&i.key==null&&i.__e&&(i.__e==_.__d&&(_.__d=$(i)),G(i,i,!1),t[n]=null,d--);if(d)for(n=0;n<f;n++)(i=t[n])!=null&&!(131072&i.__u)&&(i.__e==_.__d&&(_.__d=$(i)),G(i,i))}function u_(_,e,t){var n,r;if(typeof _.type=="function"){for(n=_.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=_,e=u_(n[r],e,t));return e}return _.__e!=e&&(t.insertBefore(_.__e,e||null),e=_.__e),e&&e.nextSibling}function P_(_,e,t,n){var r=_.key,i=_.type,u=t-1,l=t+1,c=e[t];if(c===null||c&&r==c.key&&i===c.type)return t;if(n>(c!=null&&!(131072&c.__u)?1:0))for(;u>=0||l<e.length;){if(u>=0){if((c=e[u])&&!(131072&c.__u)&&r==c.key&&i===c.type)return u;u--}if(l<e.length){if((c=e[l])&&!(131072&c.__u)&&r==c.key&&i===c.type)return l;l++}}return-1}function c_(_,e,t){e[0]==="-"?_.setProperty(e,t??""):_[e]=t==null?"":typeof t!="number"||w_.test(e)?t:t+"px"}function L(_,e,t,n,r){var i;_:if(e==="style")if(typeof t=="string")_.style.cssText=t;else{if(typeof n=="string"&&(_.style.cssText=n=""),n)for(e in n)t&&e in t||c_(_.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||c_(_.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")i=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in _?e.toLowerCase().slice(2):e.slice(2),_.l||(_.l={}),_.l[e+i]=t,t?n?t.u=n.u:(t.u=Date.now(),_.addEventListener(e,i?s_:a_,i)):_.removeEventListener(e,i?s_:a_,i);else{if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in _)try{_[e]=t??"";break _}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?_.removeAttribute(e):_.setAttribute(e,t))}}function a_(_){var e=this.l[_.type+!1];if(_.t){if(_.t<=e.u)return}else _.t=Date.now();return e(s.event?s.event(_):_)}function s_(_){return this.l[_.type+!0](s.event?s.event(_):_)}function R(_,e,t,n,r,i,u,l,c,f){var d,o,p,a,m,x,g,h,y,w,B,T,E_,O,X,C=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(c=!!(32&t.__u),i=[l=e.__e=t.__e]),(d=s.__b)&&d(e);_:if(typeof C=="function")try{if(h=e.props,y=(d=C.contextType)&&n[d.__c],w=d?y?y.props.value:d.__:n,t.__c?g=(o=e.__c=t.__c).__=o.__E:("prototype"in C&&C.prototype.render?e.__c=o=new C(h,w):(e.__c=o=new M(h,w),o.constructor=C,o.render=D_),y&&y.sub(o),o.props=h,o.state||(o.state={}),o.context=w,o.__n=n,p=o.__d=!0,o.__h=[],o._sb=[]),o.__s==null&&(o.__s=o.state),C.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=E({},o.__s)),E(o.__s,C.getDerivedStateFromProps(h,o.__s))),a=o.props,m=o.state,o.__v=e,p)C.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(C.getDerivedStateFromProps==null&&h!==a&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(h,w),!o.__e&&(o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(h,o.__s,w)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(o.props=h,o.state=o.__s,o.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(q){q&&(q.__=e)}),B=0;B<o._sb.length;B++)o.__h.push(o._sb[B]);o._sb=[],o.__h.length&&u.push(o);break _}o.componentWillUpdate!=null&&o.componentWillUpdate(h,o.__s,w),o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(a,m,x)})}if(o.context=w,o.props=h,o.__P=_,o.__e=!1,T=s.__r,E_=0,"prototype"in C&&C.prototype.render){for(o.state=o.__s,o.__d=!1,T&&T(e),d=o.render(o.props,o.state,o.context),O=0;O<o._sb.length;O++)o.__h.push(o._sb[O]);o._sb=[]}else do o.__d=!1,T&&T(e),d=o.render(o.props,o.state,o.context),o.state=o.__s;while(o.__d&&++E_<25);o.state=o.__s,o.getChildContext!=null&&(n=E(E({},n),o.getChildContext())),p||o.getSnapshotBeforeUpdate==null||(x=o.getSnapshotBeforeUpdate(a,m)),f_(_,j(X=d!=null&&d.type===I&&d.key==null?d.props.children:d)?X:[X],e,t,n,r,i,u,l,c,f),o.base=e.__e,e.__u&=-161,o.__h.length&&u.push(o),g&&(o.__E=o.__=null)}catch(q){e.__v=null,c||i!=null?(e.__e=l,e.__u|=c?160:32,i[i.indexOf(l)]=null):(e.__e=t.__e,e.__k=t.__k),s.__e(q,e,t)}else i==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=T_(t.__e,e,t,n,r,i,u,c,f);(d=s.diffed)&&d(e)}function d_(_,e,t){e.__d=void 0;for(var n=0;n<t.length;n++)z(t[n],t[++n],t[++n]);s.__c&&s.__c(e,_),_.some(function(r){try{_=r.__h,r.__h=[],_.some(function(i){i.call(r)})}catch(i){s.__e(i,r.__v)}})}function T_(_,e,t,n,r,i,u,l,c){var f,d,o,p,a,m,x,g=t.props,h=e.props,y=e.type;if(y==="svg"&&(r=!0),i!=null){for(f=0;f<i.length;f++)if((a=i[f])&&"setAttribute"in a==!!y&&(y?a.localName===y:a.nodeType===3)){_=a,i[f]=null;break}}if(_==null){if(y===null)return document.createTextNode(h);_=r?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,h.is&&h),i=null,l=!1}if(y===null)g===h||l&&_.data===h||(_.data=h);else{if(i=i&&D.call(_.childNodes),g=t.props||P,!l&&i!=null)for(g={},f=0;f<_.attributes.length;f++)g[(a=_.attributes[f]).name]=a.value;for(f in g)a=g[f],f=="children"||(f=="dangerouslySetInnerHTML"?o=a:f==="key"||f in h||L(_,f,null,a,r));for(f in h)a=h[f],f=="children"?p=a:f=="dangerouslySetInnerHTML"?d=a:f=="value"?m=a:f=="checked"?x=a:f==="key"||l&&typeof a!="function"||g[f]===a||L(_,f,a,g[f],r);if(d)l||o&&(d.__html===o.__html||d.__html===_.innerHTML)||(_.innerHTML=d.__html),e.__k=[];else if(o&&(_.innerHTML=""),f_(_,j(p)?p:[p],e,t,n,r&&y!=="foreignObject",i,u,i?i[0]:t.__k&&$(t,0),l,c),i!=null)for(f=i.length;f--;)i[f]!=null&&r_(i[f]);l||(f="value",m!==void 0&&(m!==_[f]||y==="progress"&&!m||y==="option"&&m!==g[f])&&L(_,f,m,g[f],!1),f="checked",x!==void 0&&x!==_[f]&&L(_,f,x,g[f],!1))}return _}function z(_,e,t){try{typeof _=="function"?_(e):_.current=e}catch(n){s.__e(n,t)}}function G(_,e,t){var n,r;if(s.unmount&&s.unmount(_),(n=_.ref)&&(n.current&&n.current!==_.__e||z(n,null,e)),(n=_.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){s.__e(i,e)}n.base=n.__P=null,_.__c=void 0}if(n=_.__k)for(r=0;r<n.length;r++)n[r]&&G(n[r],e,t||typeof _.type!="function");t||_.__e==null||r_(_.__e),_.__=_.__e=_.__d=void 0}function D_(_,e,t){return this.constructor(_,t)}function N_(_,e,t){var n,r,i,u;s.__&&s.__(_,e),r=(n=typeof t=="function")?null:t&&t.__k||e.__k,i=[],u=[],R(e,_=(!n&&t||e).__k=H_(I,null,[_]),r||P,P,e.ownerSVGElement!==void 0,!n&&t?[t]:r?null:e.firstChild?D.call(e.childNodes):null,i,!n&&t?t:r?r.__e:e.firstChild,n,u),d_(i,_,u)}D=o_.slice,s={__e:function(_,e,t,n){for(var r,i,u;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(_)),u=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(_,n||{}),u=r.__d),u)return r.__E=r}catch(l){_=l}throw _}},e_=0,M.prototype.setState=function(_,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=E({},this.state),typeof _=="function"&&(_=_(E({},t),this.props)),_&&E(t,_),_!=null&&this.__v&&(e&&this._sb.push(e),l_(this))},M.prototype.forceUpdate=function(_){this.__v&&(this.__e=!0,_&&this.__h.push(_),l_(this))},M.prototype.render=I,H=[],n_=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Z=function(_,e){return _.__v.__b-e.__v.__b},U.__r=0;var A,v,J,p_,K=0,h_=[],F=[],v_=s.__b,m_=s.__r,g_=s.diffed,y_=s.__c,b_=s.unmount;function k_(_,e){s.__h&&s.__h(v,_,K||e),K=0;var t=v.__H||(v.__H={__:[],__h:[]});return _>=t.__.length&&t.__.push({__V:F}),t.__[_]}function I_(_){return K=1,M_(x_,_)}function M_(_,e,t){var n=k_(A++,2);if(n.t=_,!n.__c&&(n.__=[t?t(e):x_(void 0,e),function(l){var c=n.__N?n.__N[0]:n.__[0],f=n.t(c,l);c!==f&&(n.__N=[f,n.__[1]],n.__c.setState({}))}],n.__c=v,!v.u)){var r=function(l,c,f){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(p){return p.__c});if(d.every(function(p){return!p.__N}))return!i||i.call(this,l,c,f);var o=!1;return d.forEach(function(p){if(p.__N){var a=p.__[0];p.__=p.__N,p.__N=void 0,a!==p.__[0]&&(o=!0)}}),!(!o&&n.__c.props===l)&&(!i||i.call(this,l,c,f))};v.u=!0;var i=v.shouldComponentUpdate,u=v.componentWillUpdate;v.componentWillUpdate=function(l,c,f){if(this.__e){var d=i;i=void 0,r(l,c,f),i=d}u&&u.call(this,l,c,f)},v.shouldComponentUpdate=r}return n.__N||n.__}function U_(_,e){var t=k_(A++,3);!s.__s&&F_(t.__H,e)&&(t.__=_,t.i=e,v.__H.__h.push(t))}function L_(){for(var _;_=h_.shift();)if(_.__P&&_.__H)try{_.__H.__h.forEach(W),_.__H.__h.forEach(Q),_.__H.__h=[]}catch(e){_.__H.__h=[],s.__e(e,_.__v)}}s.__b=function(_){v=null,v_&&v_(_)},s.__r=function(_){m_&&m_(_),A=0;var e=(v=_.__c).__H;e&&(J===v?(e.__h=[],v.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=F,t.__N=t.i=void 0})):(e.__h.forEach(W),e.__h.forEach(Q),e.__h=[],A=0)),J=v},s.diffed=function(_){g_&&g_(_);var e=_.__c;e&&e.__H&&(e.__H.__h.length&&(h_.push(e)!==1&&p_===s.requestAnimationFrame||((p_=s.requestAnimationFrame)||A_)(L_)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==F&&(t.__=t.__V),t.i=void 0,t.__V=F})),J=v=null},s.__c=function(_,e){e.some(function(t){try{t.__h.forEach(W),t.__h=t.__h.filter(function(n){return!n.__||Q(n)})}catch(n){e.some(function(r){r.__h&&(r.__h=[])}),e=[],s.__e(n,t.__v)}}),y_&&y_(_,e)},s.unmount=function(_){b_&&b_(_);var e,t=_.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{W(n)}catch(r){e=r}}),t.__H=void 0,e&&s.__e(e,t.__v))};var C_=typeof requestAnimationFrame=="function";function A_(_){var e,t=function(){clearTimeout(n),C_&&cancelAnimationFrame(e),setTimeout(_)},n=setTimeout(t,100);C_&&(e=requestAnimationFrame(t))}function W(_){var e=v,t=_.__c;typeof t=="function"&&(_.__c=void 0,t()),v=e}function Q(_){var e=v;_.__c=_.__(),v=e}function F_(_,e){return!_||_.length!==e.length||e.some(function(t,n){return t!==_[n]})}function x_(_,e){return typeof e=="function"?e(_):e}var W_=0;function S_(_,e,t,n,r,i){var u,l,c={};for(l in e)l=="ref"?u=e[l]:c[l]=e[l];var f={type:_,props:c,key:t,ref:u,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--W_,__i:-1,__u:0,__source:r,__self:i};if(typeof _=="function"&&(u=_.defaultProps))for(l in u)c[l]===void 0&&(c[l]=u[l]);return s.vnode&&s.vnode(f),f}class V_{constructor(){Y(this,"_context");Y(this,"_getContextCallbacks",[])}async getContext(){return this._context?this._context:new Promise(e=>{this._getContextCallbacks.push(e)})}setContext(e){this._context=e,this._getContextCallbacks.forEach(t=>t(e)),this._getContextCallbacks=[]}configureClient(e){console.log("Client configured")}themeLoaded(){console.log("Theme loaded")}close(){console.log("Theme closed")}addToEcommerceCart(e){console.log("Add to cart",e)}}let V;const B_=({context:_})=>{const[e,t]=I_(null);return U_(()=>{if(e){if(V===void 0)throw new Error("Please call setSpiffDevOptions before requesting the context.");V.setContext({..._,container:e})}},[e,_]),S_("div",{ref:t,id:"spiffThemeWrapper"})};function O_(_,e){V=new V_,window.SpiffThemeLoader=V;let t;typeof _=="string"?t=document.getElementById(_):t=_,N_(S_(B_,{context:e}),t)}function q_(_){return{id:"example",themeInstallId:(_==null?void 0:_.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:[],..._}}b.AssetType=__,b.FieldType=S,b.ThemeFileType=k,b.exampleThemeInstallConfig=q_,b.setSpiffDevOptions=O_,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
(function(m,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("fs"),require("path")):typeof define=="function"&&define.amd?define(["exports","fs","path"],k):(m=typeof globalThis<"u"?globalThis:m||self,k(m.theme={},m.fs,m.path))})(this,function(m,k,E){"use strict";var Re=Object.defineProperty;var Ge=(m,k,E)=>k in m?Re(m,k,{enumerable:!0,configurable:!0,writable:!0,value:E}):m[k]=E;var ee=(m,k,E)=>(Ge(m,typeof k!="symbol"?k+"":k,E),E);var D=(e=>(e.Javascript="Javascript",e.CSS="CSS",e))(D||{}),_e=(e=>(e.Asset="Asset",e.Boolean="Boolean",e.Color="Color",e.Heading="Heading",e.Number="Number",e.Select="Select",e.Text="Text",e))(_e||{}),te=(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))(te||{}),N,a,ne,$,oe,re,Z,P={},ie=[],He=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,z=Array.isArray;function S(e,_){for(var t in _)e[t]=_[t];return e}function le(e){var _=e.parentNode;_&&_.removeChild(e)}function Pe(e,_,t){var n,o,i,c={};for(i in _)i=="key"?n=_[i]:i=="ref"?o=_[i]:c[i]=_[i];if(arguments.length>2&&(c.children=arguments.length>3?N.call(arguments,2):t),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)c[i]===void 0&&(c[i]=e.defaultProps[i]);return j(e,c,n,o,null)}function j(e,_,t,n,o){var i={type:e,props:_,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++ne,__i:-1,__u:0};return o==null&&a.vnode!=null&&a.vnode(i),i}function I(e){return e.children}function M(e,_){this.props=e,this.context=_}function H(e,_){if(_==null)return e.__?H(e.__,e.__i+1):null;for(var t;_<e.__k.length;_++)if((t=e.__k[_])!=null&&t.__e!=null)return t.__e;return typeof e.type=="function"?H(e):null}function se(e){var _,t;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,_=0;_<e.__k.length;_++)if((t=e.__k[_])!=null&&t.__e!=null){e.__e=e.__c.base=t.__e;break}return se(e)}}function ce(e){(!e.__d&&(e.__d=!0)&&$.push(e)&&!U.__r++||oe!==a.debounceRendering)&&((oe=a.debounceRendering)||re)(U)}function U(){var e,_,t,n,o,i,c,l,f;for($.sort(Z);e=$.shift();)e.__d&&(_=$.length,n=void 0,i=(o=(t=e).__v).__e,l=[],f=[],(c=t.__P)&&((n=S({},o)).__v=o.__v+1,a.vnode&&a.vnode(n),J(c,n,o,t.__n,c.ownerSVGElement!==void 0,32&o.__u?[i]:null,l,i??H(o),!!(32&o.__u),f),n.__.__k[n.__i]=n,he(l,n,f),n.__e!=i&&se(n)),$.length>_&&$.sort(Z));U.__r=0}function fe(e,_,t,n,o,i,c,l,f,s,p){var r,d,u,g,C,y=n&&n.__k||ie,h=_.length;for(t.__d=f,Te(t,_,y),f=t.__d,r=0;r<h;r++)(u=t.__k[r])!=null&&typeof u!="boolean"&&typeof u!="function"&&(d=u.__i===-1?P:y[u.__i]||P,u.__i=r,J(e,u,d,o,i,c,l,f,s,p),g=u.__e,u.ref&&d.ref!=u.ref&&(d.ref&&R(d.ref,null,u),p.push(u.ref,u.__c||g,u)),C==null&&g!=null&&(C=g),65536&u.__u||d.__k===u.__k?f=ue(u,f,e):typeof u.type=="function"&&u.__d!==void 0?f=u.__d:g&&(f=g.nextSibling),u.__d=void 0,u.__u&=-196609);t.__d=f,t.__e=C}function Te(e,_,t){var n,o,i,c,l,f=_.length,s=t.length,p=s,r=0;for(e.__k=[],n=0;n<f;n++)(o=e.__k[n]=(o=_[n])==null||typeof o=="boolean"||typeof o=="function"?null:typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?j(null,o,null,null,o):z(o)?j(I,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?j(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)!=null?(o.__=e,o.__b=e.__b+1,l=De(o,t,c=n+r,p),o.__i=l,i=null,l!==-1&&(p--,(i=t[l])&&(i.__u|=131072)),i==null||i.__v===null?(l==-1&&r--,typeof o.type!="function"&&(o.__u|=65536)):l!==c&&(l===c+1?r++:l>c?p>f-c?r+=l-c:r--:r=l<c&&l==c-1?l-c:0,l!==n+r&&(o.__u|=65536))):(i=t[n])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=H(i)),G(i,i,!1),t[n]=null,p--);if(p)for(n=0;n<s;n++)(i=t[n])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=H(i)),G(i,i))}function ue(e,_,t){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,_=ue(n[o],_,t));return _}return e.__e!=_&&(t.insertBefore(e.__e,_||null),_=e.__e),_&&_.nextSibling}function De(e,_,t,n){var o=e.key,i=e.type,c=t-1,l=t+1,f=_[t];if(f===null||f&&o==f.key&&i===f.type)return t;if(n>(f!=null&&!(131072&f.__u)?1:0))for(;c>=0||l<_.length;){if(c>=0){if((f=_[c])&&!(131072&f.__u)&&o==f.key&&i===f.type)return c;c--}if(l<_.length){if((f=_[l])&&!(131072&f.__u)&&o==f.key&&i===f.type)return l;l++}}return-1}function ae(e,_,t){_[0]==="-"?e.setProperty(_,t??""):e[_]=t==null?"":typeof t!="number"||He.test(_)?t:t+"px"}function L(e,_,t,n,o){var i;e:if(_==="style")if(typeof t=="string")e.style.cssText=t;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(_ in n)t&&_ in t||ae(e.style,_,"");if(t)for(_ in t)n&&t[_]===n[_]||ae(e.style,_,t[_])}else if(_[0]==="o"&&_[1]==="n")i=_!==(_=_.replace(/(PointerCapture)$|Capture$/,"$1")),_=_.toLowerCase()in e?_.toLowerCase().slice(2):_.slice(2),e.l||(e.l={}),e.l[_+i]=t,t?n?t.u=n.u:(t.u=Date.now(),e.addEventListener(_,i?de:pe,i)):e.removeEventListener(_,i?de:pe,i);else{if(o)_=_.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(_!=="width"&&_!=="height"&&_!=="href"&&_!=="list"&&_!=="form"&&_!=="tabIndex"&&_!=="download"&&_!=="rowSpan"&&_!=="colSpan"&&_!=="role"&&_ in e)try{e[_]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&_[4]!=="-"?e.removeAttribute(_):e.setAttribute(_,t))}}function pe(e){var _=this.l[e.type+!1];if(e.t){if(e.t<=_.u)return}else e.t=Date.now();return _(a.event?a.event(e):e)}function de(e){return this.l[e.type+!0](a.event?a.event(e):e)}function J(e,_,t,n,o,i,c,l,f,s){var p,r,d,u,g,C,y,h,b,w,q,T,$e,O,Y,x=_.type;if(_.constructor!==void 0)return null;128&t.__u&&(f=!!(32&t.__u),i=[l=_.__e=t.__e]),(p=a.__b)&&p(_);e:if(typeof x=="function")try{if(h=_.props,b=(p=x.contextType)&&n[p.__c],w=p?b?b.props.value:p.__:n,t.__c?y=(r=_.__c=t.__c).__=r.__E:("prototype"in x&&x.prototype.render?_.__c=r=new x(h,w):(_.__c=r=new M(h,w),r.constructor=x,r.render=je),b&&b.sub(r),r.props=h,r.state||(r.state={}),r.context=w,r.__n=n,d=r.__d=!0,r.__h=[],r._sb=[]),r.__s==null&&(r.__s=r.state),x.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=S({},r.__s)),S(r.__s,x.getDerivedStateFromProps(h,r.__s))),u=r.props,g=r.state,r.__v=_,d)x.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(x.getDerivedStateFromProps==null&&h!==u&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(h,w),!r.__e&&(r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(h,r.__s,w)===!1||_.__v===t.__v)){for(_.__v!==t.__v&&(r.props=h,r.state=r.__s,r.__d=!1),_.__e=t.__e,_.__k=t.__k,_.__k.forEach(function(B){B&&(B.__=_)}),q=0;q<r._sb.length;q++)r.__h.push(r._sb[q]);r._sb=[],r.__h.length&&c.push(r);break e}r.componentWillUpdate!=null&&r.componentWillUpdate(h,r.__s,w),r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(u,g,C)})}if(r.context=w,r.props=h,r.__P=e,r.__e=!1,T=a.__r,$e=0,"prototype"in x&&x.prototype.render){for(r.state=r.__s,r.__d=!1,T&&T(_),p=r.render(r.props,r.state,r.context),O=0;O<r._sb.length;O++)r.__h.push(r._sb[O]);r._sb=[]}else do r.__d=!1,T&&T(_),p=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++$e<25);r.state=r.__s,r.getChildContext!=null&&(n=S(S({},n),r.getChildContext())),d||r.getSnapshotBeforeUpdate==null||(C=r.getSnapshotBeforeUpdate(u,g)),fe(e,z(Y=p!=null&&p.type===I&&p.key==null?p.props.children:p)?Y:[Y],_,t,n,o,i,c,l,f,s),r.base=_.__e,_.__u&=-161,r.__h.length&&c.push(r),y&&(r.__E=r.__=null)}catch(B){_.__v=null,f||i!=null?(_.__e=l,_.__u|=f?160:32,i[i.indexOf(l)]=null):(_.__e=t.__e,_.__k=t.__k),a.__e(B,_,t)}else i==null&&_.__v===t.__v?(_.__k=t.__k,_.__e=t.__e):_.__e=Ne(t.__e,_,t,n,o,i,c,f,s);(p=a.diffed)&&p(_)}function he(e,_,t){_.__d=void 0;for(var n=0;n<t.length;n++)R(t[n],t[++n],t[++n]);a.__c&&a.__c(_,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){a.__e(i,o.__v)}})}function Ne(e,_,t,n,o,i,c,l,f){var s,p,r,d,u,g,C,y=t.props,h=_.props,b=_.type;if(b==="svg"&&(o=!0),i!=null){for(s=0;s<i.length;s++)if((u=i[s])&&"setAttribute"in u==!!b&&(b?u.localName===b:u.nodeType===3)){e=u,i[s]=null;break}}if(e==null){if(b===null)return document.createTextNode(h);e=o?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,h.is&&h),i=null,l=!1}if(b===null)y===h||l&&e.data===h||(e.data=h);else{if(i=i&&N.call(e.childNodes),y=t.props||P,!l&&i!=null)for(y={},s=0;s<e.attributes.length;s++)y[(u=e.attributes[s]).name]=u.value;for(s in y)u=y[s],s=="children"||(s=="dangerouslySetInnerHTML"?r=u:s==="key"||s in h||L(e,s,null,u,o));for(s in h)u=h[s],s=="children"?d=u:s=="dangerouslySetInnerHTML"?p=u:s=="value"?g=u:s=="checked"?C=u:s==="key"||l&&typeof u!="function"||y[s]===u||L(e,s,u,y[s],o);if(p)l||r&&(p.__html===r.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),_.__k=[];else if(r&&(e.innerHTML=""),fe(e,z(d)?d:[d],_,t,n,o&&b!=="foreignObject",i,c,i?i[0]:t.__k&&H(t,0),l,f),i!=null)for(s=i.length;s--;)i[s]!=null&&le(i[s]);l||(s="value",g!==void 0&&(g!==e[s]||b==="progress"&&!g||b==="option"&&g!==y[s])&&L(e,s,g,y[s],!1),s="checked",C!==void 0&&C!==e[s]&&L(e,s,C,y[s],!1))}return e}function R(e,_,t){try{typeof e=="function"?e(_):e.current=_}catch(n){a.__e(n,t)}}function G(e,_,t){var n,o;if(a.unmount&&a.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||R(n,null,_)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){a.__e(i,_)}n.base=n.__P=null,e.__c=void 0}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&G(n[o],_,t||typeof e.type!="function");t||e.__e==null||le(e.__e),e.__=e.__e=e.__d=void 0}function je(e,_,t){return this.constructor(e,t)}function Ie(e,_,t){var n,o,i,c;a.__&&a.__(e,_),o=(n=typeof t=="function")?null:t&&t.__k||_.__k,i=[],c=[],J(_,e=(!n&&t||_).__k=Pe(I,null,[e]),o||P,P,_.ownerSVGElement!==void 0,!n&&t?[t]:o?null:_.firstChild?N.call(_.childNodes):null,i,!n&&t?t:o?o.__e:_.firstChild,n,c),he(i,e,c)}N=ie.slice,a={__e:function(e,_,t,n){for(var o,i,c;_=_.__;)if((o=_.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),c=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),c=o.__d),c)return o.__E=o}catch(l){e=l}throw e}},ne=0,M.prototype.setState=function(e,_){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=S({},this.state),typeof e=="function"&&(e=e(S({},t),this.props)),e&&S(t,e),e!=null&&this.__v&&(_&&this._sb.push(_),ce(this))},M.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ce(this))},M.prototype.render=I,$=[],re=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Z=function(e,_){return e.__v.__b-_.__v.__b},U.__r=0;var A,v,K,ve,Q=0,me=[],F=[],ge=a.__b,ye=a.__r,be=a.diffed,ke=a.__c,xe=a.unmount;function Ce(e,_){a.__h&&a.__h(v,e,Q||_),Q=0;var t=v.__H||(v.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({__V:F}),t.__[e]}function Me(e){return Q=1,Ue(we,e)}function Ue(e,_,t){var n=Ce(A++,2);if(n.t=e,!n.__c&&(n.__=[t?t(_):we(void 0,_),function(l){var f=n.__N?n.__N[0]:n.__[0],s=n.t(f,l);f!==s&&(n.__N=[s,n.__[1]],n.__c.setState({}))}],n.__c=v,!v.u)){var o=function(l,f,s){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(d){return d.__c});if(p.every(function(d){return!d.__N}))return!i||i.call(this,l,f,s);var r=!1;return p.forEach(function(d){if(d.__N){var u=d.__[0];d.__=d.__N,d.__N=void 0,u!==d.__[0]&&(r=!0)}}),!(!r&&n.__c.props===l)&&(!i||i.call(this,l,f,s))};v.u=!0;var i=v.shouldComponentUpdate,c=v.componentWillUpdate;v.componentWillUpdate=function(l,f,s){if(this.__e){var p=i;i=void 0,o(l,f,s),i=p}c&&c.call(this,l,f,s)},v.shouldComponentUpdate=o}return n.__N||n.__}function Le(e,_){var t=Ce(A++,3);!a.__s&&We(t.__H,_)&&(t.__=e,t.i=_,v.__H.__h.push(t))}function Ae(){for(var e;e=me.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(W),e.__H.__h.forEach(X),e.__H.__h=[]}catch(_){e.__H.__h=[],a.__e(_,e.__v)}}a.__b=function(e){v=null,ge&&ge(e)},a.__r=function(e){ye&&ye(e),A=0;var _=(v=e.__c).__H;_&&(K===v?(_.__h=[],v.__h=[],_.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=F,t.__N=t.i=void 0})):(_.__h.forEach(W),_.__h.forEach(X),_.__h=[],A=0)),K=v},a.diffed=function(e){be&&be(e);var _=e.__c;_&&_.__H&&(_.__H.__h.length&&(me.push(_)!==1&&ve===a.requestAnimationFrame||((ve=a.requestAnimationFrame)||Fe)(Ae)),_.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==F&&(t.__=t.__V),t.i=void 0,t.__V=F})),K=v=null},a.__c=function(e,_){_.some(function(t){try{t.__h.forEach(W),t.__h=t.__h.filter(function(n){return!n.__||X(n)})}catch(n){_.some(function(o){o.__h&&(o.__h=[])}),_=[],a.__e(n,t.__v)}}),ke&&ke(e,_)},a.unmount=function(e){xe&&xe(e);var _,t=e.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{W(n)}catch(o){_=o}}),t.__H=void 0,_&&a.__e(_,t.__v))};var Se=typeof requestAnimationFrame=="function";function Fe(e){var _,t=function(){clearTimeout(n),Se&&cancelAnimationFrame(_),setTimeout(e)},n=setTimeout(t,100);Se&&(_=requestAnimationFrame(t))}function W(e){var _=v,t=e.__c;typeof t=="function"&&(e.__c=void 0,t()),v=_}function X(e){var _=v;e.__c=e.__(),v=_}function We(e,_){return!e||e.length!==_.length||_.some(function(t,n){return t!==e[n]})}function we(e,_){return typeof _=="function"?_(e):_}var Ve=0;function Ee(e,_,t,n,o,i){var c,l,f={};for(l in _)l=="ref"?c=_[l]:f[l]=_[l];var s={type:e,props:f,key:t,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ve,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(c=e.defaultProps))for(l in c)f[l]===void 0&&(f[l]=c[l]);return a.vnode&&a.vnode(s),s}class qe{constructor(){ee(this,"_context");ee(this,"_getContextCallbacks",[])}async getContext(){return this._context?this._context:new Promise(_=>{this._getContextCallbacks.push(_)})}setContext(_){this._context=_,this._getContextCallbacks.forEach(t=>t(_)),this._getContextCallbacks=[]}configureClient(_){console.log("Client configured")}themeLoaded(){console.log("Theme loaded")}close(){console.log("Theme closed")}addToEcommerceCart(_){console.log("Add to cart",_)}}let V;const Oe=({context:e})=>{const[_,t]=Me(null);return Le(()=>{if(_){if(V===void 0)throw new Error("Please call setSpiffDevOptions before requesting the context.");V.setContext({...e,container:_})}},[_,e]),Ee("div",{ref:t,id:"spiffThemeWrapper"})};function Be(e,_){V=new qe,window.SpiffThemeLoader=V;let t;typeof e=="string"?t=document.getElementById(e):t=e,Ie(Ee(Oe,{context:_}),t)}function Ze(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 ze={name:"@spiffcommerce/theme-bridge",version:"1.10.5",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":"^19.1.0","@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"}};function Je(e){return{name:"spiff-theme-plugin",version:ze.version,writeBundle(_,t){const n={launchData:{targetFiles:Object.keys(t).map(o=>{const i=t[o];if(i.type==="chunk"){if(!i.isDynamicEntry)return{type:D.Javascript,mimeType:"text/javascript",preload:!i.isEntry,filename:o}}else if(o.endsWith(".css"))return{type:D.CSS,mimeType:"text/css",filename:o};return null}).filter(o=>o!==null)},configurationSchema:e};k.writeFileSync(E.join(_.dir,"spiffTheme.json"),JSON.stringify(n,void 0,4))}}}m.AssetType=te,m.FieldType=_e,m.ThemeFileType=D,m.exampleThemeInstallConfig=Ze,m.setSpiffDevOptions=Be,m.spiffThemePlugin=Je,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spiffcommerce/theme-bridge",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc && vite build",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"eslint-plugin-prettier": "^5.1.3",
|
|
32
32
|
"preact": "^10.19.3",
|
|
33
33
|
"prettier": "^3.2.4",
|
|
34
|
+
"rollup": "^4.12.0",
|
|
34
35
|
"ts-json-schema-generator": "^1.5.0",
|
|
35
36
|
"ts-node": "^10.9.2",
|
|
36
37
|
"tsup": "^8.0.1",
|