@kinetis/vector-ui 0.10.2 → 0.10.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/app/components/Vx/Action/Dialog.vue +9 -2
  3. package/app/components/Vx/Inbox.vue +10 -3
  4. package/app/components/Vx/Input/Relation.vue +6 -1
  5. package/app/components/Vx/Input/RichText.vue +1 -1
  6. package/app/components/Vx/Input/Upload.vue +5 -3
  7. package/app/components/Vx/Resource/Form.vue +12 -2
  8. package/app/components/Vx/Resource/Table.vue +3 -2
  9. package/app/components/Vx/Widget/Table.vue +10 -4
  10. package/app/composables/useVectorApi.ts +70 -14
  11. package/app/composables/useVectorAuthStore.ts +32 -7
  12. package/app/composables/useVectorForm.ts +6 -2
  13. package/app/composables/useVectorJobs.ts +6 -3
  14. package/app/composables/useVectorResource.ts +6 -2
  15. package/app/composables/useVectorSchema.ts +9 -1
  16. package/app/i18n/ar/actions.ts +1 -0
  17. package/app/i18n/ar/shell.ts +3 -0
  18. package/app/i18n/de/actions.ts +1 -0
  19. package/app/i18n/de/shell.ts +3 -0
  20. package/app/i18n/en/actions.ts +1 -0
  21. package/app/i18n/en/shell.ts +3 -0
  22. package/app/i18n/es/actions.ts +1 -0
  23. package/app/i18n/es/shell.ts +3 -0
  24. package/app/i18n/fr/actions.ts +1 -0
  25. package/app/i18n/fr/shell.ts +3 -0
  26. package/app/i18n/he/actions.ts +1 -0
  27. package/app/i18n/he/shell.ts +3 -0
  28. package/app/i18n/it/actions.ts +1 -0
  29. package/app/i18n/it/shell.ts +3 -0
  30. package/app/i18n/ja/actions.ts +1 -0
  31. package/app/i18n/ja/shell.ts +3 -0
  32. package/app/i18n/ko/actions.ts +1 -0
  33. package/app/i18n/ko/shell.ts +3 -0
  34. package/app/i18n/nl/actions.ts +1 -0
  35. package/app/i18n/nl/shell.ts +3 -0
  36. package/app/i18n/pl/actions.ts +1 -0
  37. package/app/i18n/pl/shell.ts +3 -0
  38. package/app/i18n/pt/actions.ts +1 -0
  39. package/app/i18n/pt/shell.ts +3 -0
  40. package/app/i18n/pt-BR/actions.ts +1 -0
  41. package/app/i18n/pt-BR/shell.ts +3 -0
  42. package/app/i18n/ru/actions.ts +1 -0
  43. package/app/i18n/ru/shell.ts +3 -0
  44. package/app/i18n/tr/actions.ts +1 -0
  45. package/app/i18n/tr/shell.ts +3 -0
  46. package/app/i18n/uk/actions.ts +1 -0
  47. package/app/i18n/uk/shell.ts +3 -0
  48. package/app/i18n/zh-Hans/actions.ts +1 -0
  49. package/app/i18n/zh-Hans/shell.ts +3 -0
  50. package/app/pages/jobs/index.vue +3 -2
  51. package/app/pages/login.vue +9 -3
  52. package/app/pages/settings.vue +4 -3
  53. package/app/utils/internal/paths.ts +12 -0
  54. package/app/utils/internal/violations.ts +26 -0
  55. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ // Where a server-supplied path may send the browser. Nested under utils/
2
+ // so Nuxt does not auto-import it: it is not part of the layer's public API.
3
+
4
+ /**
5
+ * A path of this admin, and nothing a browser would read as another
6
+ * origin: one leading `/` not followed by `/` or `\` (`//host`, `/\host`),
7
+ * no scheme, and no backslash, whitespace or control character anywhere —
8
+ * a browser strips tab, CR and LF from a URL, so `/\t/host` is `//host`.
9
+ */
10
+ export function isAdminPath(path: string): boolean {
11
+ return /^\/(?![/\\])/.test(path) && !/[\\\s\p{Cc}]/u.test(path)
12
+ }
@@ -0,0 +1,26 @@
1
+ // The entries of the framework's 422 document. Nested under utils/ so
2
+ // Nuxt does not auto-import them: they are not part of the layer's public API.
3
+
4
+ /** One segment of a violation's path: a field or key name, or a list index. */
5
+ export type ViolationSegment = string | number
6
+
7
+ /** One entry of a 422 document's `errors`, as the framework writes it (it adds a `code` and `parameters`). */
8
+ export interface Violation {
9
+ path: ViolationSegment[]
10
+ message: string
11
+ }
12
+
13
+ /** Whether an `errors` entry is a violation: a list of names and indexes for `path`, and a `message`. Anything else is ignored. */
14
+ export function isViolation(entry: unknown): entry is Violation {
15
+ const candidate = entry as { path?: unknown, message?: unknown } | null
16
+
17
+ return typeof candidate === 'object' && candidate !== null
18
+ && typeof candidate.message === 'string'
19
+ && Array.isArray(candidate.path)
20
+ && candidate.path.every(s => typeof s === 'string' || Number.isInteger(s))
21
+ }
22
+
23
+ /** The violations of a 422 document's `errors`, malformed entries left out; none when it is not a list. */
24
+ export function violationsOf(errors: unknown): Violation[] {
25
+ return Array.isArray(errors) ? errors.filter(isViolation) : []
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinetis/vector-ui",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "The Kinetis Vector admin UI, as a Nuxt layer on Vuetify.",
5
5
  "keywords": [
6
6
  "kinetis",