ariadne_view_components 0.0.55-arm64-darwin → 0.0.58-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/app/assets/builds/ariadne_view_components.css +16 -13
  4. data/app/assets/javascripts/ariadne_view_components.js +8 -0
  5. data/app/assets/javascripts/ariadne_view_components.js.map +1 -0
  6. data/app/assets/javascripts/components/ariadne/accumulator_controller/accumulator_controller.d.ts +22 -0
  7. data/app/assets/javascripts/components/ariadne/ariadne-form.d.ts +22 -0
  8. data/app/assets/javascripts/components/ariadne/ariadne.d.ts +2 -0
  9. data/app/assets/javascripts/components/ariadne/clipboard_copy_component/clipboard-copy-component.d.ts +4 -0
  10. data/app/assets/javascripts/components/ariadne/dropdown/menu_component.d.ts +1 -0
  11. data/app/assets/javascripts/components/ariadne/events_controller/events_controller.d.ts +4 -0
  12. data/app/assets/javascripts/components/ariadne/options_controller/options_controller.d.ts +39 -0
  13. data/app/assets/javascripts/components/ariadne/outlet_manager_controller/outlet_manager_controller.d.ts +42 -0
  14. data/app/assets/javascripts/components/ariadne/slideover_component/slideover-component.d.ts +9 -0
  15. data/app/assets/javascripts/components/ariadne/string_match_controller/string_match_controller.d.ts +27 -0
  16. data/app/assets/javascripts/components/ariadne/synced_boolean_attributes_controller/synced_boolean_attributes_controller.d.ts +48 -0
  17. data/app/assets/javascripts/components/ariadne/tab_container_component/tab-container-component.d.ts +1 -0
  18. data/app/assets/javascripts/components/ariadne/tab_nav_component/tab-nav-component.d.ts +9 -0
  19. data/app/assets/javascripts/components/ariadne/time_ago_component/time-ago-component.d.ts +1 -0
  20. data/app/assets/javascripts/components/ariadne/toggleable_controller/toggleable_controller.d.ts +34 -0
  21. data/app/assets/javascripts/components/ariadne/tooltip_component/tooltip-component.d.ts +24 -0
  22. data/app/components/ariadne/ariadne.js +0 -2
  23. data/app/components/ariadne/ariadne.ts +0 -2
  24. data/app/components/ariadne/options_controller/options_controller.js +6 -3
  25. data/app/components/ariadne/options_controller/options_controller.ts +9 -4
  26. data/app/components/ariadne/outlet_manager_controller/outlet_manager_controller.js +1 -1
  27. data/app/components/ariadne/outlet_manager_controller/outlet_manager_controller.ts +1 -1
  28. data/lib/ariadne/view_components/version.rb +1 -1
  29. data/static/audited_at.json +0 -2
  30. data/static/constants.json +0 -11
  31. data/static/statuses.json +0 -2
  32. metadata +21 -10
  33. data/app/components/ariadne/comment_component/comment_component.html.erb +0 -37
  34. data/app/components/ariadne/comment_component.rb +0 -71
  35. data/app/components/ariadne/rich_text_area_component/rich-text-area-component.d.ts +0 -6
  36. data/app/components/ariadne/rich_text_area_component/rich-text-area-component.js +0 -38
  37. data/app/components/ariadne/rich_text_area_component/rich-text-area-component.ts +0 -47
  38. data/app/components/ariadne/rich_text_area_component/rich_text_area_component.html.erb +0 -6
  39. data/app/components/ariadne/rich_text_area_component.rb +0 -35
