@uoguelph/web-components 1.1.3 → 1.2.0-rc.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 (82) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/{index-469a8261.js → index-06b58d35.js} +5 -5
  3. package/dist/cjs/{index-4e3091d0.js → index-cdb046b4.js} +134 -40
  4. package/dist/cjs/loader.cjs.js +5 -3
  5. package/dist/cjs/uofg-alert.cjs.entry.js +11 -10
  6. package/dist/cjs/uofg-back-to-top_5.cjs.entry.js +1374 -0
  7. package/dist/cjs/uofg-modal.cjs.entry.js +152 -142
  8. package/dist/cjs/uofg-web-components.cjs.js +6 -4
  9. package/dist/cjs/utils-3d4b7e2e.js +16 -0
  10. package/dist/collection/collection-manifest.json +2 -2
  11. package/dist/collection/components/uofg-alert/uofg-alert.css +1 -75
  12. package/dist/collection/components/uofg-alert/uofg-alert.js +15 -15
  13. package/dist/collection/components/uofg-back-to-top/uofg-back-to-top.css +1 -40
  14. package/dist/collection/components/uofg-back-to-top/uofg-back-to-top.js +66 -63
  15. package/dist/collection/components/uofg-card/uofg-card.css +1 -95
  16. package/dist/collection/components/uofg-card/uofg-card.js +42 -40
  17. package/dist/collection/components/uofg-footer/uofg-footer.css +1 -249
  18. package/dist/collection/components/uofg-footer/uofg-footer.js +132 -40
  19. package/dist/collection/components/uofg-header/uofg-header.css +1 -542
  20. package/dist/collection/components/uofg-header/uofg-header.js +238 -157
  21. package/dist/collection/components/uofg-menu/uofg-menu.js +414 -410
  22. package/dist/collection/components/uofg-modal/uofg-modal.css +1 -113
  23. package/dist/collection/components/uofg-modal/uofg-modal.js +393 -386
  24. package/dist/collection/utils/font-awesome-icon.js +4 -4
  25. package/dist/collection/utils/utils.js +5 -5
  26. package/dist/components/font-awesome-icon.js +4 -4
  27. package/dist/components/uofg-alert.d.ts +2 -2
  28. package/dist/components/uofg-alert.js +22 -21
  29. package/dist/components/uofg-back-to-top.d.ts +2 -2
  30. package/dist/components/uofg-back-to-top.js +38 -34
  31. package/dist/components/uofg-card.d.ts +2 -2
  32. package/dist/components/uofg-card.js +28 -25
  33. package/dist/components/uofg-footer.d.ts +2 -2
  34. package/dist/components/uofg-footer.js +243 -115
  35. package/dist/components/uofg-header.d.ts +2 -2
  36. package/dist/components/uofg-header.js +234 -143
  37. package/dist/components/uofg-menu.d.ts +2 -2
  38. package/dist/components/uofg-menu2.js +245 -239
  39. package/dist/components/uofg-modal.d.ts +2 -2
  40. package/dist/components/uofg-modal.js +176 -166
  41. package/dist/components/utils.js +4 -4
  42. package/dist/esm/app-globals-0f993ce5.js +3 -0
  43. package/dist/esm/{index-f644a780.js → index-0b0002d2.js} +134 -40
  44. package/dist/esm/{index-26c6582e.js → index-e685921a.js} +5 -5
  45. package/dist/esm/loader.js +6 -4
  46. package/dist/esm/uofg-alert.entry.js +11 -10
  47. package/dist/esm/uofg-back-to-top_5.entry.js +1366 -0
  48. package/dist/esm/uofg-modal.entry.js +152 -142
  49. package/dist/esm/uofg-web-components.js +7 -5
  50. package/dist/esm/utils-379bb71a.js +12 -0
  51. package/dist/types/components/uofg-alert/uofg-alert.d.ts +1 -1
  52. package/dist/types/components/uofg-back-to-top/uofg-back-to-top.d.ts +8 -8
  53. package/dist/types/components/uofg-card/uofg-card.d.ts +5 -5
  54. package/dist/types/components/uofg-footer/uofg-footer.d.ts +6 -6
  55. package/dist/types/components/uofg-header/uofg-header.d.ts +30 -29
  56. package/dist/types/components/uofg-menu/uofg-menu.d.ts +65 -65
  57. package/dist/types/components/uofg-modal/uofg-modal.d.ts +70 -70
  58. package/dist/types/components.d.ts +1 -1
  59. package/dist/types/stencil-public-runtime.d.ts +8 -0
  60. package/dist/types/utils/font-awesome-icon.d.ts +1 -1
  61. package/dist/uofg-web-components/{p-afff1fb0.js → p-6fa0f8f6.js} +1 -1
  62. package/dist/uofg-web-components/p-7569d8f2.entry.js +1 -0
  63. package/dist/uofg-web-components/p-bce5df9d.entry.js +1 -0
  64. package/dist/uofg-web-components/p-e1255160.js +1 -0
  65. package/dist/uofg-web-components/p-ee27db22.js +2 -0
  66. package/dist/uofg-web-components/p-fde6370b.entry.js +1 -0
  67. package/dist/uofg-web-components/uofg-web-components.css +1 -1
  68. package/dist/uofg-web-components/uofg-web-components.esm.js +1 -1
  69. package/package.json +10 -5
  70. package/dist/cjs/uofg-back-to-top_4.cjs.entry.js +0 -1139
  71. package/dist/cjs/uofg-card.cjs.entry.js +0 -21
  72. package/dist/cjs/utils-582c8cb9.js +0 -16
  73. package/dist/components/_commonjsHelpers.js +0 -15
  74. package/dist/esm/uofg-back-to-top_4.entry.js +0 -1132
  75. package/dist/esm/uofg-card.entry.js +0 -17
  76. package/dist/esm/utils-cfa32fa2.js +0 -12
  77. package/dist/uofg-web-components/p-579599fd.js +0 -2
  78. package/dist/uofg-web-components/p-5f29369c.entry.js +0 -1
  79. package/dist/uofg-web-components/p-b55cb256.entry.js +0 -1
  80. package/dist/uofg-web-components/p-b81838c7.entry.js +0 -1
  81. package/dist/uofg-web-components/p-f42ff310.entry.js +0 -1
  82. /package/dist/uofg-web-components/{p-826dc478.js → p-fec87f9d.js} +0 -0
