lookbook 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +81 -0
  3. data/app/assets/lookbook/css/app.css +28 -0
  4. data/app/assets/lookbook/js/app.js +49 -24
  5. data/app/assets/lookbook/js/nav/leaf.js +20 -0
  6. data/app/assets/lookbook/js/nav/node.js +31 -0
  7. data/app/assets/lookbook/js/nav.js +39 -0
  8. data/app/assets/lookbook/js/page.js +33 -0
  9. data/app/assets/lookbook/js/utils/clipboard.js +13 -0
  10. data/app/assets/lookbook/js/utils/morph.js +16 -0
  11. data/app/assets/lookbook/js/{reloader.js → utils/reloader.js} +0 -0
  12. data/app/assets/lookbook/js/utils/screen.js +44 -0
  13. data/app/assets/lookbook/js/{size_observer.js → utils/size_observer.js} +1 -1
  14. data/app/assets/lookbook/js/{split.js → utils/split.js} +4 -4
  15. data/app/assets/lookbook/js/workbench/inspector.js +11 -0
  16. data/app/assets/lookbook/js/workbench/preview.js +39 -0
  17. data/app/assets/lookbook/js/workbench.js +14 -0
  18. data/app/controllers/lookbook/{browser_controller.rb → app_controller.rb} +58 -31
  19. data/app/helpers/lookbook/application_helper.rb +1 -1
  20. data/app/views/lookbook/_sidebar.html.erb +45 -0
  21. data/app/views/lookbook/_workbench.html.erb +12 -0
  22. data/app/views/lookbook/{browser → app}/error.html.erb +0 -0
  23. data/app/views/lookbook/app/index.html.erb +11 -0
  24. data/app/views/lookbook/{browser → app}/not_found.html.erb +1 -1
  25. data/app/views/lookbook/app/show.html.erb +1 -0
  26. data/app/views/lookbook/layouts/app.html.erb +16 -26
  27. data/app/views/lookbook/nav/_collection.html.erb +5 -0
  28. data/app/views/lookbook/nav/_leaf.html.erb +22 -0
  29. data/app/views/lookbook/nav/_node.html.erb +19 -0
  30. data/app/views/lookbook/nav/_preview.html.erb +11 -0
  31. data/app/views/lookbook/preview_group.html.erb +8 -0
  32. data/app/views/lookbook/shared/_clipboard.html.erb +11 -0
  33. data/app/views/lookbook/shared/_header.html.erb +8 -0
  34. data/app/views/lookbook/workbench/_header.html.erb +39 -0
  35. data/app/views/lookbook/workbench/_inspector.html.erb +32 -0
  36. data/app/views/lookbook/workbench/_preview.html.erb +24 -0
  37. data/app/views/lookbook/workbench/inspector/_code.html.erb +3 -0
  38. data/app/views/lookbook/workbench/inspector/_notes.html.erb +24 -0
  39. data/app/views/lookbook/{partials → workbench}/inspector/_plain.html.erb +0 -0
  40. data/config/routes.rb +3 -3
  41. data/lib/lookbook/preview.rb +26 -3
  42. data/lib/lookbook/preview_controller.rb +6 -1
  43. data/lib/lookbook/preview_example.rb +3 -2
  44. data/lib/lookbook/preview_group.rb +37 -0
  45. data/lib/lookbook/taggable.rb +5 -1
  46. data/lib/lookbook/version.rb +1 -1
  47. data/lib/lookbook.rb +1 -0
  48. data/lib/tasks/lookbook_tasks.rake +1 -1
  49. data/public/lookbook-assets/app.css +229 -99
  50. data/public/lookbook-assets/app.js +882 -56
  51. data/{app/views/lookbook/partials/_icon_sprite.html.erb → public/lookbook-assets/feather-sprite.svg} +1 -1
  52. metadata +51 -22
  53. data/app/assets/lookbook/js/preview.js +0 -76
  54. data/app/views/lookbook/browser/index.html.erb +0 -8
  55. data/app/views/lookbook/browser/show.html.erb +0 -33
  56. data/app/views/lookbook/partials/_preview.html.erb +0 -18
  57. data/app/views/lookbook/partials/_sidebar.html.erb +0 -21
  58. data/app/views/lookbook/partials/inspector/_code.html.erb +0 -1
  59. data/app/views/lookbook/partials/inspector/_inspector.html.erb +0 -43
  60. data/app/views/lookbook/partials/inspector/_prose.html.erb +0 -3
  61. data/app/views/lookbook/partials/nav/_collection.html.erb +0 -17
  62. data/app/views/lookbook/partials/nav/_label.html.erb +0 -13
  63. data/app/views/lookbook/partials/nav/_nav.html.erb +0 -27
  64. data/app/views/lookbook/partials/nav/_preview.html.erb +0 -48
@@ -631,6 +631,138 @@
631
631
  }
632
632
  });
633
633
 
