@ditojs/admin 1.19.1 → 1.20.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.
Files changed (45) hide show
  1. package/dist/dito-admin.es.js +3500 -1798
  2. package/dist/dito-admin.umd.js +4 -4
  3. package/dist/style.css +1 -1
  4. package/package.json +8 -5
  5. package/src/DitoAdmin.js +22 -0
  6. package/src/components/DitoAccount.vue +2 -0
  7. package/src/components/DitoContainer.vue +2 -0
  8. package/src/components/DitoDialog.vue +1 -1
  9. package/src/components/DitoErrors.vue +2 -0
  10. package/src/components/DitoHeader.vue +2 -0
  11. package/src/components/DitoLabel.vue +2 -0
  12. package/src/components/DitoMenu.vue +2 -0
  13. package/src/components/DitoPagination.vue +1 -1
  14. package/src/components/DitoPane.vue +2 -0
  15. package/src/components/DitoPanel.vue +2 -0
  16. package/src/components/DitoPanels.vue +2 -0
  17. package/src/components/DitoRoot.vue +1 -1
  18. package/src/components/DitoSchema.vue +3 -1
  19. package/src/components/DitoSchemaInlined.vue +2 -0
  20. package/src/components/DitoScopes.vue +2 -0
  21. package/src/components/DitoTableHead.vue +2 -0
  22. package/src/components/DitoTabs.vue +2 -0
  23. package/src/components/DitoTreeItem.vue +2 -0
  24. package/src/mixins/DomMixin.js +1 -1
  25. package/src/styles/style.sass +1 -1
  26. package/src/types/TypeCheckbox.vue +2 -0
  27. package/src/types/TypeCheckboxes.vue +2 -0
  28. package/src/types/TypeCode.vue +2 -0
  29. package/src/types/TypeColor.vue +3 -1
  30. package/src/types/TypeDate.vue +1 -1
  31. package/src/types/TypeList.vue +2 -0
  32. package/src/types/TypeMarkup.vue +3 -1
  33. package/src/types/TypeMultiselect.vue +1 -1
  34. package/src/types/TypeNumber.vue +1 -1
  35. package/src/types/TypeObject.vue +2 -0
  36. package/src/types/TypeRadio.vue +2 -0
  37. package/src/types/TypeSection.vue +2 -0
  38. package/src/types/TypeSelect.vue +2 -0
  39. package/src/types/TypeSlider.vue +3 -1
  40. package/src/types/TypeSwitch.vue +3 -1
  41. package/src/types/TypeText.vue +1 -1
  42. package/src/types/TypeTextarea.vue +2 -0
  43. package/src/types/TypeTreeList.vue +2 -0
  44. package/src/types/TypeUpload.vue +2 -0
  45. package/src/styles/_vendors.sass +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/admin",
3
- "version": "1.19.1",
3
+ "version": "1.20.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",
@@ -13,7 +13,9 @@
13
13
  "import": "./dist/dito-admin.es.js",
14
14
  "require": "./dist/dito-admin.umd.js"
15
15
  },
16
- "./style.css": "./dist/style.css"
16
+ "./style.css": "./dist/style.css",
17
+ "./src": "./src/index.js",
18
+ "./imports.sass": "./src/styles/_imports.sass"
17
19
  },
18
20
  "files": [
19
21
  "src/",
@@ -37,8 +39,9 @@
37
39
  "not ie_mob > 0"
38
40
  ],
39
41
  "dependencies": {
40
- "@ditojs/ui": "^1.19.1",
41
- "@ditojs/utils": "^1.19.0",
42
+ "@ditojs/build": "^1.20.0",
43
+ "@ditojs/ui": "^1.20.0",
44
+ "@ditojs/utils": "^1.20.0",
42
45
  "codeflask": "^1.4.1",
43
46
  "filesize": "^10.0.5",
44
47
  "filesize-parser": "^1.5.0",
@@ -69,5 +72,5 @@
69
72
  "vite-plugin-vue2": "^2.0.2"
70
73
  },
