@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
|
@@ -9,7 +9,7 @@ const ContentAccordion = class {
|
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
registerInstance(this, hostRef);
|
|
11
11
|
this.revealElement = undefined;
|
|
12
|
-
this.open = 'false
|
|
12
|
+
this.open = 'false';
|
|
13
13
|
this.animationStart = 'animation-start';
|
|
14
14
|
this.animationEnd = 'animation-end';
|
|
15
15
|
this.animationTime = 0;
|
|
@@ -46,8 +46,6 @@ const ContentAccordion = class {
|
|
|
46
46
|
else {
|
|
47
47
|
this.randomID = `${this.hostElement.tagName}_${Math.floor(Math.random() * document.querySelectorAll(this.hostElement.tagName).length)}`;
|
|
48
48
|
}
|
|
49
|
-
}
|
|
50
|
-
componentDidLoad() {
|
|
51
49
|
WindowResizeService.registerProp(this.open).subscribe(newValue => {
|
|
52
50
|
this.isOpen = newValue === 'true';
|
|
53
51
|
if (this.isOpen) {
|
|
@@ -93,7 +91,6 @@ const ContentButton = class {
|
|
|
93
91
|
});
|
|
94
92
|
}
|
|
95
93
|
onHandleClickEvent(ev) {
|
|
96
|
-
console.log(ev);
|
|
97
94
|
if (this.hasContentToActivate) {
|
|
98
95
|
ev.preventDefault();
|
|
99
96
|
// ev.stopPropagation();
|
|
@@ -127,8 +124,8 @@ const ContentGridFormatter = class {
|
|
|
127
124
|
this.type = 'flex';
|
|
128
125
|
this.flexGrow = 'false';
|
|
129
126
|
this.flexShrink = 'false';
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
127
|
+
this.vertical = 'space-between';
|
|
128
|
+
this.horizontal = 'space-between';
|
|
132
129
|
this.columns = '1';
|
|
133
130
|
this.columnGap = '0';
|
|
134
131
|
this.activeClassString = undefined;
|
|
@@ -137,13 +134,13 @@ const ContentGridFormatter = class {
|
|
|
137
134
|
componentWillLoad() {
|
|
138
135
|
return Promise.allSettled([
|
|
139
136
|
WindowResizeService.registerProp(this.type).subscribe(newValue => (this.type = newValue)),
|
|
140
|
-
WindowResizeService.registerProp(this.
|
|
141
|
-
this.
|
|
142
|
-
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--align-items': this.
|
|
137
|
+
WindowResizeService.registerProp(this.vertical).subscribe(newValue => {
|
|
138
|
+
this.vertical = newValue;
|
|
139
|
+
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--align-items': this.vertical });
|
|
143
140
|
}),
|
|
144
|
-
WindowResizeService.registerProp(this.
|
|
145
|
-
this.
|
|
146
|
-
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--justify-content': this.
|
|
141
|
+
WindowResizeService.registerProp(this.horizontal).subscribe(newValue => {
|
|
142
|
+
this.horizontal = newValue;
|
|
143
|
+
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--justify-content': this.horizontal });
|
|
147
144
|
}),
|
|
148
145
|
WindowResizeService.registerProp(this.flexShrink).subscribe(newValue => (this.flexShrink = newValue)),
|
|
149
146
|
WindowResizeService.registerProp(this.flexGrow).subscribe(newValue => (this.flexGrow = newValue)),
|
|
@@ -227,20 +224,6 @@ const ContentImage = class {
|
|
|
227
224
|
}
|
|
228
225
|
componentWillLoad() {
|
|
229
226
|
this.hasMediaContent = !!this.hostElement.querySelector('[slot="mediaContent"]');
|
|
230
|
-
let observer = new IntersectionObserver(entries => {
|
|
231
|
-
entries.forEach(async (entry) => {
|
|
232
|
-
if (entry.isIntersecting) {
|
|
233
|
-
this.lazyLoadIsComplete = true;
|
|
234
|
-
this.pictureImageSrc = getCurrentValue(this.src);
|
|
235
|
-
this.showVideoAsGif = this.pictureImageSrc.indexOf('.mp4') >= 0 || getCurrentValue(this.type) === 'video';
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}, {
|
|
239
|
-
root: null,
|
|
240
|
-
rootMargin: `${Math.max(100, window.innerHeight * 0.15)}px`,
|
|
241
|
-
threshold: 0.1,
|
|
242
|
-
});
|
|
243
|
-
observer.observe(this.hostElement);
|
|
244
227
|
WindowResizeService.registerProp(this.aspectRatio).subscribe(newValue => {
|
|
245
228
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { '--aspect-ratio': `${newValue}` });
|
|
246
229
|
});
|
|
@@ -257,6 +240,23 @@ const ContentImage = class {
|
|
|
257
240
|
this.classString = `${newValue}`;
|
|
258
241
|
});
|
|
259
242
|
}
|
|
243
|
+
componentDidLoad() {
|
|
244
|
+
let observer = new IntersectionObserver(entries => {
|
|
245
|
+
entries.forEach(async (entry) => {
|
|
246
|
+
if (entry.isIntersecting) {
|
|
247
|
+
this.lazyLoadIsComplete = true;
|
|
248
|
+
this.pictureImageSrc = getCurrentValue(this.src);
|
|
249
|
+
this.showVideoAsGif = this.pictureImageSrc.indexOf('.mp4') >= 0 || getCurrentValue(this.type) === 'video';
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
}, {
|
|
253
|
+
root: null,
|
|
254
|
+
// rootMargin: `${Math.max(100, window.innerHeight * 0.95)}px`,
|
|
255
|
+
rootMargin: `0px`,
|
|
256
|
+
threshold: 0.1,
|
|
257
|
+
});
|
|
258
|
+
observer.observe(this.hostElement);
|
|
259
|
+
}
|
|
260
260
|
watchLazyLoadIsComplete(newValue) {
|
|
261
261
|
if (newValue === true) {
|
|
262
262
|
this.activeLazyLoadClass = 'content-image-loaded';
|
|
@@ -271,7 +271,7 @@ const ContentImage = class {
|
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
render() {
|
|
274
|
-
return (h(Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (h("div", { class: "content-image__media-content" }, h("slot", { name: "mediaContent" }))), this.showVideoAsGif ? (h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, h("source", { src: this.lazyLoadIsComplete ? this.
|
|
274
|
+
return (h(Host, { class: `${this.activeLazyLoadClass} ${this.classString}`, style: this.inlineStyle, content: this.showContent }, this.hasMediaContent && (h("div", { class: "content-image__media-content" }, h("slot", { name: "mediaContent" }))), this.showVideoAsGif ? (h("video", { autoplay: true, muted: true, loop: true, preload: "none", playsinline: true, width: this.width, height: this.height }, h("source", { src: this.lazyLoadIsComplete ? this.pictureImageSrc : null, type: this.videoType }))) : (h("img", { width: this.width, height: this.height, src: this.pictureImageSrc, alt: this.alt }))));
|
|
275
275
|
}
|
|
276
276
|
get hostElement() { return getElement(this); }
|
|
277
277
|
static get watchers() { return {
|
|
@@ -2249,7 +2249,7 @@ aria.replaceDialog = function (newDialogId, newFocusAfterClosed, newFocusFirst)
|
|
|
2249
2249
|
}; // end replaceDialog
|
|
2250
2250
|
window.aria = aria;
|
|
2251
2251
|
|
|
2252
|
-
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
|
|
2252
|
+
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}";
|
|
2253
2253
|
|
|
2254
2254
|
const ContentOverlay = class {
|
|
2255
2255
|
constructor(hostRef) {
|
|
@@ -2259,8 +2259,8 @@ const ContentOverlay = class {
|
|
|
2259
2259
|
this.open = 'false';
|
|
2260
2260
|
this.fullScreen = 'true';
|
|
2261
2261
|
this.classes = undefined;
|
|
2262
|
-
this.
|
|
2263
|
-
this.
|
|
2262
|
+
this.horizontal = 'center';
|
|
2263
|
+
this.vertical = 'center';
|
|
2264
2264
|
this.closeTitle = 'Close Overlay';
|
|
2265
2265
|
this.isActive = false;
|
|
2266
2266
|
this.activeClass = '';
|
|
@@ -2342,8 +2342,8 @@ const ContentOverlay = class {
|
|
|
2342
2342
|
componentWillLoad() {
|
|
2343
2343
|
this.contentElement = this.hostElement.querySelector('.js-content-overlay-content');
|
|
2344
2344
|
WindowResizeService.registerProp(this.classes).subscribe(newValue => (this.classString = `${newValue}`));
|
|
2345
|
-
WindowResizeService.registerProp(this.
|
|
2346
|
-
WindowResizeService.registerProp(this.
|
|
2345
|
+
WindowResizeService.registerProp(this.horizontal).subscribe(newValue => this.hostElement.setAttribute('horizontal', newValue));
|
|
2346
|
+
WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue));
|
|
2347
2347
|
WindowResizeService.registerProp(this.fullScreen).subscribe(newValue => {
|
|
2348
2348
|
if (!this.target)
|
|
2349
2349
|
this.isFullScreen = newValue === 'true';
|
|
@@ -2377,7 +2377,7 @@ const ContentOverlay = class {
|
|
|
2377
2377
|
};
|
|
2378
2378
|
ContentOverlay.style = contentOverlayCss;
|
|
2379
2379
|
|
|
2380
|
-
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
|
|
2380
|
+
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}";
|
|
2381
2381
|
|
|
2382
2382
|
const ContentSpacingWrapper = class {
|
|
2383
2383
|
constructor(hostRef) {
|
|
@@ -2387,7 +2387,8 @@ const ContentSpacingWrapper = class {
|
|
|
2387
2387
|
this.maxWidth = '100';
|
|
2388
2388
|
this.fullHeight = 'false';
|
|
2389
2389
|
this.textAlign = 'default';
|
|
2390
|
-
this.
|
|
2390
|
+
this.horizontal = 'default';
|
|
2391
|
+
this.vertical = 'top';
|
|
2391
2392
|
this.topOffset = '0';
|
|
2392
2393
|
this.bottomOffset = '0';
|
|
2393
2394
|
this.leftOffset = '0';
|
|
@@ -2397,7 +2398,8 @@ const ContentSpacingWrapper = class {
|
|
|
2397
2398
|
componentWillLoad() {
|
|
2398
2399
|
WindowResizeService.registerProp(this.fullHeight).subscribe(newValue => (this.fullHeight = newValue));
|
|
2399
2400
|
WindowResizeService.registerProp(this.textAlign).subscribe(newValue => (this.textAlign = newValue));
|
|
2400
|
-
WindowResizeService.registerProp(this.
|
|
2401
|
+
WindowResizeService.registerProp(this.horizontal).subscribe(newValue => (this.horizontal = newValue));
|
|
2402
|
+
WindowResizeService.registerProp(this.vertical).subscribe(newValue => (this.vertical = newValue));
|
|
2401
2403
|
WindowResizeService.registerProp(this.maxWidth).subscribe(newValue => {
|
|
2402
2404
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { 'max-width': isNaN(newValue) ? newValue : newValue + '%' });
|
|
2403
2405
|
});
|
|
@@ -2421,7 +2423,7 @@ const ContentSpacingWrapper = class {
|
|
|
2421
2423
|
};
|
|
2422
2424
|
ContentSpacingWrapper.style = contentSpacerCss;
|
|
2423
2425
|
|
|
2424
|
-
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
|
|
2426
|
+
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}";
|
|
2425
2427
|
|
|
2426
2428
|
const ContentTextBlock = class {
|
|
2427
2429
|
constructor(hostRef) {
|
|
@@ -2429,7 +2431,7 @@ const ContentTextBlock = class {
|
|
|
2429
2431
|
this.classes = undefined;
|
|
2430
2432
|
this.classString = undefined;
|
|
2431
2433
|
this.minHeight = undefined;
|
|
2432
|
-
this.
|
|
2434
|
+
this.vertical = 'top';
|
|
2433
2435
|
this.fullHeight = 'false';
|
|
2434
2436
|
this.textAlign = 'default';
|
|
2435
2437
|
this.inlineStyle = {};
|
|
@@ -2442,7 +2444,7 @@ const ContentTextBlock = class {
|
|
|
2442
2444
|
this.inlineStyle = Object.assign(Object.assign({}, this.inlineStyle), { 'min-height': isNaN(newValue) ? newValue : newValue + 'px' });
|
|
2443
2445
|
});
|
|
2444
2446
|
WindowResizeService.registerProp(this.textAlign).subscribe(newValue => this.hostElement.setAttribute('text-align', newValue));
|
|
2445
|
-
WindowResizeService.registerProp(this.
|
|
2447
|
+
WindowResizeService.registerProp(this.vertical).subscribe(newValue => this.hostElement.setAttribute('vertical', newValue));
|
|
2446
2448
|
WindowResizeService.registerProp(this.fullHeight).subscribe(newValue => {
|
|
2447
2449
|
this.hostElement.setAttribute('full-height', newValue);
|
|
2448
2450
|
});
|