@@ -10,6 +10,7 @@ const NAMESPACE = 'uofg-web-components';
10
10
  */
11
11
  let scopeId;
12
12
  let hostTagName;
13
+ let useNativeShadowDom = false;
13
14
  let isSvgMode = false;
14
15
  let queueCongestion = 0;
15
16
  let queuePending = false;
@@ -28,6 +29,13 @@ const uniqueTime = (key, measureText) => {
28
29
  }
29
30
  };
30
31
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
32
+ /**
33
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
34
+ *
35
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
36
+ * support as of Stencil v4.
37
+ */
38
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
31
39
  const XLINK_NS = 'http://www.w3.org/1999/xlink';
32
40
  /**
33
41
  * Default style mode id
@@ -338,6 +346,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
338
346
  }
339
347
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
340
348
  }
349
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
350
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
351
+ styleElm.innerHTML += SLOT_FB_CSS;
352
+ }
341
353
  if (appliedStyles) {
342
354
  appliedStyles.add(scopeId);
343
355
  }
@@ -468,11 +480,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
468
480
  // except for the first character, we keep the event name case
469
481
  memberName = ln[2] + memberName.slice(3);
470
482
  }
471
- if (oldValue) {
472
- plt.rel(elm, memberName, oldValue, false);
473
- }
474
- if (newValue) {
475
- plt.ael(elm, memberName, newValue, false);
483
+ if (oldValue || newValue) {
484
+ // Need to account for "capture" events.
485
+ // If the event name ends with "Capture", we'll update the name to remove
486
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
487
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
488
+ // Make sure we only replace the last instance of "Capture"
489
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
490
+ if (oldValue) {
491
+ plt.rel(elm, memberName, oldValue, capture);
492
+ }
493
+ if (newValue) {
494
+ plt.ael(elm, memberName, newValue, capture);
495
+ }
476
496
  }
477
497
  }
478
498
  else {
@@ -494,7 +514,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
494
514
  elm[memberName] = newValue;
495
515
  }
496
516
  }
497
- catch (e) { }
517
+ catch (e) {
518
+ /**
519
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
520
+ */
521
+ }
498
522
  }
