@ditojs/admin 2.6.10 → 2.7.1

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.6.10",
3
+ "version": "2.7.1",
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.6.10",
37
- "@ditojs/utils": "^2.6.0",
36
+ "@ditojs/ui": "^2.7.1",
37
+ "@ditojs/utils": "^2.7.1",
38
38
  "@kyvg/vue3-notification": "^2.9.0",
39
39
  "@lk77/vue3-color": "^3.0.6",
40
40
  "@tiptap/core": "^2.0.3",
@@ -83,7 +83,7 @@
83
83
  "vite": "^4.3.4"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "12d6a71efe6eb89b514b7ca9737fefc3afc319f2",
86
+ "gitHead": "3fe49034af7e93f2cc61da3f2add40c4e41893d5",
87
87
  "scripts": {
88
88
  "build": "vite build",
89
89
  "watch": "yarn build --mode 'development' --watch",
package/src/DitoAdmin.js CHANGED
@@ -4,10 +4,11 @@ import VueNotifications from '@kyvg/vue3-notification'
4
4
  import {
5
5
  isString,
6
6
  isAbsoluteUrl,
7
- merge,
7
+ assignDeeply,
8
8
  hyphenate,
9
9
  camelize,
10
- defaultFormats
10
+ defaultFormats,
11
+ deprecate
11
12
  } from '@ditojs/utils'
12
13
  import * as components from './components/index.js'
13
14
  import * as types from './types/index.js'
@@ -15,7 +16,6 @@ import DitoRoot from './components/DitoRoot.vue'
15
16
  import DitoTypeComponent from './DitoTypeComponent.js'
16
17
  import ResizeDirective from './directives/resize.js'
17
18
  import { getResource } from './utils/resource.js'
18
- import { deprecate } from './utils/deprecate.js'
19
19
  import { formatQuery } from './utils/route.js'
20
20
  import verbs from './verbs.js'
21
21
 
@@ -31,12 +31,12 @@ export default class DitoAdmin {
31
31
  // Merge in `api` settings as passed from `config.admin` and through the
32
32
  // `AdminController` with `api` values from from 'admin/index.js'
33
33
  // NOTE: `AdminController` provides `dito.api.base`
34
- this.api = api = merge({ base: '/' }, dito.api, api)
34
+ this.api = api = assignDeeply({ base: '/' }, dito.api, api)
35
35
  this.options = options
36
36
 
37
37
  // Setup default api settings:
38
38
  api.locale ||= 'en-US'
39
- api.formats = merge({}, defaultFormats, api.formats)
39
+ api.formats = assignDeeply({}, defaultFormats, api.formats)
40
40
  api.request ||= options => request(api, options)
41
41
  api.getApiUrl ||= options => getApiUrl(api, options)
42
42
  api.isApiUrl ||= url => isApiUrl(api, url)
@@ -194,6 +194,10 @@ export default class DitoAdmin {
194
194
  })
195
195
  }))
196
196
 
197
+ // Prevent endless loops of error messages during render functions by
198
+ // setting a custom error handler.
199
+ app.config.errorHandler = console.error
200
+
197
201
  app.use(VueNotifications, {
198
202
  name: 'notify',
199
203
  componentName: 'VueNotifications'
@@ -48,7 +48,7 @@
48
48
  </template>
49
49
 
50
50
  <script>
51
- import { clone, capitalize, parseDataPath, merge } from '@ditojs/utils'
51
+ import { clone, capitalize, parseDataPath, assignDeeply } from '@ditojs/utils'
52
52
  import DitoComponent from '../DitoComponent.js'
53
53
  import RouteMixin from '../mixins/RouteMixin.js'
54
54
  import ResourceMixin from '../mixins/ResourceMixin.js'
@@ -99,7 +99,7 @@ export default DitoComponent.component('DitoForm', {
99
99
 
100
100
  buttonSchemas() {
101
101
  return getButtonSchemas(
102
- merge(
102
+ assignDeeply(
103
103
  {
104
104
  cancel: {
105
105
  type: 'button',
@@ -449,8 +449,8 @@ let dialogId = 0
449
449
  function addRoutes(router, routes) {
450
450
  const removers = []
451
451
  for (const route of routes) {
452
- const removeRoute = router.addRoute(route)
453
- removers.push(removeRoute)
452
+ const remove = router.addRoute(route)
453
+ removers.push(remove)
454
454
  }
455
455
 
456
456
  return () => {
@@ -22,7 +22,7 @@
22
22
  import DitoTypeComponent from '../DitoTypeComponent.js'
23
23
  import { getSchemaAccessor } from '../utils/accessor.js'
24
24
  import { DatePicker, TimePicker, DateTimePicker } from '@ditojs/ui/src'
25
- import { isDate, merge } from '@ditojs/utils'
25
+ import { isDate, assignDeeply } from '@ditojs/utils'
26
26
 
27
27
  export default DitoTypeComponent.register(
28
28
  ['date', 'datetime', 'time'],
@@ -53,7 +53,7 @@ export default DitoTypeComponent.register(
53
53
  type: Object,
54
54
  default: null,
55
55
  get(formats) {
56
- const { date, time } = merge({}, this.api.formats, formats)
56
+ const { date, time } = assignDeeply({}, this.api.formats, formats)
57
57
  return {
58
58
  date: ['date', 'datetime'].includes(this.type) ? date : null,
59
59
  time: ['time', 'datetime'].includes(this.type) ? time : null
@@ -14,8 +14,8 @@ import {
14
14
  isModule,
15
15
  asArray,
16
16
  clone,
17
- merge,
18
17
  camelize,
18
+ assignDeeply,
19
19
  mapConcurrently,
20
20
  getValueAtDataPath
21
21
  } from '@ditojs/utils'
@@ -321,7 +321,7 @@ export function processSchemaDefaults(api, schema) {
321
321
  if (schema[key] === undefined) {
322
322
  schema[key] = value
323
323
  } else {
324
- schema[key] = merge(value, schema[key])
324
+ schema[key] = assignDeeply(value, schema[key])
325
325
  }
326
326
  }
327
327
  }
@@ -1,9 +0,0 @@
1
- const loggedDeprecations = new Set()
2
-
3
- export function deprecate(message) {
4
- // Only log deprecation messages once.
5
- if (!loggedDeprecations.has(message)) {
6
- loggedDeprecations.add(message)
7
- console.warn(message)
8
- }
9
- }