@ditojs/admin 2.55.0 → 2.56.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.55.0",
3
+ "version": "2.56.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,8 +42,8 @@
42
42
  "not ie_mob > 0"
43
43
  ],
44
44
  "dependencies": {
45
- "@ditojs/ui": "^2.55.0",
46
- "@ditojs/utils": "^2.55.0",
45
+ "@ditojs/ui": "^2.56.0",
46
+ "@ditojs/utils": "^2.56.0",
47
47
  "@kyvg/vue3-notification": "^3.4.1",
48
48
  "@lk77/vue3-color": "^3.0.6",
49
49
  "@tiptap/core": "^2.26.1",
@@ -87,9 +87,9 @@
87
87
  "vue-upload-component": "^3.1.17"
88
88
  },
89
89
  "devDependencies": {
90
- "@ditojs/build": "^2.55.0",
90
+ "@ditojs/build": "^2.56.0",
91
91
  "typescript": "^5.9.2",
92
- "vite": "^7.1.1"
92
+ "vite": "^7.1.2"
93
93
  },
94
- "gitHead": "906852a9acf182098081af90a2183fd05c7ea480"
94
+ "gitHead": "1a6dabde4d0c91ba29740ac71e9cf7928c691bf0"
95
95
  }
@@ -105,8 +105,9 @@ export default DitoComponent.component('DitoPane', {
105
105
  const wrapPrimitives = this.sourceSchema?.wrapPrimitives
106
106
  return Object.entries(this.schema?.components || {}).map(
107
107
  ([name, schema]) => {
108
- // Always add name to component schema.
109
- schema.name = name
108
+ // Always add name to component schema, but clone it first to avoid
109
+ // mutating the original schema potentially used in multiple places.
110
+ schema = { ...schema, name }
110
111
  // Share dataPath and store with parent if not nested:
111
112
  const nested = isNested(schema)
112
113
  const nestedDataPath = appendDataPath(this.dataPath, name)
@@ -129,7 +129,7 @@ export default {
129
129
  this.wrappedPrimitives = data
130
130
  } else {
131
131
  this.value = this.isObjectSource
132
- ? data && data.length > 0
132
+ ? data?.length > 0
133
133
  ? data[0]
134
134
  : null
135
135
  : data
@@ -147,7 +147,7 @@ export async function resolveSchema(value, unwrapModule = false) {
147
147
  const name = keys[0]
148
148
  schema = schema[name]
149
149
  if (name !== 'default') {
150
- schema.name = name
150
+ schema = { ...schema, name }
151
151
  }
152
152
  }
153
153
  }
@@ -197,8 +197,11 @@ export async function resolveViews(unresolvedViews) {
197
197
  // Generate a name for sub-menus from their label if it's missing.
198
198
  // NOTE: This is never actually referenced from anywhere, but they need
199
199
  // a name by which they're stored in the parent object.
200
- schema.name = camelize(schema.label)
201
- schema.items = await resolveSchemas(schema.items)
200
+ schema = {
201
+ ...schema,
202
+ name: camelize(schema.label),
203
+ items: await resolveSchemas(schema.items)
204
+ }
202
205
  }
203
206
  return schema
204
207
  })