coveragebook_components 0.5.5 → 0.5.7
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/assets/build/coco/app.css +400 -70
- data/app/assets/build/coco/app.js +24 -5
- data/app/assets/build/coco/book.css +347 -62
- data/app/assets/build/coco/book.js +3 -2
- data/app/assets/build/coco/img/slides/one-col-media-layout.svg +3 -0
- data/app/assets/build/coco/img/slides/one-col-text-layout.svg +3 -0
- data/app/assets/build/coco/img/slides/one-col-title-layout.svg +4 -0
- data/app/assets/build/coco/img/slides/two-col-media-layout.svg +3 -0
- data/app/assets/build/coco/img/slides/two-col-mixed-layout.svg +5 -0
- data/app/assets/build/coco/img/slides/two-col-text-layout.svg +3 -0
- data/app/assets/build/coco/img/test/cb-logo.svg +8 -0
- data/app/assets/build/coco/img/test/slides/slide-bg.jpg +0 -0
- data/app/assets/build/coco/img/test/slides/slide-foreground-landscape.jpg +0 -0
- data/app/assets/build/coco/img/test/slides/slide-foreground-portrait.jpg +0 -0
- data/app/assets/img/slides/one-col-media-layout.svg +3 -0
- data/app/assets/img/slides/one-col-text-layout.svg +3 -0
- data/app/assets/img/slides/one-col-title-layout.svg +4 -0
- data/app/assets/img/slides/two-col-media-layout.svg +3 -0
- data/app/assets/img/slides/two-col-mixed-layout.svg +5 -0
- data/app/assets/img/slides/two-col-text-layout.svg +3 -0
- data/app/assets/img/test/cb-logo.svg +8 -0
- data/app/assets/img/test/slides/slide-bg.jpg +0 -0
- data/app/assets/img/test/slides/slide-foreground-landscape.jpg +0 -0
- data/app/assets/img/test/slides/slide-foreground-portrait.jpg +0 -0
- data/app/assets/js/libs/alpine/plugins/dropdown.js +1 -0
- data/app/components/coco/app/elements/button/button.css +10 -1
- data/app/components/coco/app/elements/button/button.rb +4 -0
- data/app/components/coco/app/elements/button_group/button_group.css +19 -0
- data/app/components/coco/app/elements/button_group/button_group.rb +10 -0
- data/app/components/coco/app/elements/image_picker_button/image_picker_button.rb +0 -20
- data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.css +74 -0
- data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb +31 -0
- data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.js +17 -0
- data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.rb +37 -0
- data/app/components/coco/base/button/button.rb +0 -5
- data/app/components/coco/base/svg/svg.html.erb +1 -0
- data/app/components/coco/base/svg/svg.rb +29 -0
- data/app/components/coco/book/blocks/slides/editable_slide/editable_slide.css +243 -37
- data/app/components/coco/book/blocks/slides/editable_slide/editable_slide.html.erb +30 -12
- data/app/components/coco/book/blocks/slides/editable_slide/editable_slide.rb +28 -1
- data/app/components/coco/concerns/acts_as_button_group.rb +5 -0
- data/app/helpers/coco/app_helper.rb +4 -0
- data/app/helpers/coco/base_helper.rb +4 -0
- data/lib/coco/options/group.rb +1 -34
- data/lib/coco/options/option.rb +0 -13
- data/lib/coco.rb +1 -1
- metadata +29 -7
- data/app/assets/build/coco/img/slide-bg.jpg +0 -0
- data/app/assets/img/slide-bg.jpg +0 -0
- data/config/credentials/production.key +0 -1
- data/config/credentials/production.yml.enc +0 -1
@@ -1,40 +1,46 @@
|
|
1
1
|
@layer components {
|
2
2
|
[data-coco][data-component="book-editable-slide"] {
|
3
3
|
/*
|
4
|
-
*
|
5
|
-
*
|
4
|
+
* slide-padding-md at max (1480px): 240px (16.2%)
|
5
|
+
* slide-padding-md at min (320px): 16.2% x 320px = 52px
|
6
6
|
*/
|
7
|
-
--
|
7
|
+
--slide-padding-lg: max(38px, clamp(52px, 16.2cqw, 240px));
|
8
8
|
|
9
9
|
/*
|
10
|
-
*
|
11
|
-
*
|
10
|
+
* slide-padding-md at max (1480px): 120px (8.1%)
|
11
|
+
* slide-padding-md at min (320px): 8.1% x 320px = 26px
|
12
12
|
*/
|
13
|
-
--
|
13
|
+
--slide-padding-md: max(24px, clamp(26px, 8.1cqw, 120px));
|
14
14
|
|
15
15
|
/*
|
16
|
-
*
|
17
|
-
*
|
18
|
-
|
16
|
+
* slide-padding-sm at max (1480px): 80px (5.4%)
|
17
|
+
* slide-padding-sm at min (320px): 5.4% x 320px = 17px
|
18
|
+
*/
|
19
|
+
--slide-padding-sm: max(24px, clamp(17px, 5.4cqw, 80px));
|
20
|
+
|
21
|
+
/*
|
22
|
+
* Small title font size at max (1480px): 64px (4.3%)
|
23
|
+
* Small title font size at min (320px): 4.3% x 320px = 13.8px
|
19
24
|
*/
|
20
25
|
--title-font-size: max(
|
21
|
-
|
22
|
-
clamp(
|
26
|
+
32px,
|
27
|
+
clamp(13.8px, 4.3cqw, theme(fontSize.display-3))
|
23
28
|
);
|
24
29
|
|
25
30
|
/*
|
26
|
-
* Text font size at max (1480px):
|
27
|
-
* Text font size at min (320px):
|
28
|
-
* Text font size at reflow (700px): 14px
|
31
|
+
* Text font size at max (1480px): 24px / 1.62%
|
32
|
+
* Text font size at min (320px): 1.62% x 320px = 5.2px
|
29
33
|
*/
|
30
34
|
--text-font-size: max(
|
31
|
-
|
32
|
-
clamp(
|
35
|
+
16px,
|
36
|
+
clamp(5.2px, 1.62cqw, theme(fontSize.subheading-2))
|
33
37
|
);
|
34
38
|
|
35
39
|
/* ------------- */
|
36
40
|
|
37
|
-
@apply
|
41
|
+
@apply relative rounded-md @container;
|
42
|
+
@apply bg-white bg-no-repeat bg-cover;
|
43
|
+
|
38
44
|
min-width: 320px;
|
39
45
|
|
40
46
|
.slide-aspect {
|
@@ -42,13 +48,14 @@
|
|
42
48
|
}
|
43
49
|
|
44
50
|
.slide-container {
|
45
|
-
@apply @slide-fluid:absolute @slide-fluid:inset-0;
|
46
|
-
@apply
|
51
|
+
@apply @slide-fluid:absolute @slide-fluid:inset-0 overflow-hidden;
|
52
|
+
@apply px-6 py-10 @slide-fluid:p-[var(--slide-padding-md)];
|
47
53
|
}
|
48
54
|
|
49
55
|
[data-slide-region],
|
56
|
+
.slide-header,
|
50
57
|
.slide-text,
|
51
|
-
.slide-
|
58
|
+
.slide-image {
|
52
59
|
@apply hidden;
|
53
60
|
}
|
54
61
|
|
@@ -56,10 +63,53 @@
|
|
56
63
|
@apply contents;
|
57
64
|
}
|
58
65
|
|
66
|
+
.slide-title {
|
67
|
+
@apply font-bold text-current;
|
68
|
+
overflow-wrap: anywhere;
|
69
|
+
line-height: 1.1;
|
70
|
+
font-size: var(--title-font-size);
|
71
|
+
}
|
72
|
+
|
73
|
+
.slide-text {
|
74
|
+
@apply text-current;
|
75
|
+
line-height: 1.5;
|
76
|
+
font-size: var(--text-font-size);
|
77
|
+
}
|
78
|
+
|
79
|
+
.slide-media {
|
80
|
+
@apply w-full;
|
81
|
+
|
82
|
+
img {
|
83
|
+
@apply w-full h-full object-contain;
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
59
87
|
/* layouts */
|
60
88
|
|
61
|
-
&[data-layout="
|
62
|
-
|
89
|
+
&[data-layout="one-col-title"] {
|
90
|
+
/*
|
91
|
+
* Title font size at max (1480px): 80px (5.4%)
|
92
|
+
* Title font size at min (320px): 5.4% x 320px = 17px
|
93
|
+
*/
|
94
|
+
--title-font-size: max(
|
95
|
+
35px,
|
96
|
+
clamp(17px, 5.4cqw, theme(fontSize.display-2))
|
97
|
+
);
|
98
|
+
|
99
|
+
/*
|
100
|
+
* Text font size at max (1480px): 32px / 2.16%
|
101
|
+
* Text font size at min (320px): 2.16% x 320px = 7px
|
102
|
+
*/
|
103
|
+
--text-font-size: max(
|
104
|
+
16px,
|
105
|
+
clamp(7px, 2.16cqw, theme(fontSize.subheading-1))
|
106
|
+
);
|
107
|
+
|
108
|
+
@apply text-center;
|
109
|
+
|
110
|
+
.slide-container {
|
111
|
+
@apply @slide-fluid:px-[var(--slide-padding-lg)];
|
112
|
+
}
|
63
113
|
|
64
114
|
[data-slide-region="content-1"] {
|
65
115
|
@apply block;
|
@@ -69,17 +119,16 @@
|
|
69
119
|
}
|
70
120
|
}
|
71
121
|
|
72
|
-
.slide-
|
73
|
-
|
74
|
-
|
75
|
-
|
122
|
+
&.with-title [data-slide-region="content-1"] .slide-text {
|
123
|
+
margin-top: 0.875em;
|
124
|
+
}
|
125
|
+
|
126
|
+
.slide-layout {
|
127
|
+
@apply flex flex-col items-center justify-center text-center w-full h-full;
|
76
128
|
}
|
77
129
|
|
78
130
|
.slide-header {
|
79
|
-
@apply w-full;
|
80
|
-
margin-bottom: 0.3em;
|
81
|
-
line-height: 1.1;
|
82
|
-
font-size: var(--title-font-size);
|
131
|
+
@apply w-full block;
|
83
132
|
}
|
84
133
|
|
85
134
|
.slide-content {
|
@@ -91,16 +140,173 @@
|
|
91
140
|
@apply mx-auto w-full max-w-[360px] @slide-fluid:max-w-full;
|
92
141
|
}
|
93
142
|
|
143
|
+
.slide-text {
|
144
|
+
line-height: 1.4;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
&[data-layout="one-col-text"] {
|
149
|
+
.slide-container {
|
150
|
+
@apply flex items-center;
|
151
|
+
}
|
152
|
+
|
153
|
+
.slide-layout {
|
154
|
+
@apply @slide-fluid:grid w-full;
|
155
|
+
height: min-content;
|
156
|
+
grid-template-columns: 1fr;
|
157
|
+
grid-template-rows: auto;
|
158
|
+
grid-gap: var(--slide-padding-sm);
|
159
|
+
}
|
160
|
+
|
161
|
+
&.with-title {
|
162
|
+
.slide-container {
|
163
|
+
@apply block;
|
164
|
+
}
|
165
|
+
|
166
|
+
.slide-layout {
|
167
|
+
@apply h-full;
|
168
|
+
grid-template-rows: min-content auto;
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
.slide-header {
|
173
|
+
@apply w-full block;
|
174
|
+
@apply mb-6 @slide-fluid:mb-0;
|
175
|
+
}
|
176
|
+
|
177
|
+
[data-slide-region="content-1"] {
|
178
|
+
@apply block;
|
179
|
+
|
180
|
+
.slide-text {
|
181
|
+
@apply block;
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
&[data-layout="one-col-media"] {
|
187
|
+
.slide-container {
|
188
|
+
@apply py-6 @slide-fluid:py-[var(--slide-padding-sm)];
|
189
|
+
}
|
190
|
+
|
191
|
+
.slide-layout,
|
192
|
+
.slide-content {
|
193
|
+
@apply h-full;
|
194
|
+
}
|
195
|
+
|
196
|
+
[data-slide-region="content-1"] {
|
197
|
+
@apply block;
|
198
|
+
|
199
|
+
.slide-media {
|
200
|
+
@apply block w-full h-full;
|
201
|
+
|
202
|
+
img {
|
203
|
+
@apply h-full w-full object-contain;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
}
|
207
|
+
}
|
208
|
+
|
209
|
+
&[data-layout="two-col-text"],
|
210
|
+
&[data-layout="two-col-media"] {
|
211
|
+
.slide-container {
|
212
|
+
@apply flex items-center;
|
213
|
+
@apply py-6 @slide-fluid:py-[var(--slide-padding-sm)];
|
214
|
+
}
|
215
|
+
|
216
|
+
.slide-layout {
|
217
|
+
@apply @slide-fluid:grid w-full;
|
218
|
+
height: min-content;
|
219
|
+
grid-template-columns: 1fr 1fr;
|
220
|
+
grid-template-rows: auto;
|
221
|
+
grid-gap: var(--slide-padding-sm);
|
222
|
+
}
|
223
|
+
|
224
|
+
&.with-title {
|
225
|
+
.slide-container {
|
226
|
+
@apply block;
|
227
|
+
}
|
228
|
+
|
229
|
+
.slide-layout {
|
230
|
+
@apply h-full;
|
231
|
+
grid-template-rows: min-content auto;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
.slide-header {
|
236
|
+
@apply w-full block;
|
237
|
+
@apply mb-10 @slide-fluid:mb-0;
|
238
|
+
grid-column-start: 1;
|
239
|
+
grid-column-end: -1;
|
240
|
+
}
|
241
|
+
|
242
|
+
[data-slide-region="content-1"],
|
243
|
+
[data-slide-region="content-2"] {
|
244
|
+
@apply block;
|
245
|
+
|
246
|
+
.slide-text,
|
247
|
+
.slide-media {
|
248
|
+
@apply block;
|
249
|
+
}
|
250
|
+
}
|
251
|
+
|
252
|
+
[data-slide-region="content-1"] {
|
253
|
+
@apply mb-[var(--slide-padding-sm)] @slide-fluid:mb-0;
|
254
|
+
}
|
255
|
+
}
|
256
|
+
|
257
|
+
&[data-layout="two-col-media"] {
|
258
|
+
.slide-layout {
|
259
|
+
@apply @slide-fluid:h-full;
|
260
|
+
}
|
261
|
+
|
262
|
+
.slide-content {
|
263
|
+
@apply relative @slide-fluid:flex @slide-fluid:items-center @slide-fluid:h-full;
|
264
|
+
}
|
265
|
+
|
266
|
+
.slide-media {
|
267
|
+
@apply @slide-fluid:absolute @slide-fluid:inset-0;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
&[data-layout="two-col-mixed"] {
|
272
|
+
.slide-layout {
|
273
|
+
@apply @slide-fluid:grid w-full h-full;
|
274
|
+
grid-template-columns: 1fr 1fr;
|
275
|
+
grid-template-rows: auto;
|
276
|
+
grid-gap: var(--slide-padding-sm);
|
277
|
+
}
|
278
|
+
|
279
|
+
.slide-group {
|
280
|
+
@apply flex flex-col justify-center;
|
281
|
+
@apply mb-[var(--slide-padding-sm)] @slide-fluid:mb-0;
|
282
|
+
}
|
283
|
+
|
284
|
+
.slide-header {
|
285
|
+
@apply w-full block;
|
286
|
+
}
|
287
|
+
|
94
288
|
.slide-title {
|
95
|
-
|
96
|
-
overflow-wrap: anywhere;
|
97
|
-
line-height: 1.1;
|
289
|
+
margin-bottom: 0.5em;
|
98
290
|
}
|
99
291
|
|
100
|
-
|
101
|
-
@apply
|
102
|
-
|
103
|
-
|
292
|
+
[data-slide-region="content-1"] {
|
293
|
+
@apply block;
|
294
|
+
|
295
|
+
.slide-text {
|
296
|
+
@apply block;
|
297
|
+
}
|
298
|
+
}
|
299
|
+
|
300
|
+
[data-slide-region="content-2"] {
|
301
|
+
@apply relative block @slide-fluid:flex @slide-fluid:items-center @slide-fluid:h-full;
|
302
|
+
|
303
|
+
.slide-media {
|
304
|
+
@apply block @slide-fluid:absolute @slide-fluid:inset-0;
|
305
|
+
|
306
|
+
img {
|
307
|
+
@apply h-full w-full object-contain;
|
308
|
+
}
|
309
|
+
}
|
104
310
|
}
|
105
311
|
}
|
106
312
|
}
|
@@ -1,21 +1,39 @@
|
|
1
|
-
<%= render component_tag(style: slide_styles) do %>
|
1
|
+
<%= render component_tag(style: slide_styles, class: {"with-title": title?}) do %>
|
2
2
|
<div class="slide-aspect">
|
3
3
|
<div class="slide-container">
|
4
4
|
|
5
|
-
<div class="slide-
|
6
|
-
<
|
5
|
+
<div class="slide-layout">
|
6
|
+
<div class="slide-group">
|
7
7
|
<% if title? %>
|
8
|
-
<
|
9
|
-
|
10
|
-
|
8
|
+
<header class="slide-header">
|
9
|
+
<h3 class="slide-title" data-role="title">
|
10
|
+
<%= title %>
|
11
|
+
</h3>
|
12
|
+
</header>
|
11
13
|
<% end %>
|
12
|
-
</header>
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
<div class="slide-content" data-slide-region="content-1">
|
16
|
+
<% if text_1? %>
|
17
|
+
<div class="slide-text" data-role="text-1">
|
18
|
+
<%= text_1 %>
|
19
|
+
</div>
|
20
|
+
<% elsif image_1? %>
|
21
|
+
<div class="slide-media" data-role="media-1">
|
22
|
+
<img src="<%= image_1 %>">
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="slide-content" data-slide-region="content-2">
|
29
|
+
<% if text_2? %>
|
30
|
+
<div class="slide-text" data-role="text-2">
|
31
|
+
<%= text_2 %>
|
32
|
+
</div>
|
33
|
+
<% elsif image_2? %>
|
34
|
+
<div class="slide-media" data-role="media-2">
|
35
|
+
<img src="<%= image_2 %>">
|
36
|
+
</div>
|
19
37
|
<% end %>
|
20
38
|
</div>
|
21
39
|
</div>
|
@@ -7,7 +7,7 @@ module Coco
|
|
7
7
|
include Coco::TagHelper
|
8
8
|
include Coco::FormatHelper
|
9
9
|
|
10
|
-
accepts_option :layout, from: %w[
|
10
|
+
accepts_option :layout, from: %w[one-col-title one-col-text one-col-media two-col-text two-col-media two-col-mixed], default: "one-col-title"
|
11
11
|
|
12
12
|
renders_one :title,
|
13
13
|
->(&block) do
|
@@ -21,6 +21,33 @@ module Coco
|
|
21
21
|
block.call
|
22
22
|
end
|
23
23
|
|
24
|
+
renders_one :text_2,
|
25
|
+
->(&block) do
|
26
|
+
@has_content = true
|
27
|
+
block.call
|
28
|
+
end
|
29
|
+
|
30
|
+
renders_one :image_1,
|
31
|
+
->(href:) do
|
32
|
+
@has_content = true
|
33
|
+
href
|
34
|
+
end
|
35
|
+
|
36
|
+
renders_one :image_2,
|
37
|
+
->(href:) do
|
38
|
+
@has_content = true
|
39
|
+
href
|
40
|
+
end
|
41
|
+
|
42
|
+
before_initialize do |kwargs|
|
43
|
+
if kwargs[:layout]
|
44
|
+
kwargs[:layout] = kwargs[:layout].to_s.tr("_", "-")
|
45
|
+
kwargs[:layout] = "one-col-title" if kwargs[:layout] == "basic" # handle legacy layout name
|
46
|
+
end
|
47
|
+
|
48
|
+
kwargs
|
49
|
+
end
|
50
|
+
|
24
51
|
attr_reader :bg_image, :text_color_hex, :bg_color_hex
|
25
52
|
|
26
53
|
def initialize(bg_image: nil, bg_color_hex: nil, text_color_hex: nil, render_empty: false, **kwargs)
|
@@ -16,6 +16,7 @@ module Coco
|
|
16
16
|
},
|
17
17
|
menu_button: ->(**kwargs) { App::Elements::MenuButton.new(**button_kwargs(kwargs, :menu)) },
|
18
18
|
color_picker_button: ->(**kwargs) { App::Elements::ColorPickerButton.new(**button_kwargs(kwargs, :color_picker)) },
|
19
|
+
layout_picker_button: ->(**kwargs) { App::Elements::LayoutPickerButton.new(**button_kwargs(kwargs, :layout_picker)) },
|
19
20
|
image_picker_button: ->(**kwargs) { App::Elements::ImagePickerButton.new(**button_kwargs(kwargs, :image_picker)) },
|
20
21
|
dropdown_button: ->(**kwargs) { App::Elements::DropdownButton.new(**button_kwargs(kwargs, :dropdown)) }
|
21
22
|
}
|
@@ -41,6 +42,10 @@ module Coco
|
|
41
42
|
with_item_image_picker_button(...)
|
42
43
|
end
|
43
44
|
|
45
|
+
def with_layout_picker_button(...)
|
46
|
+
with_item_layout_picker_button(...)
|
47
|
+
end
|
48
|
+
|
44
49
|
def with_dropdown_button(...)
|
45
50
|
with_item_dropdown_button(...)
|
46
51
|
end
|
@@ -39,6 +39,10 @@ module Coco
|
|
39
39
|
render Coco::App::Elements::ImagePickerButton.new(**kwargs), &block
|
40
40
|
end
|
41
41
|
|
42
|
+
def coco_layout_picker_button(**kwargs, &block)
|
43
|
+
render Coco::App::Elements::LayoutPickerButton.new(**kwargs), &block
|
44
|
+
end
|
45
|
+
|
42
46
|
def coco_dropdown_button(**kwargs, &block)
|
43
47
|
render Coco::App::Elements::DropdownButton.new(**kwargs), &block
|
44
48
|
end
|
data/lib/coco/options/group.rb
CHANGED
@@ -130,17 +130,8 @@ module Coco
|
|
130
130
|
end.to_h
|
131
131
|
end
|
132
132
|
|
133
|
-
def to_h
|
134
|
-
{
|
135
|
-
name: name,
|
136
|
-
alias: @alias,
|
137
|
-
shorthand: shorthand,
|
138
|
-
options: items.map(&:to_h)
|
139
|
-
}
|
140
|
-
end
|
141
|
-
|
142
133
|
def clone
|
143
|
-
|
134
|
+
Marshal.load(Marshal.dump(self))
|
144
135
|
end
|
145
136
|
|
146
137
|
protected
|
@@ -156,30 +147,6 @@ module Coco
|
|
156
147
|
def groups
|
157
148
|
items.filter { _1.is_a?(Group) }
|
158
149
|
end
|
159
|
-
|
160
|
-
class << self
|
161
|
-
# Recursively create an options tree from a hash.
|
162
|
-
#
|
163
|
-
# {
|
164
|
-
# name: :root,
|
165
|
-
# options: [
|
166
|
-
# { name: :size, default: "md" },
|
167
|
-
# { name: :dropdown, options: [{name: :placement, from: [:left, :right]}] }
|
168
|
-
# }
|
169
|
-
# }
|
170
|
-
def from_h(data)
|
171
|
-
group = Group.new(data.fetch(:name), **data.except(:options, :name))
|
172
|
-
data.fetch(:options, []).each do |option|
|
173
|
-
if option.key?(:options)
|
174
|
-
subgroup = Group.from_h(option)
|
175
|
-
group.add_group(subgroup)
|
176
|
-
else
|
177
|
-
group.add_option(option.fetch(:name), **option.except(:name))
|
178
|
-
end
|
179
|
-
end
|
180
|
-
group
|
181
|
-
end
|
182
|
-
end
|
183
150
|
end
|
184
151
|
end
|
185
152
|
end
|
data/lib/coco/options/option.rb
CHANGED
@@ -40,19 +40,6 @@ module Coco
|
|
40
40
|
end
|
41
41
|
@value = val
|
42
42
|
end
|
43
|
-
|
44
|
-
def to_h
|
45
|
-
h = {
|
46
|
-
name: name,
|
47
|
-
alias: @alias,
|
48
|
-
required: required?,
|
49
|
-
private: private?,
|
50
|
-
from: from,
|
51
|
-
default: default
|
52
|
-
}
|
53
|
-
h[:value] = @value unless undefined?
|
54
|
-
h
|
55
|
-
end
|
56
43
|
end
|
57
44
|
end
|
58
45
|
end
|
data/lib/coco.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coveragebook_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Perkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07
|
11
|
+
date: 2023-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1257,7 +1257,16 @@ files:
|
|
1257
1257
|
- app/assets/build/coco/icons/zoom-out.svg
|
1258
1258
|
- app/assets/build/coco/img/coveragebook-landscape-white.svg
|
1259
1259
|
- app/assets/build/coco/img/coveragebook-logomark-white.svg
|
1260
|
-
- app/assets/build/coco/img/
|
1260
|
+
- app/assets/build/coco/img/slides/one-col-media-layout.svg
|
1261
|
+
- app/assets/build/coco/img/slides/one-col-text-layout.svg
|
1262
|
+
- app/assets/build/coco/img/slides/one-col-title-layout.svg
|
1263
|
+
- app/assets/build/coco/img/slides/two-col-media-layout.svg
|
1264
|
+
- app/assets/build/coco/img/slides/two-col-mixed-layout.svg
|
1265
|
+
- app/assets/build/coco/img/slides/two-col-text-layout.svg
|
1266
|
+
- app/assets/build/coco/img/test/cb-logo.svg
|
1267
|
+
- app/assets/build/coco/img/test/slides/slide-bg.jpg
|
1268
|
+
- app/assets/build/coco/img/test/slides/slide-foreground-landscape.jpg
|
1269
|
+
- app/assets/build/coco/img/test/slides/slide-foreground-portrait.jpg
|
1261
1270
|
- app/assets/config/coco/manifest.js
|
1262
1271
|
- app/assets/css/app.css
|
1263
1272
|
- app/assets/css/app/config.css
|
@@ -1274,7 +1283,16 @@ files:
|
|
1274
1283
|
- app/assets/css/libs/tippy.css
|
1275
1284
|
- app/assets/img/coveragebook-landscape-white.svg
|
1276
1285
|
- app/assets/img/coveragebook-logomark-white.svg
|
1277
|
-
- app/assets/img/
|
1286
|
+
- app/assets/img/slides/one-col-media-layout.svg
|
1287
|
+
- app/assets/img/slides/one-col-text-layout.svg
|
1288
|
+
- app/assets/img/slides/one-col-title-layout.svg
|
1289
|
+
- app/assets/img/slides/two-col-media-layout.svg
|
1290
|
+
- app/assets/img/slides/two-col-mixed-layout.svg
|
1291
|
+
- app/assets/img/slides/two-col-text-layout.svg
|
1292
|
+
- app/assets/img/test/cb-logo.svg
|
1293
|
+
- app/assets/img/test/slides/slide-bg.jpg
|
1294
|
+
- app/assets/img/test/slides/slide-foreground-landscape.jpg
|
1295
|
+
- app/assets/img/test/slides/slide-foreground-portrait.jpg
|
1278
1296
|
- app/assets/js/app.js
|
1279
1297
|
- app/assets/js/app/components.js
|
1280
1298
|
- app/assets/js/app/mixins/dropdown.js
|
@@ -1358,6 +1376,10 @@ files:
|
|
1358
1376
|
- app/components/coco/app/elements/image_picker_button/image_picker_button.html.erb
|
1359
1377
|
- app/components/coco/app/elements/image_picker_button/image_picker_button.js
|
1360
1378
|
- app/components/coco/app/elements/image_picker_button/image_picker_button.rb
|
1379
|
+
- app/components/coco/app/elements/layout_picker_button/layout_picker_button.css
|
1380
|
+
- app/components/coco/app/elements/layout_picker_button/layout_picker_button.html.erb
|
1381
|
+
- app/components/coco/app/elements/layout_picker_button/layout_picker_button.js
|
1382
|
+
- app/components/coco/app/elements/layout_picker_button/layout_picker_button.rb
|
1361
1383
|
- app/components/coco/app/elements/link/link.css
|
1362
1384
|
- app/components/coco/app/elements/link/link.rb
|
1363
1385
|
- app/components/coco/app/elements/menu/menu.css
|
@@ -1454,6 +1476,8 @@ files:
|
|
1454
1476
|
- app/components/coco/base/placeholder/placeholder.css
|
1455
1477
|
- app/components/coco/base/placeholder/placeholder.html.erb
|
1456
1478
|
- app/components/coco/base/placeholder/placeholder.rb
|
1479
|
+
- app/components/coco/base/svg/svg.html.erb
|
1480
|
+
- app/components/coco/base/svg/svg.rb
|
1457
1481
|
- app/components/coco/book/blocks/slides/editable_slide/editable_slide.css
|
1458
1482
|
- app/components/coco/book/blocks/slides/editable_slide/editable_slide.html.erb
|
1459
1483
|
- app/components/coco/book/blocks/slides/editable_slide/editable_slide.rb
|
@@ -1489,8 +1513,6 @@ files:
|
|
1489
1513
|
- app/helpers/coco/integration_helper.rb
|
1490
1514
|
- app/helpers/coco/tag_helper.rb
|
1491
1515
|
- app/helpers/coco/url_helper.rb
|
1492
|
-
- config/credentials/production.key
|
1493
|
-
- config/credentials/production.yml.enc
|
1494
1516
|
- config/icons.json
|
1495
1517
|
- config/locales/coco.en.yml
|
1496
1518
|
- config/tailwind.app.config.cjs
|
@@ -1542,7 +1564,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1542
1564
|
- !ruby/object:Gem::Version
|
1543
1565
|
version: '0'
|
1544
1566
|
requirements: []
|
1545
|
-
rubygems_version: 3.4.
|
1567
|
+
rubygems_version: 3.4.17
|
1546
1568
|
signing_key:
|
1547
1569
|
specification_version: 4
|
1548
1570
|
summary: CoverageBook component library
|
Binary file
|
data/app/assets/img/slide-bg.jpg
DELETED
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
265f649a303f0c2cbbfc9cfece75a181
|
@@ -1 +0,0 @@
|
|
1
|
-
j8VyKMx4mwRZArG1zS/oqUw1F6/UD0hQQ5sujzeTTBlNAuCTkLiuoiyAXnJV9FtR90T765ll/50wFbw0MFtk8nAzPJg=--TOqZsXP2UCs2CSMx--xYL00fHdXoCd+/xpGro01g==
|