lookbook 1.0.0.beta.1 → 1.0.0.beta.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.
- checksums.yaml +4 -4
- data/app/components/lookbook/embed/component.html.erb +3 -3
- data/app/controllers/lookbook/application_controller.rb +1 -1
- data/app/controllers/lookbook/pages_controller.rb +1 -1
- data/app/controllers/lookbook/previews_controller.rb +3 -3
- data/app/helpers/lookbook/application_helper.rb +2 -2
- data/app/helpers/lookbook/page_helper.rb +1 -1
- data/app/views/layouts/lookbook/page.html.erb +2 -2
- data/app/views/lookbook/pages/show.html.erb +3 -3
- data/app/views/lookbook/previews/panels/_preview.html.erb +1 -1
- data/app/views/lookbook/previews/show.html.erb +1 -1
- data/config/routes.rb +6 -6
- data/lib/lookbook/page.rb +1 -1
- data/lib/lookbook/preview.rb +1 -1
- data/lib/lookbook/preview_example.rb +1 -1
- data/lib/lookbook/preview_group.rb +1 -1
- data/lib/lookbook/version.rb +1 -1
- data/public/lookbook-assets/js/lookbook.js +43 -43
- 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: 0cb74b0126a7bf42c97800df69f030dbd43823a1e1d290b5da2ec363196376b8
|
4
|
+
data.tar.gz: 770bdeeac95946155bce5a7946cb4acd332729d649c0ffa891ba939e2bb3abba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 227e0525ea5700542f1a74b164e5e1da39c076b75ce9073ba05f30e89a72c7a44e350e5d0b9c1850a8ff992f64492503f16ebc1d7e354a010637d1741b619795
|
7
|
+
data.tar.gz: 9ee1d1e0d3e7589dd76d81e425d87f70ed7dd1bc7090c6006a659e9954168b1fdd5c4e465451caaa2d1218b12e1e2b81f525deaef7a5d17d6ac22e9bc6ec9121
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<% toolbar.section align: :right, divide: :left do %>
|
11
11
|
<%= render_component :button_group do |group| %>
|
12
12
|
<% group.button icon: :eye,
|
13
|
-
href: helpers.
|
13
|
+
href: helpers.lookbook_inspect_path(@example.path, @params),
|
14
14
|
tooltip: "View in Inspector" %>
|
15
15
|
<% group.button icon: :external_link,
|
16
|
-
href: helpers.
|
16
|
+
href: helpers.lookbook_inspect_path(@example.path, @params),
|
17
17
|
tooltip: "Open in new window",
|
18
18
|
target: "_blank" %>
|
19
19
|
<% end %>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
@viewport:resize-progress="resizeIframe"
|
28
28
|
@viewport:resize-complete="resizeIframe">
|
29
29
|
<%= render_component :viewport,
|
30
|
-
src: helpers.
|
30
|
+
src: helpers.lookbook_preview_path(@example.path, @params.merge(lookbook_embed: true)),
|
31
31
|
alpine_data: "store",
|
32
32
|
resize_height: false,
|
33
33
|
max_height: @max_height,
|
@@ -15,7 +15,7 @@ module Lookbook
|
|
15
15
|
def index
|
16
16
|
landing = Lookbook.pages.find(&:landing) || Lookbook.pages.first
|
17
17
|
if landing.present?
|
18
|
-
redirect_to
|
18
|
+
redirect_to lookbook_page_path(landing.lookup_path)
|
19
19
|
else
|
20
20
|
render "lookbook/index", layout: Lookbook.previews.any? ? "lookbook/application" : "lookbook/shell"
|
21
21
|
end
|
@@ -44,7 +44,7 @@ module Lookbook
|
|
44
44
|
|
45
45
|
def show_legacy
|
46
46
|
Lookbook.logger.warn("Legacy URL path detected. These paths are deprecated and will be removed in a future version")
|
47
|
-
redirect_to
|
47
|
+
redirect_to lookbook_inspect_path params[:path]
|
48
48
|
end
|
49
49
|
|
50
50
|
private
|
@@ -54,13 +54,13 @@ module Lookbook
|
|
54
54
|
if @example.present?
|
55
55
|
@preview = @example.preview
|
56
56
|
if params[:path] == @preview&.lookup_path
|
57
|
-
redirect_to
|
57
|
+
redirect_to lookbook_inspect_path "#{params[:path]}/#{@preview.default_example.name}"
|
58
58
|
end
|
59
59
|
else
|
60
60
|
@preview = Lookbook.previews.find(params[:path])
|
61
61
|
if @preview.present?
|
62
62
|
first_example = @preview.examples.first
|
63
|
-
redirect_to
|
63
|
+
redirect_to lookbook_inspect_path(first_example.lookup_path) if first_example
|
64
64
|
else
|
65
65
|
@preview = Lookbook.previews.find(path_segments.slice(0, path_segments.size - 1).join("/"))
|
66
66
|
end
|
@@ -11,9 +11,9 @@ module Lookbook
|
|
11
11
|
def landing_path
|
12
12
|
landing = Lookbook.pages.find(&:landing) || Lookbook.pages.first
|
13
13
|
if landing.present?
|
14
|
-
|
14
|
+
lookbook_page_path landing.lookup_path
|
15
15
|
else
|
16
|
-
|
16
|
+
lookbook_home_path
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
size: :lg,
|
17
17
|
icon: :chevron_left,
|
18
18
|
tooltip: "Previous page",
|
19
|
-
href:
|
19
|
+
href: lookbook_page_path(@previous_page.lookup_path),
|
20
20
|
class: "pr-0.5 bg-transparent" %>
|
21
21
|
<% else %>
|
22
22
|
<%= render_component :button,
|
@@ -31,7 +31,7 @@
|
|
31
31
|
size: :lg,
|
32
32
|
icon: :chevron_right,
|
33
33
|
tooltip: "Next page",
|
34
|
-
href:
|
34
|
+
href: lookbook_page_path(@next_page.lookup_path),
|
35
35
|
class: "pl-0.5 bg-transparent" %>
|
36
36
|
<% else %>
|
37
37
|
<%= render_component :button,
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<% if @page.sections.any? %>
|
14
|
-
<%= render_component :page_tabs, markdown: false do |page_tabs| %>
|
14
|
+
<%= render_component :page_tabs, markdown: false, class: "mt-6" do |page_tabs| %>
|
15
15
|
<% @page.sections.each do |section| %>
|
16
16
|
<% page_tabs.tab name: "page-section-#{section.name}", label: section.label do %>
|
17
17
|
<%= page_controller.render_page(section) %>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% if @page.footer? && @pages.many? %>
|
24
24
|
<footer class="flex items-center justify-between border-t border-gray-300 mt-12 pt-8 pb-10 ">
|
25
25
|
<% if @previous_page %>
|
26
|
-
<a href="<%=
|
26
|
+
<a href="<%= lookbook_page_path @previous_page.lookup_path %>"
|
27
27
|
class="flex items-center flex-none">
|
28
28
|
<%= render_component :icon, name: :arrow_left, size: 4, class: "hover:text-indigo-800" %>
|
29
29
|
<span class="ml-2 underline"><%= @previous_page.title %></span>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
<% end %>
|
32
32
|
|
33
33
|
<% if @next_page %>
|
34
|
-
<a href="<%=
|
34
|
+
<a href="<%= lookbook_page_path @next_page.lookup_path %>"
|
35
35
|
class="flex items-center flex-none ml-auto">
|
36
36
|
<span class="mr-2 underline"><%= @next_page.title %></span>
|
37
37
|
<%= render_component :icon, name: :arrow_right, size: 4, class: "hover:text-indigo-800" %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= render_component :viewport,
|
2
|
-
src:
|
2
|
+
src: lookbook_preview_path(request.query_parameters.merge(lookbook_timestamp: Time.now)),
|
3
3
|
alpine_data: "$store.inspector.main",
|
4
4
|
class: "-inset-px relative",
|
5
5
|
style: "width: calc(100% + 2px); height: calc(100% + 2px)"
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"@click.stop": "startSpin(); $dispatch('viewport:reload'); stopSpin(500);" %>
|
39
39
|
|
40
40
|
<% group.button icon: :external_link,
|
41
|
-
href:
|
41
|
+
href: lookbook_preview_path(@example.lookup_path),
|
42
42
|
tooltip: "Open preview in new window",
|
43
43
|
target: "_blank" %>
|
44
44
|
|
data/config/routes.rb
CHANGED
@@ -3,13 +3,13 @@ Lookbook::Engine.routes.draw do
|
|
3
3
|
mount Lookbook::Engine.websocket => Lookbook.config.cable_mount_path
|
4
4
|
end
|
5
5
|
|
6
|
-
root to: "application#index", as: :
|
6
|
+
root to: "application#index", as: :lookbook_home
|
7
7
|
|
8
|
-
get "/#{Lookbook.config.page_route}", to: "pages#index", as: :
|
9
|
-
get "/#{Lookbook.config.page_route}/*path", to: "pages#show", as: :
|
8
|
+
get "/#{Lookbook.config.page_route}", to: "pages#index", as: :lookbook_page_index
|
9
|
+
get "/#{Lookbook.config.page_route}/*path", to: "pages#show", as: :lookbook_page
|
10
10
|
|
11
|
-
get "/preview/*path", to: "previews#preview", as: :
|
12
|
-
get "/inspect/*path", to: "previews#show", as: :
|
11
|
+
get "/preview/*path", to: "previews#preview", as: :lookbook_preview
|
12
|
+
get "/inspect/*path", to: "previews#show", as: :lookbook_inspect
|
13
13
|
|
14
|
-
get "/*path", to: "previews#show_legacy", as: :
|
14
|
+
get "/*path", to: "previews#show_legacy", as: :lookbook_inspect_legacy
|
15
15
|
end
|
data/lib/lookbook/page.rb
CHANGED
data/lib/lookbook/preview.rb
CHANGED
data/lib/lookbook/version.rb
CHANGED
@@ -7849,7 +7849,17 @@ function $5439cede634b2921$var$toCamel(s) {
|
|
7849
7849
|
}
|
7850
7850
|
|
7851
7851
|
|
7852
|
-
var $
|
7852
|
+
var $6c7bb428bd81c9cb$exports = {};
|
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
|
+
|
7853
7863
|
var $cbd28b10fa9798c7$exports = {};
|
7854
7864
|
|
7855
7865
|
$parcel$defineInteropFlag($cbd28b10fa9798c7$exports);
|
@@ -11502,13 +11512,36 @@ function $cbd28b10fa9798c7$export$2e2bcd8739ae039() {
|
|
11502
11512
|
}
|
11503
11513
|
|
11504
11514
|
|
11505
|
-
var $
|
11515
|
+
var $e398acaded942bbe$exports = {};
|
11506
11516
|
|
11507
|
-
$parcel$defineInteropFlag($
|
11517
|
+
$parcel$defineInteropFlag($e398acaded942bbe$exports);
|
11508
11518
|
|
11509
|
-
$parcel$export($
|
11510
|
-
|
11511
|
-
|
11519
|
+
$parcel$export($e398acaded942bbe$exports, "default", () => $e398acaded942bbe$export$2e2bcd8739ae039);
|
11520
|
+
|
11521
|
+
function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
11522
|
+
return {
|
11523
|
+
width: 0,
|
11524
|
+
height: 0,
|
11525
|
+
resizing: false,
|
11526
|
+
target: null,
|
11527
|
+
init () {
|
11528
|
+
this.target = document.querySelector(targetSelector);
|
11529
|
+
if (this.target) {
|
11530
|
+
this.width = Math.round(this.target.clientWidth);
|
11531
|
+
this.height = Math.round(this.target.clientHeight);
|
11532
|
+
this.createObserver();
|
11533
|
+
}
|
11534
|
+
},
|
11535
|
+
createObserver () {
|
11536
|
+
if (this.target) this.observer = $9930d46698775b42$export$a2214cc2adb2dc44(document.querySelector(targetSelector), ({ width: width , height: height })=>{
|
11537
|
+
this.width = width;
|
11538
|
+
this.height = height;
|
11539
|
+
});
|
11540
|
+
},
|
11541
|
+
tearDown () {
|
11542
|
+
if (this.observer) this.observer.disconnect();
|
11543
|
+
}
|
11544
|
+
};
|
11512
11545
|
}
|
11513
11546
|
|
11514
11547
|
|
@@ -11568,39 +11601,6 @@ function $47a1c62621be0c54$export$2e2bcd8739ae039() {
|
|
11568
11601
|
}
|
11569
11602
|
|
11570
11603
|
|
11571
|
-
var $e398acaded942bbe$exports = {};
|
11572
|
-
|
11573
|
-
$parcel$defineInteropFlag($e398acaded942bbe$exports);
|
11574
|
-
|
11575
|
-
$parcel$export($e398acaded942bbe$exports, "default", () => $e398acaded942bbe$export$2e2bcd8739ae039);
|
11576
|
-
|
11577
|
-
function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
11578
|
-
return {
|
11579
|
-
width: 0,
|
11580
|
-
height: 0,
|
11581
|
-
resizing: false,
|
11582
|
-
target: null,
|
11583
|
-
init () {
|
11584
|
-
this.target = document.querySelector(targetSelector);
|
11585
|
-
if (this.target) {
|
11586
|
-
this.width = Math.round(this.target.clientWidth);
|
11587
|
-
this.height = Math.round(this.target.clientHeight);
|
11588
|
-
this.createObserver();
|
11589
|
-
}
|
11590
|
-
},
|
11591
|
-
createObserver () {
|
11592
|
-
if (this.target) this.observer = $9930d46698775b42$export$a2214cc2adb2dc44(document.querySelector(targetSelector), ({ width: width , height: height })=>{
|
11593
|
-
this.width = width;
|
11594
|
-
this.height = height;
|
11595
|
-
});
|
11596
|
-
},
|
11597
|
-
tearDown () {
|
11598
|
-
if (this.observer) this.observer.disconnect();
|
11599
|
-
}
|
11600
|
-
};
|
11601
|
-
}
|
11602
|
-
|
11603
|
-
|
11604
11604
|
var $e1f51f020443edd4$exports = {};
|
11605
11605
|
|
11606
11606
|
$parcel$defineInteropFlag($e1f51f020443edd4$exports);
|
@@ -13363,11 +13363,11 @@ function $6d64716f0b34fdf4$export$2e2bcd8739ae039(store) {
|
|
13363
13363
|
}
|
13364
13364
|
|
13365
13365
|
|
13366
|
-
$
|
13367
|
-
"button": $cbd28b10fa9798c7$exports,
|
13366
|
+
$6c7bb428bd81c9cb$exports = {
|
13368
13367
|
"code": $99486586f6691564$exports,
|
13369
|
-
"
|
13368
|
+
"button": $cbd28b10fa9798c7$exports,
|
13370
13369
|
"dimensions_display": $e398acaded942bbe$exports,
|
13370
|
+
"copy_button": $47a1c62621be0c54$exports,
|
13371
13371
|
"embed": $e1f51f020443edd4$exports,
|
13372
13372
|
"filter": $e9904a14dabf652d$exports,
|
13373
13373
|
"icon": $36506012e0c6e9e3$exports,
|
@@ -13523,7 +13523,7 @@ $caa9439642c6336c$export$2e2bcd8739ae039.store("settings", $96e0343bbb13096b$exp
|
|
13523
13523
|
// Components
|
13524
13524
|
$caa9439642c6336c$export$2e2bcd8739ae039.data("app", $d709d0f4027033b2$export$2e2bcd8739ae039);
|
13525
13525
|
[
|
13526
|
-
$
|
13526
|
+
$6c7bb428bd81c9cb$exports,
|
13527
13527
|
$e4eab7529959b73b$exports,
|
13528
13528
|
$4979d2d897a1c01f$exports
|
13529
13529
|
].forEach((scripts)=>{
|