lookbook 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -7898,8 +7898,8 @@ function $490552754c23ef6f$export$b98882f166bb7ce2(link) {
7898
7898
  }
7899
7899
 
7900
7900
 
7901
- async function $41e83ac737081df5$export$51c59e2af49c1a92(url, selector) {
7902
- const response = await fetch(url || window.document.location);
7901
+ async function $41e83ac737081df5$export$51c59e2af49c1a92(url, selector, options = {}) {
7902
+ const response = await fetch(url || window.document.location, options);
7903
7903
  const html = await response.text();
7904
7904
  const doc = new DOMParser().parseFromString(html, "text/html");
7905
7905
  return {
@@ -7942,7 +7942,11 @@ function $5792afa4170ed552$export$2e2bcd8739ae039() {
7942
7942
  this.debug("Navigating to ", window.location.pathname);
7943
7943
  this.$dispatch("navigation:start");
7944
7944
  this.location = window.location;
7945
- await this.updateDOM();
7945
+ await this.updateDOM("#app-main", {
7946
+ headers: {
7947
+ "X-Lookbook-Frame": "main"
7948
+ }
7949
+ });
7946
7950
  this.$dispatch("navigation:complete");
7947
7951
  },
7948
7952
  hijax (evt) {
@@ -7961,13 +7965,13 @@ function $5792afa4170ed552$export$2e2bcd8739ae039() {
7961
7965
  }
7962
7966
  }
7963
7967
  },
7964
- async updateDOM () {
7968
+ async updateDOM (rootSelector = `#${this.$root.id}`, options = {}) {
7965
7969
  this.debug("Starting DOM update");
7966
7970
  this.$dispatch("dom:update-start");
7967
7971
  this.requestStart();
7968
7972
  try {
7969
- const { fragment: fragment, title: title } = await (0, $41e83ac737081df5$export$51c59e2af49c1a92)(window.location, `#${this.$root.id}`);
7970
- (0, $490552754c23ef6f$export$2e5e8c41f5d4e7c7)(this.$root, fragment);
7973
+ const { fragment: fragment, title: title } = await (0, $41e83ac737081df5$export$51c59e2af49c1a92)(window.location, rootSelector, options);
7974
+ (0, $490552754c23ef6f$export$2e5e8c41f5d4e7c7)(document.querySelector(rootSelector), fragment);
7971
7975
  document.title = title;
7972
7976
  this.requestEnd();
7973
7977
  this.$dispatch("dom:update-complete");
@@ -12531,7 +12535,125 @@ $c9dfaeb25bf110ce$exports = {
12531
12535
  };
12532
12536
 
12533
12537
 
12534
- var $9a68326211e66205$exports = {};
12538
+ var $5d1c9207cb730903$exports = {};
12539
+ var $6a9b69d9cc7f810f$exports = {};
12540
+
12541
+ $parcel$defineInteropFlag($6a9b69d9cc7f810f$exports);
12542
+
12543
+ $parcel$export($6a9b69d9cc7f810f$exports, "default", () => $6a9b69d9cc7f810f$export$2e2bcd8739ae039);
12544
+ var $cdfeaa1e0e8d642c$exports = {};
12545
+ (function(global, factory) {
12546
+ $cdfeaa1e0e8d642c$exports = factory();
12547
+ })($cdfeaa1e0e8d642c$exports, function() {
12548
+ "use strict";
12549
+ /* eslint-disable no-var */ function assign(target) {
12550
+ for(var i = 1; i < arguments.length; i++){
12551
+ var source = arguments[i];
12552
+ for(var key in source)target[key] = source[key];
12553
+ }
12554
+ return target;
12555
+ }
12556
+ /* eslint-enable no-var */ /* eslint-disable no-var */ var defaultConverter = {
12557
+ read: function(value) {
12558
+ if (value[0] === '"') value = value.slice(1, -1);
12559
+ return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
12560
+ },
12561
+ write: function(value) {
12562
+ return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
12563
+ }
12564
+ };
12565
+ /* eslint-enable no-var */ /* eslint-disable no-var */ function init(converter, defaultAttributes) {
12566
+ function set(name, value, attributes) {
12567
+ if (typeof document === "undefined") return;
12568
+ attributes = assign({}, defaultAttributes, attributes);
12569
+ if (typeof attributes.expires === "number") attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
12570
+ if (attributes.expires) attributes.expires = attributes.expires.toUTCString();
12571
+ name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
12572
+ var stringifiedAttributes = "";
12573
+ for(var attributeName in attributes){
12574
+ if (!attributes[attributeName]) continue;
12575
+ stringifiedAttributes += "; " + attributeName;
12576
+ if (attributes[attributeName] === true) continue;
12577
+ // Considers RFC 6265 section 5.2:
12578
+ // ...
12579
+ // 3. If the remaining unparsed-attributes contains a %x3B (";")
12580
+ // character:
12581
+ // Consume the characters of the unparsed-attributes up to,
12582
+ // not including, the first %x3B (";") character.
12583
+ // ...
12584
+ stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
12585
+ }
12586
+ return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
12587
+ }
12588
+ function get(name) {
12589
+ if (typeof document === "undefined" || arguments.length && !name) return;
12590
+ // To prevent the for loop in the first place assign an empty array
12591
+ // in case there are no cookies at all.
12592
+ var cookies = document.cookie ? document.cookie.split("; ") : [];
12593
+ var jar = {};
12594
+ for(var i = 0; i < cookies.length; i++){
12595
+ var parts = cookies[i].split("=");
12596
+ var value = parts.slice(1).join("=");
12597
+ try {
12598
+ var found = decodeURIComponent(parts[0]);
12599
+ jar[found] = converter.read(value, found);
12600
+ if (name === found) break;
12601
+ } catch (e) {}
12602
+ }
12603
+ return name ? jar[name] : jar;
12604
+ }
12605
+ return Object.create({
12606
+ set: set,
12607
+ get: get,
12608
+ remove: function(name, attributes) {
12609
+ set(name, "", assign({}, attributes, {
12610
+ expires: -1
12611
+ }));
12612
+ },
12613
+ withAttributes: function(attributes) {
12614
+ return init(this.converter, assign({}, this.attributes, attributes));
12615
+ },
12616
+ withConverter: function(converter) {
12617
+ return init(assign({}, this.converter, converter), this.attributes);
12618
+ }
12619
+ }, {
12620
+ attributes: {
12621
+ value: Object.freeze(defaultAttributes)
12622
+ },
12623
+ converter: {
12624
+ value: Object.freeze(converter)
12625
+ }
12626
+ });
12627
+ }
12628
+ var api = init(defaultConverter, {
12629
+ path: "/"
12630
+ });
12631
+ /* eslint-enable no-var */ return api;
12632
+ });
12633
+
12634
+
12635
+
12636
+ function $6a9b69d9cc7f810f$export$2e2bcd8739ae039({ name: name, value: value }) {
12637
+ return {
12638
+ name: name,
12639
+ value: value,
12640
+ init () {
12641
+ this.$watch("value", ()=>this.update());
12642
+ },
12643
+ update () {
12644
+ (0, (/*@__PURE__*/$parcel$interopDefault($cdfeaa1e0e8d642c$exports))).set(`lookbook-display-${name}`, this.value);
12645
+ const searchParams = new URLSearchParams(window.location.search);
12646
+ const display = searchParams.get("_display");
12647
+ const displayParams = display ? (0, $fb8f79f7dd40b68f$export$f720fd0ddbeb53d9)(display) : {};
12648
+ displayParams[this.name] = this.value;
12649
+ searchParams.set("_display", (0, $fb8f79f7dd40b68f$export$c788aab010beeaec)(displayParams));
12650
+ const path = location.href.replace(location.search, "");
12651
+ this.navigateTo(`${path}?${searchParams.toString()}`);
12652
+ }
12653
+ };
12654
+ }
12655
+
12656
+
12535
12657
  var $c299e36fa9e271bc$exports = {};
12536
12658
 
12537
12659
  $parcel$defineInteropFlag($c299e36fa9e271bc$exports);
@@ -13424,119 +13546,33 @@ function $c299e36fa9e271bc$export$2e2bcd8739ae039(id, embedStore) {
13424
13546
  }
13425
13547
 
13426
13548
 
13427
- var $6a9b69d9cc7f810f$exports = {};
13549
+ var $1a7a7298eec5b755$exports = {};
13428
13550
 
13429
- $parcel$defineInteropFlag($6a9b69d9cc7f810f$exports);
13551
+ $parcel$defineInteropFlag($1a7a7298eec5b755$exports);
13430
13552
 
13431
- $parcel$export($6a9b69d9cc7f810f$exports, "default", () => $6a9b69d9cc7f810f$export$2e2bcd8739ae039);
13432
- var $cdfeaa1e0e8d642c$exports = {};
13433
- (function(global, factory) {
13434
- $cdfeaa1e0e8d642c$exports = factory();
13435
- })($cdfeaa1e0e8d642c$exports, function() {
13436
- "use strict";
13437
- /* eslint-disable no-var */ function assign(target) {
13438
- for(var i = 1; i < arguments.length; i++){
13439
- var source = arguments[i];
13440
- for(var key in source)target[key] = source[key];
13441
- }
13442
- return target;
13443
- }
13444
- /* eslint-enable no-var */ /* eslint-disable no-var */ var defaultConverter = {
13445
- read: function(value) {
13446
- if (value[0] === '"') value = value.slice(1, -1);
13447
- return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
13448
- },
13449
- write: function(value) {
13450
- return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
13553
+ $parcel$export($1a7a7298eec5b755$exports, "default", () => $1a7a7298eec5b755$export$2e2bcd8739ae039);
13554
+
13555
+ function $1a7a7298eec5b755$export$2e2bcd8739ae039() {
13556
+ return {
13557
+ narrow: false,
13558
+ init () {
13559
+ (0, $7ecd1fc3a6b35e5c$export$a2214cc2adb2dc44)(this.$el, ({ width: width })=>{
13560
+ this.narrow = width < 500;
13561
+ });
13451
13562
  }
13452
13563
  };
13453
- /* eslint-enable no-var */ /* eslint-disable no-var */ function init(converter, defaultAttributes) {
13454
- function set(name, value, attributes) {
13455
- if (typeof document === "undefined") return;
13456
- attributes = assign({}, defaultAttributes, attributes);
13457
- if (typeof attributes.expires === "number") attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
13458
- if (attributes.expires) attributes.expires = attributes.expires.toUTCString();
13459
- name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
13460
- var stringifiedAttributes = "";
13461
- for(var attributeName in attributes){
13462
- if (!attributes[attributeName]) continue;
13463
- stringifiedAttributes += "; " + attributeName;
13464
- if (attributes[attributeName] === true) continue;
13465
- // Considers RFC 6265 section 5.2:
13466
- // ...
13467
- // 3. If the remaining unparsed-attributes contains a %x3B (";")
13468
- // character:
13469
- // Consume the characters of the unparsed-attributes up to,
13470
- // not including, the first %x3B (";") character.
13471
- // ...
13472
- stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
13473
- }
13474
- return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
13475
- }
13476
- function get(name) {
13477
- if (typeof document === "undefined" || arguments.length && !name) return;
13478
- // To prevent the for loop in the first place assign an empty array
13479
- // in case there are no cookies at all.
13480
- var cookies = document.cookie ? document.cookie.split("; ") : [];
13481
- var jar = {};
13482
- for(var i = 0; i < cookies.length; i++){
13483
- var parts = cookies[i].split("=");
13484
- var value = parts.slice(1).join("=");
13485
- try {
13486
- var found = decodeURIComponent(parts[0]);
13487
- jar[found] = converter.read(value, found);
13488
- if (name === found) break;
13489
- } catch (e) {}
13490
- }
13491
- return name ? jar[name] : jar;
13492
- }
13493
- return Object.create({
13494
- set: set,
13495
- get: get,
13496
- remove: function(name, attributes) {
13497
- set(name, "", assign({}, attributes, {
13498
- expires: -1
13499
- }));
13500
- },
13501
- withAttributes: function(attributes) {
13502
- return init(this.converter, assign({}, this.attributes, attributes));
13503
- },
13504
- withConverter: function(converter) {
13505
- return init(assign({}, this.converter, converter), this.attributes);
13506
- }
13507
- }, {
13508
- attributes: {
13509
- value: Object.freeze(defaultAttributes)
13510
- },
13511
- converter: {
13512
- value: Object.freeze(converter)
13513
- }
13514
- });
13515
- }
13516
- var api = init(defaultConverter, {
13517
- path: "/"
13518
- });
13519
- /* eslint-enable no-var */ return api;
13520
- });
13564
+ }
13521
13565
 
13522
13566
 
13567
+ var $e773f8ef556b41ff$exports = {};
13523
13568
 
13524
- function $6a9b69d9cc7f810f$export$2e2bcd8739ae039({ name: name, value: value }) {
13569
+ $parcel$defineInteropFlag($e773f8ef556b41ff$exports);
13570
+
13571
+ $parcel$export($e773f8ef556b41ff$exports, "default", () => $e773f8ef556b41ff$export$2e2bcd8739ae039);
13572
+ function $e773f8ef556b41ff$export$2e2bcd8739ae039() {
13525
13573
  return {
13526
- name: name,
13527
- value: value,
13528
- init () {
13529
- this.$watch("value", ()=>this.update());
13530
- },
13531
- update () {
13532
- (0, (/*@__PURE__*/$parcel$interopDefault($cdfeaa1e0e8d642c$exports))).set(`lookbook-display-${name}`, this.value);
13533
- const searchParams = new URLSearchParams(window.location.search);
13534
- const display = searchParams.get("_display");
13535
- const displayParams = display ? (0, $fb8f79f7dd40b68f$export$f720fd0ddbeb53d9)(display) : {};
13536
- displayParams[this.name] = this.value;
13537
- searchParams.set("_display", (0, $fb8f79f7dd40b68f$export$c788aab010beeaec)(displayParams));
13538
- const path = location.href.replace(location.search, "");
13539
- this.navigateTo(`${path}?${searchParams.toString()}`);
13574
+ get isNarrowLayout () {
13575
+ return this.narrow || false;
13540
13576
  }
13541
13577
  };
13542
13578
  }
@@ -13551,19 +13587,19 @@ function $9b24cbeb3a465447$export$2e2bcd8739ae039({ id: id, matchers: matchers }
13551
13587
  matchers = matchers.map((matcher)=>matcher.replace(/\s/g, "").toLowerCase());
13552
13588
  return {
13553
13589
  filteredOut: false,
13590
+ active: false,
13554
13591
  get open () {
13555
13592
  return this.isCollection && this.isOpen(id);
13556
13593
  },
13557
- get active () {
13558
- if (this.$refs.link) return this.location && this.location.pathname === this.$refs.link.getAttribute("href");
13559
- return false;
13560
- },
13561
13594
  get children () {
13562
13595
  return this.$refs.items ? Array.from(this.$refs.items.children) : [];
13563
13596
  },
13564
13597
  get isCollection () {
13565
13598
  return !this.$refs.link;
13566
13599
  },
13600
+ checkActive () {
13601
+ this.active = this.$refs.link && window.location.pathname === this.$refs.link.getAttribute("href");
13602
+ },
13567
13603
  toggle () {
13568
13604
  this.toggleOpen(id);
13569
13605
  },
@@ -13599,51 +13635,19 @@ function $9b24cbeb3a465447$export$2e2bcd8739ae039({ id: id, matchers: matchers }
13599
13635
  }
13600
13636
 
13601
13637
 
13602
- var $1a7a7298eec5b755$exports = {};
13603
-
13604
- $parcel$defineInteropFlag($1a7a7298eec5b755$exports);
13605
-
13606
- $parcel$export($1a7a7298eec5b755$exports, "default", () => $1a7a7298eec5b755$export$2e2bcd8739ae039);
13607
-
13608
- function $1a7a7298eec5b755$export$2e2bcd8739ae039() {
13609
- return {
13610
- narrow: false,
13611
- init () {
13612
- (0, $7ecd1fc3a6b35e5c$export$a2214cc2adb2dc44)(this.$el, ({ width: width })=>{
13613
- this.narrow = width < 500;
13614
- });
13615
- }
13616
- };
13617
- }
13618
-
13619
-
13620
- var $e773f8ef556b41ff$exports = {};
13621
-
13622
- $parcel$defineInteropFlag($e773f8ef556b41ff$exports);
13623
-
13624
- $parcel$export($e773f8ef556b41ff$exports, "default", () => $e773f8ef556b41ff$export$2e2bcd8739ae039);
13625
- function $e773f8ef556b41ff$export$2e2bcd8739ae039() {
13626
- return {
13627
- get isNarrowLayout () {
13628
- return this.narrow || false;
13629
- }
13630
- };
13631
- }
13632
-
13633
-
13634
- $9a68326211e66205$exports = {
13635
- "embed": {
13636
- "inspector": $c299e36fa9e271bc$exports
13637
- },
13638
+ $5d1c9207cb730903$exports = {
13638
13639
  "display_options": {
13639
13640
  "field": $6a9b69d9cc7f810f$exports
13640
13641
  },
13641
- "nav": {
13642
- "item": $9b24cbeb3a465447$exports
13642
+ "embed": {
13643
+ "inspector": $c299e36fa9e271bc$exports
13643
13644
  },
13644
13645
  "params": {
13645
13646
  "editor": $1a7a7298eec5b755$exports,
13646
13647
  "field": $e773f8ef556b41ff$exports
13648
+ },
13649
+ "nav": {
13650
+ "item": $9b24cbeb3a465447$exports
13647
13651
  }
13648
13652
  };
13649
13653
 
@@ -13712,7 +13716,7 @@ const $22969b543678f572$var$prefix = window.APP_NAME;
13712
13716
  (0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $5792afa4170ed552$export$2e2bcd8739ae039));
13713
13717
  [
13714
13718
  $c9dfaeb25bf110ce$exports,
13715
- $9a68326211e66205$exports,
13719
+ $5d1c9207cb730903$exports,
13716
13720
  $d56e5cced44001d2$exports
13717
13721
  ].forEach((scripts)=>{
13718
13722
  const components = (0, $12b7aa006b8a97e1$export$4e811121b221213b)(scripts);