@everymatrix/promoting-banners 0.3.0 → 0.4.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.
Files changed (27) hide show
  1. package/dist/cjs/{index-40277d4b.js → index-ee39fac4.js} +164 -69
  2. package/dist/cjs/index.cjs.js +2 -2
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{promoting-banners-d707e229.js → promoting-banners-dc9b6beb.js} +28 -11
  5. package/dist/cjs/promoting-banners.cjs.entry.js +2 -2
  6. package/dist/cjs/promoting-banners.cjs.js +2 -2
  7. package/dist/collection/collection-manifest.json +1 -1
  8. package/dist/collection/components/promoting-banners/promoting-banners.js +39 -10
  9. package/dist/esm/{index-936cf61c.js → index-16676b7c.js} +164 -69
  10. package/dist/esm/index.js +2 -2
  11. package/dist/esm/loader.js +2 -2
  12. package/dist/esm/{promoting-banners-10e80966.js → promoting-banners-28e68ad2.js} +28 -11
  13. package/dist/esm/promoting-banners.entry.js +2 -2
  14. package/dist/esm/promoting-banners.js +3 -3
  15. package/dist/promoting-banners/index.esm.js +1 -1
  16. package/dist/promoting-banners/p-8ba44572.js +2 -0
  17. package/dist/promoting-banners/p-a67a8c19.js +1 -0
  18. package/dist/promoting-banners/p-ccda9449.entry.js +1 -0
  19. package/dist/promoting-banners/promoting-banners.esm.js +1 -1
  20. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/promoting-banners/.stencil/packages/stencil/promoting-banners/stencil.config.d.ts +2 -0
  21. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/promoting-banners/.stencil/packages/stencil/promoting-banners/stencil.config.dev.d.ts +2 -0
  22. package/package.json +1 -1
  23. package/dist/promoting-banners/p-53a1c74c.js +0 -1
  24. package/dist/promoting-banners/p-7f9296a7.entry.js +0 -1
  25. package/dist/promoting-banners/p-a3d905a8.js +0 -2
  26. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/promoting-banners/.stencil/packages/stencil/promoting-banners/stencil.config.d.ts +0 -2
  27. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/promoting-banners/.stencil/packages/stencil/promoting-banners/stencil.config.dev.d.ts +0 -2
@@ -3,6 +3,33 @@ import { getDevice, getDevicePlatform } from "../../utils/utils";
3
3
  import { translate, getTranslations } from "../../utils/locale.utils";
