@itcenteratunihelsinki/huds-lib 0.8.56 → 0.8.57

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 (54) hide show
  1. package/components/emotion.esm.js.map +1 -1
  2. package/components/hy-hero-carousel.js +1 -4
  3. package/components/hy-hero-carousel.js.map +1 -1
  4. package/components/hy-site-header.js +1 -1
  5. package/components/hy-site-header.js.map +1 -1
  6. package/components/index2.js.map +1 -1
  7. package/dist/cjs/color-box_91.cjs.entry.js +3 -3
  8. package/dist/cjs/color-box_91.cjs.entry.js.map +1 -1
  9. package/dist/cjs/{globalScript-d341436f.js → globalScript-42d6be40.js} +2 -2
  10. package/dist/cjs/{globalScript-d341436f.js.map → globalScript-42d6be40.js.map} +1 -1
  11. package/dist/cjs/huds-lib.cjs.js +3 -3
  12. package/dist/cjs/huds-lib.cjs.js.map +1 -1
  13. package/dist/cjs/hy-event-item.cjs.entry.js +1 -1
  14. package/dist/cjs/hy-events.cjs.entry.js +1 -1
  15. package/dist/cjs/hy-hero-carousel.cjs.entry.js +3 -6
  16. package/dist/cjs/hy-hero-carousel.cjs.entry.js.map +1 -1
  17. package/dist/cjs/{index-ca4e37f2.js → index-8fc99295.js} +35 -88
  18. package/dist/cjs/index-8fc99295.js.map +1 -0
  19. package/dist/cjs/loader.cjs.js +3 -3
  20. package/dist/cjs/loader.cjs.js.map +1 -1
  21. package/dist/collection/collection-manifest.json +1 -1
  22. package/dist/collection/components/site-header/site-header.css +7 -0
  23. package/dist/esm/color-box_91.entry.js +3 -3
  24. package/dist/esm/color-box_91.entry.js.map +1 -1
  25. package/dist/esm/{globalScript-3c6fab71.js → globalScript-784ce932.js} +2 -2
  26. package/dist/esm/{globalScript-3c6fab71.js.map → globalScript-784ce932.js.map} +1 -1
  27. package/dist/esm/huds-lib.js +4 -4
  28. package/dist/esm/huds-lib.js.map +1 -1
  29. package/dist/esm/hy-event-item.entry.js +1 -1
  30. package/dist/esm/hy-events.entry.js +1 -1
  31. package/dist/esm/hy-hero-carousel.entry.js +3 -6
  32. package/dist/esm/hy-hero-carousel.entry.js.map +1 -1
  33. package/dist/esm/{index-9920074a.js → index-f9deccc3.js} +35 -88
  34. package/dist/esm/index-f9deccc3.js.map +1 -0
  35. package/dist/esm/loader.js +4 -4
  36. package/dist/esm/loader.js.map +1 -1
  37. package/dist/huds-lib/color-box_91.entry.js +2 -2
  38. package/dist/huds-lib/color-box_91.entry.js.map +1 -1
  39. package/dist/huds-lib/{globalScript-3c6fab71.js → globalScript-784ce932.js} +2 -2
  40. package/dist/huds-lib/huds-lib.esm.js +1 -1
  41. package/dist/huds-lib/huds-lib.esm.js.map +1 -1
  42. package/dist/huds-lib/hy-event-item.entry.js +1 -1
  43. package/dist/huds-lib/hy-events.entry.js +1 -1
  44. package/dist/huds-lib/hy-hero-carousel.entry.js +1 -1
  45. package/dist/huds-lib/hy-hero-carousel.entry.js.map +1 -1
  46. package/dist/huds-lib/index-f9deccc3.js +3 -0
  47. package/dist/huds-lib/index-f9deccc3.js.map +1 -0
  48. package/dist/types/stencil-public-runtime.d.ts +0 -1
  49. package/package.json +2 -2
  50. package/dist/cjs/index-ca4e37f2.js.map +0 -1
  51. package/dist/esm/index-9920074a.js.map +0 -1
  52. package/dist/huds-lib/index-9920074a.js +0 -3
  53. package/dist/huds-lib/index-9920074a.js.map +0 -1
  54. /package/dist/huds-lib/{globalScript-3c6fab71.js.map → globalScript-784ce932.js.map} +0 -0
