@session-services/web-elements 0.1.36 → 0.1.37

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.
@@ -4,7 +4,7 @@ const NAMESPACE = 'session-services-elements';
4
4
  const BUILD = /* session-services-elements */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
5
5
 
6
6
  /*
7
- Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
7
+ Stencil Client Platform v4.45.2 | MIT Licensed | https://stenciljs.com
8
8
  */
9
9
 
10
10
 
@@ -93,7 +93,9 @@ var consoleError = (e, el) => (0, console.error)(e, el);
93
93
 
94
94
  // src/client/client-load-module.ts
95
95
  var cmpModules = /* @__PURE__ */ new Map();
96
+ var failedLoadAttempts = /* @__PURE__ */ new Map();
96
97
  var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
98
+ var _a;
97
99
  const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
98
100
  const bundleId = cmpMeta.$lazyBundleId$;
99
101
  if (!bundleId) {
@@ -103,21 +105,28 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
103
105
  if (module) {
104
106
  return module[exportName];
105
107
  }
108
+ const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
109
+ const cacheBustParams = [
110
+ retryCount > 0 ? `s-retry=${retryCount}` : "",
111
+ ""
112
+ ].filter(Boolean).join("&");
106
113
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
107
114
  return import(
108
115
  /* @vite-ignore */
109
116
  /* webpackInclude: /\.entry\.js$/ */
110
117
  /* webpackExclude: /\.system\.entry\.js$/ */
111
118
  /* webpackMode: "lazy" */
112
- `./${bundleId}.entry.js${""}`
119
+ `./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
113
120
  ).then(
114
121
  (importedModule) => {
115
122
  {
123
+ failedLoadAttempts.delete(bundleId);
116
124
  cmpModules.set(bundleId, importedModule);
117
125
  }
118
126
  return importedModule[exportName];
119
127
  },
120
128
  (e) => {
129
+ failedLoadAttempts.set(bundleId, retryCount + 1);
121
130
  consoleError(e, hostRef.$hostElement$);
122
131
  }
123
132
  );
@@ -127,6 +136,8 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
127
136
  var styles = /* @__PURE__ */ new Map();
128
137
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
129
138
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
139
+ var MAX_LAZY_LOAD_RETRIES = 3;
140
+ var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
130
141
  var win = typeof window !== "undefined" ? window : {};
131
142
  var plt = {
132
143
  $flags$: 0,
@@ -153,6 +164,10 @@ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @_
153
164
  var queuePending = false;
154
165
  var queueDomReads = [];
155
166
  var queueDomWrites = [];
167
+ var scheduleFlush = () => {
168
+ var _a;
169
+ return ((_a = win.document) == null ? void 0 : _a.hidden) ? setTimeout(flush, 16) : plt.raf(flush);
170
+ };
156
171
  var queueTask = (queue, write) => (cb) => {
157
172
  queue.push(cb);
158
173
  if (!queuePending) {
@@ -160,7 +175,7 @@ var queueTask = (queue, write) => (cb) => {
160
175
  if (write && plt.$flags$ & 4 /* queueSync */) {
161
176
  nextTick(flush);
162
177
  } else {
163
- plt.raf(flush);
178
+ scheduleFlush();
164
179
  }
165
180
  }
166
181
  };
@@ -179,7 +194,7 @@ var flush = () => {
179
194
  {
180
195
  consume(queueDomWrites);
181
196
  if (queuePending = queueDomReads.length > 0) {
182
- plt.raf(flush);
197
+ scheduleFlush();
183
198
  }
184
199
  }
185
200
  };
@@ -371,6 +386,11 @@ var h = (nodeName, vnodeData, ...children) => {
371
386
  } else if (child != null && typeof child !== "boolean") {
372
387
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
373
388
  child = String(child);
389
+ } else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
390
+ {
391
+ consoleError("Invalid vNode child");
392
+ }
393
+ continue;
374
394
  }
375
395
  if (simple && lastSimple) {
376
396
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -535,7 +555,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
535
555
  const oldClasses = parseClassList(oldValue);
536
556
  let newClasses = parseClassList(newValue);
537
557
  {
538
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
558
+ let removedClasses = oldClasses.filter((c) => c && !newClasses.includes(c));
559
+ classList.remove(...removedClasses);
539
560
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
540
561
  }
541
562
  } else if (memberName === "key") ; else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
@@ -608,7 +629,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
608
629
  }
609
630
  }
610
631
  if (newValue == null || newValue === false) {
611
- if (newValue !== false || elm.getAttribute(memberName) === "") {
632
+ if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
612
633
  {
613
634
  elm.removeAttribute(memberName);
614
635
  }
@@ -621,6 +642,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
621
642
  }
622
643
  }
623
644
  };
645
+ var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
646
+ var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
624
647
  var parseClassListRegex = /\s/;
625
648
  var parseClassList = (value) => {
626
649
  if (typeof value === "object" && value && "baseVal" in value) {
@@ -801,7 +824,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
801
824
  if (idxInOld >= 0) {
802
825
  elmToMove = oldCh[idxInOld];
803
826
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
804
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
827
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
805
828
  } else {
806
829
  patch(elmToMove, newStartVnode, isInitialRender);
807
830
  oldCh[idxInOld] = void 0;
@@ -878,9 +901,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
878
901
  }
879
902
  };
880
903
  var insertBefore = (parent, newNode, reference, isInitialLoad) => {
881
- if (parent.__insertBefore) {
882
- return parent.__insertBefore(newNode, reference);
883
- } else {
904
+ {
884
905
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
885
906
  }
886
907
  };
@@ -1125,8 +1146,19 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1125
1146
  }
1126
1147
  }
1127
1148
  };
1128
-
1129
- // src/runtime/proxy-component.ts
1149
+ var replayPendingSetterValues = (hostRef, cmpMeta) => {
1150
+ var _a;
1151
+ const instance = hostRef.$lazyInstance$;
1152
+ if (!instance) return;
1153
+ for (const [memberName, [memberFlags]] of Object.entries((_a = cmpMeta.$members$) != null ? _a : {})) {
1154
+ if (memberFlags & 4096 /* Setter */ && hostRef.$instanceValues$.has(memberName)) {
1155
+ const pendingValue = hostRef.$instanceValues$.get(memberName);
1156
+ if (instance[memberName] !== pendingValue) {
1157
+ instance[memberName] = pendingValue;
1158
+ }
1159
+ }
1160
+ }
1161
+ };
1130
1162
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1131
1163
  var _a, _b;
1132
1164
  const prototype = Cstr.prototype;
@@ -1156,9 +1188,8 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1156
1188
  return getValue(this, memberName);
1157
1189
  }
1158
1190
  const ref = getHostRef(this);
1159
- const instance = ref ? ref.$lazyInstance$ : prototype;
1160
- if (!instance) return;
1161
- return instance[memberName];
1191
+ if (!ref) return prototype[memberName];
1192
+ return ref.$lazyInstance$ ? ref.$lazyInstance$[memberName] : getValue(this, memberName);
1162
1193
  }
1163
1194
  },
1164
1195
  configurable: true,
@@ -1188,31 +1219,20 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1188
1219
  {
1189
1220
  if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1190
1221
  setValue(this, memberName, newValue, cmpMeta);
1191
- if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1192
- ref.$fetchedCbList$.push(() => {
1193
- if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1194
- ref.$lazyInstance$[memberName] = newValue;
1195
- }
1196
- });
1197
- }
1198
1222
  return;
1199
1223
  }
1200
- const setterSetVal = () => {
1224
+ const parsedValue = parsePropertyValue(
1225
+ newValue,
1226
+ memberFlags);
1227
+ if (ref.$lazyInstance$) {
1201
1228
  const currentValue = ref.$lazyInstance$[memberName];
1202
1229
  if (!ref.$instanceValues$.get(memberName) && currentValue) {
1203
1230
  ref.$instanceValues$.set(memberName, currentValue);
1204
1231
  }
1205
- ref.$lazyInstance$[memberName] = parsePropertyValue(
1206
- newValue,
1207
- memberFlags);
1232
+ ref.$lazyInstance$[memberName] = parsedValue;
1208
1233
  setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1209
- };
1210
- if (ref.$lazyInstance$) {
1211
- setterSetVal();
1212
1234
  } else {
1213
- ref.$fetchedCbList$.push(() => {
1214
- setterSetVal();
1215
- });
1235
+ ref.$instanceValues$.set(memberName, parsedValue);
1216
1236
  }
1217
1237
  }
1218
1238
  }
@@ -1248,10 +1268,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1248
1268
  return;
1249
1269
  }
1250
1270
  const propFlags = members.find(([m]) => m === propName);
1251
- const isBooleanTarget = propFlags && propFlags[1][0] & 4 /* Boolean */;
1271
+ const propMemberFlags = propFlags ? propFlags[1][0] : 0;
1272
+ const isBooleanTarget = propMemberFlags & 4 /* Boolean */;
1252
1273
  const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
1253
1274
  if (isBooleanTarget) {
1254
- newValue = newValue === null || newValue === "false" ? false : true;
1275
+ newValue = newValue === null || newValue === "false" && true ? false : true;
1255
1276
  }
1256
1277
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1257
1278
  if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
@@ -1276,10 +1297,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1276
1297
 
1277
1298
  // src/runtime/initialize-component.ts
1278
1299
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1300
+ var _a;
1279
1301
  let Cstr;
1280
1302
  try {
1281
1303
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1282
1304
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1305
+ hostRef.$flags$ &= -1025 /* hasFailedLoad */;
1283
1306
  const bundleId = cmpMeta.$lazyBundleId$;
1284
1307
  if (bundleId) {
1285
1308
  const CstrImport = loadModule(cmpMeta, hostRef);
@@ -1291,6 +1314,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1291
1314
  Cstr = CstrImport;
1292
1315
  }
1293
1316
  if (!Cstr) {
1317
+ hostRef.$flags$ &= -33 /* hasInitializedComponent */;
1318
+ hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
1319
+ if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
1320
+ hostRef.$flags$ |= 1024 /* hasFailedLoad */;
1321
+ }
1294
1322
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1295
1323
  }
1296
1324
  if (!Cstr.isProxied) {
@@ -1313,6 +1341,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1313
1341
  }
1314
1342
  {
1315
1343
  hostRef.$flags$ &= -9 /* isConstructingInstance */;
1344
+ replayPendingSetterValues(hostRef, cmpMeta);
1316
1345
  }
1317
1346
  {
1318
1347
  hostRef.$flags$ |= 128 /* isWatchReady */;
@@ -1352,7 +1381,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1352
1381
  hostRef.$onRenderResolve$();
1353
1382
  hostRef.$onRenderResolve$ = void 0;
1354
1383
  }
1355
- if (hostRef.$onReadyResolve$) {
1384
+ if (hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
1356
1385
  hostRef.$onReadyResolve$(elm);
1357
1386
  }
1358
1387
  }
@@ -1398,6 +1427,8 @@ var connectedCallback = (elm) => {
1398
1427
  } else {
1399
1428
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1400
1429
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
1430
+ } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
1431
+ setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
1401
1432
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1402
1433
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1403
1434
  }
@@ -1507,7 +1538,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1507
1538
  }
1508
1539
  disconnectedCallback() {
1509
1540
  plt.jmp(() => disconnectedCallback(this));
1510
- plt.raf(() => {
1541
+ nextTick(() => {
1511
1542
  var _a3;
1512
1543
  const hostRef = getHostRef(this);
1513
1544
  if (!hostRef) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-B2ZmNnji.js');
3
+ var index = require('./index-DizKcz8n.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-B2ZmNnji.js');
3
+ var index = require('./index-DizKcz8n.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
7
  /*
8
- Stencil Client Patch Browser v4.43.5 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.45.2 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
11
  var patchBrowser = () => {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-B2ZmNnji.js');
3
+ var index = require('./index-DizKcz8n.js');
4
4
 
5
5
  var tlds = [
6
6
  "aaa",