lookbook 1.0.0 → 1.0.1
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/components/lookbook/header/component.html.erb +4 -4
- data/app/components/lookbook/inspector_panel/component.rb +1 -2
- data/app/helpers/lookbook/component_helper.rb +4 -0
- data/app/views/lookbook/index.html.erb +1 -1
- data/lib/lookbook/version.rb +1 -1
- data/public/lookbook-assets/js/lookbook.js +37 -37
- data/public/lookbook-assets/js/lookbook.js.map +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ff67ef3eb53b5a6605d46fdf186f859709112f09debfc72bab1a3f766475ea7b
|
|
4
|
+
data.tar.gz: c592dfa672ad57776c5c9ffb38dafc82998c51ca68c02fcfe7b7bc980e519ccd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b0fc0d0a54945f24a543d18b44e1734453e166286823e85f17ed9f5d51235e3e4cd9733287089dc76c58617047fd4835a1051c5dbe8836c05fc8b1d7c36ec3f
|
|
7
|
+
data.tar.gz: 551d4744fb346cb835c53e26167f4a6e2fa71b612d2b212a7968b802775ac91655e15ac4f1ae4faf3d2fada0a95d7f7e1b7ecd581adb33b0ac49941cf508ccc1
|
data/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Lookbook
|
|
2
2
|
|
|
3
3
|
<div>
|
|
4
|
-
<a href="https://rubygems.org/gems/lookbook"><img src="https://img.shields.io/gem/v/lookbook
|
|
4
|
+
<a href="https://rubygems.org/gems/lookbook"><img src="https://img.shields.io/gem/v/lookbook" alt="Gem version"></a>
|
|
5
5
|
<a href="https://github.com/allmarkedup/lookbook/actions/workflows/ci.yml"><img src="https://github.com/allmarkedup/lookbook/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI status"></a>
|
|
6
6
|
</div>
|
|
7
7
|
<br>
|
|
8
8
|
|
|
9
|
-
A tool to help develop, test
|
|
9
|
+
A tool to help browse, develop, test & document [ViewComponents](https://viewcomponent.org/) in Ruby on Rails apps.
|
|
10
10
|
|
|
11
11
|
## Documentation
|
|
12
12
|
|
|
@@ -17,9 +17,9 @@ A tool to help develop, test and document [ViewComponents](https://viewcomponent
|
|
|
17
17
|
|
|
18
18
|
## Demo
|
|
19
19
|
|
|
20
|
-
**Online Demo:** [https://lookbook-demo-app
|
|
20
|
+
**Online Demo:** [https://lookbook-demo-app.herokuapp.com/lookbook](https://lookbook-demo-app.herokuapp.com/lookbook)
|
|
21
21
|
|
|
22
|
-
[](https://lookbook-demo-app
|
|
22
|
+
[](https://lookbook-demo-app.herokuapp.com/lookbook/)
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
## Development
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
<span class="opacity-70 mr-1">Lookbook</span>
|
|
47
47
|
<span class="mr-6">v<%= Lookbook::VERSION %></span>
|
|
48
48
|
<div class="flex items-center space-x-2">
|
|
49
|
-
|
|
50
|
-
<%= icon
|
|
51
|
-
</a
|
|
49
|
+
<a href="https://lookbook.build/guide" target="_blank" class="ml-auto opacity-70" title="Documentation">
|
|
50
|
+
<%= icon :book, size: 3 %>
|
|
51
|
+
</a>
|
|
52
52
|
<a href="https://github.com/allmarkedup/lookbook" target="_blank" class="ml-auto opacity-70" title="Github">
|
|
53
|
-
<%= icon
|
|
53
|
+
<%= icon :github, size: 3 %>
|
|
54
54
|
</a>
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
@@ -25,9 +25,8 @@ module Lookbook
|
|
|
25
25
|
css_parser.each_selector do |selector, declarations, specificity|
|
|
26
26
|
@panel_styles += "##{id} #{selector} { #{declarations} }\n"
|
|
27
27
|
end
|
|
28
|
-
style_tag.unlink
|
|
29
28
|
end
|
|
30
|
-
@panel_html =
|
|
29
|
+
@panel_html = content.gsub(/<style(?:\s[^>]*)?>.*<\/style>/, "").html_safe
|
|
31
30
|
end
|
|
32
31
|
end
|
|
33
32
|
@panel_html ||= content
|
|
@@ -6,6 +6,10 @@ module Lookbook
|
|
|
6
6
|
render Lookbook::Icon::Component.new(name: name, **attrs)
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
+
def code(**attrs, &block)
|
|
10
|
+
render Lookbook::Code::Component.new(**attrs), &block
|
|
11
|
+
end
|
|
12
|
+
|
|
9
13
|
def render_component(ref, **attrs, &block)
|
|
10
14
|
klass = component_class(ref)
|
|
11
15
|
comp = attrs.key?(:content) ? klass.new(**attrs.except(:content)).with_content(attrs[:content]) : klass.new(**attrs)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<% if Lookbook.previews? %>
|
|
8
8
|
<p>Select a preview from the nav to get started.</p>
|
|
9
9
|
<% else %>
|
|
10
|
-
<p><a class="underline" href="https://
|
|
10
|
+
<p><a class="underline" href="https://lookbook.build/guide/previews" target="_blank">Create a preview</a> to get started.</p>
|
|
11
11
|
<% end %>
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
data/lib/lookbook/version.rb
CHANGED
|
@@ -7701,7 +7701,7 @@ function $5439cede634b2921$var$toCamel(s) {
|
|
|
7701
7701
|
}
|
|
7702
7702
|
|
|
7703
7703
|
|
|
7704
|
-
var $
|
|
7704
|
+
var $730b795bb0498251$exports = {};
|
|
7705
7705
|
var $cbd28b10fa9798c7$exports = {};
|
|
7706
7706
|
|
|
7707
7707
|
$parcel$defineInteropFlag($cbd28b10fa9798c7$exports);
|
|
@@ -11364,39 +11364,6 @@ function $99486586f6691564$export$2e2bcd8739ae039() {
|
|
|
11364
11364
|
}
|
|
11365
11365
|
|
|
11366
11366
|
|
|
11367
|
-
var $e398acaded942bbe$exports = {};
|
|
11368
|
-
|
|
11369
|
-
$parcel$defineInteropFlag($e398acaded942bbe$exports);
|
|
11370
|
-
|
|
11371
|
-
$parcel$export($e398acaded942bbe$exports, "default", () => $e398acaded942bbe$export$2e2bcd8739ae039);
|
|
11372
|
-
|
|
11373
|
-
function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
|
11374
|
-
return {
|
|
11375
|
-
width: 0,
|
|
11376
|
-
height: 0,
|
|
11377
|
-
resizing: false,
|
|
11378
|
-
target: null,
|
|
11379
|
-
init () {
|
|
11380
|
-
this.target = document.querySelector(targetSelector);
|
|
11381
|
-
if (this.target) {
|
|
11382
|
-
this.width = Math.round(this.target.clientWidth);
|
|
11383
|
-
this.height = Math.round(this.target.clientHeight);
|
|
11384
|
-
this.createObserver();
|
|
11385
|
-
}
|
|
11386
|
-
},
|
|
11387
|
-
createObserver () {
|
|
11388
|
-
if (this.target) this.observer = (0, $9930d46698775b42$export$a2214cc2adb2dc44)(document.querySelector(targetSelector), ({ width: width , height: height })=>{
|
|
11389
|
-
this.width = width;
|
|
11390
|
-
this.height = height;
|
|
11391
|
-
});
|
|
11392
|
-
},
|
|
11393
|
-
tearDown () {
|
|
11394
|
-
if (this.observer) this.observer.disconnect();
|
|
11395
|
-
}
|
|
11396
|
-
};
|
|
11397
|
-
}
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
11367
|
var $47a1c62621be0c54$exports = {};
|
|
11401
11368
|
|
|
11402
11369
|
$parcel$defineInteropFlag($47a1c62621be0c54$exports);
|
|
@@ -11453,6 +11420,39 @@ function $47a1c62621be0c54$export$2e2bcd8739ae039() {
|
|
|
11453
11420
|
}
|
|
11454
11421
|
|
|
11455
11422
|
|
|
11423
|
+
var $e398acaded942bbe$exports = {};
|
|
11424
|
+
|
|
11425
|
+
$parcel$defineInteropFlag($e398acaded942bbe$exports);
|
|
11426
|
+
|
|
11427
|
+
$parcel$export($e398acaded942bbe$exports, "default", () => $e398acaded942bbe$export$2e2bcd8739ae039);
|
|
11428
|
+
|
|
11429
|
+
function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
|
11430
|
+
return {
|
|
11431
|
+
width: 0,
|
|
11432
|
+
height: 0,
|
|
11433
|
+
resizing: false,
|
|
11434
|
+
target: null,
|
|
11435
|
+
init () {
|
|
11436
|
+
this.target = document.querySelector(targetSelector);
|
|
11437
|
+
if (this.target) {
|
|
11438
|
+
this.width = Math.round(this.target.clientWidth);
|
|
11439
|
+
this.height = Math.round(this.target.clientHeight);
|
|
11440
|
+
this.createObserver();
|
|
11441
|
+
}
|
|
11442
|
+
},
|
|
11443
|
+
createObserver () {
|
|
11444
|
+
if (this.target) this.observer = (0, $9930d46698775b42$export$a2214cc2adb2dc44)(document.querySelector(targetSelector), ({ width: width , height: height })=>{
|
|
11445
|
+
this.width = width;
|
|
11446
|
+
this.height = height;
|
|
11447
|
+
});
|
|
11448
|
+
},
|
|
11449
|
+
tearDown () {
|
|
11450
|
+
if (this.observer) this.observer.disconnect();
|
|
11451
|
+
}
|
|
11452
|
+
};
|
|
11453
|
+
}
|
|
11454
|
+
|
|
11455
|
+
|
|
11456
11456
|
var $e1f51f020443edd4$exports = {};
|
|
11457
11457
|
|
|
11458
11458
|
$parcel$defineInteropFlag($e1f51f020443edd4$exports);
|
|
@@ -13210,11 +13210,11 @@ function $6d64716f0b34fdf4$export$2e2bcd8739ae039(store) {
|
|
|
13210
13210
|
}
|
|
13211
13211
|
|
|
13212
13212
|
|
|
13213
|
-
$
|
|
13213
|
+
$730b795bb0498251$exports = {
|
|
13214
13214
|
"button": $cbd28b10fa9798c7$exports,
|
|
13215
13215
|
"code": $99486586f6691564$exports,
|
|
13216
|
-
"dimensions_display": $e398acaded942bbe$exports,
|
|
13217
13216
|
"copy_button": $47a1c62621be0c54$exports,
|
|
13217
|
+
"dimensions_display": $e398acaded942bbe$exports,
|
|
13218
13218
|
"embed": $e1f51f020443edd4$exports,
|
|
13219
13219
|
"filter": $e9904a14dabf652d$exports,
|
|
13220
13220
|
"icon": $36506012e0c6e9e3$exports,
|
|
@@ -13367,7 +13367,7 @@ const $d73574cc5e9b9e72$var$prefix = window.APP_NAME;
|
|
|
13367
13367
|
// Components
|
|
13368
13368
|
(0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $d709d0f4027033b2$export$2e2bcd8739ae039));
|
|
13369
13369
|
[
|
|
13370
|
-
$
|
|
13370
|
+
$730b795bb0498251$exports,
|
|
13371
13371
|
$e4eab7529959b73b$exports,
|
|
13372
13372
|
$4979d2d897a1c01f$exports
|
|
13373
13373
|
].forEach((scripts)=>{
|