@@ -1,71 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Ariadne
4
- # Defines a submittable form for adding comments to a conversation.
5
- #
6
- #
7
- # @accessibility This component requires you to pass in a `sr_label`
8
- # attribute, which will be used to label the tabs for screen readers.
9
- class CommentComponent < Ariadne::Component
10
- DEFAULT_TAG = :div
11
- TAG_OPTIONS = [DEFAULT_TAG].freeze
12
-
13
- DEFAULT_CLASSES = "ariadne-border-gray-300 ariadne-border ariadne-shadow ariadne-py-5 ariadne-px-5 ariadne-rounded-md "
14
-
15
- renders_one :public_tab, lambda { |selected: false, text:, classes: "", attributes: {}|
16
- attributes[:"data-public"] = true
17
- @tab_idx += 1
18
- id = attributes.fetch(:id, "public-tab-#{@tab_idx}")
19
- @public_tab_text = text
20
-
21
- Ariadne::TabComponent.new(selected: selected, classes: classes, id: id, with_panel: true, attributes: attributes)
22
- }
23
-
24
- renders_one :public_submit, lambda { |classes: "", attributes: {}|
25
- Ariadne::ButtonComponent.new(type: Ariadne::BaseButton::TYPE_SUBMIT, scheme: Ariadne::ButtonComponent::DEFAULT_SCHEME, classes: classes, attributes: attributes)
26
- }
27
-
28
- renders_one :internal_tab, lambda { |selected: false, text:, classes: "", attributes: {}|
29
- attributes[:"data-public"] = false
30
- @tab_idx += 1
31
- id = attributes.fetch(:id, "internal-tab-#{@tab_idx}")
32
- @internal_tab_text = text
33
-
34
- Ariadne::TabComponent.new(selected: selected, classes: classes, id: id, with_panel: true, attributes: attributes)
35
- }
36
-
37
- renders_one :internal_submit, lambda { |classes: "", attributes: {}|
38
- Ariadne::ButtonComponent.new(type: Ariadne::BaseButton::TYPE_SUBMIT, scheme: Ariadne::ButtonComponent::DEFAULT_SCHEME, classes: classes, attributes: attributes)
39
- }
40
-
41
- # @example Default
42
- #
43
- # <%= render(Ariadne::CommentComponent.new(url: "/messages", method: :post, sr_label: "Select delivery time")) do |comment| %>
44
- # <% comment.with_public_tab(selected: true, text: "Reply to sender") %>
45
- # <% comment.with_public_submit { "Send" } %>
46
- # <% comment.with_internal_tab(text: "Internal comment") %>
47
- # <% comment.with_internal_submit { "Send" } %>
48
- # <% end %>
49
- #
50
- # @param url [String] The URL to take action against.
51
- # @param method [String] The method to use when submitting the form.
52
- # @param sr_label [String] A label to introduce these tabs for screen readers.
53
- # @param hidden_fields [[String]] An array of arrays of additional (hidden) fields to add to the form.
54
- # @param classes [String] <%= link_to_classes_docs %>
55
- # @param attributes [Hash] <%= link_to_attributes_docs %>
56
- def initialize(url:, method: :post, sr_label:, hidden_fields: [], classes: "", attributes: {})
57
- @tag = DEFAULT_TAG
58
- @classes = merge_class_names(
59
- DEFAULT_CLASSES,
60
- classes,
61
- )
62
- @url = url
63
- @method = method
64
- @sr_label = sr_label
65
-
66
- @tab_idx = -1
67
- @hidden_fields = hidden_fields
68
- @attributes = attributes
69
- end
70
- end
71
- end
@@ -1,6 +0,0 @@
1
- import { Controller } from '@hotwired/stimulus';
2
- export default class RichTextArea extends Controller {
3
- static targets: string[];
4
- readonly editorTargets: [HTMLDivElement];
5
- connect(): void;
6
- }
@@ -1,38 +0,0 @@
1
- import { Controller } from '@hotwired/stimulus';
2
- import { Editor } from '@tiptap/core';
3
- import { Document } from '@tiptap/extension-document';
4
- import { Paragraph } from '@tiptap/extension-paragraph';
5
- import { Text } from '@tiptap/extension-text';
6
- import DropCursor from '@tiptap/extension-dropcursor';
7
- import GapCursor from '@tiptap/extension-gapcursor';
8
- import { History } from '@tiptap/extension-history';
9
- class RichTextArea extends Controller {
10
- connect() {
11
- for (const editorElement of this.editorTargets) {
12
- const pmEditor = new Editor({
13
- extensions: [DropCursor, GapCursor, History, Document, Paragraph, Text],
14
- content: '',
15
- injectCSS: false,
16
- element: editorElement,
17
- editorProps: {
18
- attributes: {
19
- class: 'ariadne-h-28 ariadne-max-h-48 ariadne-p-2 ariadne-rounded-lg ariadne-overflow-y-auto focus:ariadne-outline-none',
20
- },
21
- },
22
- parseOptions: {
23
- preserveWhitespace: true,
24
- },
25
- });
26
- const tiptapValueContainer = editorElement.previousElementSibling;
27
- if (tiptapValueContainer) {
28
- const parentForm = editorElement.closest('form');
29
- parentForm === null || parentForm === void 0 ? void 0 : parentForm.addEventListener('submit', () => {
30
- tiptapValueContainer.setAttribute('value', pmEditor.getText() || '');
31
- pmEditor.commands.clearContent(); // TODO: test this
32
- });
33
- }
34
- }
35
- }
36
- }
37
- RichTextArea.targets = ['editor'];
38
- export default RichTextArea;
@@ -1,47 +0,0 @@
1
- import {Controller} from '@hotwired/stimulus'
2
-
3
- import {Editor} from '@tiptap/core'
4
-
5
- import {Document} from '@tiptap/extension-document'
6
- import {Paragraph} from '@tiptap/extension-paragraph'
7
- import {Text} from '@tiptap/extension-text'
8
-
9
- import DropCursor from '@tiptap/extension-dropcursor'
10
- import GapCursor from '@tiptap/extension-gapcursor'
11
- import {History} from '@tiptap/extension-history'
12
-
13
- export default class RichTextArea extends Controller {
14
- static targets = ['editor']
15
-
16
- declare readonly editorTargets: [HTMLDivElement]
17
-
18
- connect() {
19
- for (const editorElement of this.editorTargets) {
20
- const pmEditor = new Editor({
21
- extensions: [DropCursor, GapCursor, History, Document, Paragraph, Text],
22
- content: '',
23
- injectCSS: false,
24
- element: editorElement,
25
- editorProps: {
26
- attributes: {
27
- class:
28
- 'ariadne-h-28 ariadne-max-h-48 ariadne-p-2 ariadne-rounded-lg ariadne-overflow-y-auto focus:ariadne-outline-none',
29
- },
30
- },
31
- parseOptions: {
32
- preserveWhitespace: true,
33
- },
34
- })
35
-
36
- const tiptapValueContainer = editorElement.previousElementSibling
37
- if (tiptapValueContainer) {
38
- const parentForm = editorElement.closest('form')
39
-
40
- parentForm?.addEventListener('submit', () => {
41
- tiptapValueContainer.setAttribute('value', pmEditor.getText() || '')
42
- pmEditor.commands.clearContent() // TODO: test this
43
- })
44
- }
45
- }
46
- }
47
- }
@@ -1,6 +0,0 @@
1
- <%= render(Ariadne::BaseComponent.new(tag: @tag, classes: @classes, attributes: @attributes)) do %>
2
- <% if @has_form %>
3
- <input type="hidden" data-tiptap-value-container=true name="<%= @name %>" id="<%= @name %>">
4
- <% end %>
5
- <div class="tiptap-editor" name="rich-text-area" data-rich-text-area-component-target="editor"></div>
6
- <% end %>
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Ariadne
4
- # Add a general description of component here
5
- # Add additional usage considerations or best practices that may aid the user to use the component correctly.
6
- # @accessibility Add any accessibility considerations
7
- class RichTextAreaComponent < Ariadne::Component
8
- DEFAULT_TAG = :div
9
- DEFAULT_CLASSES = ""
10
-
11
- # @example Default
12
- #
13
- # <%= render(Ariadne::RichTextAreaComponent.new(name: "bodytext", sr_label: "Enter message contents")) { "Example" } %>
14
- #
15
- # @param name [Symbol] Identifies the form/param name for this rich text area.
16
- # @param sr_label [String] A label to introduce these tabs for screen readers.
17
- # @param has_form [Boolean] Indicates whether this component is wrapped in a form.
18
- # @param classes [String] <%= link_to_classes_docs %>
19
- # @param attributes [Hash] <%= link_to_attributes_docs %>
20
- def initialize(name:, sr_label:, has_form: true, classes: "", attributes: {})
21
- @tag = DEFAULT_TAG
22
- @name = name
23
- @sr_label = sr_label
24
- @has_form = has_form
25
-
26
- @classes = merge_class_names(
27
- DEFAULT_CLASSES,
28
- classes,
29
- )
30
- @attributes = attributes
31
- @attributes[:"data-controller"] = "rich-text-area-component"
32
- @attributes[:"data-has-form"] = true if @has_form
33
- end
34
- end
35
- end