coveragebook_components 0.16.0 → 0.17.0
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/coco.css +1 -3
- data/app/assets/build/coco/coco.js +11199 -10947
- data/app/assets/build/coco/tailwind.preset.js +7 -6
- data/app/assets/css/base/setup.css +0 -32
- data/app/assets/css/coco.css +33 -2
- data/app/assets/js/base/tippy/plugins/hide_on_esc.js +3 -1
- data/app/assets/js/coco/coco.js +0 -9
- data/app/assets/js/coco.js +5 -0
- data/app/assets/js/helpers/index.js +10 -2
- data/app/components/coco/buttons/layout_picker_button/layout_picker_button.html.erb +5 -1
- data/app/components/coco/buttons/layout_picker_button/layout_picker_button.rb +2 -2
- data/app/components/coco/component.rb +1 -1
- data/app/components/coco/concerns/acts_as_field_with_options.rb +0 -1
- data/app/components/coco/fields/button_component.rb +1 -1
- data/app/components/coco/fields/submit_component.rb +1 -1
- data/app/helpers/coco/components_helper.rb +253 -3
- data/app/helpers/coco/integration_helper.rb +6 -6
- data/config/locales/coco.en.yml +0 -18
- data/config/tailwind.preset.js +7 -6
- data/lib/coco/engine.rb +0 -4
- data/lib/coco.rb +1 -1
- metadata +2 -65
- data/app/assets/build/coco/app.css +0 -9619
- data/app/assets/build/coco/app.js +0 -25150
- data/app/assets/build/coco/book.css +0 -7453
- data/app/assets/build/coco/book.js +0 -16552
- data/app/assets/css/app.css +0 -3
- data/app/assets/css/book.css +0 -3
- data/app/assets/js/app.js +0 -11
- data/app/assets/js/book.js +0 -9
- data/app/assets/js/helpers/screenshot.js +0 -42
- data/app/assets/js/helpers/turbo_events.js +0 -13
- data/app/components/coco/app/application_layout/application_layout.css +0 -122
- data/app/components/coco/app/application_layout/application_layout.html.erb +0 -32
- data/app/components/coco/app/application_layout/application_layout.js +0 -36
- data/app/components/coco/app/application_layout/application_layout.rb +0 -16
- data/app/components/coco/app/contact_callout/contact_callout.css +0 -119
- data/app/components/coco/app/contact_callout/contact_callout.html.erb +0 -28
- data/app/components/coco/app/contact_callout/contact_callout.rb +0 -21
- data/app/components/coco/app/faqs/faqs.css +0 -38
- data/app/components/coco/app/faqs/faqs.html.erb +0 -12
- data/app/components/coco/app/faqs/faqs.rb +0 -14
- data/app/components/coco/app/header/header.css +0 -47
- data/app/components/coco/app/header/header.html.erb +0 -30
- data/app/components/coco/app/header/header.js +0 -11
- data/app/components/coco/app/header/header.rb +0 -33
- data/app/components/coco/app/nav_drawer/nav_drawer.css +0 -58
- data/app/components/coco/app/nav_drawer/nav_drawer.html.erb +0 -16
- data/app/components/coco/app/nav_drawer/nav_drawer.js +0 -24
- data/app/components/coco/app/nav_drawer/nav_drawer.rb +0 -32
- data/app/components/coco/app/plan_card/plan_card.css +0 -132
- data/app/components/coco/app/plan_card/plan_card.html.erb +0 -36
- data/app/components/coco/app/plan_card/plan_card.rb +0 -66
- data/app/components/coco/app/plan_confirmation/plan_confirmation.css +0 -53
- data/app/components/coco/app/plan_confirmation/plan_confirmation.html.erb +0 -16
- data/app/components/coco/app/plan_confirmation/plan_confirmation.rb +0 -18
- data/app/components/coco/app/plan_picker/plan_picker.css +0 -128
- data/app/components/coco/app/plan_picker/plan_picker.html.erb +0 -69
- data/app/components/coco/app/plan_picker/plan_picker.js +0 -56
- data/app/components/coco/app/plan_picker/plan_picker.rb +0 -25
- data/app/components/coco/app/sidebar_nav/item/item.css +0 -121
- data/app/components/coco/app/sidebar_nav/item/item.html.erb +0 -9
- data/app/components/coco/app/sidebar_nav/item/item.js +0 -80
- data/app/components/coco/app/sidebar_nav/item/item.rb +0 -48
- data/app/components/coco/app/sidebar_nav/menu/menu.css +0 -138
- data/app/components/coco/app/sidebar_nav/menu/menu.html.erb +0 -24
- data/app/components/coco/app/sidebar_nav/menu/menu.js +0 -12
- data/app/components/coco/app/sidebar_nav/menu/menu.rb +0 -46
- data/app/components/coco/app/sidebar_nav/navbar/navbar.css +0 -75
- data/app/components/coco/app/sidebar_nav/navbar/navbar.html.erb +0 -29
- data/app/components/coco/app/sidebar_nav/navbar/navbar.js +0 -28
- data/app/components/coco/app/sidebar_nav/navbar/navbar.rb +0 -50
- data/app/components/coco/app/slide_editor/slide_editor.css +0 -149
- data/app/components/coco/app/slide_editor/slide_editor.html.erb +0 -302
- data/app/components/coco/app/slide_editor/slide_editor.js +0 -269
- data/app/components/coco/app/slide_editor/slide_editor.rb +0 -114
- data/app/components/coco/book/editable_slide/editable_slide.css +0 -332
- data/app/components/coco/book/editable_slide/editable_slide.html.erb +0 -48
- data/app/components/coco/book/editable_slide/editable_slide.rb +0 -72
- data/app/components/coco/book/media_slide/media_slide.css +0 -7
- data/app/components/coco/book/media_slide/media_slide.html.erb +0 -3
- data/app/components/coco/book/media_slide/media_slide.rb +0 -12
- data/app/helpers/coco/app_components_helper.rb +0 -39
- data/app/helpers/coco/book_components_helper.rb +0 -11
- data/app/helpers/coco/core_components_helper.rb +0 -257
|
@@ -2708,12 +2708,6 @@ module.exports = {
|
|
|
2708
2708
|
},
|
|
2709
2709
|
extend: {
|
|
2710
2710
|
fontSize,
|
|
2711
|
-
containers: {
|
|
2712
|
-
"slide-fluid": "700px"
|
|
2713
|
-
},
|
|
2714
|
-
aspectRatio: {
|
|
2715
|
-
slide: "16 / 10"
|
|
2716
|
-
},
|
|
2717
2711
|
animation: {
|
|
2718
2712
|
spin: "spin 1.5s linear infinite",
|
|
2719
2713
|
"spin-reverse": "spin 1.5s linear infinite reverse"
|
|
@@ -2728,6 +2722,13 @@ module.exports = {
|
|
|
2728
2722
|
17: "4.25rem",
|
|
2729
2723
|
18: "4.5rem"
|
|
2730
2724
|
},
|
|
2725
|
+
aspectRatio: {
|
|
2726
|
+
"4/3": "4 / 3",
|
|
2727
|
+
"3/2": "3 / 2",
|
|
2728
|
+
"3/2": "3 / 2",
|
|
2729
|
+
"2/1": "2 / 1",
|
|
2730
|
+
a4: "7 / 5"
|
|
2731
|
+
},
|
|
2731
2732
|
customForms: () => ({
|
|
2732
2733
|
DEFAULT: {
|
|
2733
2734
|
checkbox: {
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
@import "./config";
|
|
2
|
-
|
|
3
|
-
@import "tailwindcss/base";
|
|
4
|
-
@import "tailwindcss/components";
|
|
5
|
-
@import "tailwindcss/utilities";
|
|
6
|
-
|
|
7
|
-
@import "./utils/text";
|
|
8
|
-
@import "./tippy";
|
|
9
|
-
|
|
10
|
-
@layer base {
|
|
11
|
-
:root {
|
|
12
|
-
--app-height: 100%;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
html {
|
|
16
|
-
@apply font-body scroll-smooth motion-safe:scroll-auto text-content-dark-1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
a {
|
|
20
|
-
@apply text-current underline underline-offset-2;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[x-cloak] {
|
|
24
|
-
display: none !important;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[x-dropdown] {
|
|
28
|
-
[x-dropdown\:content] {
|
|
29
|
-
@apply hidden;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
data/app/assets/css/coco.css
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
@import "./base/
|
|
1
|
+
@import "./base/config";
|
|
2
2
|
|
|
3
|
-
@import
|
|
3
|
+
@import "tailwindcss/base";
|
|
4
|
+
@import "tailwindcss/components";
|
|
5
|
+
@import "tailwindcss/utilities";
|
|
6
|
+
|
|
7
|
+
@import "./base/utils/text";
|
|
8
|
+
@import "./base/tippy";
|
|
9
|
+
|
|
10
|
+
@import-glob "@components/**/*.css";
|
|
11
|
+
|
|
12
|
+
@layer base {
|
|
13
|
+
:root {
|
|
14
|
+
--app-height: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html {
|
|
18
|
+
@apply font-body scroll-smooth motion-safe:scroll-auto text-content-dark-1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
a {
|
|
22
|
+
@apply text-current underline underline-offset-2;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[x-cloak] {
|
|
26
|
+
display: none !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[x-dropdown] {
|
|
30
|
+
[x-dropdown\:content] {
|
|
31
|
+
@apply hidden;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
data/app/assets/js/coco/coco.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import Alpine from "../base/alpine";
|
|
2
2
|
import packageJSON from "@/package.json" assert { type: "json" };
|
|
3
3
|
import { registerComponents } from "@helpers/alpine.js";
|
|
4
|
-
import CocoComponent from "./component";
|
|
5
|
-
import * as helpers from "@helpers/index";
|
|
6
4
|
|
|
7
5
|
const Coco = {
|
|
8
6
|
version: packageJSON.version,
|
|
@@ -24,16 +22,9 @@ const Coco = {
|
|
|
24
22
|
this._components.push(...components);
|
|
25
23
|
},
|
|
26
24
|
|
|
27
|
-
component(...args) {
|
|
28
|
-
return CocoComponent(...args);
|
|
29
|
-
},
|
|
30
|
-
|
|
31
25
|
_components: [],
|
|
32
26
|
|
|
33
27
|
_started: false,
|
|
34
28
|
};
|
|
35
29
|
|
|
36
|
-
Coco.Component = CocoComponent;
|
|
37
|
-
Coco.helpers = helpers;
|
|
38
|
-
|
|
39
30
|
export default Coco;
|
data/app/assets/js/coco.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import "./base/polyfills";
|
|
2
|
+
import helpers from "@helpers/index";
|
|
3
|
+
import tippy from "./base/tippy";
|
|
2
4
|
import Coco from "./coco/coco";
|
|
5
|
+
import CocoComponent from "./coco/component";
|
|
6
|
+
import tokens from "@config/tokens.js";
|
|
3
7
|
import components from "./base/components";
|
|
4
8
|
|
|
5
9
|
Coco.registerComponents(components);
|
|
6
10
|
|
|
7
11
|
export default Coco;
|
|
12
|
+
export { Coco, CocoComponent, tippy, helpers, tokens };
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import * as alpine from "./alpine";
|
|
1
2
|
import * as color from "./color";
|
|
2
3
|
import * as dom from "./dom";
|
|
3
4
|
import * as lang from "./lang";
|
|
4
5
|
import * as location from "./location";
|
|
5
|
-
import * as
|
|
6
|
+
import * as path from "./path";
|
|
6
7
|
|
|
7
|
-
export {
|
|
8
|
+
export default {
|
|
9
|
+
...alpine,
|
|
10
|
+
...color,
|
|
11
|
+
...dom,
|
|
12
|
+
...lang,
|
|
13
|
+
...location,
|
|
14
|
+
...path,
|
|
15
|
+
};
|
|
@@ -16,7 +16,11 @@
|
|
|
16
16
|
class="layout-picker-option"
|
|
17
17
|
:class="{'layout-picker-option-current': typeof selectedLayout !== 'undefined' && selectedLayout === '<%= options[:name] %>'}"
|
|
18
18
|
aria-label="<%= options[:name] %>">
|
|
19
|
-
|
|
19
|
+
<% if options[:thumbnail] %>
|
|
20
|
+
<%= coco_svg(options[:thumbnail]) %>
|
|
21
|
+
<% else %>
|
|
22
|
+
<%= options[:icon] %>
|
|
23
|
+
<% end %>
|
|
20
24
|
</button>
|
|
21
25
|
<% end %>
|
|
22
26
|
</div>
|
|
@@ -9,8 +9,8 @@ module Coco
|
|
|
9
9
|
Coco::Button.new(**args)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
renders_many :layouts, ->(name:, thumbnail
|
|
13
|
-
@layout_options << {name: name, thumbnail: thumbnail, **layout_options}
|
|
12
|
+
renders_many :layouts, ->(name:, thumbnail: nil, **layout_options, &block) do
|
|
13
|
+
@layout_options << {name: name, thumbnail: thumbnail, **layout_options, icon: block&.call}
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
attr_reader :layout_options, :size, :resize
|
|
@@ -1,7 +1,257 @@
|
|
|
1
1
|
module Coco
|
|
2
2
|
module ComponentsHelper
|
|
3
|
-
include
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
include ActionView::Helpers::UrlHelper
|
|
4
|
+
|
|
5
|
+
# Buttons
|
|
6
|
+
|
|
7
|
+
def coco_button(*args, **kwargs, &block)
|
|
8
|
+
href, content = if block
|
|
9
|
+
[args.first, nil]
|
|
10
|
+
else
|
|
11
|
+
(args.size == 1) ? [nil, args.first] : args[0..2].reverse!
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
button = if kwargs.key?(:action) || kwargs.key?(:method) || kwargs.key?(:params)
|
|
15
|
+
"Coco::ButtonTo"
|
|
16
|
+
else
|
|
17
|
+
"Coco::Button"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
component = button.constantize.new(href: href, **kwargs)
|
|
21
|
+
component = component.with_content(content) if !block && content.present?
|
|
22
|
+
|
|
23
|
+
render(component, &block)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def coco_button_group(**, &block)
|
|
27
|
+
render Coco::ButtonGroup.new(**), &block
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def coco_menu_button(**, &block)
|
|
31
|
+
render Coco::MenuButton.new(**), &block
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def coco_menu_item(type, **, &block)
|
|
35
|
+
render coco_component("menu_items/#{type}", **), &block
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def coco_confirm_button(href = nil, **, &block)
|
|
39
|
+
render Coco::ConfirmButton.new(href: href, **), &block
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def coco_color_picker_button(**, &block)
|
|
43
|
+
render Coco::ColorPickerButton.new(**), &block
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def coco_image_picker_button(**, &block)
|
|
47
|
+
render Coco::ImagePickerButton.new(**), &block
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def coco_layout_picker_button(**, &block)
|
|
51
|
+
render Coco::LayoutPickerButton.new(**), &block
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def coco_toolbar(**, &block)
|
|
55
|
+
render Coco::Toolbar.new(**), &block
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def coco_option_bar(**, &block)
|
|
59
|
+
render Coco::OptionBar.new(**), &block
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Embeds
|
|
63
|
+
|
|
64
|
+
def coco_embed(platform, url = nil, **)
|
|
65
|
+
case platform
|
|
66
|
+
when :youtube
|
|
67
|
+
render Coco::YoutubeEmbed.new(url: url, **)
|
|
68
|
+
else
|
|
69
|
+
raise ArgumentError, "`#{platform}` is not a valid embed type"
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Forms (WIP)
|
|
74
|
+
|
|
75
|
+
def coco_form_with(**, &block)
|
|
76
|
+
form_with(**, builder: Coco::AppFormBuilder, &block)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def coco_form_for(*, **, &block)
|
|
80
|
+
form_for(*, **, builder: Coco::AppFormBuilder, &block)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def coco_fields(**, &block)
|
|
84
|
+
fields(**, builder: Coco::AppFormBuilder, &block)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Images
|
|
88
|
+
|
|
89
|
+
def coco_svg(path = nil, **)
|
|
90
|
+
render Coco::Svg.new(path: path, **)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def coco_image(src = nil, **)
|
|
94
|
+
render Coco::Image.new(src: src, **)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def coco_avatar(src, name = nil, **)
|
|
98
|
+
render Coco::Avatar.new(src: src, name: name, **)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def coco_icon(icon_name = nil, **, &block)
|
|
102
|
+
render Coco::Icon.new(name: icon_name, **), &block
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Indicators
|
|
106
|
+
|
|
107
|
+
def coco_stamp(type = nil, **)
|
|
108
|
+
props = case type
|
|
109
|
+
when :success, :positive
|
|
110
|
+
{icon: :check_circle, theme: :positive}
|
|
111
|
+
when :error, :negative
|
|
112
|
+
{icon: :alert_circle, theme: :negative}
|
|
113
|
+
when :warning
|
|
114
|
+
{icon: :alert_triangle, theme: :warning}
|
|
115
|
+
when :info
|
|
116
|
+
{icon: :info, theme: :info}
|
|
117
|
+
else
|
|
118
|
+
{}
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
render Coco::Stamp.new(**props, **)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def coco_badge(text, **)
|
|
125
|
+
render Coco::Badge.new(**).with_content(text)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Layout
|
|
129
|
+
|
|
130
|
+
def coco_spacer(size = Coco::Spacer::DEFAULT, **)
|
|
131
|
+
render Coco::Spacer.new(size:, **)
|
|
132
|
+
end
|
|
133
|
+
alias_method :space, :coco_spacer
|
|
134
|
+
|
|
135
|
+
def coco_stack(spacing: Coco::Spacer::DEFAULT, **, &block)
|
|
136
|
+
render Coco::Stack.new(spacing:, **), &block
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def coco_panel(**, &block)
|
|
140
|
+
render Coco::Panel.new(**), &block
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def coco_page(id, **, &block)
|
|
144
|
+
render Coco::Page.new(id: id, **), &block
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Messaging
|
|
148
|
+
|
|
149
|
+
def coco_notice(**, &block)
|
|
150
|
+
render Coco::Notice.new(**), &block
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def coco_snackbar(**, &block)
|
|
154
|
+
render Coco::Snackbar.new(**), &block
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def coco_toast(**, &block)
|
|
158
|
+
render Coco::Toast.new(**), &block
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
def coco_system_banner(**, &block)
|
|
162
|
+
render Coco::SystemBanner.new(**), &block
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Modals
|
|
166
|
+
|
|
167
|
+
def coco_modal(name = "default", **, &block)
|
|
168
|
+
render(Coco::Modal.new(name: name, **), &block)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def coco_modal_dialog(name = "default", **, &block)
|
|
172
|
+
render(Coco::Modal.new(name: name, **)) do |modal|
|
|
173
|
+
modal.with_container_dialog(&block)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def coco_modal_lightbox(name = "default", scroll_top: nil, **, &block)
|
|
178
|
+
render(Coco::Modal.new(name: name, scroll_top: scroll_top, **)) do |modal|
|
|
179
|
+
modal.with_container_lightbox(&block)
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Navigation
|
|
184
|
+
|
|
185
|
+
def coco_link(*args, **, &block)
|
|
186
|
+
href, content = if block
|
|
187
|
+
[args.first, nil]
|
|
188
|
+
else
|
|
189
|
+
(args.size == 1) ? [nil, args.first] : args[0..2].reverse!
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
link = Coco::Link.new(href: href, **)
|
|
193
|
+
link = link.with_content(content) if !block && content.present?
|
|
194
|
+
|
|
195
|
+
render(link, &block)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def coco_link_to(name = nil, options = nil, html_options = nil, &block)
|
|
199
|
+
html_options, options, name = options, name, block if block
|
|
200
|
+
options ||= {}
|
|
201
|
+
html_options = Coco::ActionViewHelper.convert_options_to_data_attributes(options, html_options)
|
|
202
|
+
|
|
203
|
+
href = Coco::ActionViewHelper.url_target(name, options)
|
|
204
|
+
|
|
205
|
+
if block
|
|
206
|
+
coco_link(href, **html_options.symbolize_keys!, &block)
|
|
207
|
+
else
|
|
208
|
+
coco_link(name, href, **html_options.symbolize_keys!)
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
def coco_button_to(name = nil, options = nil, html_options = nil, &block)
|
|
213
|
+
html_options, options = options, name if block
|
|
214
|
+
options ||= {}
|
|
215
|
+
html_options ||= {}
|
|
216
|
+
html_options.symbolize_keys!
|
|
217
|
+
|
|
218
|
+
button = Coco::ButtonTo.new(action: options, type: :submit, **html_options)
|
|
219
|
+
button = button.with_content(name) unless block
|
|
220
|
+
render(button, &block)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
def coco_pager_button(direction, **, &block)
|
|
224
|
+
render Coco::PagerButton.new(direction:, **), &block
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Typography
|
|
228
|
+
|
|
229
|
+
def coco_prose(**, &block)
|
|
230
|
+
render Coco::Prose.new(**), &block
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
def coco_seamless_textarea(**, &block)
|
|
234
|
+
render Coco::SeamlessTextarea.new(**), &block
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Utilties (internal)
|
|
238
|
+
|
|
239
|
+
def coco_placeholder(text_content = nil, **, &block)
|
|
240
|
+
render Coco::Placeholder.new(text_content:, **), &block
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# General
|
|
244
|
+
|
|
245
|
+
def coco_tag(*, **, &block)
|
|
246
|
+
render Coco::Tag.new(*, **), &block
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
def coco_component(name, *, **)
|
|
250
|
+
resolve_component("coco/#{name}", *, **)
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
def resolve_component(...)
|
|
254
|
+
Coco::ComponentResolver.new(...)
|
|
255
|
+
end
|
|
6
256
|
end
|
|
7
257
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Coco
|
|
2
2
|
module IntegrationHelper
|
|
3
|
-
def coco_stylesheet_tag(
|
|
4
|
-
stylesheet_link_tag("coco#{"/dev" if dev}
|
|
3
|
+
def coco_stylesheet_tag(dev: ENV["COCO_PATH"], **)
|
|
4
|
+
stylesheet_link_tag("coco#{"/dev" if dev}/coco", **)
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
def coco_stylesheet_file_path(...)
|
|
@@ -17,12 +17,12 @@ module Coco
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
class << self
|
|
20
|
-
def stylesheet_file_path(
|
|
21
|
-
File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}
|
|
20
|
+
def stylesheet_file_path(dev: ENV["COCO_PATH"], **opts)
|
|
21
|
+
File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}/coco.css")
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def javascript_file_path(
|
|
25
|
-
File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}
|
|
24
|
+
def javascript_file_path(dev: ENV["COCO_PATH"], **opts)
|
|
25
|
+
File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}/coco.js")
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
def tailwind_preset_path
|
data/config/locales/coco.en.yml
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
en:
|
|
2
2
|
coco:
|
|
3
|
-
app:
|
|
4
|
-
slide_editor:
|
|
5
|
-
bg_color_picker:
|
|
6
|
-
label: "Background colour"
|
|
7
|
-
bg_image_picker:
|
|
8
|
-
label: "Background image"
|
|
9
|
-
blank_state: "Drag a jpg, png or gif onto the slide area or..."
|
|
10
|
-
text_color_picker:
|
|
11
|
-
label: "Text colour"
|
|
12
|
-
layout_picker:
|
|
13
|
-
label: "Layout"
|
|
14
|
-
undo_button:
|
|
15
|
-
tooltip: "Undo"
|
|
16
|
-
redo_button:
|
|
17
|
-
tooltip: "Redo"
|
|
18
|
-
save_button:
|
|
19
|
-
label: "Save"
|
|
20
|
-
saving_label: "Saving..."
|
|
21
3
|
test:
|
|
22
4
|
translatable:
|
|
23
5
|
greeting: "Hello"
|
data/config/tailwind.preset.js
CHANGED
|
@@ -14,12 +14,6 @@ module.exports = {
|
|
|
14
14
|
},
|
|
15
15
|
extend: {
|
|
16
16
|
fontSize,
|
|
17
|
-
containers: {
|
|
18
|
-
"slide-fluid": "700px",
|
|
19
|
-
},
|
|
20
|
-
aspectRatio: {
|
|
21
|
-
slide: "16 / 10",
|
|
22
|
-
},
|
|
23
17
|
animation: {
|
|
24
18
|
spin: "spin 1.5s linear infinite",
|
|
25
19
|
"spin-reverse": "spin 1.5s linear infinite reverse",
|
|
@@ -34,6 +28,13 @@ module.exports = {
|
|
|
34
28
|
17: "4.25rem",
|
|
35
29
|
18: "4.5rem",
|
|
36
30
|
},
|
|
31
|
+
aspectRatio: {
|
|
32
|
+
"4/3": "4 / 3",
|
|
33
|
+
"3/2": "3 / 2",
|
|
34
|
+
"3/2": "3 / 2",
|
|
35
|
+
"2/1": "2 / 1",
|
|
36
|
+
a4: "7 / 5",
|
|
37
|
+
},
|
|
37
38
|
customForms: () => ({
|
|
38
39
|
DEFAULT: {
|
|
39
40
|
checkbox: {
|
data/lib/coco/engine.rb
CHANGED
|
@@ -25,10 +25,6 @@ module Coco
|
|
|
25
25
|
Dir.glob("#{coco_dir}/{#{COLLAPSE_DIRS.join(",")}}/**/*.rb").each do |path|
|
|
26
26
|
autoloader.collapse(File.dirname(path))
|
|
27
27
|
end
|
|
28
|
-
|
|
29
|
-
Dir.glob("#{coco_dir}/{app,book}/**/*.rb").each do |path|
|
|
30
|
-
autoloader.collapse(File.dirname(path))
|
|
31
|
-
end
|
|
32
28
|
end
|
|
33
29
|
|
|
34
30
|
if Rails.env.production?
|
data/lib/coco.rb
CHANGED