@ditojs/admin 2.81.0 → 2.83.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/admin",
3
- "version": "2.81.0",
3
+ "version": "2.83.0",
4
4
  "type": "module",
5
5
  "description": "Dito.js Admin is a schema based admin interface for Dito.js Server, featuring auto-generated views and forms and built with Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/admin",
@@ -42,56 +42,56 @@
42
42
  "not ie_mob > 0"
43
43
  ],
44
44
  "dependencies": {
45
- "@ditojs/ui": "^2.81.0",
46
- "@ditojs/utils": "^2.81.0",
45
+ "@ditojs/ui": "^2.83.0",
46
+ "@ditojs/utils": "^2.83.0",
47
47
  "@kyvg/vue3-notification": "^3.4.2",
48
48
  "@lk77/vue3-color": "^3.0.6",
49
- "@tiptap/core": "^3.17.1",
50
- "@tiptap/extension-blockquote": "^3.17.1",
51
- "@tiptap/extension-bold": "^3.17.1",
52
- "@tiptap/extension-bullet-list": "^3.17.1",
53
- "@tiptap/extension-code": "^3.17.1",
54
- "@tiptap/extension-code-block": "^3.17.1",
55
- "@tiptap/extension-document": "^3.17.1",
56
- "@tiptap/extension-hard-break": "^3.17.1",
57
- "@tiptap/extension-heading": "^3.17.1",
58
- "@tiptap/extension-history": "^3.17.1",
59
- "@tiptap/extension-horizontal-rule": "^3.17.1",
60
- "@tiptap/extension-italic": "^3.17.1",
61
- "@tiptap/extension-link": "^3.17.1",
62
- "@tiptap/extension-list": "^3.17.1",
63
- "@tiptap/extension-list-item": "^3.17.1",
64
- "@tiptap/extension-ordered-list": "^3.17.1",
65
- "@tiptap/extension-paragraph": "^3.17.1",
66
- "@tiptap/extension-strike": "^3.17.1",
67
- "@tiptap/extension-subscript": "^3.17.1",
68
- "@tiptap/extension-superscript": "^3.17.1",
69
- "@tiptap/extension-text": "^3.17.1",
70
- "@tiptap/extension-text-style": "^3.17.1",
71
- "@tiptap/extension-underline": "^3.17.1",
72
- "@tiptap/extensions": "^3.17.1",
73
- "@tiptap/pm": "^3.17.1",
74
- "@tiptap/vue-3": "^3.17.1",
75
- "@vueuse/integrations": "^14.1.0",
49
+ "@tiptap/core": "^3.20.0",
50
+ "@tiptap/extension-blockquote": "^3.20.0",
51
+ "@tiptap/extension-bold": "^3.20.0",
52
+ "@tiptap/extension-bullet-list": "^3.20.0",
53
+ "@tiptap/extension-code": "^3.20.0",
54
+ "@tiptap/extension-code-block": "^3.20.0",
55
+ "@tiptap/extension-document": "^3.20.0",
56
+ "@tiptap/extension-hard-break": "^3.20.0",
57
+ "@tiptap/extension-heading": "^3.20.0",
58
+ "@tiptap/extension-history": "^3.20.0",
59
+ "@tiptap/extension-horizontal-rule": "^3.20.0",
60
+ "@tiptap/extension-italic": "^3.20.0",
61
+ "@tiptap/extension-link": "^3.20.0",
62
+ "@tiptap/extension-list": "^3.20.0",
63
+ "@tiptap/extension-list-item": "^3.20.0",
64
+ "@tiptap/extension-ordered-list": "^3.20.0",
65
+ "@tiptap/extension-paragraph": "^3.20.0",
66
+ "@tiptap/extension-strike": "^3.20.0",
67
+ "@tiptap/extension-subscript": "^3.20.0",
68
+ "@tiptap/extension-superscript": "^3.20.0",
69
+ "@tiptap/extension-text": "^3.20.0",
70
+ "@tiptap/extension-text-style": "^3.20.0",
71
+ "@tiptap/extension-underline": "^3.20.0",
72
+ "@tiptap/extensions": "^3.20.0",
73
+ "@tiptap/pm": "^3.20.0",
74
+ "@tiptap/vue-3": "^3.20.0",
75
+ "@vueuse/integrations": "^14.2.1",
76
76
  "codeflask": "^1.4.1",
77
77
  "filesize": "^11.0.13",
78
78
  "filesize-parser": "^1.5.1",
79
- "focus-trap": "^7.8.0",
79
+ "focus-trap": "^8.0.0",
80
80
  "nanoid": "^5.1.6",
81
- "sortablejs": "^1.15.6",
81
+ "sortablejs": "^1.15.7",
82
82
  "tinycolor2": "^1.6.0",
83
83
  "tippy.js": "^6.3.7",
84
84
  "tiptap-footnotes": "^3.0.1",
85
- "type-fest": "^5.4.1",
86
- "vue": "^3.5.27",
85
+ "type-fest": "^5.4.4",
86
+ "vue": "^3.5.28",
87
87
  "vue-multiselect": "^3.4.0",
88
- "vue-router": "^4.6.4",
88
+ "vue-router": "^5.0.3",
89
89
  "vue-upload-component": "^3.1.17"
90
90
  },
