katalyst-navigation 1.8.4 → 2.0.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/README.md +11 -2
- data/app/assets/builds/katalyst/navigation.esm.js +207 -109
- data/app/assets/builds/katalyst/navigation.js +207 -109
- data/app/assets/builds/katalyst/navigation.min.js +1 -1
- data/app/assets/builds/katalyst/navigation.min.js.map +1 -1
- data/app/assets/images/katalyst/navigation/icons/button.svg +1 -0
- data/app/assets/images/katalyst/navigation/icons/collapse.svg +3 -0
- data/app/assets/images/katalyst/navigation/icons/edit.svg +1 -0
- data/app/assets/images/katalyst/navigation/icons/expand.svg +3 -0
- data/app/assets/images/katalyst/navigation/icons/heading.svg +1 -0
- data/app/assets/images/katalyst/navigation/icons/hidden.svg +1 -0
- data/app/assets/images/katalyst/navigation/icons/indent.svg +3 -0
- data/app/assets/images/katalyst/navigation/icons/link.svg +1 -0
- data/app/assets/images/katalyst/navigation/icons/outdent.svg +4 -0
- data/app/assets/images/katalyst/navigation/icons/remove.svg +1 -0
- data/app/assets/stylesheets/katalyst/_navigation.scss +3 -0
- data/app/assets/stylesheets/katalyst/navigation/editor.css +175 -0
- data/app/assets/stylesheets/katalyst/navigation/icons.css +54 -0
- data/app/assets/stylesheets/katalyst/navigation/{editor/_status-bar.scss → status-bar.css} +30 -34
- data/app/assets/stylesheets/katalyst/navigation.css +3 -0
- data/app/components/katalyst/navigation/editor/base_component.rb +0 -6
- data/app/components/katalyst/navigation/editor/item_component.html.erb +26 -16
- data/app/components/katalyst/navigation/editor/item_component.rb +2 -3
- data/app/components/katalyst/navigation/editor/item_editor_component.rb +16 -19
- data/app/components/katalyst/navigation/editor/new_item_component.html.erb +15 -14
- data/app/components/katalyst/navigation/editor/new_item_component.rb +7 -10
- data/app/components/katalyst/navigation/editor/new_items_component.html.erb +41 -2
- data/app/components/katalyst/navigation/editor/new_items_component.rb +0 -2
- data/app/components/katalyst/navigation/editor/row_component.html.erb +2 -1
- data/app/components/katalyst/navigation/editor/status_bar_component.rb +9 -11
- data/app/components/katalyst/navigation/editor/table_component.html.erb +0 -6
- data/app/components/katalyst/navigation/editor/table_component.rb +12 -14
- data/app/components/katalyst/navigation/editor_component.html.erb +7 -0
- data/app/components/katalyst/navigation/editor_component.rb +13 -16
- data/app/controllers/katalyst/navigation/items_controller.rb +1 -1
- data/app/controllers/katalyst/navigation/menus_controller.rb +1 -1
- data/app/javascript/navigation/application.js +8 -3
- data/app/javascript/navigation/editor/item.js +1 -1
- data/app/javascript/navigation/editor/item_editor_controller.js +54 -0
- data/app/javascript/navigation/editor/list_controller.js +11 -103
- data/app/javascript/navigation/editor/new_items_controller.js +145 -0
- data/app/views/katalyst/navigation/items/_button.html.erb +24 -28
- data/app/views/katalyst/navigation/items/_form.html.erb +6 -0
- data/app/views/katalyst/navigation/items/_form_errors.html.erb +1 -1
- data/app/views/katalyst/navigation/items/_heading.html.erb +12 -14
- data/app/views/katalyst/navigation/items/_link.html.erb +24 -26
- data/app/views/katalyst/navigation/items/edit.html.erb +40 -2
- data/app/views/katalyst/navigation/items/edit.turbo_stream.erb +2 -0
- data/app/views/katalyst/navigation/items/update.turbo_stream.erb +0 -1
- data/app/views/katalyst/navigation/menus/show.html.erb +0 -1
- data/lib/katalyst/navigation/engine.rb +0 -1
- metadata +21 -28
- data/app/assets/stylesheets/katalyst/navigation/editor/_icon.scss +0 -17
- data/app/assets/stylesheets/katalyst/navigation/editor/_index.scss +0 -145
- data/app/assets/stylesheets/katalyst/navigation/editor/_item-actions.scss +0 -93
- data/app/assets/stylesheets/katalyst/navigation/editor/_item-rules.scss +0 -19
- data/app/assets/stylesheets/katalyst/navigation/editor/_new-items.scss +0 -67
- data/app/javascript/navigation/editor/new_item_controller.js +0 -12
@@ -1,10 +1,6 @@
|
|
1
1
|
import { Controller } from "@hotwired/stimulus";
|
2
2
|
|
3
3
|
export default class ListController extends Controller {
|
4
|
-
connect() {
|
5
|
-
this.enterCount = 0;
|
6
|
-
}
|
7
|
-
|
8
4
|
/**
|
9
5
|
* When the user starts a drag within the list, set the item's dataTransfer
|
10
6
|
* properties to indicate that it's being dragged and update its style.
|
@@ -28,11 +24,6 @@ export default class ListController extends Controller {
|
|
28
24
|
* When the user drags an item over another item in the last, swap the
|
29
25
|
* dragging item with the item under the cursor.
|
30
26
|
*
|
31
|
-
* As a special case, if the item is dragged over placeholder space at the end
|
32
|
-
* of the list, move the item to the bottom of the list instead. This allows
|
33
|
-
* users to hit the list element more easily when adding new items to an empty
|
34
|
-
* list.
|
35
|
-
*
|
36
27
|
* @param event {DragEvent}
|
37
28
|
*/
|
38
29
|
dragover(event) {
|
@@ -46,53 +37,7 @@ export default class ListController extends Controller {
|
|
46
37
|
}
|
47
38
|
|
48
39
|
/**
|
49
|
-
* When the user
|
50
|
-
* represent the new item. Note that we can't access the drag data
|
51
|
-
* until drop, so we assume that this is our template item for now.
|
52
|
-
*
|
53
|
-
* Users can cancel the drag by dragging the item out of the list or by
|
54
|
-
* pressing escape. Both are handled by `cancelDrag`.
|
55
|
-
*
|
56
|
-
* @param event {DragEvent}
|
57
|
-
*/
|
58
|
-
dragenter(event) {
|
59
|
-
event.preventDefault();
|
60
|
-
|
61
|
-
// Safari doesn't support relatedTarget, so we count enter/leave pairs
|
62
|
-
this.enterCount++;
|
63
|
-
|
64
|
-
if (copyAllowed(event) && !this.dragItem) {
|
65
|
-
const item = document.createElement("li");
|
66
|
-
item.dataset.dragging = "";
|
67
|
-
item.dataset.newItem = "";
|
68
|
-
this.element.appendChild(item);
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
/**
|
73
|
-
* When the user drags the item out of the list, remove the placeholder.
|
74
|
-
* This allows users to cancel the drag by dragging the item out of the list.
|
75
|
-
*
|
76
|
-
* @param event {DragEvent}
|
77
|
-
*/
|
78
|
-
dragleave(event) {
|
79
|
-
// Safari doesn't support relatedTarget, so we count enter/leave pairs
|
80
|
-
// https://bugs.webkit.org/show_bug.cgi?id=66547
|
81
|
-
this.enterCount--;
|
82
|
-
|
83
|
-
if (
|
84
|
-
this.enterCount <= 0 &&
|
85
|
-
this.dragItem.dataset.hasOwnProperty("newItem")
|
86
|
-
) {
|
87
|
-
this.cancelDrag(event);
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
/**
|
92
|
-
* When the user drops an item into the list, end the drag and reindex the list.
|
93
|
-
*
|
94
|
-
* If the item is a new item, we replace the placeholder with the template
|
95
|
-
* item data from the dataTransfer API.
|
40
|
+
* When the user drops an item, end the drag and reindex the list.
|
96
41
|
*
|
97
42
|
* @param event {DragEvent}
|
98
43
|
*/
|
@@ -105,18 +50,6 @@ export default class ListController extends Controller {
|
|
105
50
|
delete item.dataset.dragging;
|
106
51
|
swap(dropTarget(event.target), item);
|
107
52
|
|
108
|
-
if (item.dataset.hasOwnProperty("newItem")) {
|
109
|
-
const placeholder = item;
|
110
|
-
const template = document.createElement("template");
|
111
|
-
template.innerHTML = event.dataTransfer.getData("text/html");
|
112
|
-
item = template.content.querySelector("li");
|
113
|
-
|
114
|
-
this.element.replaceChild(item, placeholder);
|
115
|
-
requestAnimationFrame(() =>
|
116
|
-
item.querySelector("[role='button'][value='edit']").click(),
|
117
|
-
);
|
118
|
-
}
|
119
|
-
|
120
53
|
this.dispatch("drop", {
|
121
54
|
target: item,
|
122
55
|
bubbles: true,
|
@@ -125,16 +58,13 @@ export default class ListController extends Controller {
|
|
125
58
|
}
|
126
59
|
|
127
60
|
/**
|
128
|
-
* End an in-progress drag
|
129
|
-
*
|
61
|
+
* End an in-progress drag by resetting the item's style and restoring its
|
62
|
+
* original position in the list.
|
130
63
|
*/
|
131
64
|
dragend() {
|
132
65
|
const item = this.dragItem;
|
133
66
|
|
134
|
-
if (
|
135
|
-
} else if (item.dataset.hasOwnProperty("newItem")) {
|
136
|
-
item.remove();
|
137
|
-
} else {
|
67
|
+
if (item) {
|
138
68
|
delete item.dataset.dragging;
|
139
69
|
this.reset();
|
140
70
|
}
|
@@ -158,7 +88,7 @@ export default class ListController extends Controller {
|
|
158
88
|
}
|
159
89
|
|
160
90
|
/**
|
161
|
-
* Swaps two list items.
|
91
|
+
* Swaps two list items.
|
162
92
|
*
|
163
93
|
* @param target the target element to swap with
|
164
94
|
* @param item the item the user is dragging
|
@@ -167,39 +97,17 @@ function swap(target, item) {
|
|
167
97
|
if (!target) return;
|
168
98
|
if (target === item) return;
|
169
99
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
target.insertAdjacentElement("afterend", item);
|
176
|
-
}
|
177
|
-
}
|
178
|
-
|
179
|
-
if (target.nodeName === "OL") {
|
180
|
-
target.appendChild(item);
|
100
|
+
const positionComparison = target.compareDocumentPosition(item);
|
101
|
+
if (positionComparison & Node.DOCUMENT_POSITION_FOLLOWING) {
|
102
|
+
target.insertAdjacentElement("beforebegin", item);
|
103
|
+
} else if (positionComparison & Node.DOCUMENT_POSITION_PRECEDING) {
|
104
|
+
target.insertAdjacentElement("afterend", item);
|
181
105
|
}
|
182
106
|
}
|
183
107
|
|
184
|
-
/**
|
185
|
-
* Returns true if the event supports copy or copy move.
|
186
|
-
*
|
187
|
-
* Chrome and Firefox use copy, but Safari only supports copyMove.
|
188
|
-
*/
|
189
|
-
function copyAllowed(event) {
|
190
|
-
return (
|
191
|
-
event.dataTransfer.effectAllowed === "copy" ||
|
192
|
-
event.dataTransfer.effectAllowed === "copyMove"
|
193
|
-
);
|
194
|
-
}
|
195
|
-
|
196
108
|
/**
|
197
109
|
* Given an event target, return the closest drop target, if any.
|
198
110
|
*/
|
199
111
|
function dropTarget(e) {
|
200
|
-
return (
|
201
|
-
e &&
|
202
|
-
(e.closest("[data-controller='navigation--editor--list'] > *") ||
|
203
|
-
e.closest("[data-controller='navigation--editor--list']"))
|
204
|
-
);
|
112
|
+
return e && e.closest("[data-controller='navigation--editor--list'] > *");
|
205
113
|
}
|
@@ -0,0 +1,145 @@
|
|
1
|
+
import { Controller } from "@hotwired/stimulus";
|
2
|
+
|
3
|
+
const EDGE_AREA = 24;
|
4
|
+
|
5
|
+
export default class NewItemsController extends Controller {
|
6
|
+
static targets = ["inline"];
|
7
|
+
|
8
|
+
connect() {
|
9
|
+
this.form.addEventListener("mousemove", this.move);
|
10
|
+
}
|
11
|
+
|
12
|
+
disconnect() {
|
13
|
+
this.form?.removeEventListener("mousemove", this.move);
|
14
|
+
delete this.currentItem;
|
15
|
+
}
|
16
|
+
|
17
|
+
open(e) {
|
18
|
+
e.preventDefault();
|
19
|
+
this.dialog.showModal();
|
20
|
+
}
|
21
|
+
|
22
|
+
close(e) {
|
23
|
+
e.preventDefault();
|
24
|
+
this.dialog.close();
|
25
|
+
}
|
26
|
+
|
27
|
+
noop(e) {}
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Add the selected item to the DOM at the current position or the end of the list.
|
31
|
+
*/
|
32
|
+
add(e) {
|
33
|
+
e.preventDefault();
|
34
|
+
|
35
|
+
const template = e.target.querySelector("template");
|
36
|
+
const item = template.content.querySelector("li").cloneNode(true);
|
37
|
+
const target = this.currentItem;
|
38
|
+
|
39
|
+
if (target) {
|
40
|
+
target.insertAdjacentElement("beforebegin", item);
|
41
|
+
} else {
|
42
|
+
this.list.insertAdjacentElement("beforeend", item);
|
43
|
+
}
|
44
|
+
|
45
|
+
this.toggleInline(false);
|
46
|
+
this.dialog.close();
|
47
|
+
|
48
|
+
requestAnimationFrame(() => {
|
49
|
+
item.querySelector(`[value="edit"]`).click();
|
50
|
+
});
|
51
|
+
}
|
52
|
+
|
53
|
+
morph(e) {
|
54
|
+
e.preventDefault();
|
55
|
+
this.dialog.close();
|
56
|
+
}
|
57
|
+
|
58
|
+
move = (e) => {
|
59
|
+
if (this.isOverInlineTarget(e)) return;
|
60
|
+
if (this.dialog.open) return;
|
61
|
+
|
62
|
+
const target = this.getCurrentItem(e);
|
63
|
+
|
64
|
+
// return if we're already showing this item
|
65
|
+
if (this.currentItem === target) return;
|
66
|
+
|
67
|
+
// hide the button if it's already visible
|
68
|
+
if (this.currentItem) this.toggleInline(false);
|
69
|
+
|
70
|
+
this.currentItem = target;
|
71
|
+
|
72
|
+
// clear any previously set timer
|
73
|
+
if (this.timer) clearTimeout(this.timer);
|
74
|
+
|
75
|
+
// show the button after a debounce pause
|
76
|
+
this.timer = setTimeout(() => {
|
77
|
+
delete this.timer;
|
78
|
+
this.toggleInline();
|
79
|
+
}, 100);
|
80
|
+
};
|
81
|
+
|
82
|
+
toggleInline(show = !!this.currentItem) {
|
83
|
+
if (show) {
|
84
|
+
this.inlineTarget.style.top = `${this.currentItem.offsetTop}px`;
|
85
|
+
this.inlineTarget.toggleAttribute("hidden", false);
|
86
|
+
} else {
|
87
|
+
this.inlineTarget.toggleAttribute("hidden", true);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
get dialog() {
|
92
|
+
return this.element.querySelector("dialog");
|
93
|
+
}
|
94
|
+
|
95
|
+
/**
|
96
|
+
* @returns {HTMLFormElement}
|
97
|
+
*/
|
98
|
+
get form() {
|
99
|
+
return this.element.closest("form");
|
100
|
+
}
|
101
|
+
|
102
|
+
/**
|
103
|
+
* @returns {HTMLUListElement,null}
|
104
|
+
*/
|
105
|
+
get list() {
|
106
|
+
return this.form.querySelector(
|
107
|
+
`[data-controller="navigation--editor--list"]`,
|
108
|
+
);
|
109
|
+
}
|
110
|
+
|
111
|
+
/**
|
112
|
+
* @param {MouseEvent} e
|
113
|
+
* @returns {HTMLLIElement,null}
|
114
|
+
*/
|
115
|
+
getCurrentItem(e) {
|
116
|
+
const item = document.elementFromPoint(e.clientX, e.clientY).closest("li");
|
117
|
+
if (!item) return null;
|
118
|
+
|
119
|
+
const bounds = item.getBoundingClientRect();
|
120
|
+
|
121
|
+
// check X for center(ish) mouse position
|
122
|
+
if (e.clientX < bounds.left + bounds.width / 2 - 2 * EDGE_AREA) return null;
|
123
|
+
if (e.clientX > bounds.left + bounds.width / 2 + 2 * EDGE_AREA) return null;
|
124
|
+
|
125
|
+
// check Y for hits on this item or it's next sibling
|
126
|
+
if (e.clientY - bounds.y <= EDGE_AREA) {
|
127
|
+
return item;
|
128
|
+
} else if (bounds.y + bounds.height - e.clientY <= EDGE_AREA) {
|
129
|
+
return item.nextElementSibling;
|
130
|
+
} else {
|
131
|
+
return null;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
/**
|
136
|
+
* @param {MouseEvent} e
|
137
|
+
* @returns {Boolean} true when the target of the event is the floating button
|
138
|
+
*/
|
139
|
+
isOverInlineTarget(e) {
|
140
|
+
return (
|
141
|
+
this.inlineTarget ===
|
142
|
+
document.elementFromPoint(e.clientX, e.clientY).closest("div")
|
143
|
+
);
|
144
|
+
}
|
145
|
+
}
|
@@ -1,34 +1,30 @@
|
|
1
|
-
|
2
|
-
<%= form.hidden_field :type %>
|
3
|
-
<%= render "form_errors", form: %>
|
1
|
+
<%# locals: (form:) %>
|
4
2
|
|
5
|
-
|
6
|
-
<%= form.label :title %>
|
7
|
-
<%= form.text_field :title %>
|
8
|
-
</div>
|
3
|
+
<%= render "form_errors", form: %>
|
9
4
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
<div class="field">
|
6
|
+
<%= form.label :title %>
|
7
|
+
<%= form.text_field :title %>
|
8
|
+
</div>
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
<div class="field">
|
11
|
+
<%= form.label :url %>
|
12
|
+
<%= form.text_field :url %>
|
13
|
+
</div>
|
19
14
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
<div class="field">
|
16
|
+
<%= form.label :http_method %>
|
17
|
+
<%= form.select :http_method, Katalyst::Navigation::Button::HTTP_METHODS %>
|
18
|
+
</div>
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
<div class="field">
|
21
|
+
<%= form.label :target %>
|
22
|
+
<%= form.select :target, Katalyst::Navigation::Button::TARGETS %>
|
23
|
+
</div>
|
29
24
|
|
30
|
-
|
31
|
-
|
32
|
-
<%=
|
33
|
-
|
34
|
-
<% end %>
|
25
|
+
<div class="field">
|
26
|
+
<%= form.label(:visible) do %>
|
27
|
+
<%= form.check_box :visible %>
|
28
|
+
Visible
|
29
|
+
<% end %>
|
30
|
+
</div>
|
@@ -1,17 +1,15 @@
|
|
1
|
-
|
2
|
-
<%= form.hidden_field :type %>
|
3
|
-
<%= render "form_errors", form: %>
|
1
|
+
<%# locals: (form:) %>
|
4
2
|
|
5
|
-
|
6
|
-
<%= form.label :title %>
|
7
|
-
<%= form.text_field :title %>
|
8
|
-
</div>
|
3
|
+
<%= render "form_errors", form: %>
|
9
4
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
<div class="field">
|
6
|
+
<%= form.label :title %>
|
7
|
+
<%= form.text_field :title %>
|
8
|
+
</div>
|
14
9
|
|
15
|
-
|
16
|
-
<%=
|
17
|
-
|
10
|
+
<div class="field">
|
11
|
+
<%= form.label(:visible) do %>
|
12
|
+
<%= form.check_box :visible %>
|
13
|
+
Visible
|
14
|
+
<% end %>
|
15
|
+
</div>
|
@@ -1,32 +1,30 @@
|
|
1
|
-
|
2
|
-
<%= form.hidden_field :type %>
|
3
|
-
<%= render "form_errors", form: %>
|
1
|
+
<%# locals: (form:) %>
|
4
2
|
|
5
|
-
|
6
|
-
<%= form.label :title %>
|
7
|
-
<%= form.text_field :title %>
|
8
|
-
</div>
|
3
|
+
<%= render "form_errors", form: %>
|
9
4
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
<div class="field">
|
6
|
+
<%= form.label :title %>
|
7
|
+
<%= form.text_field :title %>
|
8
|
+
</div>
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
10
|
+
<div class="field">
|
11
|
+
<%= form.label :url %>
|
12
|
+
<%= form.text_field :url %>
|
13
|
+
</div>
|
19
14
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
<div class="input">
|
16
|
+
<%= form.label :http_method %>
|
17
|
+
<%= form.select :http_method, Katalyst::Navigation::Link::HTTP_METHODS %>
|
18
|
+
</div>
|
24
19
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
<div class="field">
|
21
|
+
<%= form.label :target %>
|
22
|
+
<%= form.select :target, Katalyst::Navigation::Link::TARGETS %>
|
23
|
+
</div>
|
29
24
|
|
30
|
-
|
31
|
-
<%=
|
32
|
-
|
25
|
+
<div class="field">
|
26
|
+
<%= form.label(:visible) do %>
|
27
|
+
<%= form.check_box :visible %>
|
28
|
+
Visible
|
29
|
+
<% end %>
|
30
|
+
</div>
|
@@ -1,3 +1,41 @@
|
|
1
|
-
<%=
|
2
|
-
|
1
|
+
<%= turbo_frame_tag(
|
2
|
+
"navigation--editor--item-editor",
|
3
|
+
data: { controller: "navigation--editor--item-editor" },
|
4
|
+
) do %>
|
5
|
+
<dialog class="modal"
|
6
|
+
data-navigation--editor--item-editor-target="dialog"
|
7
|
+
data-action="
|
8
|
+
click->navigation--editor--item-editor#dismiss
|
9
|
+
close->navigation--editor--item-editor#dismiss
|
10
|
+
"
|
11
|
+
data-item-id="<%= dom_id(item_editor.item) %>"
|
12
|
+
<%= "data-item-persisted" if item_editor.item.persisted? %>>
|
13
|
+
<article class="flow" data-action="click->navigation--editor--item-editor#noop:stop">
|
14
|
+
<header class="repel" data-nowrap>
|
15
|
+
<h2><%= item_editor.title %></h2>
|
16
|
+
<button form="<%= item_editor.id %>"
|
17
|
+
formmethod="dialog"
|
18
|
+
class="button"
|
19
|
+
data-button-padding="tight"
|
20
|
+
data-text-button>
|
21
|
+
<icon aria-hidden="true" class="icon" data-icon="close"> </icon>
|
22
|
+
<span class="visually-hidden">Close</span>
|
23
|
+
</button>
|
24
|
+
</header>
|
25
|
+
<main>
|
26
|
+
<%= render item_editor %>
|
27
|
+
</main>
|
28
|
+
<footer class="actions" data-reverse>
|
29
|
+
<button form="<%= item_editor.id %>" class="button">
|
30
|
+
Done
|
31
|
+
</button>
|
32
|
+
<button form="<%= item_editor.id %>"
|
33
|
+
formmethod="dialog"
|
34
|
+
class="button"
|
35
|
+
data-ghost-button>
|
36
|
+
Discard
|
37
|
+
</button>
|
38
|
+
</footer>
|
39
|
+
</article>
|
40
|
+
</dialog>
|
3
41
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katalyst-navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katalyst Interactive
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-14 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: katalyst-html-attributes
|
@@ -24,20 +23,6 @@ dependencies:
|
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: katalyst-kpop
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
26
|
- !ruby/object:Gem::Dependency
|
42
27
|
name: katalyst-tables
|
43
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +51,6 @@ dependencies:
|
|
66
51
|
- - ">="
|
67
52
|
- !ruby/object:Gem::Version
|
68
53
|
version: '0'
|
69
|
-
description:
|
70
54
|
email:
|
71
55
|
- developers@katalyst.com.au
|
72
56
|
executables: []
|
@@ -80,12 +64,21 @@ files:
|
|
80
64
|
- app/assets/builds/katalyst/navigation.min.js
|
81
65
|
- app/assets/builds/katalyst/navigation.min.js.map
|
82
66
|
- app/assets/config/katalyst-navigation.js
|
83
|
-
- app/assets/
|
84
|
-
- app/assets/
|
85
|
-
- app/assets/
|
86
|
-
- app/assets/
|
87
|
-
- app/assets/
|
88
|
-
- app/assets/
|
67
|
+
- app/assets/images/katalyst/navigation/icons/button.svg
|
68
|
+
- app/assets/images/katalyst/navigation/icons/collapse.svg
|
69
|
+
- app/assets/images/katalyst/navigation/icons/edit.svg
|
70
|
+
- app/assets/images/katalyst/navigation/icons/expand.svg
|
71
|
+
- app/assets/images/katalyst/navigation/icons/heading.svg
|
72
|
+
- app/assets/images/katalyst/navigation/icons/hidden.svg
|
73
|
+
- app/assets/images/katalyst/navigation/icons/indent.svg
|
74
|
+
- app/assets/images/katalyst/navigation/icons/link.svg
|
75
|
+
- app/assets/images/katalyst/navigation/icons/outdent.svg
|
76
|
+
- app/assets/images/katalyst/navigation/icons/remove.svg
|
77
|
+
- app/assets/stylesheets/katalyst/_navigation.scss
|
78
|
+
- app/assets/stylesheets/katalyst/navigation.css
|
79
|
+
- app/assets/stylesheets/katalyst/navigation/editor.css
|
80
|
+
- app/assets/stylesheets/katalyst/navigation/icons.css
|
81
|
+
- app/assets/stylesheets/katalyst/navigation/status-bar.css
|
89
82
|
- app/components/katalyst/navigation/editor/base_component.rb
|
90
83
|
- app/components/katalyst/navigation/editor/errors_component.html.erb
|
91
84
|
- app/components/katalyst/navigation/editor/errors_component.rb
|
@@ -111,10 +104,11 @@ files:
|
|
111
104
|
- app/javascript/navigation/application.js
|
112
105
|
- app/javascript/navigation/editor/item.js
|
113
106
|
- app/javascript/navigation/editor/item_controller.js
|
107
|
+
- app/javascript/navigation/editor/item_editor_controller.js
|
114
108
|
- app/javascript/navigation/editor/list_controller.js
|
115
109
|
- app/javascript/navigation/editor/menu.js
|
116
110
|
- app/javascript/navigation/editor/menu_controller.js
|
117
|
-
- app/javascript/navigation/editor/
|
111
|
+
- app/javascript/navigation/editor/new_items_controller.js
|
118
112
|
- app/javascript/navigation/editor/rules-engine.js
|
119
113
|
- app/javascript/navigation/editor/status_bar_controller.js
|
120
114
|
- app/models/concerns/katalyst/navigation/garbage_collection.rb
|
@@ -129,6 +123,7 @@ files:
|
|
129
123
|
- app/models/katalyst/navigation/node.rb
|
130
124
|
- app/models/katalyst/navigation/types/nodes_type.rb
|
131
125
|
- app/views/katalyst/navigation/items/_button.html.erb
|
126
|
+
- app/views/katalyst/navigation/items/_form.html.erb
|
132
127
|
- app/views/katalyst/navigation/items/_form_errors.html.erb
|
133
128
|
- app/views/katalyst/navigation/items/_heading.html.erb
|
134
129
|
- app/views/katalyst/navigation/items/_link.html.erb
|
@@ -156,7 +151,6 @@ licenses:
|
|
156
151
|
- MIT
|
157
152
|
metadata:
|
158
153
|
rubygems_mfa_required: 'true'
|
159
|
-
post_install_message:
|
160
154
|
rdoc_options: []
|
161
155
|
require_paths:
|
162
156
|
- lib
|
@@ -171,8 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
165
|
- !ruby/object:Gem::Version
|
172
166
|
version: '0'
|
173
167
|
requirements: []
|
174
|
-
rubygems_version: 3.
|
175
|
-
signing_key:
|
168
|
+
rubygems_version: 3.6.2
|
176
169
|
specification_version: 4
|
177
170
|
summary: Navigation generator and editor
|
178
171
|
test_files: []
|
@@ -1,17 +0,0 @@
|
|
1
|
-
%icon-block {
|
2
|
-
display: block;
|
3
|
-
cursor: pointer;
|
4
|
-
position: relative;
|
5
|
-
padding: 0.65rem;
|
6
|
-
min-width: 2.5rem;
|
7
|
-
min-height: 2.5rem;
|
8
|
-
}
|
9
|
-
|
10
|
-
%icon {
|
11
|
-
position: absolute;
|
12
|
-
content: "";
|
13
|
-
width: 1.2rem;
|
14
|
-
height: 1.2rem;
|
15
|
-
background-repeat: no-repeat;
|
16
|
-
background-position: center;
|
17
|
-
}
|