@spiffcommerce/theme-bridge 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { GetWorkflowOptions } from '@spiffcommerce/core';
1
+ import { SpiffCommerceClient } from '@spiffcommerce/core';
2
2
 
3
3
  interface SpiffThemeContextBase {
4
4
  applicationKey: string;
@@ -29,6 +29,24 @@ interface SpiffThemeContextBundle extends SpiffThemeContextBase {
29
29
  bundleOptions: GetBundleOptions;
30
30
  type: "bundle";
31
31
  }
32
+ interface GetWorkflowOptionsBase {
33
+ }
34
+ interface GetWorkflowFromTransactionOptions extends GetWorkflowOptionsBase {
35
+ transactionId: string;
36
+ type: "transaction";
37
+ }
38
+ interface GetWorkflowFromIntegrationProductOptions extends GetWorkflowOptionsBase {
39
+ integrationProductId: string;
40
+ workflowId?: string;
41
+ type: "integration";
42
+ }
43
+ interface GetWorkflowFromExternalProductOptions extends GetWorkflowOptionsBase {
44
+ externalProductId: string;
45
+ externalIntegrationId: string;
46
+ workflowId?: string;
47
+ type: "external";
48
+ }
49
+ type GetWorkflowOptions = GetWorkflowFromTransactionOptions | GetWorkflowFromIntegrationProductOptions | GetWorkflowFromExternalProductOptions;
32
50
  interface SpiffThemeContextTransaction extends SpiffThemeContextBase {
33
51
  workflowOptions: GetWorkflowOptions;
34
52
  type: "transaction";
@@ -37,6 +55,7 @@ type SpiffThemeContext = SpiffThemeContextTransaction | SpiffThemeContextBundle;
37
55
  type SpiffThemeLoader = {
38
56
  getContext(): Promise<SpiffThemeContext>;
39
57
  setContext(context: SpiffThemeContext): void;
58
+ configureClient(client: SpiffCommerceClient): void;
40
59
  };
41
60
  interface SpiffThemeConfigurationFile {
42
61
  launchData: SpiffThemeConfigurationLaunchData;
@@ -144,4 +163,4 @@ type SpiffDevOptions = Omit<SpiffThemeContextTransaction, "container"> | Omit<Sp
144
163
  declare function setSpiffDevOptions(container: HTMLElement | string, context: SpiffDevOptions): void;
145
164
  declare function exampleThemeInstallConfig(opts?: Partial<SpiffThemeInstallConfiguration>): SpiffThemeInstallConfiguration;
146
165
 
147
- export { type GetBundleOptions, type SpiffAsset, SpiffAssetType, type SpiffDevOptions, type SpiffTheme, SpiffThemeConfigurationFieldType, type SpiffThemeConfigurationFile, type SpiffThemeConfigurationLaunchData, type SpiffThemeConfigurationLaunchDataTargetFile, type SpiffThemeConfigurationSchema, type SpiffThemeConfigurationSchemaField, type SpiffThemeContext, type SpiffThemeContextBundle, type SpiffThemeContextTransaction, SpiffThemeFileType, type SpiffThemeInstallConfiguration, type SpiffThemeInstallConfigurationField, type SpiffThemeLaunchData, type SpiffThemeLaunchDataTargetFile, type SpiffThemeLoader, type SpiffThemeVersion, exampleThemeInstallConfig, setSpiffDevOptions };
166
+ export { type GetBundleOptions, type GetWorkflowFromExternalProductOptions, type GetWorkflowFromIntegrationProductOptions, type GetWorkflowFromTransactionOptions, type GetWorkflowOptions, type SpiffAsset, SpiffAssetType, type SpiffDevOptions, type SpiffTheme, SpiffThemeConfigurationFieldType, type SpiffThemeConfigurationFile, type SpiffThemeConfigurationLaunchData, type SpiffThemeConfigurationLaunchDataTargetFile, type SpiffThemeConfigurationSchema, type SpiffThemeConfigurationSchemaField, type SpiffThemeContext, type SpiffThemeContextBundle, type SpiffThemeContextTransaction, SpiffThemeFileType, type SpiffThemeInstallConfiguration, type SpiffThemeInstallConfigurationField, type SpiffThemeLaunchData, type SpiffThemeLaunchDataTargetFile, type SpiffThemeLoader, type SpiffThemeVersion, exampleThemeInstallConfig, setSpiffDevOptions };
package/dist/index.js CHANGED
@@ -59,9 +59,9 @@ function A() {
59
59
  A.__r = 0;
60
60
  }
61
61
  function p_(_, e, t, n, r, i, c, l, a, u, d) {
62
- var o, h, s, m, k, y = n && n.__k || f_, p = e.length;
63
- for (t.__d = a, D_(t, e, y), a = t.__d, o = 0; o < p; o++)
64
- (s = t.__k[o]) != null && typeof s != "boolean" && typeof s != "function" && (h = s.__i === -1 ? $ : y[s.__i] || $, s.__i = o, J(_, s, h, r, i, c, l, a, u, d), m = s.__e, s.ref && h.ref != s.ref && (h.ref && K(h.ref, null, s), d.push(s.ref, s.__c || m, s)), k == null && m != null && (k = m), 65536 & s.__u || h.__k === s.__k ? a = v_(s, a, _) : typeof s.type == "function" && s.__d !== void 0 ? a = s.__d : m && (a = m.nextSibling), s.__d = void 0, s.__u &= -196609);
62
+ var o, h, s, m, k, g = n && n.__k || f_, p = e.length;
63
+ for (t.__d = a, D_(t, e, g), a = t.__d, o = 0; o < p; o++)
64
+ (s = t.__k[o]) != null && typeof s != "boolean" && typeof s != "function" && (h = s.__i === -1 ? $ : g[s.__i] || $, s.__i = o, J(_, s, h, r, i, c, l, a, u, d), m = s.__e, s.ref && h.ref != s.ref && (h.ref && K(h.ref, null, s), d.push(s.ref, s.__c || m, s)), k == null && m != null && (k = m), 65536 & s.__u || h.__k === s.__k ? a = v_(s, a, _) : typeof s.type == "function" && s.__d !== void 0 ? a = s.__d : m && (a = m.nextSibling), s.__d = void 0, s.__u &= -196609);
65
65
  t.__d = a, t.__e = k;
66
66
  }
67
67
  function D_(_, e, t) {
@@ -144,14 +144,14 @@ function t_(_) {
144
144
  return this.l[_.type + !0](f.event ? f.event(_) : _);
145
145
  }
146
146
  function J(_, e, t, n, r, i, c, l, a, u) {
147
- var d, o, h, s, m, k, y, p, g, x, P, H, Q, D, q, b = e.type;
147
+ var d, o, h, s, m, k, g, p, y, x, P, H, Q, D, q, b = e.type;
148
148
  if (e.constructor !== void 0)
149
149
  return null;
150
150
  128 & t.__u && (a = !!(32 & t.__u), i = [l = e.__e = t.__e]), (d = f.__b) && d(e);
151
151
  _:
152
152
  if (typeof b == "function")
153
153
  try {
154
- if (p = e.props, g = (d = b.contextType) && n[d.__c], x = d ? g ? g.props.value : d.__ : n, t.__c ? y = (o = e.__c = t.__c).__ = o.__E : ("prototype" in b && b.prototype.render ? e.__c = o = new b(p, x) : (e.__c = o = new I(p, x), o.constructor = b, o.render = L_), g && g.sub(o), o.props = p, o.state || (o.state = {}), o.context = x, o.__n = n, h = o.__d = !0, o.__h = [], o._sb = []), o.__s == null && (o.__s = o.state), b.getDerivedStateFromProps != null && (o.__s == o.state && (o.__s = C({}, o.__s)), C(o.__s, b.getDerivedStateFromProps(p, o.__s))), s = o.props, m = o.state, o.__v = e, h)
154
+ if (p = e.props, y = (d = b.contextType) && n[d.__c], x = d ? y ? y.props.value : d.__ : n, t.__c ? g = (o = e.__c = t.__c).__ = o.__E : ("prototype" in b && b.prototype.render ? e.__c = o = new b(p, x) : (e.__c = o = new I(p, x), o.constructor = b, o.render = L_), y && y.sub(o), o.props = p, o.state || (o.state = {}), o.context = x, o.__n = n, h = o.__d = !0, o.__h = [], o._sb = []), o.__s == null && (o.__s = o.state), b.getDerivedStateFromProps != null && (o.__s == o.state && (o.__s = C({}, o.__s)), C(o.__s, b.getDerivedStateFromProps(p, o.__s))), s = o.props, m = o.state, o.__v = e, h)
155
155
  b.getDerivedStateFromProps == null && o.componentWillMount != null && o.componentWillMount(), o.componentDidMount != null && o.__h.push(o.componentDidMount);
156
156
  else {
157
157
  if (b.getDerivedStateFromProps == null && p !== s && o.componentWillReceiveProps != null && o.componentWillReceiveProps(p, x), !o.__e && (o.shouldComponentUpdate != null && o.shouldComponentUpdate(p, o.__s, x) === !1 || e.__v === t.__v)) {
@@ -174,7 +174,7 @@ function J(_, e, t, n, r, i, c, l, a, u) {
174
174
  do
175
175
  o.__d = !1, H && H(e), d = o.render(o.props, o.state, o.context), o.state = o.__s;
176
176
  while (o.__d && ++Q < 25);
177
- o.state = o.__s, o.getChildContext != null && (n = C(C({}, n), o.getChildContext())), h || o.getSnapshotBeforeUpdate == null || (k = o.getSnapshotBeforeUpdate(s, m)), p_(_, G(q = d != null && d.type === B && d.key == null ? d.props.children : d) ? q : [q], e, t, n, r, i, c, l, a, u), o.base = e.__e, e.__u &= -161, o.__h.length && c.push(o), y && (o.__E = o.__ = null);
177
+ o.state = o.__s, o.getChildContext != null && (n = C(C({}, n), o.getChildContext())), h || o.getSnapshotBeforeUpdate == null || (k = o.getSnapshotBeforeUpdate(s, m)), p_(_, G(q = d != null && d.type === B && d.key == null ? d.props.children : d) ? q : [q], e, t, n, r, i, c, l, a, u), o.base = e.__e, e.__u &= -161, o.__h.length && c.push(o), g && (o.__E = o.__ = null);
178
178
  } catch (N) {
179
179
  e.__v = null, a || i != null ? (e.__e = l, e.__u |= a ? 160 : 32, i[i.indexOf(l)] = null) : (e.__e = t.__e, e.__k = t.__k), f.__e(N, e, t);
180
180
  }
@@ -197,35 +197,35 @@ function m_(_, e, t) {
197
197
  });
198
198
  }
199
199
  function S_(_, e, t, n, r, i, c, l, a) {
200
- var u, d, o, h, s, m, k, y = t.props, p = e.props, g = e.type;
201
- if (g === "svg" && (r = !0), i != null) {
200
+ var u, d, o, h, s, m, k, g = t.props, p = e.props, y = e.type;
201
+ if (y === "svg" && (r = !0), i != null) {
202
202
  for (u = 0; u < i.length; u++)
203
- if ((s = i[u]) && "setAttribute" in s == !!g && (g ? s.localName === g : s.nodeType === 3)) {
203
+ if ((s = i[u]) && "setAttribute" in s == !!y && (y ? s.localName === y : s.nodeType === 3)) {
204
204
  _ = s, i[u] = null;
205
205
  break;
206
206
  }
207
207
  }
208
208
  if (_ == null) {
209
- if (g === null)
209
+ if (y === null)
210
210
  return document.createTextNode(p);
211
- _ = r ? document.createElementNS("http://www.w3.org/2000/svg", g) : document.createElement(g, p.is && p), i = null, l = !1;
211
+ _ = r ? document.createElementNS("http://www.w3.org/2000/svg", y) : document.createElement(y, p.is && p), i = null, l = !1;
212
212
  }
213
- if (g === null)
214
- y === p || l && _.data === p || (_.data = p);
213
+ if (y === null)
214
+ g === p || l && _.data === p || (_.data = p);
215
215
  else {
216
- if (i = i && F.call(_.childNodes), y = t.props || $, !l && i != null)
217
- for (y = {}, u = 0; u < _.attributes.length; u++)
218
- y[(s = _.attributes[u]).name] = s.value;
219
- for (u in y)
220
- s = y[u], u == "children" || (u == "dangerouslySetInnerHTML" ? o = s : u === "key" || u in p || S(_, u, null, s, r));
216
+ if (i = i && F.call(_.childNodes), g = t.props || $, !l && i != null)
217
+ for (g = {}, u = 0; u < _.attributes.length; u++)
218
+ g[(s = _.attributes[u]).name] = s.value;
219
+ for (u in g)
220
+ s = g[u], u == "children" || (u == "dangerouslySetInnerHTML" ? o = s : u === "key" || u in p || S(_, u, null, s, r));
221
221
  for (u in p)
222
- s = p[u], u == "children" ? h = s : u == "dangerouslySetInnerHTML" ? d = s : u == "value" ? m = s : u == "checked" ? k = s : u === "key" || l && typeof s != "function" || y[u] === s || S(_, u, s, y[u], r);
222
+ s = p[u], u == "children" ? h = s : u == "dangerouslySetInnerHTML" ? d = s : u == "value" ? m = s : u == "checked" ? k = s : u === "key" || l && typeof s != "function" || g[u] === s || S(_, u, s, g[u], r);
223
223
  if (d)
224
224
  l || o && (d.__html === o.__html || d.__html === _.innerHTML) || (_.innerHTML = d.__html), e.__k = [];
225
- else if (o && (_.innerHTML = ""), p_(_, G(h) ? h : [h], e, t, n, r && g !== "foreignObject", i, c, i ? i[0] : t.__k && E(t, 0), l, a), i != null)
225
+ else if (o && (_.innerHTML = ""), p_(_, G(h) ? h : [h], e, t, n, r && y !== "foreignObject", i, c, i ? i[0] : t.__k && E(t, 0), l, a), i != null)
226
226
  for (u = i.length; u--; )
227
227
  i[u] != null && d_(i[u]);
228
- l || (u = "value", m !== void 0 && (m !== _[u] || g === "progress" && !m || g === "option" && m !== y[u]) && S(_, u, m, y[u], !1), u = "checked", k !== void 0 && k !== _[u] && S(_, u, k, y[u], !1));
228
+ l || (u = "value", m !== void 0 && (m !== _[u] || y === "progress" && !m || y === "option" && m !== g[u]) && S(_, u, m, g[u], !1), u = "checked", k !== void 0 && k !== _[u] && S(_, u, k, g[u], !1));
229
229
  }
230
230
  return _;
231
231
  }
@@ -277,8 +277,8 @@ F = f_.slice, f = { __e: function(_, e, t, n) {
277
277
  }, I.prototype.render = B, w = [], s_ = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, O = function(_, e) {
278
278
  return _.__v.__b - e.__v.__b;
279
279
  }, A.__r = 0;
280
- var W, v, Z, n_, j = 0, y_ = [], M = [], o_ = f.__b, r_ = f.__r, i_ = f.diffed, l_ = f.__c, u_ = f.unmount;
281
- function g_(_, e) {
280
+ var W, v, Z, n_, j = 0, g_ = [], M = [], o_ = f.__b, r_ = f.__r, i_ = f.diffed, l_ = f.__c, u_ = f.unmount;
281
+ function y_(_, e) {
282
282
  f.__h && f.__h(v, _, j || e), j = 0;
283
283
  var t = v.__H || (v.__H = { __: [], __h: [] });
284
284
  return _ >= t.__.length && t.__.push({ __V: M }), t.__[_];
@@ -287,7 +287,7 @@ function M_(_) {
287
287
  return j = 1, U_(b_, _);
288
288
  }
289
289
  function U_(_, e, t) {
290
- var n = g_(W++, 2);
290
+ var n = y_(W++, 2);
291
291
  if (n.t = _, !n.__c && (n.__ = [t ? t(e) : b_(void 0, e), function(l) {
292
292
  var a = n.__N ? n.__N[0] : n.__[0], u = n.t(a, l);
293
293
  a !== u && (n.__N = [u, n.__[1]], n.__c.setState({}));
@@ -323,11 +323,11 @@ function U_(_, e, t) {
323
323
  return n.__N || n.__;
324
324
  }
325
325
  function A_(_, e) {
326
- var t = g_(W++, 3);
326
+ var t = y_(W++, 3);
327
327
  !f.__s && F_(t.__H, e) && (t.__ = _, t.i = e, v.__H.__h.push(t));
328
328
  }
329
329
  function W_() {
330
- for (var _; _ = y_.shift(); )
330
+ for (var _; _ = g_.shift(); )
331
331
  if (_.__P && _.__H)
332
332
  try {
333
333
  _.__H.__h.forEach(U), _.__H.__h.forEach(z), _.__H.__h = [];
@@ -346,7 +346,7 @@ f.__b = function(_) {
346
346
  }, f.diffed = function(_) {
347
347
  i_ && i_(_);
348
348
  var e = _.__c;
349
- e && e.__H && (e.__H.__h.length && (y_.push(e) !== 1 && n_ === f.requestAnimationFrame || ((n_ = f.requestAnimationFrame) || V_)(W_)), e.__H.__.forEach(function(t) {
349
+ e && e.__H && (e.__H.__h.length && (g_.push(e) !== 1 && n_ === f.requestAnimationFrame || ((n_ = f.requestAnimationFrame) || V_)(W_)), e.__H.__.forEach(function(t) {
350
350
  t.i && (t.__H = t.i), t.__V !== M && (t.__ = t.__V), t.i = void 0, t.__V = M;
351
351
  })), Z = v = null;
352
352
  }, f.__c = function(_, e) {
@@ -419,6 +419,9 @@ class q_ {
419
419
  setContext(e) {
420
420
  this._context = e, this._getContextCallbacks.forEach((t) => t(e)), this._getContextCallbacks = [];
421
421
  }
422
+ configureClient(e) {
423
+ console.log("Client configured");
424
+ }
422
425
  }
423
426
  let V;
424
427
  const T_ = ({
@@ -1 +1 @@
1
- (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,w)=>k in b?Z_(b,k,{enumerable:!0,configurable:!0,writable:!0,value:w}):b[k]=w;var Y=(b,k,w)=>(j_(b,typeof k!="symbol"?k+"":k,w),w);var k=(_=>(_.Javascript="Javascript",_.CSS="CSS",_))(k||{}),w=(_=>(_.SingleLineText="SingleLineText",_.MultiLineText="MultiLineText",_.Heading="Heading",_.Number="Number",_.Boolean="Boolean",_.Select="Select",_.Asset="Asset",_.Color="Color",_))(w||{}),__=(_=>(_.Data="Data",_.Font="Font",_.Frame="Frame",_.Illustration="Illustration",_.Image="Image",_.Model="Model",_.Material="Material",_.Color="Color",_.Video="Video",_.ColorProfile="ColorProfile",_.Environment="Environment",_))(__||{}),N,s,e_,$,t_,n_,Z,S={},o_=[],H_=/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 $_(_,e,t){var n,r,i,c={};for(i in e)i=="key"?n=e[i]:i=="ref"?r=e[i]:c[i]=e[i];if(arguments.length>2&&(c.children=arguments.length>3?N.call(arguments,2):t),typeof _=="function"&&_.defaultProps!=null)for(i in _.defaultProps)c[i]===void 0&&(c[i]=_.defaultProps[i]);return I(_,c,n,r,null)}function I(_,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 L(_){return _.children}function M(_,e){this.props=_,this.context=e}function P(_,e){if(e==null)return _.__?P(_.__,_.__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"?P(_):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)&&$.push(_)&&!T.__r++||t_!==s.debounceRendering)&&((t_=s.debounceRendering)||n_)(T)}function T(){var _,e,t,n,r,i,c,l,a;for($.sort(Z);_=$.shift();)_.__d&&(e=$.length,n=void 0,i=(r=(t=_).__v).__e,l=[],a=[],(c=t.__P)&&((n=E({},r)).__v=r.__v+1,s.vnode&&s.vnode(n),R(c,n,r,t.__n,c.ownerSVGElement!==void 0,32&r.__u?[i]:null,l,i??P(r),!!(32&r.__u),a),n.__.__k[n.__i]=n,d_(l,n,a),n.__e!=i&&i_(n)),$.length>e&&$.sort(Z));T.__r=0}function u_(_,e,t,n,r,i,c,l,a,u,d){var o,p,f,m,C,y=n&&n.__k||o_,h=e.length;for(t.__d=a,P_(t,e,y),a=t.__d,o=0;o<h;o++)(f=t.__k[o])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?S:y[f.__i]||S,f.__i=o,R(_,f,p,r,i,c,l,a,u,d),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&z(p.ref,null,f),d.push(f.ref,f.__c||m,f)),C==null&&m!=null&&(C=m),65536&f.__u||p.__k===f.__k?a=c_(f,a,_):typeof f.type=="function"&&f.__d!==void 0?a=f.__d:m&&(a=m.nextSibling),f.__d=void 0,f.__u&=-196609);t.__d=a,t.__e=C}function P_(_,e,t){var n,r,i,c,l,a=e.length,u=t.length,d=u,o=0;for(_.__k=[],n=0;n<a;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?I(null,r,null,null,r):j(r)?I(L,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?I(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=_,r.__b=_.__b+1,l=S_(r,t,c=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!==c&&(l===c+1?o++:l>c?d>a-c?o+=l-c:o--:o=l<c&&l==c-1?l-c:0,l!==n+o&&(r.__u|=65536))):(i=t[n])&&i.key==null&&i.__e&&(i.__e==_.__d&&(_.__d=P(i)),G(i,i,!1),t[n]=null,d--);if(d)for(n=0;n<u;n++)(i=t[n])!=null&&!(131072&i.__u)&&(i.__e==_.__d&&(_.__d=P(i)),G(i,i))}function c_(_,e,t){var n,r;if(typeof _.type=="function"){for(n=_.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=_,e=c_(n[r],e,t));return e}return _.__e!=e&&(t.insertBefore(_.__e,e||null),e=_.__e),e&&e.nextSibling}function S_(_,e,t,n){var r=_.key,i=_.type,c=t-1,l=t+1,a=e[t];if(a===null||a&&r==a.key&&i===a.type)return t;if(n>(a!=null&&!(131072&a.__u)?1:0))for(;c>=0||l<e.length;){if(c>=0){if((a=e[c])&&!(131072&a.__u)&&r==a.key&&i===a.type)return c;c--}if(l<e.length){if((a=e[l])&&!(131072&a.__u)&&r==a.key&&i===a.type)return l;l++}}return-1}function a_(_,e,t){e[0]==="-"?_.setProperty(e,t??""):_[e]=t==null?"":typeof t!="number"||H_.test(e)?t:t+"px"}function U(_,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||a_(_.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||a_(_.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_:f_,i)):_.removeEventListener(e,i?s_:f_,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 f_(_){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,c,l,a,u){var d,o,p,f,m,C,y,h,g,H,B,D,E_,O,X,x=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),i=[l=e.__e=t.__e]),(d=s.__b)&&d(e);_:if(typeof x=="function")try{if(h=e.props,g=(d=x.contextType)&&n[d.__c],H=d?g?g.props.value:d.__:n,t.__c?y=(o=e.__c=t.__c).__=o.__E:("prototype"in x&&x.prototype.render?e.__c=o=new x(h,H):(e.__c=o=new M(h,H),o.constructor=x,o.render=N_),g&&g.sub(o),o.props=h,o.state||(o.state={}),o.context=H,o.__n=n,p=o.__d=!0,o.__h=[],o._sb=[]),o.__s==null&&(o.__s=o.state),x.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=E({},o.__s)),E(o.__s,x.getDerivedStateFromProps(h,o.__s))),f=o.props,m=o.state,o.__v=e,p)x.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(x.getDerivedStateFromProps==null&&h!==f&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(h,H),!o.__e&&(o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(h,o.__s,H)===!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&&c.push(o);break _}o.componentWillUpdate!=null&&o.componentWillUpdate(h,o.__s,H),o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(f,m,C)})}if(o.context=H,o.props=h,o.__P=_,o.__e=!1,D=s.__r,E_=0,"prototype"in x&&x.prototype.render){for(o.state=o.__s,o.__d=!1,D&&D(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,D&&D(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||(C=o.getSnapshotBeforeUpdate(f,m)),u_(_,j(X=d!=null&&d.type===L&&d.key==null?d.props.children:d)?X:[X],e,t,n,r,i,c,l,a,u),o.base=e.__e,e.__u&=-161,o.__h.length&&c.push(o),y&&(o.__E=o.__=null)}catch(q){e.__v=null,a||i!=null?(e.__e=l,e.__u|=a?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=D_(t.__e,e,t,n,r,i,c,a,u);(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 D_(_,e,t,n,r,i,c,l,a){var u,d,o,p,f,m,C,y=t.props,h=e.props,g=e.type;if(g==="svg"&&(r=!0),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!g&&(g?f.localName===g:f.nodeType===3)){_=f,i[u]=null;break}}if(_==null){if(g===null)return document.createTextNode(h);_=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,h.is&&h),i=null,l=!1}if(g===null)y===h||l&&_.data===h||(_.data=h);else{if(i=i&&N.call(_.childNodes),y=t.props||S,!l&&i!=null)for(y={},u=0;u<_.attributes.length;u++)y[(f=_.attributes[u]).name]=f.value;for(u in y)f=y[u],u=="children"||(u=="dangerouslySetInnerHTML"?o=f:u==="key"||u in h||U(_,u,null,f,r));for(u in h)f=h[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?d=f:u=="value"?m=f:u=="checked"?C=f:u==="key"||l&&typeof f!="function"||y[u]===f||U(_,u,f,y[u],r);if(d)l||o&&(d.__html===o.__html||d.__html===_.innerHTML)||(_.innerHTML=d.__html),e.__k=[];else if(o&&(_.innerHTML=""),u_(_,j(p)?p:[p],e,t,n,r&&g!=="foreignObject",i,c,i?i[0]:t.__k&&P(t,0),l,a),i!=null)for(u=i.length;u--;)i[u]!=null&&r_(i[u]);l||(u="value",m!==void 0&&(m!==_[u]||g==="progress"&&!m||g==="option"&&m!==y[u])&&U(_,u,m,y[u],!1),u="checked",C!==void 0&&C!==_[u]&&U(_,u,C,y[u],!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 N_(_,e,t){return this.constructor(_,t)}function I_(_,e,t){var n,r,i,c;s.__&&s.__(_,e),r=(n=typeof t=="function")?null:t&&t.__k||e.__k,i=[],c=[],R(e,_=(!n&&t||e).__k=$_(L,null,[_]),r||S,S,e.ownerSVGElement!==void 0,!n&&t?[t]:r?null:e.firstChild?N.call(e.childNodes):null,i,!n&&t?t:r?r.__e:e.firstChild,n,c),d_(i,_,c)}N=o_.slice,s={__e:function(_,e,t,n){for(var r,i,c;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(_)),c=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(_,n||{}),c=r.__d),c)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=L,$=[],n_=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Z=function(_,e){return _.__v.__b-e.__v.__b},T.__r=0;var A,v,J,p_,K=0,h_=[],W=[],v_=s.__b,m_=s.__r,y_=s.diffed,g_=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:W}),t.__[_]}function L_(_){return K=1,M_(C_,_)}function M_(_,e,t){var n=k_(A++,2);if(n.t=_,!n.__c&&(n.__=[t?t(e):C_(void 0,e),function(l){var a=n.__N?n.__N[0]:n.__[0],u=n.t(a,l);a!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=v,!v.u)){var r=function(l,a,u){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,a,u);var o=!1;return d.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(o=!0)}}),!(!o&&n.__c.props===l)&&(!i||i.call(this,l,a,u))};v.u=!0;var i=v.shouldComponentUpdate,c=v.componentWillUpdate;v.componentWillUpdate=function(l,a,u){if(this.__e){var d=i;i=void 0,r(l,a,u),i=d}c&&c.call(this,l,a,u)},v.shouldComponentUpdate=r}return n.__N||n.__}function T_(_,e){var t=k_(A++,3);!s.__s&&W_(t.__H,e)&&(t.__=_,t.i=e,v.__H.__h.push(t))}function U_(){for(var _;_=h_.shift();)if(_.__P&&_.__H)try{_.__H.__h.forEach(F),_.__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=W,t.__N=t.i=void 0})):(e.__h.forEach(F),e.__h.forEach(Q),e.__h=[],A=0)),J=v},s.diffed=function(_){y_&&y_(_);var e=_.__c;e&&e.__H&&(e.__H.__h.length&&(h_.push(e)!==1&&p_===s.requestAnimationFrame||((p_=s.requestAnimationFrame)||A_)(U_)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==W&&(t.__=t.__V),t.i=void 0,t.__V=W})),J=v=null},s.__c=function(_,e){e.some(function(t){try{t.__h.forEach(F),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)}}),g_&&g_(_,e)},s.unmount=function(_){b_&&b_(_);var e,t=_.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{F(n)}catch(r){e=r}}),t.__H=void 0,e&&s.__e(e,t.__v))};var x_=typeof requestAnimationFrame=="function";function A_(_){var e,t=function(){clearTimeout(n),x_&&cancelAnimationFrame(e),setTimeout(_)},n=setTimeout(t,100);x_&&(e=requestAnimationFrame(t))}function F(_){var e=v,t=_.__c;typeof t=="function"&&(_.__c=void 0,t()),v=e}function Q(_){var e=v;_.__c=_.__(),v=e}function W_(_,e){return!_||_.length!==e.length||e.some(function(t,n){return t!==_[n]})}function C_(_,e){return typeof e=="function"?e(_):e}var F_=0;function w_(_,e,t,n,r,i){var c,l,a={};for(l in e)l=="ref"?c=e[l]:a[l]=e[l];var u={type:_,props:a,key:t,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--F_,__i:-1,__u:0,__source:r,__self:i};if(typeof _=="function"&&(c=_.defaultProps))for(l in c)a[l]===void 0&&(a[l]=c[l]);return s.vnode&&s.vnode(u),u}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=[]}}let V;const B_=({context:_})=>{const[e,t]=L_(null);return T_(()=>{if(e){if(V===void 0)throw new Error("Please call setSpiffDevOptions before requesting the context.");V.setContext({..._,container:e})}},[e,_]),w_("div",{ref:t,id:"spiffThemeWrapper"})};function O_(_,e){V=new V_,window.SpiffThemeLoader=V;let t;typeof _=="string"?t=document.getElementById(_):t=_,I_(w_(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.SpiffAssetType=__,b.SpiffThemeConfigurationFieldType=w,b.SpiffThemeFileType=k,b.exampleThemeInstallConfig=q_,b.setSpiffDevOptions=O_,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
1
+ (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,w)=>k in b?Z_(b,k,{enumerable:!0,configurable:!0,writable:!0,value:w}):b[k]=w;var Y=(b,k,w)=>(j_(b,typeof k!="symbol"?k+"":k,w),w);var k=(_=>(_.Javascript="Javascript",_.CSS="CSS",_))(k||{}),w=(_=>(_.SingleLineText="SingleLineText",_.MultiLineText="MultiLineText",_.Heading="Heading",_.Number="Number",_.Boolean="Boolean",_.Select="Select",_.Asset="Asset",_.Color="Color",_))(w||{}),__=(_=>(_.Data="Data",_.Font="Font",_.Frame="Frame",_.Illustration="Illustration",_.Image="Image",_.Model="Model",_.Material="Material",_.Color="Color",_.Video="Video",_.ColorProfile="ColorProfile",_.Environment="Environment",_))(__||{}),N,s,e_,$,t_,n_,Z,S={},o_=[],H_=/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 $_(_,e,t){var n,r,i,c={};for(i in e)i=="key"?n=e[i]:i=="ref"?r=e[i]:c[i]=e[i];if(arguments.length>2&&(c.children=arguments.length>3?N.call(arguments,2):t),typeof _=="function"&&_.defaultProps!=null)for(i in _.defaultProps)c[i]===void 0&&(c[i]=_.defaultProps[i]);return I(_,c,n,r,null)}function I(_,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 L(_){return _.children}function M(_,e){this.props=_,this.context=e}function P(_,e){if(e==null)return _.__?P(_.__,_.__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"?P(_):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)&&$.push(_)&&!T.__r++||t_!==s.debounceRendering)&&((t_=s.debounceRendering)||n_)(T)}function T(){var _,e,t,n,r,i,c,l,a;for($.sort(Z);_=$.shift();)_.__d&&(e=$.length,n=void 0,i=(r=(t=_).__v).__e,l=[],a=[],(c=t.__P)&&((n=E({},r)).__v=r.__v+1,s.vnode&&s.vnode(n),R(c,n,r,t.__n,c.ownerSVGElement!==void 0,32&r.__u?[i]:null,l,i??P(r),!!(32&r.__u),a),n.__.__k[n.__i]=n,d_(l,n,a),n.__e!=i&&i_(n)),$.length>e&&$.sort(Z));T.__r=0}function u_(_,e,t,n,r,i,c,l,a,u,d){var o,p,f,m,C,y=n&&n.__k||o_,h=e.length;for(t.__d=a,P_(t,e,y),a=t.__d,o=0;o<h;o++)(f=t.__k[o])!=null&&typeof f!="boolean"&&typeof f!="function"&&(p=f.__i===-1?S:y[f.__i]||S,f.__i=o,R(_,f,p,r,i,c,l,a,u,d),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&z(p.ref,null,f),d.push(f.ref,f.__c||m,f)),C==null&&m!=null&&(C=m),65536&f.__u||p.__k===f.__k?a=c_(f,a,_):typeof f.type=="function"&&f.__d!==void 0?a=f.__d:m&&(a=m.nextSibling),f.__d=void 0,f.__u&=-196609);t.__d=a,t.__e=C}function P_(_,e,t){var n,r,i,c,l,a=e.length,u=t.length,d=u,o=0;for(_.__k=[],n=0;n<a;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?I(null,r,null,null,r):j(r)?I(L,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?I(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=_,r.__b=_.__b+1,l=S_(r,t,c=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!==c&&(l===c+1?o++:l>c?d>a-c?o+=l-c:o--:o=l<c&&l==c-1?l-c:0,l!==n+o&&(r.__u|=65536))):(i=t[n])&&i.key==null&&i.__e&&(i.__e==_.__d&&(_.__d=P(i)),G(i,i,!1),t[n]=null,d--);if(d)for(n=0;n<u;n++)(i=t[n])!=null&&!(131072&i.__u)&&(i.__e==_.__d&&(_.__d=P(i)),G(i,i))}function c_(_,e,t){var n,r;if(typeof _.type=="function"){for(n=_.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=_,e=c_(n[r],e,t));return e}return _.__e!=e&&(t.insertBefore(_.__e,e||null),e=_.__e),e&&e.nextSibling}function S_(_,e,t,n){var r=_.key,i=_.type,c=t-1,l=t+1,a=e[t];if(a===null||a&&r==a.key&&i===a.type)return t;if(n>(a!=null&&!(131072&a.__u)?1:0))for(;c>=0||l<e.length;){if(c>=0){if((a=e[c])&&!(131072&a.__u)&&r==a.key&&i===a.type)return c;c--}if(l<e.length){if((a=e[l])&&!(131072&a.__u)&&r==a.key&&i===a.type)return l;l++}}return-1}function a_(_,e,t){e[0]==="-"?_.setProperty(e,t??""):_[e]=t==null?"":typeof t!="number"||H_.test(e)?t:t+"px"}function U(_,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||a_(_.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||a_(_.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_:f_,i)):_.removeEventListener(e,i?s_:f_,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 f_(_){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,c,l,a,u){var d,o,p,f,m,C,y,h,g,H,B,D,E_,O,X,x=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),i=[l=e.__e=t.__e]),(d=s.__b)&&d(e);_:if(typeof x=="function")try{if(h=e.props,g=(d=x.contextType)&&n[d.__c],H=d?g?g.props.value:d.__:n,t.__c?y=(o=e.__c=t.__c).__=o.__E:("prototype"in x&&x.prototype.render?e.__c=o=new x(h,H):(e.__c=o=new M(h,H),o.constructor=x,o.render=N_),g&&g.sub(o),o.props=h,o.state||(o.state={}),o.context=H,o.__n=n,p=o.__d=!0,o.__h=[],o._sb=[]),o.__s==null&&(o.__s=o.state),x.getDerivedStateFromProps!=null&&(o.__s==o.state&&(o.__s=E({},o.__s)),E(o.__s,x.getDerivedStateFromProps(h,o.__s))),f=o.props,m=o.state,o.__v=e,p)x.getDerivedStateFromProps==null&&o.componentWillMount!=null&&o.componentWillMount(),o.componentDidMount!=null&&o.__h.push(o.componentDidMount);else{if(x.getDerivedStateFromProps==null&&h!==f&&o.componentWillReceiveProps!=null&&o.componentWillReceiveProps(h,H),!o.__e&&(o.shouldComponentUpdate!=null&&o.shouldComponentUpdate(h,o.__s,H)===!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&&c.push(o);break _}o.componentWillUpdate!=null&&o.componentWillUpdate(h,o.__s,H),o.componentDidUpdate!=null&&o.__h.push(function(){o.componentDidUpdate(f,m,C)})}if(o.context=H,o.props=h,o.__P=_,o.__e=!1,D=s.__r,E_=0,"prototype"in x&&x.prototype.render){for(o.state=o.__s,o.__d=!1,D&&D(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,D&&D(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||(C=o.getSnapshotBeforeUpdate(f,m)),u_(_,j(X=d!=null&&d.type===L&&d.key==null?d.props.children:d)?X:[X],e,t,n,r,i,c,l,a,u),o.base=e.__e,e.__u&=-161,o.__h.length&&c.push(o),y&&(o.__E=o.__=null)}catch(q){e.__v=null,a||i!=null?(e.__e=l,e.__u|=a?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=D_(t.__e,e,t,n,r,i,c,a,u);(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 D_(_,e,t,n,r,i,c,l,a){var u,d,o,p,f,m,C,y=t.props,h=e.props,g=e.type;if(g==="svg"&&(r=!0),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!g&&(g?f.localName===g:f.nodeType===3)){_=f,i[u]=null;break}}if(_==null){if(g===null)return document.createTextNode(h);_=r?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,h.is&&h),i=null,l=!1}if(g===null)y===h||l&&_.data===h||(_.data=h);else{if(i=i&&N.call(_.childNodes),y=t.props||S,!l&&i!=null)for(y={},u=0;u<_.attributes.length;u++)y[(f=_.attributes[u]).name]=f.value;for(u in y)f=y[u],u=="children"||(u=="dangerouslySetInnerHTML"?o=f:u==="key"||u in h||U(_,u,null,f,r));for(u in h)f=h[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?d=f:u=="value"?m=f:u=="checked"?C=f:u==="key"||l&&typeof f!="function"||y[u]===f||U(_,u,f,y[u],r);if(d)l||o&&(d.__html===o.__html||d.__html===_.innerHTML)||(_.innerHTML=d.__html),e.__k=[];else if(o&&(_.innerHTML=""),u_(_,j(p)?p:[p],e,t,n,r&&g!=="foreignObject",i,c,i?i[0]:t.__k&&P(t,0),l,a),i!=null)for(u=i.length;u--;)i[u]!=null&&r_(i[u]);l||(u="value",m!==void 0&&(m!==_[u]||g==="progress"&&!m||g==="option"&&m!==y[u])&&U(_,u,m,y[u],!1),u="checked",C!==void 0&&C!==_[u]&&U(_,u,C,y[u],!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 N_(_,e,t){return this.constructor(_,t)}function I_(_,e,t){var n,r,i,c;s.__&&s.__(_,e),r=(n=typeof t=="function")?null:t&&t.__k||e.__k,i=[],c=[],R(e,_=(!n&&t||e).__k=$_(L,null,[_]),r||S,S,e.ownerSVGElement!==void 0,!n&&t?[t]:r?null:e.firstChild?N.call(e.childNodes):null,i,!n&&t?t:r?r.__e:e.firstChild,n,c),d_(i,_,c)}N=o_.slice,s={__e:function(_,e,t,n){for(var r,i,c;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(_)),c=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(_,n||{}),c=r.__d),c)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=L,$=[],n_=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Z=function(_,e){return _.__v.__b-e.__v.__b},T.__r=0;var A,v,J,p_,K=0,h_=[],W=[],v_=s.__b,m_=s.__r,y_=s.diffed,g_=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:W}),t.__[_]}function L_(_){return K=1,M_(C_,_)}function M_(_,e,t){var n=k_(A++,2);if(n.t=_,!n.__c&&(n.__=[t?t(e):C_(void 0,e),function(l){var a=n.__N?n.__N[0]:n.__[0],u=n.t(a,l);a!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=v,!v.u)){var r=function(l,a,u){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,a,u);var o=!1;return d.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(o=!0)}}),!(!o&&n.__c.props===l)&&(!i||i.call(this,l,a,u))};v.u=!0;var i=v.shouldComponentUpdate,c=v.componentWillUpdate;v.componentWillUpdate=function(l,a,u){if(this.__e){var d=i;i=void 0,r(l,a,u),i=d}c&&c.call(this,l,a,u)},v.shouldComponentUpdate=r}return n.__N||n.__}function T_(_,e){var t=k_(A++,3);!s.__s&&W_(t.__H,e)&&(t.__=_,t.i=e,v.__H.__h.push(t))}function U_(){for(var _;_=h_.shift();)if(_.__P&&_.__H)try{_.__H.__h.forEach(F),_.__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=W,t.__N=t.i=void 0})):(e.__h.forEach(F),e.__h.forEach(Q),e.__h=[],A=0)),J=v},s.diffed=function(_){y_&&y_(_);var e=_.__c;e&&e.__H&&(e.__H.__h.length&&(h_.push(e)!==1&&p_===s.requestAnimationFrame||((p_=s.requestAnimationFrame)||A_)(U_)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==W&&(t.__=t.__V),t.i=void 0,t.__V=W})),J=v=null},s.__c=function(_,e){e.some(function(t){try{t.__h.forEach(F),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)}}),g_&&g_(_,e)},s.unmount=function(_){b_&&b_(_);var e,t=_.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{F(n)}catch(r){e=r}}),t.__H=void 0,e&&s.__e(e,t.__v))};var x_=typeof requestAnimationFrame=="function";function A_(_){var e,t=function(){clearTimeout(n),x_&&cancelAnimationFrame(e),setTimeout(_)},n=setTimeout(t,100);x_&&(e=requestAnimationFrame(t))}function F(_){var e=v,t=_.__c;typeof t=="function"&&(_.__c=void 0,t()),v=e}function Q(_){var e=v;_.__c=_.__(),v=e}function W_(_,e){return!_||_.length!==e.length||e.some(function(t,n){return t!==_[n]})}function C_(_,e){return typeof e=="function"?e(_):e}var F_=0;function w_(_,e,t,n,r,i){var c,l,a={};for(l in e)l=="ref"?c=e[l]:a[l]=e[l];var u={type:_,props:a,key:t,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--F_,__i:-1,__u:0,__source:r,__self:i};if(typeof _=="function"&&(c=_.defaultProps))for(l in c)a[l]===void 0&&(a[l]=c[l]);return s.vnode&&s.vnode(u),u}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")}}let V;const B_=({context:_})=>{const[e,t]=L_(null);return T_(()=>{if(e){if(V===void 0)throw new Error("Please call setSpiffDevOptions before requesting the context.");V.setContext({..._,container:e})}},[e,_]),w_("div",{ref:t,id:"spiffThemeWrapper"})};function O_(_,e){V=new V_,window.SpiffThemeLoader=V;let t;typeof _=="string"?t=document.getElementById(_):t=_,I_(w_(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.SpiffAssetType=__,b.SpiffThemeConfigurationFieldType=w,b.SpiffThemeFileType=k,b.exampleThemeInstallConfig=q_,b.setSpiffDevOptions=O_,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/theme-bridge",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "tsc && vite build",