4
4
  export class PromotingBanners {
5
5
  constructor() {
6
+ /**
7
+ * The endpoint
8
+ */
9
+ this.cmsEndpoint = '';
10
+ /**
11
+ * The language
12
+ */
13
+ this.language = 'en';
14
+ /**
15
+ * The CMS environment
16
+ */
17
+ this.cmsEnv = '';
18
+ /**
19
+ * Client custom styling via inline style
20
+ */
21
+ this.clientStyling = '';
22
+ /**
23
+ * Client custom styling via url
24
+ */
25
+ this.clientStylingUrl = '';
26
+ /**
27
+ * Translations via URL
28
+ */
29
+ this.translationUrl = '';
30
+ this.promotingBannersArray = [];
31
+ this.hasErrors = false;
32
+ this.isLoading = true;
6
33
  this.setClientStyling = () => {
7
34
  let sheet = document.createElement('style');
8
35
  sheet.innerHTML = this.clientStyling;
@@ -29,16 +56,6 @@ export class PromotingBanners {
29
56
  this.setClientStylingURL();
30
57
  }
31
58
  };
32
- this.cmsEndpoint = '';
33
- this.language = 'en';
34
- this.cmsEnv = '';
35
- this.clientStyling = '';
36
- this.clientStylingUrl = '';
37
- this.translationUrl = '';
38
- this.promotingBannersArray = [];
39
- this.hasErrors = false;
40
- this.isLoading = true;
41
- this.translationData = undefined;
42
59
  }
43
60
  handleStylingChange(newValue, oldValue) {
44
61
  if (newValue !== oldValue)
@@ -141,6 +158,8 @@ export class PromotingBanners {
141
158
  "tags": [],
142
159
  "text": "The endpoint"
143
160
  },
161
+ "getter": false,
162
+ "setter": false,
144
163
  "attribute": "cms-endpoint",
145
164
  "reflect": true,
146
165
  "defaultValue": "''"
@@ -159,6 +178,8 @@ export class PromotingBanners {
159
178
  "tags": [],
160
179
  "text": "The language"
161
180
  },
181
+ "getter": false,
182
+ "setter": false,
162
183
  "attribute": "language",
163
184
  "reflect": true,
164
185
  "defaultValue": "'en'"
@@ -177,6 +198,8 @@ export class PromotingBanners {
177
198
  "tags": [],
178
199
  "text": "The CMS environment"
179
200
  },
201
+ "getter": false,
202
+ "setter": false,
180
203
  "attribute": "cms-env",
181
204
  "reflect": true,
182
205
  "defaultValue": "''"
@@ -195,6 +218,8 @@ export class PromotingBanners {
195
218
  "tags": [],
196
219
  "text": "Client custom styling via inline style"
197
220
  },
221
+ "getter": false,
222
+ "setter": false,
198
223
  "attribute": "client-styling",
199
224
  "reflect": true,
200
225
  "defaultValue": "''"
@@ -213,6 +238,8 @@ export class PromotingBanners {
213
238
  "tags": [],
214
239
  "text": "Client custom styling via url"
215
240
  },
241
+ "getter": false,
242
+ "setter": false,
216
243
  "attribute": "client-styling-url",
217
244
  "reflect": true,
218
245
  "defaultValue": "''"
@@ -231,6 +258,8 @@ export class PromotingBanners {
231
258
  "tags": [],
232
259
  "text": "Translations via URL"
233
260
  },
261
+ "getter": false,
262
+ "setter": false,
234
263
  "attribute": "translation-url",
235
264
  "reflect": true,
236
265
  "defaultValue": "''"
@@ -1,17 +1,21 @@
1
1
  const NAMESPACE = 'promoting-banners';
2
- const BUILD = /* promoting-banners */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* promoting-banners */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.22.3 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
9
9
  for (var name in all)
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
+
13
+ // src/client/client-host-ref.ts
12
14
  var hostRefs = /* @__PURE__ */ new WeakMap();
13
15
  var getHostRef = (ref) => hostRefs.get(ref);
14
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
16
+ var registerInstance = (lazyInstance, hostRef) => {
17
+ hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
18
+ };
15
19
  var registerHost = (hostElement, cmpMeta) => {
16
20
  const hostRef = {
17
21
  $flags$: 0,
@@ -24,7 +28,8 @@ var registerHost = (hostElement, cmpMeta) => {
24
28
  hostElement["s-p"] = [];
25
29
  hostElement["s-rc"] = [];
26
30
  }
27
- return hostRefs.set(hostElement, hostRef);
31
+ const ref = hostRefs.set(hostElement, hostRef);
32
+ return ref;
28
33
  };
29
34
  var isMemberInElement = (elm, memberName) => memberName in elm;
30
35
  var consoleError = (e, el) => (0, console.error)(e, el);
@@ -61,16 +66,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
61
66
  /* webpackExclude: /\.system\.entry\.js$/ */
62
67
  /* webpackMode: "lazy" */
63
68
  `./${bundleId}.entry.js${""}`
64
- ).then((importedModule) => {
65
- {
66
- cmpModules.set(bundleId, importedModule);
69
+ ).then(
70
+ (importedModule) => {
71
+ {
72
+ cmpModules.set(bundleId, importedModule);
73
+ }
74
+ return importedModule[exportName];
75
+ },
76
+ (e) => {
77
+ consoleError(e, hostRef.$hostElement$);
67
78
  }
68
- return importedModule[exportName];
69
- }, consoleError);
79
+ );
70
80
  };
71
81
 
72
82
  // src/client/client-style.ts
73
83
  var styles = /* @__PURE__ */ new Map();
84
+ var HYDRATED_STYLE_ID = "sty-id";
74
85
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
75
86
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
76
87
  var win = typeof window !== "undefined" ? window : {};
@@ -128,12 +139,6 @@ var flush = () => {
128
139
  };
129
140
  var nextTick = (cb) => promiseResolve().then(cb);
130
141
  var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
131
-
132
- // src/utils/constants.ts
133
- var EMPTY_OBJ = {};
134
-
135
- // src/utils/helpers.ts
136
- var isDef = (v) => v != null;
137
142
  var isComplexType = (o) => {
138
143
  o = typeof o;
139
144
  return o === "object" || o === "function";
@@ -315,7 +320,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
315
320
  }
316
321
  if (!appliedStyles.has(scopeId2)) {
317
322
  {
318
- styleElm = doc.createElement("style");
323
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
319
324
  styleElm.innerHTML = style;
320
325
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
321
326
  if (nonce != null) {
@@ -325,7 +330,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
325
330
  if (styleContainerNode.nodeName === "HEAD") {
326
331
  const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
327
332
  const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
328
- styleContainerNode.insertBefore(styleElm, referenceNode2);
333
+ styleContainerNode.insertBefore(
334
+ styleElm,
335
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
336
+ );
329
337
  } else if ("host" in styleContainerNode) {
330
338
  if (supportsConstructableStylesheets) {
331
339
  const stylesheet = new CSSStyleSheet();
@@ -375,16 +383,18 @@ var attachStyles = (hostRef) => {
375
383
  endAttachStyles();
376
384
  };
377
385
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
378
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
386
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
379
387
  if (oldValue !== newValue) {
380
388
  let isProp = isMemberInElement(elm, memberName);
381
389
  let ln = memberName.toLowerCase();
382
390
  if (memberName === "class") {
383
391
  const classList = elm.classList;
384
392
  const oldClasses = parseClassList(oldValue);
385
- const newClasses = parseClassList(newValue);
386
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
387
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
393
+ let newClasses = parseClassList(newValue);
394
+ {
395
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
396
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
397
+ }
388
398
  } else if (memberName === "style") {
389
399
  {
390
400
  for (const prop in oldValue) {
@@ -443,7 +453,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
443
453
  elm.setAttribute(memberName, n);
444
454
  }
445
455
  }
446
- } else {
456
+ } else if (elm[memberName] !== newValue) {
447
457
  elm[memberName] = newValue;
448
458
  }
449
459
  } catch (e) {
@@ -465,24 +475,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
465
475
  }
466
476
  };
467
477
  var parseClassListRegex = /\s/;
468
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
478
+ var parseClassList = (value) => {
479
+ if (typeof value === "object" && value && "baseVal" in value) {
480
+ value = value.baseVal;
481
+ }
482
+ if (!value || typeof value !== "string") {
483
+ return [];
484
+ }
485
+ return value.split(parseClassListRegex);
486
+ };
469
487
  var CAPTURE_EVENT_SUFFIX = "Capture";
470
488
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
471
489
 
472
490
  // src/runtime/vdom/update-element.ts
473
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
491
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
474
492
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
475
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
476
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
493
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
494
+ const newVnodeAttrs = newVnode.$attrs$ || {};
477
495
  {
478
496
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
479
497
  if (!(memberName in newVnodeAttrs)) {
480
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
498
+ setAccessor(
499
+ elm,
500
+ memberName,
501
+ oldVnodeAttrs[memberName],
502
+ void 0,
503
+ isSvgMode2,
504
+ newVnode.$flags$);
481
505
  }
482
506
  }
483
507
  }
484
508
  for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
485
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
509
+ setAccessor(
510
+ elm,
511
+ memberName,
512
+ oldVnodeAttrs[memberName],
513
+ newVnodeAttrs[memberName],
514
+ isSvgMode2,
515
+ newVnode.$flags$);
486
516
  }
487
517
  };
488
518
  function sortedAttrNames(attrNames) {
@@ -494,13 +524,10 @@ function sortedAttrNames(attrNames) {
494
524
  attrNames
495
525
  );
496
526
  }
497
-
498
- // src/runtime/vdom/vdom-render.ts
499
- var scopeId;
500
527
  var hostTagName;
501
528
  var useNativeShadowDom = false;
502
529
  var isSvgMode = false;
503
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
530
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
504
531
  const newVNode2 = newParentVNode.$children$[childIndex];
505
532
  let i2 = 0;
506
533
  let elm;
@@ -514,11 +541,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
514
541
  {
515
542
  updateElement(null, newVNode2, isSvgMode);
516
543
  }
517
- const rootNode = elm.getRootNode();
518
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
519
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
520
- elm.classList.add(elm["s-si"] = scopeId);
521
- }
522
544
  if (newVNode2.$children$) {
523
545
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
524
546
  childNode = createElm(oldParentVNode, newVNode2, i2);
@@ -648,6 +670,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
648
670
  if (!isInitialRender) {
649
671
  return leftVNode.$key$ === rightVNode.$key$;
650
672
  }
673
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
674
+ leftVNode.$key$ = rightVNode.$key$;
675
+ }
651
676
  return true;
652
677
  }
