@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
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const globalScripts = () => {};
4
+
5
+ exports.globalScripts = globalScripts;
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-4e3091d0.js');
3
+ const index = require('./index-cdb046b4.js');
4
4
 
5
5
  const FontAwesomeIcon = props => {
6
- const width = props.icon.icon[0];
7
- const height = props.icon.icon[1];
8
- const iconPathData = props.icon.icon[4];
9
- return (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}` }, Array.isArray(iconPathData) ? (iconPathData.map(path => index.h("path", { d: path }))) : (index.h("path", { d: iconPathData }))));
6
+ const width = props.icon.icon[0];
7
+ const height = props.icon.icon[1];
8
+ const iconPathData = props.icon.icon[4];
9
+ return (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}` }, Array.isArray(iconPathData) ? (iconPathData.map(path => index.h("path", { d: path }))) : (index.h("path", { d: iconPathData }))));
10
10
  };
11
11
 
12
12
  var faCircleExclamation = {
@@ -32,6 +32,7 @@ const NAMESPACE = 'uofg-web-components';
32
32
  */
33
33
  let scopeId;
34
34
  let hostTagName;
35
+ let useNativeShadowDom = false;
35
36
  let isSvgMode = false;
36
37
  let queueCongestion = 0;
37
38
  let queuePending = false;
@@ -50,6 +51,13 @@ const uniqueTime = (key, measureText) => {
50
51
  }
51
52
  };
52
53
  const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
54
+ /**
55
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
56
+ *
57
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
58
+ * support as of Stencil v4.
59
+ */
60
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
53
61
  const XLINK_NS = 'http://www.w3.org/1999/xlink';
54
62
  /**
55
63
  * Default style mode id
@@ -360,6 +368,10 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
360
368
  }
361
369
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
362
370
  }
371
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
372
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
373
+ styleElm.innerHTML += SLOT_FB_CSS;
374
+ }
363
375
  if (appliedStyles) {
364
376
  appliedStyles.add(scopeId);
365
377
  }
@@ -490,11 +502,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
490
502
  // except for the first character, we keep the event name case
491
503
  memberName = ln[2] + memberName.slice(3);
492
504
  }
493
- if (oldValue) {
494
- plt.rel(elm, memberName, oldValue, false);
495
- }
496
- if (newValue) {
497
- plt.ael(elm, memberName, newValue, false);
505
+ if (oldValue || newValue) {
506
+ // Need to account for "capture" events.
507
+ // If the event name ends with "Capture", we'll update the name to remove
508
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
509
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
510
+ // Make sure we only replace the last instance of "Capture"
511
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
512
+ if (oldValue) {
513
+ plt.rel(elm, memberName, oldValue, capture);
514
+ }
515
+ if (newValue) {
516
+ plt.ael(elm, memberName, newValue, capture);
517
+ }
498
518
  }
499
519
  }
500
520
  else {
@@ -516,7 +536,11 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
516
536
  elm[memberName] = newValue;
517
537
  }
518
538
  }
519
- catch (e) { }
539
+ catch (e) {
540
+ /**
541
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
542
+ */
543
+ }
520
544
  }
521
545
  /**
522
546
  * Need to manually update attribute if:
@@ -555,7 +579,14 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
555
579
  }
556
580
  };
557
581
  const parseClassListRegex = /\s/;
582
+ /**
583
+ * Parsed a string of classnames into an array
584
+ * @param value className string, e.g. "foo bar baz"
585
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
586
+ */
558
587
  const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
588
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
589
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
559
590
  const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
560
591
  // if the element passed in is a shadow root, which is a document fragment
561
592
  // then we want to be adding attrs/props to the shadow root's "host" element
@@ -639,6 +670,9 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
639
670
  }
640
671
  }
641
672
  }
673
+ // This needs to always happen so we can hide nodes that are projected
674
+ // to another component but don't end up in a slot
675
+ elm['s-hn'] = hostTagName;
642
676
  return elm;
643
677
  };
