lookbook 2.3.0 → 2.3.2

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.
@@ -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 $6178ee12f80cbf68$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,124 +13546,6 @@ function $c299e36fa9e271bc$export$2e2bcd8739ae039(id, embedStore) {
13424
13546
  }
13425
13547
 
13426
13548
 
13427
- var $6a9b69d9cc7f810f$exports = {};
13428
-
13429
- $parcel$defineInteropFlag($6a9b69d9cc7f810f$exports);
13430
-
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);
13451
- }
13452
- };
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
- });
13521
-
13522
-
13523
-
13524
- function $6a9b69d9cc7f810f$export$2e2bcd8739ae039({ name: name, value: value }) {
13525
- 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()}`);
13540
- }
13541
- };
13542
- }
13543
-
13544
-
13545
13549
  var $9b24cbeb3a465447$exports = {};
13546
13550
 
13547
13551
  $parcel$defineInteropFlag($9b24cbeb3a465447$exports);
@@ -13551,19 +13555,19 @@ function $9b24cbeb3a465447$export$2e2bcd8739ae039({ id: id, matchers: matchers }
13551
13555
  matchers = matchers.map((matcher)=>matcher.replace(/\s/g, "").toLowerCase());
13552
13556
  return {
13553
13557
  filteredOut: false,
13558
+ active: false,
13554
13559
  get open () {
13555
13560
  return this.isCollection && this.isOpen(id);
13556
13561
  },
13557
- get active () {
13558
- if (this.$refs.link) return this.location && this.location.pathname === this.$refs.link.getAttribute("href");
13559
- return false;
13560
- },
13561
13562
  get children () {
13562
13563
  return this.$refs.items ? Array.from(this.$refs.items.children) : [];
13563
13564
  },
13564
13565
  get isCollection () {
13565
13566
  return !this.$refs.link;
13566
13567
  },
13568
+ checkActive () {
13569
+ this.active = this.$refs.link && window.location.pathname === this.$refs.link.getAttribute("href");
13570
+ },
13567
13571
  toggle () {
13568
13572
  this.toggleOpen(id);
13569
13573
  },
@@ -13631,13 +13635,13 @@ function $e773f8ef556b41ff$export$2e2bcd8739ae039() {
13631
13635
  }
13632
13636
 
13633
13637
 
13634
- $9a68326211e66205$exports = {
13635
- "embed": {
13636
- "inspector": $c299e36fa9e271bc$exports
13637
- },
13638
+ $6178ee12f80cbf68$exports = {
13638
13639
  "display_options": {
13639
13640
  "field": $6a9b69d9cc7f810f$exports
13640
13641
  },
13642
+ "embed": {
13643
+ "inspector": $c299e36fa9e271bc$exports
13644
+ },
13641
13645
  "nav": {
13642
13646
  "item": $9b24cbeb3a465447$exports
13643
13647
  },
@@ -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
+ $6178ee12f80cbf68$exports,
13716
13720
  $d56e5cced44001d2$exports
13717
13721
  ].forEach((scripts)=>{
13718
13722
  const components = (0, $12b7aa006b8a97e1$export$4e811121b221213b)(scripts);