653
678
  return false;
@@ -687,8 +712,9 @@ var nullifyVNodeRefs = (vNode) => {
687
712
  }
688
713
  };
689
714
  var insertBefore = (parent, newNode, reference) => {
690
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
691
- return inserted;
715
+ {
716
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
717
+ }
692
718
  };
693
719
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
694
720
  const hostElm = hostRef.$hostElement$;
@@ -713,9 +739,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
713
739
  rootVnode.$flags$ |= 4 /* isHost */;
714
740
  hostRef.$vnode$ = rootVnode;
715
741
  rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
716
- {
717
- scopeId = hostElm["s-sc"];
718
- }
719
742
  useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
720
743
  patch(oldVNode, rootVnode, isInitialLoad);
721
744
  };
@@ -723,7 +746,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
723
746
  // src/runtime/update-component.ts
724
747
  var attachToAncestor = (hostRef, ancestorComponent) => {
725
748
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
726
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
749
+ const index = ancestorComponent["s-p"].push(
750
+ new Promise(
751
+ (r) => hostRef.$onRenderResolve$ = () => {
752
+ ancestorComponent["s-p"].splice(index - 1, 1);
753
+ r();
754
+ }
755
+ )
756
+ );
727
757
  }
728
758
  };
729
759
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -750,7 +780,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
750
780
  let maybePromise;