644
678
  /**
@@ -763,8 +797,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
763
797
  * @param oldCh the old children of the parent node
764
798
  * @param newVNode the new VNode which will replace the parent
765
799
  * @param newCh the new children of the parent node
800
+ * @param isInitialRender whether or not this is the first render of the vdom
766
801
  */
767
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
802
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
768
803
  let oldStartIdx = 0;
769
804
  let newStartIdx = 0;
770
805
  let idxInOld = 0;
@@ -791,25 +826,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
791
826
  else if (newEndVnode == null) {
792
827
  newEndVnode = newCh[--newEndIdx];
793
828
  }
794
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
829
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
795
830
  // if the start nodes are the same then we should patch the new VNode
796
831
  // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
797
832
  // indices to reflect that. We don't need to move any DOM Nodes around
798
833
  // since things are matched up in order.
799
- patch(oldStartVnode, newStartVnode);
834
+ patch(oldStartVnode, newStartVnode, isInitialRender);
800
835
  oldStartVnode = oldCh[++oldStartIdx];
801
836
  newStartVnode = newCh[++newStartIdx];
802
837
  }
803
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
838
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
804
839
  // likewise, if the end nodes are the same we patch new onto old and
805
840
  // decrement our end indices, and also likewise in this case we don't
806
841
  // need to move any DOM Nodes.
807
- patch(oldEndVnode, newEndVnode);
842
+ patch(oldEndVnode, newEndVnode, isInitialRender);
808
843
  oldEndVnode = oldCh[--oldEndIdx];
809
844
  newEndVnode = newCh[--newEndIdx];
810
845
  }
811
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
812
- patch(oldStartVnode, newEndVnode);
846
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
847
+ patch(oldStartVnode, newEndVnode, isInitialRender);
813
848
  // We need to move the element for `oldStartVnode` into a position which
814
849
  // will be appropriate for `newEndVnode`. For this we can use
815
850
  // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
@@ -831,8 +866,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
831
866
  oldStartVnode = oldCh[++oldStartIdx];
832
867
  newEndVnode = newCh[--newEndIdx];
833
868
  }
834
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
835
- patch(oldEndVnode, newStartVnode);
869
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
870
+ patch(oldEndVnode, newStartVnode, isInitialRender);
836
871
  // We've already checked above if `oldStartVnode` and `newStartVnode` are
837
872
  // the same node, so since we're here we know that they are not. Thus we
838
873
  // can move the element for `oldEndVnode` _before_ the element for
@@ -869,7 +904,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
869
904
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
870
905
  }
