lookbook 2.3.12 → 2.3.13
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/button/component.html.erb +11 -12
- data/app/components/lookbook/button/component.js +19 -31
- data/app/components/lookbook/button/component.rb +4 -0
- data/app/components/lookbook/button_group/component.html.erb +1 -1
- data/app/components/lookbook/code/component.html.erb +1 -1
- data/app/components/lookbook/copy_button/component.html.erb +1 -1
- data/app/components/lookbook/debug_menu/component.html.erb +1 -1
- data/app/components/lookbook/dimensions_display/component.html.erb +2 -2
- data/app/components/lookbook/display_options/editor/component.html.erb +2 -2
- data/app/components/lookbook/display_options/field/component.html.erb +1 -1
- data/app/components/lookbook/embed/component.html.erb +1 -1
- data/app/components/lookbook/file_source/component.html.erb +1 -1
- data/app/components/lookbook/icon_button/component.html.erb +2 -2
- data/app/components/lookbook/inspector_panel/component.html.erb +1 -1
- data/app/components/lookbook/logo/component.html.erb +1 -1
- data/app/components/lookbook/message/component.html.erb +1 -1
- data/app/components/lookbook/nav/component.html.erb +1 -1
- data/app/components/lookbook/nav/directory/component.html.erb +1 -1
- data/app/components/lookbook/nav/entity/component.html.erb +1 -1
- data/app/components/lookbook/page_tabs/component.html.erb +1 -1
- data/app/components/lookbook/params/editor/component.html.erb +1 -1
- data/app/components/lookbook/prose/component.html.erb +1 -1
- data/app/components/lookbook/split_layout/component.html.erb +1 -1
- data/app/components/lookbook/tab_panels/component.html.erb +1 -1
- data/app/components/lookbook/tab_panels/panel/component.html.erb +1 -1
- data/app/components/lookbook/tabs/component.html.erb +1 -1
- data/app/components/lookbook/tabs/dropdown_tab/component.html.erb +1 -1
- data/app/components/lookbook/tabs/tab/component.html.erb +1 -1
- data/app/components/lookbook/text_button/component.html.erb +2 -2
- data/app/components/lookbook/toolbar/component.html.erb +1 -1
- data/app/controllers/lookbook/application_controller.rb +17 -0
- data/app/views/layouts/lookbook/application.html.erb +3 -3
- data/app/views/layouts/lookbook/embed.html.erb +1 -1
- data/app/views/lookbook/embeds/show.html.erb +1 -1
- data/app/views/lookbook/errors/default.html.erb +1 -1
- data/app/views/lookbook/errors/not_found.html.erb +1 -1
- data/app/views/lookbook/index.html.erb +1 -1
- data/app/views/lookbook/inspector/inputs/_color.html.erb +1 -1
- data/app/views/lookbook/inspector/inputs/_range.html.erb +1 -1
- data/app/views/lookbook/inspector/inputs/_select.html.erb +1 -1
- data/app/views/lookbook/inspector/inputs/_text.html.erb +1 -1
- data/app/views/lookbook/inspector/inputs/_text_two_step.html.erb +1 -1
- data/app/views/lookbook/inspector/inputs/_textarea.html.erb +1 -1
- data/app/views/lookbook/inspector/panels/_notes.html.erb +1 -1
- data/app/views/lookbook/inspector/panels/_output.html.erb +1 -1
- data/app/views/lookbook/inspector/panels/_preview.html.erb +1 -1
- data/app/views/lookbook/inspector/panels/_source.html.erb +1 -1
- data/app/views/lookbook/inspector/show.html.erb +4 -4
- data/app/views/lookbook/pages/show.html.erb +1 -1
- data/app/views/lookbook/partials/_iframe_content_scripts.html.erb +1 -1
- data/app/views/lookbook/partials/_user_styles.html.erb +1 -1
- data/app/views/lookbook/previews/group.html.erb +1 -1
- data/app/views/lookbook/previews/preview.html.erb +3 -3
- data/app/views/lookbook/previews/show.html.erb +1 -1
- data/config/app.yml +0 -1
- data/lib/lookbook/preview_parser.rb +1 -1
- data/lib/lookbook/services/markdown_renderer.rb +12 -4
- data/lib/lookbook/version.rb +1 -1
- data/public/lookbook-assets/css/lookbook.css +74 -99
- data/public/lookbook-assets/css/lookbook.css.map +1 -1
- data/public/lookbook-assets/js/iframe.js +15 -6
- data/public/lookbook-assets/js/iframe.js.map +1 -1
- data/public/lookbook-assets/js/index.js +539 -399
- data/public/lookbook-assets/js/index.js.map +1 -1
- data/public/lookbook-assets/js/lookbook.js +26 -8
- 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: 6690e132c2afade65dabcdd620bf4d8e67f6bfcbacd8d94ad5f156d443417eb9
|
4
|
+
data.tar.gz: fa40a220f164cef926db2e1ce4a6be8681ccac8069149b49d791e58157e1a2a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6590230a593eccba2833f205758255543ae6fdb4afea7ccc656909d7426a0032dc67163dfcb412c000c0d7b1fb78bc55070d4e738d05068d9bb6a21b6154166d
|
7
|
+
data.tar.gz: cb3f413449f297e41ec1a6706b11dcfb3589631a70252f4220466dcda5ade1e9ae8b909627ad923de8c9aa5471397085fcb50cbc6cacf81348cbfaf550ceaa02
|
@@ -1,18 +1,17 @@
|
|
1
|
-
<%=
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<% end %>
|
1
|
+
<div class="contents" key="<%= key %>">
|
2
|
+
<%= lookbook_render button_component.new(
|
3
|
+
id: id,
|
4
|
+
icon: icon,
|
5
|
+
**button_attrs,
|
6
|
+
"x-on:keydown.esc.stop.document": "hideDropdown") do %>
|
7
|
+
<%= content %>
|
8
|
+
<% end %>
|
9
9
|
|
10
|
-
<% if dropdown? %>
|
11
|
-
|
12
|
-
<div data-dropdown-id="<%= id %>">
|
10
|
+
<% if dropdown? %>
|
11
|
+
<div data-dropdown-id="<%= id %>" hidden>
|
13
12
|
<div class="divide-y divide-lookbook-divider text-left">
|
14
13
|
<%= dropdown %>
|
15
14
|
</div>
|
16
15
|
</div>
|
17
16
|
<% end %>
|
18
|
-
|
17
|
+
</div>
|
@@ -6,12 +6,7 @@ export default function buttonComponent() {
|
|
6
6
|
let dropdown = null;
|
7
7
|
|
8
8
|
return {
|
9
|
-
updateAfterNavigate: true,
|
10
|
-
|
11
9
|
init() {
|
12
|
-
this.updateAfterNavigate =
|
13
|
-
this.$el.dataset.updateAfterNavigate !== "false";
|
14
|
-
|
15
10
|
if (this.$refs.tooltip) {
|
16
11
|
tooltip = initTooltip(this, {
|
17
12
|
target: this.$refs.icon,
|
@@ -19,24 +14,28 @@ export default function buttonComponent() {
|
|
19
14
|
}
|
20
15
|
|
21
16
|
if (this.dropdownContent) {
|
22
|
-
|
23
|
-
content: this.dropdownContent,
|
24
|
-
trigger: "click",
|
25
|
-
theme: "menu",
|
26
|
-
triggerTarget: this.$el,
|
27
|
-
interactive: true,
|
28
|
-
zIndex: 99999,
|
29
|
-
onShow: () => {
|
30
|
-
if (!this.$store.settings.showTooltips) {
|
31
|
-
return false;
|
32
|
-
}
|
33
|
-
this.$dispatch("dropdown:show", { dropdown: this });
|
34
|
-
},
|
35
|
-
onHide: () => this.$dispatch("dropdown:hide", { dropdown: this }),
|
36
|
-
});
|
17
|
+
this.initDropdown();
|
37
18
|
}
|
38
19
|
},
|
39
20
|
|
21
|
+
initDropdown() {
|
22
|
+
dropdown = tippy(this.$el, {
|
23
|
+
content: this.dropdownContent,
|
24
|
+
trigger: "click",
|
25
|
+
theme: "menu",
|
26
|
+
triggerTarget: this.$el,
|
27
|
+
interactive: true,
|
28
|
+
zIndex: 99999,
|
29
|
+
onShow: () => {
|
30
|
+
if (!this.$store.settings.showTooltips) {
|
31
|
+
return false;
|
32
|
+
}
|
33
|
+
this.$dispatch("dropdown:show", { dropdown: this });
|
34
|
+
},
|
35
|
+
onHide: () => this.$dispatch("dropdown:hide", { dropdown: this }),
|
36
|
+
});
|
37
|
+
},
|
38
|
+
|
40
39
|
get dropdownContent() {
|
41
40
|
if (this.$root && this.$root.id) {
|
42
41
|
const dropdown = document.querySelector(
|
@@ -53,17 +52,6 @@ export default function buttonComponent() {
|
|
53
52
|
}
|
54
53
|
},
|
55
54
|
|
56
|
-
updateDropdown() {
|
57
|
-
if (dropdown) {
|
58
|
-
dropdown.hide();
|
59
|
-
if (this.updateAfterNavigate) {
|
60
|
-
this.$nextTick(() => {
|
61
|
-
dropdown.setContent(this.dropdownContent);
|
62
|
-
});
|
63
|
-
}
|
64
|
-
}
|
65
|
-
},
|
66
|
-
|
67
55
|
startSpin() {
|
68
56
|
this._spinning = true;
|
69
57
|
},
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= render_component_tag class: "flex items-center text-xs font-mono space-x-1 transition",
|
2
|
-
":class":"{'!opacity-100': resizing}",
|
2
|
+
"x-bind:class":"{'!opacity-100': resizing}",
|
3
3
|
"x-on:viewport:resize-start.window": "resizing = true",
|
4
4
|
"x-on:viewport:resize-complete.window": "resizing = false",
|
5
5
|
"x-on:dom:update-start.window": "tearDown",
|
@@ -8,4 +8,4 @@
|
|
8
8
|
<span x-text="`${width}px`"></span>
|
9
9
|
<span class="opacity-70">x</span>
|
10
10
|
<span x-text="`${height}px`"></span>
|
11
|
-
<% end %>
|
11
|
+
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= render_component_tag class: "px-2" do %>
|
2
2
|
<% if fields.many? %>
|
3
|
-
<%= lookbook_render :button, id: "display-options-dropdown-button", icon: :settings, tooltip: "Display options"
|
3
|
+
<%= lookbook_render :button, id: "display-options-dropdown-button", icon: :settings, tooltip: "Display options" do |button| %>
|
4
4
|
<% button.with_dropdown do %>
|
5
5
|
<div class="p-3 space-y-3">
|
6
6
|
<%= safe_join(fields) %>
|
@@ -10,4 +10,4 @@
|
|
10
10
|
<% else %>
|
11
11
|
<%= safe_join(fields) %>
|
12
12
|
<% end %>
|
13
|
-
<% end %>
|
13
|
+
<% end %>
|
@@ -11,10 +11,10 @@
|
|
11
11
|
disabled: disabled,
|
12
12
|
aria: { label: tooltip } do %>
|
13
13
|
<span x-ref="icon">
|
14
|
-
<%= icons.present? ? safe_join(icons) : (lookbook_render(:icon, name: icon, size: icon_size, ":class": "{'animate-spin': _spinning}") if icon) %>
|
14
|
+
<%= icons.present? ? safe_join(icons) : (lookbook_render(:icon, name: icon, size: icon_size, "x-bind:class": "{'animate-spin': _spinning}") if icon) %>
|
15
15
|
</span>
|
16
16
|
<% if tooltip %>
|
17
17
|
<label class="hidden" x-ref="tooltip"><%= tooltip %></label>
|
18
18
|
<% end %>
|
19
19
|
<%= content %>
|
20
|
-
<% end %>
|
20
|
+
<% end %>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"py-2 text-base": @theme == :page,
|
9
9
|
}
|
10
10
|
],
|
11
|
-
":class": "{
|
11
|
+
"x-bind:class": "{
|
12
12
|
'border-lookbook-tabs-border-active': isSelected($el),
|
13
13
|
'border-transparent text-lookbook-tabs-text hover:text-lookbook-tabs-text-hover': !isSelected($el),
|
14
14
|
'hidden': visibleTabsCount >= #{@position}
|
@@ -9,7 +9,7 @@
|
|
9
9
|
"px-2 text-lg relative -bottom-px": @theme == :page,
|
10
10
|
}
|
11
11
|
],
|
12
|
-
":class": "{
|
12
|
+
"x-bind:class": "{
|
13
13
|
'border-lookbook-tabs-border-active': isSelected($el),
|
14
14
|
'border-transparent text-lookbook-tabs-text hover:text-lookbook-tabs-text-hover': !isSelected($el),
|
15
15
|
'!text-lookbook-tabs-text-disabled': isDisabled($el),
|
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
<span class="flex items-center space-x-2 justify-center">
|
15
15
|
<span x-ref="icon">
|
16
|
-
<%= icons.present? ? safe_join(icons) : (lookbook_render(:icon, name: icon, size: icon_size, ":class": "{'animate-spin': _spinning}") if icon) %>
|
16
|
+
<%= icons.present? ? safe_join(icons) : (lookbook_render(:icon, name: icon, size: icon_size, "x-bind:class": "{'animate-spin': _spinning}") if icon) %>
|
17
17
|
</span>
|
18
18
|
<% if content %>
|
19
19
|
<span><%= content %></span>
|
@@ -23,4 +23,4 @@
|
|
23
23
|
<% if tooltip %>
|
24
24
|
<label class="hidden" x-ref="tooltip"><%= tooltip %></label>
|
25
25
|
<% end %>
|
26
|
-
<% end %>
|
26
|
+
<% end %>
|
@@ -10,6 +10,9 @@ module Lookbook
|
|
10
10
|
helper Lookbook::ApplicationHelper
|
11
11
|
helper Lookbook::UiElementsHelper
|
12
12
|
|
13
|
+
before_action :disable_annotations
|
14
|
+
after_action :restore_annotations
|
15
|
+
|
13
16
|
before_action :assign_theme_overrides
|
14
17
|
before_action :assign_instance_vars
|
15
18
|
|
@@ -37,6 +40,20 @@ module Lookbook
|
|
37
40
|
|
38
41
|
protected
|
39
42
|
|
43
|
+
def disable_annotations
|
44
|
+
return unless ActionView::Base.respond_to?(:annotate_rendered_view_with_filenames)
|
45
|
+
|
46
|
+
@original_annotations_value = ActionView::Base.annotate_rendered_view_with_filenames
|
47
|
+
ActionView::Base.annotate_rendered_view_with_filenames = false
|
48
|
+
end
|
49
|
+
|
50
|
+
def restore_annotations
|
51
|
+
return if @original_annotations_value.nil?
|
52
|
+
|
53
|
+
ActionView::Base.annotate_rendered_view_with_filenames = @original_annotations_value
|
54
|
+
@original_annotations_value = nil
|
55
|
+
end
|
56
|
+
|
40
57
|
def assign_theme_overrides
|
41
58
|
@theme_overrides ||= Engine.theme.to_css
|
42
59
|
end
|
@@ -22,10 +22,10 @@
|
|
22
22
|
|
23
23
|
<%= lookbook_render :split_layout,
|
24
24
|
alpine_data: "$store.layout.main",
|
25
|
-
":class": "$store.layout.mobile && '!block'" do |layout| %>
|
25
|
+
"x-bind:class": "$store.layout.mobile && '!block'" do |layout| %>
|
26
26
|
|
27
27
|
<% layout.with_pane id: "app-sidebar", class: "flex flex-col bg-lookbook-sidebar-bg relative translate-x-0",
|
28
|
-
":class": "{
|
28
|
+
"x-bind:class": "{
|
29
29
|
'transition': $store.layout.mobile,
|
30
30
|
'translate-x-full': $store.layout.mobile && sidebarHidden,
|
31
31
|
'!absolute right-0 bottom-0 top-[40px] h-[calc(100%_-_40px)] w-full max-w-[420px] z-[1001] border-l border-lookbook-divider': $store.layout.mobile
|
@@ -93,7 +93,7 @@
|
|
93
93
|
<% end %>
|
94
94
|
<% end %>
|
95
95
|
|
96
|
-
<% layout.with_pane id: "app-main", class: "overflow-hidden h-full", ":class": "$store.layout.mobile && 'w-screen'" do %>
|
96
|
+
<% layout.with_pane id: "app-main", class: "overflow-hidden h-full", "x-bind:class": "$store.layout.mobile && 'w-screen'" do %>
|
97
97
|
<%= content_for?(:main) ? yield(:main) : yield %>
|
98
98
|
<% end %>
|
99
99
|
<% end %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%= lookbook_render :split_layout,
|
3
3
|
id: "inspector",
|
4
4
|
alpine_data: "$store.layout.inspector",
|
5
|
-
":class": "($store.inspector.drawer.hidden || #{@drawer_panels.none?}) && '!grid-rows-[1fr] !grid-cols-[1fr]'",
|
5
|
+
"x-bind:class": "($store.inspector.drawer.hidden || #{@drawer_panels.none?}) && '!grid-rows-[1fr] !grid-cols-[1fr]'",
|
6
6
|
data: {
|
7
7
|
"preview-target": @target.id
|
8
8
|
} do |layout| %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"x-effect": "forceOrientation = (layoutWidth < $store.inspector.minVerticalSplitWidth) ? 'horizontal' : null" do %>
|
12
12
|
|
13
13
|
<%= lookbook_render :toolbar, id: "main-toolbar" do |toolbar| %>
|
14
|
-
<% toolbar.with_section ":class": "layoutResizing && 'overflow-hidden'" do %>
|
14
|
+
<% toolbar.with_section "x-bind:class": "layoutResizing && 'overflow-hidden'" do %>
|
15
15
|
<%= lookbook_render :tabs, alpine_data: "$store.inspector.main", id: "inspector-tabs-main" do |tabs| %>
|
16
16
|
<%= @main_panels.each do |panel| %>
|
17
17
|
<% tabs.with_tab name: panel.name,
|
@@ -99,7 +99,7 @@
|
|
99
99
|
"x-show": "!$store.inspector.drawer.hidden && #{@drawer_panels.any?}" do %>
|
100
100
|
|
101
101
|
<%= lookbook_render :toolbar, id: "drawer-toolbar" do |toolbar| %>
|
102
|
-
<% toolbar.with_section ":class": "layoutResizing && 'overflow-hidden'" do %>
|
102
|
+
<% toolbar.with_section "x-bind:class": "layoutResizing && 'overflow-hidden'" do %>
|
103
103
|
<%= lookbook_render :tabs, alpine_data: "$store.inspector.drawer", id: "inspector-tabs-drawer" do |tabs| %>
|
104
104
|
<%= @drawer_panels.each do |panel| %>
|
105
105
|
<% tabs.with_tab name: panel.name,
|
@@ -133,7 +133,7 @@
|
|
133
133
|
tooltip: "Pin drawer on right",
|
134
134
|
"x-on:click": "switchOrientation",
|
135
135
|
"x-show": "horizontal",
|
136
|
-
":class": "{'pointer-events-none opacity-50 !cursor-not-allowed': horizontal && layoutWidth <= $store.inspector.minVerticalSplitWidth}",
|
136
|
+
"x-bind:class": "{'pointer-events-none opacity-50 !cursor-not-allowed': horizontal && layoutWidth <= $store.inspector.minVerticalSplitWidth}",
|
137
137
|
cloak: true %>
|
138
138
|
|
139
139
|
<% group.with_button id: "drawer-to-bottom-button",
|
@@ -1 +1 @@
|
|
1
|
-
<script src="<%= lookbook_asset_path("/js/iframe.js") %>" defer></script>
|
1
|
+
<script src="<%= lookbook_asset_path("/js/iframe.js") %>" defer></script>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<% if @render_args[:component] %>
|
2
2
|
<% if defined?(Phlex::SGML) && @render_args[:component].is_a?(Phlex::SGML) %>
|
3
|
-
<% if defined?(Phlex::VERSION) && Gem::Version.new(Phlex::VERSION)
|
4
|
-
<%= raw(@render_args[:component].call(context: { rails_view_context: self }, &@render_args[:block])) %>
|
5
|
-
<% else %>
|
3
|
+
<% if defined?(Phlex::VERSION) && Gem::Version.new(Phlex::VERSION) < Gem::Version.new("2.0.0") %>
|
6
4
|
<%= raw(@render_args[:component].call(view_context: self, &@render_args[:block])) %>
|
5
|
+
<% else %>
|
6
|
+
<%= render(@render_args[:component], @render_args[:args], &@render_args[:block]) %>
|
7
7
|
<% end %>
|
8
8
|
<% else %>
|
9
9
|
<%= render(@render_args[:component], @render_args[:args], &@render_args[:block]) %>
|
@@ -1 +1 @@
|
|
1
|
-
<%= @preview_html %>
|
1
|
+
<%= @preview_html %>
|
data/config/app.yml
CHANGED