proto-tinker-wc 0.1.248 → 0.1.249

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.
@@ -5,7 +5,7 @@ const BUILD = /* proto-tinker-wc */ { allRenderFn: true, appendChildSlotFix: fal
5
5
  const Env = /* proto-tinker-wc */ {};
6
6
 
7
7
  /*
8
- Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Platform v4.44.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
11
  var Build = {
@@ -142,7 +142,9 @@ var setErrorHandler = (handler) => customError = handler;
142
142
 
143
143
  // src/client/client-load-module.ts
144
144
  var cmpModules = /* @__PURE__ */ new Map();
145
+ var failedLoadAttempts = /* @__PURE__ */ new Map();
145
146
  var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
147
+ var _a;
146
148
  const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
147
149
  const bundleId = cmpMeta.$lazyBundleId$;
148
150
  if (BUILD.isDev && typeof bundleId !== "string") {
@@ -157,21 +159,28 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
157
159
  if (module) {
158
160
  return module[exportName];
159
161
  }
162
+ const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
163
+ const cacheBustParams = [
164
+ retryCount > 0 ? `s-retry=${retryCount}` : "",
165
+ BUILD.hotModuleReplacement && hmrVersionId ? `s-hmr=${hmrVersionId}` : ""
166
+ ].filter(Boolean).join("&");
160
167
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
161
168
  return import(
162
169
  /* @vite-ignore */
163
170
  /* webpackInclude: /\.entry\.js$/ */
164
171
  /* webpackExclude: /\.system\.entry\.js$/ */
165
172
  /* webpackMode: "lazy" */
166
- `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
173
+ `./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
167
174
  ).then(
168
175
  (importedModule) => {
169
176
  if (!BUILD.hotModuleReplacement) {
177
+ failedLoadAttempts.delete(bundleId);
170
178
  cmpModules.set(bundleId, importedModule);
171
179
  }
172
180
  return importedModule[exportName];
173
181
  },
174
182
  (e) => {
183
+ failedLoadAttempts.set(bundleId, retryCount + 1);
175
184
  consoleError(e, hostRef.$hostElement$);
176
185
  }
177
186
  );
@@ -202,6 +211,8 @@ var DEFAULT_DOC_DATA = {
202
211
  };
203
212
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
204
213
  var XLINK_NS = "http://www.w3.org/1999/xlink";
214
+ var MAX_LAZY_LOAD_RETRIES = 3;
215
+ var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
205
216
  var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
206
217
  "formAssociatedCallback",
207
218
  "formResetCallback",
@@ -261,6 +272,10 @@ var queuePending = false;
261
272
  var queueDomReads = [];
262
273
  var queueDomWrites = [];
263
274
  var queueDomWritesLow = [];
275
+ var scheduleFlush = () => {
276
+ var _a;
277
+ return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
278
+ };
264
279
  var queueTask = (queue, write) => (cb) => {
265
280
  queue.push(cb);
266
281
  if (!queuePending) {
@@ -268,7 +283,7 @@ var queueTask = (queue, write) => (cb) => {
268
283
  if (write && plt.$flags$ & 4 /* queueSync */) {
269
284
  nextTick(flush);
270
285
  } else {
271
- plt.raf(flush);
286
+ scheduleFlush();
272
287
  }
273
288
  }
274
289
  };
@@ -312,14 +327,14 @@ var flush = () => {
312
327
  queueDomWrites.length = 0;
313
328
  }
314
329
  if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
315
- plt.raf(flush);
330
+ scheduleFlush();
316
331
  } else {
317
332
  queueCongestion = 0;
318
333
  }
319
334
  } else {
320
335
  consume(queueDomWrites);
321
336
  if (queuePending = queueDomReads.length > 0) {
322
- plt.raf(flush);
337
+ scheduleFlush();
323
338
  }
324
339
  }
325
340
  };
@@ -404,7 +419,7 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
404
419
  slottedNodes.push(childNode);
