@ditojs/admin 2.6.7 → 2.6.9

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.7",
3
+ "version": "2.6.9",
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",
@@ -83,7 +83,7 @@
83
83
  "vite": "^4.3.4"
84
84
  },
85
85
  "types": "types",
86
- "gitHead": "b192b2ffad1ff1c9e2e228a7b4a0ca86c8184028",
86
+ "gitHead": "40ee20c006b240c735252fb8fcebd538ace2f508",
87
87
  "scripts": {
88
88
  "build": "vite build",
89
89
  "watch": "yarn build --mode 'development' --watch",
@@ -84,6 +84,19 @@ export default DitoComponent.component('DitoHeader', {
84
84
  z-index: $header-z-index;
85
85
  @include user-select(none);
86
86
 
87
+ &::after {
88
+ // Cover the gaps between the different headers that might appear due to
89
+ // layout rounding imprecisions.
90
+ content: '';
91
+ top: 0;
92
+ bottom: 0;
93
+ left: calc(100% - 1px);
94
+ width: 2px;
95
+ position: absolute;
96
+ background: inherit;
97
+ z-index: -1;
98
+ }
99
+
87
100
  span {
88
101
  display: inline-block;
89
102
  padding: $header-padding;
@@ -112,12 +125,13 @@ export default DitoComponent.component('DitoHeader', {
112
125
  a {
113
126
  position: relative;
114
127
  display: block;
115
- padding-right: 0.4em;
116
128
 
117
129
  $angle: 33deg;
118
130
 
119
131
  &:hover {
120
- color: #999999;
132
+ span {
133
+ color: $color-light;
134
+ }
121
135
  }
122
136
 
123
137
  &::before,
@@ -125,9 +139,10 @@ export default DitoComponent.component('DitoHeader', {
125
139
  position: absolute;
126
140
  content: '';
127
141
  width: 1px;
128
- height: 1.2em;
129
- right: -1px;
130
- background: $color-dark;
142
+ height: 0.75em;
143
+ right: -0.25em;
144
+ background: $color-white;
145
+ opacity: 0.5;
131
146
  }
132
147
 
133
148
  &::before {
@@ -222,23 +222,31 @@ export default DitoComponent.component('DitoPanel', {
222
222
  border-bottom-right-radius: $border-radius;
223
223
 
224
224
  > .dito-schema-content {
225
- > .dito-pane {
226
- padding: $form-spacing-half $form-spacing;
225
+ .dito-pane {
226
+ margin: -$form-spacing-half;
227
227
 
228
- > .dito-container {
228
+ > .dito-container:not(.dito-container--single) {
229
229
  padding: $form-spacing-half;
230
230
  }
231
231
  }
232
232
 
233
+ > .dito-pane {
234
+ padding: $form-spacing;
235
+
236
+ &.dito-pane--single {
237
+ margin: 0;
238
+ }
239
+ }
240
+
233
241
  .dito-object {
234
- border: 0;
242
+ border: none;
235
243
  padding: 0;
236
244
  }
237
245
 
238
246
  > .dito-buttons {
239
247
  --button-margin: #{$form-spacing};
240
248
 
241
- padding: 0 $form-spacing $form-spacing;
249
+ padding: $form-spacing;
242
250
 
243
251
  .dito-container {
244
252
  padding: 0;
@@ -251,10 +259,6 @@ export default DitoComponent.component('DitoPanel', {
251
259
  font-weight: normal;
252
260
  }
253
261
  }
254
-
255
- .dito-pane {
256
- margin: 0 (-$form-spacing-half);
257
- }
258
262
  }
259
263
  }
260
264
  </style>
@@ -283,25 +283,24 @@ export async function processSchemaComponent(
283
283
  ])
284
284
  }
285
285
 
286
- export async function processView(component, api, schema, name, menuLevel = 0) {
286
+ export async function processView(component, api, schema, name, fullPath = '') {
287
287
  processSchemaDefaults(api, schema)
288
+ processRouteSchema(api, schema, name, fullPath)
288
289
  let children = []
289
290
  if (isView(schema)) {
290
- processRouteSchema(api, schema, name)
291
291
  await processNestedSchemas(api, schema)
292
292
  await processSchemaComponents(api, schema, children)
293
293
  } else if (isMenu(schema)) {
294
- processRouteSchema(api, schema, name)
295
294
  children = await Promise.all(
296
295
  Object.entries(schema.items).map(async ([name, item]) =>
297
- processView(component, api, item, name, menuLevel + 1)
296
+ processView(component, api, item, name, schema.fullPath)
298
297
  )
299
298
  )
300
299
  } else {
301
300
  throw new Error(`Invalid view schema: '${getSchemaIdentifier(schema)}'`)
302
301
  }
303
302
  return {
304
- path: menuLevel === 0 ? `/${schema.path}` : schema.path,
303
+ path: schema.fullPath,
305
304
  children,
306
305
  component,
307
306
  meta: {
@@ -343,10 +342,13 @@ export function processNestedSchemaDefaults(api, schema) {
343
342
  })
344
343
  }
345
344
 
346
- export function processRouteSchema(api, schema, name) {
345
+ export function processRouteSchema(api, schema, name, fullPath = null) {
347
346
  // Used for view and source schemas, see SourceMixin.
348
347
  schema.name ??= name
349
348
  schema.path ??= api.normalizePath(name)
349
+ if (fullPath !== null) {
350
+ schema.fullPath = `${fullPath}/${schema.path}`
351
+ }
350
352
  }
351
353
 
352
354
  export async function processForms(api, schema, level) {
@@ -466,8 +468,8 @@ export function getViewEditPath(schema, id, context) {
466
468
  const view = getViewSchema(schema, context)
467
469
  if (view) {
468
470
  const path = isSingleComponentView(view)
469
- ? `/${view.path}`
470
- : `/${view.path}/${view.path}`
471
+ ? view.fullPath
472
+ : `${view.fullPath}/${view.path}`
471
473
  return `${path}/${id}`
472
474
  }
473
475
  return null