lookbook 1.0.0.beta.4 → 1.0.0.beta.5
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/base_component.rb +6 -4
- data/app/components/lookbook/copy_button/component.html.erb +3 -3
- data/app/components/lookbook/embed/component.html.erb +33 -33
- data/app/components/lookbook/header/component.html.erb +2 -2
- data/app/components/lookbook/nav/component.html.erb +4 -8
- data/app/components/lookbook/nav/component.rb +5 -7
- data/app/components/lookbook/nav/item/component.html.erb +12 -6
- data/app/components/lookbook/nav/item/component.rb +9 -2
- data/app/components/lookbook/page_tabs/component.html.erb +1 -1
- data/app/components/lookbook/split_layout/component.html.erb +1 -1
- data/app/components/lookbook/tab_panels/panel/component.html.erb +2 -2
- data/app/components/lookbook/tabs/component.html.erb +2 -2
- 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/tag_component.rb +5 -10
- data/app/controllers/lookbook/application_controller.rb +1 -1
- data/app/views/layouts/lookbook/application.html.erb +76 -60
- data/app/views/layouts/lookbook/page.html.erb +35 -35
- data/app/views/lookbook/index.html.erb +24 -11
- data/app/views/lookbook/pages/show.html.erb +1 -1
- data/app/views/lookbook/previews/show.html.erb +7 -7
- data/lib/lookbook/config.rb +9 -1
- data/lib/lookbook/engine.rb +16 -6
- data/lib/lookbook/markdown.rb +3 -1
- data/lib/lookbook/page.rb +4 -0
- data/lib/lookbook/preview.rb +35 -5
- data/lib/lookbook/version.rb +1 -1
- data/lib/tasks/lookbook_tasks.rake +1 -1
- data/public/lookbook-assets/css/lookbook.css +12 -12
- data/public/lookbook-assets/js/lookbook.js +108 -108
- data/public/lookbook-assets/js/lookbook.js.map +1 -1
- metadata +2 -2
@@ -1,14 +1,27 @@
|
|
1
|
-
<div id="
|
2
|
-
<div class="
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
<div id="landing" class="flex flex-col items-center justify-center h-full w-full">
|
2
|
+
<div class="p-4 text-center mx-auto">
|
3
|
+
<% if Lookbook.previews? %>
|
4
|
+
<div id="landing-with-content">
|
5
|
+
<h5 class="text-lg opacity-50"><%= config.project_name %></h5>
|
6
|
+
<div class="mt-2 italic opacity-30 max-w-[400px]">
|
7
|
+
<p>
|
8
|
+
Select a preview from the nav to get started.
|
9
|
+
</p>
|
10
|
+
</div>
|
11
11
|
</div>
|
12
|
-
|
12
|
+
<% else %>
|
13
|
+
<div id="landing-no-content">
|
14
|
+
<h5 class="text-lg font-bold opacity-80"><%= config.project_name %></h5>
|
15
|
+
<div class="mt-3 italic opacity-40 max-w-[400px]">
|
16
|
+
<p>
|
17
|
+
Nothing here yet!
|
18
|
+
<a class="underline" href="https://viewcomponent.org/guide/previews.html" target="_blank">
|
19
|
+
Create a preview
|
20
|
+
</a>
|
21
|
+
to get started.
|
22
|
+
</p>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
13
26
|
</div>
|
14
27
|
</div>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="px-4 md:px-10 pt-8 md:pt-10 overflow-auto scroll-smooth w-full max-h-full pb-12" x-ref="scroller">
|
2
|
-
<div class="w-full max-w-
|
2
|
+
<div class="w-full max-w-screen-lg mx-auto h-full flex flex-col">
|
3
3
|
<% if @page.header? %>
|
4
4
|
<header id="page-header" class="mb-8 prose max-w-none flex-none">
|
5
5
|
<h1><%= @page.title %></h1>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
":class": "($store.inspector.drawer.hidden || #{@drawer_panels.none?}) && '!grid-rows-[1fr] !grid-cols-[1fr]'" do |layout| %>
|
4
4
|
|
5
5
|
<%= layout.pane class: "flex flex-col h-full overflow-hidden",
|
6
|
-
|
6
|
+
"x-effect": "forceOrientation = (layoutWidth < $store.inspector.minVerticalSplitWidth) ? 'horizontal' : null" do %>
|
7
7
|
|
8
8
|
<%= render_component :toolbar do |toolbar| %>
|
9
9
|
<% toolbar.section ":class": "layoutResizing && 'overflow-hidden'" do %>
|
@@ -46,7 +46,7 @@
|
|
46
46
|
tooltip: "Show drawer",
|
47
47
|
"@click": "$store.inspector.drawer.hidden = false",
|
48
48
|
class: "rotate-180",
|
49
|
-
|
49
|
+
"x-show": "$store.inspector.drawer.hidden",
|
50
50
|
cloak: true %>
|
51
51
|
<% end %>
|
52
52
|
<% end %>
|
@@ -64,7 +64,7 @@
|
|
64
64
|
<% end %>
|
65
65
|
|
66
66
|
<%= layout.pane class: "flex flex-col h-full overflow-hidden bg-lookbook-drawer",
|
67
|
-
|
67
|
+
"x-show": "!$store.inspector.drawer.hidden && #{@drawer_panels.any?}" do %>
|
68
68
|
|
69
69
|
<%= render_component :toolbar do |toolbar| %>
|
70
70
|
<% toolbar.section ":class": "layoutResizing && 'overflow-hidden'" do %>
|
@@ -84,7 +84,7 @@
|
|
84
84
|
<% group.button icon: :copy,
|
85
85
|
tooltip: "Copy panel contents",
|
86
86
|
copy: !!panel.copy,
|
87
|
-
|
87
|
+
"x-show": "$store.inspector.drawer.activeTab === '#{panel.name}'",
|
88
88
|
cloak: true do %>
|
89
89
|
<%== panel.copy ? panel.copy : "" %>
|
90
90
|
<% end %>
|
@@ -98,18 +98,18 @@
|
|
98
98
|
<% group.button icon: :corner_up_right,
|
99
99
|
tooltip: "Move drawer to right",
|
100
100
|
"@click": "switchOrientation",
|
101
|
-
|
101
|
+
"x-show": "horizontal && layoutWidth > $store.inspector.minVerticalSplitWidth",
|
102
102
|
cloak: true %>
|
103
103
|
|
104
104
|
<% group.button icon: :corner_up_right,
|
105
|
-
|
105
|
+
"x-show": "horizontal && layoutWidth <= $store.inspector.minVerticalSplitWidth",
|
106
106
|
disabled: true,
|
107
107
|
cloak: true %>
|
108
108
|
|
109
109
|
<% group.button icon: :corner_left_down,
|
110
110
|
tooltip: "Move drawer to bottom",
|
111
111
|
"@click": "switchOrientation",
|
112
|
-
|
112
|
+
"x-show": "vertical",
|
113
113
|
cloak: true %>
|
114
114
|
|
115
115
|
<% group.button icon: :x_circle,
|
data/lib/lookbook/config.rb
CHANGED
@@ -28,6 +28,7 @@ module Lookbook
|
|
28
28
|
|
29
29
|
listen: Rails.env.development?,
|
30
30
|
listen_paths: [],
|
31
|
+
listen_extensions: ["rb", "html.*"],
|
31
32
|
listen_use_polling: false,
|
32
33
|
|
33
34
|
cable_mount_path: "/lookbook-cable",
|
@@ -133,6 +134,12 @@ module Lookbook
|
|
133
134
|
normalize_paths(@options.listen_paths)
|
134
135
|
end
|
135
136
|
|
137
|
+
def listen_extensions
|
138
|
+
@options.listen_extensions += ["rb", "html.*"]
|
139
|
+
@options.listen_extensions.uniq!
|
140
|
+
@options.listen_extensions
|
141
|
+
end
|
142
|
+
|
136
143
|
def parser_registry_path
|
137
144
|
absolute_path(@options.parser_registry_path)
|
138
145
|
end
|
@@ -219,7 +226,8 @@ module Lookbook
|
|
219
226
|
|
220
227
|
def normalize_paths(paths)
|
221
228
|
paths.map! { |path| absolute_path(path) }
|
222
|
-
paths.select { |path| Dir.exist?(path) }
|
229
|
+
paths.select! { |path| Dir.exist?(path) }
|
230
|
+
paths
|
223
231
|
end
|
224
232
|
|
225
233
|
def absolute_path(path)
|
data/lib/lookbook/engine.rb
CHANGED
@@ -36,10 +36,18 @@ module Lookbook
|
|
36
36
|
Preview.all
|
37
37
|
end
|
38
38
|
|
39
|
+
def previews?
|
40
|
+
Preview.any?
|
41
|
+
end
|
42
|
+
|
39
43
|
def pages
|
40
44
|
Page.all
|
41
45
|
end
|
42
46
|
|
47
|
+
def pages?
|
48
|
+
Page.any?
|
49
|
+
end
|
50
|
+
|
43
51
|
def after_initialize(&block)
|
44
52
|
add_hook(:after_initialize, block)
|
45
53
|
end
|
@@ -112,10 +120,11 @@ module Lookbook
|
|
112
120
|
|
113
121
|
if config.lookbook.listen
|
114
122
|
Listen.logger = Lookbook.logger
|
123
|
+
|
115
124
|
preview_listener = Listen.to(
|
116
125
|
*config.lookbook.listen_paths,
|
117
|
-
only: /\.(
|
118
|
-
force_polling:
|
126
|
+
only: /\.(#{config.lookbook.listen_extensions.join("|")})$/,
|
127
|
+
force_polling: config.lookbook.listen_use_polling
|
119
128
|
) do |modified, added, removed|
|
120
129
|
changes = { modified: modified, added: added, removed: removed }
|
121
130
|
begin
|
@@ -131,7 +140,7 @@ module Lookbook
|
|
131
140
|
page_listener = Listen.to(
|
132
141
|
*config.lookbook.page_paths,
|
133
142
|
only: /\.(html.*|md.*)$/,
|
134
|
-
force_polling:
|
143
|
+
force_polling: config.lookbook.listen_use_polling
|
135
144
|
) do |modified, added, removed|
|
136
145
|
changes = { modified: modified, added: added, removed: removed }
|
137
146
|
Lookbook::Engine.reload_ui(changes)
|
@@ -166,6 +175,7 @@ module Lookbook
|
|
166
175
|
class << self
|
167
176
|
|
168
177
|
def websocket
|
178
|
+
return @websocket unless @websocket.nil?
|
169
179
|
if config.lookbook.auto_refresh
|
170
180
|
cable = ActionCable::Server::Configuration.new
|
171
181
|
cable.cable = {adapter: "async"}.with_indifferent_access
|
@@ -176,9 +186,9 @@ module Lookbook
|
|
176
186
|
@websocket ||= if Rails.version.to_f >= 6.0
|
177
187
|
ActionCable::Server::Base.new(config: cable)
|
178
188
|
else
|
179
|
-
websocket ||= ActionCable::Server::Base.new
|
180
|
-
websocket.config = cable
|
181
|
-
websocket
|
189
|
+
@websocket ||= ActionCable::Server::Base.new
|
190
|
+
@websocket.config = cable
|
191
|
+
@websocket
|
182
192
|
end
|
183
193
|
end
|
184
194
|
end
|
data/lib/lookbook/markdown.rb
CHANGED
@@ -8,10 +8,12 @@ module Lookbook
|
|
8
8
|
disable_indented_code_blocks: true,
|
9
9
|
strikethrough: true,
|
10
10
|
highlight: true,
|
11
|
-
with_toc_data: true
|
11
|
+
with_toc_data: true,
|
12
|
+
lax_spacing: true
|
12
13
|
}
|
13
14
|
|
14
15
|
def self.render(text)
|
16
|
+
text&.gsub!(/\<\!\-\- (BEGIN|END) (.*) \-\-\>/, "")
|
15
17
|
markdown = Redcarpet::Markdown.new(Renderer, Lookbook.config.markdown_options)
|
16
18
|
markdown.render(text).html_safe
|
17
19
|
end
|
data/lib/lookbook/page.rb
CHANGED
data/lib/lookbook/preview.rb
CHANGED
@@ -122,14 +122,15 @@ module Lookbook
|
|
122
122
|
!!find(path)
|
123
123
|
end
|
124
124
|
|
125
|
-
def
|
126
|
-
|
125
|
+
def any?
|
126
|
+
all.any?
|
127
127
|
end
|
128
128
|
|
129
129
|
def all
|
130
130
|
load_previews if preview_files.size > ViewComponent::Preview.descendants.size
|
131
131
|
|
132
|
-
|
132
|
+
@previews = nil if cache_stale?
|
133
|
+
return @previews unless @previews.nil?
|
133
134
|
|
134
135
|
previews = ViewComponent::Preview.descendants.map do |p|
|
135
136
|
new(p)
|
@@ -144,15 +145,44 @@ module Lookbook
|
|
144
145
|
end
|
145
146
|
|
146
147
|
sorted_previews = previews.compact.sort_by { |preview| [preview.position, preview.label] }
|
147
|
-
@previews
|
148
|
+
@previews = PreviewCollection.new(sorted_previews)
|
149
|
+
mark_as_cached if Lookbook.config.listen == true
|
150
|
+
@previews
|
148
151
|
end
|
149
152
|
|
150
153
|
def errors
|
151
154
|
@errors ||= []
|
152
155
|
end
|
153
156
|
|
157
|
+
def clear_cache
|
158
|
+
cache_dir = File.dirname(cache_marker_path)
|
159
|
+
FileUtils.mkdir_p(cache_dir) unless File.exists?(cache_dir)
|
160
|
+
File.write(cache_marker_path, Time.now.to_i)
|
161
|
+
end
|
162
|
+
|
154
163
|
protected
|
155
164
|
|
165
|
+
def cache_marker_path
|
166
|
+
Rails.root.join("tmp/cache/lookbook-previews")
|
167
|
+
end
|
168
|
+
|
169
|
+
def cache_stale?
|
170
|
+
return false if !File.exists?(cache_marker_path)
|
171
|
+
cache_timestamp = File.read(cache_marker_path).to_i
|
172
|
+
if @last_cache_timestamp.nil? || cache_timestamp > @last_cache_timestamp
|
173
|
+
@last_cache_timestamp = cache_timestamp
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
def mark_as_cached
|
181
|
+
cache_dir = File.dirname(cache_marker_path)
|
182
|
+
FileUtils.mkdir_p(cache_dir) unless File.exists?(cache_dir)
|
183
|
+
File.write(cache_marker_path, Time.now)
|
184
|
+
end
|
185
|
+
|
156
186
|
def load_previews
|
157
187
|
@errors = []
|
158
188
|
preview_files.each do |file|
|
@@ -166,7 +196,7 @@ module Lookbook
|
|
166
196
|
)
|
167
197
|
end
|
168
198
|
end
|
169
|
-
|
199
|
+
|
170
200
|
def preview_files
|
171
201
|
files = Array(Lookbook.config.preview_paths).map do |preview_path|
|
172
202
|
Dir["#{preview_path}/**/*preview.rb"].map do |path|
|
data/lib/lookbook/version.rb
CHANGED
@@ -1756,14 +1756,14 @@ pre[class*="language-"] {
|
|
1756
1756
|
margin-top: 2rem;
|
1757
1757
|
}
|
1758
1758
|
|
1759
|
-
.mt-6 {
|
1760
|
-
margin-top: 1.5rem;
|
1761
|
-
}
|
1762
|
-
|
1763
1759
|
.ml-2 {
|
1764
1760
|
margin-left: .5rem;
|
1765
1761
|
}
|
1766
1762
|
|
1763
|
+
.mt-6 {
|
1764
|
+
margin-top: 1.5rem;
|
1765
|
+
}
|
1766
|
+
|
1767
1767
|
.mt-12 {
|
1768
1768
|
margin-top: 3rem;
|
1769
1769
|
}
|
@@ -1976,12 +1976,12 @@ pre[class*="language-"] {
|
|
1976
1976
|
max-width: 1024px;
|
1977
1977
|
}
|
1978
1978
|
|
1979
|
-
.max-w-\[
|
1980
|
-
max-width:
|
1979
|
+
.max-w-\[400px\] {
|
1980
|
+
max-width: 400px;
|
1981
1981
|
}
|
1982
1982
|
|
1983
|
-
.max-w
|
1984
|
-
max-width:
|
1983
|
+
.max-w-\[420px\] {
|
1984
|
+
max-width: 420px;
|
1985
1985
|
}
|
1986
1986
|
|
1987
1987
|
.max-w-none {
|
@@ -2687,14 +2687,14 @@ pre[class*="language-"] {
|
|
2687
2687
|
opacity: .3;
|
2688
2688
|
}
|
2689
2689
|
|
2690
|
-
.opacity-40 {
|
2691
|
-
opacity: .4;
|
2692
|
-
}
|
2693
|
-
|
2694
2690
|
.opacity-80 {
|
2695
2691
|
opacity: .8;
|
2696
2692
|
}
|
2697
2693
|
|
2694
|
+
.opacity-40 {
|
2695
|
+
opacity: .4;
|
2696
|
+
}
|
2697
|
+
|
2698
2698
|
.opacity-0 {
|
2699
2699
|
opacity: 0;
|
2700
2700
|
}
|
@@ -7849,7 +7849,7 @@ function $5439cede634b2921$var$toCamel(s) {
|
|
7849
7849
|
}
|
7850
7850
|
|
7851
7851
|
|
7852
|
-
var $
|
7852
|
+
var $8827b5620b152958$exports = {};
|
7853
7853
|
var $cbd28b10fa9798c7$exports = {};
|
7854
7854
|
|
7855
7855
|
$parcel$defineInteropFlag($cbd28b10fa9798c7$exports);
|
@@ -11502,72 +11502,6 @@ function $cbd28b10fa9798c7$export$2e2bcd8739ae039() {
|
|
11502
11502
|
}
|
11503
11503
|
|
11504
11504
|
|
11505
|
-
var $99486586f6691564$exports = {};
|
11506
|
-
|
11507
|
-
$parcel$defineInteropFlag($99486586f6691564$exports);
|
11508
|
-
|
11509
|
-
$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039);
|
11510
|
-
function $99486586f6691564$export$2e2bcd8739ae039() {
|
11511
|
-
return {};
|
11512
|
-
}
|
11513
|
-
|
11514
|
-
|
11515
|
-
var $47a1c62621be0c54$exports = {};
|
11516
|
-
|
11517
|
-
$parcel$defineInteropFlag($47a1c62621be0c54$exports);
|
11518
|
-
|
11519
|
-
$parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039);
|
11520
|
-
var $122263eab94cad08$exports = {};
|
11521
|
-
|
11522
|
-
$parcel$defineInteropFlag($122263eab94cad08$exports);
|
11523
|
-
|
11524
|
-
$parcel$export($122263eab94cad08$exports, "initClipboard", () => $122263eab94cad08$export$c6684e6159b21de3);
|
11525
|
-
$parcel$export($122263eab94cad08$exports, "default", () => $122263eab94cad08$export$2e2bcd8739ae039);
|
11526
|
-
|
11527
|
-
function $122263eab94cad08$export$c6684e6159b21de3(context = {}) {
|
11528
|
-
let copyTimeout = null;
|
11529
|
-
return Object.assign(context, {
|
11530
|
-
copied: false,
|
11531
|
-
async copyToClipboard (target = null) {
|
11532
|
-
let targetEl;
|
11533
|
-
if (this.$refs.copyTarget) targetEl = this.$refs.copyTarget;
|
11534
|
-
else if (typeof target === "string") targetEl = document.querySelector(target);
|
11535
|
-
if (!targetEl) {
|
11536
|
-
this.warn("Could not find copy target");
|
11537
|
-
return false;
|
11538
|
-
}
|
11539
|
-
const content = $7ae6ae39c2ec9059$export$6cb344a21ca18aec(targetEl.innerText.trim());
|
11540
|
-
await window.navigator.clipboard.writeText(content);
|
11541
|
-
this.copied = true;
|
11542
|
-
if (copyTimeout) clearTimeout(copyTimeout);
|
11543
|
-
copyTimeout = setTimeout(()=>{
|
11544
|
-
this.copied = false;
|
11545
|
-
this.onCopyComplete();
|
11546
|
-
}, 1000);
|
11547
|
-
return content;
|
11548
|
-
},
|
11549
|
-
onCopyComplete () {}
|
11550
|
-
});
|
11551
|
-
}
|
11552
|
-
function $122263eab94cad08$export$2e2bcd8739ae039() {
|
11553
|
-
return $122263eab94cad08$export$c6684e6159b21de3({});
|
11554
|
-
}
|
11555
|
-
|
11556
|
-
|
11557
|
-
|
11558
|
-
function $47a1c62621be0c54$export$2e2bcd8739ae039() {
|
11559
|
-
const button = $cbd28b10fa9798c7$export$2e2bcd8739ae039();
|
11560
|
-
return {
|
11561
|
-
...button,
|
11562
|
-
copied: false,
|
11563
|
-
init () {
|
11564
|
-
button.init.bind(this)();
|
11565
|
-
$122263eab94cad08$export$c6684e6159b21de3(this);
|
11566
|
-
}
|
11567
|
-
};
|
11568
|
-
}
|
11569
|
-
|
11570
|
-
|
11571
11505
|
var $e398acaded942bbe$exports = {};
|
11572
11506
|
|
11573
11507
|
$parcel$defineInteropFlag($e398acaded942bbe$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,36 +12435,74 @@ function $e9904a14dabf652d$export$2e2bcd8739ae039(store) {
|
|
12491
12435
|
}
|
12492
12436
|
|
12493
12437
|
|
12494
|
-
var $
|
12438
|
+
var $47a1c62621be0c54$exports = {};
|
12495
12439
|
|
12496
|
-
$parcel$defineInteropFlag($
|
12440
|
+
$parcel$defineInteropFlag($47a1c62621be0c54$exports);
|
12497
12441
|
|
12498
|
-
$parcel$export($
|
12499
|
-
|
12500
|
-
return {
|
12501
|
-
iconName: iconName
|
12502
|
-
};
|
12503
|
-
}
|
12442
|
+
$parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039);
|
12443
|
+
var $122263eab94cad08$exports = {};
|
12504
12444
|
|
12445
|
+
$parcel$defineInteropFlag($122263eab94cad08$exports);
|
12505
12446
|
|
12506
|
-
|
12447
|
+
$parcel$export($122263eab94cad08$exports, "initClipboard", () => $122263eab94cad08$export$c6684e6159b21de3);
|
12448
|
+
$parcel$export($122263eab94cad08$exports, "default", () => $122263eab94cad08$export$2e2bcd8739ae039);
|
12507
12449
|
|
12508
|
-
$
|
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
|
+
}
|
12509
12478
|
|
12510
|
-
$parcel$export($b63b9c6d236b3f65$exports, "default", () => $b63b9c6d236b3f65$export$2e2bcd8739ae039);
|
12511
12479
|
|
12512
|
-
|
12480
|
+
|
12481
|
+
function $47a1c62621be0c54$export$2e2bcd8739ae039() {
|
12482
|
+
const button = $cbd28b10fa9798c7$export$2e2bcd8739ae039();
|
12513
12483
|
return {
|
12514
|
-
|
12484
|
+
...button,
|
12485
|
+
copied: false,
|
12515
12486
|
init () {
|
12516
|
-
|
12517
|
-
|
12518
|
-
});
|
12487
|
+
button.init.bind(this)();
|
12488
|
+
$122263eab94cad08$export$c6684e6159b21de3(this);
|
12519
12489
|
}
|
12520
12490
|
};
|
12521
12491
|
}
|
12522
12492
|
|
12523
12493
|
|
12494
|
+
var $36506012e0c6e9e3$exports = {};
|
12495
|
+
|
12496
|
+
$parcel$defineInteropFlag($36506012e0c6e9e3$exports);
|
12497
|
+
|
12498
|
+
$parcel$export($36506012e0c6e9e3$exports, "default", () => $36506012e0c6e9e3$export$2e2bcd8739ae039);
|
12499
|
+
function $36506012e0c6e9e3$export$2e2bcd8739ae039(iconName) {
|
12500
|
+
return {
|
12501
|
+
iconName: iconName
|
12502
|
+
};
|
12503
|
+
}
|
12504
|
+
|
12505
|
+
|
12524
12506
|
var $d92d9d5253f84566$exports = {};
|
12525
12507
|
|
12526
12508
|
$parcel$defineInteropFlag($d92d9d5253f84566$exports);
|
@@ -12563,28 +12545,19 @@ function $d92d9d5253f84566$export$2e2bcd8739ae039(store) {
|
|
12563
12545
|
}
|
12564
12546
|
|
12565
12547
|
|
12566
|
-
var $
|
12548
|
+
var $b63b9c6d236b3f65$exports = {};
|
12567
12549
|
|
12568
|
-
$parcel$defineInteropFlag($
|
12550
|
+
$parcel$defineInteropFlag($b63b9c6d236b3f65$exports);
|
12569
12551
|
|
12570
|
-
$parcel$export($
|
12571
|
-
|
12552
|
+
$parcel$export($b63b9c6d236b3f65$exports, "default", () => $b63b9c6d236b3f65$export$2e2bcd8739ae039);
|
12553
|
+
|
12554
|
+
function $b63b9c6d236b3f65$export$2e2bcd8739ae039() {
|
12572
12555
|
return {
|
12573
|
-
|
12574
|
-
|
12575
|
-
|
12576
|
-
|
12577
|
-
|
12578
|
-
},
|
12579
|
-
get panels () {
|
12580
|
-
return Array.from(this.$refs.panels.children);
|
12581
|
-
},
|
12582
|
-
isActive (el) {
|
12583
|
-
return this.store.activeTab === this._getRef(el);
|
12584
|
-
},
|
12585
|
-
// protected
|
12586
|
-
_getRef (el) {
|
12587
|
-
return el.getAttribute("x-ref");
|
12556
|
+
narrow: false,
|
12557
|
+
init () {
|
12558
|
+
$9930d46698775b42$export$a2214cc2adb2dc44(this.$el, ({ width: width })=>{
|
12559
|
+
this.narrow = width < 450;
|
12560
|
+
});
|
12588
12561
|
}
|
12589
12562
|
};
|
12590
12563
|
}
|
@@ -13143,6 +13116,33 @@ function $506dabb2bf255b38$var$sizeSplits(sizes) {
|
|
13143
13116
|
}
|
13144
13117
|
|
13145
13118
|
|
13119
|
+
var $a87dacf5139b5e2f$exports = {};
|
13120
|
+
|
13121
|
+
$parcel$defineInteropFlag($a87dacf5139b5e2f$exports);
|
13122
|
+
|
13123
|
+
$parcel$export($a87dacf5139b5e2f$exports, "default", () => $a87dacf5139b5e2f$export$2e2bcd8739ae039);
|
13124
|
+
function $a87dacf5139b5e2f$export$2e2bcd8739ae039(store) {
|
13125
|
+
return {
|
13126
|
+
get store () {
|
13127
|
+
return store || this;
|
13128
|
+
},
|
13129
|
+
get id () {
|
13130
|
+
return this.$root.id;
|
13131
|
+
},
|
13132
|
+
get panels () {
|
13133
|
+
return Array.from(this.$refs.panels.children);
|
13134
|
+
},
|
13135
|
+
isActive (el) {
|
13136
|
+
return this.store.activeTab === this._getRef(el);
|
13137
|
+
},
|
13138
|
+
// protected
|
13139
|
+
_getRef (el) {
|
13140
|
+
return el.getAttribute("x-ref");
|
13141
|
+
}
|
13142
|
+
};
|
13143
|
+
}
|
13144
|
+
|
13145
|
+
|
13146
13146
|
var $0db07828cadc68e0$exports = {};
|
13147
13147
|
|
13148
13148
|
$parcel$defineInteropFlag($0db07828cadc68e0$exports);
|
@@ -13364,18 +13364,18 @@ function $6d64716f0b34fdf4$export$2e2bcd8739ae039(store) {
|
|
13364
13364
|
}
|
13365
13365
|
|
13366
13366
|
|
13367
|
-
$
|
13367
|
+
$8827b5620b152958$exports = {
|
13368
13368
|
"button": $cbd28b10fa9798c7$exports,
|
13369
|
-
"code": $99486586f6691564$exports,
|
13370
|
-
"copy_button": $47a1c62621be0c54$exports,
|
13371
13369
|
"dimensions_display": $e398acaded942bbe$exports,
|
13372
13370
|
"embed": $e1f51f020443edd4$exports,
|
13371
|
+
"code": $99486586f6691564$exports,
|
13373
13372
|
"filter": $e9904a14dabf652d$exports,
|
13373
|
+
"copy_button": $47a1c62621be0c54$exports,
|
13374
13374
|
"icon": $36506012e0c6e9e3$exports,
|
13375
|
-
"params_editor": $b63b9c6d236b3f65$exports,
|
13376
13375
|
"nav": $d92d9d5253f84566$exports,
|
13377
|
-
"
|
13376
|
+
"params_editor": $b63b9c6d236b3f65$exports,
|
13378
13377
|
"split_layout": $506dabb2bf255b38$exports,
|
13378
|
+
"tab_panels": $a87dacf5139b5e2f$exports,
|
13379
13379
|
"tabs": $0db07828cadc68e0$exports,
|
13380
13380
|
"viewport": $6d64716f0b34fdf4$exports
|
13381
13381
|
};
|
@@ -13524,7 +13524,7 @@ $caa9439642c6336c$export$2e2bcd8739ae039.store("settings", $96e0343bbb13096b$exp
|
|
13524
13524
|
// Components
|
13525
13525
|
$caa9439642c6336c$export$2e2bcd8739ae039.data("app", $d709d0f4027033b2$export$2e2bcd8739ae039);
|
13526
13526
|
[
|
13527
|
-
$
|
13527
|
+
$8827b5620b152958$exports,
|
13528
13528
|
$e4eab7529959b73b$exports,
|
13529
13529
|
$4979d2d897a1c01f$exports
|
13530
13530
|
].forEach((scripts)=>{
|