coveragebook_components 0.8.4 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/build/coco/app.css +135 -6
  3. data/app/assets/build/coco/app.js +801 -574
  4. data/app/assets/build/coco/book.css +63 -0
  5. data/app/assets/build/coco/book.js +770 -554
  6. data/app/assets/build/coco/icons/cake.svg +1 -1
  7. data/app/assets/build/coco/icons/check-circle-2.svg +1 -1
  8. data/app/assets/build/coco/icons/check-circle.svg +1 -1
  9. data/app/assets/build/coco/icons/check-square-2.svg +1 -0
  10. data/app/assets/build/coco/icons/check-square.svg +1 -1
  11. data/app/assets/build/coco/icons/check.svg +1 -1
  12. data/app/assets/build/coco/icons/radiation.svg +1 -1
  13. data/app/assets/build/coco/icons/ribbon.svg +1 -0
  14. data/app/assets/build/coco/icons/tree-deciduous.svg +1 -1
  15. data/app/assets/js/libs/alpine/directives/options.js +0 -1
  16. data/app/components/coco/app/blocks/sidebar_nav/item/item.css +2 -2
  17. data/app/components/coco/app/blocks/sidebar_nav/menu/menu.css +2 -2
  18. data/app/components/coco/app/blocks/sidebar_nav/navbar/navbar.css +2 -2
  19. data/app/components/coco/app/blocks/slide_editor/slide_editor.html.erb +3 -2
  20. data/app/components/coco/app/blocks/slide_editor/slide_editor.js +9 -10
  21. data/app/components/coco/app/elements/image_picker_button/image_picker_button.js +8 -2
  22. data/app/components/coco/app/elements/menu_items/user_profile/user_profile.css +1 -1
  23. data/app/components/coco/app/layouts/application/application.css +13 -0
  24. data/app/components/coco/app/layouts/application/application.rb +0 -2
  25. data/app/components/coco/app/layouts/page/page.css +23 -0
  26. data/app/components/coco/app/layouts/page/page.html.erb +27 -0
  27. data/app/components/coco/app/layouts/page/page.js +5 -0
  28. data/app/components/coco/app/layouts/page/page.rb +40 -0
  29. data/app/components/coco/base/image_uploader/image_uploader.js +1 -0
  30. data/app/components/coco/base/pager_link/pager_link.css +26 -0
  31. data/app/components/coco/base/pager_link/pager_link.html.erb +3 -0
  32. data/app/components/coco/base/pager_link/pager_link.rb +32 -0
  33. data/app/components/coco/base/poll_controller/poll_controller.css +5 -0
  34. data/app/components/coco/base/poll_controller/poll_controller.html.erb +15 -0
  35. data/app/components/coco/base/poll_controller/poll_controller.js +67 -0
  36. data/app/components/coco/base/poll_controller/poll_controller.rb +9 -0
  37. data/app/helpers/coco/app_helper.rb +4 -0
  38. data/config/icons.json +2 -0
  39. data/lib/coco.rb +1 -1
  40. data/lib/tasks/coco_tasks.rake +0 -8
  41. metadata +15 -2
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8"/><path d="M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1"/><path d="M2 21h20"/><path d="M7 8v2"/><path d="M12 8v2"/><path d="M17 8v2"/><path d="M7 4h.01"/><path d="M12 4h.01"/><path d="M17 4h.01"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8"/><path d="M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1"/><path d="M2 21h20"/><path d="M7 8v3"/><path d="M12 8v3"/><path d="M17 8v3"/><path d="M7 4h0.01"/><path d="M12 4h0.01"/><path d="M17 4h0.01"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"/><path d="m9 12 2 2 4-4"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="m9 12 2 2 4-4"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><polyline points="9 11 12 14 22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="m9 11 3 3L22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><polyline points="20 6 9 17 4 12"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 12h0"/><path d="M7.5 4.2c-.3-.5-.9-.7-1.3-.4C3.9 5.5 2.3 8.1 2 11c-.1.5.4 1 1 1h5c0-1.5.8-2.8 2-3.4-1.1-1.9-2-3.5-2.5-4.4z"/><path d="M21 12c.6 0 1-.4 1-1-.3-2.9-1.8-5.5-4.1-7.1-.4-.3-1.1-.2-1.3.3-.6.9-1.5 2.5-2.6 4.3 1.2.7 2 2 2 3.5h5z"/><path d="M7.5 19.8c-.3.5-.1 1.1.4 1.3 2.6 1.2 5.6 1.2 8.2 0 .5-.2.7-.8.4-1.3-.5-.9-1.4-2.5-2.5-4.3-1.2.7-2.8.7-4 0-1.1 1.8-2 3.4-2.5 4.3z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 12h0.01"/><path d="M7.5 4.2c-.3-.5-.9-.7-1.3-.4C3.9 5.5 2.3 8.1 2 11c-.1.5.4 1 1 1h5c0-1.5.8-2.8 2-3.4-1.1-1.9-2-3.5-2.5-4.4z"/><path d="M21 12c.6 0 1-.4 1-1-.3-2.9-1.8-5.5-4.1-7.1-.4-.3-1.1-.2-1.3.3-.6.9-1.5 2.5-2.6 4.3 1.2.7 2 2 2 3.5h5z"/><path d="M7.5 19.8c-.3.5-.1 1.1.4 1.3 2.6 1.2 5.6 1.2 8.2 0 .5-.2.7-.8.4-1.3-.5-.9-1.4-2.5-2.5-4.3-1.2.7-2.8.7-4 0-1.1 1.8-2 3.4-2.5 4.3z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17.75 9.01c-.52 2.08-1.83 3.64-3.18 5.49l-2.6 3.54-2.97 4-3.5-2.54 3.85-4.97c-1.86-2.61-2.8-3.77-3.16-5.44"/><path d="M17.75 9.01A7 7 0 0 0 6.2 9.1C6.06 8.5 6 7.82 6 7c0-3.5 2.83-5 5.98-5C15.24 2 18 3.5 18 7c0 .73-.09 1.4-.25 2.01Z"/><path d="m9.35 14.53 2.64-3.31"/><path d="m11.97 18.04 2.99 4 3.54-2.54-3.93-5"/><path d="M14 8c0 1-1 2-2.01 3.22C11 10 10 9 10 8a2 2 0 1 1 4 0"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8 19h8a4 4 0 0 0 3.8-2.8 4 4 0 0 0-1.6-4.5c1-1.1 1-2.7.4-4-.7-1.2-2.2-2-3.6-1.7a3 3 0 0 0-3-3 3 3 0 0 0-3 3c-1.4-.2-2.9.5-3.6 1.7-.7 1.3-.5 2.9.4 4a4 4 0 0 0-1.6 4.5A4 4 0 0 0 8 19Z"/><path d="M12 19v3"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8 19a4 4 0 0 1-2.24-7.32A3.5 3.5 0 0 1 9 6.03V6a3 3 0 1 1 6 0v.04a3.5 3.5 0 0 1 3.24 5.65A4 4 0 0 1 16 19Z"/><path d="M12 19v3"/></svg>
@@ -1,4 +1,3 @@
1
- import bind from "alpinejs/src/utils/bind";
2
1
  import { kebabCase, camelCase, mapValues, keyBy } from "lodash";
