@content-blocks/js 0.5.0 → 0.7.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 (136) hide show
  1. package/dist/cjs/content-accordion_11.cjs.entry.js +79 -61
  2. package/dist/cjs/content-accordion_11.cjs.entry.js.map +1 -1
  3. package/dist/cjs/content-blocks.cjs.js +2 -2
  4. package/dist/cjs/content-carousel.cjs.entry.js +2 -1
  5. package/dist/cjs/content-carousel.cjs.entry.js.map +1 -1
  6. package/dist/cjs/content-navigation-block.cjs.entry.js +24 -20
  7. package/dist/cjs/content-navigation-block.cjs.entry.js.map +1 -1
  8. package/dist/cjs/content-split-block.cjs.entry.js +4 -4
  9. package/dist/cjs/content-split-block.cjs.entry.js.map +1 -1
  10. package/dist/cjs/content-tabs.cjs.entry.js +3 -3
  11. package/dist/cjs/{index-072153fb.js → index-9f20d89a.js} +34 -4
  12. package/dist/cjs/index-9f20d89a.js.map +1 -0
  13. package/dist/cjs/index.cjs.js +1 -1
  14. package/dist/cjs/loader.cjs.js +2 -2
  15. package/dist/cjs/{utils-9856e159.js → utils-db61cd70.js} +1 -3
  16. package/dist/cjs/utils-db61cd70.js.map +1 -0
  17. package/dist/cjs/{window-resize-service-77b2c64e.js → window-resize-service-ac5c2012.js} +2 -2
  18. package/dist/cjs/{window-resize-service-77b2c64e.js.map → window-resize-service-ac5c2012.js.map} +1 -1
  19. package/dist/collection/blocks/content-hero-block/content-hero-block.css +6 -0
  20. package/dist/collection/blocks/content-split-block/content-split-block.js +1 -1
  21. package/dist/collection/blocks/content-split-block/content-split-block.js.map +1 -1
  22. package/dist/collection/blocks/content-text-block/content-text-block.css +8 -8
  23. package/dist/collection/blocks/content-text-block/content-text-block.js +4 -4
  24. package/dist/collection/blocks/content-text-block/content-text-block.js.map +1 -1
  25. package/dist/collection/components/content-accordion/content-accordion.js +4 -6
  26. package/dist/collection/components/content-accordion/content-accordion.js.map +1 -1
  27. package/dist/collection/components/content-carousel/content-carousel.js +1 -0
  28. package/dist/collection/components/content-carousel/content-carousel.js.map +1 -1
  29. package/dist/collection/components/content-navigation-block/content-navigation-block.js +21 -17
  30. package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +1 -1
  31. package/dist/collection/components/content-overlay/content-overlay.css +12 -9
  32. package/dist/collection/components/content-overlay/content-overlay.js +32 -17
  33. package/dist/collection/components/content-overlay/content-overlay.js.map +1 -1
  34. package/dist/collection/elements/content-button/content-button.js +2 -6
  35. package/dist/collection/elements/content-button/content-button.js.map +1 -1
  36. package/dist/collection/elements/content-image/content-image.css +4 -7
  37. package/dist/collection/elements/content-image/content-image.js +82 -21
  38. package/dist/collection/elements/content-image/content-image.js.map +1 -1
  39. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +1 -0
  40. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +58 -15
  41. package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +1 -1
  42. package/dist/collection/formatters/content-spacer/content-spacer.css +16 -3
  43. package/dist/collection/formatters/content-spacer/content-spacer.js +47 -5
  44. package/dist/collection/formatters/content-spacer/content-spacer.js.map +1 -1
  45. package/dist/collection/stories/ContentHeroBlock.stories.js +2 -2
  46. package/dist/collection/stories/ContentHeroBlock.stories.js.map +1 -1
  47. package/dist/collection/stories/FullPageExample.stories.js +11 -11
  48. package/dist/collection/stories/FullPageExample.stories.js.map +1 -1
  49. package/dist/components/content-accordion.js +3 -4
  50. package/dist/components/content-accordion.js.map +1 -1
  51. package/dist/components/content-button.js +3 -6
  52. package/dist/components/content-button.js.map +1 -1
  53. package/dist/components/content-carousel.js +2 -0
  54. package/dist/components/content-carousel.js.map +1 -1
  55. package/dist/components/content-grid-formatter2.js +19 -12
  56. package/dist/components/content-grid-formatter2.js.map +1 -1
  57. package/dist/components/content-hero-block.js +2 -1
  58. package/dist/components/content-hero-block.js.map +1 -1
  59. package/dist/components/content-image.js +30 -22
  60. package/dist/components/content-image.js.map +1 -1
  61. package/dist/components/content-line.js +1 -0
  62. package/dist/components/content-line.js.map +1 -1
  63. package/dist/components/content-navigation-block.js +22 -17
  64. package/dist/components/content-navigation-block.js.map +1 -1
  65. package/dist/components/content-overlay.js +29 -13
  66. package/dist/components/content-overlay.js.map +1 -1
  67. package/dist/components/content-spacer.js +8 -4
  68. package/dist/components/content-spacer.js.map +1 -1
  69. package/dist/components/content-split-block.js +2 -1
  70. package/dist/components/content-split-block.js.map +1 -1
  71. package/dist/components/content-tabs.js +1 -0
  72. package/dist/components/content-tabs.js.map +1 -1
  73. package/dist/components/content-text-block.js +5 -4
  74. package/dist/components/content-text-block.js.map +1 -1
  75. package/dist/components/content-tout-block.js +1 -0
  76. package/dist/components/content-tout-block.js.map +1 -1
  77. package/dist/components/content-video.js +1 -0
  78. package/dist/components/content-video.js.map +1 -1
  79. package/dist/components/utils.js +1 -1
  80. package/dist/components/utils.js.map +1 -1
  81. package/dist/content-blocks/content-blocks.esm.js +1 -1
  82. package/dist/content-blocks/content-blocks.esm.js.map +1 -1
  83. package/dist/content-blocks/index.esm.js +1 -1
  84. package/dist/content-blocks/p-24657e66.entry.js +10 -0
  85. package/dist/content-blocks/p-24657e66.entry.js.map +1 -0
  86. package/dist/content-blocks/{p-30ab003a.entry.js → p-271fb304.entry.js} +2 -2
  87. package/dist/content-blocks/p-271fb304.entry.js.map +1 -0
  88. package/dist/content-blocks/p-288eace9.js +3 -0
  89. package/dist/content-blocks/p-288eace9.js.map +1 -0
  90. package/dist/content-blocks/{p-fd14acd9.entry.js → p-4bfbd7ef.entry.js} +2 -2
  91. package/dist/content-blocks/{p-fd14acd9.entry.js.map → p-4bfbd7ef.entry.js.map} +1 -1
  92. package/dist/content-blocks/{p-ebaee21f.entry.js → p-6a177aef.entry.js} +2 -2
  93. package/dist/content-blocks/{p-ebaee21f.entry.js.map → p-6a177aef.entry.js.map} +1 -1
  94. package/dist/content-blocks/{p-2c515f18.entry.js → p-8cc22c1e.entry.js} +2 -2
  95. package/dist/content-blocks/{p-da2c36ea.js → p-b04fe808.js} +2 -2
  96. package/dist/content-blocks/{p-da2c36ea.js.map → p-b04fe808.js.map} +1 -1
  97. package/dist/content-blocks/{p-3b4b9ad1.js → p-cfb4593f.js} +2 -2
  98. package/dist/esm/content-accordion_11.entry.js +79 -61
  99. package/dist/esm/content-accordion_11.entry.js.map +1 -1
  100. package/dist/esm/content-blocks.js +3 -3
  101. package/dist/esm/content-carousel.entry.js +2 -1
  102. package/dist/esm/content-carousel.entry.js.map +1 -1
  103. package/dist/esm/content-navigation-block.entry.js +24 -20
  104. package/dist/esm/content-navigation-block.entry.js.map +1 -1
  105. package/dist/esm/content-split-block.entry.js +4 -4
  106. package/dist/esm/content-split-block.entry.js.map +1 -1
  107. package/dist/esm/content-tabs.entry.js +3 -3
  108. package/dist/esm/{index-5c31f78b.js → index-e848c048.js} +34 -4
  109. package/dist/esm/index-e848c048.js.map +1 -0
  110. package/dist/esm/index.js +1 -1
  111. package/dist/esm/loader.js +3 -3
  112. package/dist/esm/{utils-4f29a9cf.js → utils-4f78228e.js} +2 -2
  113. package/dist/esm/utils-4f78228e.js.map +1 -0
  114. package/dist/esm/{window-resize-service-332e7420.js → window-resize-service-f40ec51c.js} +2 -2
  115. package/dist/esm/{window-resize-service-332e7420.js.map → window-resize-service-f40ec51c.js.map} +1 -1
  116. package/dist/types/blocks/content-text-block/content-text-block.d.ts +1 -1
  117. package/dist/types/components/content-accordion/content-accordion.d.ts +6 -7
  118. package/dist/types/components/content-overlay/content-overlay.d.ts +6 -4
  119. package/dist/types/components.d.ts +67 -15
  120. package/dist/types/elements/content-button/content-button.d.ts +2 -2
  121. package/dist/types/elements/content-image/content-image.d.ts +13 -0
  122. package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +10 -4
  123. package/dist/types/formatters/content-spacer/content-spacer.d.ts +11 -2
  124. package/dist/types/typings.d.ts +3 -3
  125. package/package.json +1 -1
  126. package/dist/cjs/index-072153fb.js.map +0 -1
  127. package/dist/cjs/utils-9856e159.js.map +0 -1
  128. package/dist/content-blocks/p-2faf0c78.js +0 -3
  129. package/dist/content-blocks/p-2faf0c78.js.map +0 -1
  130. package/dist/content-blocks/p-30ab003a.entry.js.map +0 -1
  131. package/dist/content-blocks/p-b8009321.entry.js +0 -10
  132. package/dist/content-blocks/p-b8009321.entry.js.map +0 -1
  133. package/dist/esm/index-5c31f78b.js.map +0 -1
  134. package/dist/esm/utils-4f29a9cf.js.map +0 -1
  135. /package/dist/content-blocks/{p-2c515f18.entry.js.map → p-8cc22c1e.entry.js.map} +0 -0
  136. /package/dist/content-blocks/{p-3b4b9ad1.js.map → p-cfb4593f.js.map} +0 -0
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-072153fb.js');
6
- const windowResizeService = require('./window-resize-service-77b2c64e.js');
7
- const utils = require('./utils-9856e159.js');
5
+ const index = require('./index-9f20d89a.js');
6
+ const windowResizeService = require('./window-resize-service-ac5c2012.js');
7
+ const utils = require('./utils-db61cd70.js');
8
8
  require('./BehaviorSubject-771fd78b.js');
