lookbook 1.0.6 → 1.0.8
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/lib/lookbook/config.rb +1 -0
- data/lib/lookbook/engine.rb +2 -2
- data/lib/lookbook/preview_controller.rb +19 -1
- data/lib/lookbook/preview_example.rb +1 -1
- data/lib/lookbook/version.rb +1 -1
- data/public/lookbook-assets/js/lookbook.js +57 -57
- data/public/lookbook-assets/js/lookbook.js.map +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95694c758af19ee6a561b2aedfee93d932c663f7027471204da2dce393052a5a
|
4
|
+
data.tar.gz: 1b4f3e4af714af47b6719cbbef7a861ad0ca2341089e2689ef8ed80b9a745867
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a148ae5b71546463c003244040e54de07106db6f927e61b77ff35c92d524f37ed59e53646833675a8d1c399968904ffe41891817e85628aa8da879af8aa3bd8
|
7
|
+
data.tar.gz: ee91d909da4634558dbf542802ee770c921f0dfdec0bdc37592977b082a97705957bf7e19cf5168b599e78dca1f5d4222147417262c4b41f90b305a43c2c4f72
|
data/lib/lookbook/config.rb
CHANGED
data/lib/lookbook/engine.rb
CHANGED
@@ -155,7 +155,7 @@ module Lookbook
|
|
155
155
|
def websocket
|
156
156
|
config = Lookbook.config
|
157
157
|
return @websocket unless @websocket.nil?
|
158
|
-
return unless config.auto_refresh == true && !Rails.env.test?
|
158
|
+
return unless config.auto_refresh == true && config.listen == true && !Rails.env.test?
|
159
159
|
Lookbook.logger.info "Initializing websocket"
|
160
160
|
|
161
161
|
cable = ActionCable::Server::Configuration.new
|
@@ -174,7 +174,7 @@ module Lookbook
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def websocket_mount_path
|
177
|
-
"#{mounted_path}#{config.lookbook.cable_mount_path}" if websocket?
|
177
|
+
"#{mounted_path}#{config.lookbook.cable_mount_path}".gsub("//", "/") if websocket?
|
178
178
|
end
|
179
179
|
|
180
180
|
def websocket?
|
@@ -11,7 +11,10 @@ module Lookbook
|
|
11
11
|
opts = {}
|
12
12
|
opts[:layout] = nil
|
13
13
|
opts[:locals] = locals if locals.present?
|
14
|
-
|
14
|
+
|
15
|
+
with_optional_annotations do
|
16
|
+
render html: render_to_string(template, **opts)
|
17
|
+
end
|
15
18
|
end
|
16
19
|
|
17
20
|
def render_in_layout_to_string(template, locals, opts = {})
|
@@ -22,5 +25,20 @@ module Lookbook
|
|
22
25
|
end
|
23
26
|
render html: html
|
24
27
|
end
|
28
|
+
|
29
|
+
def with_optional_annotations
|
30
|
+
if ActionView::Base.respond_to?(:annotate_rendered_view_with_filenames) && Lookbook.config.preview_disable_action_view_annotations
|
31
|
+
original_value = ActionView::Base.annotate_rendered_view_with_filenames
|
32
|
+
ActionView::Base.annotate_rendered_view_with_filenames = false
|
33
|
+
|
34
|
+
res = yield
|
35
|
+
|
36
|
+
ActionView::Base.annotate_rendered_view_with_filenames = original_value
|
37
|
+
|
38
|
+
res
|
39
|
+
else
|
40
|
+
yield
|
41
|
+
end
|
42
|
+
end
|
25
43
|
end
|
26
44
|
end
|
data/lib/lookbook/version.rb
CHANGED
@@ -7755,7 +7755,7 @@ function $5439cede634b2921$var$toCamel(s) {
|
|
7755
7755
|
}
|
7756
7756
|
|
7757
7757
|
|
7758
|
-
var $
|
7758
|
+
var $5a1160331e703b26$exports = {};
|
7759
7759
|
var $cbd28b10fa9798c7$exports = {};
|
7760
7760
|
|
7761
7761
|
$parcel$defineInteropFlag($cbd28b10fa9798c7$exports);
|
@@ -11507,6 +11507,31 @@ function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
|
11507
11507
|
}
|
11508
11508
|
|
11509
11509
|
|
11510
|
+
var $e9904a14dabf652d$exports = {};
|
11511
|
+
|
11512
|
+
$parcel$defineInteropFlag($e9904a14dabf652d$exports);
|
11513
|
+
|
11514
|
+
$parcel$export($e9904a14dabf652d$exports, "default", () => $e9904a14dabf652d$export$2e2bcd8739ae039);
|
11515
|
+
function $e9904a14dabf652d$export$2e2bcd8739ae039(store) {
|
11516
|
+
return {
|
11517
|
+
focussed: false,
|
11518
|
+
get active () {
|
11519
|
+
return store.active;
|
11520
|
+
},
|
11521
|
+
get text () {
|
11522
|
+
return store.text;
|
11523
|
+
},
|
11524
|
+
clear () {
|
11525
|
+
if (store.raw === "") this.$refs.input.blur();
|
11526
|
+
else store.raw = "";
|
11527
|
+
},
|
11528
|
+
focus () {
|
11529
|
+
this.$refs.input.focus();
|
11530
|
+
}
|
11531
|
+
};
|
11532
|
+
}
|
11533
|
+
|
11534
|
+
|
11510
11535
|
var $e1f51f020443edd4$exports = {};
|
11511
11536
|
|
11512
11537
|
$parcel$defineInteropFlag($e1f51f020443edd4$exports);
|
@@ -12372,31 +12397,6 @@ function $e1f51f020443edd4$export$2e2bcd8739ae039(id, embedStore) {
|
|
12372
12397
|
}
|
12373
12398
|
|
12374
12399
|
|
12375
|
-
var $e9904a14dabf652d$exports = {};
|
12376
|
-
|
12377
|
-
$parcel$defineInteropFlag($e9904a14dabf652d$exports);
|
12378
|
-
|
12379
|
-
$parcel$export($e9904a14dabf652d$exports, "default", () => $e9904a14dabf652d$export$2e2bcd8739ae039);
|
12380
|
-
function $e9904a14dabf652d$export$2e2bcd8739ae039(store) {
|
12381
|
-
return {
|
12382
|
-
focussed: false,
|
12383
|
-
get active () {
|
12384
|
-
return store.active;
|
12385
|
-
},
|
12386
|
-
get text () {
|
12387
|
-
return store.text;
|
12388
|
-
},
|
12389
|
-
clear () {
|
12390
|
-
if (store.raw === "") this.$refs.input.blur();
|
12391
|
-
else store.raw = "";
|
12392
|
-
},
|
12393
|
-
focus () {
|
12394
|
-
this.$refs.input.focus();
|
12395
|
-
}
|
12396
|
-
};
|
12397
|
-
}
|
12398
|
-
|
12399
|
-
|
12400
12400
|
var $36506012e0c6e9e3$exports = {};
|
12401
12401
|
|
12402
12402
|
$parcel$defineInteropFlag($36506012e0c6e9e3$exports);
|
@@ -13018,6 +13018,33 @@ function $506dabb2bf255b38$var$sizeSplits(sizes) {
|
|
13018
13018
|
}
|
13019
13019
|
|
13020
13020
|
|
13021
|
+
var $a87dacf5139b5e2f$exports = {};
|
13022
|
+
|
13023
|
+
$parcel$defineInteropFlag($a87dacf5139b5e2f$exports);
|
13024
|
+
|
13025
|
+
$parcel$export($a87dacf5139b5e2f$exports, "default", () => $a87dacf5139b5e2f$export$2e2bcd8739ae039);
|
13026
|
+
function $a87dacf5139b5e2f$export$2e2bcd8739ae039(store) {
|
13027
|
+
return {
|
13028
|
+
get store () {
|
13029
|
+
return store || this;
|
13030
|
+
},
|
13031
|
+
get id () {
|
13032
|
+
return this.$root.id;
|
13033
|
+
},
|
13034
|
+
get panels () {
|
13035
|
+
return Array.from(this.$refs.panels.children);
|
13036
|
+
},
|
13037
|
+
isActive (el) {
|
13038
|
+
return this.store.activeTab === this._getRef(el);
|
13039
|
+
},
|
13040
|
+
// protected
|
13041
|
+
_getRef (el) {
|
13042
|
+
return el.getAttribute("x-ref");
|
13043
|
+
}
|
13044
|
+
};
|
13045
|
+
}
|
13046
|
+
|
13047
|
+
|
13021
13048
|
var $0db07828cadc68e0$exports = {};
|
13022
13049
|
|
13023
13050
|
$parcel$defineInteropFlag($0db07828cadc68e0$exports);
|
@@ -13110,33 +13137,6 @@ function $0db07828cadc68e0$export$2e2bcd8739ae039(store) {
|
|
13110
13137
|
}
|
13111
13138
|
|
13112
13139
|
|
13113
|
-
var $a87dacf5139b5e2f$exports = {};
|
13114
|
-
|
13115
|
-
$parcel$defineInteropFlag($a87dacf5139b5e2f$exports);
|
13116
|
-
|
13117
|
-
$parcel$export($a87dacf5139b5e2f$exports, "default", () => $a87dacf5139b5e2f$export$2e2bcd8739ae039);
|
13118
|
-
function $a87dacf5139b5e2f$export$2e2bcd8739ae039(store) {
|
13119
|
-
return {
|
13120
|
-
get store () {
|
13121
|
-
return store || this;
|
13122
|
-
},
|
13123
|
-
get id () {
|
13124
|
-
return this.$root.id;
|
13125
|
-
},
|
13126
|
-
get panels () {
|
13127
|
-
return Array.from(this.$refs.panels.children);
|
13128
|
-
},
|
13129
|
-
isActive (el) {
|
13130
|
-
return this.store.activeTab === this._getRef(el);
|
13131
|
-
},
|
13132
|
-
// protected
|
13133
|
-
_getRef (el) {
|
13134
|
-
return el.getAttribute("x-ref");
|
13135
|
-
}
|
13136
|
-
};
|
13137
|
-
}
|
13138
|
-
|
13139
|
-
|
13140
13140
|
var $6d64716f0b34fdf4$exports = {};
|
13141
13141
|
|
13142
13142
|
$parcel$defineInteropFlag($6d64716f0b34fdf4$exports);
|
@@ -13264,19 +13264,19 @@ function $6d64716f0b34fdf4$export$2e2bcd8739ae039(store) {
|
|
13264
13264
|
}
|
13265
13265
|
|
13266
13266
|
|
13267
|
-
$
|
13267
|
+
$5a1160331e703b26$exports = {
|
13268
13268
|
"button": $cbd28b10fa9798c7$exports,
|
13269
13269
|
"code": $99486586f6691564$exports,
|
13270
13270
|
"copy_button": $47a1c62621be0c54$exports,
|
13271
13271
|
"dimensions_display": $e398acaded942bbe$exports,
|
13272
|
-
"embed": $e1f51f020443edd4$exports,
|
13273
13272
|
"filter": $e9904a14dabf652d$exports,
|
13273
|
+
"embed": $e1f51f020443edd4$exports,
|
13274
13274
|
"icon": $36506012e0c6e9e3$exports,
|
13275
13275
|
"nav": $d92d9d5253f84566$exports,
|
13276
13276
|
"params_editor": $b63b9c6d236b3f65$exports,
|
13277
13277
|
"split_layout": $506dabb2bf255b38$exports,
|
13278
|
-
"tabs": $0db07828cadc68e0$exports,
|
13279
13278
|
"tab_panels": $a87dacf5139b5e2f$exports,
|
13279
|
+
"tabs": $0db07828cadc68e0$exports,
|
13280
13280
|
"viewport": $6d64716f0b34fdf4$exports
|
13281
13281
|
};
|
13282
13282
|
|
@@ -13421,7 +13421,7 @@ const $d73574cc5e9b9e72$var$prefix = window.APP_NAME;
|
|
13421
13421
|
// Components
|
13422
13422
|
(0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $d709d0f4027033b2$export$2e2bcd8739ae039));
|
13423
13423
|
[
|
13424
|
-
$
|
13424
|
+
$5a1160331e703b26$exports,
|
13425
13425
|
$e4eab7529959b73b$exports,
|
13426
13426
|
$4979d2d897a1c01f$exports
|
13427
13427
|
].forEach((scripts)=>{
|