3
2
  import { castAttributeValue } from "@helpers/dom";
4
3
  import { setData } from "@helpers/alpine";
@@ -25,11 +25,11 @@
25
25
  @apply app-sidebar-nav-horizontal-item;
26
26
  }
27
27
 
28
- @media screen(sm) and screen(max-md) {
28
+ @media screen(sm) and screen(max-xl) {
29
29
  @apply app-sidebar-nav-vertical-narrow-item;
30
30
  }
31
31
 
32
- @media screen(md) {
32
+ @media screen(xl) {
33
33
  @apply app-sidebar-nav-vertical-wide-item;
34
34
  }
35
35
 
@@ -61,11 +61,11 @@
61
61
  @apply app-sidebar-nav-menu-regular;
62
62
  }
63
63
 
64
- @media screen(sm) and screen(max-md) {
64
+ @media screen(sm) and screen(max-xl) {
65
65
  @apply app-sidebar-nav-menu-small;
66
66
  }
67
67
 
68
- @media screen(md) {
68
+ @media screen(xl) {
69
69
  @apply app-sidebar-nav-menu-regular;
70
70
  }
71
71
 
@@ -6,11 +6,11 @@
6
6
  @apply app-sidebar-nav-horizontal;
7
7
  }
8
8
 
9
- @media screen(sm) and screen(max-md) {
9
+ @media screen(sm) and screen(max-xl) {
10
10
  @apply app-sidebar-nav-vertical-narrow;
11
11
  }
12
12
 
13
- @media screen(md) {
13
+ @media screen(xl) {
14
14
  @apply app-sidebar-nav-vertical-wide;
15
15
  }
16
16
 
@@ -64,6 +64,7 @@
64
64
  role: "bg-image-picker"
65
65
  },
66
66
  x: {
67
+ "@image-picker:change": "bgImage = $event.detail.image",
67
68
  modelable: "selectedImage",
68
69
  model: "bgImage"
69
70
  }
@@ -201,7 +202,7 @@
201
202
  floating: true,
202
203
  class: "editor-image-upload-toolbar"
203
204
  ) do |group| %>
204
- <% group.with_button(icon: :trash_2, tooltip: "remove image", x: {"@click.stop": "image1 = {}"}) %>
205
+ <% group.with_button(icon: :trash_2, tooltip: "remove image", x: {"@click.stop": "image1 = {}; clear();"}) %>
205
206
  <% end %>
206
207
  <img :src="image1.data">
207
208
  </div>
@@ -227,7 +228,7 @@
227
228
  floating: true,
228
229
  class: "editor-image-upload-toolbar"
229
230
  ) do |group| %>
230
- <% group.with_button(icon: :trash_2, tooltip: "remove image", x: {"@click.stop": "image2 = {}"}) %>
231
+ <% group.with_button(icon: :trash_2, tooltip: "remove image", x: {"@click.stop": "image2 = {}; clear();"}) %>
231
232
  <% end %>
232
233
  <img :src="image2.data">
233
234
  </div>
@@ -59,17 +59,16 @@ export default CocoComponent("appSlideEditor", (data) => {
59
59
  );
60
60
  });