9
9
 
10
10
  const contentAccordionCss = "*{box-sizing:border-box}content-accordion{display:block}content-accordion>button{display:block;width:100%;padding:0;border:none;font:inherit;color:inherit;background-color:transparent;cursor:pointer}content-accordion[expanded]>.content-accordion__reveal{display:block}content-accordion>.content-accordion__reveal{display:none}";
@@ -13,10 +13,10 @@ const ContentAccordion = class {
13
13
  constructor(hostRef) {
14
14
  index.registerInstance(this, hostRef);
15
15
  this.revealElement = undefined;
16
- this.open = 'false|true';
16
+ this.open = 'false';
17
17
  this.animationStart = 'animation-start';
18
18
  this.animationEnd = 'animation-end';
19
- this.animationTime = 300;
19
+ this.animationTime = 0;
20
20
  this.isOpen = false;
21
21
  this.randomID = '';
22
22
  this.classString = '';
@@ -50,8 +50,6 @@ const ContentAccordion = class {
50
50
  else {
51
51
  this.randomID = `${this.hostElement.tagName}_${Math.floor(Math.random() * document.querySelectorAll(this.hostElement.tagName).length)}`;
52
52
  }
53
- }
54
- componentDidLoad() {
55
53
  windowResizeService.WindowResizeService.registerProp(this.open).subscribe(newValue => {
56
54
  this.isOpen = newValue === 'true';
57
55
  if (this.isOpen) {
@@ -97,21 +95,17 @@ const ContentButton = class {
97
95
  });
98
96
  }
99
97
  onHandleClickEvent(ev) {
100
- console.log(ev);
101
98
  if (this.hasContentToActivate) {
102
- console.log('this.hascontenttoactivate');
103
99
  ev.preventDefault();
104
- ev.stopPropagation();
100
+ // ev.stopPropagation();
105
101
  this.activatedContent.dispatchEvent(new CustomEvent('contentBlockActivated', { detail: this.activatedContent }));
106
102
  this.activatedContent.scrollIntoView({ behavior: 'smooth' });
107
103
  }
108
104
  else if (this.href && this.href.length > 1 && this.href.substring(0, 1) === '#') {
109
105
  let element = document.getElementById(this.href.substring(1));
110
- console.log(this.href.substring(1));
111
106
  if (element) {
112
107
  ev.preventDefault();
113
- ev.stopPropagation();
114
- console.log(element);
108
+ // ev.stopPropagation();
115
109
  element.dispatchEvent(new CustomEvent('contentBlockActivated', { detail: element }));
116
110
  // element.scrollIntoView({ behavior: 'smooth' });
117
111
  }
@@ -124,7 +118,7 @@ const ContentButton = class {
124
118
  };
125
119
  ContentButton.style = contentButtonCss;
126
120
 
127
- const contentGridFormatterCss = "*{box-sizing:border-box}content-grid-formatter{width:100%;overflow:auto}content-grid-formatter *{box-sizing:border-box}content-grid-formatter[type=grid]{display:grid;grid-template-columns:repeat(var(--columns), 1fr)}content-grid-formatter[type=flex]{display:flex;align-items:var(--align-items);justify-content:var(--justify-content);flex-wrap:wrap}content-grid-formatter[type=flex]>*{overflow:auto;flex:0 0 auto;width:calc(100% / var(--columns))}content-grid-formatter>[flex-shrink=true]{width:auto;flex-shrink:1}content-grid-formatter[flex-shrink=true]>*{flex-shrink:1}content-grid-formatter[flex-grow=true]>*{flex-grow:1}content-grid-formatter>[flex-grow=true]{width:auto;flex-grow:1}";
121
+ const contentGridFormatterCss = "*{box-sizing:border-box}content-grid-formatter{width:100%;overflow:auto}content-grid-formatter *{box-sizing:border-box}content-grid-formatter[type=grid]{display:grid;grid-template-columns:repeat(var(--columns), 1fr);column-gap:var(--column-gap)}content-grid-formatter[type=flex]{display:flex;align-items:var(--align-items);justify-content:var(--justify-content);flex-wrap:wrap}content-grid-formatter[type=flex]>*{overflow:auto;flex:0 0 auto;width:calc(100% / var(--columns))}content-grid-formatter>[flex-shrink=true]{width:auto;flex-shrink:1}content-grid-formatter[flex-shrink=true]>*{flex-shrink:1}content-grid-formatter[flex-grow=true]>*{flex-grow:1}content-grid-formatter>[flex-grow=true]{width:auto;flex-grow:1}";
128
122
 
129
123
  const ContentGridFormatter = class {
130
124
  constructor(hostRef) {
@@ -134,22 +128,23 @@ const ContentGridFormatter = class {
134
128
  this.type = 'flex';
135
129
  this.flexGrow = 'false';
136
130
  this.flexShrink = 'false';
137
- this.verticalAlignment = 'space-between';
138
- this.horizontalAlignment = 'space-between';
131
+ this.vertical = 'space-between';
132
+ this.horizontal = 'space-between';
139
133
  this.columns = '1';
134
+ this.columnGap = '0';
140
135
  this.activeClassString = undefined;
141
136
  this.inlineStyle = {};
142
137
  }
143
- componentDidLoad() {
138
+ componentWillLoad() {
144
139
  return Promise.allSettled([
145
140
  windowResizeService.WindowResizeService.registerProp(this.type).subscribe(newValue => (this.type = newValue)),
146
- windowResizeService.WindowResizeService.registerProp(this.verticalAlignment).subscribe(newValue => {
147
- this.verticalAlignment = newValue;
148
- this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--align-items': this.verticalAlignment });
141
+ windowResizeService.WindowResizeService.registerProp(this.vertical).subscribe(newValue => {
142
+ this.vertical = newValue;
143
+ this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--align-items': this.vertical });
149
144
  }),
150
- windowResizeService.WindowResizeService.registerProp(this.horizontalAlignment).subscribe(newValue => {
151
- this.horizontalAlignment = newValue;
152
- this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--justify-content': this.horizontalAlignment });
145
+ windowResizeService.WindowResizeService.registerProp(this.horizontal).subscribe(newValue => {
146
+ this.horizontal = newValue;
147
+ this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--justify-content': this.horizontal });
153
148
  }),
154
149
  windowResizeService.WindowResizeService.registerProp(this.flexShrink).subscribe(newValue => (this.flexShrink = newValue)),
155
150
  windowResizeService.WindowResizeService.registerProp(this.flexGrow).subscribe(newValue => (this.flexGrow = newValue)),
@@ -157,6 +152,10 @@ const ContentGridFormatter = class {
157
152
  this.columns = newValue;
158
153
  this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--columns': newValue });
159
154
  }),
155
+ windowResizeService.WindowResizeService.registerProp(this.columnGap).subscribe(newValue => {
156
+ this.columnGap = newValue;
157
+ this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--column-gap': newValue });
158
+ }),
160
159
  windowResizeService.WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = newValue)),
161
160
  ]);
162
161
  }
@@ -166,7 +165,7 @@ const ContentGridFormatter = class {
166
165
  };
167
166
  ContentGridFormatter.style = contentGridFormatterCss;
168
167
 
169
- const contentHeroBlockCss = "*{box-sizing:border-box}content-hero-block{position:relative}content-hero-block[content-position=above]{display:grid;grid-template-columns:1fr}content-hero-block[content-position=above] .content-hero-block__background,content-hero-block[content-position=above] .content-hero-block__content{grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__background{height:100%;overflow:hidden}content-hero-block[content-position=above] .content-hero-block__content{display:flex;top:0;left:0;width:100%;height:100%;grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__content>*{width:100%}content-hero-block[content-position=above] .content-hero-block__content{position:relative;z-index:1}content-hero-block[content-position=below]{display:block}";
168
+ const contentHeroBlockCss = "*{box-sizing:border-box}content-hero-block{position:relative}content-hero-block[content-position=above]{display:grid;grid-template-columns:1fr}content-hero-block[content-position=above] .content-hero-block__background,content-hero-block[content-position=above] .content-hero-block__content{grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__background{height:100%;overflow:hidden}content-hero-block[content-position=above] .content-hero-block__background content-image,content-hero-block[content-position=above] .content-hero-block__background content-image picture,content-hero-block[content-position=above] .content-hero-block__background content-image img,content-hero-block[content-position=above] .content-hero-block__background content-image video{height:100%}content-hero-block[content-position=above] .content-hero-block__content{display:flex;top:0;left:0;width:100%;height:100%;grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__content>*{width:100%}content-hero-block[content-position=above] .content-hero-block__content{position:relative;z-index:1}content-hero-block[content-position=below]{display:block}";
170
169
 
171
170
  const ContentHeroBlock = class {
172
171
  constructor(hostRef) {
@@ -195,7 +194,7 @@ const ContentHeroBlock = class {
195
194
  };
196
195
  ContentHeroBlock.style = contentHeroBlockCss;
197
196
 
198
- const contentImageCss = "*{box-sizing:border-box}content-image{display:block;height:auto;transition:opacity 0.3s;position:relative}content-image.content-image-loading{opacity:0}content-image.content-image-loaded{opacity:1}content-image img,content-image picture,content-image video{display:block;width:100%;height:100%}content-hero-block content-image img,content-grid-formatter content-image img,content-hero-block content-image picture,content-grid-formatter content-image picture,content-hero-block content-image video,content-grid-formatter content-image video{height:auto}content-image .content-image__media-content{display:none;position:absolute;width:100%;height:100%;top:0;left:0;align-items:center;justify-content:center;overflow:hidden}content-image .content-image__media-content [slot=mediaContent]{height:100%;width:100%}content-image[content=true] .content-image__media-content{display:flex}";
197
+ const contentImageCss = "*{box-sizing:border-box}content-image{display:block;height:auto;transition:opacity 0.3s;position:relative}content-image.content-image-loading{opacity:0}content-image.content-image-loaded{opacity:1}content-image[aspect-ratio] img,content-image[aspect-ratio] picture,content-image[aspect-ratio] video{aspect-ratio:var(--aspect-ratio);object-fit:cover}content-image img,content-image picture,content-image video{display:block;width:100%;height:100%}content-image .content-image__media-content{display:none;position:absolute;width:100%;height:100%;top:0;left:0;align-items:center;justify-content:center;overflow:hidden}content-image .content-image__media-content [slot=mediaContent]{height:100%;width:100%}content-image[content=true] .content-image__media-content{display:flex}";
199
198
 
200
199
  const ContentImage = class {
201
200
  constructor(hostRef) {
@@ -207,6 +206,8 @@ const ContentImage = class {
207
206
  this.alt = undefined;
208
207
  this.width = '16';
209
208
  this.height = '9';
209
+ this.aspectRatio = undefined;
210
+ this.type = 'image';
210
211
  this.videoType = 'video/mp4';
211
212
  this.showContent = 'false|true';
212
213
  this.lazyLoadIsComplete = false;
@@ -215,6 +216,7 @@ const ContentImage = class {
215
216
  this.classString = '';
216
217
  this.inlineStyle = {};
217
218
  this.hasMediaContent = false;
219
+ this.pictureImageSrc = undefined;
218
220
  }
219
221
  preloadImage(src) {
220
222
  return new Promise(r => {
@@ -226,12 +228,8 @@ const ContentImage = class {
226
228
  }
227
229
  componentWillLoad() {
228
230
  this.hasMediaContent = !!this.hostElement.querySelector('[slot="mediaContent"]');
229
- windowResizeService.WindowResizeService.registerProp(this.src).subscribe(newValue => {
230
- this.showVideoAsGif = newValue.indexOf('.mp4') >= 0;
231
- if (!this.lazyLoadIsComplete) {
232
- this.lazyLoadIsComplete = true;
233
- }
234
- this.src = newValue;
231
+ windowResizeService.WindowResizeService.registerProp(this.aspectRatio).subscribe(newValue => {
232
+ this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--aspect-ratio': `${newValue}` });
235
233
  });
236
234
  windowResizeService.WindowResizeService.registerProp(this.alt).subscribe(newValue => {
237
235
  this.alt = newValue;
@@ -246,6 +244,23 @@ const ContentImage = class {
246
244
  this.classString = `${newValue}`;
247
245
  });
248
246
  }
247
+ componentDidLoad() {
248
+ let observer = new IntersectionObserver(entries => {
249
+ entries.forEach(async (entry) => {
250
+ if (entry.isIntersecting) {
251
+ this.lazyLoadIsComplete = true;
252
+ this.pictureImageSrc = utils.getCurrentValue(this.src);
253
+ this.showVideoAsGif = this.pictureImageSrc.indexOf('.mp4') >= 0 || utils.getCurrentValue(this.type) === 'video';
254
+ }
255
+ });
256
+ }, {
257
+ root: null,
258
+ // rootMargin: `${Math.max(100, window.innerHeight * 0.95)}px`,
259
+ rootMargin: `0px`,
260
+ threshold: 0.1,
261
+ });
262
+ observer.observe(this.hostElement);
263
+ }
249
264
  watchLazyLoadIsComplete(newValue) {
250
265
  if (newValue === true) {
251
266
  this.activeLazyLoadClass = 'content-image-loaded';
@@ -260,19 +275,7 @@ const ContentImage = class {
260
275
  }
261
276
  }
262
277
  render() {
263
- let pictureSrcSet = '';
264
- let pictureImageSrc = '';
265
- if (this.src) {
266
- utils.breakpointValues.forEach((_bp, index) => {
267
- if (index === 0) {
268
- pictureImageSrc = utils.getValueAtIndex(0, this.src);
269
- }
270
- else {
271
- pictureSrcSet += `${utils.getValueAtIndex(index, this.src)} ${utils.breakpointValues[index]}w,`;
272
- }
273
- });
274
- }
275
- return (index.h(index.Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (index.h("div", { class: "content-image__media-content" }, index.h("slot", { name: "mediaContent" }))), this.showVideoAsGif ? (index.h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, index.h("source", { src: this.lazyLoadIsComplete ? this.src : null, type: this.videoType }))) : (index.h("picture", null, index.h("source", { srcSet: pictureSrcSet }), index.h("img", { width: this.width, height: this.height, src: pictureImageSrc, alt: this.alt })))));
278
+ return (index.h(index.Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (index.h("div", { class: "content-image__media-content" }, index.h("slot", { name: "mediaContent" }))), this.showVideoAsGif ? (index.h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, index.h("source", { src: this.lazyLoadIsComplete ? this.pictureImageSrc : null, type: this.videoType }))) : (index.h("img", { width: this.width, height: this.height, src: this.pictureImageSrc, alt: this.alt }))));
276
279
  }
277
280
  get hostElement() { return index.getElement(this); }
278
281
  static get watchers() { return {
@@ -2250,7 +2253,7 @@ aria.replaceDialog = function (newDialogId, newFocusAfterClosed, newFocusFirst)
2250
2253
  }; // end replaceDialog
2251
2254
  window.aria = aria;
2252
2255
 
2253
- const contentOverlayCss = "*{box-sizing:border-box}.content-block-overlay-container{position:relative;display:block;height:100%}content-overlay{display:block;position:relative}content-overlay .content-overlay__content>*[slot=content]{height:100%}content-overlay.content-overlay-inactive{display:none}content-overlay[vertical-position=left]{align-items:flex-start}content-overlay[vertical-position=center]{align-items:center}content-overlay[vertical-position=right]{align-items:flex-end}content-overlay[vertical-position=top]{justify-content:flex-start}content-overlay[vertical-position=center]{justify-content:center}content-overlay[vertical-position=bottom]{justify-content:flex-end}content-overlay .content-overlay-background{background:rgba(255, 255, 255, 0.8);bottom:0;display:none;top:0;z-index:100000;right:0;left:0}content-overlay .content-overlay-background.active{display:block}content-overlay .content-overlay__header{display:flex;align-items:center}content-overlay .content-overlay__close{order:2;margin-left:auto;cursor:pointer;z-index:1;appearance:none;background:none;border:none}content-overlay.content-overlay--fullscreen .content-overlay-background{position:fixed}content-overlay.content-overlay--absolute{position:absolute;box-sizing:border-box;z-index:100000;height:100%;width:100%;top:0;left:0}content-overlay.content-overlay--absolute .content-overlay-background{position:absolute}content-overlay.content-overlay--absolute .content-overlay__content,content-overlay.content-overlay--fullscreen .content-overlay__content{flex:1;overflow:hidden}content-overlay [role=dialog]{display:flex;flex-direction:column;height:100%;justify-content:flex-start}content-overlay [role=dialog].hidden{display:none}body.has-dialog{overflow:hidden}";
2256
+ const contentOverlayCss = "*{box-sizing:border-box}.content-block-overlay-container{position:relative;display:block;height:100%}content-overlay{display:none;position:relative;flex:0}content-overlay .content-overlay__content>*[slot=content]{height:100%;overflow:auto}content-overlay.content-overlay-active{display:block}content-overlay[vertical=left]{align-items:flex-start}content-overlay[vertical=center]{align-items:center}content-overlay[vertical=right]{align-items:flex-end}content-overlay[vertical=top]{justify-content:flex-start}content-overlay[vertical=center]{justify-content:center}content-overlay[vertical=bottom]{justify-content:flex-end}content-overlay .content-overlay-background{background:rgba(255, 255, 255, 0.8);bottom:0;display:none;top:0;z-index:100000;right:0;left:0}content-overlay .content-overlay-background.active{display:block}content-overlay .content-overlay__header{display:flex;align-items:center}content-overlay .content-overlay__close{order:2;margin-left:auto;cursor:pointer;z-index:1;appearance:none;background:none;border:none;min-width:16px}content-overlay.content-overlay--fullscreen .content-overlay-background{position:fixed}content-overlay.content-overlay--absolute{position:absolute;box-sizing:border-box;z-index:100000;height:100%;width:100%;top:0;left:0}content-overlay.content-overlay--absolute .content-overlay-background{position:absolute}content-overlay.content-overlay--absolute .content-overlay__content,content-overlay.content-overlay--fullscreen .content-overlay__content{flex:1;overflow:hidden}content-overlay [role=dialog]{display:flex;flex-direction:column;height:100%;justify-content:flex-start}content-overlay [role=dialog].hidden{display:none}body.has-dialog{overflow:hidden}";
2254
2257
 
2255
2258
  const ContentOverlay = class {
2256
2259
  constructor(hostRef) {
@@ -2260,30 +2263,41 @@ const ContentOverlay = class {
2260
2263
  this.open = 'false';
2261
2264
  this.fullScreen = 'true';
2262
2265
  this.classes = undefined;
2263
- this.horizontalAlignment = 'center';
2264
- this.verticalAlignment = 'center';
2266
+ this.horizontal = 'center';
2267
+ this.vertical = 'center';
2265
2268
  this.closeTitle = 'Close Overlay';
2266
2269
  this.isActive = false;
2267
2270
  this.activeClass = '';
2268
2271
  this.classString = '';
2269
2272
  this.contentSlot = undefined;
2270
2273
  this.isFullScreen = false;
2274
+ this.hasCloseButton = false;
2275
+ this.originalMarkup = undefined;
2271
2276
  }
2272
2277
  onContentBlockActivated(event) {
2273
2278
  if (this.hostElement.getAttribute('id') === event.detail.getAttribute('id')) {
2274
2279
  event.preventDefault();
2275
- this.openOverlay();
2280
+ if (!this.isActive) {
2281
+ this.openOverlay();
2282
+ }
2283
+ else {
2284
+ this.closeOverlay();
2285
+ }
2276
2286
  }
2277
2287
  }
2278
2288
  async openOverlay() {
2279
- if (this.isActive) {
2280
- return false;
2281
- }
2289
+ // if (this.isActive) {
2290
+ // return false;
2291
+ // }
2282
2292
  this.isActive = true;
2293
+ if (!this.originalMarkup) {
2294
+ this.originalMarkup = this.contentSlot.querySelector('[slot="content"]').innerHTML;
2295
+ }
2283
2296
  if (this.target) {
2284
2297
  let targetElement = document.getElementById(this.target);
2285
2298
  if (targetElement) {
2286
2299
  targetElement.classList.add('content-block-overlay-container');
2300
+ targetElement.appendChild(this.hostElement);
2287
2301
  }
2288
2302
  }
2289
2303
  else if (this.isFullScreen) {
@@ -2292,6 +2306,7 @@ const ContentOverlay = class {
2292
2306
  }
2293
2307
  }
2294
2308
  if (this.contentSlot) {
2309
+ this.contentSlot.innerHTML = this.originalMarkup;
2295
2310
  this.setComputedActiveClass();
2296
2311
  if (this.isFullScreen) {
2297
2312
  this.focusTrap = createFocusTrap(this.hostElement, {
@@ -2306,6 +2321,7 @@ const ContentOverlay = class {
2306
2321
  this.contentOverlayActivated.emit(this.hostElement);
2307
2322
  }
2308
2323
  async closeOverlay() {
2324
+ this.contentSlot.innerHTML = '';
2309
2325
  this.isActive = false;
2310
2326
  this.activeClass = '';
2311
2327
  if (this.focusTrap) {
@@ -2328,11 +2344,10 @@ const ContentOverlay = class {
2328
2344
  this.activeClass = `content-overlay ${this.isActive ? 'content-overlay-active' : 'content-overlay-inactive'} content-overlay--${positioningValue}`;
2329
2345
  }
2330
2346
  componentWillLoad() {
2331
- this.contentSlot = this.hostElement.querySelector('[slot="content"]');
2332
2347
  this.contentElement = this.hostElement.querySelector('.js-content-overlay-content');
2333
2348
  windowResizeService.WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = `${newValue}`));
2334
- windowResizeService.WindowResizeService.registerProp(this.horizontalAlignment).subscribe(newValue => this.hostElement.setAttribute('horizontal-alignment', newValue));
2335
- windowResizeService.WindowResizeService.registerProp(this.verticalAlignment).subscribe(newValue => this.hostElement.setAttribute('vertical-alignment', newValue));
2349
+ windowResizeService.WindowResizeService.registerProp(this.horizontal).subscribe(newValue => this.hostElement.setAttribute('horizontal', newValue));
2350
+ windowResizeService.WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue));
2336
2351
  windowResizeService.WindowResizeService.registerProp(this.fullScreen).subscribe(newValue => {
2337
2352
  if (!this.target)
2338
2353
  this.isFullScreen = newValue === 'true';
@@ -2340,13 +2355,14 @@ const ContentOverlay = class {
2340
2355
  windowResizeService.WindowResizeService.registerProp(this.open).subscribe(newValue => {
2341
2356
  this.hostElement.setAttribute('open', newValue);
2342
2357
  });
2358
+ this.hasCloseButton = !!this.hostElement.querySelector('[slot="closeButton"]');
2343
2359
  }
2344
2360
  closeOverlayButtonClicked(event) {
2345
2361
  event.preventDefault();
2346
2362
  this.closeOverlay();
2347
2363
  }
2348
2364
  render() {
2349
- return (index.h(index.Host, { class: `${this.activeClass} ${this.classString}` }, index.h("div", { class: "content-block-overlay-container" }, index.h("div", { class: `content-overlay-background ${this.isActive ? 'active' : ''}` }, index.h("div", { ref: element => (this.dialogElement = element), role: "dialog", "aria-modal": "true", class: this.isActive ? 'active' : 'hidden', "aria-expanded": this.isActive }, index.h("div", { class: "content-overlay__header" }, index.h("button", { onClick: e => this.closeOverlayButtonClicked(e), class: "content-overlay__close", title: this.closeTitle }, index.h("slot", { name: "closeButton" })), index.h("slot", { name: "header" })), index.h("div", { class: "js-content-overlay-content content-overlay__content" }, index.h("slot", { name: "content" })))))));
2365
+ return (index.h(index.Host, { class: `${this.activeClass} ${this.classString}` }, index.h("div", { class: "content-block-overlay-container" }, index.h("div", { class: `content-overlay-background ${this.isActive ? 'active' : ''}` }, index.h("div", { ref: element => (this.dialogElement = element), role: "dialog", "aria-modal": "true", class: this.isActive ? 'active' : 'hidden', "aria-expanded": this.isActive }, index.h("div", { class: "content-overlay__header" }, index.h("button", { onClick: e => this.closeOverlayButtonClicked(e), class: "content-overlay__close", title: this.closeTitle }, !this.hasCloseButton && (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", width: "16", height: "16", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6 18 18 6M6 6l12 12" }))), index.h("slot", { name: "closeButton" })), index.h("slot", { name: "header" })), index.h("div", { class: "content-overlay__content", ref: (el) => (this.contentSlot = el) }, index.h("slot", { name: "content" })))))));
2350
2366
  }
2351
2367
  componentDidRender() {
2352
2368
  if (this.open === 'true') {
@@ -2365,7 +2381,7 @@ const ContentOverlay = class {
2365
2381
  };
2366
2382
  ContentOverlay.style = contentOverlayCss;
2367
2383
 
2368
- const contentSpacerCss = "*{box-sizing:border-box}content-spacer{display:block;width:100%;height:auto}content-spacer[full-height=true]{height:100%}content-spacer[text-align=left]{text-align:left}content-spacer[text-align=center]{text-align:center}content-spacer[text-align=right]{text-align:right}content-spacer[horizontal-position=left]{margin-left:0;margin-right:auto}content-spacer[horizontal-position=center]{margin-left:auto;margin-right:auto}content-spacer[horizontal-position=right]{margin-left:auto;margin-right:0}";
2384
+ const contentSpacerCss = "*{box-sizing:border-box}content-spacer{display:block;width:100%;height:auto}content-spacer[full-height=true]{height:100%}content-spacer[text-align=left]{text-align:left}content-spacer[text-align=center]{text-align:center}content-spacer[text-align=right]{text-align:right}content-spacer[horizontal=left]{margin-left:0;margin-right:auto}content-spacer[horizontal=center]{margin-left:auto;margin-right:auto}content-spacer[horizontal=right]{margin-left:auto;margin-right:0}content-spacer[vertical]{display:flex;flex-direction:column}content-spacer[vertical=top]{justify-content:flex-start}content-spacer[vertical=center]{justify-content:center}content-spacer[vertical=bottom]{justify-content:flex-end}";
2369
2385
 
2370
2386
  const ContentSpacingWrapper = class {
2371
2387
  constructor(hostRef) {
@@ -2375,7 +2391,8 @@ const ContentSpacingWrapper = class {
2375
2391
  this.maxWidth = '100';
2376
2392
  this.fullHeight = 'false';
2377
2393
  this.textAlign = 'default';
2378
- this.horizontalPosition = undefined;
2394
+ this.horizontal = 'default';
2395
+ this.vertical = 'top';
2379
2396
  this.topOffset = '0';
2380
2397
  this.bottomOffset = '0';
2381
2398
  this.leftOffset = '0';
@@ -2385,7 +2402,8 @@ const ContentSpacingWrapper = class {
2385
2402
  componentWillLoad() {
2386
2403
  windowResizeService.WindowResizeService.registerProp(this.fullHeight).subscribe(newValue => (this.fullHeight = newValue));
2387
2404
  windowResizeService.WindowResizeService.registerProp(this.textAlign).subscribe(newValue => (this.textAlign = newValue));
2388
- windowResizeService.WindowResizeService.registerProp(this.horizontalPosition).subscribe(newValue => (this.horizontalPosition = newValue));
2405
+ windowResizeService.WindowResizeService.registerProp(this.horizontal).subscribe(newValue => (this.horizontal = newValue));
2406
+ windowResizeService.WindowResizeService.registerProp(this.vertical).subscribe(newValue => (this.vertical = newValue));
2389
2407
  windowResizeService.WindowResizeService.registerProp(this.maxWidth).subscribe(newValue => {
2390
2408
  this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { 'max-width': isNaN(newValue) ? newValue : newValue + '%' });
2391
2409
  });
@@ -2409,7 +2427,7 @@ const ContentSpacingWrapper = class {
2409
2427
  };
2410
2428
  ContentSpacingWrapper.style = contentSpacerCss;
2411
2429
 
2412
- const contentTextBlockCss = "*{box-sizing:border-box}content-text-block{display:block;width:100%;text-align:initial}content-text-block[full-height=true]{height:100%}content-text-block>*[slot=footer]{margin-top:auto;margin-bottom:0;width:100%;padding-top:1rem;height:auto}content-text-block[vertical-alignment=bottom]>[slot=footer]{position:static;height:auto}content-text-block[vertical-alignment]{display:flex;flex-direction:column}content-text-block[vertical-alignment=top]{justify-content:flex-start}content-text-block[vertical-alignment=center]{justify-content:center}content-text-block[vertical-alignment=center][footer=true] .content-text-block__content{margin-top:auto;margin-bottom:0}content-text-block[vertical-alignment=bottom]{justify-content:flex-end}content-text-block[vertical-alignment=bottom][footer=true] .content-text-block__content{margin-top:auto;margin-bottom:0}content-text-block[vertical-alignment=bottom][footer=true]>[slot=footer]{margin-top:0}content-text-block[text-align=left]{text-align:left}content-text-block[text-align=center]{text-align:center}content-text-block[text-align=right]{text-align:right}";
2430
+ const contentTextBlockCss = "*{box-sizing:border-box}content-text-block{display:block;width:100%;text-align:initial}content-text-block[full-height=true]{height:100%}content-text-block>*[slot=footer]{margin-top:auto;margin-bottom:0;width:100%;padding-top:1rem;height:auto}content-text-block[vertical=bottom]>[slot=footer]{position:static;height:auto}content-text-block[vertical]{display:flex;flex-direction:column}content-text-block[vertical=top]{justify-content:flex-start}content-text-block[vertical=center]{justify-content:center}content-text-block[vertical=center][footer=true] .content-text-block__content{margin-top:auto;margin-bottom:0}content-text-block[vertical=bottom]{justify-content:flex-end}content-text-block[vertical=bottom][footer=true] .content-text-block__content{margin-top:auto;margin-bottom:0}content-text-block[vertical=bottom][footer=true]>[slot=footer]{margin-top:0}content-text-block[text-align=left]{text-align:left}content-text-block[text-align=center]{text-align:center}content-text-block[text-align=right]{text-align:right}";
2413
2431
 
2414
2432
  const ContentTextBlock = class {
2415
2433
  constructor(hostRef) {
@@ -2417,7 +2435,7 @@ const ContentTextBlock = class {
2417
2435
  this.classes = undefined;
2418
2436
  this.classString = undefined;
2419
2437
  this.minHeight = undefined;
2420
- this.verticalAlignment = 'top';
2438
+ this.vertical = 'top';
2421
2439
  this.fullHeight = 'false';
2422
2440
  this.textAlign = 'default';
2423
2441
  this.inlineStyle = {};
@@ -2430,7 +2448,7 @@ const ContentTextBlock = class {
2430
2448
  this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { 'min-height': isNaN(newValue) ? newValue : newValue + 'px' });
2431
2449
  });
2432
2450
  windowResizeService.WindowResizeService.registerProp(this.textAlign).subscribe(newValue => this.hostElement.setAttribute('text-align', newValue));
2433
- windowResizeService.WindowResizeService.registerProp(this.verticalAlignment).subscribe(newValue => this.hostElement.setAttribute('vertical-alignment', newValue));
2451
+ windowResizeService.WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue));
2434
2452
  windowResizeService.WindowResizeService.registerProp(this.fullHeight).subscribe(newValue => {
2435
2453
  this.hostElement.setAttribute('full-height', newValue);
2436
2454
  });