@ditojs/admin 2.82.0 → 2.84.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.82.0",
3
+ "version": "2.84.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.82.0",
46
- "@ditojs/utils": "^2.82.0",
45
+ "@ditojs/ui": "^2.84.0",
46
+ "@ditojs/utils": "^2.84.0",
47
47
  "@kyvg/vue3-notification": "^3.4.2",
48
48
  "@lk77/vue3-color": "^3.0.6",
49
- "@tiptap/core": "^3.19.0",
50
- "@tiptap/extension-blockquote": "^3.19.0",
51
- "@tiptap/extension-bold": "^3.19.0",
52
- "@tiptap/extension-bullet-list": "^3.19.0",
53
- "@tiptap/extension-code": "^3.19.0",
54
- "@tiptap/extension-code-block": "^3.19.0",
55
- "@tiptap/extension-document": "^3.19.0",
56
- "@tiptap/extension-hard-break": "^3.19.0",
57
- "@tiptap/extension-heading": "^3.19.0",
58
- "@tiptap/extension-history": "^3.19.0",
59
- "@tiptap/extension-horizontal-rule": "^3.19.0",
60
- "@tiptap/extension-italic": "^3.19.0",
61
- "@tiptap/extension-link": "^3.19.0",
62
- "@tiptap/extension-list": "^3.19.0",
63
- "@tiptap/extension-list-item": "^3.19.0",
64
- "@tiptap/extension-ordered-list": "^3.19.0",
65
- "@tiptap/extension-paragraph": "^3.19.0",
66
- "@tiptap/extension-strike": "^3.19.0",
67
- "@tiptap/extension-subscript": "^3.19.0",
68
- "@tiptap/extension-superscript": "^3.19.0",
69
- "@tiptap/extension-text": "^3.19.0",
70
- "@tiptap/extension-text-style": "^3.19.0",
71
- "@tiptap/extension-underline": "^3.19.0",
72
- "@tiptap/extensions": "^3.19.0",
73
- "@tiptap/pm": "^3.19.0",
74
- "@tiptap/vue-3": "^3.19.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
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
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
85
  "type-fest": "^5.4.4",
86
- "vue": "^3.5.28",
86
+ "vue": "^3.5.29",
87
87
  "vue-multiselect": "^3.4.0",
88
- "vue-router": "^5.0.2",
88
+ "vue-router": "^5.0.3",
89
89
  "vue-upload-component": "^3.1.17"
90
90
  },
91
91
  "devDependencies": {
92
- "@ditojs/build": "^2.82.0",
92
+ "@ditojs/build": "^2.84.0",
93
93
  "typescript": "^5.9.3",
94
94
  "vite": "^7.3.1"
95
95
  },
96
- "gitHead": "7e721714e882dd1a02bf13354569a3744d4fefbe"
96
+ "gitHead": "e087912f9e510eb883080a0621ee4c2dde4421c1"
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
 
@@ -218,6 +218,7 @@ export default DitoTypeComponent.register('multiselect', {
218
218
  onAddTag(tag) {
219
219
  const option = this.addTagOption(tag)
220
220
  if (option) {
221
+ this.value ??= []
221
222
  this.value.push(this.getValueForOption(option))
222
223
  }
223
224
  },
@@ -383,9 +384,11 @@ $tag-line-height: 1em;
383
384
  padding: $input-padding;
384
385
 
385
386
  &::after {
386
- // Instruction text for options
387
- padding: $input-padding;
388
- line-height: $tag-line-height;
387
+ // Instruction text for options (e.g. "Press enter to add new tag")
388
+ position: static;
389
+ height: auto;
390
+ line-height: inherit;
391
+ padding-left: $input-padding-hor;
389
392
  }
390
393
 
391
394
  // Only show the highlight once the pulldown has received mouse or
@@ -401,8 +404,6 @@ $tag-line-height: 1em;
401
404
 
402
405
  &--highlight {
403
406
  &::after {
404
- display: block;
405
- position: absolute;
406
407
  background: transparent;
407
408
  color: $color-white;
408
409
  }