871
906
  else {
872
- patch(elmToMove, newStartVnode);
907
+ patch(elmToMove, newStartVnode, isInitialRender);
873
908
  // invalidate the matching old node so that we won't try to update it
874
909
  // again later on
875
910
  oldCh[idxInOld] = undefined;
@@ -920,16 +955,22 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
920
955
  *
921
956
  * @param leftVNode the first VNode to check
922
957
  * @param rightVNode the second VNode to check
958
+ * @param isInitialRender whether or not this is the first render of the vdom
923
959
  * @returns whether they're equal or not
924
960
  */
925
- const isSameVnode = (leftVNode, rightVNode) => {
961
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
926
962
  // compare if two vnode to see if they're "technically" the same
927
963
  // need to have the same element tag, and same key to be the same
928
964
  if (leftVNode.$tag$ === rightVNode.$tag$) {
929
- // this will be set if components in the build have `key` attrs set on them
930
- {
965
+ // this will be set if JSX tags in the build have `key` attrs set on them
966
+ // we only want to check this if we're not on the first render since on
967
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
968
+ // astray and, for instance, accidentally delete a DOM node that we want to
969
+ // keep around.
970
+ if (!isInitialRender) {
931
971
  return leftVNode.$key$ === rightVNode.$key$;
932
972
  }
973
+ return true;
933
974
  }
934
975
  return false;
935
976
  };
@@ -940,8 +981,9 @@ const isSameVnode = (leftVNode, rightVNode) => {
940
981
  *
941
982
  * @param oldVNode an old VNode whose DOM element and children we want to update
942
983
  * @param newVNode a new VNode representing an updated version of the old one
984
+ * @param isInitialRender whether or not this is the first render of the vdom
943
985
  */
944
- const patch = (oldVNode, newVNode) => {
986
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
945
987
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
946
988
  const oldChildren = oldVNode.$children$;
947
989
  const newChildren = newVNode.$children$;
@@ -954,8 +996,7 @@ const patch = (oldVNode, newVNode) => {
954
996
  isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
955
997
  }
956
998
  {
957
- if (tag === 'slot')
958
- ;
999
+ if (tag === 'slot' && !useNativeShadowDom) ;
959
1000
  else {
960
1001
  // either this is the first render of an element OR it's an update
961
1002
  // AND we already know it's possible it could have changed
@@ -966,7 +1007,7 @@ const patch = (oldVNode, newVNode) => {
966
1007
  if (oldChildren !== null && newChildren !== null) {
967
1008
  // looks like there's child vnodes for both the old and new vnodes
968
1009
  // so we need to call `updateChildren` to reconcile them
969
- updateChildren(elm, oldChildren, newVNode, newChildren);
1010
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
970
1011
  }
971
1012
  else if (newChildren !== null) {
972
1013
  // no old child vnodes, but there are new child vnodes to add
@@ -1019,6 +1060,7 @@ const nullifyVNodeRefs = (vNode) => {
1019
1060
  */
1020
1061
  const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1021
1062
  const hostElm = hostRef.$hostElement$;
1063
+ const cmpMeta = hostRef.$cmpMeta$;
1022
1064
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1023
1065
  // if `renderFnResults` is a Host node then we can use it directly. If not,
1024
1066
  // we need to call `h` again to wrap the children of our component in a
@@ -1055,8 +1097,9 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1055
1097
  {
1056
1098
  scopeId = hostElm['s-sc'];
1057
1099
  }
1100
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1058
1101
  // synchronous patch
1059
- patch(oldVNode, rootVnode);
1102
+ patch(oldVNode, rootVnode, isInitialLoad);
1060
1103
  };
1061
1104
  const attachToAncestor = (hostRef, ancestorComponent) => {
1062
1105
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
@@ -1368,13 +1411,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1368
1411
  */
1369
1412
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1370
1413
  var _a;
1414
+ const prototype = Cstr.prototype;
1371
1415
  if (cmpMeta.$members$) {
1372
1416
  if (Cstr.watchers) {
1373
1417
  cmpMeta.$watchers$ = Cstr.watchers;
1374
1418
  }
1375
1419
  // It's better to have a const than two Object.entries()
1376
1420
  const members = Object.entries(cmpMeta.$members$);
1377
- const prototype = Cstr.prototype;
1378
1421
  members.map(([memberName, [memberFlags]]) => {
1379
1422
  if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1380
1423
  ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
@@ -1397,8 +1440,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1397
1440
  // proxyComponent - method
1398
1441
  Object.defineProperty(prototype, memberName, {
1399
1442
  value(...args) {
1443
+ var _a;
1400
1444
  const ref = getHostRef(this);
1401
- return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
1445
+ 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); });
1402
1446
  },
1403
1447
  });
1404
1448
  }
@@ -1407,6 +1451,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1407
1451
  const attrNameToPropName = new Map();
1408
1452
  prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1409
1453
  plt.jmp(() => {
1454
+ var _a;
1410
1455
  const propName = attrNameToPropName.get(attrName);
1411
1456
  // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1412
1457
  // in the case where an attribute was set inline.
@@ -1462,11 +1507,12 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1462
1507
  // 1. The instance is ready
1463
1508
  // 2. The watchers are ready
1464
1509
  // 3. The value has changed
1465
- if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1510
+ if (flags &&
1511
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1466
1512
  flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1467
1513
  newValue !== oldValue) {
1468
1514
  const instance = hostRef.$lazyInstance$ ;
1469
- const entry = cmpMeta.$watchers$[attrName];
1515
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1470
1516
  entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1471
1517
  if (instance[callbackName] != null) {
1472
1518
  instance[callbackName].call(instance, newValue, oldValue, attrName);
@@ -1676,7 +1722,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1676
1722
  const customElements = win.customElements;
1677
1723
  const head = doc.head;
1678
1724
  const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1679
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1725
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
1680
1726
  const deferredConnectedCallbacks = [];
1681
1727
  let appLoadFallback;
1682
1728
  let isBootstrapping = true;
@@ -1687,6 +1733,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1687
1733
  plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
1688
1734
  }
1689
1735
  }
1736
+ let hasSlotRelocation = false;
1690
1737
  lazyBundles.map((lazyBundle) => {
1691
1738
  lazyBundle[1].map((compactMeta) => {
1692
1739
  var _a;
@@ -1696,6 +1743,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1696
1743
  $members$: compactMeta[2],
1697
1744
  $listeners$: compactMeta[3],
1698
1745
  };
1746
+ // Check if we are using slots outside the shadow DOM in this component.
1747
+ // We'll use this information later to add styles for `slot-fb` elements
1748
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
1749
+ hasSlotRelocation = true;
1750
+ }
1699
1751
  {
1700
1752
  cmpMeta.$members$ = compactMeta[2];
1701
1753
  }
@@ -1752,15 +1804,29 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1752
1804
  }
1753
1805
  });
1754
1806
  });
1755
- {
1756
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1757
- visibilityStyle.setAttribute('data-styles', '');
1758
- // Apply CSP nonce to the style tag if it exists
1759
- const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1760
- if (nonce != null) {
1761
- visibilityStyle.setAttribute('nonce', nonce);
1807
+ // Only bother generating CSS if we have components
1808
+ // TODO(STENCIL-1118): Add test cases for CSS content based on conditionals
1809
+ if (cmpTags.length > 0) {
1810
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
1811
+ if (hasSlotRelocation) {
1812
+ dataStyles.textContent += SLOT_FB_CSS;
1813
+ }
1814
+ // Add hydration styles
1815
+ {
1816
+ dataStyles.textContent += cmpTags + HYDRATED_CSS;
1817
+ }
1818
+ // If we have styles, add them to the DOM
1819
+ if (dataStyles.innerHTML.length) {
1820
+ dataStyles.setAttribute('data-styles', '');
1821
+ // Apply CSP nonce to the style tag if it exists
1822
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1823
+ if (nonce != null) {
1824
+ dataStyles.setAttribute('nonce', nonce);
1825
+ }
1826
+ // Insert the styles into the document head
1827
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
1828
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1762
1829
  }
1763
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1764
1830
  }
1765
1831
  // Process deferred connectedCallbacks now all components have been registered
1766
1832
  isBootstrapping = false;
@@ -1809,7 +1875,12 @@ const getHostListenerTarget = (elm, flags) => {
1809
1875
  return elm;
1810
1876
  };
1811
1877
  // prettier-ignore
1812
- const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1878
+ const hostListenerOpts = (flags) => supportsListenerOptions
1879
+ ? ({
1880
+ passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
1881
+ capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
1882
+ })
1883
+ : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1813
1884
  /**
1814
1885
  * Assigns the given value to the nonce property on the runtime platform object.
1815
1886
  * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
@@ -1820,8 +1891,19 @@ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1820
1891
  /**
1821
1892
  * A WeakMap mapping runtime component references to their corresponding host reference
1822
1893
  * instances.
1894
+ *
1895
+ * **Note**: If we're in an HMR context we need to store a reference to this
1896
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1897
+ * to {@link d.HostRef} across HMR updates.
1898
+ *
1899
+ * This is necessary because when HMR updates for a component are processed by
1900
+ * the browser-side dev server client the JS bundle for that component is
1901
+ * re-fetched. Since the module containing {@link hostRefs} is included in
1902
+ * that bundle, if we do not store a reference to it the new iteration of the
1903
+ * component will not have access to the previous hostRef map, leading to a
1904
+ * bug where the new version of the component cannot properly initialize.
1823
1905
  */
1824
- const hostRefs = /*@__PURE__*/ new WeakMap();
1906
+ const hostRefs = new WeakMap();
1825
1907
  /**
1826
1908
  * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1827
1909
  *
@@ -1901,6 +1983,18 @@ const plt = {
1901
1983
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1902
1984
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
1903
1985
  };
1986
+ const supportsListenerOptions = /*@__PURE__*/ (() => {
1987
+ let supportsListenerOptions = false;
1988
+ try {
1989
+ doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
1990
+ get() {
1991
+ supportsListenerOptions = true;
1992
+ },
1993
+ }));
1994
+ }
1995
+ catch (e) { }
1996
+ return supportsListenerOptions;
1997
+ })();
1904
1998
  const promiseResolve = (v) => Promise.resolve(v);
1905
1999
  const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1906
2000
  try {
@@ -1984,7 +2078,7 @@ const flush = () => {
1984
2078
  }
1985
2079
  }
1986
2080
  };
1987
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
2081
+ const nextTick = (cb) => promiseResolve().then(cb);
1988
2082
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1989
2083
 
1990
2084
  exports.Fragment = Fragment;
@@ -2,11 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4e3091d0.js');
5
+ const index = require('./index-cdb046b4.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
6
7
 
7
- const defineCustomElements = (win, options) => {
8
+ const defineCustomElements = async (win, options) => {
8
9
  if (typeof window === 'undefined') return undefined;
9
- return index.bootstrapLazy([["uofg-alert.cjs",[[1,"uofg-alert"]]],["uofg-card.cjs",[[1,"uofg-card",{"href":[1]}]]],["uofg-modal.cjs",[[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.cjs",[[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);
10
+ await appGlobals.globalScripts();
11
+ return index.bootstrapLazy([["uofg-alert.cjs",[[1,"uofg-alert"]]],["uofg-modal.cjs",[[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.cjs",[[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);
10
12
  };
11
13
 
12
14
  exports.setNonce = index.setNonce;
@@ -2,19 +2,20 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-4e3091d0.js');
6
- const index$1 = require('./index-469a8261.js');
5
+ const index = require('./index-cdb046b4.js');
6
+ const index$1 = require('./index-06b58d35.js');
7
7
 
8
- 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}";
8
+ 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;}";
9
+ const UofgAlertStyle0 = uofgAlertCss;
9
10
 
10
11
  const UofgAlert = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- }
14
- render() {
15
- return (index.h("div", { id: "uofg-alert" }, index.h("div", { id: "uofg-alert-title" }, index.h(index$1.FontAwesomeIcon, { icon: index$1.faCircleExclamation }), index.h("slot", { name: "title" })), index.h("div", { id: "uofg-alert-body" }, index.h("slot", { name: "subtitle" }), index.h("slot", { name: "message" })), index.h("div", { id: "uofg-alert-footer" }, index.h("slot", { name: "footer" }))));
16
- }
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ }
15
+ render() {
16
+ return (index.h("div", { key: '43637578cd80a54999db4a08bf6a5fa09c76c402', class: "tw-flex tw-flex-col tw-text-3xl" }, index.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" }, index.h(index$1.FontAwesomeIcon, { key: 'a742d78bcb8a8215d55a6270eabba0a53b165f26', icon: index$1.faCircleExclamation }), index.h("slot", { key: '5afc5e3a18c0fb3ab5662af2fa912752fda379c8', name: "title" })), index.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' }, index.h("slot", { key: '261b7f2434eecdc63cd0746bdb11539be6e3edf9', name: "subtitle" }), index.h("slot", { key: '438ef72be3746c53ee8f628e553163a7af93fe3e', name: "message" })), index.h("div", { key: '6b3a020c4a6d98e7f7fe90b922a0be997a6f341a', class: "tw-flex tw-bg-uofg-grey tw-py-4 tw-px-8 tw-text-2xl" }, index.h("slot", { key: '588ae6afce9d76c96768b807c3135cb1714f2889', name: "footer" }))));
17
+ }
17
18
  };
18
- UofgAlert.style = uofgAlertCss;
19
+ UofgAlert.style = UofgAlertStyle0;
19
20
 
20
21
  exports.uofg_alert = UofgAlert;