634
+ // node_modules/@github/hotkey/dist/index.js
635
+ var Leaf = class {
636
+ constructor(trie) {
637
+ this.children = [];
638
+ this.parent = trie;
639
+ }
640
+ delete(value) {
641
+ const index2 = this.children.indexOf(value);
642
+ if (index2 === -1)
643
+ return false;
644
+ this.children = this.children.slice(0, index2).concat(this.children.slice(index2 + 1));
645
+ if (this.children.length === 0) {
646
+ this.parent.delete(this);
647
+ }
648
+ return true;
649
+ }
650
+ add(value) {
651
+ this.children.push(value);
652
+ return this;
653
+ }
654
+ };
655
+ var RadixTrie = class {
656
+ constructor(trie) {
657
+ this.parent = null;
658
+ this.children = {};
659
+ this.parent = trie || null;
660
+ }
661
+ get(edge) {
662
+ return this.children[edge];
663
+ }
664
+ insert(edges) {
665
+ let currentNode = this;
666
+ for (let i = 0; i < edges.length; i += 1) {
667
+ const edge = edges[i];
668
+ let nextNode = currentNode.get(edge);
669
+ if (i === edges.length - 1) {
670
+ if (nextNode instanceof RadixTrie) {
671
+ currentNode.delete(nextNode);
672
+ nextNode = null;
673
+ }
674
+ if (!nextNode) {
675
+ nextNode = new Leaf(currentNode);
676
+ currentNode.children[edge] = nextNode;
677
+ }
678
+ return nextNode;
679
+ } else {
680
+ if (nextNode instanceof Leaf)
681
+ nextNode = null;
682
+ if (!nextNode) {
683
+ nextNode = new RadixTrie(currentNode);
684
+ currentNode.children[edge] = nextNode;
685
+ }
686
+ }
687
+ currentNode = nextNode;
688
+ }
689
+ return currentNode;
690
+ }
691
+ delete(node) {
692
+ for (const edge in this.children) {
693
+ const currentNode = this.children[edge];
694
+ if (currentNode === node) {
695
+ const success = delete this.children[edge];
696
+ if (Object.keys(this.children).length === 0 && this.parent) {
697
+ this.parent.delete(this);
698
+ }
699
+ return success;
700
+ }
701
+ }
702
+ return false;
703
+ }
704
+ };
705
+ function isFormField(element) {
706
+ if (!(element instanceof HTMLElement)) {
707
+ return false;
708
+ }
709
+ const name = element.nodeName.toLowerCase();
710
+ const type = (element.getAttribute("type") || "").toLowerCase();
711
+ return name === "select" || name === "textarea" || name === "input" && type !== "submit" && type !== "reset" && type !== "checkbox" && type !== "radio" || element.isContentEditable;
712
+ }
713
+ function fireDeterminedAction(el) {
714
+ if (isFormField(el)) {
715
+ el.focus();
716
+ } else {
717
+ el.click();
718
+ }
719
+ }
720
+ function expandHotkeyToEdges(hotkey2) {
721
+ return hotkey2.split(",").map((edge) => edge.split(" "));
722
+ }
723
+ function hotkey(event) {
724
+ const elideShift = event.code.startsWith("Key") && event.shiftKey && event.key.toUpperCase() === event.key;
725
+ return `${event.ctrlKey ? "Control+" : ""}${event.altKey ? "Alt+" : ""}${event.metaKey ? "Meta+" : ""}${event.shiftKey && !elideShift ? "Shift+" : ""}${event.key}`;
726
+ }
727
+ var hotkeyRadixTrie = new RadixTrie();
728
+ var elementsLeaves = new WeakMap();
729
+ var currentTriePosition = hotkeyRadixTrie;
730
+ var resetTriePositionTimer = null;
731
+ function resetTriePosition() {
732
+ resetTriePositionTimer = null;
733
+ currentTriePosition = hotkeyRadixTrie;
734
+ }
735
+ function keyDownHandler(event) {
736
+ if (event.defaultPrevented)
737
+ return;
738
+ if (event.target instanceof Node && isFormField(event.target))
739
+ return;
740
+ if (resetTriePositionTimer != null) {
741
+ window.clearTimeout(resetTriePositionTimer);
742
+ }
743
+ resetTriePositionTimer = window.setTimeout(resetTriePosition, 1500);
744
+ const newTriePosition = currentTriePosition.get(hotkey(event));
745
+ if (!newTriePosition) {
746
+ resetTriePosition();
747
+ return;
748
+ }
749
+ currentTriePosition = newTriePosition;
750
+ if (newTriePosition instanceof Leaf) {
751
+ fireDeterminedAction(newTriePosition.children[newTriePosition.children.length - 1]);
752
+ event.preventDefault();
753
+ resetTriePosition();
754
+ return;
755
+ }
756
+ }
757
+ function install(element, hotkey2) {
758
+ if (Object.keys(hotkeyRadixTrie.children).length === 0) {
759
+ document.addEventListener("keydown", keyDownHandler);
760
+ }
761
+ const hotkeys = expandHotkeyToEdges(hotkey2 || element.getAttribute("data-hotkey") || "");
762
+ const leaves = hotkeys.map((h) => hotkeyRadixTrie.insert(h).add(element));
763
+ elementsLeaves.set(element, leaves);
764
+ }
765
+
634
766
  // node_modules/alpinejs/dist/module.esm.js
635
767
  var __create2 = Object.create;
636
768
  var __defProp2 = Object.defineProperty;
@@ -691,7 +823,7 @@
691
823
  };
692
824
  var GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt";
693
825
  var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