91
91
  "devDependencies": {
92
- "@ditojs/build": "^2.81.0",
92
+ "@ditojs/build": "^2.83.0",
93
93
  "typescript": "^5.9.3",
94
94
  "vite": "^7.3.1"
95
95
  },
96
- "gitHead": "13502bffe56e6c570a96092c692b9178789e3f62"
96
+ "gitHead": "276e6adff5ae8e8b607aec5a1e0740fec8ca7e52"
97
97
  }
@@ -1,5 +1,8 @@
1
1
  <template lang="pug">
2
- .dito-form.dito-scroll-parent(:data-resource="sourceSchema.path")
2
+ .dito-form.dito-scroll-parent(
3
+ :class="{ 'dito-form-nested': isNestedRoute }"
4
+ :data-resource="sourceSchema.path"
5
+ )
3
6
  //- Only render a router-view here if this isn't the last data route and not a
4
7
  //- nested form route, which will appear elsewhere in its own view.
5
8
  RouterView(
@@ -28,7 +28,9 @@
28
28
  import DitoTypeComponent from '../DitoTypeComponent.js'
29
29
  import DomMixin from '../mixins/DomMixin.js'
30
30
  import { getSchemaAccessor } from '../utils/accessor.js'
31
+ // Tiptap:
31
32
  import { Editor, EditorContent, Mark, getMarkAttributes } from '@tiptap/vue-3'
33
+ import { Slice, Fragment } from '@tiptap/pm/model'
32
34
  // Essentials:
33
35
  import { Document } from '@tiptap/extension-document'
34
36
  import { Text } from '@tiptap/extension-text'
@@ -171,7 +173,41 @@ export default DitoTypeComponent.register('markup', {
171
173
  autoFocus: this.autofocus,
172
174
  disableInputRules: !this.enableRules.input,
173
175
  disablePasteRules: !this.enableRules.paste,
174
- parseOptions: this.parseOptions
176
+ parseOptions: this.parseOptions,
177
+ editorProps: this.hardBreak
178
+ ? {
179
+ handlePaste: (view, event, slice) => {
180
+ const nodes = []
181
+
182
+ slice.content.forEach((node, offset, index) => {
183
+ if (index > 0 && node.type.name === 'paragraph') {
184
+ // Add hard break between paragraphs
185
+ nodes.push(view.state.schema.nodes.hardBreak.create())
186
+ }
187
+
188
+ // Extract content from paragraphs, keep other nodes as-is
189
+ if (node.type.name === 'paragraph') {
190
+ node.content.forEach(child => nodes.push(child))
191
+ } else {
192
+ nodes.push(node)
193
+ }
194
+ })
195
+
196
+ const paragraph = view.state.schema.nodes.paragraph.create(
197
+ null,
198
+ Fragment.from(nodes)
199
+ )
200
+
201
+ view.dispatch(
202
+ view.state.tr.replaceSelection(
203
+ new Slice(Fragment.from(paragraph), 0, 0)
204
+ )
205
+ )
206
+
207
+ return true
208
+ }
209
+ }
210
+ : {}
175
211
  }
176
212
  },
177
213