751
781
  if (isInitialLoad) {
752
782
  {
753
- maybePromise = safeCall(instance, "componentWillLoad");
783
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
754
784
  }
755
785
  }
756
786
  endSchedule();
@@ -849,12 +879,12 @@ var appDidLoad = (who) => {
849
879
  }
850
880
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
851
881
  };
852
- var safeCall = (instance, method, arg) => {
882
+ var safeCall = (instance, method, arg, elm) => {
853
883
  if (instance && instance[method]) {
854
884
  try {
855
885
  return instance[method](arg);
856
886
  } catch (e) {
857
- consoleError(e);
887
+ consoleError(e, elm);
858
888
  }
859
889
  }
860
890
  return void 0;
@@ -913,15 +943,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
913
943
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
914
944
  members.map(([memberName, [memberFlags]]) => {
915
945
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
946
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
947
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
948
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
949
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
950
+ Object.defineProperty(prototype, memberName, {
951
+ get() {
952
+ {
953
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
954
+ return getValue(this, memberName);
955
+ }
956
+ const ref = getHostRef(this);
957
+ const instance = ref ? ref.$lazyInstance$ : prototype;
958
+ if (!instance) return;
959
+ return instance[memberName];
960
+ }
961
+ },
962
+ configurable: true,
963
+ enumerable: true
964
+ });
965
+ }
916
966
  Object.defineProperty(prototype, memberName, {
917
- get() {
918
- return getValue(this, memberName);
919
- },
920
967
  set(newValue) {
921
- setValue(this, memberName, newValue, cmpMeta);
922
- },
923
- configurable: true,
924
- enumerable: true
968
+ const ref = getHostRef(this);
969
+ if (origSetter) {
970
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
971
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
972
+ newValue = ref.$instanceValues$.get(memberName);
973
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
974
+ ref.$instanceValues$.set(memberName, currentValue);
975
+ }
976
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
977
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
978
+ setValue(this, memberName, newValue, cmpMeta);
979
+ return;
980
+ }
981
+ {
982
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
983
+ setValue(this, memberName, newValue, cmpMeta);
984
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
985
+ ref.$onReadyPromise$.then(() => {
986
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
987
+ ref.$lazyInstance$[memberName] = newValue;
988
+ }
989
+ });
990
+ }
991
+ return;
992
+ }
993
+ const setterSetVal = () => {
994
+ const currentValue = ref.$lazyInstance$[memberName];
995
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
996
+ ref.$instanceValues$.set(memberName, currentValue);
997
+ }
998
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
999
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1000
+ };
1001
+ if (ref.$lazyInstance$) {
1002
+ setterSetVal();
1003
+ } else {
1004
+ ref.$onReadyPromise$.then(() => setterSetVal());
1005
+ }
1006
+ }
1007
+ }
925
1008
  });
