@lwrjs/client-modules 0.7.0-alpha.11 → 0.7.0-alpha.14

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.
@@ -10,18 +10,20 @@ export function toKebabCase(specifier) {
10
10
  * @param components - An array of arrays, each one holding:
11
11
  * 0. a bare specifier
12
12
  * 1. the corresponding LightningElement constructor
13
- * 2. properties to set on the component
13
+ * @param ssrProps - map of properties to set on each component
14
14
  * @example - [['x/appRoot', appCtor], ['x/nav', navCtor]]
15
15
  */
16
16
 
17
- export function init(components) {
17
+ export function init(components, ssrProps = {}) {
18
18
  if (typeof document !== 'undefined') {
19
- components.forEach(([moduleSpecifier, ctor, props]) => {
19
+ components.forEach(([moduleSpecifier, ctor]) => {
20
20
  // Kebab-case the specifier
21
21
  const elementName = toKebabCase(moduleSpecifier); // Find all instances of the component in the document, and hydrate them all
22
22
 
23
23
  const customElements = document.querySelectorAll(elementName);
24
24
  customElements.forEach(customElement => {
25
+ const propsId = customElement.dataset.lwrPropsId;
26
+ const props = ssrProps[propsId] || {};
25
27
  hydrateComponent(customElement, ctor, props);
26
28
  });
27
29
  });
@@ -846,7 +846,7 @@ function createRevokedProxy$LWS(object$LWS) {
846
846
  revocable$LWS.revoke();
847
847
  return revocable$LWS.proxy;
848
848
  }
849
- /*! version: 0.16.14 */
849
+ /*! version: 0.16.15 */
850
850
 
851
851
  /*!
852
852
  * Copyright (C) 2019 salesforce.com, inc.
@@ -1473,7 +1473,7 @@ const {
1473
1473
  const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter$LWS(XhrProto$LWS, 'responseText');
1474
1474
  const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter$LWS(XhrProto$LWS, 'status');
1475
1475
  const XhrProtoWithCredentialsSetter$LWS = ObjectLookupOwnSetter$LWS(XhrProto$LWS, 'withCredentials');
1476
- /*! version: 0.16.14 */
1476
+ /*! version: 0.16.15 */
1477
1477
 
1478
1478
  /*! @license DOMPurify 2.3.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.6/LICENSE */
1479
1479
 
@@ -3194,7 +3194,7 @@ function sanitizeSvgTextReturnDOM$LWS(dirty$LWS) {
3194
3194
  const sanitizer$LWS = svgSanitizer$LWS();
3195
3195
  return sanitizer$LWS.sanitize(dirty$LWS);
3196
3196
  }
3197
- /*! version: 0.16.14 */
3197
+ /*! version: 0.16.15 */
3198
3198
 
3199
3199
  /*!
3200
3200
  * Copyright (C) 2019 salesforce.com, inc.
@@ -3261,7 +3261,7 @@ function sanitizeURLForElement$LWS(url$LWS) {
3261
3261
  ReflectApply$LWS(HTMLAnchorElementProtoHrefSetter$LWS, normalizerAnchor$LWS, [url$LWS]);
3262
3262
  return sanitizeURLString$LWS(ReflectApply$LWS(HTMLAnchorElementProtoHrefGetter$LWS, normalizerAnchor$LWS, []));
3263
3263
  }
3264
- /*! version: 0.16.14 */
3264
+ /*! version: 0.16.15 */
3265
3265
 
3266
3266
  /*!
3267
3267
  * Copyright (C) 2019 salesforce.com, inc.
@@ -7433,7 +7433,7 @@ const HTMLScriptElementBlockedProperties$LWS = ObjectFreeze$LWS(['nonce']);
7433
7433
  const SVGElementBlockedAttributes$LWS = ObjectFreeze$LWS(['nonce']);
7434
7434
  const SVGElementBlockedProperties$LWS = ObjectFreeze$LWS(['nonce']);
7435
7435
  const XSLTProcessorBlockedProperties$LWS = ObjectFreeze$LWS(['transformToDocument', 'transformToFragment']);
7436
- /*! version: 0.16.14 */
7436
+ /*! version: 0.16.15 */
7437
7437
 
7438
7438
  /*!
7439
7439
  * Copyright (C) 2021 salesforce.com, inc.
@@ -7536,7 +7536,7 @@ class DefaultInstrumentation$LWS {
7536
7536
 
7537
7537
 
7538
7538
  const defaultInstrumentation$LWS = new DefaultInstrumentation$LWS();
7539
- /*! version: 0.16.14 */
7539
+ /*! version: 0.16.15 */
7540
7540
 
7541
7541
  const $t=SymbolFor$LWS("@@lockerDebugMode");if(LOCKER_UNMINIFIED_FLAG$LWS){let t=!0;const x=100,O=5,_=100,A=_/2,B="display: inline-block; margin-bottom: 3px; margin-left: -3px; word-break: break-all; word-wrap: wrap;",E={style:"margin-left:11px; margin-bottom: 3px;"},F={style:"display: inline-block; margin-left:12px; word-break: break-all; word-wrap: wrap;"},j={style:"color: #9d288c; font-weight: bold"},H={style:"color: #b17ab0"},M={style:"color: #16239f"},k={style:"color: #236d25"},R={style:"color: #606367"},C={style:"color: #b82619"},formatValue$LWS=function(t){if(null==t)return ["span",R,`${t}`];if("boolean"==typeof t)return ["span",M,t];if("number"==typeof t)return NumberIsFinite$LWS(t)?["span",M,t]:["span",M,(t>=0?"":"-")+"Infinity"];if("string"==typeof t){let e=t;const{length:r}=e;if(r>_){const t=ReflectApply$LWS(StringProtoSlice$LWS,e,[0,A]),o=ReflectApply$LWS(StringProtoSlice$LWS,e,[r-A-1,r]);e=t+CHAR_ELLIPSIS$LWS+o;}return ["span",C,JSONStringify$LWS(e)]}return ArrayIsArray$LWS(t)?["span",{},`Array(${t.length})`]:isObject$LWS(t)?["span",{},`{${CHAR_ELLIPSIS$LWS}}`]:["span",C,StringCtor$LWS(t)]},formatHeader$LWS=function(t,r={}){const{t:o}=r,a=[];let b=0;o&&(a[b++]=["span",j,r.o],a[b++]=["span",{},": "]);const P=ReflectApply$LWS(ObjectProtoToString$LWS,t,[]);let w=ObjectKeys$LWS(t);if(P===TO_STRING_BRAND_SYMBOL$LWS)ReflectApply$LWS(ArrayProtoIncludes$LWS,w,["description"])||ReflectApply$LWS(ArrayProtoUnshift$LWS,w,["description"]);else if(P===TO_STRING_BRAND_STRING$LWS){const{length:e}=t;w=ReflectApply$LWS(ArrayProtoFilter$LWS,w,[t=>{const r="string"==typeof t?+t:-1;return r<0||r>=e||!NumberIsInteger$LWS(r)}]);}const{length:T}=w;if(ArrayIsArray$LWS(t)){a[b++]=["span",o?R:{},`(${t.length}) [`];for(let e=0,r=MathMin$LWS(T,x);e<r;e+=1){const r=t[w[e]];a[b++]=["span",{},e?", ":""],a[b++]=formatValue$LWS(r);}return T>x&&(a[b++]=["span",null,["span",{},`, ${CHAR_ELLIPSIS$LWS}`]]),a[b++]=["span",{},"]"],a}let m,_="{";switch(P){case TO_STRING_BRAND_BIG_INT$LWS:case TO_STRING_BRAND_BOOLEAN$LWS:case TO_STRING_BRAND_NUMBER$LWS:case TO_STRING_BRAND_STRING$LWS:case TO_STRING_BRAND_SYMBOL$LWS:{let e=M;P===TO_STRING_BRAND_BIG_INT$LWS?e=k:P===TO_STRING_BRAND_SYMBOL$LWS&&(e=C),_=`${ReflectApply$LWS(StringProtoSlice$LWS,P,[8,-1])} {`,m=["span",e,`${StringCtor$LWS(getNearMembraneSerializedValue$LWS(t))}`];break}}a[b++]=["span",{},_],m&&(a[b++]=m,T&&(a[b++]=["span",{},", "]));for(let e=0,r=MathMin$LWS(T,O);e<r;e+=1){const r=w[e],o=t[r];a[b++]=["span",{},e?", ":""],a[b++]=["span",R,r],a[b++]=["span",{},": "],a[b++]=formatValue$LWS(o);}return T>O&&(a[b++]=["span",null,["span",{},`, ${CHAR_ELLIPSIS$LWS}`]]),a[b++]=["span",{},"}"],a},formatBody$LWS=function(t){const r=ObjectKeys$LWS(t),o=ReflectOwnKeys$LWS(t);ArrayIsArray$LWS(t)||ReflectApply$LWS(ArrayProtoSort$LWS,o,[]);const a=[];let i=0;for(let e=0,{length:s}=o;e<s;e+=1){const s=o[e],l=t[s];if(isObject$LWS(l))a[i++]=["div",{},["object",{object:l,config:{o:StringCtor$LWS(s),t:!0}}]];else {let t=j;"symbol"!=typeof s&&ReflectApply$LWS(ArrayProtoIncludes$LWS,r,[s])||(t=H),a[i++]=["div",E,["span",t,StringCtor$LWS(s)],["span",{},": "],formatValue$LWS(l)];}}return a};let{devtoolsFormatters:I}=window;ArrayIsArray$LWS(I)||(I=[],ReflectDefineProperty$LWS(window,"devtoolsFormatters",{__proto__:null,configurable:!0,value:I,writable:!0})),I[I.length]={header(e,i={}){if(t&&(t=!1,ReflectDefineProperty$LWS(window,$t,{__proto__:null,configurable:!0,value:!0,writable:!0})),!isNearMembrane$LWS(e))return null;const s=["div",{style:`${B}${i.t?"":"font-style: italic;"}`}];return ReflectApply$LWS(ArrayProtoPush$LWS,s,formatHeader$LWS(e,i)),["div",{},s]},hasBody:()=>!0,body(t){const e=["div",F];return ReflectApply$LWS(ArrayProtoPush$LWS,e,formatBody$LWS(t)),e}};}const vt=new WeakMap;function createMembraneMarshall$LWS(t){var e,r,o;const n=Array,a=ArrayBuffer,i=Error,s=Number,l=Object,c=Proxy,u=Reflect,f=RegExp,y=String,d=Symbol,p=TypeError,S=WeakMap,{for:h,toStringTag:g}=d,{apply:L,construct:$,defineProperty:v,deleteProperty:W,get:b,getOwnPropertyDescriptor:P,getPrototypeOf:w,has:T,isExtensible:m,ownKeys:x,preventExtensions:O,set:_,setPrototypeOf:A}=u,{assign:B,defineProperties:E,freeze:F,getOwnPropertyDescriptor:j,getOwnPropertyDescriptors:H,isFrozen:M,isSealed:k,keys:R,prototype:C,seal:I}=l,{hasOwnProperty:D,propertyIsEnumerable:N,toString:G}=C,{hasOwn:K}=l,{__defineGetter__:V,__defineSetter__:U,__lookupGetter__:z,__lookupSetter__:X}=C,Z="function"==typeof K?K:(t,e)=>L(D,t,[e]),Q="object"!=typeof t||null===t,J=Q?void 0:h("@@lockerDebugMode"),Y=Q?void 0:h("@@lockerLiveValue"),q=Q?void 0:h("@@lockerNearMembraneSerializedValue"),tt=Q?void 0:h("@@lockerNearMembrane"),et=h("@@lockerNearMembraneUndefinedValue"),LOCKER_UNMINIFIED_FLAG$LWS=`${()=>
7542
7542
  /* $LWS */
@@ -846,7 +846,7 @@ function createRevokedProxy$LWS(object$LWS) {
846
846
  revocable$LWS.revoke();
847
847
  return revocable$LWS.proxy;
848
848
  }
849
- /*! version: 0.16.14 */
849
+ /*! version: 0.16.15 */
850
850
 
851
851
  /*!
852
852
  * Copyright (C) 2019 salesforce.com, inc.
@@ -1473,7 +1473,7 @@ const {
1473
1473
  const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter$LWS(XhrProto$LWS, 'responseText');
1474
1474
  const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter$LWS(XhrProto$LWS, 'status');
1475
1475
  const XhrProtoWithCredentialsSetter$LWS = ObjectLookupOwnSetter$LWS(XhrProto$LWS, 'withCredentials');
1476
- /*! version: 0.16.14 */
1476
+ /*! version: 0.16.15 */
1477
1477
 
1478
1478
  /*! @license DOMPurify 2.3.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.6/LICENSE */
1479
1479
 
@@ -3194,7 +3194,7 @@ function sanitizeSvgTextReturnDOM$LWS(dirty$LWS) {
3194
3194
  const sanitizer$LWS = svgSanitizer$LWS();
3195
3195
  return sanitizer$LWS.sanitize(dirty$LWS);
3196
3196
  }
3197
- /*! version: 0.16.14 */
3197
+ /*! version: 0.16.15 */
3198
3198
 
3199
3199
  /*!
3200
3200
  * Copyright (C) 2019 salesforce.com, inc.
@@ -3261,7 +3261,7 @@ function sanitizeURLForElement$LWS(url$LWS) {
3261
3261
  ReflectApply$LWS(HTMLAnchorElementProtoHrefSetter$LWS, normalizerAnchor$LWS, [url$LWS]);
3262
3262
  return sanitizeURLString$LWS(ReflectApply$LWS(HTMLAnchorElementProtoHrefGetter$LWS, normalizerAnchor$LWS, []));
3263
3263
  }
3264
- /*! version: 0.16.14 */
3264
+ /*! version: 0.16.15 */
3265
3265
 
3266
3266
  /*!
3267
3267
  * Copyright (C) 2019 salesforce.com, inc.
@@ -7433,7 +7433,7 @@ const HTMLScriptElementBlockedProperties$LWS = ObjectFreeze$LWS(['nonce']);
7433
7433
  const SVGElementBlockedAttributes$LWS = ObjectFreeze$LWS(['nonce']);
7434
7434
  const SVGElementBlockedProperties$LWS = ObjectFreeze$LWS(['nonce']);
7435
7435
  const XSLTProcessorBlockedProperties$LWS = ObjectFreeze$LWS(['transformToDocument', 'transformToFragment']);
7436
- /*! version: 0.16.14 */
7436
+ /*! version: 0.16.15 */
7437
7437
 
7438
7438
  /*!
7439
7439
  * Copyright (C) 2021 salesforce.com, inc.
@@ -7536,7 +7536,7 @@ class DefaultInstrumentation$LWS {
7536
7536
 
7537
7537
 
7538
7538
  const defaultInstrumentation$LWS = new DefaultInstrumentation$LWS();
7539
- /*! version: 0.16.14 */
7539
+ /*! version: 0.16.15 */
7540
7540
 
7541
7541
  const $t=SymbolFor$LWS("@@lockerDebugMode");if(LOCKER_UNMINIFIED_FLAG$LWS){let t=!0;const x=100,O=5,_=100,A=_/2,B="display: inline-block; margin-bottom: 3px; margin-left: -3px; word-break: break-all; word-wrap: wrap;",E={style:"margin-left:11px; margin-bottom: 3px;"},F={style:"display: inline-block; margin-left:12px; word-break: break-all; word-wrap: wrap;"},j={style:"color: #9d288c; font-weight: bold"},H={style:"color: #b17ab0"},M={style:"color: #16239f"},k={style:"color: #236d25"},R={style:"color: #606367"},C={style:"color: #b82619"},formatValue$LWS=function(t){if(null==t)return ["span",R,`${t}`];if("boolean"==typeof t)return ["span",M,t];if("number"==typeof t)return NumberIsFinite$LWS(t)?["span",M,t]:["span",M,(t>=0?"":"-")+"Infinity"];if("string"==typeof t){let e=t;const{length:r}=e;if(r>_){const t=ReflectApply$LWS(StringProtoSlice$LWS,e,[0,A]),o=ReflectApply$LWS(StringProtoSlice$LWS,e,[r-A-1,r]);e=t+CHAR_ELLIPSIS$LWS+o;}return ["span",C,JSONStringify$LWS(e)]}return ArrayIsArray$LWS(t)?["span",{},`Array(${t.length})`]:isObject$LWS(t)?["span",{},`{${CHAR_ELLIPSIS$LWS}}`]:["span",C,StringCtor$LWS(t)]},formatHeader$LWS=function(t,r={}){const{t:o}=r,a=[];let b=0;o&&(a[b++]=["span",j,r.o],a[b++]=["span",{},": "]);const P=ReflectApply$LWS(ObjectProtoToString$LWS,t,[]);let w=ObjectKeys$LWS(t);if(P===TO_STRING_BRAND_SYMBOL$LWS)ReflectApply$LWS(ArrayProtoIncludes$LWS,w,["description"])||ReflectApply$LWS(ArrayProtoUnshift$LWS,w,["description"]);else if(P===TO_STRING_BRAND_STRING$LWS){const{length:e}=t;w=ReflectApply$LWS(ArrayProtoFilter$LWS,w,[t=>{const r="string"==typeof t?+t:-1;return r<0||r>=e||!NumberIsInteger$LWS(r)}]);}const{length:T}=w;if(ArrayIsArray$LWS(t)){a[b++]=["span",o?R:{},`(${t.length}) [`];for(let e=0,r=MathMin$LWS(T,x);e<r;e+=1){const r=t[w[e]];a[b++]=["span",{},e?", ":""],a[b++]=formatValue$LWS(r);}return T>x&&(a[b++]=["span",null,["span",{},`, ${CHAR_ELLIPSIS$LWS}`]]),a[b++]=["span",{},"]"],a}let m,_="{";switch(P){case TO_STRING_BRAND_BIG_INT$LWS:case TO_STRING_BRAND_BOOLEAN$LWS:case TO_STRING_BRAND_NUMBER$LWS:case TO_STRING_BRAND_STRING$LWS:case TO_STRING_BRAND_SYMBOL$LWS:{let e=M;P===TO_STRING_BRAND_BIG_INT$LWS?e=k:P===TO_STRING_BRAND_SYMBOL$LWS&&(e=C),_=`${ReflectApply$LWS(StringProtoSlice$LWS,P,[8,-1])} {`,m=["span",e,`${StringCtor$LWS(getNearMembraneSerializedValue$LWS(t))}`];break}}a[b++]=["span",{},_],m&&(a[b++]=m,T&&(a[b++]=["span",{},", "]));for(let e=0,r=MathMin$LWS(T,O);e<r;e+=1){const r=w[e],o=t[r];a[b++]=["span",{},e?", ":""],a[b++]=["span",R,r],a[b++]=["span",{},": "],a[b++]=formatValue$LWS(o);}return T>O&&(a[b++]=["span",null,["span",{},`, ${CHAR_ELLIPSIS$LWS}`]]),a[b++]=["span",{},"}"],a},formatBody$LWS=function(t){const r=ObjectKeys$LWS(t),o=ReflectOwnKeys$LWS(t);ArrayIsArray$LWS(t)||ReflectApply$LWS(ArrayProtoSort$LWS,o,[]);const a=[];let i=0;for(let e=0,{length:s}=o;e<s;e+=1){const s=o[e],l=t[s];if(isObject$LWS(l))a[i++]=["div",{},["object",{object:l,config:{o:StringCtor$LWS(s),t:!0}}]];else {let t=j;"symbol"!=typeof s&&ReflectApply$LWS(ArrayProtoIncludes$LWS,r,[s])||(t=H),a[i++]=["div",E,["span",t,StringCtor$LWS(s)],["span",{},": "],formatValue$LWS(l)];}}return a};let{devtoolsFormatters:I}=window;ArrayIsArray$LWS(I)||(I=[],ReflectDefineProperty$LWS(window,"devtoolsFormatters",{__proto__:null,configurable:!0,value:I,writable:!0})),I[I.length]={header(e,i={}){if(t&&(t=!1,ReflectDefineProperty$LWS(window,$t,{__proto__:null,configurable:!0,value:!0,writable:!0})),!isNearMembrane$LWS(e))return null;const s=["div",{style:`${B}${i.t?"":"font-style: italic;"}`}];return ReflectApply$LWS(ArrayProtoPush$LWS,s,formatHeader$LWS(e,i)),["div",{},s]},hasBody:()=>!0,body(t){const e=["div",F];return ReflectApply$LWS(ArrayProtoPush$LWS,e,formatBody$LWS(t)),e}};}const vt=new WeakMap;function createMembraneMarshall$LWS(t){var e,r,o;const n=Array,a=ArrayBuffer,i=Error,s=Number,l=Object,c=Proxy,u=Reflect,f=RegExp,y=String,d=Symbol,p=TypeError,S=WeakMap,{for:h,toStringTag:g}=d,{apply:L,construct:$,defineProperty:v,deleteProperty:W,get:b,getOwnPropertyDescriptor:P,getPrototypeOf:w,has:T,isExtensible:m,ownKeys:x,preventExtensions:O,set:_,setPrototypeOf:A}=u,{assign:B,defineProperties:E,freeze:F,getOwnPropertyDescriptor:j,getOwnPropertyDescriptors:H,isFrozen:M,isSealed:k,keys:R,prototype:C,seal:I}=l,{hasOwnProperty:D,propertyIsEnumerable:N,toString:G}=C,{hasOwn:K}=l,{__defineGetter__:V,__defineSetter__:U,__lookupGetter__:z,__lookupSetter__:X}=C,Z="function"==typeof K?K:(t,e)=>L(D,t,[e]),Q="object"!=typeof t||null===t,J=Q?void 0:h("@@lockerDebugMode"),Y=Q?void 0:h("@@lockerLiveValue"),q=Q?void 0:h("@@lockerNearMembraneSerializedValue"),tt=Q?void 0:h("@@lockerNearMembrane"),et=h("@@lockerNearMembraneUndefinedValue"),LOCKER_UNMINIFIED_FLAG$LWS=`${()=>
7542
7542
  /* $LWS */
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.7.0-alpha.11",
7
+ "version": "0.7.0-alpha.14",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -31,8 +31,8 @@
31
31
  "build:bundle": "rollup --config scripts/rollup.moduleBundle.config.cjs"
32
32
  },
33
33
  "dependencies": {
34
- "@locker/sandbox": "0.16.14",
35
- "@lwrjs/shared-utils": "0.7.0-alpha.11"
34
+ "@locker/sandbox": "0.16.15",
35
+ "@lwrjs/shared-utils": "0.7.0-alpha.14"
36
36
  },
37
37
  "devDependencies": {
38
38
  "rollup-plugin-terser": "^7.0.2"
@@ -58,5 +58,5 @@
58
58
  "engines": {
59
59
  "node": ">=14.15.4 <17"
60
60
  },
61
- "gitHead": "0b272d15905ec7b949974e8c5ba668a98eaa7e2d"
61
+ "gitHead": "60265ddd2d76cd898ce3c3593c24d5488ce68467"
62
62
  }