@content-blocks/js 0.6.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.
- package/dist/cjs/content-accordion_11.cjs.entry.js +40 -38
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +1 -1
- package/dist/cjs/content-blocks.cjs.js +1 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js +1 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/blocks/content-text-block/content-text-block.css +8 -8
- package/dist/collection/blocks/content-text-block/content-text-block.js +4 -4
- package/dist/collection/blocks/content-text-block/content-text-block.js.map +1 -1
- package/dist/collection/components/content-accordion/content-accordion.js +2 -4
- package/dist/collection/components/content-accordion/content-accordion.js.map +1 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +1 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +1 -1
- package/dist/collection/components/content-overlay/content-overlay.css +6 -6
- package/dist/collection/components/content-overlay/content-overlay.js +8 -8
- package/dist/collection/components/content-overlay/content-overlay.js.map +1 -1
- package/dist/collection/elements/content-button/content-button.js +0 -1
- package/dist/collection/elements/content-button/content-button.js.map +1 -1
- package/dist/collection/elements/content-image/content-image.js +18 -15
- package/dist/collection/elements/content-image/content-image.js.map +1 -1
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +12 -12
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +1 -1
- package/dist/collection/formatters/content-spacer/content-spacer.css +16 -3
- package/dist/collection/formatters/content-spacer/content-spacer.js +45 -4
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +1 -1
- package/dist/collection/stories/ContentHeroBlock.stories.js +2 -2
- package/dist/collection/stories/ContentHeroBlock.stories.js.map +1 -1
- package/dist/collection/stories/FullPageExample.stories.js +11 -11
- package/dist/collection/stories/FullPageExample.stories.js.map +1 -1
- package/dist/components/content-accordion.js +2 -3
- package/dist/components/content-accordion.js.map +1 -1
- package/dist/components/content-button.js +1 -1
- package/dist/components/content-button.js.map +1 -1
- package/dist/components/content-carousel.js +1 -0
- package/dist/components/content-carousel.js.map +1 -1
- package/dist/components/content-grid-formatter2.js +11 -10
- package/dist/components/content-grid-formatter2.js.map +1 -1
- package/dist/components/content-hero-block.js +1 -0
- package/dist/components/content-hero-block.js.map +1 -1
- package/dist/components/content-image.js +19 -15
- package/dist/components/content-image.js.map +1 -1
- package/dist/components/content-line.js +1 -0
- package/dist/components/content-line.js.map +1 -1
- package/dist/components/content-navigation-block.js +2 -1
- package/dist/components/content-navigation-block.js.map +1 -1
- package/dist/components/content-overlay.js +8 -7
- package/dist/components/content-overlay.js.map +1 -1
- package/dist/components/content-spacer.js +8 -4
- package/dist/components/content-spacer.js.map +1 -1
- package/dist/components/content-split-block.js +1 -0
- package/dist/components/content-split-block.js.map +1 -1
- package/dist/components/content-tabs.js +1 -0
- package/dist/components/content-tabs.js.map +1 -1
- package/dist/components/content-text-block.js +5 -4
- package/dist/components/content-text-block.js.map +1 -1
- package/dist/components/content-tout-block.js +1 -0
- package/dist/components/content-tout-block.js.map +1 -1
- package/dist/components/content-video.js +1 -0
- package/dist/components/content-video.js.map +1 -1
- package/dist/content-blocks/content-blocks.esm.js +1 -1
- package/dist/content-blocks/content-blocks.esm.js.map +1 -1
- package/dist/content-blocks/p-24657e66.entry.js +10 -0
- package/dist/content-blocks/p-24657e66.entry.js.map +1 -0
- package/dist/content-blocks/{p-167a9155.entry.js → p-6a177aef.entry.js} +2 -2
- package/dist/content-blocks/{p-167a9155.entry.js.map → p-6a177aef.entry.js.map} +1 -1
- package/dist/esm/content-accordion_11.entry.js +40 -38
- package/dist/esm/content-accordion_11.entry.js.map +1 -1
- package/dist/esm/content-blocks.js +1 -1
- package/dist/esm/content-navigation-block.entry.js +1 -1
- package/dist/esm/content-navigation-block.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/blocks/content-text-block/content-text-block.d.ts +1 -1
- package/dist/types/components/content-accordion/content-accordion.d.ts +0 -1
- package/dist/types/components/content-overlay/content-overlay.d.ts +2 -2
- package/dist/types/components.d.ts +30 -12
- package/dist/types/elements/content-button/content-button.d.ts +2 -2
- package/dist/types/elements/content-image/content-image.d.ts +1 -0
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +2 -2
- package/dist/types/formatters/content-spacer/content-spacer.d.ts +11 -2
- package/package.json +1 -1
- package/dist/content-blocks/p-4038cd42.entry.js +0 -10
- package/dist/content-blocks/p-4038cd42.entry.js.map +0 -1
|
@@ -13,7 +13,7 @@ const ContentAccordion = class {
|
|
|
13
13
|
constructor(hostRef) {
|
|
14
14
|
index.registerInstance(this, hostRef);
|
|
15
15
|
this.revealElement = undefined;
|
|
16
|
-
this.open = 'false
|
|
16
|
+
this.open = 'false';
|
|
17
17
|
this.animationStart = 'animation-start';
|
|
18
18
|
this.animationEnd = 'animation-end';
|
|
19
19
|
this.animationTime = 0;
|
|
@@ -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,7 +95,6 @@ const ContentButton = class {
|
|
|
97
95
|
});
|
|
98
96
|
}
|
|
99
97
|
onHandleClickEvent(ev) {
|
|
100
|
-
console.log(ev);
|
|
101
98
|
if (this.hasContentToActivate) {
|
|
102
99
|
ev.preventDefault();
|
|
103
100
|
// ev.stopPropagation();
|
|
@@ -131,8 +128,8 @@ const ContentGridFormatter = class {
|
|
|
131
128
|
this.type = 'flex';
|
|
132
129
|
this.flexGrow = 'false';
|
|
133
130
|
this.flexShrink = 'false';
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
131
|
+
this.vertical = 'space-between';
|
|
132
|
+
this.horizontal = 'space-between';
|
|
136
133
|
this.columns = '1';
|
|
137
134
|
this.columnGap = '0';
|
|
138
135
|
this.activeClassString = undefined;
|
|
@@ -141,13 +138,13 @@ const ContentGridFormatter = class {
|
|
|
141
138
|
componentWillLoad() {
|
|
142
139
|
return Promise.allSettled([
|
|
143
140
|
windowResizeService.WindowResizeService.registerProp(this.type).subscribe(newValue => (this.type = newValue)),
|
|
144
|
-
windowResizeService.WindowResizeService.registerProp(this.
|
|
145
|
-
this.
|
|
146
|
-
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--align-items': this.
|
|
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 });
|
|
147
144
|
}),
|
|
148
|
-
windowResizeService.WindowResizeService.registerProp(this.
|
|
149
|
-
this.
|
|
150
|
-
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--justify-content': this.
|
|
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 });
|
|
151
148
|
}),
|
|
152
149
|
windowResizeService.WindowResizeService.registerProp(this.flexShrink).subscribe(newValue => (this.flexShrink = newValue)),
|
|
153
150
|
windowResizeService.WindowResizeService.registerProp(this.flexGrow).subscribe(newValue => (this.flexGrow = newValue)),
|
|
@@ -231,20 +228,6 @@ const ContentImage = class {
|
|
|
231
228
|
}
|
|
232
229
|
componentWillLoad() {
|
|
233
230
|
this.hasMediaContent = !!this.hostElement.querySelector('[slot="mediaContent"]');
|
|
234
|
-
let observer = new IntersectionObserver(entries => {
|
|
235
|
-
entries.forEach(async (entry) => {
|
|
236
|
-
if (entry.isIntersecting) {
|
|
237
|
-
this.lazyLoadIsComplete = true;
|
|
238
|
-
this.pictureImageSrc = utils.getCurrentValue(this.src);
|
|
239
|
-
this.showVideoAsGif = this.pictureImageSrc.indexOf('.mp4') >= 0 || utils.getCurrentValue(this.type) === 'video';
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
}, {
|
|
243
|
-
root: null,
|
|
244
|
-
rootMargin: `${Math.max(100, window.innerHeight * 0.15)}px`,
|
|
245
|
-
threshold: 0.1,
|
|
246
|
-
});
|
|
247
|
-
observer.observe(this.hostElement);
|
|
248
231
|
windowResizeService.WindowResizeService.registerProp(this.aspectRatio).subscribe(newValue => {
|
|
249
232
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--aspect-ratio': `${newValue}` });
|
|
250
233
|
});
|
|
@@ -261,6 +244,23 @@ const ContentImage = class {
|
|
|
261
244
|
this.classString = `${newValue}`;
|
|
262
245
|
});
|
|
263
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
|
+
}
|
|
264
264
|
watchLazyLoadIsComplete(newValue) {
|
|
265
265
|
if (newValue === true) {
|
|
266
266
|
this.activeLazyLoadClass = 'content-image-loaded';
|
|
@@ -275,7 +275,7 @@ const ContentImage = class {
|
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
render() {
|
|
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.
|
|
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 }))));
|
|
279
279
|
}
|
|
280
280
|
get hostElement() { return index.getElement(this); }
|
|
281
281
|
static get watchers() { return {
|
|
@@ -2253,7 +2253,7 @@ aria.replaceDialog = function (newDialogId, newFocusAfterClosed, newFocusFirst)
|
|
|
2253
2253
|
}; // end replaceDialog
|
|
2254
2254
|
window.aria = aria;
|
|
2255
2255
|
|
|
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
|
|
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}";
|
|
2257
2257
|
|
|
2258
2258
|
const ContentOverlay = class {
|
|
2259
2259
|
constructor(hostRef) {
|
|
@@ -2263,8 +2263,8 @@ const ContentOverlay = class {
|
|
|
2263
2263
|
this.open = 'false';
|
|
2264
2264
|
this.fullScreen = 'true';
|
|
2265
2265
|
this.classes = undefined;
|
|
2266
|
-
this.
|
|
2267
|
-
this.
|
|
2266
|
+
this.horizontal = 'center';
|
|
2267
|
+
this.vertical = 'center';
|
|
2268
2268
|
this.closeTitle = 'Close Overlay';
|
|
2269
2269
|
this.isActive = false;
|
|
2270
2270
|
this.activeClass = '';
|
|
@@ -2346,8 +2346,8 @@ const ContentOverlay = class {
|
|
|
2346
2346
|
componentWillLoad() {
|
|
2347
2347
|
this.contentElement = this.hostElement.querySelector('.js-content-overlay-content');
|
|
2348
2348
|
windowResizeService.WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = `${newValue}`));
|
|
2349
|
-
windowResizeService.WindowResizeService.registerProp(this.
|
|
2350
|
-
windowResizeService.WindowResizeService.registerProp(this.
|
|
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));
|
|
2351
2351
|
windowResizeService.WindowResizeService.registerProp(this.fullScreen).subscribe(newValue => {
|
|
2352
2352
|
if (!this.target)
|
|
2353
2353
|
this.isFullScreen = newValue === 'true';
|
|
@@ -2381,7 +2381,7 @@ const ContentOverlay = class {
|
|
|
2381
2381
|
};
|
|
2382
2382
|
ContentOverlay.style = contentOverlayCss;
|
|
2383
2383
|
|
|
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
|
|
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}";
|
|
2385
2385
|
|
|
2386
2386
|
const ContentSpacingWrapper = class {
|
|
2387
2387
|
constructor(hostRef) {
|
|
@@ -2391,7 +2391,8 @@ const ContentSpacingWrapper = class {
|
|
|
2391
2391
|
this.maxWidth = '100';
|
|
2392
2392
|
this.fullHeight = 'false';
|
|
2393
2393
|
this.textAlign = 'default';
|
|
2394
|
-
this.
|
|
2394
|
+
this.horizontal = 'default';
|
|
2395
|
+
this.vertical = 'top';
|
|
2395
2396
|
this.topOffset = '0';
|
|
2396
2397
|
this.bottomOffset = '0';
|
|
2397
2398
|
this.leftOffset = '0';
|
|
@@ -2401,7 +2402,8 @@ const ContentSpacingWrapper = class {
|
|
|
2401
2402
|
componentWillLoad() {
|
|
2402
2403
|
windowResizeService.WindowResizeService.registerProp(this.fullHeight).subscribe(newValue => (this.fullHeight = newValue));
|
|
2403
2404
|
windowResizeService.WindowResizeService.registerProp(this.textAlign).subscribe(newValue => (this.textAlign = newValue));
|
|
2404
|
-
windowResizeService.WindowResizeService.registerProp(this.
|
|
2405
|
+
windowResizeService.WindowResizeService.registerProp(this.horizontal).subscribe(newValue => (this.horizontal = newValue));
|
|
2406
|
+
windowResizeService.WindowResizeService.registerProp(this.vertical).subscribe(newValue => (this.vertical = newValue));
|
|
2405
2407
|
windowResizeService.WindowResizeService.registerProp(this.maxWidth).subscribe(newValue => {
|
|
2406
2408
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { 'max-width': isNaN(newValue) ? newValue : newValue + '%' });
|
|
2407
2409
|
});
|
|
@@ -2425,7 +2427,7 @@ const ContentSpacingWrapper = class {
|
|
|
2425
2427
|
};
|
|
2426
2428
|
ContentSpacingWrapper.style = contentSpacerCss;
|
|
2427
2429
|
|
|
2428
|
-
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
|
|
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}";
|
|
2429
2431
|
|
|
2430
2432
|
const ContentTextBlock = class {
|
|
2431
2433
|
constructor(hostRef) {
|
|
@@ -2433,7 +2435,7 @@ const ContentTextBlock = class {
|
|
|
2433
2435
|
this.classes = undefined;
|
|
2434
2436
|
this.classString = undefined;
|
|
2435
2437
|
this.minHeight = undefined;
|
|
2436
|
-
this.
|
|
2438
|
+
this.vertical = 'top';
|
|
2437
2439
|
this.fullHeight = 'false';
|
|
2438
2440
|
this.textAlign = 'default';
|
|
2439
2441
|
this.inlineStyle = {};
|
|
@@ -2446,7 +2448,7 @@ const ContentTextBlock = class {
|
|
|
2446
2448
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { 'min-height': isNaN(newValue) ? newValue : newValue + 'px' });
|
|
2447
2449
|
});
|
|
2448
2450
|
windowResizeService.WindowResizeService.registerProp(this.textAlign).subscribe(newValue => this.hostElement.setAttribute('text-align', newValue));
|
|
2449
|
-
windowResizeService.WindowResizeService.registerProp(this.
|
|
2451
|
+
windowResizeService.WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue));
|
|
2450
2452
|
windowResizeService.WindowResizeService.registerProp(this.fullHeight).subscribe(newValue => {
|
|
2451
2453
|
this.hostElement.setAttribute('full-height', newValue);
|
|
2452
2454
|
});
|