499
523
  /**
500
524
  * Need to manually update attribute if:
@@ -533,7 +557,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
533
557
  }
534
558
  };
535
559
  const parseClassListRegex = /\s/;
560
+ /**
561
+ * Parsed a string of classnames into an array
562
+ * @param value className string, e.g. "foo bar baz"
563
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
564
+ */
536
565
  const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
566
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
567
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
537
568
  const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
538
569
  // if the element passed in is a shadow root, which is a document fragment
539
570
  // then we want to be adding attrs/props to the shadow root's "host" element
@@ -617,6 +648,9 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
617
648
  }
618
649
  }
619
650
  }
651
+ // This needs to always happen so we can hide nodes that are projected
652
+ // to another component but don't end up in a slot
653
+ elm['s-hn'] = hostTagName;
620
654
  return elm;
621
655
  };
622
656
  /**
@@ -741,8 +775,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
741
775
  * @param oldCh the old children of the parent node
742
776
  * @param newVNode the new VNode which will replace the parent
743
777
  * @param newCh the new children of the parent node
778
+ * @param isInitialRender whether or not this is the first render of the vdom
744
779
  */
745
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
780
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
746
781
  let oldStartIdx = 0;
747
782
  let newStartIdx = 0;
748
783
  let idxInOld = 0;
@@ -769,25 +804,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
769
804
  else if (newEndVnode == null) {
770
805
  newEndVnode = newCh[--newEndIdx];
771
806
  }
772
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
807
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
773
808
  // if the start nodes are the same then we should patch the new VNode
774
809
  // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
775
810
  // indices to reflect that. We don't need to move any DOM Nodes around
776
811
  // since things are matched up in order.
777
- patch(oldStartVnode, newStartVnode);
812
+ patch(oldStartVnode, newStartVnode, isInitialRender);
778
813
  oldStartVnode = oldCh[++oldStartIdx];
779
814
  newStartVnode = newCh[++newStartIdx];
780
815
  }
781
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
816
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
782
817
  // likewise, if the end nodes are the same we patch new onto old and
783
818
  // decrement our end indices, and also likewise in this case we don't
784
819
  // need to move any DOM Nodes.
785
- patch(oldEndVnode, newEndVnode);
820
+ patch(oldEndVnode, newEndVnode, isInitialRender);
786
821
  oldEndVnode = oldCh[--oldEndIdx];
787
822
  newEndVnode = newCh[--newEndIdx];
788
823
  }
789
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
790
- patch(oldStartVnode, newEndVnode);
824
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
825
+ patch(oldStartVnode, newEndVnode, isInitialRender);
791
826
  // We need to move the element for `oldStartVnode` into a position which
792
827
  // will be appropriate for `newEndVnode`. For this we can use
793
828
  // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
@@ -809,8 +844,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
809
844
  oldStartVnode = oldCh[++oldStartIdx];
810
845
  newEndVnode = newCh[--newEndIdx];
811
846
  }
812
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
813
- patch(oldEndVnode, newStartVnode);
847
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
848
+ patch(oldEndVnode, newStartVnode, isInitialRender);
814
849
  // We've already checked above if `oldStartVnode` and `newStartVnode` are
815
850
  // the same node, so since we're here we know that they are not. Thus we
816
851
  // can move the element for `oldEndVnode` _before_ the element for
@@ -847,7 +882,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
847
882
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
848
883
  }