405
420
  if (typeof slotName !== "undefined") return slottedNodes;
406
421
  }
407
- slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
422
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(internalCall(childNode, "childNodes"), hostName, slotName)];
408
423
  }
409
424
  return slottedNodes;
410
425
  }
@@ -751,13 +766,13 @@ var patchChildSlotNodes = (elm) => {
751
766
  patchHostOriginalAccessor("firstChild", elm);
752
767
  Object.defineProperty(elm, "firstChild", {
753
768
  get() {
754
- return this.childNodes[0];
769
+ return this.childNodes[0] || null;
755
770
  }
756
771
  });
757
772
  patchHostOriginalAccessor("lastChild", elm);
758
773
  Object.defineProperty(elm, "lastChild", {
759
774
  get() {
760
- return this.childNodes[this.childNodes.length - 1];
775
+ return this.childNodes[this.childNodes.length - 1] || null;
761
776
  }
762
777
  });
763
778
  patchHostOriginalAccessor("childNodes", elm);
@@ -788,7 +803,7 @@ var patchNextSibling = (node) => {
788
803
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
789
804
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
790
805
  if (parentNodes && index > -1) {
791
- return parentNodes[index + 1];
806
+ return parentNodes[index + 1] || null;
792
807
  }
793
808
  return this.__nextSibling;
794
809
  }
@@ -803,7 +818,7 @@ var patchNextElementSibling = (element) => {
803
818
  const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
804
819
  const index = parentEles == null ? void 0 : parentEles.indexOf(this);
805
820
  if (parentEles && index > -1) {
806
- return parentEles[index + 1];
821
+ return parentEles[index + 1] || null;
807
822
  }
808
823
  return this.__nextElementSibling;
809
824
  }
@@ -818,7 +833,7 @@ var patchPreviousSibling = (node) => {
818
833
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
819
834
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
820
835
  if (parentNodes && index > -1) {
821
- return parentNodes[index - 1];
836
+ return parentNodes[index - 1] || null;
822
837
  }
823
838
  return this.__previousSibling;
824
839
  }
@@ -833,7 +848,7 @@ var patchPreviousElementSibling = (element) => {
833
848
  const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
834
849
  const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
835
850
  if (parentNodes && index > -1) {
836
- return parentNodes[index - 1];
851
+ return parentNodes[index - 1] || null;
837
852
  }
838
853
  return this.__previousElementSibling;
839
854
  }
@@ -1152,10 +1167,15 @@ var h = (nodeName, vnodeData, ...children) => {
1152
1167
  } else if (child != null && typeof child !== "boolean") {
1153
1168
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1154
1169
  child = String(child);
1155
- } else if (BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1156
- consoleDevError(`vNode passed as children has unexpected type.
1170
+ } else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
1171
+ if (BUILD.isDev) {
1172
+ consoleDevError(`vNode passed as children has unexpected type.
1157
1173
  Make sure it's using the correct h() function.
1158
1174
  Empty objects can also be the cause, look for JSX comments that became objects.`);
1175
+ } else {
1176
+ consoleError("Invalid vNode child");
1177
+ }
1178
+ continue;
1159
1179
  }
1160
1180
  if (simple && lastSimple) {
1161
1181
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -2853,7 +2873,10 @@ var markSlotContentForRelocation = (elm) => {
2853
2873
  const slotName = childNode["s-sn"];
2854
2874
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
2855
2875
  node = hostContentNodes[j];
2856
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
2876
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && // let an exact named-slot match override a stale default-slot claim. Skip this for
2877
+ // `slotName === ''` itself - a matched default node's cached `s-sn` is `''` too, which
2878
+ // would trivially "match" on every re-render and force pointless re-insertion.
2879
+ (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"] || slotName !== "" && getSlotName(node) === slotName)) {
2857
2880
  if (isNodeLocatedInSlot(node, slotName)) {
2858
2881
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
2859
2882
  checkSlotFallbackVisibility = true;
@@ -3129,7 +3152,7 @@ var attachToAncestor = (hostRef, ancestorComponent) => {
3129
3152
  }
3130
3153
  };
3131
3154
  var scheduleUpdate = (hostRef, isInitialLoad) => {
3132
- if (BUILD.taskQueue && BUILD.updatable) {
3155
+ if (BUILD.updatable) {
3133
3156
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
3134
3157
  }
3135
3158
  if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
@@ -3199,7 +3222,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3199
3222
  }
3200
3223
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
3201
3224
  if (BUILD.isDev) {
3202
- hostRef.$flags$ |= 1024 /* devOnRender */;
3225
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3203
3226
  }
3204
3227
  if (BUILD.hydrateServerSide) {
3205
3228
  await callRender(hostRef, instance, elm, isInitialLoad);
@@ -3208,7 +3231,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3208
3231
  }
3209
3232
  if (BUILD.isDev) {
3210
3233
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
3211
- hostRef.$flags$ &= -1025 /* devOnRender */;
3234
+ hostRef.$flags$ &= -2049 /* devOnRender */;
3212
3235
  }
3213
3236
  if (BUILD.hydrateServerSide) {
3214
3237
  try {
@@ -3248,12 +3271,11 @@ var renderingRef = null;
3248
3271
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
3249
3272
  const allRenderFn = BUILD.allRenderFn ? true : false;
3250
3273
  const lazyLoad = BUILD.lazyLoad ? true : false;
3251
- const taskQueue = BUILD.taskQueue ? true : false;
3252
3274
  const updatable = BUILD.updatable ? true : false;
3253
3275
  try {
3254
3276
  renderingRef = instance;
3255
3277
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
3256
- if (updatable && taskQueue) {
3278
+ if (updatable) {
3257
3279
  hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
3258
3280
  }
3259
3281
  if (updatable || lazyLoad) {
@@ -3289,11 +3311,11 @@ var postUpdateComponent = (hostRef) => {
3289
3311
  const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
3290
3312
  const ancestorComponent = hostRef.$ancestorComponent$;
3291
3313
  if (BUILD.isDev) {
3292
- hostRef.$flags$ |= 1024 /* devOnRender */;
3314
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3293
3315
  }
3294
3316
  safeCall(instance, "componentDidRender", void 0, elm);
3295
3317
  if (BUILD.isDev) {
3296
- hostRef.$flags$ &= -1025 /* devOnRender */;
3318
+ hostRef.$flags$ &= -2049 /* devOnRender */;
3297
3319
  }
3298
3320
  emitLifecycleEvent(elm, "componentDidRender");
3299
3321
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
@@ -3302,11 +3324,11 @@ var postUpdateComponent = (hostRef) => {
3302
3324
  addHydratedFlag(elm);
3303
3325
  }
3304
3326
  if (BUILD.isDev) {
3305
- hostRef.$flags$ |= 2048 /* devOnDidLoad */;
3327
+ hostRef.$flags$ |= 4096 /* devOnDidLoad */;
3306
3328
  }
3307
3329
  safeCall(instance, "componentDidLoad", void 0, elm);
3308
3330
  if (BUILD.isDev) {
3309
- hostRef.$flags$ &= -2049 /* devOnDidLoad */;
3331
+ hostRef.$flags$ &= -4097 /* devOnDidLoad */;
3310
3332
  }
3311
3333
  emitLifecycleEvent(elm, "componentDidLoad");
3312
3334
  endPostUpdate();
@@ -3318,11 +3340,11 @@ var postUpdateComponent = (hostRef) => {
3318
3340
  }
3319
3341
  } else {
3320
3342
  if (BUILD.isDev) {
3321
- hostRef.$flags$ |= 1024 /* devOnRender */;
3343
+ hostRef.$flags$ |= 2048 /* devOnRender */;
3322
3344
  }
3323
3345
  safeCall(instance, "componentDidUpdate", void 0, elm);
3324
3346
  if (BUILD.isDev) {
3325
- hostRef.$flags$ &= -1025 /* devOnRender */;
3347
+ hostRef.$flags$ &= -2049 /* devOnRender */;
3326
3348
  }
3327
3349
  emitLifecycleEvent(elm, "componentDidUpdate");
3328
3350
  endPostUpdate();
@@ -3454,7 +3476,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3454
3476
  }
3455
3477
  }
3456
3478
  if (BUILD.isDev) {
3457
- if (hostRef.$flags$ & 1024 /* devOnRender */) {
3479
+ if (hostRef.$flags$ & 2048 /* devOnRender */) {
3458
3480
  consoleDevWarn(
3459
3481
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
3460
3482
  "\nElement",
@@ -3464,7 +3486,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3464
3486
  "\nOld value",
3465
3487
  oldVal
3466
3488
  );
3467
- } else if (hostRef.$flags$ & 2048 /* devOnDidLoad */) {
3489
+ } else if (hostRef.$flags$ & 4096 /* devOnDidLoad */) {
3468
3490
  consoleDevWarn(
3469
3491
  `The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`,
3470
3492
  "\nElement",
@@ -3755,10 +3777,12 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3755
3777
 
3756
3778
  // src/runtime/initialize-component.ts
3757
3779
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3780
+ var _a;
3758
3781
  let Cstr;
3759
3782
  try {
3760
3783
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3761
3784
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3785
+ hostRef.$flags$ &= -1025 /* hasFailedLoad */;
3762
3786
  const bundleId = cmpMeta.$lazyBundleId$;
3763
3787
  if (BUILD.lazyLoad && bundleId) {
3764
3788
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
@@ -3773,6 +3797,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3773
3797
  Cstr = CstrImport;
3774
3798
  }
3775
3799
  if (!Cstr) {
3800
+ hostRef.$flags$ &= -33 /* hasInitializedComponent */;
3801
+ hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
3802
+ if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
3803
+ hostRef.$flags$ |= 1024 /* hasFailedLoad */;
3804
+ }
3776
3805
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3777
3806
  }
3778
3807
  if (BUILD.member && !Cstr.isProxied) {
@@ -3850,7 +3879,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3850
3879
  hostRef.$onRenderResolve$();
3851
3880
  hostRef.$onRenderResolve$ = void 0;
3852
3881
  }
3853
- if (BUILD.asyncLoading && hostRef.$onReadyResolve$) {
3882
+ if (BUILD.asyncLoading && hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
3854
3883
  hostRef.$onReadyResolve$(elm);
3855
3884
  }
3856
3885
  }
@@ -3922,6 +3951,8 @@ var connectedCallback = (elm) => {
3922
3951
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
3923
3952
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
3924
3953
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
3954
+ } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
3955
+ setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
3925
3956
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
3926
3957
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
3927
3958
  }
@@ -4219,7 +4250,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4219
4250
  }
4220
4251
  disconnectedCallback() {
4221
4252
  plt.jmp(() => disconnectedCallback(this));
4222
- plt.raf(() => {
4253
+ nextTick(() => {
4223
4254
  var _a3;
4224
4255
  const hostRef = getHostRef(this);
4225
4256
  if (!hostRef) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-B4fCz9fW.js');
3
+ var index = require('./index-D0NoqTT-.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-B4fCz9fW.js');
3
+ var index = require('./index-D0NoqTT-.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.44.0 | 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-B4fCz9fW.js');
3
+ var index = require('./index-D0NoqTT-.js');
4
4
 
5
5
  const Radio = props => {
6
6
  const hex = props.hex || 'currentColor';
@@ -5,7 +5,7 @@
5
5
  "mixins": [],
6
6
  "compiler": {
7
7
  "name": "@stencil/core",
8
- "version": "4.43.5",
8
+ "version": "4.44.0",
9
9
  "typescriptVersion": "5.8.3"
10
10
  },
11
11
  "collections": [],