61
61
 
62
- this.ready = true;
63
- });
62
+ // Stop navigation when changes have not been saved
63
+ this.$watch("history.undoable", (undoable) => {
64
+ if (undoable) {
65
+ window.onbeforeunload = () => true;
66
+ } else {
67
+ window.onbeforeunload = null;
68
+ }
69
+ });
64
70
 
65
- this.$watch("history.undoable", (undoable) => {
66
- if (undoable) {
67
- window.onbeforeunload = () => {
68
- return true;
69
- };
70
- } else {
71
- window.onbeforeunload = null;
72
- }
71
+ this.ready = true;
73
72
  });
74
73
  },
75
74
 
@@ -24,13 +24,19 @@ export default CocoComponent("appImagePickerButton", ({ src }) => {
24
24
  const reader = new FileReader();
25
25
 
26
26
  reader.addEventListener("load", () => {
27
- this.selectedImage = {
27
+ const selectedImage = {
28
28
  name: file.name,
29
29
  file,
30
30
  data: reader.result,
31
31
  };
32
32
 
33
- this.dropdown.hide();
33
+ this.$dispatch("image-picker:change", { image: selectedImage });
34
+
35
+ this.selectedImage = selectedImage;
36
+
37
+ if (this.dropdown) {
38
+ this.dropdown.hide();
39
+ }
34
40
  });
35
41
 
36
42
  reader.readAsDataURL(file);
@@ -8,7 +8,7 @@
8
8
  }
9
9
 
10
10
  .user-profile-details {
11
- @apply space-y-1;
11
+ @apply space-y-1 overflow-hidden flex flex-col justify-center;
12
12
  }
13
13
 
14
14
  .user-profile-name {
@@ -2,6 +2,7 @@
2
2
  [data-coco][data-component="application-layout"] {
3
3
  @apply grid overflow-hidden absolute inset-0 w-screen;
4
4
  height: var(--app-height);
5
+ --sidebar-nav-width: 0;
5
6
 
6
7
  grid-template-areas: "body";
7
8
  grid-template-rows: 1fr;
@@ -105,5 +106,17 @@
105
106
  }
106
107
  }
107
108
  }
109
+
110
+ @media screen(sm) and screen(max-md) {
111
+ --sidebar-nav-width: theme(width.16);
112
+ }
113
+
114
+ @media screen(md) {
115
+ --sidebar-nav-width: theme(width.24);
116
+ }
117
+
118
+ @media screen(letterbox) {
119
+ --sidebar-nav-width: theme(width.16);
120
+ }
108
121
  }
109
122
  }
@@ -2,8 +2,6 @@ module Coco
2
2
  module App
3
3
  module Layouts
4
4
  class Application < Coco::Component
5
- include Concerns::AcceptsOptions
6
-
7
5
  renders_one :flashes
8
6
  renders_one :banner
9
7
  renders_one :header