849
884
  else {
850
- patch(elmToMove, newStartVnode);
885
+ patch(elmToMove, newStartVnode, isInitialRender);
851
886
  // invalidate the matching old node so that we won't try to update it
852
887
  // again later on
853
888
  oldCh[idxInOld] = undefined;
@@ -898,16 +933,22 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
898
933
  *
899
934
  * @param leftVNode the first VNode to check
900
935
  * @param rightVNode the second VNode to check
936
+ * @param isInitialRender whether or not this is the first render of the vdom
901
937
  * @returns whether they're equal or not
902
938
  */
903
- const isSameVnode = (leftVNode, rightVNode) => {
939
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
904
940
  // compare if two vnode to see if they're "technically" the same
905
941
  // need to have the same element tag, and same key to be the same
906
942
  if (leftVNode.$tag$ === rightVNode.$tag$) {
907
- // this will be set if components in the build have `key` attrs set on them
908
- {
943
+ // this will be set if JSX tags in the build have `key` attrs set on them
944
+ // we only want to check this if we're not on the first render since on
945
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
946
+ // astray and, for instance, accidentally delete a DOM node that we want to
947
+ // keep around.
948
+ if (!isInitialRender) {
909
949
  return leftVNode.$key$ === rightVNode.$key$;
910
950
  }
951
+ return true;
911
952
  }
912
953
  return false;
913
954
  };
@@ -918,8 +959,9 @@ const isSameVnode = (leftVNode, rightVNode) => {
918
959
  *
919
960
  * @param oldVNode an old VNode whose DOM element and children we want to update
920
961
  * @param newVNode a new VNode representing an updated version of the old one
962
+ * @param isInitialRender whether or not this is the first render of the vdom
921
963
  */
922
- const patch = (oldVNode, newVNode) => {
964
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
923
965
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
924
966
  const oldChildren = oldVNode.$children$;
925
967
  const newChildren = newVNode.$children$;
@@ -932,8 +974,7 @@ const patch = (oldVNode, newVNode) => {
932
974
  isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
933
975
  }
934
976
  {
935
- if (tag === 'slot')
936
- ;
977
+ if (tag === 'slot' && !useNativeShadowDom) ;
937
978
  else {
938
979
  // either this is the first render of an element OR it's an update
939
980
  // AND we already know it's possible it could have changed
@@ -944,7 +985,7 @@ const patch = (oldVNode, newVNode) => {
944
985
  if (oldChildren !== null && newChildren !== null) {
945
986
  // looks like there's child vnodes for both the old and new vnodes
946
987
  // so we need to call `updateChildren` to reconcile them
947
- updateChildren(elm, oldChildren, newVNode, newChildren);
988
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
948
989
  }
949
990
  else if (newChildren !== null) {
950
991
  // no old child vnodes, but there are new child vnodes to add
@@ -997,6 +1038,7 @@ const nullifyVNodeRefs = (vNode) => {
997
1038
  */
998
1039
  const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
999
1040
  const hostElm = hostRef.$hostElement$;
1041
+ const cmpMeta = hostRef.$cmpMeta$;
1000
1042
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1001
1043
  // if `renderFnResults` is a Host node then we can use it directly. If not,
1002
1044
  // we need to call `h` again to wrap the children of our component in a
@@ -1033,8 +1075,9 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1033
1075
  {
1034
1076
  scopeId = hostElm['s-sc'];
1035
1077
  }
1078
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1036
1079
  // synchronous patch
1037
- patch(oldVNode, rootVnode);
1080
+ patch(oldVNode, rootVnode, isInitialLoad);
1038
1081
  };
1039
1082
  const attachToAncestor = (hostRef, ancestorComponent) => {
1040
1083
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
@@ -1346,13 +1389,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1346
1389
  */
1347
1390
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1348
1391
  var _a;
1392
+ const prototype = Cstr.prototype;
1349
1393
  if (cmpMeta.$members$) {
1350
1394
  if (Cstr.watchers) {
1351
1395
  cmpMeta.$watchers$ = Cstr.watchers;
1352
1396
  }
1353
1397
  // It's better to have a const than two Object.entries()
1354
1398
  const members = Object.entries(cmpMeta.$members$);
1355
- const prototype = Cstr.prototype;
1356
1399
  members.map(([memberName, [memberFlags]]) => {
1357
1400
  if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1358
1401
  ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
@@ -1375,8 +1418,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1375
1418
  // proxyComponent - method
1376
1419
  Object.defineProperty(prototype, memberName, {
1377
1420
  value(...args) {
1421
+ var _a;
1378
1422
  const ref = getHostRef(this);
1379
- return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
1423
+ return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
1380
1424
  },
1381
1425
  });
1382
1426
  }
@@ -1385,6 +1429,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1385
1429
  const attrNameToPropName = new Map();
1386
1430
  prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1387
1431
  plt.jmp(() => {
1432
+ var _a;
1388
1433
  const propName = attrNameToPropName.get(attrName);
1389
1434
  // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1390
1435
  // in the case where an attribute was set inline.
@@ -1440,11 +1485,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1440
1485
  // 1. The instance is ready
1441
1486
  // 2. The watchers are ready
1442
1487
  // 3. The value has changed
1443
- if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1488
+ if (flags &&
1489
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1444
1490
  flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1445
1491
  newValue !== oldValue) {
1446
1492
  const instance = hostRef.$lazyInstance$ ;
1447
- const entry = cmpMeta.$watchers$[attrName];
1493
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1448
1494
  entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1449
1495
  if (instance[callbackName] != null) {
1450
1496
  instance[callbackName].call(instance, newValue, oldValue, attrName);
@@ -1654,7 +1700,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1654
1700
  const customElements = win.customElements;
1655
1701
  const head = doc.head;
1656
1702
  const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1657
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1703
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
1658
1704
  const deferredConnectedCallbacks = [];
1659
1705
  let appLoadFallback;
1660
1706
  let isBootstrapping = true;
@@ -1665,6 +1711,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1665
1711
  plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
1666
1712
  }
1667
1713
  }
1714
+ let hasSlotRelocation = false;
1668
1715
  lazyBundles.map((lazyBundle) => {
1669
1716
  lazyBundle[1].map((compactMeta) => {
1670
1717
  var _a;
@@ -1674,6 +1721,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1674
1721
  $members$: compactMeta[2],
1675
1722
  $listeners$: compactMeta[3],
1676
1723
  };
1724
+ // Check if we are using slots outside the shadow DOM in this component.
1725
+ // We'll use this information later to add styles for `slot-fb` elements
1726
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
1727
+ hasSlotRelocation = true;
1728
+ }
1677
1729
  {
1678
1730
  cmpMeta.$members$ = compactMeta[2];
1679
1731
  }
@@ -1730,15 +1782,29 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1730
1782
  }
1731
1783
  });
1732
1784
  });
1733
- {
1734
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1735
- visibilityStyle.setAttribute('data-styles', '');
1736
- // Apply CSP nonce to the style tag if it exists
1737
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1738
- if (nonce != null) {
1739
- visibilityStyle.setAttribute('nonce', nonce);
1785
+ // Only bother generating CSS if we have components
1786
+ // TODO(STENCIL-1118): Add test cases for CSS content based on conditionals
1787
+ if (cmpTags.length > 0) {
1788
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
1789
+ if (hasSlotRelocation) {
1790
+ dataStyles.textContent += SLOT_FB_CSS;
1791
+ }
1792
+ // Add hydration styles
1793
+ {
1794
+ dataStyles.textContent += cmpTags + HYDRATED_CSS;
1795
+ }
1796
+ // If we have styles, add them to the DOM
1797
+ if (dataStyles.innerHTML.length) {
1798
+ dataStyles.setAttribute('data-styles', '');
1799
+ // Apply CSP nonce to the style tag if it exists
1800
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1801
+ if (nonce != null) {
1802
+ dataStyles.setAttribute('nonce', nonce);
1803
+ }
1804
+ // Insert the styles into the document head
1805
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
1806
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1740
1807
  }
1741
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1742
1808
  }
1743
1809
  // Process deferred connectedCallbacks now all components have been registered
1744
1810
  isBootstrapping = false;
@@ -1787,7 +1853,12 @@ const getHostListenerTarget = (elm, flags) => {
1787
1853
  return elm;
1788
1854
  };
1789
1855
  // prettier-ignore
1790
- const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1856
+ const hostListenerOpts = (flags) => supportsListenerOptions
1857
+ ? ({
1858
+ passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
1859
+ capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
1860
+ })
1861
+ : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1791
1862
  /**
1792
1863
  * Assigns the given value to the nonce property on the runtime platform object.
1793
1864
  * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
@@ -1798,8 +1869,19 @@ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1798
1869
  /**
1799
1870
  * A WeakMap mapping runtime component references to their corresponding host reference
1800
1871
  * instances.
1872
+ *
1873
+ * **Note**: If we're in an HMR context we need to store a reference to this
1874
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1875
+ * to {@link d.HostRef} across HMR updates.
1876
+ *
1877
+ * This is necessary because when HMR updates for a component are processed by
1878
+ * the browser-side dev server client the JS bundle for that component is
1879
+ * re-fetched. Since the module containing {@link hostRefs} is included in
1880
+ * that bundle, if we do not store a reference to it the new iteration of the
1881
+ * component will not have access to the previous hostRef map, leading to a
1882
+ * bug where the new version of the component cannot properly initialize.
1801
1883
  */
1802
- const hostRefs = /*@__PURE__*/ new WeakMap();
1884
+ const hostRefs = new WeakMap();
1803
1885
  /**
1804
1886
  * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1805
1887
  *
@@ -1879,6 +1961,18 @@ const plt = {
1879
1961
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1880
1962
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
1881
1963
  };
1964
+ const supportsListenerOptions = /*@__PURE__*/ (() => {
1965
+ let supportsListenerOptions = false;
1966
+ try {
1967
+ doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
1968
+ get() {
1969
+ supportsListenerOptions = true;
1970
+ },
1971
+ }));
1972
+ }
1973
+ catch (e) { }
1974
+ return supportsListenerOptions;
1975
+ })();
1882
1976
  const promiseResolve = (v) => Promise.resolve(v);
1883
1977
  const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1884
1978
  try {
@@ -1962,7 +2056,7 @@ const flush = () => {
1962
2056
  }
1963
2057
  }
1964
2058
  };
1965
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
2059
+ const nextTick = (cb) => promiseResolve().then(cb);
1966
2060
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1967
2061
 
1968
2062
  export { Fragment as F, Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
@@ -1,10 +1,10 @@
1
- import { h } from './index-f644a780.js';
1
+ import { h } from './index-0b0002d2.js';
2
2
 
3
3
  const FontAwesomeIcon = props => {
4
- const width = props.icon.icon[0];
5
- const height = props.icon.icon[1];
6
- const iconPathData = props.icon.icon[4];
7
- return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}` }, Array.isArray(iconPathData) ? (iconPathData.map(path => h("path", { d: path }))) : (h("path", { d: iconPathData }))));
4
+ const width = props.icon.icon[0];
5
+ const height = props.icon.icon[1];
6
+ const iconPathData = props.icon.icon[4];
7
+ return (h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}` }, Array.isArray(iconPathData) ? (iconPathData.map(path => h("path", { d: path }))) : (h("path", { d: iconPathData }))));
8
8
  };
9
9
 
10
10
  var faCircleExclamation = {
@@ -1,9 +1,11 @@
1
- import { b as bootstrapLazy } from './index-f644a780.js';
2
- export { s as setNonce } from './index-f644a780.js';
1
+ import { b as bootstrapLazy } from './index-0b0002d2.js';
2
+ export { s as setNonce } from './index-0b0002d2.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
3
4
 
4
- const defineCustomElements = (win, options) => {
5
+ const defineCustomElements = async (win, options) => {
5
6
  if (typeof window === 'undefined') return undefined;
6
- return bootstrapLazy([["uofg-alert",[[1,"uofg-alert"]]],["uofg-card",[[1,"uofg-card",{"href":[1]}]]],["uofg-modal",[[1,"uofg-modal",{"label":[1],"alertDialog":[4,"alert-dialog"],"centered":[4],"staticBackdrop":[4,"static-backdrop"],"autoOpen":[4,"auto-open"],"isOpen":[32],"getState":[64],"setState":[64],"toggle":[64],"close":[64],"open":[64]},null,{"isOpen":["handleIsOpenChange"]}]]],["uofg-back-to-top_4",[[1,"uofg-header",{"pageTitle":[1,"page-title"],"pageUrl":[1,"page-url"],"isFullSize":[32],"pageSpecificContent":[32],"isSubContainerOverflowing":[32]},[[9,"resize","updateFullSize"]]],[1,"uofg-back-to-top",{"threshold":[2],"isVisible":[32]},[[9,"scroll","onScroll"]]],[1,"uofg-footer",{"extraLinks":[32]}],[0,"uofg-menu",{"autoCollapse":[4,"auto-collapse"],"isExpanded":[32],"getExpanded":[64],"setExpanded":[64],"toggle":[64],"collapse":[64],"expand":[64]},null,{"isExpanded":["handleIsExpandedChange"]}]]]], options);
7
+ await globalScripts();
8
+ return bootstrapLazy([["uofg-alert",[[1,"uofg-alert"]]],["uofg-modal",[[1,"uofg-modal",{"label":[1],"alertDialog":[4,"alert-dialog"],"centered":[4],"staticBackdrop":[4,"static-backdrop"],"autoOpen":[4,"auto-open"],"isOpen":[32],"getState":[64],"setState":[64],"toggle":[64],"close":[64],"open":[64]},null,{"isOpen":["handleIsOpenChange"]}]]],["uofg-back-to-top_5",[[1,"uofg-header",{"pageTitle":[1,"page-title"],"pageUrl":[1,"page-url"],"isFullSize":[32],"pageSpecificContent":[32],"isSubContainerOverflowing":[32]},[[9,"resize","updateFullSize"]]],[1,"uofg-back-to-top",{"threshold":[2],"isVisible":[32]},[[9,"scroll","onScroll"]]],[1,"uofg-card",{"href":[1]}],[1,"uofg-footer",{"extraLinks":[32]}],[0,"uofg-menu",{"autoCollapse":[4,"auto-collapse"],"isExpanded":[32],"getExpanded":[64],"setExpanded":[64],"toggle":[64],"collapse":[64],"expand":[64]},null,{"isExpanded":["handleIsExpandedChange"]}]]]], options);
7
9
  };
8
10
 
9
11
  export { defineCustomElements };
@@ -1,16 +1,17 @@
1
- import { r as registerInstance, h } from './index-f644a780.js';
2
- import { F as FontAwesomeIcon, a as faCircleExclamation } from './index-26c6582e.js';
1
+ import { r as registerInstance, h } from './index-0b0002d2.js';
2
+ import { F as FontAwesomeIcon, a as faCircleExclamation } from './index-e685921a.js';
3
3
 
4
- const uofgAlertCss = "*{box-sizing:border-box}button{border:none;background-color:transparent;cursor:pointer}a{color:inherit;text-decoration:none}ul{list-style:none;padding:0;margin:unset}ul>li{display:contents}:focus-visible{outline:2px solid #ffc72a;outline-offset:0.5rem}:host{display:block;max-width:100rem}#uofg-alert{display:flex;flex-direction:column;font-size:2rem}#uofg-alert-title{display:flex;align-items:center;font-size:2.25rem;padding:2rem;color:white;background-color:#c20430}#uofg-alert-title>svg{margin-right:1rem;fill:currentColor;height:1.5em}#uofg-alert-body{display:flex;flex-direction:column;padding:1.5rem 2rem;background-color:white}#uofg-alert-body slot[name=subtitle]::slotted(*){font-size:2rem;margin-bottom:2rem;font-weight:bold}#uofg-alert-body slot[name=message]::slotted(*){font-size:1.6rem}#uofg-alert-footer{display:flex;padding:1rem 2rem;background-color:#dddddd;font-size:1.4rem}";
4
+ const uofgAlertCss = ":host{display:block;max-width:100rem}*{box-sizing:border-box}a{text-decoration:none;color:inherit}button{border:none;background:none;cursor:pointer;font-size:inherit;font-family:inherit;color:inherit;line-height:inherit;word-spacing:inherit;letter-spacing:inherit}ul{list-style:none;padding:0;margin:0}@defaults border-spacing{--tw-border-spacing-x:0;--tw-border-spacing-y:0}@defaults transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1}@defaults touch-action{}@defaults scroll-snap-type{--tw-scroll-snap-strictness:proximity}@defaults gradient-color-stops{}@defaults font-variant-numeric{}@defaults box-shadow{--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}@defaults ring-width{--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}@defaults filter{}@defaults backdrop-filter{}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.tw-flex{display:flex!important}.tw-flex-col{flex-direction:column!important}.tw-items-center{align-items:center!important}.tw-bg-uofg-grey{--tw-bg-opacity:1!important;background-color:rgb(221 221 221/var(--tw-bg-opacity))!important}.tw-bg-uofg-red{--tw-bg-opacity:1!important;background-color:rgb(194 4 48/var(--tw-bg-opacity))!important}.tw-bg-white{--tw-bg-opacity:1!important;background-color:rgb(255 255 255/var(--tw-bg-opacity))!important}.tw-p-8{padding:2rem!important}.tw-px-8{padding-left:2rem!important;padding-right:2rem!important}.tw-py-4{padding-bottom:1rem!important;padding-top:1rem!important}.tw-py-6{padding-bottom:1.5rem!important;padding-top:1.5rem!important}.tw-text-2xl{font-size:1.5rem!important;line-height:2rem!important}.tw-text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.tw-text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.tw-text-white{--tw-text-opacity:1!important;color:rgb(255 255 255/var(--tw-text-opacity))!important}.\\[\\&\\>slot\\[name\\=\\\"message\\\"\\]\\:\\:slotted\\(\\*\\)\\]\\:tw-text-2xl>slot[name=message]::slotted(*){font-size:1.5rem!important;line-height:2rem!important}.\\[\\&\\>slot\\[name\\=\\\"subtitle\\\"\\]\\:\\:slotted\\(\\*\\)\\]\\:tw-mb-8>slot[name=subtitle]::slotted(*){margin-bottom:2rem!important}.\\[\\&\\>slot\\[name\\=\\\"subtitle\\\"\\]\\:\\:slotted\\(\\*\\)\\]\\:tw-text-4xl>slot[name=subtitle]::slotted(*){font-size:2.25rem!important;line-height:2.5rem!important}.\\[\\&\\>slot\\[name\\=\\\"subtitle\\\"\\]\\:\\:slotted\\(\\*\\)\\]\\:tw-font-bold>slot[name=subtitle]::slotted(*){font-weight:700!important}.\\[\\&\\>svg\\]\\:tw-mr-4>svg{margin-right:1rem!important}.\\[\\&\\>svg\\]\\:tw-h-\\[1\\.5em\\]>svg{height:1.5em!important}.\\[\\&\\>svg\\]\\:tw-fill-current>svg{fill:currentColor!important}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}";
5
+ const UofgAlertStyle0 = uofgAlertCss;
5
6
 
6
7
  const UofgAlert = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- }
10
- render() {
11
- return (h("div", { id: "uofg-alert" }, h("div", { id: "uofg-alert-title" }, h(FontAwesomeIcon, { icon: faCircleExclamation }), h("slot", { name: "title" })), h("div", { id: "uofg-alert-body" }, h("slot", { name: "subtitle" }), h("slot", { name: "message" })), h("div", { id: "uofg-alert-footer" }, h("slot", { name: "footer" }))));
12
- }
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ }
11
+ render() {
12
+ return (h("div", { key: '43637578cd80a54999db4a08bf6a5fa09c76c402', class: "tw-flex tw-flex-col tw-text-3xl" }, h("div", { key: '22313ab033d01b2271fd7dfe7d7747b5fd59e776', class: "tw-flex tw-items-center tw-bg-uofg-red tw-p-8 tw-text-4xl tw-text-white [&>svg]:tw-mr-4 [&>svg]:tw-h-[1.5em] [&>svg]:tw-fill-current" }, h(FontAwesomeIcon, { key: 'a742d78bcb8a8215d55a6270eabba0a53b165f26', icon: faCircleExclamation }), h("slot", { key: '5afc5e3a18c0fb3ab5662af2fa912752fda379c8', name: "title" })), h("div", { key: 'd2ff3754074ce3b5e7e254cdf72711b1174222a7', class: 'tw-flex tw-flex-col tw-bg-white tw-px-8 tw-py-6 [&>slot[name="message"]::slotted(*)]:tw-text-2xl [&>slot[name="subtitle"]::slotted(*)]:tw-mb-8 [&>slot[name="subtitle"]::slotted(*)]:tw-text-4xl [&>slot[name="subtitle"]::slotted(*)]:tw-font-bold' }, h("slot", { key: '261b7f2434eecdc63cd0746bdb11539be6e3edf9', name: "subtitle" }), h("slot", { key: '438ef72be3746c53ee8f628e553163a7af93fe3e', name: "message" })), h("div", { key: '6b3a020c4a6d98e7f7fe90b922a0be997a6f341a', class: "tw-flex tw-bg-uofg-grey tw-py-4 tw-px-8 tw-text-2xl" }, h("slot", { key: '588ae6afce9d76c96768b807c3135cb1714f2889', name: "footer" }))));
13
+ }
13
14
  };
14
- UofgAlert.style = uofgAlertCss;
15
+ UofgAlert.style = UofgAlertStyle0;
15
16
 
16
17
  export { UofgAlert as uofg_alert };