71
74
  "types": "types",
72
- "gitHead": "a1ea63d36d6a971c3645f7f7245a277607cdbbb9"
75
+ "gitHead": "66013b5bf5ba7c216f950f39f311f56851de2821"
73
76
  }
package/src/DitoAdmin.js CHANGED
@@ -22,6 +22,12 @@ Vue.use(VueRouter)
22
22
  Vue.use(VueModal, { dynamic: true })
23
23
  Vue.use(VueNotifications)
24
24
 
25
+ if (import.meta.hot) {
26
+ // Workaround for a strange Vite hot-reloading bug, see:
27
+ // https://github.com/vitejs/vite/issues/7839#issuecomment-1340109679
28
+ import.meta.hot.on('vite:beforeUpdate', onBeforeViteUpdate)
29
+ }
30
+
25
31
  export default class DitoAdmin {
26
32
  constructor(el, {
27
33
  // `dito` contains the base and api settings passed from `AdminController`
@@ -274,3 +280,19 @@ function formatQuery(query) {
274
280
  )
275
281
  ).toString()
276
282
  }
283
+
284
+ function onBeforeViteUpdate(event) {
285
+ if (event.type === 'update') {
286
+ // Patch `event.updates` to remove the version query parameter from path,
287
+ // so that the update gets picked up.
288
+ // Why the stored `deps` are missing this part of the URL, I cannot say…
289
+ const updates = []
290
+ for (const update of event.updates) {
291
+ updates.push(update, {
292
+ ...update,
293
+ acceptedPath: update.acceptedPath.replace(/\?v=[0-9a-f]+&/, '?')
294
+ })
295
+ }
296
+ event.updates = updates
297
+ }
298
+ }
@@ -17,6 +17,8 @@
17
17
  </template>
18
18
 
19
19
  <style lang="sass">
20
+ @import '../styles/_imports'
21
+
20
22
  .dito-account
21
23
  position: relative
22
24
  .dito-pulldown
@@ -29,6 +29,8 @@
29
29
  </template>
30
30
 
31
31
  <style lang="sass">
32
+ @import '../styles/_imports'
33
+
32
34
  .dito-container
33
35
  // Needed for better vertical alignment:
34
36
  align-self: stretch
@@ -18,7 +18,7 @@
18
18
 
19
19
  <script>
20
20
  import { clone } from '@ditojs/utils'
21
- import { addEvents } from '@ditojs/ui'
21
+ import { addEvents } from '@ditojs/ui/src'
22
22
  import DitoComponent from '../DitoComponent.js'
23
23
  import { getButtonSchemas } from '../utils/schema.js'
24
24
 
@@ -8,6 +8,8 @@
8
8
  </template>
9
9
 
10
10
  <style lang="sass">
11
+ @import '../styles/_imports'
12
+
11
13
  .dito-errors
12
14
  position: absolute
13
15
  z-index: 1
@@ -16,6 +16,8 @@
16
16
  </template>
17
17
 
18
18
  <style lang="sass">
19
+ @import '../styles/_imports'
20
+
19
21
  .dito-header
20
22
  background: $color-black
21
23
  font-size: $menu-font-size
@@ -26,6 +26,8 @@
26
26
  </template>
27
27
 
28
28
  <style lang="sass">
29
+ @import '../styles/_imports'
30
+
29
31
  .dito-label
30
32
  --label-padding: 0
31
33
  // For buttons and chevron to align right:
@@ -11,6 +11,8 @@
11
11
  </template>
12
12
 
13
13
  <style lang="sass">
14
+ @import '../styles/_imports'
15
+
14
16
  .dito-menu
15
17
  flex: initial
16
18
  font-size: $menu-font-size
@@ -7,7 +7,7 @@
7
7
  </template>
8
8
 
9
9
  <script>
10
- import { Pagination } from '@ditojs/ui'
10
+ import { Pagination } from '@ditojs/ui/src'
11
11
  import DitoComponent from '../DitoComponent.js'
12
12
 
13
13
  // @vue/component
@@ -34,6 +34,8 @@
34
34
  </template>
35
35
 
36
36
  <style lang="sass">
37
+ @import '../styles/_imports'
38
+
37
39
  .dito-pane
38
40
  display: flex
39
41
  position: relative
@@ -27,6 +27,8 @@
27
27
  </template>
28
28
 
29
29
  <style lang="sass">
30
+ @import '../styles/_imports'
31
+
30
32
  .dito-panel
31
33
  margin-bottom: $content-padding
32
34
  .dito-panel-title
@@ -17,6 +17,8 @@
17
17
  </template>
18
18
 
19
19
  <style lang="sass">
20
+ @import '../styles/_imports'
21
+
20
22
  .dito-panels
21
23
  max-width: $content-sidebar-width
22
24
  min-width: calc($content-sidebar-width / 2)
@@ -23,7 +23,7 @@
23
23
  </template>
24
24
 
25
25
  <style lang="sass">
26
- @import '../styles/style.sass'
26
+ @import '../styles/style'
27
27
 
28
28
  .dito-root
29
29
  height: 100%
@@ -80,6 +80,8 @@
80
80
  </template>
81
81
 
82
82
  <style lang="sass">
83
+ @import '../styles/_imports'
84
+
83
85
  .dito-schema
84
86
  box-sizing: border-box
85
87
  // To display schema next to panels:
@@ -153,7 +155,7 @@ import {
153
155
  isObject, isArray, isFunction, isRegExp,
154
156
  parseDataPath, normalizeDataPath, labelize
155
157
  } from '@ditojs/utils'
156
- import { TransitionHeight } from '@ditojs/ui'
158
+ import { TransitionHeight } from '@ditojs/ui/src'
157
159
  import DitoComponent from '../DitoComponent.js'
158
160
  import ItemMixin from '../mixins/ItemMixin.js'
159
161
  import { appendDataPath, getParentItem } from '../utils/data.js'
@@ -31,6 +31,8 @@
31
31
  </template>
32
32
 
33
33
  <style lang="sass">
34
+ @import '../styles/_imports'
35
+
34
36
  .dito-schema-inlined
35
37
  > .dito-schema-content
36
38
  padding: 0
@@ -15,6 +15,8 @@
15
15
  </template>
16
16
 
17
17
  <style lang="sass">
18
+ @import '../styles/_imports'
19
+
18
20
  .dito-scopes
19
21
  white-space: nowrap
20
22
  display: flex
@@ -27,6 +27,8 @@
27
27
  </template>
28
28
 
29
29
  <style lang="sass">
30
+ @import '../styles/_imports'
31
+
30
32
  .dito-table-head
31
33
  +user-select(none)
32
34
  tr
@@ -11,6 +11,8 @@
11
11
  </template>
12
12
 
13
13
  <style lang="sass">
14
+ @import '../styles/_imports'
15
+
14
16
  $tab-color-background: $color-lightest
15
17
  $tab-color-inactive: $color-light
16
18
  $tab-color-active: $color-lightest
@@ -86,6 +86,8 @@
86
86
  </template>
87
87
 
88
88
  <style lang="sass">
89
+ @import '../styles/_imports'
90
+
89
91
  .dito-tree-item
90
92
  --chevron-indent: #{$chevron-indent}
91
93
  > .dito-tree-header
@@ -1,5 +1,5 @@
1
1
  import { isObject } from '@ditojs/utils'
2
- import { addEvents } from '@ditojs/ui'
2
+ import { addEvents } from '@ditojs/ui/src'
3
3
 
4
4
  // @vue/component
5
5
  export default {
@@ -1,4 +1,4 @@
1
- @import '_vendors'
1
+ @import '_imports'
2
2
  // No need to import `_imports.sass` again, since it's handled by sass-loader.
3
3
  @import '_base'
4
4
  @import '_button'
@@ -10,6 +10,8 @@
10
10
  </template>
11
11
 
12
12
  <style lang="sass">
13
+ @import '../styles/_imports'
14
+
13
15
  .dito-checkbox
14
16
  @extend %input-borderless
15
17
  </style>
@@ -17,6 +17,8 @@
17
17
  </template>
18
18
 
19
19
  <style lang="sass">
20
+ @import '../styles/_imports'
21
+
20
22
  .dito-checkboxes
21
23
  label
22
24
  @extend %input-borderless
@@ -7,6 +7,8 @@
7
7
  </template>
8
8
 
9
9
  <style lang="sass">
10
+ @import '../styles/_imports'
11
+
10
12
  .dito-code
11
13
  @extend %input
12
14
  position: relative
@@ -35,6 +35,8 @@
35
35
  </template>
36
36
 
37
37
  <style lang="sass">
38
+ @import '../styles/_imports'
39
+
38
40
  $color-swatch-width: $pattern-transparency-size
39
41
  $color-swatch-radius: $border-radius - $border-width
40
42
  .dito-color
@@ -71,7 +73,7 @@
71
73
  import tinycolor from 'tinycolor2'
72
74
  import { Sketch as SketchPicker } from 'vue-color'
73
75
  import TypeComponent from '../TypeComponent.js'
74
- import { Trigger } from '@ditojs/ui'
76
+ import { Trigger } from '@ditojs/ui/src'
75
77
  import { getSchemaAccessor } from '../utils/accessor.js'
76
78
 
77
79
  // @vue/component
@@ -15,7 +15,7 @@
15
15
  <script>
16
16
  import TypeComponent from '../TypeComponent.js'
17
17
  import { getSchemaAccessor } from '../utils/accessor.js'
18
- import { DatePicker, TimePicker, DateTimePicker } from '@ditojs/ui'
18
+ import { DatePicker, TimePicker, DateTimePicker } from '@ditojs/ui/src'
19
19
  import { isDate } from '@ditojs/utils'
20
20
 
21
21
  export default TypeComponent.register([
@@ -147,6 +147,8 @@
147
147
  </template>
148
148
 
149
149
  <style lang="sass">
150
+ @import '../styles/_imports'
151
+
150
152
  .dito-list
151
153
  position: relative
152
154
  .dito-navigation
@@ -27,6 +27,8 @@
27
27
  </template>
28
28
 
29
29
  <style lang="sass">
30
+ @import '../styles/_imports'
31
+
30
32
  .dito-markup
31
33
  @extend %input
32
34
  position: relative
@@ -133,7 +135,7 @@ import {
133
135
  // Tools:
134
136
  History
135
137
  } from 'tiptap-extensions'
136
- import { Icon } from '@ditojs/ui'
138
+ import { Icon } from '@ditojs/ui/src'
137
139
  import {
138
140
  isArray, isObject, underscore, hyphenate, debounce
139
141
  } from '@ditojs/utils'
@@ -39,6 +39,7 @@
39
39
  </template>
40
40
 
41
41
  <style lang="sass">
42
+ @import '../styles/_imports'
42
43
  @import 'vue-multiselect/dist/vue-multiselect.min.css'
43
44
 
44
45
  $spinner-width: $select-arrow-width
@@ -227,7 +228,6 @@ import DitoContext from '../DitoContext.js'
227
228
  import OptionsMixin from '../mixins/OptionsMixin.js'
228
229
  import VueMultiselect from 'vue-multiselect'
229
230
  import { getSchemaAccessor } from '../utils/accessor.js'
230
- import 'vue-multiselect/dist/vue-multiselect.min.css'
231
231
 
232
232
  // @vue/component
233
233
  export default TypeComponent.register('multiselect', {
@@ -24,7 +24,7 @@
24
24
  <script>
25
25
  import TypeComponent from '../TypeComponent.js'
26
26
  import NumberMixin from '../mixins/NumberMixin.js'
27
- import { InputField } from '@ditojs/ui'
27
+ import { InputField } from '@ditojs/ui/src'
28
28
 
29
29
  export default TypeComponent.register([
30
30
  'number', 'integer'
@@ -53,6 +53,8 @@
53
53
  </template>
54
54
 
55
55
  <style lang="sass">
56
+ @import '../styles/_imports'
57
+
56
58
  .dito-object
57
59
  display: flex
58
60
  border: $border-style
@@ -17,6 +17,8 @@
17
17
  </template>
18
18
 
19
19
  <style lang="sass">
20
+ @import '../styles/_imports'
21
+
20
22
  .dito-radio-buttons
21
23
  label
22
24
  @extend %input-borderless
@@ -13,6 +13,8 @@
13
13
  </template>
14
14
 
15
15
  <style lang="sass">
16
+ @import '../styles/_imports'
17
+
16
18
  .dito-section
17
19
  &.dito-section-labelled
18
20
  border: $border-style
@@ -42,6 +42,8 @@
42
42
  </template>
43
43
 
44
44
  <style lang="sass">
45
+ @import '../styles/_imports'
46
+
45
47
  // TODO: Move to dito-ui
46
48
  $select-arrow-right: calc(($select-arrow-width - $select-arrow-size) / 2)
47
49
 
@@ -24,6 +24,8 @@
24
24
  </template>
25
25
 
26
26
  <style lang="sass">
27
+ @import '../styles/_imports'
28
+
27
29
  .dito-slider
28
30
  @extend %input
29
31
  display: flex
@@ -41,7 +43,7 @@
41
43
  import TypeComponent from '../TypeComponent.js'
42
44
  import NumberMixin from '../mixins/NumberMixin.js'
43
45
  import { getSchemaAccessor } from '../utils/accessor.js'
44
- import { InputField } from '@ditojs/ui'
46
+ import { InputField } from '@ditojs/ui/src'
45
47
 
46
48
  // @vue/component
47
49
  export default TypeComponent.register('slider', {
@@ -11,6 +11,8 @@
11
11
  </template>
12
12
 
13
13
  <style lang="sass">
14
+ @import '../styles/_imports'
15
+
14
16
  .dito-switch
15
17
  .dito-switch-label
16
18
  font-size: $font-size-small
@@ -18,7 +20,7 @@
18
20
 
19
21
  <script>
20
22
  import TypeComponent from '../TypeComponent.js'
21
- import { SwitchButton } from '@ditojs/ui'
23
+ import { SwitchButton } from '@ditojs/ui/src'
22
24
 
23
25
  // @vue/component
24
26
  export default TypeComponent.register('switch', {
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script>
13
13
  import TypeComponent from '../TypeComponent.js'
14
- import { InputField } from '@ditojs/ui'
14
+ import { InputField } from '@ditojs/ui/src'
15
15
 
16
16
  const maskedPassword = '****************'
17
17
 
@@ -11,6 +11,8 @@
11
11
  </template>
12
12
 
13
13
  <style lang="sass">
14
+ @import '../styles/_imports'
15
+
14
16
  .dito-textarea
15
17
  display: block
16
18
  resize: none
@@ -21,6 +21,8 @@
21
21
  </template>
22
22
 
23
23
  <style lang="sass">
24
+ @import '../styles/_imports'
25
+
24
26
  .dito-tree-list
25
27
  @extend %field
26
28
  .dito-tree-panel
@@ -86,6 +86,8 @@
86
86
  </template>
87
87
 
88
88
  <style lang="sass">
89
+ @import '../styles/_imports'
90
+
89
91
  .dito-upload
90
92
  .dito-table
91
93
  tr
@@ -1 +0,0 @@
1
- @import '@ditojs/ui/style.css'