lookbook 2.3.15 → 2.3.17
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/controllers/lookbook/pages_controller.rb +1 -1
- data/lib/lookbook/engine.rb +5 -0
- data/lib/lookbook/helpers/ui_elements_helper.rb +1 -1
- data/lib/lookbook/services/code/code_highlighter.rb +2 -3
- data/lib/lookbook/version.rb +1 -1
- data/public/lookbook-assets/js/index.js +10 -4
- data/public/lookbook-assets/js/index.js.map +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a1c5d68258ed8dd2f0bfc5b3cffe4860f6a2df45d0d4c57e12304e5e5bdfe6cf
|
|
4
|
+
data.tar.gz: 667ada787ec847eea4b49efe25c2ead39e4c0da8a61ba08e6effc909e924bbe0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b65daee7c638c7935fead83d1b66a90718ad0484867d328c71c91c34bcd0deb0fd2324d8bdc8386913adf470f1237c48682b8fcb030002d31e78d358e23ebe4f
|
|
7
|
+
data.tar.gz: 1f7759fb195757c9655399e67308f586acd01e89dbd282fbcbe54f5587914abf21f410a3ce3f43d01bb6469a3ebf999bf1970d1c4bcc13d4e285ef7524cdc4dc
|
|
@@ -10,7 +10,7 @@ module Lookbook
|
|
|
10
10
|
landing = Engine.pages.find(&:landing?) || Engine.pages.first
|
|
11
11
|
raise_not_found("Page not found") unless landing.present?
|
|
12
12
|
|
|
13
|
-
redirect_to lookbook_page_path(landing.
|
|
13
|
+
redirect_to lookbook_page_path(landing.lookup_path)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def show
|
data/lib/lookbook/engine.rb
CHANGED
|
@@ -33,6 +33,11 @@ module Lookbook
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
# Cached component classes go stale when Rails reloads app/components.
|
|
37
|
+
config.to_prepare do
|
|
38
|
+
UiElementsHelper::COMPONENT_CLASSES.clear
|
|
39
|
+
end
|
|
40
|
+
|
|
36
41
|
config.after_initialize do
|
|
37
42
|
if opts.using_view_component
|
|
38
43
|
vc_config = Engine.host_config.view_component
|
|
@@ -74,9 +74,9 @@ module Lookbook
|
|
|
74
74
|
|
|
75
75
|
# @api private
|
|
76
76
|
def component_class(ref)
|
|
77
|
+
ref = ref.to_s.tr("-", "_")
|
|
77
78
|
klass = COMPONENT_CLASSES[ref]
|
|
78
79
|
if klass.nil?
|
|
79
|
-
ref = ref.to_s.tr("-", "_")
|
|
80
80
|
class_namespace = ref.camelize
|
|
81
81
|
begin
|
|
82
82
|
klass = "Lookbook::#{class_namespace}::Component".constantize
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require "rouge"
|
|
2
|
-
require "
|
|
2
|
+
require "cgi/escape"
|
|
3
3
|
|
|
4
4
|
module Lookbook
|
|
5
5
|
class CodeHighlighter < Service
|
|
@@ -15,8 +15,7 @@ module Lookbook
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def call
|
|
18
|
-
|
|
19
|
-
decoded_source = coder.decode(source)
|
|
18
|
+
decoded_source = CGI.unescapeHTML(source)
|
|
20
19
|
language = opts.fetch(:language, "ruby")
|
|
21
20
|
formatter = LookbookFormatter.new(language: language, **opts)
|
|
22
21
|
lexer = Rouge::Lexer.find(language.to_s) || Rouge::Lexer.find("plaintext")
|
data/lib/lookbook/version.rb
CHANGED
|
@@ -3457,19 +3457,20 @@ function $a5acee56471cec18$export$9a6132153fba2e0(Alpine) {
|
|
|
3457
3457
|
console.warn("Alpine: $persist is using temporary storage since localStorage is unavailable.");
|
|
3458
3458
|
let dummy = /* @__PURE__ */ new Map();
|
|
3459
3459
|
storage = {
|
|
3460
|
-
getItem: dummy.get
|
|
3460
|
+
getItem: (key)=>dummy.has(key) ? dummy.get(key) : null,
|
|
3461
3461
|
setItem: dummy.set.bind(dummy)
|
|
3462
3462
|
};
|
|
3463
3463
|
}
|
|
3464
|
-
return Alpine.interceptor((initialValue, getter, setter, path, key)=>{
|
|
3464
|
+
return Alpine.interceptor((initialValue, getter, setter, path, key, cleanup = ()=>{})=>{
|
|
3465
3465
|
let lookup = alias || `_x_${path}`;
|
|
3466
3466
|
let initial = $a5acee56471cec18$var$storageHas(lookup, storage) ? $a5acee56471cec18$var$storageGet(lookup, storage) : initialValue;
|
|
3467
3467
|
setter(initial);
|
|
3468
|
-
Alpine.effect(()=>{
|
|
3468
|
+
let effect = Alpine.effect(()=>{
|
|
3469
3469
|
let value = getter();
|
|
3470
3470
|
$a5acee56471cec18$var$storageSet(lookup, value, storage);
|
|
3471
3471
|
setter(value);
|
|
3472
3472
|
});
|
|
3473
|
+
cleanup(()=>Alpine.release(effect));
|
|
3473
3474
|
return initial;
|
|
3474
3475
|
}, (func)=>{
|
|
3475
3476
|
func.as = (key)=>{
|
|
@@ -3496,7 +3497,8 @@ function $a5acee56471cec18$export$9a6132153fba2e0(Alpine) {
|
|
|
3496
3497
|
};
|
|
3497
3498
|
}
|
|
3498
3499
|
function $a5acee56471cec18$var$storageHas(key, storage) {
|
|
3499
|
-
|
|
3500
|
+
let value = storage.getItem(key);
|
|
3501
|
+
return value !== null && value !== void 0;
|
|
3500
3502
|
}
|
|
3501
3503
|
function $a5acee56471cec18$var$storageGet(key, storage) {
|
|
3502
3504
|
let value = storage.getItem(key);
|
|
@@ -3504,6 +3506,10 @@ function $a5acee56471cec18$var$storageGet(key, storage) {
|
|
|
3504
3506
|
return JSON.parse(value);
|
|
3505
3507
|
}
|
|
3506
3508
|
function $a5acee56471cec18$var$storageSet(key, value, storage) {
|
|
3509
|
+
if (value === void 0) {
|
|
3510
|
+
storage.removeItem?.(key);
|
|
3511
|
+
return;
|
|
3512
|
+
}
|
|
3507
3513
|
storage.setItem(key, JSON.stringify(value));
|
|
3508
3514
|
}
|
|
3509
3515
|
// packages/persist/builds/module.js
|