@spiffcommerce/theme-bridge 1.25.2 → 1.25.3
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.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -162,5 +162,5 @@ Check the render method of %s.`,Be(ar)||"Unknown"));var v=ju(s,f);v.payload={ele
|
|
|
162
162
|
|
|
163
163
|
let root = createRoot(domContainer);
|
|
164
164
|
root.render(<App />);`),t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(u=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError),t.transitionCallbacks!==void 0&&t.transitionCallbacks);var f=TR(e,Fh,null,a,i,u,s);Oh(f.current,e);var p=e.nodeType===Ln?e.parentNode:e;return Jd(p),new cE(f)}function Bm(e){this._internalRoot=e}function F_(e){e&&Zv(e)}Bm.prototype.unstable_scheduleHydration=F_;function j_(e,t,a){if(!Im(e))throw new Error("hydrateRoot(...): Target container is not a DOM element.");QR(e),t===void 0&&S("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var i=a??null,u=a!=null&&a.hydratedSources||null,s=!1,f=!1,p="",v=YR;a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onRecoverableError!==void 0&&(v=a.onRecoverableError));var y=wR(t,null,e,Fh,i,s,f,p,v);if(Oh(y.current,e),Jd(e),u)for(var g=0;g<u.length;g++){var _=u[g];Bx(y,_)}return new Bm(y)}function Im(e){return!!(e&&(e.nodeType===Qr||e.nodeType===Ii||e.nodeType===td))}function Gp(e){return!!(e&&(e.nodeType===Qr||e.nodeType===Ii||e.nodeType===td||e.nodeType===Ln&&e.nodeValue===" react-mount-point-unstable "))}function QR(e){e.nodeType===Qr&&e.tagName&&e.tagName.toUpperCase()==="BODY"&&S("createRoot(): Creating roots directly with document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try using a container element created for your app."),cp(e)&&(e._reactRootContainer?S("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):S("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}var H_=k.ReactCurrentOwner,$R;$R=function(e){if(e._reactRootContainer&&e.nodeType!==Ln){var t=bR(e._reactRootContainer.current);t&&t.parentNode!==e&&S("render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container.")}var a=!!e._reactRootContainer,i=fE(e),u=!!(i&&_o(i));u&&!a&&S("render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render."),e.nodeType===Qr&&e.tagName&&e.tagName.toUpperCase()==="BODY"&&S("render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app.")};function fE(e){return e?e.nodeType===Ii?e.documentElement:e.firstChild:null}function WR(){}function V_(e,t,a,i,u){if(u){if(typeof i=="function"){var s=i;i=function(){var w=Pm(f);s.call(w)}}var f=wR(t,i,e,ko,null,!1,!1,"",WR);e._reactRootContainer=f,Oh(f.current,e);var p=e.nodeType===Ln?e.parentNode:e;return Jd(p),Bu(),f}else{for(var v;v=e.lastChild;)e.removeChild(v);if(typeof i=="function"){var y=i;i=function(){var w=Pm(g);y.call(w)}}var g=TR(e,ko,null,!1,!1,"",WR);e._reactRootContainer=g,Oh(g.current,e);var _=e.nodeType===Ln?e.parentNode:e;return Jd(_),Bu(function(){Wp(t,g,a,i)}),g}}function P_(e,t){e!==null&&typeof e!="function"&&S("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.",t,e)}function Ym(e,t,a,i,u){$R(a),P_(u===void 0?null:u,"render");var s=a._reactRootContainer,f;if(!s)f=V_(a,t,e,u,i);else{if(f=s,typeof u=="function"){var p=u;u=function(){var v=Pm(f);p.call(v)}}Wp(t,f,e,u)}return Pm(f)}var GR=!1;function B_(e){{GR||(GR=!0,S("findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node"));var t=H_.current;if(t!==null&&t.stateNode!==null){var a=t.stateNode._warnedAboutRefsInRender;a||S("%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",Tt(t.type)||"A component"),t.stateNode._warnedAboutRefsInRender=!0}}return e==null?null:e.nodeType===Qr?e:b_(e,"findDOMNode")}function I_(e,t,a){if(S("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Gp(t))throw new Error("Target container is not a DOM element.");{var i=cp(t)&&t._reactRootContainer===void 0;i&&S("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?")}return Ym(null,e,t,!0,a)}function Y_(e,t,a){if(S("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Gp(t))throw new Error("Target container is not a DOM element.");{var i=cp(t)&&t._reactRootContainer===void 0;i&&S("You are calling ReactDOM.render() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?")}return Ym(null,e,t,!1,a)}function Q_(e,t,a,i){if(S("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot"),!Gp(a))throw new Error("Target container is not a DOM element.");if(e==null||!oy(e))throw new Error("parentComponent must be a valid React Component");return Ym(e,t,a,!1,i)}var qR=!1;function $_(e){if(qR||(qR=!0,S("unmountComponentAtNode is deprecated and will be removed in the next major release. Switch to the createRoot API. Learn more: https://reactjs.org/link/switch-to-createroot")),!Gp(e))throw new Error("unmountComponentAtNode(...): Target container is not a DOM element.");{var t=cp(e)&&e._reactRootContainer===void 0;t&&S("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?")}if(e._reactRootContainer){{var a=fE(e),i=a&&!_o(a);i&&S("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.")}return Bu(function(){Ym(null,null,e,!1,function(){e._reactRootContainer=null,YE(e)})}),!0}else{{var u=fE(e),s=!!(u&&_o(u)),f=e.nodeType===Qr&&Gp(e.parentNode)&&!!e.parentNode._reactRootContainer;s&&S("unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",f?"You may have accidentally passed in a React root node instead of its container.":"Instead, have the parent component update its state and rerender in order to remove this component.")}return!1}}Rr(__),go(D_),Gv(k_),Ds(za),Ad(Qv),(typeof Map!="function"||Map.prototype==null||typeof Map.prototype.forEach!="function"||typeof Set!="function"||Set.prototype==null||typeof Set.prototype.clear!="function"||typeof Set.prototype.forEach!="function")&&S("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),mc(GT),uy(BS,jb,Bu);function W_(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!Im(t))throw new Error("Target container is not a DOM element.");return x_(e,t,null,a)}function G_(e,t,a,i){return Q_(e,t,a,i)}var dE={usingClientEntryPoint:!1,Events:[_o,Sf,Lh,lo,yc,BS]};function q_(e,t){return dE.usingClientEntryPoint||S('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),A_(e,t)}function X_(e,t,a){return dE.usingClientEntryPoint||S('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".'),j_(e,t,a)}function K_(e){return nR()&&S("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."),Bu(e)}var Z_=U_({findFiberByHostInstance:Bs,bundleType:1,version:iE,rendererPackageName:"react-dom"});if(!Z_&&kn&&window.top===window.self&&(navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge")===-1||navigator.userAgent.indexOf("Firefox")>-1)){var XR=window.location.protocol;/^(https?|file):$/.test(XR)&&console.info("%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools"+(XR==="file:"?`
|
|
165
|
-
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}Ba.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dE,Ba.createPortal=W_,Ba.createRoot=q_,Ba.findDOMNode=B_,Ba.flushSync=K_,Ba.hydrate=I_,Ba.hydrateRoot=X_,Ba.render=Y_,Ba.unmountComponentAtNode=$_,Ba.unstable_batchedUpdates=BS,Ba.unstable_renderSubtreeIntoContainer=G_,Ba.version=iE,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()),Ba}var sT;function yD(){if(sT)return Wm.exports;sT=1;function x(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(x)}catch(j){console.error(j)}}}return process.env.NODE_ENV==="production"?(x(),Wm.exports=hD()):Wm.exports=mD(),Wm.exports}var cT;function gD(){if(cT)return Yf;cT=1;var x=yD();if(process.env.NODE_ENV==="production")Yf.createRoot=x.createRoot,Yf.hydrateRoot=x.hydrateRoot;else{var j=x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Yf.createRoot=function(k,Ve){j.usingClientEntryPoint=!0;try{return x.createRoot(k,Ve)}finally{j.usingClientEntryPoint=!1}},Yf.hydrateRoot=function(k,Ve,at){j.usingClientEntryPoint=!0;try{return x.hydrateRoot(k,Ve,at)}finally{j.usingClientEntryPoint=!1}}}return Yf}var SD=gD();class ED{_context=void 0;_getContextCallbacks=[];async getContext(){return this._context?this._context:new Promise(j=>{this._getContextCallbacks.push(j)})}setContext(j){this._context=j,this._getContextCallbacks.forEach(k=>k(j)),this._getContextCallbacks=[]}configureClient(j){console.log("Client configured")}themeLoaded(){console.log("Theme loaded")}close(){console.log("Theme closed")}addToEcommerceCart(j){console.log("Add to cart",j)}completeQuote(){console.log("Complete quote")}navigateToCustomerPortal(){console.log("Navigating to customer portal")}}let Xm;const CD=({context:x})=>{const[j,k]=rT.useState(null);return rT.useEffect(()=>{if(j){if(Xm===void 0)throw new Error("Please call setSpiffDevOptions before requesting the context.");Xm.setContext({...x,container:j})}},[j,x]),pT.jsx("div",{ref:k,id:"spiffThemeWrapper"})};function RD(x,j){Xm=new ED,window.SpiffThemeLoader=Xm;let k;typeof x=="string"?k=document.getElementById(x):k=x,SD.createRoot(k).render(pT.jsx(CD,{context:j}))}function TD(x){return{id:"example",themeInstallId:x?.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:[],...x}}const wD=x=>{if(Object.keys(x).includes("defaultValue"))return x.defaultValue};function xD(x,...j){return x.fields.filter(k=>!k.key||!j.includes(k.key)).map(k=>({key:k.key,fallbackToDefaultConfiguration:!1,value:wD(k),type:k.type,asset:void 0}))}const bD="1.25.
|
|
165
|
+
You might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq`:""),"font-weight:bold")}Ba.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dE,Ba.createPortal=W_,Ba.createRoot=q_,Ba.findDOMNode=B_,Ba.flushSync=K_,Ba.hydrate=I_,Ba.hydrateRoot=X_,Ba.render=Y_,Ba.unmountComponentAtNode=$_,Ba.unstable_batchedUpdates=BS,Ba.unstable_renderSubtreeIntoContainer=G_,Ba.version=iE,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()),Ba}var sT;function yD(){if(sT)return Wm.exports;sT=1;function x(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(x)}catch(j){console.error(j)}}}return process.env.NODE_ENV==="production"?(x(),Wm.exports=hD()):Wm.exports=mD(),Wm.exports}var cT;function gD(){if(cT)return Yf;cT=1;var x=yD();if(process.env.NODE_ENV==="production")Yf.createRoot=x.createRoot,Yf.hydrateRoot=x.hydrateRoot;else{var j=x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Yf.createRoot=function(k,Ve){j.usingClientEntryPoint=!0;try{return x.createRoot(k,Ve)}finally{j.usingClientEntryPoint=!1}},Yf.hydrateRoot=function(k,Ve,at){j.usingClientEntryPoint=!0;try{return x.hydrateRoot(k,Ve,at)}finally{j.usingClientEntryPoint=!1}}}return Yf}var SD=gD();class ED{_context=void 0;_getContextCallbacks=[];async getContext(){return this._context?this._context:new Promise(j=>{this._getContextCallbacks.push(j)})}setContext(j){this._context=j,this._getContextCallbacks.forEach(k=>k(j)),this._getContextCallbacks=[]}configureClient(j){console.log("Client configured")}themeLoaded(){console.log("Theme loaded")}close(){console.log("Theme closed")}addToEcommerceCart(j){console.log("Add to cart",j)}completeQuote(){console.log("Complete quote")}navigateToCustomerPortal(){console.log("Navigating to customer portal")}}let Xm;const CD=({context:x})=>{const[j,k]=rT.useState(null);return rT.useEffect(()=>{if(j){if(Xm===void 0)throw new Error("Please call setSpiffDevOptions before requesting the context.");Xm.setContext({...x,container:j})}},[j,x]),pT.jsx("div",{ref:k,id:"spiffThemeWrapper"})};function RD(x,j){Xm=new ED,window.SpiffThemeLoader=Xm;let k;typeof x=="string"?k=document.getElementById(x):k=x,SD.createRoot(k).render(pT.jsx(CD,{context:j}))}function TD(x){return{id:"example",themeInstallId:x?.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:[],...x}}const wD=x=>{if(Object.keys(x).includes("defaultValue"))return x.defaultValue};function xD(x,...j){return x.fields.filter(k=>!k.key||!j.includes(k.key)).map(k=>({key:k.key,fallbackToDefaultConfiguration:!1,value:wD(k),type:k.type,asset:void 0}))}const bD="1.25.2",_D={version:bD};function DD(x,j,k){if(j.type==="chunk"){if(console.log(`chunk ${x} isEntry: ${j.isEntry}, isDynamicEntry: ${j.isDynamicEntry}, isImplicitEntry: ${j.isImplicitEntry}`),!j.isEntry&&!k)return null;if(!j.isDynamicEntry)return{type:exports.ThemeFileType.Javascript,mimeType:"text/javascript",preload:!j.isEntry,filename:x}}else if(x.endsWith(".css"))return{type:exports.ThemeFileType.CSS,mimeType:"text/css",filename:x};return null}function kD(x){const{autoGenerateTargetFiles:j=!0,configurationSchema:k,includePreloadChunks:Ve=!1,targetFiles:at}=x??{};return{name:"spiff-theme-plugin",version:_D.version,config(dt,S){dt.base!==void 0&&dt.base!==""&&console.warn('You have specified a `base` in your vite configuration other than "". This value will now be overwritten.'),dt.base=""},writeBundle(dt,S){const Ut=j?Object.keys(S).map(ue=>at?.some(Je=>Je.filename===ue)?null:DD(ue,S[ue],Ve)).filter(ue=>ue!==null):[];at&&Ut.push(...at);const ce={launchData:{targetFiles:Ut},configurationSchema:k};nD.writeFileSync(rD.join(dt.dir,"spiffTheme.json"),JSON.stringify(ce,void 0,4))}}}Object.defineProperty(exports,"ConversionDataType",{enumerable:!0,get:()=>tD.ConversionDataType});exports.exampleThemeInstallConfig=TD;exports.getDefaultsForSchema=xD;exports.setSpiffDevOptions=RD;exports.spiffThemePlugin=kD;exports.themeInstallConfigurationFieldsToRecordObject=aD;exports.themeInstallConfigurationGraphQlToResource=uD;exports.themeInstallConfigurationToRecordObject=iD;exports.themeVersionConfigurationGraphQlToResource=dT;exports.themeVersionGraphQlToResource=lD;
|
|
166
166
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -21358,7 +21358,7 @@ function FD(x, ...j) {
|
|
|
21358
21358
|
asset: void 0
|
|
21359
21359
|
}));
|
|
21360
21360
|
}
|
|
21361
|
-
const TD = "1.25.
|
|
21361
|
+
const TD = "1.25.2", wD = {
|
|
21362
21362
|
version: TD
|
|
21363
21363
|
};
|
|
21364
21364
|
function xD(x, j, k) {
|