926
1009
  }
927
1010
  });
@@ -931,7 +1014,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
931
1014
  plt.jmp(() => {
932
1015
  var _a2;
933
1016
  const propName = attrNameToPropName.get(attrName);
934
- if (this.hasOwnProperty(propName)) {
1017
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
935
1018
  newValue = this[propName];
936
1019
  delete this[propName];
937
1020
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -951,7 +1034,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
951
1034
  }
952
1035
  return;
953
1036
  }
954
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1037
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1038
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1039
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1040
+ this[propName] = newValue;
1041
+ }
955
1042
  });
956
1043
  };
957
1044
  Cstr.observedAttributes = Array.from(
@@ -978,9 +1065,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
978
1065
  let Cstr;
979
1066
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
980
1067
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
981
- const bundleId = cmpMeta.$lazyBundleId$;
982
- if (bundleId) {
983
- const CstrImport = loadModule(cmpMeta);
1068
+ {
1069
+ const CstrImport = loadModule(cmpMeta, hostRef);
984
1070
  if (CstrImport && "then" in CstrImport) {
985
1071
  const endLoad = uniqueTime();
986
1072
  Cstr = await CstrImport;
@@ -1005,7 +1091,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1005
1091
  try {
1006
1092
  new Cstr(hostRef);
1007
1093
  } catch (e) {
1008
- consoleError(e);
1094
+ consoleError(e, elm);
1009
1095
  }
1010
1096
  {
1011
1097
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
@@ -1014,11 +1100,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1014
1100
  hostRef.$flags$ |= 128 /* isWatchReady */;
1015
1101
  }
1016
1102
  endNewInstance();
1017
- fireConnectedCallback(hostRef.$lazyInstance$);
1018
- } else {
1019
- Cstr = elm.constructor;
1020
- const cmpTag = elm.localName;
1021
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1103
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1022
1104
  }
1023
1105
  if (Cstr && Cstr.style) {
1024
1106
  let style;
@@ -1041,9 +1123,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1041
1123
  schedule();
1042
1124
  }
1043
1125
  };
1044
- var fireConnectedCallback = (instance) => {
1126
+ var fireConnectedCallback = (instance, elm) => {
1045
1127
  {
1046
- safeCall(instance, "connectedCallback");
1128
+ safeCall(instance, "connectedCallback", void 0, elm);
1047
1129
  }
1048
1130
  };
1049
1131
 
@@ -1078,15 +1160,15 @@ var connectedCallback = (elm) => {
1078
1160
  }
1079
1161
  } else {
1080
1162
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1081
- fireConnectedCallback(hostRef.$lazyInstance$);
1163
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1082
1164
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1083
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1165
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1084
1166
  }
1085
1167
  }
1086
1168
  endConnected();
1087
1169
  }
1088
1170
  };
1089
- var disconnectInstance = (instance) => {
1171
+ var disconnectInstance = (instance, elm) => {
1090
1172
  };
1091
1173
  var disconnectedCallback = async (elm) => {
1092
1174
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1095,6 +1177,12 @@ var disconnectedCallback = async (elm) => {
1095
1177
  hostRef.$onReadyPromise$.then(() => disconnectInstance());
1096
1178
  }
1097
1179
  }
1180
+ if (rootAppliedStyles.has(elm)) {
1181
+ rootAppliedStyles.delete(elm);
1182
+ }
1183
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1184
+ rootAppliedStyles.delete(elm.shadowRoot);
1185
+ }
1098
1186
  };
