@ditojs/admin 2.9.5 → 2.10.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.9.5",
3
+ "version": "2.10.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",
@@ -33,8 +33,8 @@
33
33
  "not ie_mob > 0"
34
34
  ],
35
35
  "dependencies": {
36
- "@ditojs/ui": "^2.9.3",
37
- "@ditojs/utils": "^2.9.0",
36
+ "@ditojs/ui": "^2.10.0",
37
+ "@ditojs/utils": "^2.10.0",
38
38
  "@kyvg/vue3-notification": "^2.9.1",
39
39
  "@lk77/vue3-color": "^3.0.6",
40
40
  "@tiptap/core": "^2.0.3",
@@ -62,28 +62,28 @@
62
62
  "codeflask": "^1.4.1",
63
63
  "filesize": "^10.0.7",
64
64
  "filesize-parser": "^1.5.0",
65
- "focus-trap": "^7.4.1",
65
+ "focus-trap": "^7.4.3",
66
66
  "nanoid": "^4.0.2",
67
67
  "sortablejs": "^1.15.0",
68
68
  "tinycolor2": "^1.6.0",
69
69
  "tippy.js": "^6.3.7",
70
- "type-fest": "^3.10.0",
71
- "vue": "^3.3.2",
70
+ "type-fest": "^3.11.1",
71
+ "vue": "^3.3.4",
72
72
  "vue-multiselect": "^3.0.0-beta.2",
73
- "vue-router": "^4.2.0",
73
+ "vue-router": "^4.2.2",
74
74
  "vue-upload-component": "^3.1.8"
75
75
  },
76
76
  "devDependencies": {
77
- "@ditojs/build": "^2.9.0",
77
+ "@ditojs/build": "^2.10.0",
78
78
  "@vitejs/plugin-vue": "^4.2.3",
79
- "@vue/compiler-sfc": "^3.3.2",
79
+ "@vue/compiler-sfc": "^3.3.4",
80
80
  "pug": "^3.0.2",
81
81
  "sass": "1.62.1",
82
- "typescript": "^5.0.4",
83
- "vite": "^4.3.7"
82
+ "typescript": "^5.1.3",
83
+ "vite": "^4.3.9"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "e3e70442d05a10fd6a82c4ed58f9580b3643d4ab",
86
+ "gitHead": "ef290c4c55a5e65a88fdd124634ca3edae4e735f",
87
87
  "scripts": {
88
88
  "build": "vite build",
89
89
  "watch": "yarn build --mode 'development' --watch",
@@ -1,10 +1,17 @@
1
1
  <template lang="pug">
2
2
  component(
3
- v-if="content"
4
- :is="options.tag || tag"
3
+ v-if="options?.text != null"
4
+ :is="tagName"
5
5
  :class="classes"
6
6
  :style="styles"
7
7
  ) {{ options.text }}
8
+ component(
9
+ v-else-if="options?.html != null"
10
+ :is="tagName"
11
+ :class="classes"
12
+ :style="styles"
13
+ v-html="options.html"
14
+ )
8
15
  </template>
9
16
 
10
17
  <script>
@@ -21,7 +28,15 @@ export default DitoComponent.component('DitoElement', {
21
28
  computed: {
22
29
  options() {
23
30
  const { content } = this
24
- return isObject(content) ? content : { text: content }
31
+ return content != null
32
+ ? isObject(content)
33
+ ? content
34
+ : { text: content }
35
+ : null
36
+ },
37
+
38
+ tagName() {
39
+ return this.options.tag || this.tag
25
40
  },
26
41
 
27
42
  classes() {
@@ -296,10 +296,6 @@ export default DitoComponent.component('DitoPane', {
296
296
  padding: $form-spacing;
297
297
  }
298
298
 
299
- &--padding-panel {
300
- padding: $form-spacing;
301
- }
302
-
303
299
  .dito-break {
304
300
  // `.dito-break` is rendered as <span> so we can use the
305
301
  // `.dito-container:first-of-type` selector to match the first container
@@ -12,7 +12,7 @@ component.dito-panel(
12
12
  :data="panelData"
13
13
  :meta="meta"
14
14
  :store="store"
15
- padding="panel"
15
+ padding="nested"
16
16
  :disabled="disabled"
17
17
  :hasOwnData="hasOwnData"
18
18
  generateLabels
@@ -7,6 +7,7 @@ DitoSchema.dito-schema-inlined(
7
7
  :meta="meta"
8
8
  :store="store"
9
9
  :label="isCompact ? null : label"
10
+ padding="inlined"
10
11
  :inlined="true"
11
12
  :disabled="disabled"
12
13
  :collapsed="collapsed"
@@ -71,7 +71,7 @@ export default DitoTypeComponent.register('section', {
71
71
  }
72
72
 
73
73
  // For animation purposes, move the padding to the contained panes.
74
- .dito-pane {
74
+ > .dito-schema > .dito-schema-content > .dito-pane {
75
75
  padding: $form-spacing;
76
76
 
77
77
  &:has(> .dito-container--label-vertical:first-of-type) {
@@ -133,7 +133,10 @@ export async function resolveSchema(schema, unwrapModule = false) {
133
133
  schema = { ...schema }
134
134
  // Unwrap default or named schema
135
135
  if (!schema.name && (unwrapModule || schema.default)) {
136
- const keys = Object.keys(schema)
136
+ // Filter out internal key added by vite / vue 3 plugin when changing
137
+ // code in a dynamically imported vue component, see:
138
+ // https://github.com/vitejs/vite-plugin-vue/blob/abdf5f4f32d02af641e5f60871bde14535569b1e/packages/plugin-vue/src/main.ts#L133
139
+ const keys = Object.keys(schema).filter(key => key !== '_rerender_only')
137
140
  if (keys.length === 1) {
138
141
  const name = keys[0]
139
142
  schema = schema[name]