public/lookbook-assets/js/index.js in lookbook-2.0.1 vs public/lookbook-assets/js/index.js in lookbook-2.0.2
- old
+ new
@@ -7813,11 +7813,11 @@
return $1.toUpperCase().replace("-", "").replace("_", "");
});
}
-var $27875b8c7b5f0522$exports = {};
+var $db546f7a367d8ec7$exports = {};
var $cbd28b10fa9798c7$exports = {};
$parcel$defineInteropFlag($cbd28b10fa9798c7$exports);
$parcel$export($cbd28b10fa9798c7$exports, "default", () => $cbd28b10fa9798c7$export$2e2bcd8739ae039);
@@ -11344,10 +11344,20 @@
_spinning: false
};
}
+var $99486586f6691564$exports = {};
+
+$parcel$defineInteropFlag($99486586f6691564$exports);
+
+$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039);
+function $99486586f6691564$export$2e2bcd8739ae039() {
+ return {};
+}
+
+
var $47a1c62621be0c54$exports = {};
$parcel$defineInteropFlag($47a1c62621be0c54$exports);
$parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039);
@@ -11438,36 +11448,11 @@
var $216ef7001f59f21d$exports = {};
$parcel$defineInteropFlag($216ef7001f59f21d$exports);
$parcel$export($216ef7001f59f21d$exports, "default", () => $216ef7001f59f21d$export$2e2bcd8739ae039);
-
function $216ef7001f59f21d$export$2e2bcd8739ae039() {
- let copyTimeout = null;
- return {
- copied: false,
- copyEmbedCode () {
- this.$nextTick(async ()=>{
- const content = (0, $fb8f79f7dd40b68f$export$6cb344a21ca18aec)(this.$refs.copyTarget.innerHTML.trim());
- await window.navigator.clipboard.writeText(content);
- this.copied = true;
- if (copyTimeout) clearTimeout(copyTimeout);
- copyTimeout = setTimeout(()=>{
- this.copied = false;
- }, 2000);
- });
- }
- };
-}
-
-
-var $99486586f6691564$exports = {};
-
-$parcel$defineInteropFlag($99486586f6691564$exports);
-
-$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039);
-function $99486586f6691564$export$2e2bcd8739ae039() {
return {};
}
var $e9904a14dabf652d$exports = {};
@@ -11537,10 +11522,130 @@
}
};
}
+var $a87dacf5139b5e2f$exports = {};
+
+$parcel$defineInteropFlag($a87dacf5139b5e2f$exports);
+
+$parcel$export($a87dacf5139b5e2f$exports, "default", () => $a87dacf5139b5e2f$export$2e2bcd8739ae039);
+function $a87dacf5139b5e2f$export$2e2bcd8739ae039(store) {
+ return {
+ get store () {
+ return store || this;
+ },
+ get id () {
+ return this.$root.id;
+ },
+ get panels () {
+ return Array.from(this.$refs.panels.children);
+ },
+ isActive (el) {
+ return this.store.activeTab === this._getRef(el);
+ },
+ // protected
+ _getRef (el) {
+ return el.getAttribute("x-ref");
+ }
+ };
+}
+
+
+var $0db07828cadc68e0$exports = {};
+
+$parcel$defineInteropFlag($0db07828cadc68e0$exports);
+
+$parcel$export($0db07828cadc68e0$exports, "default", () => $0db07828cadc68e0$export$2e2bcd8739ae039);
+
+
+
+
+function $0db07828cadc68e0$export$2e2bcd8739ae039(store) {
+ const initial = store ? store.activeTab : null;
+ let dropdown = null;
+ return {
+ visibleTabsCount: 0,
+ triggerLeft: 0,
+ get store () {
+ return store || this;
+ },
+ get tabs () {
+ return this.$refs.tabs ? Array.from(this.$refs.tabs.children) : [];
+ },
+ get dropdownTabs () {
+ return Array.from(this.$refs.tabsDropdown ? this.$refs.tabsDropdown.children : []);
+ },
+ get tabWidths () {
+ return this.tabs.map((tab)=>(0, $490552754c23ef6f$export$bdf7e699b242f476)(tab, {
+ includeMargins: true
+ }).width);
+ },
+ init () {
+ this.$nextTick(()=>{
+ if (this.$root.parentElement.offsetWidth === this.$root.offsetWidth) this.visibleTabsCount = this.tabs.length;
+ dropdown = (0, $789b7d27a7c715a6$export$2e2bcd8739ae039)(this.$refs.dropdownTrigger, {
+ content: this.$refs.tabsDropdown,
+ theme: "menu",
+ interactive: true,
+ trigger: "click",
+ placement: "bottom",
+ appendTo: this.$root
+ });
+ const initialTab = initial ? this.tabs.find((t)=>this._getRef(t) === initial) : this.tabs[0];
+ this.selectTab(initialTab || this.tabs[0], true);
+ this.parentObserver = (0, $7ecd1fc3a6b35e5c$export$a2214cc2adb2dc44)(this.$root.parentElement, (0, $c5d017602d25d050$export$61fc7d43ac8f84b0)(10, this.handleResize.bind(this)));
+ this.$watch("visibleTabsCount", (value)=>{
+ this.debug(`'#${this.$root.id}' visible tabs count:`, value);
+ });
+ });
+ },
+ handleResize ({ width: width }) {
+ if (width === this._lastMeasuredWidth) return;
+ if (width === this.$root.offsetWidth) {
+ this.visibleTabsCount = this.tabs.length;
+ return;
+ }
+ let sumTabWidths = 60;
+ let triggerLeft = 20;
+ let visibleTabsCount = 0;
+ this.tabWidths.forEach((tabWidth)=>{
+ sumTabWidths += tabWidth;
+ if (sumTabWidths < width) {
+ triggerLeft += tabWidth;
+ visibleTabsCount++;
+ }
+ });
+ this.visibleTabsCount = visibleTabsCount;
+ this.triggerLeft = triggerLeft;
+ this._lastMeasuredWidth = width;
+ },
+ selectTab (el, initial = false) {
+ this.store.activeTab = this._getRef(el);
+ dropdown.hide();
+ if (!initial) this.$dispatch("tabs:change", {
+ tabs: this
+ });
+ },
+ isSelected (el) {
+ return this.store.activeTab === this._getRef(el);
+ },
+ isDisabled (el) {
+ return el.getAttribute("data-disabled") == "true";
+ },
+ hasHiddenTabs () {
+ return this.visibleTabsCount < this.tabs.length;
+ },
+ // protected
+ _lastMeasuredWidth: 0,
+ _getRef (el) {
+ return el ? el.getAttribute("x-ref").replace("dropdown-", "") : null;
+ }
+ };
+}
+
+
var $506dabb2bf255b38$exports = {};
$parcel$defineInteropFlag($506dabb2bf255b38$exports);
$parcel$export($506dabb2bf255b38$exports, "default", () => $506dabb2bf255b38$export$2e2bcd8739ae039);
@@ -12087,130 +12192,10 @@
});
return splits;
}
-var $a87dacf5139b5e2f$exports = {};
-
-$parcel$defineInteropFlag($a87dacf5139b5e2f$exports);
-
-$parcel$export($a87dacf5139b5e2f$exports, "default", () => $a87dacf5139b5e2f$export$2e2bcd8739ae039);
-function $a87dacf5139b5e2f$export$2e2bcd8739ae039(store) {
- return {
- get store () {
- return store || this;
- },
- get id () {
- return this.$root.id;
- },
- get panels () {
- return Array.from(this.$refs.panels.children);
- },
- isActive (el) {
- return this.store.activeTab === this._getRef(el);
- },
- // protected
- _getRef (el) {
- return el.getAttribute("x-ref");
- }
- };
-}
-
-
-var $0db07828cadc68e0$exports = {};
-
-$parcel$defineInteropFlag($0db07828cadc68e0$exports);
-
-$parcel$export($0db07828cadc68e0$exports, "default", () => $0db07828cadc68e0$export$2e2bcd8739ae039);
-
-
-
-
-function $0db07828cadc68e0$export$2e2bcd8739ae039(store) {
- const initial = store ? store.activeTab : null;
- let dropdown = null;
- return {
- visibleTabsCount: 0,
- triggerLeft: 0,
- get store () {
- return store || this;
- },
- get tabs () {
- return this.$refs.tabs ? Array.from(this.$refs.tabs.children) : [];
- },
- get dropdownTabs () {
- return Array.from(this.$refs.tabsDropdown ? this.$refs.tabsDropdown.children : []);
- },
- get tabWidths () {
- return this.tabs.map((tab)=>(0, $490552754c23ef6f$export$bdf7e699b242f476)(tab, {
- includeMargins: true
- }).width);
- },
- init () {
- this.$nextTick(()=>{
- if (this.$root.parentElement.offsetWidth === this.$root.offsetWidth) this.visibleTabsCount = this.tabs.length;
- dropdown = (0, $789b7d27a7c715a6$export$2e2bcd8739ae039)(this.$refs.dropdownTrigger, {
- content: this.$refs.tabsDropdown,
- theme: "menu",
- interactive: true,
- trigger: "click",
- placement: "bottom",
- appendTo: this.$root
- });
- const initialTab = initial ? this.tabs.find((t)=>this._getRef(t) === initial) : this.tabs[0];
- this.selectTab(initialTab || this.tabs[0], true);
- this.parentObserver = (0, $7ecd1fc3a6b35e5c$export$a2214cc2adb2dc44)(this.$root.parentElement, (0, $c5d017602d25d050$export$61fc7d43ac8f84b0)(10, this.handleResize.bind(this)));
- this.$watch("visibleTabsCount", (value)=>{
- this.debug(`'#${this.$root.id}' visible tabs count:`, value);
- });
- });
- },
- handleResize ({ width: width }) {
- if (width === this._lastMeasuredWidth) return;
- if (width === this.$root.offsetWidth) {
- this.visibleTabsCount = this.tabs.length;
- return;
- }
- let sumTabWidths = 60;
- let triggerLeft = 20;
- let visibleTabsCount = 0;
- this.tabWidths.forEach((tabWidth)=>{
- sumTabWidths += tabWidth;
- if (sumTabWidths < width) {
- triggerLeft += tabWidth;
- visibleTabsCount++;
- }
- });
- this.visibleTabsCount = visibleTabsCount;
- this.triggerLeft = triggerLeft;
- this._lastMeasuredWidth = width;
- },
- selectTab (el, initial = false) {
- this.store.activeTab = this._getRef(el);
- dropdown.hide();
- if (!initial) this.$dispatch("tabs:change", {
- tabs: this
- });
- },
- isSelected (el) {
- return this.store.activeTab === this._getRef(el);
- },
- isDisabled (el) {
- return el.getAttribute("data-disabled") == "true";
- },
- hasHiddenTabs () {
- return this.visibleTabsCount < this.tabs.length;
- },
- // protected
- _lastMeasuredWidth: 0,
- _getRef (el) {
- return el ? el.getAttribute("x-ref").replace("dropdown-", "") : null;
- }
- };
-}
-
-
var $6d64716f0b34fdf4$exports = {};
$parcel$defineInteropFlag($6d64716f0b34fdf4$exports);
$parcel$export($6d64716f0b34fdf4$exports, "default", () => $6d64716f0b34fdf4$export$2e2bcd8739ae039);
@@ -12334,26 +12319,26 @@
}
};
}
-$27875b8c7b5f0522$exports = {
+$db546f7a367d8ec7$exports = {
"button": $cbd28b10fa9798c7$exports,
+ "code": $99486586f6691564$exports,
"copy_button": $47a1c62621be0c54$exports,
"dimensions_display": $e398acaded942bbe$exports,
"embed_code_dropdown": $216ef7001f59f21d$exports,
- "code": $99486586f6691564$exports,
"filter": $e9904a14dabf652d$exports,
"nav": $d92d9d5253f84566$exports,
- "split_layout": $506dabb2bf255b38$exports,
"tab_panels": $a87dacf5139b5e2f$exports,
"tabs": $0db07828cadc68e0$exports,
+ "split_layout": $506dabb2bf255b38$exports,
"viewport": $6d64716f0b34fdf4$exports
};
-var $f3e1e32f4a1bd6da$exports = {};
+var $234342a379d83f20$exports = {};
var $6a9b69d9cc7f810f$exports = {};
$parcel$defineInteropFlag($6a9b69d9cc7f810f$exports);
$parcel$export($6a9b69d9cc7f810f$exports, "default", () => $6a9b69d9cc7f810f$export$2e2bcd8739ae039);
@@ -13341,19 +13326,61 @@
},
switchTarget (newTargetPath) {
this.navigateTo(`${newTargetPath}${window.location.search}`);
},
onResized ({ height: height }) {
- if (height) this.viewportHeight = height;
+ if (height) {
+ this.viewportHeight = height;
+ // Notify parent window of height resize so the parent window can implement
+ // its own iframe resize strategy if not using the Lookbook JS script.
+ // Uses Embedly-compatible postMessage format: https://docs.embed.ly/reference/provider-height-resizing
+ window.parent.postMessage(JSON.stringify({
+ src: window.location.toString(),
+ context: "iframe.resize",
+ height: height
+ }), "*");
+ }
},
resizeIframe () {
this.iframe.iFrameResizer.resize();
}
};
}
+var $1a7a7298eec5b755$exports = {};
+
+$parcel$defineInteropFlag($1a7a7298eec5b755$exports);
+
+$parcel$export($1a7a7298eec5b755$exports, "default", () => $1a7a7298eec5b755$export$2e2bcd8739ae039);
+
+function $1a7a7298eec5b755$export$2e2bcd8739ae039() {
+ return {
+ narrow: false,
+ init () {
+ (0, $7ecd1fc3a6b35e5c$export$a2214cc2adb2dc44)(this.$el, ({ width: width })=>{
+ this.narrow = width < 500;
+ });
+ }
+ };
+}
+
+
+var $e773f8ef556b41ff$exports = {};
+
+$parcel$defineInteropFlag($e773f8ef556b41ff$exports);
+
+$parcel$export($e773f8ef556b41ff$exports, "default", () => $e773f8ef556b41ff$export$2e2bcd8739ae039);
+function $e773f8ef556b41ff$export$2e2bcd8739ae039() {
+ return {
+ get isNarrowLayout () {
+ return this.narrow || false;
+ }
+ };
+}
+
+
var $9b24cbeb3a465447$exports = {};
$parcel$defineInteropFlag($9b24cbeb3a465447$exports);
$parcel$export($9b24cbeb3a465447$exports, "default", () => $9b24cbeb3a465447$export$2e2bcd8739ae039);
@@ -13407,55 +13434,23 @@
}
};
}
-var $1a7a7298eec5b755$exports = {};
-
-$parcel$defineInteropFlag($1a7a7298eec5b755$exports);
-
-$parcel$export($1a7a7298eec5b755$exports, "default", () => $1a7a7298eec5b755$export$2e2bcd8739ae039);
-
-function $1a7a7298eec5b755$export$2e2bcd8739ae039() {
- return {
- narrow: false,
- init () {
- (0, $7ecd1fc3a6b35e5c$export$a2214cc2adb2dc44)(this.$el, ({ width: width })=>{
- this.narrow = width < 500;
- });
- }
- };
-}
-
-
-var $e773f8ef556b41ff$exports = {};
-
-$parcel$defineInteropFlag($e773f8ef556b41ff$exports);
-
-$parcel$export($e773f8ef556b41ff$exports, "default", () => $e773f8ef556b41ff$export$2e2bcd8739ae039);
-function $e773f8ef556b41ff$export$2e2bcd8739ae039() {
- return {
- get isNarrowLayout () {
- return this.narrow || false;
- }
- };
-}
-
-
-$f3e1e32f4a1bd6da$exports = {
+$234342a379d83f20$exports = {
"display_options": {
"field": $6a9b69d9cc7f810f$exports
},
"embed": {
"inspector": $c299e36fa9e271bc$exports
},
- "nav": {
- "item": $9b24cbeb3a465447$exports
- },
"params": {
"editor": $1a7a7298eec5b755$exports,
"field": $e773f8ef556b41ff$exports
+ },
+ "nav": {
+ "item": $9b24cbeb3a465447$exports
}
};
var $338da9a25bc5c332$exports = {};
@@ -13519,11 +13514,11 @@
prefix: $22969b543678f572$var$prefix
}));
// Components
(0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $5792afa4170ed552$export$2e2bcd8739ae039));
[
- $27875b8c7b5f0522$exports,
- $f3e1e32f4a1bd6da$exports,
+ $db546f7a367d8ec7$exports,
+ $234342a379d83f20$exports,
$338da9a25bc5c332$exports
].forEach((scripts)=>{
const components = (0, $12b7aa006b8a97e1$export$4e811121b221213b)(scripts);
Object.keys(components).forEach((name)=>{
(0, $caa9439642c6336c$export$2e2bcd8739ae039).data(`${name}Component`, components[name]);