lookbook 1.0.0.rc.2 → 1.0.0.rc.3
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 +1 -1
- data/app/components/lookbook/params_editor/field/component.html.erb +3 -4
- data/app/components/lookbook/params_editor/field/component.rb +5 -3
- data/lib/lookbook/engine.rb +0 -1
- data/lib/lookbook/version.rb +1 -1
- data/lib/tasks/lookbook_tasks.rake +0 -29
- data/public/lookbook-assets/css/themes/zinc.css.map.91837.5 +1 -0
- data/public/lookbook-assets/js/embed.js.91837.6 +0 -0
- data/public/lookbook-assets/js/lookbook.js +89 -89
- data/public/lookbook-assets/js/lookbook.js.map +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f64c997d49feb8abebcde5278b87487c2e6560325e5f36c849b2f1897e8c749e
|
4
|
+
data.tar.gz: d6d230272a15c2b3685da778e3b174300c5a40845f9b3819dba676c66f78904e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cae26841a60c692b5f762b77ad5b6ca38cba5164da39b38f8e026b720a9289300469e6f50d8b7e90e7c8135dcae93443650ae4a6861c5e29ea7b527cdd6e6ee
|
7
|
+
data.tar.gz: d59f0142b41eb72a82997a61a479937cf91ac2cf3adffdfd7e28f0fa9e9af6dacc0f106ce8db5afc9431b5b7278afb00fea3498859e4411b563cd67a47342c14
|
@@ -35,7 +35,7 @@ module Lookbook
|
|
35
35
|
alpine_component_name = x_data || @html_attrs&.dig(:"x-data") || alpine_component
|
36
36
|
if alpine_component_name.present?
|
37
37
|
args = Array.wrap(alpine_data)
|
38
|
-
args.any? ? "#{alpine_component_name}(#{safe_join(args)
|
38
|
+
args.any? ? "#{alpine_component_name}(#{safe_join(args)})" : alpine_component_name
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= render_component_tag class: "px-4 py-3" do %>
|
2
2
|
<div class="flex items-start max-w-[800px]" :class="isNarrowLayout && '!block'">
|
3
3
|
<label
|
4
|
-
for="param-<%=
|
4
|
+
for="param-<%= name %>"
|
5
5
|
class="block font-bold cursor-pointer flex-none py-2 w-[140px] truncate pr-2">
|
6
6
|
<%= label %>
|
7
7
|
</label>
|
@@ -27,12 +27,12 @@
|
|
27
27
|
<select
|
28
28
|
class="form-input"
|
29
29
|
x-bind="bindings.input || {}"
|
30
|
-
x-model="value"
|
30
|
+
x-model="value"
|
31
|
+
name="<%= name %>">
|
31
32
|
<%= options_for_select(@options || [], value) %>
|
32
33
|
</select>
|
33
34
|
|
34
35
|
<% elsif field_type == "toggle" %>
|
35
|
-
|
36
36
|
<button type="button"
|
37
37
|
class="<%= value == true ? "bg-lookbook-input-toggle-active" : "bg-lookbook-input-toggle" %> relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-input-border-focus"
|
38
38
|
role="switch"
|
@@ -42,7 +42,6 @@
|
|
42
42
|
class="<%= value == true ? "translate-x-5" : "translate-x-0" %> pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow ring-0 transition ease-in-out duration-200"
|
43
43
|
></span>
|
44
44
|
</button>
|
45
|
-
|
46
45
|
<% end %>
|
47
46
|
</div>
|
48
47
|
</div>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Lookbook
|
2
2
|
class ParamsEditor::Field::Component < Lookbook::BaseComponent
|
3
|
+
attr_reader :name
|
4
|
+
|
3
5
|
def initialize(input:, name:, default: nil, value: nil, input_type: nil, type: nil, options: nil, **html_attrs)
|
4
6
|
@input = input
|
5
7
|
@name = name
|
@@ -12,7 +14,7 @@ module Lookbook
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def label
|
15
|
-
|
17
|
+
name.titleize
|
16
18
|
end
|
17
19
|
|
18
20
|
def value
|
@@ -31,8 +33,8 @@ module Lookbook
|
|
31
33
|
protected
|
32
34
|
|
33
35
|
def alpine_data
|
34
|
-
escaped_value =
|
35
|
-
"{name: '#{
|
36
|
+
escaped_value = helpers.raw json_escape(value.to_json)
|
37
|
+
"{name: '#{name}', value: #{escaped_value}}"
|
36
38
|
end
|
37
39
|
|
38
40
|
def alpine_component
|
data/lib/lookbook/engine.rb
CHANGED
data/lib/lookbook/version.rb
CHANGED
@@ -1,18 +1,6 @@
|
|
1
1
|
require_relative "../lookbook"
|
2
2
|
|
3
3
|
namespace :lookbook do
|
4
|
-
desc "Run the rspec tests"
|
5
|
-
task :test do
|
6
|
-
sh "bundle exec rspec"
|
7
|
-
end
|
8
|
-
|
9
|
-
namespace :test do
|
10
|
-
desc "Start a server to view the test app"
|
11
|
-
task :serve do
|
12
|
-
sh "bundle exec rackup"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
4
|
namespace :previews do
|
17
5
|
desc "Preparse the previews"
|
18
6
|
task preparse: :environment do
|
@@ -20,21 +8,4 @@ namespace :lookbook do
|
|
20
8
|
puts "Lookbook preview parsing complete"
|
21
9
|
end
|
22
10
|
end
|
23
|
-
|
24
|
-
namespace :release do
|
25
|
-
desc "Bump the Lookbook engine version number"
|
26
|
-
task :bump_version, [:version] do |t, args|
|
27
|
-
filename = Lookbook::Engine.root.join("lib/lookbook/version.rb")
|
28
|
-
current_version = Lookbook::VERSION.to_s
|
29
|
-
new_version = args[:version].sub("v", "").tr("-", ".")
|
30
|
-
file = File.open(filename)
|
31
|
-
contents = file.read
|
32
|
-
File.write(filename, contents.gsub(current_version, new_version))
|
33
|
-
end
|
34
|
-
|
35
|
-
desc "Build Gem and push to RubyGems"
|
36
|
-
task :build_and_push do
|
37
|
-
sh("rake build && gem push pkg/lookbook-#{Lookbook::VERSION}.gem")
|
38
|
-
end
|
39
|
-
end
|
40
11
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{"mappings":"AAAA","sources":["app/assets/lookbook/css/themes/zinc.css"],"sourcesContent":[":root {\n --lookbook-white: theme(\"colors.white\");\n --lookbook-accent-50: theme(\"colors.zinc.50\");\n --lookbook-accent-100: theme(\"colors.zinc.100\");\n --lookbook-accent-200: theme(\"colors.zinc.200\");\n --lookbook-accent-300: theme(\"colors.zinc.300\");\n --lookbook-accent-400: theme(\"colors.zinc.400\");\n --lookbook-accent-500: theme(\"colors.zinc.500\");\n --lookbook-accent-600: theme(\"colors.zinc.600\");\n --lookbook-accent-700: theme(\"colors.zinc.700\");\n --lookbook-accent-800: theme(\"colors.zinc.800\");\n --lookbook-accent-900: theme(\"colors.zinc.900\");\n --lookbook-base-50: theme(\"colors.zinc.50\");\n --lookbook-base-100: theme(\"colors.zinc.100\");\n --lookbook-base-200: theme(\"colors.zinc.200\");\n --lookbook-base-300: theme(\"colors.zinc.300\");\n --lookbook-base-400: theme(\"colors.zinc.400\");\n --lookbook-base-500: theme(\"colors.zinc.500\");\n --lookbook-base-600: theme(\"colors.zinc.600\");\n --lookbook-base-700: theme(\"colors.zinc.700\");\n --lookbook-base-800: theme(\"colors.zinc.800\");\n --lookbook-base-900: theme(\"colors.zinc.900\");\n --lookbook-text: var(--lookbook-base-800);\n --lookbook-divider: var(--lookbook-base-300);\n --lookbook-icon-button-stroke: var(--lookbook-base-400);\n --lookbook-icon-button-stroke-hover: var(--lookbook-accent-600);\n --lookbook-tooltip-bg: var(--lookbook-accent-500);\n --lookbook-tooltip-text: var(--lookbook-white);\n --lookbook-scrollbar: var(--lookbook-base-200);\n --lookbook-scrollbar-hover: var(--lookbook-base-300);\n --lookbook-toolbar-bg: var(--lookbook-white);\n --lookbook-toolbar-divider: var(--lookbook-divider);\n --lookbook-nav-text: var(--lookbook-text);\n --lookbook-nav-toggle: var(--lookbook-base-500);\n --lookbook-nav-icon-stroke: var(--lookbook-accent-500);\n --lookbook-nav-item-hover: var(--lookbook-base-100);\n --lookbook-nav-item-active: var(--lookbook-accent-50);\n --lookbook-input-bg: var(--lookbook-white);\n --lookbook-input-border: var(--lookbook-base-300);\n --lookbook-input-border-focus: var(--lookbook-accent-200);\n --lookbook-input-text: var(--lookbook-base-600);\n --lookbook-input-text-placeholder: var(--lookbook-base-400);\n --lookbook-input-toggle: var(--lookbook-base-300);\n --lookbook-input-toggle-active: var(--lookbook-accent-500);\n --lookbook-prose-bg: var(--lookbook-white);\n --lookbook-prose-text: var(--lookbook-base-600);\n --lookbook-prose-link: var(--lookbook-accent-900);\n --lookbook-tabs-text: var(--lookbook-base-500);\n --lookbook-tabs-text-hover: var(--lookbook-base-700);\n --lookbook-tabs-text-disabled: var(--lookbook-base-300);\n --lookbook-tabs-border-active: var(--lookbook-accent-400);\n --lookbook-viewport-handle: var(--lookbook-white);\n --lookbook-viewport-handle-icon-stroke: var(--lookbook-base-300);\n --lookbook-viewport-handle-icon-stroke-hover: var(--lookbook-base-700);\n --lookbook-sidebar-bg: var(--lookbook-base-50);\n --lookbook-page-bg: var(--lookbook-white);\n --lookbook-drawer-bg: var(--lookbook-base-50);\n --lookbook-header-bg: var(--lookbook-accent-600);\n --lookbook-header-text: var(--lookbook-white);\n --lookbook-header-border: var(--lookbook-accent-700);\n --lookbook-blank-slate-title: var(--lookbook-accent-600);\n --lookbook-branding-text: var(--lookbook-header-text);\n --lookbook-draggable-hint: rgb(224 231 255 / 0.2);\n}\n"],"names":[],"version":3,"file":"zinc.css.map","sourceRoot":"../../../../"}
|
File without changes
|
@@ -7701,17 +7701,7 @@ function $5439cede634b2921$var$toCamel(s) {
|
|
7701
7701
|
}
|
7702
7702
|
|
7703
7703
|
|
7704
|
-
var $
|
7705
|
-
var $99486586f6691564$exports = {};
|
7706
|
-
|
7707
|
-
$parcel$defineInteropFlag($99486586f6691564$exports);
|
7708
|
-
|
7709
|
-
$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039);
|
7710
|
-
function $99486586f6691564$export$2e2bcd8739ae039() {
|
7711
|
-
return {};
|
7712
|
-
}
|
7713
|
-
|
7714
|
-
|
7704
|
+
var $730b795bb0498251$exports = {};
|
7715
7705
|
var $cbd28b10fa9798c7$exports = {};
|
7716
7706
|
|
7717
7707
|
$parcel$defineInteropFlag($cbd28b10fa9798c7$exports);
|
@@ -11364,6 +11354,72 @@ function $cbd28b10fa9798c7$export$2e2bcd8739ae039() {
|
|
11364
11354
|
}
|
11365
11355
|
|
11366
11356
|
|
11357
|
+
var $99486586f6691564$exports = {};
|
11358
|
+
|
11359
|
+
$parcel$defineInteropFlag($99486586f6691564$exports);
|
11360
|
+
|
11361
|
+
$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039);
|
11362
|
+
function $99486586f6691564$export$2e2bcd8739ae039() {
|
11363
|
+
return {};
|
11364
|
+
}
|
11365
|
+
|
11366
|
+
|
11367
|
+
var $47a1c62621be0c54$exports = {};
|
11368
|
+
|
11369
|
+
$parcel$defineInteropFlag($47a1c62621be0c54$exports);
|
11370
|
+
|
11371
|
+
$parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039);
|
11372
|
+
var $122263eab94cad08$exports = {};
|
11373
|
+
|
11374
|
+
$parcel$defineInteropFlag($122263eab94cad08$exports);
|
11375
|
+
|
11376
|
+
$parcel$export($122263eab94cad08$exports, "initClipboard", () => $122263eab94cad08$export$c6684e6159b21de3);
|
11377
|
+
$parcel$export($122263eab94cad08$exports, "default", () => $122263eab94cad08$export$2e2bcd8739ae039);
|
11378
|
+
|
11379
|
+
function $122263eab94cad08$export$c6684e6159b21de3(context = {}) {
|
11380
|
+
let copyTimeout = null;
|
11381
|
+
return Object.assign(context, {
|
11382
|
+
copied: false,
|
11383
|
+
async copyToClipboard (target = null) {
|
11384
|
+
let targetEl;
|
11385
|
+
if (this.$refs.copyTarget) targetEl = this.$refs.copyTarget;
|
11386
|
+
else if (typeof target === "string") targetEl = document.querySelector(target);
|
11387
|
+
if (!targetEl) {
|
11388
|
+
this.warn("Could not find copy target");
|
11389
|
+
return false;
|
11390
|
+
}
|
11391
|
+
const content = (0, $7ae6ae39c2ec9059$export$6cb344a21ca18aec)(targetEl.innerHTML.trim());
|
11392
|
+
await window.navigator.clipboard.writeText(content);
|
11393
|
+
this.copied = true;
|
11394
|
+
if (copyTimeout) clearTimeout(copyTimeout);
|
11395
|
+
copyTimeout = setTimeout(()=>{
|
11396
|
+
this.copied = false;
|
11397
|
+
this.onCopyComplete();
|
11398
|
+
}, 1000);
|
11399
|
+
return content;
|
11400
|
+
},
|
11401
|
+
onCopyComplete () {}
|
11402
|
+
});
|
11403
|
+
}
|
11404
|
+
function $122263eab94cad08$export$2e2bcd8739ae039() {
|
11405
|
+
return $122263eab94cad08$export$c6684e6159b21de3({});
|
11406
|
+
}
|
11407
|
+
|
11408
|
+
|
11409
|
+
|
11410
|
+
function $47a1c62621be0c54$export$2e2bcd8739ae039() {
|
11411
|
+
const button = (0, $cbd28b10fa9798c7$export$2e2bcd8739ae039)();
|
11412
|
+
return {
|
11413
|
+
...button,
|
11414
|
+
copied: false,
|
11415
|
+
init () {
|
11416
|
+
button.init.bind(this)();
|
11417
|
+
(0, $122263eab94cad08$export$c6684e6159b21de3)(this);
|
11418
|
+
}
|
11419
|
+
};
|
11420
|
+
}
|
11421
|
+
|
11422
|
+
|
11367
11423
|
var $e398acaded942bbe$exports = {};
|
11368
11424
|
|
11369
11425
|
$parcel$defineInteropFlag($e398acaded942bbe$exports);
|
@@ -11397,31 +11453,6 @@ function $e398acaded942bbe$export$2e2bcd8739ae039(targetSelector) {
|
|
11397
11453
|
}
|
11398
11454
|
|
11399
11455
|
|
11400
|
-
var $e9904a14dabf652d$exports = {};
|
11401
|
-
|
11402
|
-
$parcel$defineInteropFlag($e9904a14dabf652d$exports);
|
11403
|
-
|
11404
|
-
$parcel$export($e9904a14dabf652d$exports, "default", () => $e9904a14dabf652d$export$2e2bcd8739ae039);
|
11405
|
-
function $e9904a14dabf652d$export$2e2bcd8739ae039(store) {
|
11406
|
-
return {
|
11407
|
-
focussed: false,
|
11408
|
-
get active () {
|
11409
|
-
return store.active;
|
11410
|
-
},
|
11411
|
-
get text () {
|
11412
|
-
return store.text;
|
11413
|
-
},
|
11414
|
-
clear () {
|
11415
|
-
if (store.raw === "") this.$refs.input.blur();
|
11416
|
-
else store.raw = "";
|
11417
|
-
},
|
11418
|
-
focus () {
|
11419
|
-
this.$refs.input.focus();
|
11420
|
-
}
|
11421
|
-
};
|
11422
|
-
}
|
11423
|
-
|
11424
|
-
|
11425
11456
|
var $e1f51f020443edd4$exports = {};
|
11426
11457
|
|
11427
11458
|
$parcel$defineInteropFlag($e1f51f020443edd4$exports);
|
@@ -12287,57 +12318,26 @@ function $e1f51f020443edd4$export$2e2bcd8739ae039(id, embedStore) {
|
|
12287
12318
|
}
|
12288
12319
|
|
12289
12320
|
|
12290
|
-
var $
|
12291
|
-
|
12292
|
-
$parcel$defineInteropFlag($47a1c62621be0c54$exports);
|
12293
|
-
|
12294
|
-
$parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039);
|
12295
|
-
var $122263eab94cad08$exports = {};
|
12296
|
-
|
12297
|
-
$parcel$defineInteropFlag($122263eab94cad08$exports);
|
12298
|
-
|
12299
|
-
$parcel$export($122263eab94cad08$exports, "initClipboard", () => $122263eab94cad08$export$c6684e6159b21de3);
|
12300
|
-
$parcel$export($122263eab94cad08$exports, "default", () => $122263eab94cad08$export$2e2bcd8739ae039);
|
12301
|
-
|
12302
|
-
function $122263eab94cad08$export$c6684e6159b21de3(context = {}) {
|
12303
|
-
let copyTimeout = null;
|
12304
|
-
return Object.assign(context, {
|
12305
|
-
copied: false,
|
12306
|
-
async copyToClipboard (target = null) {
|
12307
|
-
let targetEl;
|
12308
|
-
if (this.$refs.copyTarget) targetEl = this.$refs.copyTarget;
|
12309
|
-
else if (typeof target === "string") targetEl = document.querySelector(target);
|
12310
|
-
if (!targetEl) {
|
12311
|
-
this.warn("Could not find copy target");
|
12312
|
-
return false;
|
12313
|
-
}
|
12314
|
-
const content = (0, $7ae6ae39c2ec9059$export$6cb344a21ca18aec)(targetEl.innerHTML.trim());
|
12315
|
-
await window.navigator.clipboard.writeText(content);
|
12316
|
-
this.copied = true;
|
12317
|
-
if (copyTimeout) clearTimeout(copyTimeout);
|
12318
|
-
copyTimeout = setTimeout(()=>{
|
12319
|
-
this.copied = false;
|
12320
|
-
this.onCopyComplete();
|
12321
|
-
}, 1000);
|
12322
|
-
return content;
|
12323
|
-
},
|
12324
|
-
onCopyComplete () {}
|
12325
|
-
});
|
12326
|
-
}
|
12327
|
-
function $122263eab94cad08$export$2e2bcd8739ae039() {
|
12328
|
-
return $122263eab94cad08$export$c6684e6159b21de3({});
|
12329
|
-
}
|
12330
|
-
|
12321
|
+
var $e9904a14dabf652d$exports = {};
|
12331
12322
|
|
12323
|
+
$parcel$defineInteropFlag($e9904a14dabf652d$exports);
|
12332
12324
|
|
12333
|
-
|
12334
|
-
|
12325
|
+
$parcel$export($e9904a14dabf652d$exports, "default", () => $e9904a14dabf652d$export$2e2bcd8739ae039);
|
12326
|
+
function $e9904a14dabf652d$export$2e2bcd8739ae039(store) {
|
12335
12327
|
return {
|
12336
|
-
|
12337
|
-
|
12338
|
-
|
12339
|
-
|
12340
|
-
|
12328
|
+
focussed: false,
|
12329
|
+
get active () {
|
12330
|
+
return store.active;
|
12331
|
+
},
|
12332
|
+
get text () {
|
12333
|
+
return store.text;
|
12334
|
+
},
|
12335
|
+
clear () {
|
12336
|
+
if (store.raw === "") this.$refs.input.blur();
|
12337
|
+
else store.raw = "";
|
12338
|
+
},
|
12339
|
+
focus () {
|
12340
|
+
this.$refs.input.focus();
|
12341
12341
|
}
|
12342
12342
|
};
|
12343
12343
|
}
|
@@ -13210,13 +13210,13 @@ function $6d64716f0b34fdf4$export$2e2bcd8739ae039(store) {
|
|
13210
13210
|
}
|
13211
13211
|
|
13212
13212
|
|
13213
|
-
$
|
13214
|
-
"code": $99486586f6691564$exports,
|
13213
|
+
$730b795bb0498251$exports = {
|
13215
13214
|
"button": $cbd28b10fa9798c7$exports,
|
13215
|
+
"code": $99486586f6691564$exports,
|
13216
|
+
"copy_button": $47a1c62621be0c54$exports,
|
13216
13217
|
"dimensions_display": $e398acaded942bbe$exports,
|
13217
|
-
"filter": $e9904a14dabf652d$exports,
|
13218
13218
|
"embed": $e1f51f020443edd4$exports,
|
13219
|
-
"
|
13219
|
+
"filter": $e9904a14dabf652d$exports,
|
13220
13220
|
"icon": $36506012e0c6e9e3$exports,
|
13221
13221
|
"nav": $d92d9d5253f84566$exports,
|
13222
13222
|
"params_editor": $b63b9c6d236b3f65$exports,
|
@@ -13367,7 +13367,7 @@ const $d73574cc5e9b9e72$var$prefix = window.APP_NAME;
|
|
13367
13367
|
// Components
|
13368
13368
|
(0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $d709d0f4027033b2$export$2e2bcd8739ae039));
|
13369
13369
|
[
|
13370
|
-
$
|
13370
|
+
$730b795bb0498251$exports,
|
13371
13371
|
$e4eab7529959b73b$exports,
|
13372
13372
|
$4979d2d897a1c01f$exports
|
13373
13373
|
].forEach((scripts)=>{
|