694
- var range = 2;
826
+ var range2 = 2;
695
827
  function generateCodeFrame(source, start2 = 0, end = source.length) {
696
828
  const lines = source.split(/\r?\n/);
697
829
  let count = 0;
@@ -699,7 +831,7 @@
699
831
  for (let i = 0; i < lines.length; i++) {
700
832
  count += lines[i].length + 1;
701
833
  if (count >= start2) {
702
- for (let j = i - range; j <= i + range || end > count; j++) {
834
+ for (let j = i - range2; j <= i + range2 || end > count; j++) {
703
835
  if (j < 0 || j >= lines.length)
704
836
  continue;
705
837
  const line = j + 1;
@@ -2314,9 +2446,9 @@ Expression: "${expression}"
2314
2446
  stopDeferring();
2315
2447
  }
2316
2448
  function getDirectiveHandler(el, directive2) {
2317
- let noop = () => {
2449
+ let noop2 = () => {
2318
2450
  };
2319
- let handler3 = directiveHandlers[directive2.type] || noop;
2451
+ let handler3 = directiveHandlers[directive2.type] || noop2;
2320
2452
  let cleanups = [];
2321
2453
  let cleanup2 = (callback) => cleanups.push(callback);
2322
2454
  let [effect3, cleanupEffect] = elementBoundEffect(el);
@@ -5791,18 +5923,18 @@ Expression: "${expression}"
5791
5923
  didTouchMove = false;
5792
5924
  }
5793
5925
  function addDocumentPress() {
5794
- var doc = getDocument();
5795
- doc.addEventListener("mousedown", onDocumentPress, true);
5796
- doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
5797
- doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
5798
- doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
5926
+ var doc2 = getDocument();
5927
+ doc2.addEventListener("mousedown", onDocumentPress, true);
5928
+ doc2.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
5929
+ doc2.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
5930
+ doc2.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
5799
5931
  }
5800
5932
  function removeDocumentPress() {
5801
- var doc = getDocument();
5802
- doc.removeEventListener("mousedown", onDocumentPress, true);
5803
- doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
5804
- doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
5805
- doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
5933
+ var doc2 = getDocument();
5934
+ doc2.removeEventListener("mousedown", onDocumentPress, true);
5935
+ doc2.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
5936
+ doc2.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
5937
+ doc2.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
5806
5938
  }
5807
5939
  function onTransitionedOut(duration, callback) {
5808
5940
  onTransitionEnd(duration, function() {
@@ -6697,18 +6829,18 @@ Expression: "${expression}"
6697
6829
  clientY
6698
6830
  };
6699
6831
  }
6700
- function addMouseCoordsListener(doc) {
6701
- doc.addEventListener("mousemove", storeMouseCoords);
6832
+ function addMouseCoordsListener(doc2) {
6833
+ doc2.addEventListener("mousemove", storeMouseCoords);
6702
6834
  }
6703
- function removeMouseCoordsListener(doc) {
6704
- doc.removeEventListener("mousemove", storeMouseCoords);
6835
+ function removeMouseCoordsListener(doc2) {
6836
+ doc2.removeEventListener("mousemove", storeMouseCoords);
6705
6837
  }
6706
6838
  var followCursor2 = {
6707
6839
  name: "followCursor",
6708
6840
  defaultValue: false,
6709
6841
  fn: function fn(instance) {
6710
6842
  var reference = instance.reference;
6711
- var doc = getOwnerDocument(instance.props.triggerTarget || reference);
6843
+ var doc2 = getOwnerDocument(instance.props.triggerTarget || reference);
6712
6844
  var isInternalUpdate = false;
6713
6845
  var wasFocusEvent = false;
6714
6846
  var isUnmounted = true;
@@ -6717,10 +6849,10 @@ Expression: "${expression}"
6717
6849
  return instance.props.followCursor === "initial" && instance.state.isVisible;
6718
6850
  }
6719
6851
  function addListener() {
6720
- doc.addEventListener("mousemove", onMouseMove);
6852
+ doc2.addEventListener("mousemove", onMouseMove);
6721
6853
  }
6722
6854
  function removeListener() {
6723
- doc.removeEventListener("mousemove", onMouseMove);
6855
+ doc2.removeEventListener("mousemove", onMouseMove);
6724
6856
  }
6725
6857
  function unsetGetReferenceClientRect() {
6726
6858
  isInternalUpdate = true;
@@ -6766,9 +6898,9 @@ Expression: "${expression}"
6766
6898
  if (instance.props.followCursor) {
6767
6899
  activeInstances.push({
6768
6900
  instance,
6769
- doc
6901
+ doc: doc2
6770
6902
  });
6771
- addMouseCoordsListener(doc);
6903
+ addMouseCoordsListener(doc2);
6772
6904
  }
6773
6905
  }
6774
6906
  function destroy3() {
@@ -6776,9 +6908,9 @@ Expression: "${expression}"
6776
6908
  return data2.instance !== instance;
6777
6909
  });
6778
6910
  if (activeInstances.filter(function(data2) {
6779
- return data2.doc === doc;
6911
+ return data2.doc === doc2;
6780
6912
  }).length === 0) {
6781
- removeMouseCoordsListener(doc);
6913
+ removeMouseCoordsListener(doc2);
6782
6914
  }
6783
6915
  }
6784
6916
  return {
@@ -7098,6 +7230,32 @@ Expression: "${expression}"
7098
7230
  });
7099
7231
  }
7100
7232
 
7233
+ // app/assets/lookbook/js/utils/screen.js
7234
+ function screen_default(Alpine3) {
7235
+ let data2 = Alpine3.reactive({ screensize: window.innerWidth });
7236
+ const defaultBreakpoints = {
7237
+ xs: 0,
7238
+ sm: 640,
7239
+ md: 768,
7240
+ lg: 1024,
7241
+ xl: 1280,
7242
+ "2xl": 1536
7243
+ };
7244
+ const breakpoints = window.AlpineMagicHelpersConfig && window.AlpineMagicHelpersConfig.breakpoints ? window.AlpineMagicHelpersConfig.breakpoints : defaultBreakpoints;
7245
+ window.addEventListener("resize", () => {
7246
+ data2.screensize = window.innerWidth;
7247
+ });
7248
+ Alpine3.magic("screen", () => (breakpoint) => {
7249
+ let width = data2.screensize;
7250
+ if (Number.isInteger(breakpoint))
7251
+ return breakpoint <= width;
7252
+ if (breakpoints[breakpoint] === void 0) {
7253
+ throw Error("Undefined $screen property: " + breakpoint + ". Supported properties: " + Object.keys(breakpoints).join(", "));
7254
+ }
7255
+ return breakpoints[breakpoint] <= width;
7256
+ });
7257
+ }
7258
+
7101
7259
  // node_modules/split-grid/dist/split-grid.mjs
7102
7260
  var numeric = function(value, unit) {
7103
7261
  return Number(value.slice(0, -1 * unit.length));
@@ -7575,9 +7733,9 @@ Expression: "${expression}"
7575
7733
  }
7576
7734
  var split_grid_default = index;
7577
7735
 
7578
- // app/assets/lookbook/js/split.js
7736
+ // app/assets/lookbook/js/utils/split.js
7579
7737
  function split_default(props) {
7580
- const app = Alpine.store("app");
7738
+ const page2 = Alpine.store("page");
7581
7739
  return {
7582
7740
  init() {
7583
7741
  split_grid_default({
@@ -7588,23 +7746,562 @@ Expression: "${expression}"
7588
7746
  writeStyle() {
7589
7747
  },
7590
7748
  onDrag(dir, track, style) {
7591
- splits = style.split(" ").map((num) => parseInt(num));
7749
+ const splits = style.split(" ").map((num) => parseInt(num));
7592
7750
  props.onDrag(splits);
7593
7751
  },
7594
7752
  onDragStart() {
7595
- app.reflowing = true;
7753
+ page2.reflowing = true;
7596
7754
  },
7597
7755
  onDragEnd() {
7598
- app.reflowing = false;
7756
+ page2.reflowing = false;
7757
+ }
7758
+ });
7759
+ }
7760
+ };
7761
+ }
7762
+
7763
+ // node_modules/morphdom/dist/morphdom-esm.js
7764
+ var DOCUMENT_FRAGMENT_NODE = 11;
7765
+ function morphAttrs(fromNode, toNode) {
7766
+ var toNodeAttrs = toNode.attributes;
7767
+ var attr;
7768
+ var attrName;
7769
+ var attrNamespaceURI;
7770
+ var attrValue;
7771
+ var fromValue;
7772
+ if (toNode.nodeType === DOCUMENT_FRAGMENT_NODE || fromNode.nodeType === DOCUMENT_FRAGMENT_NODE) {
7773
+ return;
7774
+ }
7775
+ for (var i = toNodeAttrs.length - 1; i >= 0; i--) {
7776
+ attr = toNodeAttrs[i];
7777
+ attrName = attr.name;
7778
+ attrNamespaceURI = attr.namespaceURI;
7779
+ attrValue = attr.value;
7780
+ if (attrNamespaceURI) {
7781
+ attrName = attr.localName || attrName;
7782
+ fromValue = fromNode.getAttributeNS(attrNamespaceURI, attrName);
7783
+ if (fromValue !== attrValue) {
7784
+ if (attr.prefix === "xmlns") {
7785
+ attrName = attr.name;
7786
+ }
7787
+ fromNode.setAttributeNS(attrNamespaceURI, attrName, attrValue);
7788
+ }
7789
+ } else {
7790
+ fromValue = fromNode.getAttribute(attrName);
7791
+ if (fromValue !== attrValue) {
7792
+ fromNode.setAttribute(attrName, attrValue);
7793
+ }
7794
+ }
7795
+ }
7796
+ var fromNodeAttrs = fromNode.attributes;
7797
+ for (var d = fromNodeAttrs.length - 1; d >= 0; d--) {
7798
+ attr = fromNodeAttrs[d];
7799
+ attrName = attr.name;
7800
+ attrNamespaceURI = attr.namespaceURI;
7801
+ if (attrNamespaceURI) {
7802
+ attrName = attr.localName || attrName;
7803
+ if (!toNode.hasAttributeNS(attrNamespaceURI, attrName)) {
7804
+ fromNode.removeAttributeNS(attrNamespaceURI, attrName);
7805
+ }
7806
+ } else {
7807
+ if (!toNode.hasAttribute(attrName)) {
7808
+ fromNode.removeAttribute(attrName);
7809
+ }
7810
+ }
7811
+ }
7812
+ }
7813
+ var range;
7814
+ var NS_XHTML = "http://www.w3.org/1999/xhtml";
7815
+ var doc = typeof document === "undefined" ? void 0 : document;
7816
+ var HAS_TEMPLATE_SUPPORT = !!doc && "content" in doc.createElement("template");
7817
+ var HAS_RANGE_SUPPORT = !!doc && doc.createRange && "createContextualFragment" in doc.createRange();
7818
+ function createFragmentFromTemplate(str) {
7819
+ var template = doc.createElement("template");
7820
+ template.innerHTML = str;
7821
+ return template.content.childNodes[0];
7822
+ }
7823
+ function createFragmentFromRange(str) {
7824
+ if (!range) {
7825
+ range = doc.createRange();
7826
+ range.selectNode(doc.body);
7827
+ }
7828
+ var fragment = range.createContextualFragment(str);
7829
+ return fragment.childNodes[0];
7830
+ }
7831
+ function createFragmentFromWrap(str) {
7832
+ var fragment = doc.createElement("body");
7833
+ fragment.innerHTML = str;
7834
+ return fragment.childNodes[0];
7835
+ }
7836
+ function toElement(str) {
7837
+ str = str.trim();
7838
+ if (HAS_TEMPLATE_SUPPORT) {
7839
+ return createFragmentFromTemplate(str);
7840
+ } else if (HAS_RANGE_SUPPORT) {
7841
+ return createFragmentFromRange(str);
7842
+ }
7843
+ return createFragmentFromWrap(str);
7844
+ }
7845
+ function compareNodeNames(fromEl, toEl) {
7846
+ var fromNodeName = fromEl.nodeName;
7847
+ var toNodeName = toEl.nodeName;
7848
+ var fromCodeStart, toCodeStart;
7849
+ if (fromNodeName === toNodeName) {
7850
+ return true;
7851
+ }
7852
+ fromCodeStart = fromNodeName.charCodeAt(0);
7853
+ toCodeStart = toNodeName.charCodeAt(0);
7854
+ if (fromCodeStart <= 90 && toCodeStart >= 97) {
7855
+ return fromNodeName === toNodeName.toUpperCase();
7856
+ } else if (toCodeStart <= 90 && fromCodeStart >= 97) {
7857
+ return toNodeName === fromNodeName.toUpperCase();
7858
+ } else {
7859
+ return false;
7860
+ }
7861
+ }
7862
+ function createElementNS(name, namespaceURI) {
7863
+ return !namespaceURI || namespaceURI === NS_XHTML ? doc.createElement(name) : doc.createElementNS(namespaceURI, name);
7864
+ }
7865
+ function moveChildren(fromEl, toEl) {
7866
+ var curChild = fromEl.firstChild;
7867
+ while (curChild) {
7868
+ var nextChild = curChild.nextSibling;
7869
+ toEl.appendChild(curChild);
7870
+ curChild = nextChild;
7871
+ }
7872
+ return toEl;
7873
+ }
7874
+ function syncBooleanAttrProp(fromEl, toEl, name) {
7875
+ if (fromEl[name] !== toEl[name]) {
7876
+ fromEl[name] = toEl[name];
7877
+ if (fromEl[name]) {
7878
+ fromEl.setAttribute(name, "");
7879
+ } else {
7880
+ fromEl.removeAttribute(name);
7881
+ }
7882
+ }
7883
+ }
7884
+ var specialElHandlers = {
7885
+ OPTION: function(fromEl, toEl) {
7886
+ var parentNode = fromEl.parentNode;
7887
+ if (parentNode) {
7888
+ var parentName = parentNode.nodeName.toUpperCase();
7889
+ if (parentName === "OPTGROUP") {
7890
+ parentNode = parentNode.parentNode;
7891
+ parentName = parentNode && parentNode.nodeName.toUpperCase();
7892
+ }
7893
+ if (parentName === "SELECT" && !parentNode.hasAttribute("multiple")) {
7894
+ if (fromEl.hasAttribute("selected") && !toEl.selected) {
7895
+ fromEl.setAttribute("selected", "selected");
7896
+ fromEl.removeAttribute("selected");
7897
+ }
7898
+ parentNode.selectedIndex = -1;
7899
+ }
7900
+ }
7901
+ syncBooleanAttrProp(fromEl, toEl, "selected");
7902
+ },
7903
+ INPUT: function(fromEl, toEl) {
7904
+ syncBooleanAttrProp(fromEl, toEl, "checked");
7905
+ syncBooleanAttrProp(fromEl, toEl, "disabled");
7906
+ if (fromEl.value !== toEl.value) {
7907
+ fromEl.value = toEl.value;
7908
+ }
7909
+ if (!toEl.hasAttribute("value")) {
7910
+ fromEl.removeAttribute("value");
7911
+ }
7912
+ },
7913
+ TEXTAREA: function(fromEl, toEl) {
7914
+ var newValue = toEl.value;
7915
+ if (fromEl.value !== newValue) {
7916
+ fromEl.value = newValue;
7917
+ }
7918
+ var firstChild = fromEl.firstChild;
7919
+ if (firstChild) {
7920
+ var oldValue = firstChild.nodeValue;
7921
+ if (oldValue == newValue || !newValue && oldValue == fromEl.placeholder) {
7922
+ return;
7923
+ }
7924
+ firstChild.nodeValue = newValue;
7925
+ }
7926
+ },
7927
+ SELECT: function(fromEl, toEl) {
7928
+ if (!toEl.hasAttribute("multiple")) {
7929
+ var selectedIndex = -1;
7930
+ var i = 0;
7931
+ var curChild = fromEl.firstChild;
7932
+ var optgroup;
7933
+ var nodeName;
7934
+ while (curChild) {
7935
+ nodeName = curChild.nodeName && curChild.nodeName.toUpperCase();
7936
+ if (nodeName === "OPTGROUP") {
7937
+ optgroup = curChild;
7938
+ curChild = optgroup.firstChild;
7939
+ } else {
7940
+ if (nodeName === "OPTION") {
7941
+ if (curChild.hasAttribute("selected")) {
7942
+ selectedIndex = i;
7943
+ break;
7944
+ }
7945
+ i++;
7946
+ }
7947
+ curChild = curChild.nextSibling;
7948
+ if (!curChild && optgroup) {
7949
+ curChild = optgroup.nextSibling;
7950
+ optgroup = null;
7951
+ }
7952
+ }
7953
+ }
7954
+ fromEl.selectedIndex = selectedIndex;
7955
+ }
7956
+ }
7957
+ };
7958
+ var ELEMENT_NODE = 1;
7959
+ var DOCUMENT_FRAGMENT_NODE$1 = 11;
7960
+ var TEXT_NODE = 3;
7961
+ var COMMENT_NODE = 8;
7962
+ function noop() {
7963
+ }
7964
+ function defaultGetNodeKey(node) {
7965
+ if (node) {
7966
+ return node.getAttribute && node.getAttribute("id") || node.id;
7967
+ }
7968
+ }
7969
+ function morphdomFactory(morphAttrs2) {
7970
+ return function morphdom2(fromNode, toNode, options) {
7971
+ if (!options) {
7972
+ options = {};
7973
+ }
7974
+ if (typeof toNode === "string") {
7975
+ if (fromNode.nodeName === "#document" || fromNode.nodeName === "HTML" || fromNode.nodeName === "BODY") {
7976
+ var toNodeHtml = toNode;
7977
+ toNode = doc.createElement("html");
7978
+ toNode.innerHTML = toNodeHtml;
7979
+ } else {
7980
+ toNode = toElement(toNode);
7981
+ }
7982
+ }
7983
+ var getNodeKey = options.getNodeKey || defaultGetNodeKey;
7984
+ var onBeforeNodeAdded = options.onBeforeNodeAdded || noop;
7985
+ var onNodeAdded = options.onNodeAdded || noop;
7986
+ var onBeforeElUpdated = options.onBeforeElUpdated || noop;
7987
+ var onElUpdated = options.onElUpdated || noop;
7988
+ var onBeforeNodeDiscarded = options.onBeforeNodeDiscarded || noop;
7989
+ var onNodeDiscarded = options.onNodeDiscarded || noop;
7990
+ var onBeforeElChildrenUpdated = options.onBeforeElChildrenUpdated || noop;
7991
+ var childrenOnly = options.childrenOnly === true;
7992
+ var fromNodesLookup = Object.create(null);
7993
+ var keyedRemovalList = [];
7994
+ function addKeyedRemoval(key) {
7995
+ keyedRemovalList.push(key);
7996
+ }
7997
+ function walkDiscardedChildNodes(node, skipKeyedNodes) {
7998
+ if (node.nodeType === ELEMENT_NODE) {
7999
+ var curChild = node.firstChild;
8000
+ while (curChild) {
8001
+ var key = void 0;
8002
+ if (skipKeyedNodes && (key = getNodeKey(curChild))) {
8003
+ addKeyedRemoval(key);
8004
+ } else {
8005
+ onNodeDiscarded(curChild);
8006
+ if (curChild.firstChild) {
8007
+ walkDiscardedChildNodes(curChild, skipKeyedNodes);
8008
+ }
8009
+ }
8010
+ curChild = curChild.nextSibling;
8011
+ }
8012
+ }
8013
+ }
8014
+ function removeNode(node, parentNode, skipKeyedNodes) {
8015
+ if (onBeforeNodeDiscarded(node) === false) {
8016
+ return;
8017
+ }
8018
+ if (parentNode) {
8019
+ parentNode.removeChild(node);
8020
+ }
8021
+ onNodeDiscarded(node);
8022
+ walkDiscardedChildNodes(node, skipKeyedNodes);
8023
+ }
8024
+ function indexTree(node) {
8025
+ if (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE$1) {
8026
+ var curChild = node.firstChild;
8027
+ while (curChild) {
8028
+ var key = getNodeKey(curChild);
8029
+ if (key) {
8030
+ fromNodesLookup[key] = curChild;
8031
+ }
8032
+ indexTree(curChild);
8033
+ curChild = curChild.nextSibling;
8034
+ }
8035
+ }
8036
+ }
8037
+ indexTree(fromNode);
8038
+ function handleNodeAdded(el) {
8039
+ onNodeAdded(el);
8040
+ var curChild = el.firstChild;
8041
+ while (curChild) {
8042
+ var nextSibling = curChild.nextSibling;
8043
+ var key = getNodeKey(curChild);
8044
+ if (key) {
8045
+ var unmatchedFromEl = fromNodesLookup[key];
8046
+ if (unmatchedFromEl && compareNodeNames(curChild, unmatchedFromEl)) {
8047
+ curChild.parentNode.replaceChild(unmatchedFromEl, curChild);
8048
+ morphEl(unmatchedFromEl, curChild);
8049
+ } else {
8050
+ handleNodeAdded(curChild);
8051
+ }
8052
+ } else {
8053
+ handleNodeAdded(curChild);
8054
+ }
8055
+ curChild = nextSibling;
8056
+ }
8057
+ }
8058
+ function cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey) {
8059
+ while (curFromNodeChild) {
8060
+ var fromNextSibling = curFromNodeChild.nextSibling;
8061
+ if (curFromNodeKey = getNodeKey(curFromNodeChild)) {
8062
+ addKeyedRemoval(curFromNodeKey);
8063
+ } else {
8064
+ removeNode(curFromNodeChild, fromEl, true);
8065
+ }
8066
+ curFromNodeChild = fromNextSibling;
8067
+ }
8068
+ }
8069
+ function morphEl(fromEl, toEl, childrenOnly2) {
8070
+ var toElKey = getNodeKey(toEl);
8071
+ if (toElKey) {
8072
+ delete fromNodesLookup[toElKey];
8073
+ }
8074
+ if (!childrenOnly2) {
8075
+ if (onBeforeElUpdated(fromEl, toEl) === false) {
8076
+ return;
8077
+ }
8078
+ morphAttrs2(fromEl, toEl);
8079
+ onElUpdated(fromEl);
8080
+ if (onBeforeElChildrenUpdated(fromEl, toEl) === false) {
8081
+ return;
8082
+ }
8083
+ }
8084
+ if (fromEl.nodeName !== "TEXTAREA") {
8085
+ morphChildren(fromEl, toEl);
8086
+ } else {
8087
+ specialElHandlers.TEXTAREA(fromEl, toEl);
8088
+ }
8089
+ }
8090
+ function morphChildren(fromEl, toEl) {
8091
+ var curToNodeChild = toEl.firstChild;
8092
+ var curFromNodeChild = fromEl.firstChild;
8093
+ var curToNodeKey;
8094
+ var curFromNodeKey;
8095
+ var fromNextSibling;
8096
+ var toNextSibling;
8097
+ var matchingFromEl;
8098
+ outer:
8099
+ while (curToNodeChild) {
8100
+ toNextSibling = curToNodeChild.nextSibling;
8101
+ curToNodeKey = getNodeKey(curToNodeChild);
8102
+ while (curFromNodeChild) {
8103
+ fromNextSibling = curFromNodeChild.nextSibling;
8104
+ if (curToNodeChild.isSameNode && curToNodeChild.isSameNode(curFromNodeChild)) {
8105
+ curToNodeChild = toNextSibling;
8106
+ curFromNodeChild = fromNextSibling;
8107
+ continue outer;
8108
+ }
8109
+ curFromNodeKey = getNodeKey(curFromNodeChild);
8110
+ var curFromNodeType = curFromNodeChild.nodeType;
8111
+ var isCompatible = void 0;
8112
+ if (curFromNodeType === curToNodeChild.nodeType) {
8113
+ if (curFromNodeType === ELEMENT_NODE) {
8114
+ if (curToNodeKey) {
8115
+ if (curToNodeKey !== curFromNodeKey) {
8116
+ if (matchingFromEl = fromNodesLookup[curToNodeKey]) {
8117
+ if (fromNextSibling === matchingFromEl) {
8118
+ isCompatible = false;
8119
+ } else {
8120
+ fromEl.insertBefore(matchingFromEl, curFromNodeChild);
8121
+ if (curFromNodeKey) {
8122
+ addKeyedRemoval(curFromNodeKey);
8123
+ } else {
8124
+ removeNode(curFromNodeChild, fromEl, true);
8125
+ }
8126
+ curFromNodeChild = matchingFromEl;
8127
+ }
8128
+ } else {
8129
+ isCompatible = false;
8130
+ }
8131
+ }
8132
+ } else if (curFromNodeKey) {
8133
+ isCompatible = false;
8134
+ }
8135
+ isCompatible = isCompatible !== false && compareNodeNames(curFromNodeChild, curToNodeChild);
8136
+ if (isCompatible) {
8137
+ morphEl(curFromNodeChild, curToNodeChild);
8138
+ }
8139
+ } else if (curFromNodeType === TEXT_NODE || curFromNodeType == COMMENT_NODE) {
8140
+ isCompatible = true;
8141
+ if (curFromNodeChild.nodeValue !== curToNodeChild.nodeValue) {
8142
+ curFromNodeChild.nodeValue = curToNodeChild.nodeValue;
8143
+ }
8144
+ }
8145
+ }
8146
+ if (isCompatible) {
8147
+ curToNodeChild = toNextSibling;
8148
+ curFromNodeChild = fromNextSibling;
8149
+ continue outer;
8150
+ }
8151
+ if (curFromNodeKey) {
8152
+ addKeyedRemoval(curFromNodeKey);
8153
+ } else {
8154
+ removeNode(curFromNodeChild, fromEl, true);
8155
+ }
8156
+ curFromNodeChild = fromNextSibling;
8157
+ }
8158
+ if (curToNodeKey && (matchingFromEl = fromNodesLookup[curToNodeKey]) && compareNodeNames(matchingFromEl, curToNodeChild)) {
8159
+ fromEl.appendChild(matchingFromEl);
8160
+ morphEl(matchingFromEl, curToNodeChild);
8161
+ } else {
8162
+ var onBeforeNodeAddedResult = onBeforeNodeAdded(curToNodeChild);
8163
+ if (onBeforeNodeAddedResult !== false) {
8164
+ if (onBeforeNodeAddedResult) {
8165
+ curToNodeChild = onBeforeNodeAddedResult;
8166
+ }
8167
+ if (curToNodeChild.actualize) {
8168
+ curToNodeChild = curToNodeChild.actualize(fromEl.ownerDocument || doc);
8169
+ }
8170
+ fromEl.appendChild(curToNodeChild);
8171
+ handleNodeAdded(curToNodeChild);
8172
+ }
8173
+ }
8174
+ curToNodeChild = toNextSibling;
8175
+ curFromNodeChild = fromNextSibling;
8176
+ }
8177
+ cleanupFromEl(fromEl, curFromNodeChild, curFromNodeKey);
8178
+ var specialElHandler = specialElHandlers[fromEl.nodeName];
8179
+ if (specialElHandler) {
8180
+ specialElHandler(fromEl, toEl);
8181
+ }
8182
+ }
8183
+ var morphedNode = fromNode;
8184
+ var morphedNodeType = morphedNode.nodeType;
8185
+ var toNodeType = toNode.nodeType;
8186
+ if (!childrenOnly) {
8187
+ if (morphedNodeType === ELEMENT_NODE) {
8188
+ if (toNodeType === ELEMENT_NODE) {
8189
+ if (!compareNodeNames(fromNode, toNode)) {
8190
+ onNodeDiscarded(fromNode);
8191
+ morphedNode = moveChildren(fromNode, createElementNS(toNode.nodeName, toNode.namespaceURI));
8192
+ }
8193
+ } else {
8194
+ morphedNode = toNode;
8195
+ }
8196
+ } else if (morphedNodeType === TEXT_NODE || morphedNodeType === COMMENT_NODE) {
8197
+ if (toNodeType === morphedNodeType) {
8198
+ if (morphedNode.nodeValue !== toNode.nodeValue) {
8199
+ morphedNode.nodeValue = toNode.nodeValue;
8200
+ }
8201
+ return morphedNode;
8202
+ } else {
8203
+ morphedNode = toNode;
8204
+ }
8205
+ }
8206
+ }
8207
+ if (morphedNode === toNode) {
8208
+ onNodeDiscarded(fromNode);
8209
+ } else {
8210
+ if (toNode.isSameNode && toNode.isSameNode(morphedNode)) {
8211
+ return;
8212
+ }
8213
+ morphEl(morphedNode, toNode, childrenOnly);
8214
+ if (keyedRemovalList) {
8215
+ for (var i = 0, len = keyedRemovalList.length; i < len; i++) {
8216
+ var elToRemove = fromNodesLookup[keyedRemovalList[i]];
8217
+ if (elToRemove) {
8218
+ removeNode(elToRemove, elToRemove.parentNode, false);
8219
+ }
7599
8220
  }
8221
+ }
8222
+ }
8223
+ if (!childrenOnly && morphedNode !== fromNode && fromNode.parentNode) {
8224
+ if (morphedNode.actualize) {
8225
+ morphedNode = morphedNode.actualize(fromNode.ownerDocument || doc);
8226
+ }
8227
+ fromNode.parentNode.replaceChild(morphedNode, fromNode);
8228
+ }
8229
+ return morphedNode;
8230
+ };
8231
+ }
8232
+ var morphdom = morphdomFactory(morphAttrs);
8233
+ var morphdom_esm_default = morphdom;
8234
+
8235
+ // app/assets/lookbook/js/utils/morph.js
8236
+ function morph_default(from, to, opts = {}) {
8237
+ morphdom_esm_default(from, to, __spreadValues({
8238
+ onBeforeElUpdated: function(fromEl, toEl) {
8239
+ if (fromEl._x_dataStack) {
8240
+ Alpine.clone(fromEl, toEl);
8241
+ }
8242
+ if (fromEl.isEqualNode(toEl)) {
8243
+ return false;
8244
+ }
8245
+ return true;
8246
+ }
8247
+ }, opts));
8248
+ }
8249
+
8250
+ // app/assets/lookbook/js/page.js
8251
+ function page() {
8252
+ const store2 = Alpine.store("page");
8253
+ return {
8254
+ ready: false,
8255
+ sidebarOpenMobile: false,
8256
+ init() {
8257
+ this.$nextTick(() => this.ready = true);
8258
+ },
8259
+ splitProps: {
8260
+ minSize: 200,
8261
+ onDrag(splits) {
8262
+ Alpine.store("nav").width = Math.min(splits[0], 500);
8263
+ }
8264
+ },
8265
+ fetchHTML() {
8266
+ return __async(this, null, function* () {
8267
+ const response = yield fetch(window.document.location);
8268
+ if (!response.ok)
8269
+ return window.location.reload();
8270
+ const html = yield response.text();
8271
+ store2.doc = new DOMParser().parseFromString(html, "text/html");
8272
+ return store2.doc;
7600
8273
  });
8274
+ },
8275
+ updateTitle() {
8276
+ document.title = store2.doc.title;
8277
+ },
8278
+ render() {
8279
+ if (this.ready) {
8280
+ morph_default(this.$el, store2.doc.getElementById(this.$el.id));
8281
+ }
7601
8282
  }
7602
8283
  };
7603
8284
  }
7604
8285
 
7605
- // app/assets/lookbook/js/preview.js
8286
+ // app/assets/lookbook/js/workbench.js
8287
+ function workbench() {
8288
+ const inspector2 = Alpine.store("inspector");
8289
+ return {
8290
+ previewViewportHeight: 0,
8291
+ previewViewportWidth: 0,
8292
+ splitProps: {
8293
+ direction: "vertical",
8294
+ minSize: 200,
8295
+ onDrag(splits) {
8296
+ inspector2.height = splits[2];
8297
+ }
8298
+ }
8299
+ };
8300
+ }
8301
+
8302
+ // app/assets/lookbook/js/workbench/preview.js
7606
8303
  function preview() {
7607
- const app = Alpine.store("app");
8304
+ const app = Alpine.store("page");
7608
8305
  const preview2 = Alpine.store("preview");
7609
8306
  return {
7610
8307
  init() {
@@ -7626,27 +8323,129 @@ Expression: "${expression}"
7626
8323
  window.addEventListener("pointermove", this.onResize);
7627
8324
  window.addEventListener("pointerup", this.onResizeEnd);
7628
8325
  },
7629
- onResizeEnd(e) {
8326
+ onResizeEnd() {
7630
8327
  window.removeEventListener("pointermove", this.onResize);
7631
8328
  window.removeEventListener("pointerup", this.onResizeEnd);
7632
8329
  app.reflowing = false;
7633
8330
  },
7634
- handle: {
7635
- ["@pointerdown"]: "onResizeStart",
7636
- ["@dblclick"]() {
7637
- if (preview2.width === "100%" && preview2.lastWidth) {
7638
- preview2.width = preview2.lastWidth;
7639
- } else {
7640
- preview2.lastWidth = preview2.width;
7641
- preview2.width = "100%";
8331
+ toggleFullWidth() {
8332
+ if (preview2.width === "100%" && preview2.lastWidth) {
8333
+ preview2.width = preview2.lastWidth;
8334
+ } else {
8335
+ preview2.lastWidth = preview2.width;
8336
+ preview2.width = "100%";
8337
+ }
8338
+ }
8339
+ };
8340
+ }
8341
+
8342
+ // app/assets/lookbook/js/workbench/inspector.js
8343
+ function inspector() {
8344
+ const inspector2 = Alpine.store("inspector");
8345
+ return {
8346
+ switchTo(id) {
8347
+ inspector2.active = id;
8348
+ },
8349
+ active(id) {
8350
+ return inspector2.active === id;
8351
+ }
8352
+ };
8353
+ }
8354
+
8355
+ // app/assets/lookbook/js/nav.js
8356
+ function nav_default() {
8357
+ return {
8358
+ clearFilter() {
8359
+ this.$store.nav.filter = "";
8360
+ },
8361
+ init() {
8362
+ this.$watch("$store.nav.filter", (value) => {
8363
+ const nav = this.$store.nav;
8364
+ nav.filterText = value.replace(/\s/g, "").toLowerCase();
8365
+ nav.filtering = nav.filterText.length > 0;
8366
+ });
8367
+ },
8368
+ updateNav(event) {
8369
+ const nav = document.getElementById("nav");
8370
+ nav.style.height = `${this.$refs.shim.offsetHeight}px`;
8371
+ morph_default(nav, event.detail.doc.getElementById("nav"));
8372
+ Promise.resolve().then(() => {
8373
+ this.$refs.shim.style.height = "auto";
8374
+ this.$dispatch("nav:updated");
8375
+ });
8376
+ },
8377
+ navigate(path) {
8378
+ if (path instanceof Event) {
8379
+ path = path.currentTarget.href;
8380
+ }
8381
+ history.pushState({}, null, path);
8382
+ this.$dispatch("popstate");
8383
+ },
8384
+ focusFilter() {
8385
+ this.currentFocus = this.$refs.filter;
8386
+ setTimeout(() => this.$refs.filter.focus(), 0);
8387
+ },
8388
+ unfocusFilter() {
8389
+ this.$refs.filter.blur();
8390
+ }
8391
+ };
8392
+ }
8393
+
8394
+ // app/assets/lookbook/js/nav/node.js
8395
+ function navNode() {
8396
+ return {
8397
+ id: null,
8398
+ hidden: true,
8399
+ children: [],
8400
+ init() {
8401
+ this.id = this.$el.id;
8402
+ },
8403
+ open() {
8404
+ return this.$store.nav.open[this.id];
8405
+ },
8406
+ getChildren() {
8407
+ return this.$refs.items ? Array.from(this.$refs.items.querySelectorAll(":scope > li")) : [];
8408
+ },
8409
+ filter() {
8410
+ this.hidden = true;
8411
+ this.getChildren().forEach((child) => {
8412
+ const data2 = child._x_dataStack[0];
8413
+ data2.filter();
8414
+ if (!data2.hidden) {
8415
+ this.hidden = false;
7642
8416
  }
8417
+ });
8418
+ },
8419
+ toggle() {
8420
+ this.$store.nav.open[this.id] = !this.$store.nav.open[this.id];
8421
+ }
8422
+ };
8423
+ }
8424
+
8425
+ // app/assets/lookbook/js/nav/leaf.js
8426
+ function navLeaf() {
8427
+ return {
8428
+ path: null,
8429
+ matchers: [],
8430
+ active: false,
8431
+ hidden: false,
8432
+ setActive() {
8433
+ this.active = this.path === window.location.pathname;
8434
+ },
8435
+ filter() {
8436
+ if (this.$store.nav.filtering) {
8437
+ const text = this.$store.nav.filterText;
8438
+ const matched = this.matchers.map((m) => m.includes(text));
8439
+ this.hidden = !matched.filter((m) => m).length;
8440
+ } else {
8441
+ this.hidden = false;
7643
8442
  }
7644
8443
  }
7645
8444
  };
7646
8445
  }
7647
8446
 
7648
- // app/assets/lookbook/js/size_observer.js
7649
- function size_observer_default() {
8447
+ // app/assets/lookbook/js/utils/size_observer.js
8448
+ function sizeObserver() {
7650
8449
  return {
7651
8450
  observedWidth: 0,
7652
8451
  observedHeight: 0,
@@ -7663,7 +8462,7 @@ Expression: "${expression}"
7663
8462
  };
7664
8463
  }
7665
8464
 
7666
- // app/assets/lookbook/js/reloader.js
8465
+ // app/assets/lookbook/js/utils/reloader.js
7667
8466
  var import_actioncable = __toModule(require_action_cable());
7668
8467
  var import_debounce = __toModule(require_debounce());
7669
8468
  function reloader_default(endpoint) {
@@ -7690,32 +8489,59 @@ Expression: "${expression}"
7690
8489
  };
7691
8490
  }
7692
8491
 
8492
+ // app/assets/lookbook/js/utils/clipboard.js
8493
+ function clipboard() {
8494
+ return {
8495
+ content: null,
8496
+ done: false,
8497
+ save() {
8498
+ this.$clipboard(this.content);
8499
+ this.done = true;
8500
+ setTimeout(() => {
8501
+ this.done = false;
8502
+ }, 1e3);
8503
+ }
8504
+ };
8505
+ }
8506
+
7693
8507
  // app/assets/lookbook/js/app.js
8508
+ window.Alpine = module_default;
7694
8509
  module_default.plugin(module_default2);
7695
8510
  module_default.plugin(module_default3);
7696
8511
  module_default.plugin(src_default4);
7697
- module_default.data("preview", preview);
7698
- module_default.data("sizeObserver", size_observer_default);
7699
- module_default.data("split", split_default);
7700
- module_default.store("app", { reflowing: false });
8512
+ module_default.plugin(screen_default);
8513
+ module_default.store("page", {
8514
+ reflowing: false,
8515
+ doc: window.document
8516
+ });
7701
8517
  module_default.persistedStore("nav", {
7702
8518
  width: 280,
7703
8519
  filter: "",
7704
- open: {},
7705
- scrollTop: 0,
7706
- shouldDisplay(previewName) {
7707
- const cleanFilter = this.filter.replace(/\s/g, "");
7708
- return cleanFilter === "" || previewName.includes(cleanFilter.toLowerCase());
7709
- }
8520
+ open: {}
7710
8521
  });
7711
- module_default.persistedStore("preview", {});
7712
8522
  module_default.persistedStore("inspector", {
7713
8523
  height: 200,
7714
8524
  active: "source"
7715
8525
  });
7716
- window.Alpine = module_default;
8526
+ module_default.persistedStore("preview", {
8527
+ width: "100%"
8528
+ });
8529
+ module_default.data("page", page);
8530
+ module_default.data("nav", nav_default);
8531
+ module_default.data("navNode", navNode);
8532
+ module_default.data("navLeaf", navLeaf);
8533
+ module_default.data("workbench", workbench);
8534
+ module_default.data("preview", preview);
8535
+ module_default.data("inspector", inspector);
8536
+ module_default.data("clipboard", clipboard);
8537
+ module_default.data("sizeObserver", sizeObserver);
8538
+ module_default.data("split", split_default);
8539
+ for (const el of document.querySelectorAll("[data-hotkey]")) {
8540
+ install(el);
8541
+ }
7717
8542
  if (window.SOCKET_PATH) {
7718
8543
  reloader_default(window.SOCKET_PATH).start();
7719
8544
  }
8545
+ window.Alpine = module_default;
7720
8546
  module_default.start();
7721
8547
  })();