@ditojs/admin 2.11.1 → 2.11.3

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.11.1",
3
+ "version": "2.11.3",
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,7 +33,7 @@
33
33
  "not ie_mob > 0"
34
34
  ],
35
35
  "dependencies": {
36
- "@ditojs/ui": "^2.11.1",
36
+ "@ditojs/ui": "^2.11.3",
37
37
  "@ditojs/utils": "^2.11.1",
38
38
  "@kyvg/vue3-notification": "^2.9.1",
39
39
  "@lk77/vue3-color": "^3.0.6",
@@ -58,7 +58,7 @@
58
58
  "@tiptap/extension-underline": "^2.0.4",
59
59
  "@tiptap/pm": "^2.0.4",
60
60
  "@tiptap/vue-3": "^2.0.4",
61
- "@vueuse/integrations": "^10.2.1",
61
+ "@vueuse/integrations": "^10.3.0",
62
62
  "codeflask": "^1.4.1",
63
63
  "filesize": "^10.0.8",
64
64
  "filesize-parser": "^1.5.0",
@@ -67,7 +67,7 @@
67
67
  "sortablejs": "^1.15.0",
68
68
  "tinycolor2": "^1.6.0",
69
69
  "tippy.js": "^6.3.7",
70
- "type-fest": "^4.0.0",
70
+ "type-fest": "^4.1.0",
71
71
  "vue": "^3.3.4",
72
72
  "vue-multiselect": "^3.0.0-beta.2",
73
73
  "vue-router": "^4.2.4",
@@ -78,12 +78,12 @@
78
78
  "@vitejs/plugin-vue": "^4.2.3",
79
79
  "@vue/compiler-sfc": "^3.3.4",
80
80
  "pug": "^3.0.2",
81
- "sass": "1.64.1",
81
+ "sass": "1.64.2",
82
82
  "typescript": "^5.1.6",
83
- "vite": "^4.4.7"
83
+ "vite": "^4.4.9"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "fb1e7ce180f5c9ce8e058a7ef22465e0428cd758",
86
+ "gitHead": "9a5406b3ce9575128e9432dfbe6a6d3177d96c3d",
87
87
  "scripts": {
88
88
  "build": "vite build",
89
89
  "watch": "yarn build --mode 'development' --watch",
@@ -29,9 +29,7 @@ export default DitoComponent.component('DitoClipboard', {
29
29
 
30
30
  props: {
31
31
  clipboard: { type: [Boolean, Object], required: true },
32
- schema: { type: Object, required: true },
33
- dataPath: { type: String, required: true },
34
- data: { type: [Object, Array], default: null }
32
+ schema: { type: Object, required: true }
35
33
  },
36
34
 
37
35
  data() {
@@ -318,12 +318,12 @@ export default DitoComponent.component('DitoForm', {
318
318
  return this.mainSchemaComponent.emitEvent(event, params)
319
319
  },
320
320
 
321
- getDataPathFrom(route) {
321
+ getDataPathFrom(routeComponent) {
322
322
  // Get the data path by denormalizePath the relative route path
323
323
  return this.api.denormalizePath(
324
324
  this.path
325
325
  // DitoViews have nested routes, so don't remove their path.
326
- .slice((route.isView ? 0 : route.path.length) + 1)
326
+ .slice((routeComponent.isView ? 0 : routeComponent.path.length) + 1)
327
327
  )
328
328
  },
329
329
 
@@ -42,8 +42,6 @@ slot(name="before")
42
42
  v-if="clipboard"
43
43
  :clipboard="clipboard"
44
44
  :schema="schema"
45
- :dataPath="dataPath"
46
- :data="data"
47
45
  )
48
46
  slot(name="edit-buttons")
49
47
  TransitionHeight(:enabled="inlined")
@@ -189,7 +187,7 @@ export default DitoComponent.component('DitoSchema', {
189
187
  },
190
188
 
191
189
  panelEntries() {
192
- return getPanelEntries(this.schema.panels, '')
190
+ return getPanelEntries(this.schema.panels, this.dataPath)
193
191
  },
194
192
 
195
193
  tabs() {
@@ -64,11 +64,11 @@ export default {
64
64
 
65
65
  let dataPath
66
66
  const getDataPath = () =>
67
- (dataPath ||= this.getItemDataPath(sourceSchema, index))
67
+ (dataPath ??= this.getItemDataPath(sourceSchema, index))
68
68
 
69
69
  let formLabel
70
70
  const getFormLabel = () =>
71
- (formLabel ||= this.getLabel(
71
+ (formLabel ??= this.getLabel(
72
72
  getItemFormSchema(sourceSchema, item, this.context)
73
73
  ))
74
74
 
@@ -252,18 +252,21 @@ export default {
252
252
  // exposed to further callbacks through DitoContext.
253
253
  callback(null, response)
254
254
  } catch (error) {
255
- // If callback returns true, errors were already handled.
256
- const { response } = error
257
- if (!callback(error, response)) {
258
- const data = response?.data
259
- const title = isString(data?.type)
260
- ? labelize(data.type)
261
- : 'Error'
262
- const text = data?.message ?? error
263
- this.notify({ type: 'error', title, text })
255
+ if (error.name !== 'AbortError') {
256
+ // If callback returns true, errors were already handled.
257
+ const { response } = error
258
+ if (!callback(error, response)) {
259
+ const data = response?.data
260
+ const title = isString(data?.type)
261
+ ? labelize(data.type)
262
+ : 'Error'
263
+ const text = data?.message ?? error
264
+ this.notify({ type: 'error', title, text })
265
+ }
264
266
  }
265
267
  }
266
268
  if (this.abortController === controller) {
269
+ // Only clear the loading state if this is still the current request.
267
270
  this.abortController = null
268
271
  this.setLoading(false, loadingOptions)
269
272
  }
@@ -205,7 +205,7 @@ export default DitoTypeComponent.register('list', {
205
205
 
206
206
  computed: {
207
207
  hasPagination() {
208
- return this.paginate && this.total > this.paginate
208
+ return !!this.paginate
209
209
  },
210
210
 
211
211
  hasListButtons() {
@@ -229,7 +229,7 @@ export default DitoTypeComponent.register('markup', {
229
229
  if (ignoreWatch) {
230
230
  ignoreWatch = false
231
231
  } else {
232
- this.editor.setContent(value, false, this.parseOptions)
232
+ this.editor.commands.setContent(value, false, this.parseOptions)
233
233
  }
234
234
  })
235
235
 
@@ -1007,7 +1007,7 @@ export function getPanelEntry(schema, dataPath = null, tabComponent = null) {
1007
1007
 
1008
1008
  export function getPanelEntries(
1009
1009
  panelSchemas,
1010
- dataPath = null,
1010
+ dataPath,
1011
1011
  tabComponent = null,
1012
1012
  panelEntries = []
1013
1013
  ) {
@@ -1015,7 +1015,7 @@ export function getPanelEntries(
1015
1015
  for (const [key, schema] of Object.entries(panelSchemas)) {
1016
1016
  const entry = getPanelEntry(
1017
1017
  schema,
1018
- dataPath != null ? appendDataPath(dataPath, key) : null,
1018
+ appendDataPath(dataPath, key),
1019
1019
  tabComponent
1020
1020
  )
1021
1021
  if (entry) {
@@ -1037,7 +1037,7 @@ export function getPanelSchemas(schema) {
1037
1037
  export function getAllPanelEntries(
1038
1038
  api,
1039
1039
  schema,
1040
- dataPath = null,
1040
+ dataPath,
1041
1041
  component = null,
1042
1042
  tabComponent = null
1043
1043
  ) {