@@ -0,0 +1,23 @@
1
+ @layer components {
2
+ [data-coco][data-component="page-layout"] {
3
+ .page-body {
4
+ @apply pt-12 pb-12 px-app w-full;
5
+ }
6
+
7
+ .page-controls {
8
+ @apply fixed top-1/2 -translate-y-1/2 right-0 flex justify-between;
9
+
10
+ left: var(--sidebar-nav-width, 0);
11
+
12
+ .page-control-next {
13
+ @apply ml-auto;
14
+ }
15
+ }
16
+
17
+ &[data-width="constrained"] {
18
+ .page-body {
19
+ @apply max-w-screen-2xl mx-auto;
20
+ }
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,27 @@
1
+ <%= render component_tag(x: {data: x_data("pageLayout")}, class: ({"with-header": header?} if header?)) do %>
2
+ <% if header? %>
3
+ <header class="page-header" data-role="page-header">
4
+ <%= header %>
5
+ </header>
6
+ <% end %>
7
+ <div class="page-body" data-role="page-body">
8
+ <%= content %>
9
+ </div>
10
+
11
+ <% if previous_link? || next_link? %>
12
+ <div class="page-controls">
13
+ <%= previous_link %>
14
+ <%= next_link %>
15
+ </div>
16
+ <% end %>
17
+
18
+ <% if hidden_sections? %>
19
+ <div class="hidden">
20
+ <% hidden_sections.each do |hidden| %>
21
+ <%= hidden %>
22
+ <% end %>
23
+ </div>
24
+ <% end %>
25
+
26
+ <%= poll_controller if poll_controller? %>
27
+ <% end %>
@@ -0,0 +1,5 @@
1
+ import { CocoComponent } from "@js/coco";
2
+
3
+ export default CocoComponent("pageLayout", () => {
4
+ return {};
5
+ });
@@ -0,0 +1,40 @@
1
+ module Coco
2
+ module App
3
+ module Layouts
4
+ class Page < Coco::Component
5
+ include Concerns::AcceptsOptions
6
+
7
+ component_name :page_layout
8
+
9
+ accepts_option :width, from: [:full, :constrained], default: :constrained
10
+
11
+ renders_one :header
12
+ renders_many :hidden_sections
13
+
14
+ renders_one :previous_link, ->(**kwargs) do
15
+ Coco::PagerLink.new(**kwargs, direction: :previous, class: "page-control-previous")
16
+ end
17
+
18
+ renders_one :next_link, ->(**kwargs) do
19
+ Coco::PagerLink.new(**kwargs, direction: :next, class: "page-control-next")
20
+ end
21
+
22
+ renders_one :poll_controller, ->(interval) do
23
+ Coco::PollController.new(interval: interval)
24
+ end
25
+
26
+ before_render do
27
+ with_poll_controller(@poll) unless poll_controller? || @poll.nil?
28
+ with_next_link(href: @next_page) if @next_page
29
+ with_previous_link(href: @previous_page) if @previous_page
30
+ end
31
+
32
+ def initialize(poll: nil, **kwargs)
33
+ @poll = poll
34
+ @previous_page = kwargs[:previous]
35
+ @next_page = kwargs[:next]
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -47,6 +47,7 @@ export default CocoComponent("imageUploader", ({ click, drop }) => {
47
47
 
48
48
  clear() {
49
49
  this.file = null;
50
+ this.input.value = null;
50
51
  this.$dispatch("image-uploader:clear");
51
52
  },
52
53
 
@@ -0,0 +1,26 @@
1
+ @layer components {
2
+ [data-coco][data-component="pager-link"] {
3
+ @apply block py-2.5 px-1 bg-background-dark-3 bg-opacity-40 hover:bg-opacity-60 scale-75 hover:scale-100 lg:scale-100 lg:hover:scale-125 transition-all;
4
+ width: min-content;
5
+
6
+ .coco-icon {
7
+ @apply relative text-content-light-1;
8
+ }
9
+
10
+ &[data-direction="previous"] {
11
+ @apply origin-left rounded-r-md;
12
+
13
+ .coco-icon {
14
+ @apply -ml-1;
15
+ }
16
+ }
17
+
18
+ &[data-direction="next"] {
19
+ @apply origin-right rounded-l-md;
20
+
21
+ .coco-icon {
22
+ @apply -mr-1;
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,3 @@
1
+ <%= render component_tag(data: {role: "#{direction}-page"}) do %>
2
+ <%= icon %>
3
+ <% end %>
@@ -0,0 +1,32 @@
1
+ module Coco
2
+ class PagerLink < Coco::Component
3
+ include Concerns::AcceptsOptions
4
+
5
+ tag_name :a
6
+ tag_attr :href, :target
7
+
8
+ accepts_option :direction, from: %i[previous next], required: true
9
+
10
+ renders_one :icon, ->(name, **kwargs) do
11
+ Coco::Icon.new(**kwargs, name: name, size: :xxl)
12
+ end
13
+
14
+ before_render do
15
+ unless icon?
16
+ with_icon(next? ? :chevron_right : :chevron_left)
17
+ end
18
+ end
19
+
20
+ def direction
21
+ get_option_value(:direction)
22
+ end
23
+
24
+ def next?
25
+ direction == :next
26
+ end
27
+
28
+ def previous?
29
+ direction == :previous
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ @layer components {
2
+ [data-coco][data-component="poll-controller"] {
3
+ @apply contents;
4
+ }
5
+ }
@@ -0,0 +1,15 @@
1
+ <%=
2
+ render component_tag(
3
+ id: "polling-controller",
4
+ x: {
5
+ data: "pollController",
6
+ "@turbo:load.document": "startPolling",
7
+ "@turbo:fetch-request-error": "queuePollRequest"
8
+ },
9
+ data: {
10
+ interval: interval.to_json,
11
+ cachebust: Time.now.to_i
12
+ }) do
13
+ helpers.turbo_frame_tag "polling-controller-frame"
14
+ end
15
+ %>
@@ -0,0 +1,67 @@
1
+ import { CocoComponent } from "@js/coco";
2
+
3
+ export default CocoComponent("pollController", () => {
4
+ return {
5
+ polling: false,
6
+ frame: null,
7
+ pollTimer: null,
8
+
9
+ get interval() {
10
+ return parseInt(this.$root.dataset.interval || 0, 10);
11
+ },
12
+
13
+ init() {
14
+ this.frame = document.getElementById("polling-controller-frame");
15
+ this.observer = new MutationObserver(() => this.onUpdate());
16
+ this.observer.observe(this.$el, { attributes: true });
17
+ },
18
+
19
+ startPolling() {
20
+ if (this.interval > 0 && !this.polling) {
21
+ this.polling = true;
22
+ this.queuePollRequest(500);
23
+ }
24
+ },
25
+
26
+ onUpdate() {
27
+ this.$nextTick(() => {
28
+ this.$dispatch("dom-updates:complete", { html: document }); // for compatability with legacy components
29
+ });
30
+ this.queuePollRequest();
31
+ },
32
+
33
+ queuePollRequest(wait) {
34
+ if (this.pollTimer) clearTimeout(this.pollTimer);
35
+ if (this.interval > 0 && this.polling) {
36
+ this.pollTimer = setTimeout(
37
+ () => this.reloadFrame(),
38
+ wait || this.interval
39
+ );
40
+ }
41
+ },
42
+
43
+ reloadFrame() {
44
+ this.frame.addEventListener(
45
+ "turbo:before-fetch-request",
46
+ addStreamHeaders,
47
+ { once: true }
48
+ );
49
+ window.Turbo.visit(location.href, {
50
+ frame: this.frame.id,
51
+ action: "replace",
52
+ });
53
+ },
54
+
55
+ destroy() {
56
+ this.observer.disconnect();
57
+ this.polling = false;
58
+ },
59
+ };
60
+ });
61
+
62
+ function addStreamHeaders(event) {
63
+ const { headers } = event.detail.fetchOptions || {};
64
+ if (headers) {
65
+ headers.Accept = ["text/vnd.turbo-stream.html", headers.Accept].join(", ");
66
+ }
67
+ }
@@ -0,0 +1,9 @@
1
+ module Coco
2
+ class PollController < Coco::Component
3
+ attr_reader :interval
4
+
5
+ def initialize(interval:, **)
6
+ @interval = interval
7
+ end
8
+ end
9
+ end
@@ -115,5 +115,9 @@ module Coco
115
115
  def coco_menu_item(type, **, &block)
116
116
  render coco_component("app/elements/menu_items/#{type}", **), &block
117
117
  end
118
+
119
+ def coco_page(id, **, &block)
120
+ render coco_component("app/layouts/page", id: id, **), &block
121
+ end
118
122
  end
119
123
  end
data/config/icons.json CHANGED
@@ -275,6 +275,7 @@
275
275
  "check-circle",
276
276
  "check-circle-2",
277
277
  "check-square",
278
+ "check-square-2",
278
279
  "chef-hat",
279
280
  "cherry",
280
281
  "chevron-down",
@@ -994,6 +995,7 @@
994
995
  "reply",
995
996
  "reply-all",
996
997
  "rewind",
998
+ "ribbon",
997
999
  "rocket",
998
1000
  "rocking-chair",
999
1001
  "roller-coaster",
data/lib/coco.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Coco
2
- VERSION = "0.8.4"
2
+ VERSION = "0.8.6"
3
3
  end
@@ -15,10 +15,6 @@ namespace :coco do
15
15
  Rake::Task["standard"].execute
16
16
  puts "✅ standardrb complete"
17
17
 
18
- puts "🥥 Running erblint..."
19
- system "bundle exec erblint --lint-all"
20
- puts "✅ erblint complete"
21
-
22
18
  puts "🥥 Running prettier..."
23
19
  system "npx prettier . --check --config ./package.json"
24
20
  puts "✅ prettier complete"
@@ -31,10 +27,6 @@ namespace :coco do
31
27
  Rake::Task["standard:fix"].execute
32
28
  puts "✅ standardrb complete"
33
29
 
34
- puts "🥥 Running erb_lint..."
35
- system "bundle exec erblint --lint-all --autocorrect"
36
- puts "✅ erblint complete"
37
-
38
30
  puts "🥥 Running prettier..."
39
31
  system "npx prettier . --write --config ./package.json"
40
32
  puts "✅ prettier complete"
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.8.4
4
+ version: 0.8.6
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-11-02 00:00:00.000000000 Z
11
+ date: 2023-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -351,6 +351,7 @@ files:
351
351
  - app/assets/build/coco/icons/check-check.svg
352
352
  - app/assets/build/coco/icons/check-circle-2.svg
353
353
  - app/assets/build/coco/icons/check-circle.svg
354
+ - app/assets/build/coco/icons/check-square-2.svg
354
355
  - app/assets/build/coco/icons/check-square.svg
355
356
  - app/assets/build/coco/icons/check.svg
356
357
  - app/assets/build/coco/icons/chef-hat.svg
@@ -1079,6 +1080,7 @@ files:
1079
1080
  - app/assets/build/coco/icons/reply-all.svg
1080
1081
  - app/assets/build/coco/icons/reply.svg
1081
1082
  - app/assets/build/coco/icons/rewind.svg
1083
+ - app/assets/build/coco/icons/ribbon.svg
1082
1084
  - app/assets/build/coco/icons/rocket.svg
1083
1085
  - app/assets/build/coco/icons/rocking-chair.svg
1084
1086
  - app/assets/build/coco/icons/roller-coaster.svg
@@ -1606,6 +1608,10 @@ files:
1606
1608
  - app/components/coco/app/layouts/application/application.html.erb
1607
1609
  - app/components/coco/app/layouts/application/application.js
1608
1610
  - app/components/coco/app/layouts/application/application.rb
1611
+ - app/components/coco/app/layouts/page/page.css
1612
+ - app/components/coco/app/layouts/page/page.html.erb
1613
+ - app/components/coco/app/layouts/page/page.js
1614
+ - app/components/coco/app/layouts/page/page.rb
1609
1615
  - app/components/coco/base/avatar/avatar.css
1610
1616
  - app/components/coco/base/avatar/avatar.rb
1611
1617
  - app/components/coco/base/button/button.css
@@ -1644,9 +1650,16 @@ files:
1644
1650
  - app/components/coco/base/modal_lightbox/modal_lightbox.html.erb
1645
1651
  - app/components/coco/base/modal_lightbox/modal_lightbox.js
1646
1652
  - app/components/coco/base/modal_lightbox/modal_lightbox.rb
1653
+ - app/components/coco/base/pager_link/pager_link.css
1654
+ - app/components/coco/base/pager_link/pager_link.html.erb
1655
+ - app/components/coco/base/pager_link/pager_link.rb
1647
1656
  - app/components/coco/base/placeholder/placeholder.css
1648
1657
  - app/components/coco/base/placeholder/placeholder.html.erb
1649
1658
  - app/components/coco/base/placeholder/placeholder.rb
1659
+ - app/components/coco/base/poll_controller/poll_controller.css
1660
+ - app/components/coco/base/poll_controller/poll_controller.html.erb
1661
+ - app/components/coco/base/poll_controller/poll_controller.js
1662
+ - app/components/coco/base/poll_controller/poll_controller.rb
1650
1663
  - app/components/coco/base/svg/svg.html.erb
1651
1664
  - app/components/coco/base/svg/svg.rb
1652
1665
  - app/components/coco/book/blocks/slides/editable_slide/editable_slide.css