lookbook 1.5.1 → 1.5.3
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.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/app/controllers/concerns/lookbook/targetable_concern.rb +3 -2
- data/app/controllers/lookbook/previews_controller.rb +22 -4
- data/app/views/layouts/lookbook/application.html.erb +1 -1
- data/app/views/lookbook/preview.html.erb +1 -1
- data/lib/lookbook/engine.rb +10 -0
- data/lib/lookbook/entities/preview_example.rb +4 -0
- data/lib/lookbook/entities/preview_group.rb +4 -0
- data/lib/lookbook/version.rb +1 -1
- data/public/lookbook-assets/css/lookbook.css +357 -355
- data/public/lookbook-assets/css/lookbook.css.map +1 -1
- data/public/lookbook-assets/js/embed.js +32 -31
- data/public/lookbook-assets/js/embed.js.map +1 -1
- data/public/lookbook-assets/js/lookbook.js +85 -84
- data/public/lookbook-assets/js/lookbook.js.map +1 -1
- metadata +3 -3
@@ -7820,7 +7820,7 @@ function $5439cede634b2921$var$toCamel(s) {
|
|
7820
7820
|
}
|
7821
7821
|
|
7822
7822
|
|
7823
|
-
var $
|
7823
|
+
var $1f889267678ff167$exports = {};
|
7824
7824
|
var $cbd28b10fa9798c7$exports = {};
|
7825
7825
|
|
7826
7826
|
$parcel$defineInteropFlag($cbd28b10fa9798c7$exports);
|
@@ -11409,6 +11409,39 @@ function $47a1c62621be0c54$export$2e2bcd8739ae039() {
|
|
11409
11409
|
}
|
11410
11410
|
|
11411
11411
|
|
11412
|
+
var $e398acaded942bbe$exports = {};
|
11413
|
+
|
11414
|
+
$parcel$defineInteropFlag($e398acaded942bbe$exports);
|
11415
|
+
|
11416
|
+
$parcel$export($e398acaded942bbe$exports, "default", () => $e398acaded942bbe$export$2e2bcd8739ae039);
|
11417
|
+
|
11418
|
+
function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
11419
|
+
return {
|
11420
|
+
width: 0,
|
11421
|
+
height: 0,
|
11422
|
+
resizing: false,
|
11423
|
+
target: null,
|
11424
|
+
init () {
|
11425
|
+
this.target = document.querySelector(targetSelector);
|
11426
|
+
if (this.target) {
|
11427
|
+
this.width = Math.round(this.target.clientWidth);
|
11428
|
+
this.height = Math.round(this.target.clientHeight);
|
11429
|
+
this.createObserver();
|
11430
|
+
}
|
11431
|
+
},
|
11432
|
+
createObserver () {
|
11433
|
+
if (this.target) this.observer = (0, $9930d46698775b42$export$a2214cc2adb2dc44)(document.querySelector(targetSelector), ({ width: width , height: height })=>{
|
11434
|
+
this.width = width;
|
11435
|
+
this.height = height;
|
11436
|
+
});
|
11437
|
+
},
|
11438
|
+
tearDown () {
|
11439
|
+
if (this.observer) this.observer.disconnect();
|
11440
|
+
}
|
11441
|
+
};
|
11442
|
+
}
|
11443
|
+
|
11444
|
+
|
11412
11445
|
var $e1f51f020443edd4$exports = {};
|
11413
11446
|
|
11414
11447
|
$parcel$defineInteropFlag($e1f51f020443edd4$exports);
|
@@ -11490,11 +11523,11 @@ var $ef5e88eaa61efd95$exports = {};
|
|
11490
11523
|
var x;
|
11491
11524
|
// Remove vendor prefixing if prefixed and break early if not
|
11492
11525
|
for(x = 0; x < vendors.length && !requestAnimationFrame; x += 1)requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"];
|
11493
|
-
if (
|
11494
|
-
else // Firefox extension content-scripts have a globalThis object that is not the same as window.
|
11526
|
+
if (requestAnimationFrame) // Firefox extension content-scripts have a globalThis object that is not the same as window.
|
11495
11527
|
// Binding `requestAnimationFrame` to window allows the function to work and prevents errors
|
11496
11528
|
// being thrown when run in that context, and should be a no-op in every other context.
|
11497
11529
|
requestAnimationFrame = requestAnimationFrame.bind(window);
|
11530
|
+
else log("setup", "RequestAnimationFrame not supported");
|
11498
11531
|
}
|
11499
11532
|
function getMyID(iframeId) {
|
11500
11533
|
var retStr = "Host page: " + iframeId;
|
@@ -11532,7 +11565,7 @@ var $ef5e88eaa61efd95$exports = {};
|
|
11532
11565
|
syncResize(resize, messageData, "init");
|
11533
11566
|
}
|
11534
11567
|
function processMsg() {
|
11535
|
-
var data = msg.
|
11568
|
+
var data = msg.slice(msgIdLen).split(":");
|
11536
11569
|
var height = data[1] ? parseInt(data[1], 10) : 0;
|
11537
11570
|
var iframe = settings[data[0]] && settings[data[0]].iframe;
|
11538
11571
|
var compStyle = getComputedStyle(iframe);
|
@@ -11592,12 +11625,12 @@ var $ef5e88eaa61efd95$exports = {};
|
|
11592
11625
|
return true;
|
11593
11626
|
}
|
11594
11627
|
function isMessageForUs() {
|
11595
|
-
return msgId === ("" + msg).
|
11628
|
+
return msgId === ("" + msg).slice(0, msgIdLen) && msg.slice(msgIdLen).split(":")[0] in settings // ''+Protects against non-string msg
|
11596
11629
|
;
|
11597
11630
|
}
|
11598
11631
|
function isMessageFromMetaParent() {
|
11599
11632
|
// Test if this message is from a parent above us. This is an ugly test, however, updating
|
11600
|
-
// the message format would break backwards
|
11633
|
+
// the message format would break backwards compatibility.
|
11601
11634
|
var retCode = messageData.type in {
|
11602
11635
|
true: 1,
|
11603
11636
|
false: 1,
|
@@ -11607,7 +11640,7 @@ var $ef5e88eaa61efd95$exports = {};
|
|
11607
11640
|
return retCode;
|
11608
11641
|
}
|
11609
11642
|
function getMsgBody(offset) {
|
11610
|
-
return msg.
|
11643
|
+
return msg.slice(msg.indexOf(":") + msgHeaderLen + offset);
|
11611
11644
|
}
|
11612
11645
|
function forwardMsgFromIFrame(msgBody) {
|
11613
11646
|
log(iframeId, "onMessage passed: {iframe: " + messageData.iframe.id + ", message: " + msgBody + "}");
|
@@ -11709,12 +11742,12 @@ var $ef5e88eaa61efd95$exports = {};
|
|
11709
11742
|
y: 0
|
11710
11743
|
}, newPosition = calcOffset();
|
11711
11744
|
log(iframeId, "Reposition requested from iFrame (offset x:" + offset.x + " y:" + offset.y + ")");
|
11712
|
-
if (window.top
|
11713
|
-
else
|
11745
|
+
if (window.top === window.self) reposition();
|
11746
|
+
else scrollParent();
|
11714
11747
|
}
|
11715
11748
|
function scrollTo() {
|
11716
|
-
if (false
|
11717
|
-
else
|
11749
|
+
if (false === on("onScroll", pagePosition)) unsetPagePosition();
|
11750
|
+
else setPagePosition(iframeId);
|
11718
11751
|
}
|
11719
11752
|
function findTarget(location) {
|
11720
11753
|
function jumpToTarget() {
|
@@ -11733,8 +11766,8 @@ var $ef5e88eaa61efd95$exports = {};
|
|
11733
11766
|
}
|
11734
11767
|
var hash = location.split("#")[1] || "", hashData = decodeURIComponent(hash), target = document.getElementById(hashData) || document.getElementsByName(hashData)[0];
|
11735
11768
|
if (target) jumpToTarget();
|
11736
|
-
else if (window.top
|
11737
|
-
else
|
11769
|
+
else if (window.top === window.self) log(iframeId, "In page link #" + hash + " not found");
|
11770
|
+
else jumpToParent();
|
11738
11771
|
}
|
11739
11772
|
function onMouse(event) {
|
11740
11773
|
var mousePos = {};
|
@@ -11864,8 +11897,8 @@ var $ef5e88eaa61efd95$exports = {};
|
|
11864
11897
|
function getPagePosition(iframeId) {
|
11865
11898
|
if (null === pagePosition) {
|
11866
11899
|
pagePosition = {
|
11867
|
-
x: window.pageXOffset
|
11868
|
-
y: window.pageYOffset
|
11900
|
+
x: window.pageXOffset === undefined ? document.documentElement.scrollLeft : window.pageXOffset,
|
11901
|
+
y: window.pageYOffset === undefined ? document.documentElement.scrollTop : window.pageYOffset
|
11869
11902
|
};
|
11870
11903
|
log(iframeId, "Get page position: " + pagePosition.x + "," + pagePosition.y);
|
11871
11904
|
}
|
@@ -12110,14 +12143,15 @@ var $ef5e88eaa61efd95$exports = {};
|
|
12110
12143
|
return iframeId in settings && "iFrameResizer" in iframe;
|
12111
12144
|
}
|
12112
12145
|
var iframeId = ensureHasId(iframe.id);
|
12113
|
-
if (
|
12146
|
+
if (beenHere()) warn(iframeId, "Ignored iFrame, already setup.");
|
12147
|
+
else {
|
12114
12148
|
processOptions(options);
|
12115
12149
|
setScrolling();
|
12116
12150
|
setLimits();
|
12117
12151
|
setupBodyMarginValues();
|
12118
12152
|
init(createOutgoingMsg(iframeId));
|
12119
12153
|
setupIFrameObject();
|
12120
|
-
}
|
12154
|
+
}
|
12121
12155
|
}
|
12122
12156
|
function debouce(fn, time) {
|
12123
12157
|
if (null === timer) timer = setTimeout(function() {
|
@@ -12176,10 +12210,10 @@ var $ef5e88eaa61efd95$exports = {};
|
|
12176
12210
|
// Not testable in PhantomJS
|
12177
12211
|
/* istanbul ignore next */ function tabVisible() {
|
12178
12212
|
function resize() {
|
12179
|
-
sendTriggerMsg("Tab
|
12213
|
+
sendTriggerMsg("Tab Visible", "resize");
|
12180
12214
|
}
|
12181
12215
|
if ("hidden" !== document.visibilityState) {
|
12182
|
-
log("document", "Trigger event:
|
12216
|
+
log("document", "Trigger event: Visibility change");
|
12183
12217
|
debouce(resize, 16);
|
12184
12218
|
}
|
12185
12219
|
}
|
@@ -12244,7 +12278,7 @@ var $ef5e88eaa61efd95$exports = {};
|
|
12244
12278
|
return this.filter("iframe").each(init).end();
|
12245
12279
|
};
|
12246
12280
|
}
|
12247
|
-
if (window.jQuery) createJQueryPublicMethod(window.jQuery);
|
12281
|
+
if (window.jQuery !== undefined) createJQueryPublicMethod(window.jQuery);
|
12248
12282
|
if (typeof define === "function" && define.amd) define([], factory);
|
12249
12283
|
else if (typeof $ef5e88eaa61efd95$exports === "object") // Node for browserfy
|
12250
12284
|
$ef5e88eaa61efd95$exports = factory();
|
@@ -12283,39 +12317,6 @@ function $e1f51f020443edd4$export$2e2bcd8739ae039(id, embedStore) {
|
|
12283
12317
|
}
|
12284
12318
|
|
12285
12319
|
|
12286
|
-
var $e398acaded942bbe$exports = {};
|
12287
|
-
|
12288
|
-
$parcel$defineInteropFlag($e398acaded942bbe$exports);
|
12289
|
-
|
12290
|
-
$parcel$export($e398acaded942bbe$exports, "default", () => $e398acaded942bbe$export$2e2bcd8739ae039);
|
12291
|
-
|
12292
|
-
function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
12293
|
-
return {
|
12294
|
-
width: 0,
|
12295
|
-
height: 0,
|
12296
|
-
resizing: false,
|
12297
|
-
target: null,
|
12298
|
-
init () {
|
12299
|
-
this.target = document.querySelector(targetSelector);
|
12300
|
-
if (this.target) {
|
12301
|
-
this.width = Math.round(this.target.clientWidth);
|
12302
|
-
this.height = Math.round(this.target.clientHeight);
|
12303
|
-
this.createObserver();
|
12304
|
-
}
|
12305
|
-
},
|
12306
|
-
createObserver () {
|
12307
|
-
if (this.target) this.observer = (0, $9930d46698775b42$export$a2214cc2adb2dc44)(document.querySelector(targetSelector), ({ width: width , height: height })=>{
|
12308
|
-
this.width = width;
|
12309
|
-
this.height = height;
|
12310
|
-
});
|
12311
|
-
},
|
12312
|
-
tearDown () {
|
12313
|
-
if (this.observer) this.observer.disconnect();
|
12314
|
-
}
|
12315
|
-
};
|
12316
|
-
}
|
12317
|
-
|
12318
|
-
|
12319
12320
|
var $e9904a14dabf652d$exports = {};
|
12320
12321
|
|
12321
12322
|
$parcel$defineInteropFlag($e9904a14dabf652d$exports);
|
@@ -12397,33 +12398,6 @@ function $d92d9d5253f84566$export$2e2bcd8739ae039(store) {
|
|
12397
12398
|
}
|
12398
12399
|
|
12399
12400
|
|
12400
|
-
var $a87dacf5139b5e2f$exports = {};
|
12401
|
-
|
12402
|
-
$parcel$defineInteropFlag($a87dacf5139b5e2f$exports);
|
12403
|
-
|
12404
|
-
$parcel$export($a87dacf5139b5e2f$exports, "default", () => $a87dacf5139b5e2f$export$2e2bcd8739ae039);
|
12405
|
-
function $a87dacf5139b5e2f$export$2e2bcd8739ae039(store) {
|
12406
|
-
return {
|
12407
|
-
get store () {
|
12408
|
-
return store || this;
|
12409
|
-
},
|
12410
|
-
get id () {
|
12411
|
-
return this.$root.id;
|
12412
|
-
},
|
12413
|
-
get panels () {
|
12414
|
-
return Array.from(this.$refs.panels.children);
|
12415
|
-
},
|
12416
|
-
isActive (el) {
|
12417
|
-
return this.store.activeTab === this._getRef(el);
|
12418
|
-
},
|
12419
|
-
// protected
|
12420
|
-
_getRef (el) {
|
12421
|
-
return el.getAttribute("x-ref");
|
12422
|
-
}
|
12423
|
-
};
|
12424
|
-
}
|
12425
|
-
|
12426
|
-
|
12427
12401
|
var $506dabb2bf255b38$exports = {};
|
12428
12402
|
|
12429
12403
|
$parcel$defineInteropFlag($506dabb2bf255b38$exports);
|
@@ -12974,6 +12948,33 @@ function $506dabb2bf255b38$var$sizeSplits(sizes) {
|
|
12974
12948
|
}
|
12975
12949
|
|
12976
12950
|
|
12951
|
+
var $a87dacf5139b5e2f$exports = {};
|
12952
|
+
|
12953
|
+
$parcel$defineInteropFlag($a87dacf5139b5e2f$exports);
|
12954
|
+
|
12955
|
+
$parcel$export($a87dacf5139b5e2f$exports, "default", () => $a87dacf5139b5e2f$export$2e2bcd8739ae039);
|
12956
|
+
function $a87dacf5139b5e2f$export$2e2bcd8739ae039(store) {
|
12957
|
+
return {
|
12958
|
+
get store () {
|
12959
|
+
return store || this;
|
12960
|
+
},
|
12961
|
+
get id () {
|
12962
|
+
return this.$root.id;
|
12963
|
+
},
|
12964
|
+
get panels () {
|
12965
|
+
return Array.from(this.$refs.panels.children);
|
12966
|
+
},
|
12967
|
+
isActive (el) {
|
12968
|
+
return this.store.activeTab === this._getRef(el);
|
12969
|
+
},
|
12970
|
+
// protected
|
12971
|
+
_getRef (el) {
|
12972
|
+
return el.getAttribute("x-ref");
|
12973
|
+
}
|
12974
|
+
};
|
12975
|
+
}
|
12976
|
+
|
12977
|
+
|
12977
12978
|
var $0db07828cadc68e0$exports = {};
|
12978
12979
|
|
12979
12980
|
$parcel$defineInteropFlag($0db07828cadc68e0$exports);
|
@@ -13194,17 +13195,17 @@ function $6d64716f0b34fdf4$export$2e2bcd8739ae039(store) {
|
|
13194
13195
|
}
|
13195
13196
|
|
13196
13197
|
|
13197
|
-
$
|
13198
|
+
$1f889267678ff167$exports = {
|
13198
13199
|
"button": $cbd28b10fa9798c7$exports,
|
13199
13200
|
"code": $99486586f6691564$exports,
|
13200
13201
|
"copy_button": $47a1c62621be0c54$exports,
|
13201
|
-
"embed": $e1f51f020443edd4$exports,
|
13202
13202
|
"dimensions_display": $e398acaded942bbe$exports,
|
13203
|
+
"embed": $e1f51f020443edd4$exports,
|
13203
13204
|
"filter": $e9904a14dabf652d$exports,
|
13204
13205
|
"icon": $36506012e0c6e9e3$exports,
|
13205
13206
|
"nav": $d92d9d5253f84566$exports,
|
13206
|
-
"tab_panels": $a87dacf5139b5e2f$exports,
|
13207
13207
|
"split_layout": $506dabb2bf255b38$exports,
|
13208
|
+
"tab_panels": $a87dacf5139b5e2f$exports,
|
13208
13209
|
"tabs": $0db07828cadc68e0$exports,
|
13209
13210
|
"viewport": $6d64716f0b34fdf4$exports
|
13210
13211
|
};
|
@@ -13495,7 +13496,7 @@ const $d73574cc5e9b9e72$var$prefix = window.APP_NAME;
|
|
13495
13496
|
// Components
|
13496
13497
|
(0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $d709d0f4027033b2$export$2e2bcd8739ae039));
|
13497
13498
|
[
|
13498
|
-
$
|
13499
|
+
$1f889267678ff167$exports,
|
13499
13500
|
$fe98e3f2bf49b28f$exports,
|
13500
13501
|
$6c10158820e535ef$exports
|
13501
13502
|
].forEach((scripts)=>{
|