lookbook 1.0.0.beta.2 → 1.0.0.beta.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +180 -40
- data/app/components/lookbook/{component.rb → base_component.rb} +7 -5
- data/app/components/lookbook/button/component.rb +1 -1
- data/app/components/lookbook/button_group/component.rb +1 -1
- data/app/components/lookbook/code/component.rb +1 -1
- data/app/components/lookbook/copy_button/component.html.erb +3 -3
- data/app/components/lookbook/copy_button/component.rb +1 -1
- data/app/components/lookbook/dimensions_display/component.rb +1 -1
- data/app/components/lookbook/embed/component.html.erb +34 -33
- data/app/components/lookbook/embed/component.rb +1 -1
- data/app/components/lookbook/filter/component.html.erb +1 -1
- data/app/components/lookbook/filter/component.rb +1 -1
- data/app/components/lookbook/header/component.html.erb +8 -13
- data/app/components/lookbook/header/component.rb +6 -1
- data/app/components/lookbook/icon/component.rb +1 -1
- data/app/components/lookbook/nav/component.html.erb +4 -8
- data/app/components/lookbook/nav/component.rb +6 -8
- data/app/components/lookbook/nav/item/component.html.erb +12 -6
- data/app/components/lookbook/nav/item/component.rb +10 -3
- data/app/components/lookbook/page_tabs/component.html.erb +1 -1
- data/app/components/lookbook/page_tabs/component.rb +1 -1
- data/app/components/lookbook/params_editor/component.rb +1 -1
- data/app/components/lookbook/params_editor/field/component.rb +1 -1
- data/app/components/lookbook/prose/component.rb +1 -1
- data/app/components/lookbook/split_layout/component.html.erb +1 -1
- data/app/components/lookbook/split_layout/component.rb +1 -1
- data/app/components/lookbook/tab_panels/component.rb +1 -1
- data/app/components/lookbook/tab_panels/panel/component.html.erb +2 -2
- data/app/components/lookbook/tab_panels/panel/component.rb +2 -2
- data/app/components/lookbook/tabs/component.html.erb +2 -2
- data/app/components/lookbook/tabs/component.js +6 -6
- data/app/components/lookbook/tabs/component.rb +1 -1
- data/app/components/lookbook/tabs/dropdown_tab/component.html.erb +1 -1
- data/app/components/lookbook/tabs/dropdown_tab/component.rb +1 -1
- data/app/components/lookbook/tabs/tab/component.html.erb +1 -1
- data/app/components/lookbook/tabs/tab/component.rb +1 -1
- data/app/components/lookbook/tag_component.rb +5 -10
- data/app/components/lookbook/toolbar/component.rb +1 -1
- data/app/components/lookbook/viewport/component.rb +1 -1
- data/app/controllers/lookbook/application_controller.rb +1 -1
- data/app/controllers/lookbook/previews_controller.rb +24 -29
- data/app/helpers/lookbook/application_helper.rb +6 -0
- data/app/helpers/lookbook/component_helper.rb +4 -0
- data/app/helpers/lookbook/page_helper.rb +1 -1
- data/app/views/layouts/lookbook/application.html.erb +76 -58
- data/app/views/layouts/lookbook/page.html.erb +35 -35
- data/app/views/layouts/lookbook/shell.html.erb +2 -48
- data/app/views/layouts/lookbook/skeleton.html.erb +7 -1
- data/app/views/lookbook/404.html.erb +1 -1
- data/app/views/lookbook/index.html.erb +24 -11
- data/app/views/lookbook/pages/show.html.erb +7 -7
- data/app/views/lookbook/previews/panels/_notes.html.erb +1 -1
- data/app/views/lookbook/previews/show.html.erb +10 -10
- data/lib/lookbook/collection.rb +1 -1
- data/lib/lookbook/component.rb +31 -0
- data/lib/lookbook/config.rb +101 -40
- data/lib/lookbook/engine.rb +88 -18
- data/lib/lookbook/markdown.rb +3 -1
- data/lib/lookbook/page.rb +6 -2
- data/lib/lookbook/parser.rb +1 -4
- data/lib/lookbook/preview.rb +59 -12
- data/lib/lookbook/preview_example.rb +1 -1
- data/lib/lookbook/source_inspector.rb +10 -0
- data/lib/lookbook/utils.rb +2 -2
- data/lib/lookbook/version.rb +1 -1
- data/lib/lookbook.rb +1 -12
- data/lib/tasks/lookbook_tasks.rake +1 -1
- data/public/lookbook-assets/css/lookbook.css +34 -38
- data/public/lookbook-assets/css/lookbook.css.map +1 -1
- data/public/lookbook-assets/js/lookbook.js +79 -78
- data/public/lookbook-assets/js/lookbook.js.map +1 -1
- metadata +4 -3
@@ -7849,17 +7849,7 @@ function $5439cede634b2921$var$toCamel(s) {
|
|
7849
7849
|
}
|
7850
7850
|
|
7851
7851
|
|
7852
|
-
var $
|
7853
|
-
var $99486586f6691564$exports = {};
|
7854
|
-
|
7855
|
-
$parcel$defineInteropFlag($99486586f6691564$exports);
|
7856
|
-
|
7857
|
-
$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039);
|
7858
|
-
function $99486586f6691564$export$2e2bcd8739ae039() {
|
7859
|
-
return {};
|
7860
|
-
}
|
7861
|
-
|
7862
|
-
|
7852
|
+
var $8827b5620b152958$exports = {};
|
7863
7853
|
var $cbd28b10fa9798c7$exports = {};
|
7864
7854
|
|
7865
7855
|
$parcel$defineInteropFlag($cbd28b10fa9798c7$exports);
|
@@ -11545,62 +11535,6 @@ function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
|
11545
11535
|
}
|
11546
11536
|
|
11547
11537
|
|
11548
|
-
var $47a1c62621be0c54$exports = {};
|
11549
|
-
|
11550
|
-
$parcel$defineInteropFlag($47a1c62621be0c54$exports);
|
11551
|
-
|
11552
|
-
$parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039);
|
11553
|
-
var $122263eab94cad08$exports = {};
|
11554
|
-
|
11555
|
-
$parcel$defineInteropFlag($122263eab94cad08$exports);
|
11556
|
-
|
11557
|
-
$parcel$export($122263eab94cad08$exports, "initClipboard", () => $122263eab94cad08$export$c6684e6159b21de3);
|
11558
|
-
$parcel$export($122263eab94cad08$exports, "default", () => $122263eab94cad08$export$2e2bcd8739ae039);
|
11559
|
-
|
11560
|
-
function $122263eab94cad08$export$c6684e6159b21de3(context = {}) {
|
11561
|
-
let copyTimeout = null;
|
11562
|
-
return Object.assign(context, {
|
11563
|
-
copied: false,
|
11564
|
-
async copyToClipboard (target = null) {
|
11565
|
-
let targetEl;
|
11566
|
-
if (this.$refs.copyTarget) targetEl = this.$refs.copyTarget;
|
11567
|
-
else if (typeof target === "string") targetEl = document.querySelector(target);
|
11568
|
-
if (!targetEl) {
|
11569
|
-
this.warn("Could not find copy target");
|
11570
|
-
return false;
|
11571
|
-
}
|
11572
|
-
const content = $7ae6ae39c2ec9059$export$6cb344a21ca18aec(targetEl.innerText.trim());
|
11573
|
-
await window.navigator.clipboard.writeText(content);
|
11574
|
-
this.copied = true;
|
11575
|
-
if (copyTimeout) clearTimeout(copyTimeout);
|
11576
|
-
copyTimeout = setTimeout(()=>{
|
11577
|
-
this.copied = false;
|
11578
|
-
this.onCopyComplete();
|
11579
|
-
}, 1000);
|
11580
|
-
return content;
|
11581
|
-
},
|
11582
|
-
onCopyComplete () {}
|
11583
|
-
});
|
11584
|
-
}
|
11585
|
-
function $122263eab94cad08$export$2e2bcd8739ae039() {
|
11586
|
-
return $122263eab94cad08$export$c6684e6159b21de3({});
|
11587
|
-
}
|
11588
|
-
|
11589
|
-
|
11590
|
-
|
11591
|
-
function $47a1c62621be0c54$export$2e2bcd8739ae039() {
|
11592
|
-
const button = $cbd28b10fa9798c7$export$2e2bcd8739ae039();
|
11593
|
-
return {
|
11594
|
-
...button,
|
11595
|
-
copied: false,
|
11596
|
-
init () {
|
11597
|
-
button.init.bind(this)();
|
11598
|
-
$122263eab94cad08$export$c6684e6159b21de3(this);
|
11599
|
-
}
|
11600
|
-
};
|
11601
|
-
}
|
11602
|
-
|
11603
|
-
|
11604
11538
|
var $e1f51f020443edd4$exports = {};
|
11605
11539
|
|
11606
11540
|
$parcel$defineInteropFlag($e1f51f020443edd4$exports);
|
@@ -12466,6 +12400,16 @@ function $e1f51f020443edd4$export$2e2bcd8739ae039(id, embedStore) {
|
|
12466
12400
|
}
|
12467
12401
|
|
12468
12402
|
|
12403
|
+
var $99486586f6691564$exports = {};
|
12404
|
+
|
12405
|
+
$parcel$defineInteropFlag($99486586f6691564$exports);
|
12406
|
+
|
12407
|
+
$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039);
|
12408
|
+
function $99486586f6691564$export$2e2bcd8739ae039() {
|
12409
|
+
return {};
|
12410
|
+
}
|
12411
|
+
|
12412
|
+
|
12469
12413
|
var $e9904a14dabf652d$exports = {};
|
12470
12414
|
|
12471
12415
|
$parcel$defineInteropFlag($e9904a14dabf652d$exports);
|
@@ -12491,6 +12435,62 @@ function $e9904a14dabf652d$export$2e2bcd8739ae039(store) {
|
|
12491
12435
|
}
|
12492
12436
|
|
12493
12437
|
|
12438
|
+
var $47a1c62621be0c54$exports = {};
|
12439
|
+
|
12440
|
+
$parcel$defineInteropFlag($47a1c62621be0c54$exports);
|
12441
|
+
|
12442
|
+
$parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039);
|
12443
|
+
var $122263eab94cad08$exports = {};
|
12444
|
+
|
12445
|
+
$parcel$defineInteropFlag($122263eab94cad08$exports);
|
12446
|
+
|
12447
|
+
$parcel$export($122263eab94cad08$exports, "initClipboard", () => $122263eab94cad08$export$c6684e6159b21de3);
|
12448
|
+
$parcel$export($122263eab94cad08$exports, "default", () => $122263eab94cad08$export$2e2bcd8739ae039);
|
12449
|
+
|
12450
|
+
function $122263eab94cad08$export$c6684e6159b21de3(context = {}) {
|
12451
|
+
let copyTimeout = null;
|
12452
|
+
return Object.assign(context, {
|
12453
|
+
copied: false,
|
12454
|
+
async copyToClipboard (target = null) {
|
12455
|
+
let targetEl;
|
12456
|
+
if (this.$refs.copyTarget) targetEl = this.$refs.copyTarget;
|
12457
|
+
else if (typeof target === "string") targetEl = document.querySelector(target);
|
12458
|
+
if (!targetEl) {
|
12459
|
+
this.warn("Could not find copy target");
|
12460
|
+
return false;
|
12461
|
+
}
|
12462
|
+
const content = $7ae6ae39c2ec9059$export$6cb344a21ca18aec(targetEl.innerText.trim());
|
12463
|
+
await window.navigator.clipboard.writeText(content);
|
12464
|
+
this.copied = true;
|
12465
|
+
if (copyTimeout) clearTimeout(copyTimeout);
|
12466
|
+
copyTimeout = setTimeout(()=>{
|
12467
|
+
this.copied = false;
|
12468
|
+
this.onCopyComplete();
|
12469
|
+
}, 1000);
|
12470
|
+
return content;
|
12471
|
+
},
|
12472
|
+
onCopyComplete () {}
|
12473
|
+
});
|
12474
|
+
}
|
12475
|
+
function $122263eab94cad08$export$2e2bcd8739ae039() {
|
12476
|
+
return $122263eab94cad08$export$c6684e6159b21de3({});
|
12477
|
+
}
|
12478
|
+
|
12479
|
+
|
12480
|
+
|
12481
|
+
function $47a1c62621be0c54$export$2e2bcd8739ae039() {
|
12482
|
+
const button = $cbd28b10fa9798c7$export$2e2bcd8739ae039();
|
12483
|
+
return {
|
12484
|
+
...button,
|
12485
|
+
copied: false,
|
12486
|
+
init () {
|
12487
|
+
button.init.bind(this)();
|
12488
|
+
$122263eab94cad08$export$c6684e6159b21de3(this);
|
12489
|
+
}
|
12490
|
+
};
|
12491
|
+
}
|
12492
|
+
|
12493
|
+
|
12494
12494
|
var $36506012e0c6e9e3$exports = {};
|
12495
12495
|
|
12496
12496
|
$parcel$defineInteropFlag($36506012e0c6e9e3$exports);
|
@@ -13153,7 +13153,7 @@ $parcel$export($0db07828cadc68e0$exports, "default", () => $0db07828cadc68e0$exp
|
|
13153
13153
|
|
13154
13154
|
|
13155
13155
|
function $0db07828cadc68e0$export$2e2bcd8739ae039(store) {
|
13156
|
-
const
|
13156
|
+
const initial1 = store ? store.activeTab : null;
|
13157
13157
|
let dropdown = null;
|
13158
13158
|
return {
|
13159
13159
|
visibleTabsCount: 0,
|
@@ -13162,7 +13162,7 @@ function $0db07828cadc68e0$export$2e2bcd8739ae039(store) {
|
|
13162
13162
|
return store || this;
|
13163
13163
|
},
|
13164
13164
|
get tabs () {
|
13165
|
-
return Array.from(this.$refs.tabs.children);
|
13165
|
+
return this.$refs.tabs ? Array.from(this.$refs.tabs.children) : [];
|
13166
13166
|
},
|
13167
13167
|
get dropdownTabs () {
|
13168
13168
|
return Array.from(this.$refs.tabsDropdown ? this.$refs.tabsDropdown.children : []);
|
@@ -13183,9 +13183,9 @@ function $0db07828cadc68e0$export$2e2bcd8739ae039(store) {
|
|
13183
13183
|
placement: "bottom",
|
13184
13184
|
appendTo: this.$root
|
13185
13185
|
});
|
13186
|
-
const initialTab =
|
13186
|
+
const initialTab = initial1 ? this.tabs.find((t)=>this._getRef(t) === initial1
|
13187
13187
|
) : this.tabs[0];
|
13188
|
-
this.selectTab(initialTab);
|
13188
|
+
this.selectTab(initialTab, true);
|
13189
13189
|
this.parentObserver = $9930d46698775b42$export$a2214cc2adb2dc44(this.$root.parentElement, (/*@__PURE__*/$parcel$interopDefault($d3ec6a576bb30dc9$exports))(this.handleResize.bind(this), 10));
|
13190
13190
|
this.$watch("visibleTabsCount", (value)=>{
|
13191
13191
|
this.debug(`'#${this.$root.id}' visible tabs count:`, value);
|
@@ -13195,11 +13195,9 @@ function $0db07828cadc68e0$export$2e2bcd8739ae039(store) {
|
|
13195
13195
|
handleResize ({ width: width }) {
|
13196
13196
|
if (width === this._lastMeasuredWidth) return;
|
13197
13197
|
if (width === this.$root.offsetWidth) {
|
13198
|
-
console.log("uep");
|
13199
13198
|
this.visibleTabsCount = this.tabs.length;
|
13200
13199
|
return;
|
13201
13200
|
}
|
13202
|
-
console.log(width);
|
13203
13201
|
let sumTabWidths = 60;
|
13204
13202
|
let triggerLeft = 20;
|
13205
13203
|
let visibleTabsCount = 0;
|
@@ -13214,9 +13212,12 @@ function $0db07828cadc68e0$export$2e2bcd8739ae039(store) {
|
|
13214
13212
|
this.triggerLeft = triggerLeft;
|
13215
13213
|
this._lastMeasuredWidth = width;
|
13216
13214
|
},
|
13217
|
-
selectTab (el) {
|
13215
|
+
selectTab (el, initial = false) {
|
13218
13216
|
this.store.activeTab = this._getRef(el);
|
13219
13217
|
dropdown.hide();
|
13218
|
+
if (!initial) this.$dispatch("tabs:change", {
|
13219
|
+
tabs: this
|
13220
|
+
});
|
13220
13221
|
},
|
13221
13222
|
isSelected (el) {
|
13222
13223
|
return this.store.activeTab === this._getRef(el);
|
@@ -13363,13 +13364,13 @@ function $6d64716f0b34fdf4$export$2e2bcd8739ae039(store) {
|
|
13363
13364
|
}
|
13364
13365
|
|
13365
13366
|
|
13366
|
-
$
|
13367
|
-
"code": $99486586f6691564$exports,
|
13367
|
+
$8827b5620b152958$exports = {
|
13368
13368
|
"button": $cbd28b10fa9798c7$exports,
|
13369
13369
|
"dimensions_display": $e398acaded942bbe$exports,
|
13370
|
-
"copy_button": $47a1c62621be0c54$exports,
|
13371
13370
|
"embed": $e1f51f020443edd4$exports,
|
13371
|
+
"code": $99486586f6691564$exports,
|
13372
13372
|
"filter": $e9904a14dabf652d$exports,
|
13373
|
+
"copy_button": $47a1c62621be0c54$exports,
|
13373
13374
|
"icon": $36506012e0c6e9e3$exports,
|
13374
13375
|
"nav": $d92d9d5253f84566$exports,
|
13375
13376
|
"params_editor": $b63b9c6d236b3f65$exports,
|
@@ -13523,7 +13524,7 @@ $caa9439642c6336c$export$2e2bcd8739ae039.store("settings", $96e0343bbb13096b$exp
|
|
13523
13524
|
// Components
|
13524
13525
|
$caa9439642c6336c$export$2e2bcd8739ae039.data("app", $d709d0f4027033b2$export$2e2bcd8739ae039);
|
13525
13526
|
[
|
13526
|
-
$
|
13527
|
+
$8827b5620b152958$exports,
|
13527
13528
|
$e4eab7529959b73b$exports,
|
13528
13529
|
$4979d2d897a1c01f$exports
|
13529
13530
|
].forEach((scripts)=>{
|