@sitecore/byoc
Advanced tools
Comparing version 0.0.14 to 0.0.16
@@ -0,1 +1,12 @@ | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
import { transformSchema, transformUiSchema, getSchemaProperties, parseValue } from './schema.js'; | ||
@@ -9,6 +20,6 @@ import { toKebabCase } from './utils.js'; | ||
*/ | ||
const { thumbnail = 'https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg', name, id = options.name, group = null, ui, isHidden = false, uiSchema: explicitUISchema, schema: explicitSchema, ...schemaOptions } = options; | ||
const { thumbnail = 'https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg', name, id = options.name, group = null, ui, isHidden = false, uiSchema: explicitUISchema, schema: explicitSchema } = options, schemaOptions = __rest(options, ["thumbnail", "name", "id", "group", "ui", "isHidden", "uiSchema", "schema"]); | ||
const schemaBase = explicitSchema || schemaOptions || {}; | ||
const useSchemaBase = explicitUISchema || ui || {}; | ||
const schema = transformSchema({ description: 'External component', ...schemaBase, type: 'object' }, defaults); | ||
const schema = transformSchema(Object.assign(Object.assign({ description: 'External component' }, schemaBase), { type: 'object' }), defaults); | ||
const uiSchema = transformUiSchema(useSchemaBase, schema.properties || {}); | ||
@@ -156,3 +167,3 @@ return { | ||
if (overload) | ||
base = { ...base, ...overload, component: overload.component || (base === null || base === void 0 ? void 0 : base.component) }; | ||
base = Object.assign(Object.assign(Object.assign({}, base), overload), { component: overload.component || (base === null || base === void 0 ? void 0 : base.component) }); | ||
// merge query string as default values | ||
@@ -166,23 +177,5 @@ query.split(/\&/g).forEach((pair) => { | ||
// merge in k/v pair as default value | ||
base = { | ||
...base, | ||
schema: { | ||
...base.schema, | ||
properties: { | ||
...base.schema.properties, | ||
[k]: { | ||
...propertyDefinition, | ||
default: parseValue(decodeURIComponent(v), propertyDefinition.type) | ||
} | ||
} | ||
}, | ||
uiSchema: { | ||
...base.uiSchema, | ||
base = Object.assign(Object.assign({}, base), { schema: Object.assign(Object.assign({}, base.schema), { properties: Object.assign(Object.assign({}, base.schema.properties), { [k]: Object.assign(Object.assign({}, propertyDefinition), { default: parseValue(decodeURIComponent(v), propertyDefinition.type) }) }) }), uiSchema: Object.assign(Object.assign({}, base.uiSchema), { | ||
// hide preconfigured properties | ||
[k]: { | ||
...base.uiSchema[k], | ||
'ui:widget': (_c = (_b = base.uiSchema[k]) === null || _b === void 0 ? void 0 : _b['ui:widget']) !== null && _c !== void 0 ? _c : 'hidden' | ||
} | ||
} | ||
}; | ||
[k]: Object.assign(Object.assign({}, base.uiSchema[k]), { 'ui:widget': (_c = (_b = base.uiSchema[k]) === null || _b === void 0 ? void 0 : _b['ui:widget']) !== null && _c !== void 0 ? _c : 'hidden' }) }) }); | ||
}); | ||
@@ -189,0 +182,0 @@ } |
@@ -0,1 +1,12 @@ | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
import React from "react"; | ||
@@ -18,3 +29,3 @@ import { getComponent, getComponentProperties, isWebComponent, registered, } from "@sitecore/byoc"; | ||
// See if component is registered in current context | ||
const { componentName, ...attributes } = props; | ||
const { componentName } = props, attributes = __rest(props, ["componentName"]); | ||
const Component = (_a = getComponent(componentName)) === null || _a === void 0 ? void 0 : _a.component; | ||
@@ -25,3 +36,3 @@ if (!NextComponents.get(componentName)) { | ||
ssr: false, | ||
loading: () => (React.createElement(RegularComponent, { ...attributes, componentName: componentName })), | ||
loading: () => (React.createElement(RegularComponent, Object.assign({}, attributes, { componentName: componentName }))), | ||
}); | ||
@@ -31,3 +42,3 @@ NextComponents.set(componentName, Dynamic); | ||
const External = NextComponents.get(componentName); | ||
return (React.createElement(External, { ...props, fallback: Component ? React.createElement(Component, { ...props }) : null })); | ||
return (React.createElement(External, Object.assign({}, props, { fallback: Component ? React.createElement(Component, Object.assign({}, props)) : null }))); | ||
} | ||
@@ -77,3 +88,3 @@ /** | ||
export function RegularComponent(props) { | ||
const { componentName, fallback, ...attributes } = props; | ||
const { componentName, fallback } = props, attributes = __rest(props, ["componentName", "fallback"]); | ||
const definition = getComponent(componentName); | ||
@@ -87,11 +98,8 @@ const Component = definition === null || definition === void 0 ? void 0 : definition.component; | ||
if (Component && isWebComponent(Component)) { | ||
return React.createElement("byoc-" + toKebabCase(definition.id), { | ||
...objectKeysToKebabCase(parsed), | ||
suppressHydrationWarning: true, | ||
}); | ||
return React.createElement("byoc-" + toKebabCase(definition.id), Object.assign(Object.assign({}, objectKeysToKebabCase(parsed)), { suppressHydrationWarning: true })); | ||
} | ||
// execute component as a function to supress hydration errors inside | ||
return (React.createElement(React.Fragment, null, | ||
React.createElement("feaas-external", { ...objectKeysToKebabCase(parsed), "data-external-id": componentName, suppressHydrationWarning: true, hydrate: "false" }, Component == null ? null : React.createElement(Component, { ...parsed })))); | ||
React.createElement("feaas-external", Object.assign({}, objectKeysToKebabCase(parsed), { "data-external-id": componentName, suppressHydrationWarning: true, hydrate: "false" }), Component == null ? null : React.createElement(Component, Object.assign({}, parsed))))); | ||
} | ||
//# sourceMappingURL=react.js.map |
@@ -8,11 +8,8 @@ import { toCamelCase, toKebabCase } from './utils.js'; | ||
const properties = schema.properties || {}; | ||
return { | ||
return Object.assign(Object.assign({ | ||
/** 2. Assign schema type unless given */ | ||
type: 'object', | ||
...schema, | ||
properties: Object.keys(properties).reduce((acc, key) => Object.assign(acc, { | ||
[key]: { | ||
...properties[key], | ||
type: 'object' }, schema), { properties: Object.keys(properties).reduce((acc, key) => Object.assign(acc, { | ||
[key]: Object.assign(Object.assign({}, properties[key]), { | ||
/** 3. Assign default value from the explicit defaults object*/ | ||
default: defaults.hasOwnProperty(key) ? defaults[key] : properties[key].default, | ||
default: defaults.hasOwnProperty(key) ? defaults[key] : properties[key].default, | ||
/** 4. Generate fallback title */ | ||
@@ -23,12 +20,8 @@ title: properties[key].title || | ||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) | ||
.join(' ') | ||
} | ||
}), {}) | ||
}; | ||
.join(' ') }) | ||
}), {}) }); | ||
} | ||
/** Make UI schema assumptions to improve the ui */ | ||
export const transformUiSchema = (uiSchema, properties) => { | ||
let transformed = { | ||
...uiSchema | ||
}; | ||
let transformed = Object.assign({}, uiSchema); | ||
/* use updown input widget as default for numbers */ | ||
@@ -39,3 +32,3 @@ const numberProperties = Object.keys(properties).filter((key) => /(integer|number)/.test(properties[key].type)); | ||
if (!((_a = transformed[propertyName]) === null || _a === void 0 ? void 0 : _a['ui:widget'])) | ||
transformed[propertyName] = { ...transformed[propertyName], 'ui:widget': 'updown' }; | ||
transformed[propertyName] = Object.assign(Object.assign({}, transformed[propertyName]), { 'ui:widget': 'updown' }); | ||
}); | ||
@@ -82,3 +75,3 @@ return transformed; | ||
if (parsed != null && !name.startsWith('data-attribute') && !['class', 'id', 'contenteditable'].includes(name)) { | ||
return { ...prev, [prop]: parsed }; | ||
return Object.assign(Object.assign({}, prev), { [prop]: parsed }); | ||
} | ||
@@ -95,6 +88,3 @@ else { | ||
export function getSchemaProperties(schema, props) { | ||
return { | ||
...getSchemaDefaults(schema), | ||
...parseSchemaProperties(schema, props) | ||
}; | ||
return Object.assign(Object.assign({}, getSchemaDefaults(schema)), parseSchemaProperties(schema, props)); | ||
} | ||
@@ -106,3 +96,3 @@ /** Get properties with their default non-null values*/ | ||
if (((_a = schema.properties[prop]) === null || _a === void 0 ? void 0 : _a.default) != null) { | ||
return { ...prev, [prop]: (_b = schema.properties[prop]) === null || _b === void 0 ? void 0 : _b.default }; | ||
return Object.assign(Object.assign({}, prev), { [prop]: (_b = schema.properties[prop]) === null || _b === void 0 ? void 0 : _b.default }); | ||
} | ||
@@ -109,0 +99,0 @@ else { |
@@ -1,2 +0,2 @@ | ||
var T=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[d(r)]:e[r]}),{}),L=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[m(r)]:e[r]}),{});function d(e){let t=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return m(e).replace(t,function(r){return"-"+r.toLowerCase()})}function m(e){return e=e.replace(/[-_ ]+/g," "),e=e.charAt(0).toLowerCase()+e.slice(1),e.split(/\s+/).map((t,r)=>r===0?t:t.charAt(0).toUpperCase()+t.slice(1)).join("")}function v(e,t={}){let r=e.properties||{};return{type:"object",...e,properties:Object.keys(r).reduce((o,n)=>Object.assign(o,{[n]:{...r[n],default:t.hasOwnProperty(n)?t[n]:r[n].default,title:r[n].title||d(n).split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ")}}),{})}}var w=(e,t)=>{let r={...e};return Object.keys(t).filter(n=>/(integer|number)/.test(t[n].type)).forEach(n=>{var i;!((i=r[n])===null||i===void 0)&&i["ui:widget"]||(r[n]={...r[n],"ui:widget":"updown"})}),r};function g(e,t){switch(t){case"string":return e;case"object":try{return typeof e=="object"&&e!=null?e:JSON.parse(e)}catch{return null}case"array":try{return Array.isArray(e)?e:JSON.parse(e)}catch{return null}case"number":return parseFloat(e);case"integer":return parseInt(e);case"boolean":return e=="true"||e=="1";default:return e}}function _(e,t){return Object.keys(t).reduce((r,o)=>{let n=t[o],i=m(o),s=e?.properties[i],c=s?.type,a=g(n,c);return a!=null&&!o.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(o)?{...r,[i]:a}:r},{})}function y(e,t){return{...A(e),..._(e,t)}}function A(e){return Object.keys(e.properties).reduce((t,r)=>{var o,n;return((o=e.properties[r])===null||o===void 0?void 0:o.default)!=null?{...t,[r]:(n=e.properties[r])===null||n===void 0?void 0:n.default}:t},{})}function P(e,t,r){let{thumbnail:o="https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg",name:n,id:i=e.name,group:s=null,ui:c,isHidden:a=!1,uiSchema:u,schema:h,...l}=e,O=h||l||{},j=u||c||{},p=v({description:"External component",...O,type:"object"},r),E=w(j,p.properties||{});return{component:t,name:n,schema:p,uiSchema:E,thumbnail:o,group:s,isHidden:a,id:i,title:p?.title||l?.title||n}}var C,D=typeof HTMLElement<"u"?HTMLElement:typeof windowJSDOM<"u"?windowJSDOM.HTMLElement:class{setAttribute(){}},f=typeof window<"u"?window.BYOCComponents||(window.BYOCComponents={}):{};function J(e,t,r={}){if(!t?.name)throw new Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(t));let o=P(t,e,r);f[o.id]=o,K(e)&&b.register("byoc-"+d(t.name),void 0,e),S()}function K(e){return e&&"prototype"in e&&"setAttribute"in e.prototype}function I(e,t={}){var r;let o=(r=x(e))===null||r===void 0?void 0:r.schema;return o?y(o,t):t}function N(e){let t=x(e);return Object.keys(t?.schema.properties||{}).filter(r=>{var o,n;return((n=(o=t?.uiSchema)===null||o===void 0?void 0:o[r])===null||n===void 0?void 0:n["ui:widget"])!="hidden"})}function x(e){if(typeof e!="string"){if(e&&"schema"in e)return e;throw new Error(`Component name should be a string, got ${typeof e}`)}let[t,r]=e.split("?");var o=f[t];if(r){let n=f[e];if(!n&&!o)return null;n&&(o={...o,...n,component:n.component||o?.component}),r.split(/\&/g).forEach(i=>{var s,c,a;let[u,h]=i.split("="),l=((s=o.schema.properties)===null||s===void 0?void 0:s[u])||{type:"string"};o={...o,schema:{...o.schema,properties:{...o.schema.properties,[u]:{...l,default:g(decodeURIComponent(h),l.type)}}},uiSchema:{...o.uiSchema,[u]:{...o.uiSchema[u],"ui:widget":(a=(c=o.uiSchema[u])===null||c===void 0?void 0:c["ui:widget"])!==null&&a!==void 0?a:"hidden"}}}})}return o}function S(){clearTimeout(C),C=setTimeout(()=>{var e;typeof window<"u"&&window.parent!==window&&((e=window.parent)===null||e===void 0||e.postMessage(JSON.stringify({action:"register-components",data:Object.values(f)}),"*"))},30)}S();var b=class extends D{connectedCallback(){try{JSON.parse(String(this.getAttribute("components"))).forEach(t=>{J(null,t)})}catch{}}static register(t,r,o=this){r==null&&(r=typeof window<"u"?window:void 0),r&&!r.customElements.get(t)&&r.customElements.define(t,o)}};b.register("byoc-registration");export{b as BYOCRegistration,D as WebComponent,x as getComponent,N as getComponentConfigurablePropertyNames,I as getComponentProperties,A as getSchemaDefaults,y as getSchemaProperties,K as isWebComponent,P as normalizeOptions,L as objectKeysToCamelCase,T as objectKeysToKebabCase,_ as parseSchemaProperties,g as parseValue,J as registerComponent,f as registered,S as setRegistrationCallback,m as toCamelCase,d as toKebabCase,v as transformSchema,w as transformUiSchema}; | ||
var L=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[d(r)]:e[r]}),{}),M=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[b(r)]:e[r]}),{});function d(e){let t=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return b(e).replace(t,function(r){return"-"+r.toLowerCase()})}function b(e){return e=e.replace(/[-_ ]+/g," "),e=e.charAt(0).toLowerCase()+e.slice(1),e.split(/\s+/).map((t,r)=>r===0?t:t.charAt(0).toUpperCase()+t.slice(1)).join("")}function h(e,t={}){let r=e.properties||{};return Object.assign(Object.assign({type:"object"},e),{properties:Object.keys(r).reduce((n,o)=>Object.assign(n,{[o]:Object.assign(Object.assign({},r[o]),{default:t.hasOwnProperty(o)?t[o]:r[o].default,title:r[o].title||d(o).split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ")})}),{})})}var j=(e,t)=>{let r=Object.assign({},e);return Object.keys(t).filter(o=>/(integer|number)/.test(t[o].type)).forEach(o=>{var i;!((i=r[o])===null||i===void 0)&&i["ui:widget"]||(r[o]=Object.assign(Object.assign({},r[o]),{"ui:widget":"updown"}))}),r};function O(e,t){switch(t){case"string":return e;case"object":try{return typeof e=="object"&&e!=null?e:JSON.parse(e)}catch(r){return null}case"array":try{return Array.isArray(e)?e:JSON.parse(e)}catch(r){return null}case"number":return parseFloat(e);case"integer":return parseInt(e);case"boolean":return e=="true"||e=="1";default:return e}}function _(e,t){return Object.keys(t).reduce((r,n)=>{let o=t[n],i=b(n),s=e==null?void 0:e.properties[i],c=s==null?void 0:s.type,a=O(o,c);return a!=null&&!n.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(n)?Object.assign(Object.assign({},r),{[i]:a}):r},{})}function y(e,t){return Object.assign(Object.assign({},P(e)),_(e,t))}function P(e){return Object.keys(e.properties).reduce((t,r)=>{var n,o;return((n=e.properties[r])===null||n===void 0?void 0:n.default)!=null?Object.assign(Object.assign({},t),{[r]:(o=e.properties[r])===null||o===void 0?void 0:o.default}):t},{})}var A=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function D(e,t,r){let{thumbnail:n="https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg",name:o,id:i=e.name,group:s=null,ui:c,isHidden:a=!1,uiSchema:u,schema:g}=e,l=A(e,["thumbnail","name","id","group","ui","isHidden","uiSchema","schema"]),x=g||l||{},S=u||c||{},p=h(Object.assign(Object.assign({description:"External component"},x),{type:"object"}),r),E=j(S,p.properties||{});return{component:t,name:o,schema:p,uiSchema:E,thumbnail:n,group:s,isHidden:a,id:i,title:(p==null?void 0:p.title)||(l==null?void 0:l.title)||o}}var v,J=typeof HTMLElement!="undefined"?HTMLElement:typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{setAttribute(){}},m=typeof window!="undefined"?window.BYOCComponents||(window.BYOCComponents={}):{};function K(e,t,r={}){if(!(t!=null&&t.name))throw new Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(t));let n=D(t,e,r);m[n.id]=n,T(e)&&f.register("byoc-"+d(t.name),void 0,e),C()}function T(e){return e&&"prototype"in e&&"setAttribute"in e.prototype}function N(e,t={}){var r;let n=(r=w(e))===null||r===void 0?void 0:r.schema;return n?y(n,t):t}function W(e){let t=w(e);return Object.keys((t==null?void 0:t.schema.properties)||{}).filter(r=>{var n,o;return((o=(n=t==null?void 0:t.uiSchema)===null||n===void 0?void 0:n[r])===null||o===void 0?void 0:o["ui:widget"])!="hidden"})}function w(e){if(typeof e!="string"){if(e&&"schema"in e)return e;throw new Error(`Component name should be a string, got ${typeof e}`)}let[t,r]=e.split("?");var n=m[t];if(r){let o=m[e];if(!o&&!n)return null;o&&(n=Object.assign(Object.assign(Object.assign({},n),o),{component:o.component||(n==null?void 0:n.component)})),r.split(/\&/g).forEach(i=>{var s,c,a;let[u,g]=i.split("="),l=((s=n.schema.properties)===null||s===void 0?void 0:s[u])||{type:"string"};n=Object.assign(Object.assign({},n),{schema:Object.assign(Object.assign({},n.schema),{properties:Object.assign(Object.assign({},n.schema.properties),{[u]:Object.assign(Object.assign({},l),{default:O(decodeURIComponent(g),l.type)})})}),uiSchema:Object.assign(Object.assign({},n.uiSchema),{[u]:Object.assign(Object.assign({},n.uiSchema[u]),{"ui:widget":(a=(c=n.uiSchema[u])===null||c===void 0?void 0:c["ui:widget"])!==null&&a!==void 0?a:"hidden"})})})})}return n}function C(){clearTimeout(v),v=setTimeout(()=>{var e;typeof window!="undefined"&&window.parent!==window&&((e=window.parent)===null||e===void 0||e.postMessage(JSON.stringify({action:"register-components",data:Object.values(m)}),"*"))},30)}C();var f=class extends J{connectedCallback(){try{JSON.parse(String(this.getAttribute("components"))).forEach(t=>{K(null,t)})}catch(t){}}static register(t,r,n=this){r==null&&(r=typeof window!="undefined"?window:void 0),r&&!r.customElements.get(t)&&r.customElements.define(t,n)}};f.register("byoc-registration");export{f as BYOCRegistration,J as WebComponent,w as getComponent,W as getComponentConfigurablePropertyNames,N as getComponentProperties,P as getSchemaDefaults,y as getSchemaProperties,T as isWebComponent,D as normalizeOptions,M as objectKeysToCamelCase,L as objectKeysToKebabCase,_ as parseSchemaProperties,O as parseValue,K as registerComponent,m as registered,C as setRegistrationCallback,b as toCamelCase,d as toKebabCase,h as transformSchema,j as transformUiSchema}; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"react";import{getComponent as p,getComponentProperties as f,isWebComponent as g,registered as x}from"@sitecore/byoc";import{objectKeysToKebabCase as u,toKebabCase as b}from"@sitecore/byoc";export*from"@sitecore/byoc";var s=new Map,m=null,c=null;function y(n){var t;let{componentName:r,...i}=n,o=(t=p(r))===null||t===void 0?void 0:t.component;if(!s.get(r)){let l=c(()=>Promise.resolve(m),{ssr:!1,loading:()=>e.createElement(d,{...i,componentName:r})});s.set(r,l)}let a=s.get(r);return e.createElement(a,{...n,fallback:o?e.createElement(o,{...n}):null})}function W(n,t){return c=n,m=t,t}function H(n){if(Object.keys(n).length!=0)return c?y(n):d(n)}function h(){return e.createElement(e.Fragment,null,e.createElement("byoc-registration",{components:JSON.stringify(Object.values(x)),suppressHydrationWarning:!0}),e.createElement(m,null))}function d(n){let{componentName:t,fallback:r,...i}=n,o=p(t),a=o?.component;if(!a&&r||!t)return e.createElement("feaas-external",{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},r);let l=f(t,i);delete l.suppressHydrationWarning;var C=null;return a&&g(a)?e.createElement("byoc-"+b(o.id),{...u(l),suppressHydrationWarning:!0}):e.createElement(e.Fragment,null,e.createElement("feaas-external",{...u(l),"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},a==null?null:e.createElement(a,{...l})))}export{h as Bundle,H as Component,y as NextComponent,d as RegularComponent,W as enableNextClientsideComponents}; | ||
import o from"react";import{getComponent as f,getComponentProperties as g,isWebComponent as d,registered as y}from"@sitecore/byoc";import{objectKeysToKebabCase as u,toKebabCase as O}from"@sitecore/byoc";export*from"@sitecore/byoc";var p=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]]);return a},s=new Map,c=null,m=null;function x(e){var t;let{componentName:a}=e,n=p(e,["componentName"]),r=(t=f(a))===null||t===void 0?void 0:t.component;if(!s.get(a)){let i=m(()=>Promise.resolve(c),{ssr:!1,loading:()=>o.createElement(b,Object.assign({},n,{componentName:a}))});s.set(a,i)}let l=s.get(a);return o.createElement(l,Object.assign({},e,{fallback:r?o.createElement(r,Object.assign({},e)):null}))}function N(e,t){return m=e,c=t,t}function h(e){if(Object.keys(e).length!=0)return m?x(e):b(e)}function W(){return o.createElement(o.Fragment,null,o.createElement("byoc-registration",{components:JSON.stringify(Object.values(y)),suppressHydrationWarning:!0}),o.createElement(c,null))}function b(e){let{componentName:t,fallback:a}=e,n=p(e,["componentName","fallback"]),r=f(t),l=r==null?void 0:r.component;if(!l&&a||!t)return o.createElement("feaas-external",{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},a);let i=g(t,n);delete i.suppressHydrationWarning;var j=null;return l&&d(l)?o.createElement("byoc-"+O(r.id),Object.assign(Object.assign({},u(i)),{suppressHydrationWarning:!0})):o.createElement(o.Fragment,null,o.createElement("feaas-external",Object.assign({},u(i),{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"}),l==null?null:o.createElement(l,Object.assign({},i))))}export{W as Bundle,h as Component,x as NextComponent,b as RegularComponent,N as enableNextClientsideComponents}; | ||
//# sourceMappingURL=react.esm.js.map |
@@ -1,2 +0,2 @@ | ||
var T=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[d(r)]:e[r]}),{}),L=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[m(r)]:e[r]}),{});function d(e){let t=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return m(e).replace(t,function(r){return"-"+r.toLowerCase()})}function m(e){return e=e.replace(/[-_ ]+/g," "),e=e.charAt(0).toLowerCase()+e.slice(1),e.split(/\s+/).map((t,r)=>r===0?t:t.charAt(0).toUpperCase()+t.slice(1)).join("")}function v(e,t={}){let r=e.properties||{};return{type:"object",...e,properties:Object.keys(r).reduce((o,n)=>Object.assign(o,{[n]:{...r[n],default:t.hasOwnProperty(n)?t[n]:r[n].default,title:r[n].title||d(n).split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ")}}),{})}}var w=(e,t)=>{let r={...e};return Object.keys(t).filter(n=>/(integer|number)/.test(t[n].type)).forEach(n=>{var i;!((i=r[n])===null||i===void 0)&&i["ui:widget"]||(r[n]={...r[n],"ui:widget":"updown"})}),r};function g(e,t){switch(t){case"string":return e;case"object":try{return typeof e=="object"&&e!=null?e:JSON.parse(e)}catch{return null}case"array":try{return Array.isArray(e)?e:JSON.parse(e)}catch{return null}case"number":return parseFloat(e);case"integer":return parseInt(e);case"boolean":return e=="true"||e=="1";default:return e}}function _(e,t){return Object.keys(t).reduce((r,o)=>{let n=t[o],i=m(o),s=e?.properties[i],c=s?.type,a=g(n,c);return a!=null&&!o.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(o)?{...r,[i]:a}:r},{})}function y(e,t){return{...A(e),..._(e,t)}}function A(e){return Object.keys(e.properties).reduce((t,r)=>{var o,n;return((o=e.properties[r])===null||o===void 0?void 0:o.default)!=null?{...t,[r]:(n=e.properties[r])===null||n===void 0?void 0:n.default}:t},{})}function P(e,t,r){let{thumbnail:o="https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg",name:n,id:i=e.name,group:s=null,ui:c,isHidden:a=!1,uiSchema:u,schema:h,...l}=e,O=h||l||{},j=u||c||{},p=v({description:"External component",...O,type:"object"},r),E=w(j,p.properties||{});return{component:t,name:n,schema:p,uiSchema:E,thumbnail:o,group:s,isHidden:a,id:i,title:p?.title||l?.title||n}}var C,D=typeof HTMLElement<"u"?HTMLElement:typeof windowJSDOM<"u"?windowJSDOM.HTMLElement:class{setAttribute(){}},f=typeof window<"u"?window.BYOCComponents||(window.BYOCComponents={}):{};function J(e,t,r={}){if(!t?.name)throw new Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(t));let o=P(t,e,r);f[o.id]=o,K(e)&&b.register("byoc-"+d(t.name),void 0,e),S()}function K(e){return e&&"prototype"in e&&"setAttribute"in e.prototype}function I(e,t={}){var r;let o=(r=x(e))===null||r===void 0?void 0:r.schema;return o?y(o,t):t}function N(e){let t=x(e);return Object.keys(t?.schema.properties||{}).filter(r=>{var o,n;return((n=(o=t?.uiSchema)===null||o===void 0?void 0:o[r])===null||n===void 0?void 0:n["ui:widget"])!="hidden"})}function x(e){if(typeof e!="string"){if(e&&"schema"in e)return e;throw new Error(`Component name should be a string, got ${typeof e}`)}let[t,r]=e.split("?");var o=f[t];if(r){let n=f[e];if(!n&&!o)return null;n&&(o={...o,...n,component:n.component||o?.component}),r.split(/\&/g).forEach(i=>{var s,c,a;let[u,h]=i.split("="),l=((s=o.schema.properties)===null||s===void 0?void 0:s[u])||{type:"string"};o={...o,schema:{...o.schema,properties:{...o.schema.properties,[u]:{...l,default:g(decodeURIComponent(h),l.type)}}},uiSchema:{...o.uiSchema,[u]:{...o.uiSchema[u],"ui:widget":(a=(c=o.uiSchema[u])===null||c===void 0?void 0:c["ui:widget"])!==null&&a!==void 0?a:"hidden"}}}})}return o}function S(){clearTimeout(C),C=setTimeout(()=>{var e;typeof window<"u"&&window.parent!==window&&((e=window.parent)===null||e===void 0||e.postMessage(JSON.stringify({action:"register-components",data:Object.values(f)}),"*"))},30)}S();var b=class extends D{connectedCallback(){try{JSON.parse(String(this.getAttribute("components"))).forEach(t=>{J(null,t)})}catch{}}static register(t,r,o=this){r==null&&(r=typeof window<"u"?window:void 0),r&&!r.customElements.get(t)&&r.customElements.define(t,o)}};b.register("byoc-registration");export{b as BYOCRegistration,D as WebComponent,x as getComponent,N as getComponentConfigurablePropertyNames,I as getComponentProperties,A as getSchemaDefaults,y as getSchemaProperties,K as isWebComponent,P as normalizeOptions,L as objectKeysToCamelCase,T as objectKeysToKebabCase,_ as parseSchemaProperties,g as parseValue,J as registerComponent,f as registered,S as setRegistrationCallback,m as toCamelCase,d as toKebabCase,v as transformSchema,w as transformUiSchema}; | ||
var L=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[d(r)]:e[r]}),{}),M=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[b(r)]:e[r]}),{});function d(e){let t=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return b(e).replace(t,function(r){return"-"+r.toLowerCase()})}function b(e){return e=e.replace(/[-_ ]+/g," "),e=e.charAt(0).toLowerCase()+e.slice(1),e.split(/\s+/).map((t,r)=>r===0?t:t.charAt(0).toUpperCase()+t.slice(1)).join("")}function h(e,t={}){let r=e.properties||{};return Object.assign(Object.assign({type:"object"},e),{properties:Object.keys(r).reduce((n,o)=>Object.assign(n,{[o]:Object.assign(Object.assign({},r[o]),{default:t.hasOwnProperty(o)?t[o]:r[o].default,title:r[o].title||d(o).split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ")})}),{})})}var j=(e,t)=>{let r=Object.assign({},e);return Object.keys(t).filter(o=>/(integer|number)/.test(t[o].type)).forEach(o=>{var i;!((i=r[o])===null||i===void 0)&&i["ui:widget"]||(r[o]=Object.assign(Object.assign({},r[o]),{"ui:widget":"updown"}))}),r};function O(e,t){switch(t){case"string":return e;case"object":try{return typeof e=="object"&&e!=null?e:JSON.parse(e)}catch(r){return null}case"array":try{return Array.isArray(e)?e:JSON.parse(e)}catch(r){return null}case"number":return parseFloat(e);case"integer":return parseInt(e);case"boolean":return e=="true"||e=="1";default:return e}}function _(e,t){return Object.keys(t).reduce((r,n)=>{let o=t[n],i=b(n),s=e==null?void 0:e.properties[i],c=s==null?void 0:s.type,a=O(o,c);return a!=null&&!n.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(n)?Object.assign(Object.assign({},r),{[i]:a}):r},{})}function y(e,t){return Object.assign(Object.assign({},P(e)),_(e,t))}function P(e){return Object.keys(e.properties).reduce((t,r)=>{var n,o;return((n=e.properties[r])===null||n===void 0?void 0:n.default)!=null?Object.assign(Object.assign({},t),{[r]:(o=e.properties[r])===null||o===void 0?void 0:o.default}):t},{})}var A=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function D(e,t,r){let{thumbnail:n="https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg",name:o,id:i=e.name,group:s=null,ui:c,isHidden:a=!1,uiSchema:u,schema:g}=e,l=A(e,["thumbnail","name","id","group","ui","isHidden","uiSchema","schema"]),x=g||l||{},S=u||c||{},p=h(Object.assign(Object.assign({description:"External component"},x),{type:"object"}),r),E=j(S,p.properties||{});return{component:t,name:o,schema:p,uiSchema:E,thumbnail:n,group:s,isHidden:a,id:i,title:(p==null?void 0:p.title)||(l==null?void 0:l.title)||o}}var v,J=typeof HTMLElement!="undefined"?HTMLElement:typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{setAttribute(){}},m=typeof window!="undefined"?window.BYOCComponents||(window.BYOCComponents={}):{};function K(e,t,r={}){if(!(t!=null&&t.name))throw new Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(t));let n=D(t,e,r);m[n.id]=n,T(e)&&f.register("byoc-"+d(t.name),void 0,e),C()}function T(e){return e&&"prototype"in e&&"setAttribute"in e.prototype}function N(e,t={}){var r;let n=(r=w(e))===null||r===void 0?void 0:r.schema;return n?y(n,t):t}function W(e){let t=w(e);return Object.keys((t==null?void 0:t.schema.properties)||{}).filter(r=>{var n,o;return((o=(n=t==null?void 0:t.uiSchema)===null||n===void 0?void 0:n[r])===null||o===void 0?void 0:o["ui:widget"])!="hidden"})}function w(e){if(typeof e!="string"){if(e&&"schema"in e)return e;throw new Error(`Component name should be a string, got ${typeof e}`)}let[t,r]=e.split("?");var n=m[t];if(r){let o=m[e];if(!o&&!n)return null;o&&(n=Object.assign(Object.assign(Object.assign({},n),o),{component:o.component||(n==null?void 0:n.component)})),r.split(/\&/g).forEach(i=>{var s,c,a;let[u,g]=i.split("="),l=((s=n.schema.properties)===null||s===void 0?void 0:s[u])||{type:"string"};n=Object.assign(Object.assign({},n),{schema:Object.assign(Object.assign({},n.schema),{properties:Object.assign(Object.assign({},n.schema.properties),{[u]:Object.assign(Object.assign({},l),{default:O(decodeURIComponent(g),l.type)})})}),uiSchema:Object.assign(Object.assign({},n.uiSchema),{[u]:Object.assign(Object.assign({},n.uiSchema[u]),{"ui:widget":(a=(c=n.uiSchema[u])===null||c===void 0?void 0:c["ui:widget"])!==null&&a!==void 0?a:"hidden"})})})})}return n}function C(){clearTimeout(v),v=setTimeout(()=>{var e;typeof window!="undefined"&&window.parent!==window&&((e=window.parent)===null||e===void 0||e.postMessage(JSON.stringify({action:"register-components",data:Object.values(m)}),"*"))},30)}C();var f=class extends J{connectedCallback(){try{JSON.parse(String(this.getAttribute("components"))).forEach(t=>{K(null,t)})}catch(t){}}static register(t,r,n=this){r==null&&(r=typeof window!="undefined"?window:void 0),r&&!r.customElements.get(t)&&r.customElements.define(t,n)}};f.register("byoc-registration");export{f as BYOCRegistration,J as WebComponent,w as getComponent,W as getComponentConfigurablePropertyNames,N as getComponentProperties,P as getSchemaDefaults,y as getSchemaProperties,T as isWebComponent,D as normalizeOptions,M as objectKeysToCamelCase,L as objectKeysToKebabCase,_ as parseSchemaProperties,O as parseValue,K as registerComponent,m as registered,C as setRegistrationCallback,b as toCamelCase,d as toKebabCase,h as transformSchema,j as transformUiSchema}; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"react";import{getComponent as p,getComponentProperties as f,isWebComponent as g,registered as x}from"@sitecore/byoc";import{objectKeysToKebabCase as u,toKebabCase as b}from"@sitecore/byoc";export*from"@sitecore/byoc";var s=new Map,m=null,c=null;function y(n){var t;let{componentName:r,...i}=n,o=(t=p(r))===null||t===void 0?void 0:t.component;if(!s.get(r)){let l=c(()=>Promise.resolve(m),{ssr:!1,loading:()=>e.createElement(d,{...i,componentName:r})});s.set(r,l)}let a=s.get(r);return e.createElement(a,{...n,fallback:o?e.createElement(o,{...n}):null})}function W(n,t){return c=n,m=t,t}function H(n){if(Object.keys(n).length!=0)return c?y(n):d(n)}function h(){return e.createElement(e.Fragment,null,e.createElement("byoc-registration",{components:JSON.stringify(Object.values(x)),suppressHydrationWarning:!0}),e.createElement(m,null))}function d(n){let{componentName:t,fallback:r,...i}=n,o=p(t),a=o?.component;if(!a&&r||!t)return e.createElement("feaas-external",{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},r);let l=f(t,i);delete l.suppressHydrationWarning;var C=null;return a&&g(a)?e.createElement("byoc-"+b(o.id),{...u(l),suppressHydrationWarning:!0}):e.createElement(e.Fragment,null,e.createElement("feaas-external",{...u(l),"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},a==null?null:e.createElement(a,{...l})))}export{h as Bundle,H as Component,y as NextComponent,d as RegularComponent,W as enableNextClientsideComponents}; | ||
import o from"react";import{getComponent as f,getComponentProperties as g,isWebComponent as d,registered as y}from"@sitecore/byoc";import{objectKeysToKebabCase as u,toKebabCase as O}from"@sitecore/byoc";export*from"@sitecore/byoc";var p=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(a[n[r]]=e[n[r]]);return a},s=new Map,c=null,m=null;function x(e){var t;let{componentName:a}=e,n=p(e,["componentName"]),r=(t=f(a))===null||t===void 0?void 0:t.component;if(!s.get(a)){let i=m(()=>Promise.resolve(c),{ssr:!1,loading:()=>o.createElement(b,Object.assign({},n,{componentName:a}))});s.set(a,i)}let l=s.get(a);return o.createElement(l,Object.assign({},e,{fallback:r?o.createElement(r,Object.assign({},e)):null}))}function N(e,t){return m=e,c=t,t}function h(e){if(Object.keys(e).length!=0)return m?x(e):b(e)}function W(){return o.createElement(o.Fragment,null,o.createElement("byoc-registration",{components:JSON.stringify(Object.values(y)),suppressHydrationWarning:!0}),o.createElement(c,null))}function b(e){let{componentName:t,fallback:a}=e,n=p(e,["componentName","fallback"]),r=f(t),l=r==null?void 0:r.component;if(!l&&a||!t)return o.createElement("feaas-external",{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},a);let i=g(t,n);delete i.suppressHydrationWarning;var j=null;return l&&d(l)?o.createElement("byoc-"+O(r.id),Object.assign(Object.assign({},u(i)),{suppressHydrationWarning:!0})):o.createElement(o.Fragment,null,o.createElement("feaas-external",Object.assign({},u(i),{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"}),l==null?null:o.createElement(l,Object.assign({},i))))}export{W as Bundle,h as Component,x as NextComponent,b as RegularComponent,N as enableNextClientsideComponents}; | ||
//# sourceMappingURL=react.esm.js.map |
@@ -5,6 +5,6 @@ { | ||
"description": "Bring-Your-Own-Components runtime to register and retrieve react components", | ||
"version": "0.0.14", | ||
"version": "0.0.16", | ||
"scripts": { | ||
"test": "npx vitest", | ||
"types": "tsc", | ||
"types": "tsc -p tsconfig.json", | ||
"build:esbuild": "node scripts/build.js", | ||
@@ -11,0 +11,0 @@ "build": "npm run types && npm run build:esbuild", |
@@ -1,2 +0,2 @@ | ||
"use strict";var C=Object.create;var d=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},p=(e,t,n,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of v(t))!W.call(e,l)&&l!==n&&d(e,l,{get:()=>t[l],enumerable:!(m=E(t,l))||m.enumerable});return e},o=(e,t,n)=>(p(e,t,"default"),n&&p(n,t,"default")),h=(e,t,n)=>(n=e!=null?C(N(e)):{},p(t||!e||!e.__esModule?d(n,"default",{value:e,enumerable:!0}):n,e)),j=e=>p(d({},"__esModule",{value:!0}),e);var r={};H(r,{Bundle:()=>K,Component:()=>F,NextComponent:()=>y,RegularComponent:()=>b,enableNextClientsideComponents:()=>k});module.exports=j(r);var a=h(require("react"),1),i=require("@sitecore/byoc"),u=require("@sitecore/byoc");o(r,require("@sitecore/byoc"),module.exports);var f=new Map,g=null,x=null;function y(e){var t;let{componentName:n,...m}=e,l=(t=(0,i.getComponent)(n))===null||t===void 0?void 0:t.component;if(!f.get(n)){let c=x(()=>Promise.resolve(g),{ssr:!1,loading:()=>a.default.createElement(b,{...m,componentName:n})});f.set(n,c)}let s=f.get(n);return a.default.createElement(s,{...e,fallback:l?a.default.createElement(l,{...e}):null})}function k(e,t){return x=e,g=t,t}function F(e){if(Object.keys(e).length!=0)return x?y(e):b(e)}function K(){return a.default.createElement(a.default.Fragment,null,a.default.createElement("byoc-registration",{components:JSON.stringify(Object.values(i.registered)),suppressHydrationWarning:!0}),a.default.createElement(g,null))}function b(e){let{componentName:t,fallback:n,...m}=e,l=(0,i.getComponent)(t),s=l?.component;if(!s&&n||!t)return a.default.createElement("feaas-external",{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},n);let c=(0,i.getComponentProperties)(t,m);delete c.suppressHydrationWarning;var O=null;return s&&(0,i.isWebComponent)(s)?a.default.createElement("byoc-"+(0,u.toKebabCase)(l.id),{...(0,u.objectKeysToKebabCase)(c),suppressHydrationWarning:!0}):a.default.createElement(a.default.Fragment,null,a.default.createElement("feaas-external",{...(0,u.objectKeysToKebabCase)(c),"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},s==null?null:a.default.createElement(s,{...c})))} | ||
"use strict";var j=Object.create;var f=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var h=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},p=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of C(t))!N.call(e,r)&&r!==n&&f(e,r,{get:()=>t[r],enumerable:!(o=v(t,r))||o.enumerable});return e},l=(e,t,n)=>(p(e,t,"default"),n&&p(n,t,"default")),W=(e,t,n)=>(n=e!=null?j(E(e)):{},p(t||!e||!e.__esModule?f(n,"default",{value:e,enumerable:!0}):n,e)),H=e=>p(f({},"__esModule",{value:!0}),e);var a={};h(a,{Bundle:()=>k,Component:()=>_,NextComponent:()=>x,RegularComponent:()=>y,enableNextClientsideComponents:()=>P});module.exports=H(a);var i=W(require("react"),1),s=require("@sitecore/byoc"),u=require("@sitecore/byoc");l(a,require("@sitecore/byoc"),module.exports);var O=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},b=new Map,g=null,d=null;function x(e){var t;let{componentName:n}=e,o=O(e,["componentName"]),r=(t=(0,s.getComponent)(n))===null||t===void 0?void 0:t.component;if(!b.get(n)){let m=d(()=>Promise.resolve(g),{ssr:!1,loading:()=>i.default.createElement(y,Object.assign({},o,{componentName:n}))});b.set(n,m)}let c=b.get(n);return i.default.createElement(c,Object.assign({},e,{fallback:r?i.default.createElement(r,Object.assign({},e)):null}))}function P(e,t){return d=e,g=t,t}function _(e){if(Object.keys(e).length!=0)return d?x(e):y(e)}function k(){return i.default.createElement(i.default.Fragment,null,i.default.createElement("byoc-registration",{components:JSON.stringify(Object.values(s.registered)),suppressHydrationWarning:!0}),i.default.createElement(g,null))}function y(e){let{componentName:t,fallback:n}=e,o=O(e,["componentName","fallback"]),r=(0,s.getComponent)(t),c=r==null?void 0:r.component;if(!c&&n||!t)return i.default.createElement("feaas-external",{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"},n);let m=(0,s.getComponentProperties)(t,o);delete m.suppressHydrationWarning;var w=null;return c&&(0,s.isWebComponent)(c)?i.default.createElement("byoc-"+(0,u.toKebabCase)(r.id),Object.assign(Object.assign({},(0,u.objectKeysToKebabCase)(m)),{suppressHydrationWarning:!0})):i.default.createElement(i.default.Fragment,null,i.default.createElement("feaas-external",Object.assign({},(0,u.objectKeysToKebabCase)(m),{"data-external-id":t,suppressHydrationWarning:!0,hydrate:"false"}),c==null?null:i.default.createElement(c,Object.assign({},m))))} | ||
//# sourceMappingURL=react.js.map |
{ | ||
"compilerOptions": { | ||
"experimentalDecorators": true, | ||
"target": "ES2018", | ||
"target": "ES2015", | ||
"module": "NodeNext", | ||
@@ -6,0 +6,0 @@ "moduleResolution": "nodenext", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
355621
1800