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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5efc30f722f9fff6377285d5b4e06a5f62e20e0a202eb19966ab6a7701999db2
4
- data.tar.gz: 4987e68865cf8ddfdc68838bfc1497c71118898c0607d0c5dd9701ccc754d406
3
+ metadata.gz: 0cb74b0126a7bf42c97800df69f030dbd43823a1e1d290b5da2ec363196376b8
4
+ data.tar.gz: 770bdeeac95946155bce5a7946cb4acd332729d649c0ffa891ba939e2bb3abba
5
5
  SHA512:
6
- metadata.gz: 27b85921801c7e88510e69ae88a0b6b093f9da9252910130b5ee7edbc89ecb9149a8b7d0a6c60b6993904e73448e64150a2756a936eeb1e3f61a4ab7d2acc40b
7
- data.tar.gz: 68d236bd6baba5c456cc090cd2faed45ef02300ba2d0913eae9d2087b0572d140653df035a65a28d29baf435459f67ea86aa1cb7142634c5154324540ac56e1f
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.lookbook.inspect_path(@example.path, @params),
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.lookbook.inspect_path(@example.path, @params),
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.lookbook.preview_path(@example.path, @params.merge(lookbook_embed: true)),
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 page_path(landing.lookup_path)
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
@@ -10,7 +10,7 @@ module Lookbook
10
10
  def index
11
11
  landing = Lookbook.pages.find(&:landing) || Lookbook.pages.first
12
12
  if landing.present?
13
- redirect_to page_path landing.lookup_path
13
+ redirect_to lookbook_page_path landing.lookup_path
14
14
  else
15
15
  show_404
16
16
  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 inspect_path params[:path]
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 inspect_path "#{params[:path]}/#{@preview.default_example.name}"
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 inspect_path(first_example.lookup_path) if first_example
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
- page_path(landing.lookup_path)
14
+ lookbook_page_path landing.lookup_path
15
15
  else
16
- home_path
16
+ lookbook_home_path
17
17
  end
18
18
  end
19
19
 
@@ -5,7 +5,7 @@ module Lookbook
5
5
  def page_path(id)
6
6
  page = id.is_a?(Page) ? id : Lookbook.pages.find(id)
7
7
  if page.present?
8
- lookbook.page_path page.lookup_path
8
+ lookbook_page_path page.lookup_path
9
9
  else
10
10
  Lookbook.logger.warn "Could not find page with id ':#{id}'"
11
11
  end
@@ -16,7 +16,7 @@
16
16
  size: :lg,
17
17
  icon: :chevron_left,
18
18
  tooltip: "Previous page",
19
- href: page_path(@previous_page.lookup_path),
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: page_path(@next_page.lookup_path),
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="<%= page_path @previous_page.lookup_path %>"
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="<%= page_path @next_page.lookup_path %>"
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: lookbook.preview_path(request.query_parameters.merge(lookbook_timestamp: Time.now)),
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: lookbook.preview_path(@example.lookup_path),
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: :home
6
+ root to: "application#index", as: :lookbook_home
7
7
 
8
- get "/#{Lookbook.config.page_route}", to: "pages#index", as: :page_index
9
- get "/#{Lookbook.config.page_route}/*path", to: "pages#show", as: :page
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: :preview
12
- get "/inspect/*path", to: "previews#show", as: :inspect
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: :inspect_legacy
14
+ get "/*path", to: "previews#show_legacy", as: :lookbook_inspect_legacy
15
15
  end
data/lib/lookbook/page.rb CHANGED
@@ -30,7 +30,7 @@ module Lookbook
30
30
  end
31
31
 
32
32
  def url_path
33
- page_path lookup_path
33
+ lookbook_page_path lookup_path
34
34
  end
35
35
 
36
36
  def full_path
@@ -69,7 +69,7 @@ module Lookbook
69
69
  end
70
70
 
71
71
  def url_path
72
- inspect_path lookup_path
72
+ lookbook_inspect_path lookup_path
73
73
  end
74
74
 
75
75
  def preview_paths
@@ -15,7 +15,7 @@ module Lookbook
15
15
  end
16
16
 
17
17
  def url_path
18
- inspect_path lookup_path
18
+ lookbook_inspect_path lookup_path
19
19
  end
20
20
 
21
21
  def label
@@ -10,7 +10,7 @@ module Lookbook
10
10
  end
11
11
 
12
12
  def url_path
13
- inspect_path lookup_path
13
+ lookbook_inspect_path lookup_path
14
14
  end
15
15
 
16
16
  def label
@@ -1,3 +1,3 @@
1
1
  module Lookbook
2
- VERSION = "1.0.0.beta.1"
2
+ VERSION = "1.0.0.beta.2"
3
3
  end
@@ -7849,7 +7849,17 @@ function $5439cede634b2921$var$toCamel(s) {
7849
7849
  }
7850
7850
 
7851
7851
 
7852
- var $730b795bb0498251$exports = {};
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 $99486586f6691564$exports = {};
11515
+ var $e398acaded942bbe$exports = {};
11506
11516
 
11507
- $parcel$defineInteropFlag($99486586f6691564$exports);
11517
+ $parcel$defineInteropFlag($e398acaded942bbe$exports);
11508
11518
 
11509
- $parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039);
11510
- function $99486586f6691564$export$2e2bcd8739ae039() {
11511
- return {};
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
- $730b795bb0498251$exports = {
13367
- "button": $cbd28b10fa9798c7$exports,
13366
+ $6c7bb428bd81c9cb$exports = {
13368
13367
  "code": $99486586f6691564$exports,
13369
- "copy_button": $47a1c62621be0c54$exports,
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
- $730b795bb0498251$exports,
13526
+ $6c7bb428bd81c9cb$exports,
13527
13527
  $e4eab7529959b73b$exports,
13528
13528
  $4979d2d897a1c01f$exports
13529
13529
  ].forEach((scripts)=>{