@navette-js/forms 1.0.0-beta.4 → 1.0.0-beta.5

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.
@@ -0,0 +1,394 @@
1
+ export const RICH_EDITOR_TOOL_DEFINITIONS = [
2
+ {
3
+ "name": "bold",
4
+ "label": "filament-forms::components.rich_editor.tools.bold",
5
+ "jsHandler": "$getEditor()?.chain().focus().toggleBold().run()",
6
+ "toggle": true,
7
+ "icon": "m-bold"
8
+ },
9
+ {
10
+ "name": "italic",
11
+ "label": "filament-forms::components.rich_editor.tools.italic",
12
+ "jsHandler": "$getEditor()?.chain().focus().toggleItalic().run()",
13
+ "toggle": true,
14
+ "icon": "m-italic"
15
+ },
16
+ {
17
+ "name": "underline",
18
+ "label": "filament-forms::components.rich_editor.tools.underline",
19
+ "jsHandler": "$getEditor()?.chain().focus().toggleUnderline().run()",
20
+ "toggle": true,
21
+ "icon": "m-underline"
22
+ },
23
+ {
24
+ "name": "strike",
25
+ "label": "filament-forms::components.rich_editor.tools.strike",
26
+ "jsHandler": "$getEditor()?.chain().focus().toggleStrike().run()",
27
+ "toggle": true,
28
+ "icon": "m-strikethrough"
29
+ },
30
+ {
31
+ "name": "subscript",
32
+ "label": "filament-forms::components.rich_editor.tools.subscript",
33
+ "jsHandler": "$getEditor()?.chain().focus().toggleSubscript().run()",
34
+ "toggle": true,
35
+ "icon": "fi-o-subscript"
36
+ },
37
+ {
38
+ "name": "superscript",
39
+ "label": "filament-forms::components.rich_editor.tools.superscript",
40
+ "jsHandler": "$getEditor()?.chain().focus().toggleSuperscript().run()",
41
+ "toggle": true,
42
+ "icon": "fi-o-superscript"
43
+ },
44
+ {
45
+ "name": "link",
46
+ "label": "filament-forms::components.rich_editor.tools.link",
47
+ "action": "{ url: $getEditor().getAttributes('link')?.href, shouldOpenInNewTab: $getEditor().getAttributes('link')?.target === '_blank' }",
48
+ "toggle": true,
49
+ "icon": "m-link"
50
+ },
51
+ {
52
+ "name": "textColor",
53
+ "label": "filament-forms::components.rich_editor.tools.text_color",
54
+ "action": "{ color: $getEditor().getAttributes('textColor')['data-color'] ?? null }",
55
+ "toggle": true,
56
+ "icon": "m-swatch"
57
+ },
58
+ {
59
+ "name": "h1",
60
+ "label": "filament-forms::components.rich_editor.tools.h1",
61
+ "jsHandler": "$getEditor()?.chain().focus().toggleHeading({ level: 1 }).run()",
62
+ "toggle": true,
63
+ "icon": "fi-o-h1",
64
+ "activeKey": "heading",
65
+ "activeOptions": {
66
+ "level": 1
67
+ }
68
+ },
69
+ {
70
+ "name": "h2",
71
+ "label": "filament-forms::components.rich_editor.tools.h2",
72
+ "jsHandler": "$getEditor()?.chain().focus().toggleHeading({ level: 2 }).run()",
73
+ "toggle": true,
74
+ "icon": "fi-o-h2",
75
+ "activeKey": "heading",
76
+ "activeOptions": {
77
+ "level": 2
78
+ }
79
+ },
80
+ {
81
+ "name": "h3",
82
+ "label": "filament-forms::components.rich_editor.tools.h3",
83
+ "jsHandler": "$getEditor()?.chain().focus().toggleHeading({ level: 3 }).run()",
84
+ "toggle": true,
85
+ "icon": "fi-o-h3",
86
+ "activeKey": "heading",
87
+ "activeOptions": {
88
+ "level": 3
89
+ }
90
+ },
91
+ {
92
+ "name": "paragraph",
93
+ "label": "filament-forms::components.rich_editor.tools.paragraph",
94
+ "jsHandler": "$getEditor()?.chain().focus().setParagraph().run()",
95
+ "toggle": true,
96
+ "icon": "fi-o-paragraph"
97
+ },
98
+ {
99
+ "name": "h4",
100
+ "label": "filament-forms::components.rich_editor.tools.h4",
101
+ "jsHandler": "$getEditor()?.chain().focus().toggleHeading({ level: 4 }).run()",
102
+ "toggle": true,
103
+ "icon": "fi-o-h4",
104
+ "activeKey": "heading",
105
+ "activeOptions": {
106
+ "level": 4
107
+ }
108
+ },
109
+ {
110
+ "name": "h5",
111
+ "label": "filament-forms::components.rich_editor.tools.h5",
112
+ "jsHandler": "$getEditor()?.chain().focus().toggleHeading({ level: 5 }).run()",
113
+ "toggle": true,
114
+ "icon": "fi-o-h5",
115
+ "activeKey": "heading",
116
+ "activeOptions": {
117
+ "level": 5
118
+ }
119
+ },
120
+ {
121
+ "name": "h6",
122
+ "label": "filament-forms::components.rich_editor.tools.h6",
123
+ "jsHandler": "$getEditor()?.chain().focus().toggleHeading({ level: 6 }).run()",
124
+ "toggle": true,
125
+ "icon": "fi-o-h6",
126
+ "activeKey": "heading",
127
+ "activeOptions": {
128
+ "level": 6
129
+ }
130
+ },
131
+ {
132
+ "name": "blockquote",
133
+ "label": "filament-forms::components.rich_editor.tools.blockquote",
134
+ "jsHandler": "$getEditor()?.chain().focus().toggleBlockquote().run()",
135
+ "toggle": true,
136
+ "icon": "m-chat-bubble-bottom-center-text"
137
+ },
138
+ {
139
+ "name": "code",
140
+ "label": "filament-forms::components.rich_editor.tools.code",
141
+ "jsHandler": "$getEditor()?.chain().focus().toggleCode().run()",
142
+ "toggle": true,
143
+ "icon": "fi-o-code"
144
+ },
145
+ {
146
+ "name": "codeBlock",
147
+ "label": "filament-forms::components.rich_editor.tools.code_block",
148
+ "jsHandler": "$getEditor()?.chain().focus().toggleCodeBlock().run()",
149
+ "toggle": true,
150
+ "icon": "fi-o-code-block"
151
+ },
152
+ {
153
+ "name": "bulletList",
154
+ "label": "filament-forms::components.rich_editor.tools.bullet_list",
155
+ "jsHandler": "$getEditor()?.chain().focus().toggleBulletList().run()",
156
+ "toggle": true,
157
+ "icon": "m-list-bullet"
158
+ },
159
+ {
160
+ "name": "orderedList",
161
+ "label": "filament-forms::components.rich_editor.tools.ordered_list",
162
+ "jsHandler": "$getEditor()?.chain().focus().toggleOrderedList().run()",
163
+ "toggle": true,
164
+ "icon": "m-numbered-list"
165
+ },
166
+ {
167
+ "name": "table",
168
+ "label": "filament-forms::components.rich_editor.tools.table",
169
+ "jsHandler": "$getEditor()?.commands.insertTable({ rows: 2, cols: 3, withHeaderRow: true })",
170
+ "icon": "fi-o-table"
171
+ },
172
+ {
173
+ "name": "tableAddColumnBefore",
174
+ "label": "filament-forms::components.rich_editor.tools.table_add_column_before",
175
+ "jsHandler": "$getEditor()?.chain().focus().addColumnBefore().run()",
176
+ "icon": "fi-o-table-add-column-before"
177
+ },
178
+ {
179
+ "name": "tableAddColumnAfter",
180
+ "label": "filament-forms::components.rich_editor.tools.table_add_column_after",
181
+ "jsHandler": "$getEditor()?.chain().focus().addColumnAfter().run()",
182
+ "icon": "fi-o-table-add-column-after"
183
+ },
184
+ {
185
+ "name": "tableDeleteColumn",
186
+ "label": "filament-forms::components.rich_editor.tools.table_delete_column",
187
+ "jsHandler": "$getEditor()?.chain().focus().deleteColumn().run()",
188
+ "icon": "fi-o-table-delete-column"
189
+ },
190
+ {
191
+ "name": "tableAddRowBefore",
192
+ "label": "filament-forms::components.rich_editor.tools.table_add_row_before",
193
+ "jsHandler": "$getEditor()?.chain().focus().addRowBefore().run()",
194
+ "icon": "fi-o-table-add-row-before"
195
+ },
196
+ {
197
+ "name": "tableAddRowAfter",
198
+ "label": "filament-forms::components.rich_editor.tools.table_add_row_after",
199
+ "jsHandler": "$getEditor()?.chain().focus().addRowAfter().run()",
200
+ "icon": "fi-o-table-add-row-after"
201
+ },
202
+ {
203
+ "name": "tableDeleteRow",
204
+ "label": "filament-forms::components.rich_editor.tools.table_delete_row",
205
+ "jsHandler": "$getEditor()?.chain().focus().deleteRow().run()",
206
+ "icon": "fi-o-table-delete-row"
207
+ },
208
+ {
209
+ "name": "tableMergeCells",
210
+ "label": "filament-forms::components.rich_editor.tools.table_merge_cells",
211
+ "jsHandler": "$getEditor()?.chain().focus().mergeCells().run()",
212
+ "icon": "fi-o-table-merge-cells"
213
+ },
214
+ {
215
+ "name": "tableSplitCell",
216
+ "label": "filament-forms::components.rich_editor.tools.table_split_cell",
217
+ "jsHandler": "$getEditor()?.chain().focus().splitCell().run()",
218
+ "icon": "fi-o-table-split-cell"
219
+ },
220
+ {
221
+ "name": "tableToggleHeaderRow",
222
+ "label": "filament-forms::components.rich_editor.tools.table_toggle_header_row",
223
+ "jsHandler": "$getEditor()?.chain().focus().toggleHeaderRow().run()",
224
+ "icon": "fi-o-table-toggle-header-row"
225
+ },
226
+ {
227
+ "name": "tableToggleHeaderCell",
228
+ "label": "filament-forms::components.rich_editor.tools.table_toggle_header_cell",
229
+ "jsHandler": "$getEditor()?.chain().focus().toggleHeaderCell().run()",
230
+ "icon": "fi-o-table-toggle-header-cell"
231
+ },
232
+ {
233
+ "name": "tableDelete",
234
+ "label": "filament-forms::components.rich_editor.tools.table_delete",
235
+ "jsHandler": "$getEditor()?.chain().focus().deleteTable().run()",
236
+ "icon": "fi-o-table-delete"
237
+ },
238
+ {
239
+ "name": "attachFiles",
240
+ "label": "filament-forms::components.rich_editor.tools.attach_files",
241
+ "action": "{ alt: $getEditor().getAttributes('image')?.alt, id: $getEditor().getAttributes('image')?.id, src: $getEditor().getAttributes('image')?.src }",
242
+ "icon": "m-paper-clip",
243
+ "activeKey": "image"
244
+ },
245
+ {
246
+ "name": "customBlocks",
247
+ "label": "filament-forms::components.rich_editor.tools.custom_blocks",
248
+ "jsHandler": "togglePanel('customBlocks')",
249
+ "icon": "m-squares-plus",
250
+ "activeJsExpression": "isPanelActive('customBlocks')"
251
+ },
252
+ {
253
+ "name": "mergeTags",
254
+ "label": "filament-forms::components.rich_editor.tools.merge_tags",
255
+ "jsHandler": "togglePanel('mergeTags')",
256
+ "icon": "fi-o-merge-tag",
257
+ "activeJsExpression": "isPanelActive('mergeTags')"
258
+ },
259
+ {
260
+ "name": "horizontalRule",
261
+ "label": "filament-forms::components.rich_editor.tools.horizontal_rule",
262
+ "jsHandler": "$getEditor()?.chain().focus().setHorizontalRule().run()",
263
+ "icon": "m-minus"
264
+ },
265
+ {
266
+ "name": "highlight",
267
+ "label": "filament-forms::components.rich_editor.tools.highlight",
268
+ "jsHandler": "$getEditor()?.chain().focus().toggleHighlight().run()",
269
+ "toggle": true,
270
+ "icon": "fi-o-highlight"
271
+ },
272
+ {
273
+ "name": "small",
274
+ "label": "filament-forms::components.rich_editor.tools.small",
275
+ "jsHandler": "$getEditor()?.chain().focus().toggleSmall().run()",
276
+ "toggle": true,
277
+ "icon": "fi-o-small"
278
+ },
279
+ {
280
+ "name": "lead",
281
+ "label": "filament-forms::components.rich_editor.tools.lead",
282
+ "jsHandler": "$getEditor()?.chain().focus().toggleLead().run()",
283
+ "toggle": true,
284
+ "icon": "fi-o-lead"
285
+ },
286
+ {
287
+ "name": "undo",
288
+ "label": "filament-forms::components.rich_editor.tools.undo",
289
+ "jsHandler": "$getEditor()?.chain().focus().undo().run()",
290
+ "icon": "m-arrow-uturn-left"
291
+ },
292
+ {
293
+ "name": "redo",
294
+ "label": "filament-forms::components.rich_editor.tools.redo",
295
+ "jsHandler": "$getEditor()?.chain().focus().redo().run()",
296
+ "icon": "m-arrow-uturn-right"
297
+ },
298
+ {
299
+ "name": "alignStart",
300
+ "label": "filament-forms::components.rich_editor.tools.align_start",
301
+ "jsHandler": "$getEditor()?.chain().focus().setTextAlign('start').run()",
302
+ "toggle": true,
303
+ "icon": "fi-o-align-start",
304
+ "activeJsExpression": "$getEditor()?.isActive({ textAlign: 'start' })"
305
+ },
306
+ {
307
+ "name": "alignCenter",
308
+ "label": "filament-forms::components.rich_editor.tools.align_center",
309
+ "jsHandler": "$getEditor()?.chain().focus().setTextAlign('center').run()",
310
+ "toggle": true,
311
+ "icon": "fi-o-align-center",
312
+ "activeJsExpression": "$getEditor()?.isActive({ textAlign: 'center' })"
313
+ },
314
+ {
315
+ "name": "alignEnd",
316
+ "label": "filament-forms::components.rich_editor.tools.align_end",
317
+ "jsHandler": "$getEditor()?.chain().focus().setTextAlign('end').run()",
318
+ "toggle": true,
319
+ "icon": "fi-o-align-end",
320
+ "activeJsExpression": "$getEditor()?.isActive({ textAlign: 'end' })"
321
+ },
322
+ {
323
+ "name": "alignJustify",
324
+ "label": "filament-forms::components.rich_editor.tools.align_justify",
325
+ "jsHandler": "$getEditor()?.chain().focus().setTextAlign('justify').run()",
326
+ "toggle": true,
327
+ "icon": "fi-o-align-justify",
328
+ "activeJsExpression": "$getEditor()?.isActive({ textAlign: 'justify' })"
329
+ },
330
+ {
331
+ "name": "grid",
332
+ "label": "filament-forms::components.rich_editor.tools.grid",
333
+ "action": "{}",
334
+ "icon": "fi-o-columns",
335
+ "activeJsExpression": "false"
336
+ },
337
+ {
338
+ "name": "gridAddColumnBefore",
339
+ "label": "filament-forms::components.rich_editor.tools.table_add_column_before",
340
+ "jsHandler": "$getEditor()?.chain().focus().addGridColumnBefore().run()",
341
+ "icon": "fi-o-table-add-column-before",
342
+ "activeJsExpression": "$getEditor()?.can().addGridColumnBefore()",
343
+ "activeStyling": false,
344
+ "disabledWhenNotActive": true,
345
+ "extraAttributes": {
346
+ "data-testid": "grid-add-column-before"
347
+ }
348
+ },
349
+ {
350
+ "name": "gridAddColumnAfter",
351
+ "label": "filament-forms::components.rich_editor.tools.table_add_column_after",
352
+ "jsHandler": "$getEditor()?.chain().focus().addGridColumnAfter().run()",
353
+ "icon": "fi-o-table-add-column-after",
354
+ "activeJsExpression": "$getEditor()?.can().addGridColumnAfter()",
355
+ "activeStyling": false,
356
+ "disabledWhenNotActive": true,
357
+ "extraAttributes": {
358
+ "data-testid": "grid-add-column-after"
359
+ }
360
+ },
361
+ {
362
+ "name": "gridDeleteColumn",
363
+ "label": "filament-forms::components.rich_editor.tools.table_delete_column",
364
+ "jsHandler": "$getEditor()?.chain().focus().deleteGridColumn().run()",
365
+ "icon": "fi-o-table-delete-column",
366
+ "activeJsExpression": "$getEditor()?.can().deleteGridColumn()",
367
+ "activeStyling": false,
368
+ "disabledWhenNotActive": true,
369
+ "extraAttributes": {
370
+ "data-testid": "grid-delete-column"
371
+ }
372
+ },
373
+ {
374
+ "name": "gridDelete",
375
+ "label": "filament-forms::components.rich_editor.tools.grid_delete",
376
+ "jsHandler": "$getEditor()?.chain().focus().deleteGrid().run()",
377
+ "icon": "fi-o-columns-delete",
378
+ "activeKey": "grid",
379
+ "activeStyling": false,
380
+ "disabledWhenNotActive": true
381
+ },
382
+ {
383
+ "name": "details",
384
+ "label": "filament-forms::components.rich_editor.tools.details",
385
+ "jsHandler": "$getEditor()?.chain().focus().setDetails().run()",
386
+ "icon": "fi-o-details"
387
+ },
388
+ {
389
+ "name": "clearFormatting",
390
+ "label": "filament-forms::components.rich_editor.tools.clear_formatting",
391
+ "jsHandler": "$getEditor()?.chain().focus().clearNodes().unsetAllMarks().run()",
392
+ "icon": "fi-o-clear-formatting"
393
+ }
394
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navette-js/forms",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.5",
4
4
  "description": "Form fields and validation for Navette admin panels.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,9 +42,9 @@
42
42
  "node"
43
43
  ],
44
44
  "dependencies": {
45
- "@navette-js/actions": "1.0.0-beta.4",
46
- "@navette-js/schemas": "1.0.0-beta.4",
47
- "@navette-js/support": "1.0.0-beta.4",
45
+ "@navette-js/actions": "1.0.0-beta.5",
46
+ "@navette-js/schemas": "1.0.0-beta.5",
47
+ "@navette-js/support": "1.0.0-beta.5",
48
48
  "@tiptap/core": "^3.33.1",
49
49
  "@tiptap/extension-highlight": "^3.33.1",
50
50
  "@tiptap/extension-image": "^3.33.1",