@@ -732,31 +732,30 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
732
732
  * @param vnodes a list of virtual DOM nodes to remove
733
733
  * @param startIdx the index at which to start removing nodes (inclusive)
734
734
  * @param endIdx the index at which to stop removing nodes (inclusive)
735
+ * @param vnode a VNode
736
+ * @param elm an element
735
737
  */
736
- const removeVnodes = (vnodes, startIdx, endIdx) => {
737
- for (let index = startIdx; index <= endIdx; ++index) {
738
- const vnode = vnodes[index];
739
- if (vnode) {
740
- const elm = vnode.$elm$;
741
- nullifyVNodeRefs(vnode);
742
- if (elm) {
743
- {
744
- // we're removing this element
745
- // so it's possible we need to show slot fallback content now
746
- checkSlotFallbackVisibility = true;
747
- if (elm['s-ol']) {
748
- // remove the original location comment
749
- elm['s-ol'].remove();
750
- }
751
- else {
752
- // it's possible that child nodes of the node
753
- // that's being removed are slot nodes
754
- putBackInOriginalLocation(elm, true);
755
- }
738
+ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
739
+ for (; startIdx <= endIdx; ++startIdx) {
740
+ if ((vnode = vnodes[startIdx])) {
741
+ elm = vnode.$elm$;
742
+ callNodeRefs(vnode);
743
+ {
744
+ // we're removing this element
745
+ // so it's possible we need to show slot fallback content now
746
+ checkSlotFallbackVisibility = true;
747
+ if (elm['s-ol']) {
748
+ // remove the original location comment
749
+ elm['s-ol'].remove();
750
+ }
751
+ else {
752
+ // it's possible that child nodes of the node
753
+ // that's being removed are slot nodes
754
+ putBackInOriginalLocation(elm, true);
756
755
  }
757
- // remove the vnode's element from the dom
758
- elm.remove();
759
756
  }
757
+ // remove the vnode's element from the dom
758
+ elm.remove();
760
759
  }
761
760
  }
762
761
  };
@@ -1237,17 +1236,10 @@ const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
1237
1236
  }
1238
1237
  return slotNameAttr === '';
1239
1238
  };
1240
- /**
1241
- * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by
1242
- * calling them with `null`. This signals that the DOM element corresponding to
1243
- * the VDom node has been removed from the DOM.
1244
- *
1245
- * @param vNode a virtual DOM node
1246
- */
1247
- const nullifyVNodeRefs = (vNode) => {
1239
+ const callNodeRefs = (vNode) => {
1248
1240
  {
1249
1241
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1250
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1242
+ vNode.$children$ && vNode.$children$.map(callNodeRefs);
1251
1243
  }
1252
1244
  };
1253
1245
  /**
@@ -1384,32 +1376,10 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
1384
1376
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1385
1377
  return writeTask(dispatch) ;
1386
1378
  };
1387
- /**
1388
- * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1389
- * component lifecycle methods like `componentWillLoad` as well as
1390
- * {@link updateComponent}, which will kick off the virtual DOM re-render.
1391
- *
1392
- * @param hostRef a reference to a host DOM node
1393
- * @param isInitialLoad whether we're on the initial load or not
1394
- * @returns an empty Promise which is used to enqueue a series of operations for
1395
- * the component
1396
- */
1397
1379
  const dispatchHooks = (hostRef, isInitialLoad) => {
1398
1380
  const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1399
1381
  const instance = hostRef.$lazyInstance$ ;
1400
- // We're going to use this variable together with `enqueue` to implement a
1401
- // little promise-based queue. We start out with it `undefined`. When we add
1402
- // the first function to the queue we'll set this variable to be that
1403
- // function's return value. When we attempt to add subsequent values to the
1404
- // queue we'll check that value and, if it was a `Promise`, we'll then chain
1405
- // the new function off of that `Promise` using `.then()`. This will give our
1406
- // queue two nice properties:
1407
- //
1408
- // 1. If all functions added to the queue are synchronous they'll be called
1409
- // synchronously right away.
1410
- // 2. If all functions added to the queue are asynchronous they'll all be
1411
- // called in order after `dispatchHooks` exits.
1412
- let maybePromise;
1382
+ let promise;
1413
1383
  if (isInitialLoad) {
1414
1384
  {
1415
1385
  hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
@@ -1419,48 +1389,22 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
1419
1389
  }
1420
1390
  }
1421
1391
  {
1422
- // If `componentWillLoad` returns a `Promise` then we want to wait on
1423
- // whatever's going on in that `Promise` before we launch into
1424
- // rendering the component, doing other lifecycle stuff, etc. So
1425
- // in that case we assign the returned promise to the variable we
1426
- // declared above to hold a possible 'queueing' Promise
1427
- maybePromise = safeCall(instance, 'componentWillLoad');
1392
+ promise = safeCall(instance, 'componentWillLoad');
1428
1393
  }
1429
1394
  }
1430
1395
  else {
1431
1396
  {
1432
- // Like `componentWillLoad` above, we allow Stencil component
1433
- // authors to return a `Promise` from this lifecycle callback, and
1434
- // we specify that our runtime will wait for that `Promise` to
1435
- // resolve before the component re-renders. So if the method
1436
- // returns a `Promise` we need to keep it around!
1437
- maybePromise = safeCall(instance, 'componentWillUpdate');
1397
+ promise = safeCall(instance, 'componentWillUpdate');
1438
1398
  }
1439
1399
  }
1440
1400
  {
1441
- maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1401
+ promise = then(promise, () => safeCall(instance, 'componentWillRender'));
1442
1402
  }
1443
1403
  endSchedule();
1444
- return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1404
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
1445
1405
  };
1446
- /**
1447
- * This function uses a Promise to implement a simple first-in, first-out queue
1448
- * of functions to be called.
1449
- *
1450
- * The queue is ordered on the basis of the first argument. If it's
1451
- * `undefined`, then nothing is on the queue yet, so the provided function can
1452
- * be called synchronously (although note that this function may return a
1453
- * `Promise`). The idea is that then the return value of that enqueueing
1454
- * operation is kept around, so that if it was a `Promise` then subsequent
1455
- * functions can be enqueued by calling this function again with that `Promise`
1456
- * as the first argument.
1457
- *
1458
- * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1459
- * @param fn a function to enqueue
1460
- * @returns either a `Promise` or the return value of the provided function
1461
- */
1462
- const enqueue = (maybePromise, fn) => maybePromise instanceof Promise ? maybePromise.then(fn) : fn();
1463
1406
  const updateComponent = async (hostRef, instance, isInitialLoad) => {
1407
+ // updateComponent
1464
1408
  const elm = hostRef.$hostElement$;
1465
1409
  const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1466
1410
  const rc = elm['s-rc'];
@@ -1586,6 +1530,9 @@ const safeCall = (instance, method, arg) => {
1586
1530
  }
1587
1531
  return undefined;
1588
1532
  };
1533
+ const then = (promise, thenFn) => {
1534
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
1535
+ };
1589
1536
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1590
1537
  ;
1591
1538
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
@@ -1739,9 +1686,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1739
1686
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1740
1687
  // initializeComponent
1741
1688
  if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1742
- // Let the runtime know that the component has been initialized
1743
- hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1744
1689
  {
1690
+ // we haven't initialized this element yet
1691
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1745
1692
  // lazy loaded components
1746
1693
  // request the component's implementation to be
1747
1694
  // wired up with the host element
@@ -2196,4 +2143,4 @@ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2196
2143
 
2197
2144
  export { Fragment as F, Host as H, setMode as a, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2198
2145
 
2199
- //# sourceMappingURL=index-9920074a.js.map
2146
+ //# sourceMappingURL=index-f9deccc3.js.map