1099
1187
 
1100
1188
  // src/runtime/bootstrap-lazy.ts
@@ -1175,6 +1263,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1175
1263
  }
1176
1264
  disconnectedCallback() {
1177
1265
  plt.jmp(() => disconnectedCallback(this));
1266
+ plt.raf(() => {
1267
+ var _a3;
1268
+ const hostRef = getHostRef(this);
1269
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1270
+ delete hostRef.$vnode$.$elm$;
1271
+ }
1272
+ });
1178
1273
  }
1179
1274
  componentOnReady() {
1180
1275
  return getHostRef(this).$onReadyPromise$;
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { P as PromotingBanners } from './promoting-banners-10e80966.js';
2
- import './index-936cf61c.js';
1
+ export { P as PromotingBanners } from './promoting-banners-28e68ad2.js';
2
+ import './index-16676b7c.js';
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-936cf61c.js';
2
- export { s as setNonce } from './index-936cf61c.js';
1
+ import { b as bootstrapLazy } from './index-16676b7c.js';
2
+ export { s as setNonce } from './index-16676b7c.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-936cf61c.js';
1
+ import { r as registerInstance, h } from './index-16676b7c.js';
2
2
 
3
3
  const getDevice = () => {
4
4
  let userAgent = window.navigator.userAgent;
@@ -83,6 +83,33 @@ const PromotingBannersStyle0 = promotingBannersCss;
83
83
  const PromotingBanners = class {
84
84
  constructor(hostRef) {
85
85
  registerInstance(this, hostRef);
86
+ /**
87
+ * The endpoint
88
+ */
89
+ this.cmsEndpoint = '';
90
+ /**
91
+ * The language
92
+ */
93
+ this.language = 'en';
94
+ /**
95
+ * The CMS environment
96
+ */
97
+ this.cmsEnv = '';
98
+ /**
99
+ * Client custom styling via inline style
100
+ */
101
+ this.clientStyling = '';
102
+ /**
103
+ * Client custom styling via url
104
+ */
105
+ this.clientStylingUrl = '';
106
+ /**
107
+ * Translations via URL
108
+ */
109
+ this.translationUrl = '';
110
+ this.promotingBannersArray = [];
111
+ this.hasErrors = false;
112
+ this.isLoading = true;
86
113
  this.setClientStyling = () => {
87
114
  let sheet = document.createElement('style');
88
115
  sheet.innerHTML = this.clientStyling;
@@ -109,16 +136,6 @@ const PromotingBanners = class {
109
136
  this.setClientStylingURL();
110
137
  }
111
138
  };
112
- this.cmsEndpoint = '';
113
- this.language = 'en';
114
- this.cmsEnv = '';
115
- this.clientStyling = '';
116
- this.clientStylingUrl = '';
117
- this.translationUrl = '';
118
- this.promotingBannersArray = [];
119
- this.hasErrors = false;
120
- this.isLoading = true;
121
- this.translationData = undefined;
122
139
  }
123
140
  handleStylingChange(newValue, oldValue) {
124
141
  if (newValue !== oldValue)
@@ -1,2 +1,2 @@
1
- export { P as promoting_banners } from './promoting-banners-10e80966.js';
2
- import './index-936cf61c.js';
1
+ export { P as promoting_banners } from './promoting-banners-28e68ad2.js';
2
+ import './index-16676b7c.js';
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-936cf61c.js';
2
- export { s as setNonce } from './index-936cf61c.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-16676b7c.js';
2
+ export { s as setNonce } from './index-16676b7c.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.25.1 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var patchBrowser = () => {
9
9
  const importMeta = import.meta.url;
@@ -1 +1 @@
1
- export{P as PromotingBanners}from"./p-53a1c74c.js";import"./p-a3d905a8.js";
1
+ export{P as PromotingBanners}from"./p-a67a8c19.js";import"./p-8ba44572.js";