@riducms/admin 0.1.0
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/LICENSE +21 -0
- package/README.md +31 -0
- package/THIRD_PARTY_NOTICES.md +217 -0
- package/package.json +62 -0
- package/src/app/admin-core-view-route.svelte +89 -0
- package/src/app/admin-layout.svelte +457 -0
- package/src/app/admin-navigation-progress.svelte +204 -0
- package/src/app/admin-page-title.svelte +94 -0
- package/src/app/admin-provider-layer.svelte +26 -0
- package/src/app/admin-router-root.svelte +9 -0
- package/src/app/admin-routes.svelte +116 -0
- package/src/app/deferred-redirect.svelte +23 -0
- package/src/app/loading-boundary.svelte +70 -0
- package/src/app/not-found-route.svelte +29 -0
- package/src/app-meta.ts +2 -0
- package/src/app.css +467 -0
- package/src/app.svelte +88 -0
- package/src/assets/ridu-logo-arch.svg +3 -0
- package/src/assets/ridu-word-logo.svg +7 -0
- package/src/components/brand/ridu-logo.svelte +24 -0
- package/src/components/code-block/code-block.svelte +107 -0
- package/src/components/json-tree/json-tree-node.svelte +77 -0
- package/src/components/json-tree/json-viewer.svelte +113 -0
- package/src/components/ui/banner/banner.svelte +41 -0
- package/src/components/ui/banner/index.ts +5 -0
- package/src/components/ui/bulk-action-bar/bulk-action-bar.svelte +50 -0
- package/src/components/ui/bulk-action-bar/index.ts +1 -0
- package/src/components/ui/button/index.ts +8 -0
- package/src/components/ui/calendar/calendar-caption.svelte +72 -0
- package/src/components/ui/calendar/calendar-cell.svelte +20 -0
- package/src/components/ui/calendar/calendar-day.svelte +27 -0
- package/src/components/ui/calendar/calendar-grid-row.svelte +13 -0
- package/src/components/ui/calendar/calendar-grid.svelte +17 -0
- package/src/components/ui/calendar/calendar-head-cell.svelte +20 -0
- package/src/components/ui/calendar/calendar-header.svelte +20 -0
- package/src/components/ui/calendar/calendar-heading.svelte +17 -0
- package/src/components/ui/calendar/calendar-month-select.svelte +45 -0
- package/src/components/ui/calendar/calendar-month.svelte +16 -0
- package/src/components/ui/calendar/calendar-months.svelte +20 -0
- package/src/components/ui/calendar/calendar-nav.svelte +20 -0
- package/src/components/ui/calendar/calendar-next-button.svelte +30 -0
- package/src/components/ui/calendar/calendar-prev-button.svelte +30 -0
- package/src/components/ui/calendar/calendar-year-select.svelte +44 -0
- package/src/components/ui/calendar/calendar.svelte +118 -0
- package/src/components/ui/calendar/index.ts +1 -0
- package/src/components/ui/checkbox/checkbox.svelte +35 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/confirmation-dialog/confirmation-dialog.svelte +37 -0
- package/src/components/ui/confirmation-dialog/index.ts +1 -0
- package/src/components/ui/date-value-control/date-value-calendar.svelte +37 -0
- package/src/components/ui/date-value-control/date-value-control-loader.svelte +36 -0
- package/src/components/ui/date-value-control/date-value-control.svelte +177 -0
- package/src/components/ui/date-value-control/index.ts +3 -0
- package/src/components/ui/dialog/dialog-close.svelte +11 -0
- package/src/components/ui/dialog/dialog-content.svelte +52 -0
- package/src/components/ui/dialog/dialog-description.svelte +20 -0
- package/src/components/ui/dialog/dialog-footer.svelte +20 -0
- package/src/components/ui/dialog/dialog-header.svelte +20 -0
- package/src/components/ui/dialog/dialog-overlay.svelte +20 -0
- package/src/components/ui/dialog/dialog-title.svelte +17 -0
- package/src/components/ui/dialog/dialog-trigger.svelte +11 -0
- package/src/components/ui/dialog/dialog.svelte +7 -0
- package/src/components/ui/dialog/index.ts +8 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-content.svelte +27 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-item.svelte +20 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +16 -0
- package/src/components/ui/dropdown-menu/dropdown-menu.svelte +7 -0
- package/src/components/ui/dropdown-menu/index.ts +5 -0
- package/src/components/ui/empty-state/empty-state.svelte +34 -0
- package/src/components/ui/empty-state/index.ts +1 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/kbd/index.ts +1 -0
- package/src/components/ui/kbd/kbd.svelte +24 -0
- package/src/components/ui/pagination/index.ts +1 -0
- package/src/components/ui/pagination/pagination.svelte +88 -0
- package/src/components/ui/popover/index.ts +3 -0
- package/src/components/ui/popover/popover-content.svelte +29 -0
- package/src/components/ui/popover/popover-trigger.svelte +11 -0
- package/src/components/ui/popover/popover.svelte +7 -0
- package/src/components/ui/radio-group/index.ts +3 -0
- package/src/components/ui/radio-group/radio-card-item.svelte +38 -0
- package/src/components/ui/radio-group/radio-group-item.svelte +17 -0
- package/src/components/ui/radio-group/radio-group.svelte +19 -0
- package/src/components/ui/select/index.ts +4 -0
- package/src/components/ui/select/select-content.svelte +38 -0
- package/src/components/ui/select/select-item.svelte +40 -0
- package/src/components/ui/select/select-scroll-down-button.svelte +23 -0
- package/src/components/ui/select/select-scroll-up-button.svelte +23 -0
- package/src/components/ui/select/select-trigger.svelte +29 -0
- package/src/components/ui/select/select.svelte +11 -0
- package/src/components/ui/sheet/index.ts +6 -0
- package/src/components/ui/sheet/sheet-close.svelte +7 -0
- package/src/components/ui/sheet/sheet-content.svelte +77 -0
- package/src/components/ui/sheet/sheet-description.svelte +17 -0
- package/src/components/ui/sheet/sheet-overlay.svelte +36 -0
- package/src/components/ui/sheet/sheet-title.svelte +17 -0
- package/src/components/ui/sheet/sheet-trigger.svelte +7 -0
- package/src/components/ui/sheet/sheet.svelte +7 -0
- package/src/components/ui/skeleton/index.ts +1 -0
- package/src/components/ui/skeleton/skeleton.svelte +31 -0
- package/src/components/ui/slider/index.ts +3 -0
- package/src/components/ui/slider/slider-content.svelte +59 -0
- package/src/components/ui/slider/slider.svelte +35 -0
- package/src/components/ui/sonner/index.ts +1 -0
- package/src/components/ui/sonner/sonner.svelte +55 -0
- package/src/components/ui/status-indicator/index.ts +5 -0
- package/src/components/ui/status-indicator/status-indicator.svelte +54 -0
- package/src/components/ui/table/index.ts +6 -0
- package/src/components/ui/table/table-body.svelte +20 -0
- package/src/components/ui/table/table-cell.svelte +23 -0
- package/src/components/ui/table/table-head.svelte +23 -0
- package/src/components/ui/table/table-header.svelte +20 -0
- package/src/components/ui/table/table-row.svelte +23 -0
- package/src/components/ui/table/table.svelte +22 -0
- package/src/components/ui/tabs/index.ts +8 -0
- package/src/components/ui/tabs/tabs-content.svelte +17 -0
- package/src/components/ui/tabs/tabs-list.svelte +40 -0
- package/src/components/ui/tabs/tabs-trigger.svelte +23 -0
- package/src/components/ui/tabs/tabs.svelte +19 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/components/ui/tooltip/tooltip-content.svelte +50 -0
- package/src/components/ui/tooltip/tooltip-provider.svelte +7 -0
- package/src/components/ui/tooltip/tooltip-trigger.svelte +7 -0
- package/src/components/ui/tooltip/tooltip.svelte +7 -0
- package/src/core/api/admin-client.ts +45 -0
- package/src/core/forms/field-condition.ts +63 -0
- package/src/core/forms/form-controller.svelte.ts +369 -0
- package/src/core/forms/form-draft-recovery.ts +80 -0
- package/src/core/forms/form-schema.ts +609 -0
- package/src/core/forms/form-validation.ts +750 -0
- package/src/core/i18n/admin-i18n.svelte.ts +364 -0
- package/src/core/i18n/localized-schema.ts +111 -0
- package/src/core/notifications/notification-center.svelte.ts +69 -0
- package/src/core/notifications/validation-toast.svelte +18 -0
- package/src/core/plugins/field-registry.ts +60 -0
- package/src/core/plugins/row-label-registry.ts +62 -0
- package/src/core/preferences/preference-write-queue.ts +107 -0
- package/src/core/routing/admin-paths.ts +137 -0
- package/src/core/runtime/admin-runtime.svelte.ts +625 -0
- package/src/features/auth/account-menu.svelte +159 -0
- package/src/features/auth/account-navigation.svelte +44 -0
- package/src/features/auth/account-route.svelte +395 -0
- package/src/features/auth/account-security-controller.svelte.ts +119 -0
- package/src/features/auth/account-security-route.svelte +460 -0
- package/src/features/auth/auth-brand.svelte +17 -0
- package/src/features/auth/auth-frame.svelte +18 -0
- package/src/features/auth/create-first-user-controller.svelte.ts +220 -0
- package/src/features/auth/create-first-user-route.svelte +174 -0
- package/src/features/auth/forgot-password-route.svelte +78 -0
- package/src/features/auth/login-route.svelte +221 -0
- package/src/features/auth/request-verification-route.svelte +73 -0
- package/src/features/auth/reset-password-route.svelte +107 -0
- package/src/features/auth/verify-email-route.svelte +60 -0
- package/src/features/collections/collection-list-bulk-actions.svelte +143 -0
- package/src/features/collections/collection-list-bulk-editor.svelte +157 -0
- package/src/features/collections/collection-list-controller.svelte.ts +717 -0
- package/src/features/collections/collection-list-filter-popover.svelte +238 -0
- package/src/features/collections/collection-list-preferences-controller.svelte.ts +393 -0
- package/src/features/collections/collection-list-results.svelte +410 -0
- package/src/features/collections/collection-list-route.svelte +951 -0
- package/src/features/collections/collection-list-workspace-toolbar.svelte +409 -0
- package/src/features/collections/collection-table-skeleton.svelte +44 -0
- package/src/features/collections/list-workspace.ts +265 -0
- package/src/features/dashboard/dashboard-route.svelte +141 -0
- package/src/features/development/development-tools.svelte +217 -0
- package/src/features/documents/document-api-view-loader.svelte +31 -0
- package/src/features/documents/document-api-view.svelte +547 -0
- package/src/features/documents/document-controller.svelte.ts +1252 -0
- package/src/features/documents/document-field-partition.ts +18 -0
- package/src/features/documents/document-field-sections.svelte +46 -0
- package/src/features/documents/document-heading.ts +20 -0
- package/src/features/documents/document-route-dirty.ts +43 -0
- package/src/features/documents/document-route-loader.svelte +22 -0
- package/src/features/documents/document-route.svelte +1124 -0
- package/src/features/documents/live-preview-panel.svelte +390 -0
- package/src/features/documents/live-preview.ts +61 -0
- package/src/features/documents/upload-document-preview-loader.svelte +40 -0
- package/src/features/documents/upload-document-preview.svelte +525 -0
- package/src/features/localization/content-locale-switcher.svelte +93 -0
- package/src/features/navigation/admin-breadcrumbs.svelte +124 -0
- package/src/features/navigation/admin-command-menu.svelte +245 -0
- package/src/features/navigation/admin-resource-groups.ts +72 -0
- package/src/features/reference-browser/reference-browser-loader.svelte +15 -0
- package/src/features/reference-browser/reference-browser-workflow.svelte.ts +691 -0
- package/src/features/reference-browser/reference-browser.svelte +844 -0
- package/src/features/uploads/bulk-upload-route.svelte +624 -0
- package/src/features/uploads/bulk-upload.ts +39 -0
- package/src/features/uploads/upload-metadata-fields.svelte +112 -0
- package/src/features/versions/version-diff.ts +72 -0
- package/src/features/versions/version-history-route.svelte +581 -0
- package/src/fields/field-clipboard.ts +132 -0
- package/src/fields/field-layout.svelte +60 -0
- package/src/fields/field-layout.ts +57 -0
- package/src/fields/field-messages.svelte +29 -0
- package/src/fields/field-renderer.svelte +152 -0
- package/src/fields/field-shell.svelte +30 -0
- package/src/fields/field-tab-layout.svelte +99 -0
- package/src/fields/join/join-field.svelte +358 -0
- package/src/fields/localized-field-presentation.ts +17 -0
- package/src/fields/nested/nested-field.svelte +602 -0
- package/src/fields/nested/scoped-field.ts +78 -0
- package/src/fields/nested/sortable-row.svelte +32 -0
- package/src/fields/point/point-field.svelte +52 -0
- package/src/fields/radio/radio-field.svelte +34 -0
- package/src/fields/relationship/relationship-field-controller.svelte.ts +245 -0
- package/src/fields/relationship/relationship-field.svelte +258 -0
- package/src/fields/relationship/relationship-lookup-controller.svelte.ts +129 -0
- package/src/fields/relationship/relationship-query.ts +88 -0
- package/src/fields/relationship/relationship-quick-picker-controller.svelte.ts +198 -0
- package/src/fields/relationship/relationship-quick-picker.svelte +327 -0
- package/src/fields/relationship/relationship-value.ts +47 -0
- package/src/fields/scalar/date-control-value.ts +60 -0
- package/src/fields/scalar/date-value.ts +26 -0
- package/src/fields/scalar/scalar-field.svelte +137 -0
- package/src/fields/select/select-field.svelte +132 -0
- package/src/fields/select/select-value.ts +14 -0
- package/src/fields/text/slug-field.svelte +87 -0
- package/src/fields/text/slug.ts +38 -0
- package/src/fields/text/text-field.svelte +41 -0
- package/src/fields/ui/ui-field.svelte +12 -0
- package/src/fields/virtual/virtual-field.svelte +28 -0
- package/src/index.ts +49 -0
- package/src/main.ts +12 -0
- package/src/vite-env.d.ts +9 -0
package/src/app.css
ADDED
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: dark;
|
|
3
|
+
--radius: 0.25rem;
|
|
4
|
+
--background: oklch(0.145 0 0);
|
|
5
|
+
--background-surface: oklch(0.18 0 0);
|
|
6
|
+
--background-layer: oklch(0.205 0 0);
|
|
7
|
+
--foreground: oklch(0.985 0 0);
|
|
8
|
+
--foreground-muted: oklch(0.708 0 0);
|
|
9
|
+
--foreground-sub: oklch(0.625 0 0);
|
|
10
|
+
--foreground-soft: oklch(0.556 0 0);
|
|
11
|
+
--card: oklch(0.205 0 0);
|
|
12
|
+
--card-foreground: oklch(0.985 0 0);
|
|
13
|
+
--popover: oklch(0.205 0 0);
|
|
14
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
15
|
+
--primary: oklch(0.922 0 0);
|
|
16
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
17
|
+
--secondary: oklch(0.269 0 0);
|
|
18
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
19
|
+
--muted: oklch(0.269 0 0);
|
|
20
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
21
|
+
--accent: oklch(0.269 0 0);
|
|
22
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
23
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
24
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
25
|
+
--destructive-hover: oklch(0.76 0.17 22.216);
|
|
26
|
+
--border: oklch(1 0 0 / 10%);
|
|
27
|
+
--input: oklch(1 0 0 / 15%);
|
|
28
|
+
--ring: oklch(0.708 0 0);
|
|
29
|
+
--control-surface: oklch(0.205 0 0);
|
|
30
|
+
--control-surface-hover: oklch(0.235 0 0);
|
|
31
|
+
--control-surface-disabled: oklch(0.18 0 0);
|
|
32
|
+
--control-border: oklch(1 0 0 / 15%);
|
|
33
|
+
--control-border-hover: oklch(1 0 0 / 24%);
|
|
34
|
+
--control-border-disabled: oklch(1 0 0 / 8%);
|
|
35
|
+
--stroke-soft: oklch(1 0 0 / 8%);
|
|
36
|
+
--brand-primary: oklch(0.922 0 0);
|
|
37
|
+
--brand-primary-foreground: oklch(0.205 0 0);
|
|
38
|
+
--brand-primary-soft: oklch(0.708 0 0);
|
|
39
|
+
--tabs-segment-surface: oklch(0.205 0 0);
|
|
40
|
+
--tabs-segment-active: oklch(0.269 0 0);
|
|
41
|
+
--tabs-segment-text-active: oklch(0.985 0 0);
|
|
42
|
+
--tabs-segment-text-inactive: oklch(0.708 0 0);
|
|
43
|
+
--sidebar: oklch(0.18 0 0);
|
|
44
|
+
--sidebar-foreground: oklch(0.708 0 0);
|
|
45
|
+
--sidebar-primary: oklch(0.922 0 0);
|
|
46
|
+
--sidebar-primary-foreground: oklch(0.205 0 0);
|
|
47
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
48
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
49
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
50
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
51
|
+
--warning: oklch(0.79 0.14 82);
|
|
52
|
+
--success: oklch(0.72 0.14 145);
|
|
53
|
+
--accent-hover: oklch(0.82 0 0);
|
|
54
|
+
--accent-soft: oklch(0.708 0 0);
|
|
55
|
+
--ink-strong: oklch(0.985 0 0);
|
|
56
|
+
--ink-body: oklch(0.922 0 0);
|
|
57
|
+
--ink-secondary: oklch(0.78 0 0);
|
|
58
|
+
--ink-muted: oklch(0.708 0 0);
|
|
59
|
+
--ink-faint: oklch(0.556 0 0);
|
|
60
|
+
--ink-placeholder: oklch(0.625 0 0);
|
|
61
|
+
--ink-label: oklch(0.82 0 0);
|
|
62
|
+
--ink-tag: oklch(0.625 0 0);
|
|
63
|
+
--surface-raised: oklch(0.18 0 0);
|
|
64
|
+
--surface-overlay: oklch(0.205 0 0);
|
|
65
|
+
--toast-surface: var(--background-layer);
|
|
66
|
+
--backdrop: oklch(0 0 0 / 68%);
|
|
67
|
+
--media-overlay: oklch(0 0 0 / 40%);
|
|
68
|
+
--media-foreground: oklch(1 0 0);
|
|
69
|
+
--preview-canvas: oklch(1 0 0);
|
|
70
|
+
--shadow-popover: 0 16px 48px oklch(0 0 0 / 50%);
|
|
71
|
+
--shadow-dialog: 0 24px 80px oklch(0 0 0 / 60%);
|
|
72
|
+
--syntax-property: oklch(0.72 0.1 30);
|
|
73
|
+
--syntax-number: oklch(0.76 0.07 85);
|
|
74
|
+
--syntax-string: oklch(0.76 0.09 135);
|
|
75
|
+
--syntax-operator: oklch(0.75 0.06 220);
|
|
76
|
+
--syntax-keyword: oklch(0.72 0.09 315);
|
|
77
|
+
--syntax-function: oklch(0.72 0.1 235);
|
|
78
|
+
--syntax-variable: oklch(0.72 0.11 70);
|
|
79
|
+
--font-sans: "Geist Variable", "Geist", ui-sans-serif, system-ui, sans-serif;
|
|
80
|
+
--font-serif: var(--font-sans);
|
|
81
|
+
--font-mono: "Spline Sans Mono Variable", "Spline Sans Mono", ui-monospace, monospace;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:root[data-theme="light"] {
|
|
85
|
+
color-scheme: light;
|
|
86
|
+
--background: oklch(1 0 0);
|
|
87
|
+
--background-surface: oklch(0.985 0 0);
|
|
88
|
+
--background-layer: oklch(0.97 0 0);
|
|
89
|
+
--foreground: oklch(0.145 0 0);
|
|
90
|
+
--foreground-muted: oklch(0.556 0 0);
|
|
91
|
+
--foreground-sub: oklch(0.485 0 0);
|
|
92
|
+
--foreground-soft: oklch(0.625 0 0);
|
|
93
|
+
--card: oklch(1 0 0);
|
|
94
|
+
--card-foreground: oklch(0.145 0 0);
|
|
95
|
+
--popover: oklch(1 0 0);
|
|
96
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
97
|
+
--primary: oklch(0.205 0 0);
|
|
98
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
99
|
+
--secondary: oklch(0.97 0 0);
|
|
100
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
101
|
+
--muted: oklch(0.97 0 0);
|
|
102
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
103
|
+
--accent: oklch(0.97 0 0);
|
|
104
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
105
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
106
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
107
|
+
--destructive-hover: oklch(0.52 0.23 27.325);
|
|
108
|
+
--border: oklch(0.922 0 0);
|
|
109
|
+
--input: oklch(0.922 0 0);
|
|
110
|
+
--ring: oklch(0.556 0 0);
|
|
111
|
+
--control-surface: oklch(0.985 0 0);
|
|
112
|
+
--control-surface-hover: oklch(0.97 0 0);
|
|
113
|
+
--control-surface-disabled: oklch(0.97 0 0);
|
|
114
|
+
--control-border: oklch(0.86 0 0);
|
|
115
|
+
--control-border-hover: oklch(0.72 0 0);
|
|
116
|
+
--control-border-disabled: oklch(0.922 0 0);
|
|
117
|
+
--stroke-soft: oklch(0.922 0 0);
|
|
118
|
+
--brand-primary: oklch(0.205 0 0);
|
|
119
|
+
--brand-primary-foreground: oklch(0.985 0 0);
|
|
120
|
+
--brand-primary-soft: oklch(0.556 0 0);
|
|
121
|
+
--tabs-segment-surface: oklch(0.97 0 0);
|
|
122
|
+
--tabs-segment-active: oklch(0.922 0 0);
|
|
123
|
+
--tabs-segment-text-active: oklch(0.145 0 0);
|
|
124
|
+
--tabs-segment-text-inactive: oklch(0.556 0 0);
|
|
125
|
+
--sidebar: oklch(0.985 0 0);
|
|
126
|
+
--sidebar-foreground: oklch(0.556 0 0);
|
|
127
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
128
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
129
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
130
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
131
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
132
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
133
|
+
--warning: oklch(0.58 0.14 78);
|
|
134
|
+
--success: oklch(0.52 0.14 145);
|
|
135
|
+
--accent-hover: oklch(0.269 0 0);
|
|
136
|
+
--accent-soft: oklch(0.556 0 0);
|
|
137
|
+
--ink-strong: oklch(0.145 0 0);
|
|
138
|
+
--ink-body: oklch(0.205 0 0);
|
|
139
|
+
--ink-secondary: oklch(0.371 0 0);
|
|
140
|
+
--ink-muted: oklch(0.556 0 0);
|
|
141
|
+
--ink-faint: oklch(0.625 0 0);
|
|
142
|
+
--ink-placeholder: oklch(0.556 0 0);
|
|
143
|
+
--ink-label: oklch(0.371 0 0);
|
|
144
|
+
--ink-tag: oklch(0.556 0 0);
|
|
145
|
+
--surface-raised: oklch(0.985 0 0);
|
|
146
|
+
--surface-overlay: oklch(1 0 0);
|
|
147
|
+
--toast-surface: var(--background-layer);
|
|
148
|
+
--backdrop: oklch(0 0 0 / 46%);
|
|
149
|
+
--media-overlay: oklch(0 0 0 / 40%);
|
|
150
|
+
--media-foreground: oklch(1 0 0);
|
|
151
|
+
--preview-canvas: oklch(1 0 0);
|
|
152
|
+
--shadow-popover: 0 16px 48px oklch(0 0 0 / 18%);
|
|
153
|
+
--shadow-dialog: 0 24px 80px oklch(0 0 0 / 24%);
|
|
154
|
+
--syntax-property: oklch(0.5 0.13 30);
|
|
155
|
+
--syntax-number: oklch(0.5 0.1 80);
|
|
156
|
+
--syntax-string: oklch(0.5 0.12 140);
|
|
157
|
+
--syntax-operator: oklch(0.5 0.09 220);
|
|
158
|
+
--syntax-keyword: oklch(0.5 0.12 315);
|
|
159
|
+
--syntax-function: oklch(0.5 0.13 235);
|
|
160
|
+
--syntax-variable: oklch(0.52 0.14 70);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
* {
|
|
164
|
+
--at-apply: border-border;
|
|
165
|
+
box-sizing: border-box;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
html {
|
|
169
|
+
font-family: var(--font-sans);
|
|
170
|
+
font-synthesis: none;
|
|
171
|
+
text-rendering: optimizeLegibility;
|
|
172
|
+
scroll-behavior: smooth;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
body {
|
|
176
|
+
margin: 0;
|
|
177
|
+
min-width: 20rem;
|
|
178
|
+
background: var(--background);
|
|
179
|
+
color: var(--foreground);
|
|
180
|
+
font-size: 0.90625rem;
|
|
181
|
+
line-height: 1.5;
|
|
182
|
+
-webkit-font-smoothing: antialiased;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
button,
|
|
186
|
+
input,
|
|
187
|
+
select,
|
|
188
|
+
textarea {
|
|
189
|
+
font: inherit;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
button,
|
|
193
|
+
a,
|
|
194
|
+
input,
|
|
195
|
+
select,
|
|
196
|
+
textarea {
|
|
197
|
+
-webkit-tap-highlight-color: transparent;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
a {
|
|
201
|
+
color: inherit;
|
|
202
|
+
text-decoration: none;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
::selection {
|
|
206
|
+
background: color-mix(in oklab, var(--foreground) 18%, transparent);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
::placeholder {
|
|
210
|
+
color: var(--ink-placeholder);
|
|
211
|
+
opacity: 1;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
::-webkit-scrollbar {
|
|
215
|
+
width: 10px;
|
|
216
|
+
height: 12px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
::-webkit-scrollbar-thumb {
|
|
220
|
+
border: 3px solid var(--background);
|
|
221
|
+
border-radius: 5px;
|
|
222
|
+
background: color-mix(in oklab, var(--foreground) 12%, transparent);
|
|
223
|
+
background-clip: padding-box;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
::-webkit-scrollbar-track {
|
|
227
|
+
background: transparent;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
:focus-visible {
|
|
231
|
+
outline: 2px solid color-mix(in oklab, var(--ring) 72%, transparent);
|
|
232
|
+
outline-offset: 2px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
[data-slot="input"]:focus-visible,
|
|
236
|
+
[data-slot="textarea"]:focus-visible,
|
|
237
|
+
[data-slot="command-input"]:focus-visible,
|
|
238
|
+
select:focus-visible {
|
|
239
|
+
border-color: color-mix(in oklab, var(--ring) 78%, transparent);
|
|
240
|
+
box-shadow: none;
|
|
241
|
+
outline: none;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.font-serif {
|
|
245
|
+
font-family: var(--font-serif);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.font-mono {
|
|
249
|
+
font-family: var(--font-mono);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ridu-popover-enter[data-state="open"],
|
|
253
|
+
.ridu-popover-enter:not([data-state]) {
|
|
254
|
+
animation: ridu-pop-in 0.16s ease both;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.ridu-dialog-enter[data-state="open"] {
|
|
258
|
+
animation: ridu-dialog-in 0.16s ease both;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.ridu-dialog-enter.ridu-command-dialog[data-state="open"] {
|
|
262
|
+
animation-name: ridu-command-dialog-in;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.ridu-surface-grid {
|
|
266
|
+
background-image:
|
|
267
|
+
linear-gradient(color-mix(in oklab, var(--foreground) 2%, transparent) 1px, transparent 1px),
|
|
268
|
+
linear-gradient(
|
|
269
|
+
90deg,
|
|
270
|
+
color-mix(in oklab, var(--foreground) 2%, transparent) 1px,
|
|
271
|
+
transparent 1px
|
|
272
|
+
);
|
|
273
|
+
background-size: 32px 32px;
|
|
274
|
+
background-position: -1px -1px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.ridu-field-label {
|
|
278
|
+
color: var(--ink-label);
|
|
279
|
+
font-size: 0.8125rem;
|
|
280
|
+
font-weight: 550;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.ridu-field-required {
|
|
284
|
+
margin-inline-start: 0.2rem;
|
|
285
|
+
color: var(--destructive);
|
|
286
|
+
font-weight: 650;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.ridu-field-status {
|
|
290
|
+
border: 1px solid var(--border);
|
|
291
|
+
border-radius: 999px;
|
|
292
|
+
padding: 0.08rem 0.42rem;
|
|
293
|
+
font-family: var(--font-mono);
|
|
294
|
+
font-size: 0.625rem;
|
|
295
|
+
font-weight: 400;
|
|
296
|
+
color: var(--ink-muted);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.ridu-field-help {
|
|
300
|
+
color: var(--ink-muted);
|
|
301
|
+
font-size: 0.8125rem;
|
|
302
|
+
line-height: 1.5;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.ridu-field-error {
|
|
306
|
+
color: var(--destructive);
|
|
307
|
+
font-size: 0.8125rem;
|
|
308
|
+
line-height: 1.5;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/*
|
|
312
|
+
* Tone lives in the text and the wash, matching `banner`: no rails, chips, or icons.
|
|
313
|
+
* `--normal-*` are sonner's own theming variables; its dark-theme rules paint the
|
|
314
|
+
* close button from them at a specificity we cannot outrank, so we set them here
|
|
315
|
+
* per tone rather than fighting the selector.
|
|
316
|
+
*/
|
|
317
|
+
.ridu-toast {
|
|
318
|
+
--toast-title: var(--foreground);
|
|
319
|
+
--toast-body: var(--foreground-muted);
|
|
320
|
+
--toast-wash: var(--toast-surface);
|
|
321
|
+
--toast-edge: var(--border);
|
|
322
|
+
/*
|
|
323
|
+
* Sonner's dark theme paints the close button from these; keep them tone-neutral
|
|
324
|
+
* so the chip reads as a consistent dismiss affordance, not a decorative extension
|
|
325
|
+
* of the tinted wash. Inverted fill gives it its own identity on any tone.
|
|
326
|
+
*/
|
|
327
|
+
--normal-bg: var(--foreground);
|
|
328
|
+
--normal-bg-hover: var(--ink-strong);
|
|
329
|
+
--normal-border: transparent;
|
|
330
|
+
--normal-border-hover: transparent;
|
|
331
|
+
--normal-text: var(--background);
|
|
332
|
+
position: relative;
|
|
333
|
+
border: 1px solid var(--toast-edge);
|
|
334
|
+
background: var(--toast-wash);
|
|
335
|
+
color: var(--toast-body);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/* Only the loading spinner keeps an icon; tone is carried by text and wash. */
|
|
339
|
+
[data-sonner-toaster] .ridu-toast[data-sonner-toast]:not([data-type="loading"]) [data-icon] {
|
|
340
|
+
display: none;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
[data-sonner-toaster] .ridu-toast[data-sonner-toast] [data-title] {
|
|
344
|
+
color: var(--toast-title);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
[data-sonner-toaster] .ridu-toast[data-sonner-toast] [data-description] {
|
|
348
|
+
color: var(--toast-body);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/*
|
|
352
|
+
* The toaster mirrors with interface direction, so the dismiss control uses
|
|
353
|
+
* the matching logical corner. Colors come from the `--normal-*` variables
|
|
354
|
+
* above; only geometry is set here, since sonner skips its own geometry rules
|
|
355
|
+
* while `unstyled`.
|
|
356
|
+
*/
|
|
357
|
+
[data-sonner-toaster] .ridu-toast[data-sonner-toast] [data-close-button] {
|
|
358
|
+
position: absolute;
|
|
359
|
+
top: -0.4375rem;
|
|
360
|
+
inset-inline-start: -0.4375rem;
|
|
361
|
+
display: grid;
|
|
362
|
+
place-items: center;
|
|
363
|
+
width: 1.375rem;
|
|
364
|
+
height: 1.375rem;
|
|
365
|
+
padding: 0;
|
|
366
|
+
border-width: 1px;
|
|
367
|
+
border-style: solid;
|
|
368
|
+
border-radius: 999px;
|
|
369
|
+
cursor: pointer;
|
|
370
|
+
transition:
|
|
371
|
+
background-color 0.12s ease,
|
|
372
|
+
border-color 0.12s ease;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/* In a collapsed stack only the front toast is actionable, so only it shows one. */
|
|
376
|
+
[data-sonner-toaster]
|
|
377
|
+
.ridu-toast[data-sonner-toast][data-front="false"]:not([data-expanded="true"])
|
|
378
|
+
[data-close-button] {
|
|
379
|
+
display: none;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.ridu-toast[data-type="success"] {
|
|
383
|
+
--toast-title: color-mix(in oklab, var(--success) 58%, var(--foreground));
|
|
384
|
+
--toast-body: color-mix(in oklab, var(--success) 34%, var(--foreground-muted));
|
|
385
|
+
--toast-edge: color-mix(in oklab, var(--success) 26%, transparent);
|
|
386
|
+
--toast-wash: color-mix(in oklab, var(--success) 8%, var(--toast-surface));
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.ridu-toast[data-type="warning"] {
|
|
390
|
+
--toast-title: color-mix(in oklab, var(--warning) 58%, var(--foreground));
|
|
391
|
+
--toast-body: color-mix(in oklab, var(--warning) 34%, var(--foreground-muted));
|
|
392
|
+
--toast-edge: color-mix(in oklab, var(--warning) 26%, transparent);
|
|
393
|
+
--toast-wash: color-mix(in oklab, var(--warning) 9%, var(--toast-surface));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.ridu-toast[data-type="info"] {
|
|
397
|
+
--toast-edge: color-mix(in oklab, var(--ink-secondary) 16%, transparent);
|
|
398
|
+
--toast-wash: color-mix(in oklab, var(--ink-secondary) 4%, var(--toast-surface));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.ridu-toast[data-type="error"] {
|
|
402
|
+
--toast-title: color-mix(in oklab, var(--destructive) 62%, var(--foreground));
|
|
403
|
+
--toast-body: color-mix(in oklab, var(--destructive) 38%, var(--foreground-muted));
|
|
404
|
+
--toast-edge: color-mix(in oklab, var(--destructive) 30%, transparent);
|
|
405
|
+
--toast-wash: color-mix(in oklab, var(--destructive) 9%, var(--toast-surface));
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
@keyframes ridu-fade-up {
|
|
409
|
+
from {
|
|
410
|
+
opacity: 0;
|
|
411
|
+
transform: translateY(7px);
|
|
412
|
+
}
|
|
413
|
+
to {
|
|
414
|
+
opacity: 1;
|
|
415
|
+
transform: none;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
@keyframes ridu-pop-in {
|
|
420
|
+
from {
|
|
421
|
+
opacity: 0;
|
|
422
|
+
scale: 0.985;
|
|
423
|
+
translate: 0 -6px;
|
|
424
|
+
}
|
|
425
|
+
to {
|
|
426
|
+
opacity: 1;
|
|
427
|
+
scale: 1;
|
|
428
|
+
translate: 0 0;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
@keyframes ridu-dialog-in {
|
|
433
|
+
from {
|
|
434
|
+
opacity: 0;
|
|
435
|
+
scale: 0.985;
|
|
436
|
+
}
|
|
437
|
+
to {
|
|
438
|
+
opacity: 1;
|
|
439
|
+
scale: 1;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
@keyframes ridu-command-dialog-in {
|
|
444
|
+
from {
|
|
445
|
+
opacity: 0;
|
|
446
|
+
scale: 0.985;
|
|
447
|
+
}
|
|
448
|
+
to {
|
|
449
|
+
opacity: 1;
|
|
450
|
+
scale: 1;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
@media (prefers-reduced-motion: reduce) {
|
|
455
|
+
html {
|
|
456
|
+
scroll-behavior: auto;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
*,
|
|
460
|
+
*::before,
|
|
461
|
+
*::after {
|
|
462
|
+
animation-duration: 0.01ms !important;
|
|
463
|
+
animation-iteration-count: 1 !important;
|
|
464
|
+
transition-duration: 0.01ms !important;
|
|
465
|
+
scroll-behavior: auto !important;
|
|
466
|
+
}
|
|
467
|
+
}
|
package/src/app.svelte
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createBrowserRouter, RouterProvider } from "@hvniel/svelte-router";
|
|
3
|
+
import { setAdminI18n, type AdminPlugin, type FieldPlugin } from "@riducms/plugin";
|
|
4
|
+
import type { TranslationLanguage } from "@riducms/translations";
|
|
5
|
+
import { TooltipProvider } from "@riducms/ui";
|
|
6
|
+
import { untrack } from "svelte";
|
|
7
|
+
|
|
8
|
+
import AdminRouterRoot from "@admin/app/admin-router-root.svelte";
|
|
9
|
+
import AdminProviderLayer from "@admin/app/admin-provider-layer.svelte";
|
|
10
|
+
import LoadingBoundary from "@admin/app/loading-boundary.svelte";
|
|
11
|
+
import { Toaster } from "@admin/components/ui/sonner";
|
|
12
|
+
import {
|
|
13
|
+
NotificationCenter,
|
|
14
|
+
setNotificationCenter,
|
|
15
|
+
} from "@admin/core/notifications/notification-center.svelte";
|
|
16
|
+
import { AdminRuntime, setAdminRuntime } from "@admin/core/runtime/admin-runtime.svelte";
|
|
17
|
+
import type { AdminClient } from "@admin/core/api/admin-client";
|
|
18
|
+
import DevelopmentTools from "@admin/features/development/development-tools.svelte";
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
clientFactory: () => AdminClient;
|
|
22
|
+
adminBasePath?: string;
|
|
23
|
+
plugins?: readonly AdminPlugin[];
|
|
24
|
+
fieldPlugins?: readonly FieldPlugin[];
|
|
25
|
+
languages?: readonly TranslationLanguage[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let {
|
|
29
|
+
clientFactory,
|
|
30
|
+
adminBasePath = "/admin",
|
|
31
|
+
plugins = [],
|
|
32
|
+
fieldPlugins = [],
|
|
33
|
+
languages,
|
|
34
|
+
}: Props = $props();
|
|
35
|
+
// The runtime owns the client and plugin registry selected when this admin instance is mounted.
|
|
36
|
+
// svelte-ignore state_referenced_locally
|
|
37
|
+
const runtime = setAdminRuntime(
|
|
38
|
+
new AdminRuntime(clientFactory(), plugins, fieldPlugins, languages)
|
|
39
|
+
);
|
|
40
|
+
setAdminI18n(runtime.i18n);
|
|
41
|
+
const notifications = setNotificationCenter(new NotificationCenter());
|
|
42
|
+
const development = import.meta.hot !== undefined;
|
|
43
|
+
const notificationPosition = $derived(
|
|
44
|
+
development ? (runtime.i18n.direction === "rtl" ? "top-left" : "top-right") : undefined
|
|
45
|
+
);
|
|
46
|
+
let schemaRefreshQueued = $state(false);
|
|
47
|
+
// The router owns the base path selected when this admin instance is mounted.
|
|
48
|
+
// svelte-ignore state_referenced_locally
|
|
49
|
+
const router = createBrowserRouter([{ path: "*", Component: AdminRouterRoot }], {
|
|
50
|
+
basename: adminBasePath,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
$effect(() => {
|
|
54
|
+
const hot = import.meta.hot;
|
|
55
|
+
if (hot === undefined) return;
|
|
56
|
+
const queueSchemaRefresh = () => {
|
|
57
|
+
schemaRefreshQueued = true;
|
|
58
|
+
};
|
|
59
|
+
hot.on("ridu:schema-update", queueSchemaRefresh);
|
|
60
|
+
return () => hot.off("ridu:schema-update", queueSchemaRefresh);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
$effect(() => {
|
|
64
|
+
void runtime.bootstrap();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
$effect(() => {
|
|
68
|
+
if (!schemaRefreshQueued || runtime.loading || runtime.refreshingManifest) return;
|
|
69
|
+
const bootstrap = runtime.error !== undefined || runtime.manifest === undefined;
|
|
70
|
+
schemaRefreshQueued = false;
|
|
71
|
+
untrack(() => {
|
|
72
|
+
void (bootstrap ? runtime.bootstrap() : runtime.refreshManifest());
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
$effect(() => () => notifications.destroy());
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<TooltipProvider delayDuration={350}>
|
|
80
|
+
<AdminProviderLayer providers={runtime.providers} i18n={runtime.i18n}>
|
|
81
|
+
<LoadingBoundary>
|
|
82
|
+
<RouterProvider {router} />
|
|
83
|
+
</LoadingBoundary>
|
|
84
|
+
</AdminProviderLayer>
|
|
85
|
+
|
|
86
|
+
{#if development && !runtime.loading && runtime.error === undefined}<DevelopmentTools />{/if}
|
|
87
|
+
<Toaster theme={runtime.resolvedTheme} position={notificationPosition} />
|
|
88
|
+
</TooltipProvider>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="82" height="70" viewBox="0 0 82 70" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M81.3232 70H0V64.8525H81.3232V70ZM77.2061 60.7354H4.11719V55.5879H77.2061V60.7354ZM40.6621 0C57.7177 0.000248423 71.5439 13.8271 71.5439 30.8828V51.4707H66.3965V30.8828C66.3965 16.6698 54.8751 5.14771 40.6621 5.14746C26.449 5.14752 14.9268 16.6696 14.9268 30.8828V51.4707H9.7793V30.8828C9.7793 13.827 23.6063 6.18546e-05 40.6621 0ZM40.6611 10.2939C52.0315 10.2939 61.2497 19.5115 61.25 30.8818V51.4707H56.1025V30.8818C56.1022 22.3542 49.1889 15.4414 40.6611 15.4414C32.1337 15.4417 25.221 22.3544 25.2207 30.8818V51.4707H20.0732V30.8818C20.0735 19.5117 29.291 10.2943 40.6611 10.2939Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg width="241" height="70" viewBox="0 0 241 70" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M81.3232 70H0V64.8525H81.3232V70ZM77.2061 60.7354H4.11719V55.5879H77.2061V60.7354ZM40.6621 0C57.7177 0.000248423 71.5439 13.8271 71.5439 30.8828V51.4707H66.3965V30.8828C66.3965 16.6698 54.8751 5.14771 40.6621 5.14746C26.449 5.14752 14.9268 16.6696 14.9268 30.8828V51.4707H9.7793V30.8828C9.7793 13.827 23.6063 6.18546e-05 40.6621 0ZM40.6611 10.2939C52.0315 10.2939 61.2497 19.5115 61.25 30.8818V51.4707H56.1025V30.8818C56.1022 22.3542 49.1889 15.4414 40.6611 15.4414C32.1337 15.4417 25.221 22.3544 25.2207 30.8818V51.4707H20.0732V30.8818C20.0735 19.5117 29.291 10.2943 40.6611 10.2939Z" fill="white"/>
|
|
3
|
+
<path d="M121.099 12.9624C126.245 12.9625 130.36 14.3761 133.417 17.228C136.526 20.0825 138.073 23.9291 138.073 28.7378C138.073 31.9674 137.443 34.5707 136.157 36.5249L136.156 36.5239C134.935 38.4558 133.381 39.9364 131.492 40.9575L131.487 40.9595C129.734 41.8596 127.979 42.5355 126.222 42.9917L139.083 62.7261L139.335 63.1128H132.061L131.986 62.9956L120.06 44.062H103.198V63.1128H97.0732V12.9624H121.099ZM103.198 38.2378H120.123C121.897 38.2378 123.699 37.966 125.527 37.4224C127.334 36.8852 128.843 35.9351 130.062 34.5708H130.062C131.31 33.1794 131.948 31.2455 131.948 28.7378C131.948 25.6515 130.898 23.2507 128.812 21.5044L128.811 21.5015C126.716 19.6996 123.929 18.7876 120.423 18.7876H103.198V38.2378Z" fill="white" stroke="white" stroke-width="0.5"/>
|
|
4
|
+
<path d="M151.498 24.3628V63.1128H145.748V24.3628H151.498ZM148.623 9.9624C149.735 9.9624 150.673 10.361 151.419 11.1548L151.565 11.2974C152.27 12.0217 152.623 12.9149 152.623 13.9624C152.623 15.0304 152.22 15.9648 151.43 16.7573L151.431 16.7583C150.682 17.5601 149.741 17.9624 148.623 17.9624C147.553 17.9624 146.615 17.5579 145.822 16.7642C145.028 15.9704 144.623 15.033 144.623 13.9624C144.623 12.8451 145.026 11.9033 145.827 11.1548C146.62 10.3649 147.555 9.9624 148.623 9.9624Z" fill="white" stroke="white" stroke-width="0.5"/>
|
|
5
|
+
<path d="M198.399 6.88745V42.8376C198.399 47.122 197.516 50.7927 195.74 53.8386C193.967 56.8769 191.583 59.1839 188.59 60.7566L188.591 60.7576C185.652 62.3285 182.386 63.1121 178.798 63.1121C176.119 63.112 173.565 62.6576 171.136 61.7468L171.129 61.7439C168.75 60.7819 166.648 59.414 164.824 57.6414L164.822 57.6394C163.046 55.8634 161.652 53.7091 160.641 51.1804V51.1785C159.628 48.595 159.123 45.6886 159.123 42.4626C159.123 38.3279 159.98 34.7816 161.707 31.8357C163.428 28.8504 165.709 26.5436 168.549 24.9207L168.551 24.9197C171.44 23.2975 174.633 22.4871 178.123 22.4871C180.254 22.4871 182.285 22.8678 184.215 23.6296C186.142 24.3905 187.868 25.4567 189.391 26.8269H189.39C190.731 27.9896 191.818 29.3111 192.649 30.7917V6.88745H198.399ZM178.723 27.5623C176.267 27.5623 173.986 28.1764 171.874 29.4041L171.873 29.4031C169.816 30.6282 168.148 32.3945 166.867 34.7087L166.865 34.7107C165.591 36.9665 164.948 39.6474 164.948 42.7625C164.948 45.979 165.592 48.7358 166.867 51.0417H166.866C168.145 53.3038 169.839 55.0444 171.947 56.2703C174.109 57.4489 176.417 58.0378 178.873 58.0378C181.331 58.0378 183.589 57.4479 185.65 56.2703L185.652 56.2693C187.758 55.0938 189.425 53.3791 190.654 51.1179L190.656 51.114C191.93 48.8599 192.573 46.1049 192.573 42.8376C192.573 39.5702 191.93 36.8145 190.656 34.5603C189.376 32.2973 187.683 30.582 185.576 29.406L185.571 29.4021C183.511 28.1761 181.23 27.5623 178.723 27.5623Z" fill="white" stroke="white" stroke-width="0.5"/>
|
|
6
|
+
<path d="M210.648 23.3875V45.6873C210.648 48.2985 211.214 50.5255 212.335 52.3787L212.559 52.7234C213.701 54.4207 215.121 55.7252 216.817 56.6423H216.816C218.629 57.5726 220.564 58.0378 222.623 58.0378C224.732 58.0378 226.692 57.5469 228.505 56.5671L228.507 56.5662C230.366 55.5876 231.858 54.1943 232.984 52.3826C234.106 50.5286 234.674 48.3004 234.674 45.6873V23.3875H240.424V45.9128C240.424 49.4012 239.64 52.4479 238.062 55.0427C236.489 57.6314 234.355 59.6374 231.665 61.0583L231.662 61.0603C228.973 62.4301 225.958 63.1121 222.623 63.1121C219.387 63.112 216.423 62.4294 213.735 61.0603L213.731 61.0583C211.042 59.6378 208.885 57.6325 207.262 55.0457L207.26 55.0427C205.682 52.4479 204.898 49.4012 204.898 45.9128V23.3875H210.648Z" fill="white" stroke="white" stroke-width="0.5"/>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import archLogo from "@admin/assets/ridu-logo-arch.svg";
|
|
3
|
+
import wordLogo from "@admin/assets/ridu-word-logo.svg";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
variant = "word",
|
|
7
|
+
class: className,
|
|
8
|
+
}: {
|
|
9
|
+
variant?: "arch" | "word";
|
|
10
|
+
class?: string;
|
|
11
|
+
} = $props();
|
|
12
|
+
|
|
13
|
+
const source = $derived(variant === "arch" ? archLogo : wordLogo);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<span
|
|
17
|
+
class={[
|
|
18
|
+
"inline-block shrink-0 bg-current [mask:var(--ridu-logo)_center/contain_no-repeat] [-webkit-mask:var(--ridu-logo)_center/contain_no-repeat]",
|
|
19
|
+
variant === "arch" ? "aspect-[82/70]" : "aspect-[234/70]",
|
|
20
|
+
className,
|
|
21
|
+
]}
|
|
22
|
+
style={`--ridu-logo: url("${source}")`}
|
|
23
|
+
aria-hidden="true"
|
|
24
|
+
></span>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Prism from "prismjs";
|
|
3
|
+
import "prismjs/components/prism-bash";
|
|
4
|
+
import "prismjs/components/prism-javascript";
|
|
5
|
+
import "prismjs/components/prism-json";
|
|
6
|
+
import { getAdminI18n } from "@riducms/plugin";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
value,
|
|
10
|
+
language = "javascript",
|
|
11
|
+
class: className = "",
|
|
12
|
+
}: {
|
|
13
|
+
value: string;
|
|
14
|
+
language?: "javascript" | "bash" | "json";
|
|
15
|
+
class?: string;
|
|
16
|
+
} = $props();
|
|
17
|
+
const i18n = getAdminI18n();
|
|
18
|
+
|
|
19
|
+
const normalized = $derived(normalize(value));
|
|
20
|
+
const highlighted = $derived(
|
|
21
|
+
Prism.highlight(normalized, Prism.languages[language] ?? Prism.languages.javascript, language)
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
function normalize(source: string) {
|
|
25
|
+
const lines = source.replaceAll("\t", " ").split("\n");
|
|
26
|
+
while (lines[0]?.trim() === "") lines.shift();
|
|
27
|
+
while (lines.at(-1)?.trim() === "") lines.pop();
|
|
28
|
+
const indentation = lines
|
|
29
|
+
.filter((line) => line.trim() !== "")
|
|
30
|
+
.map((line) => line.match(/^\s*/)?.[0].length ?? 0);
|
|
31
|
+
const minimum = indentation.length === 0 ? 0 : Math.min(...indentation);
|
|
32
|
+
return lines.map((line) => line.slice(minimum)).join("\n");
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<!-- Keyboard focus lets users scroll long examples without a pointer. -->
|
|
37
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
38
|
+
<pre
|
|
39
|
+
class={[
|
|
40
|
+
"overflow-x-auto bg-background p-4 font-mono text-[11.5px] leading-6 text-foreground-muted selection:bg-primary/25",
|
|
41
|
+
className,
|
|
42
|
+
]}
|
|
43
|
+
tabindex="0"
|
|
44
|
+
role="region"
|
|
45
|
+
aria-label={i18n.t("general:codeExample")}><code
|
|
46
|
+
class={`language-${language}`}>{@html highlighted}</code></pre>
|
|
47
|
+
|
|
48
|
+
<style>
|
|
49
|
+
:global(.token.comment),
|
|
50
|
+
:global(.token.prolog),
|
|
51
|
+
:global(.token.doctype),
|
|
52
|
+
:global(.token.cdata) {
|
|
53
|
+
color: color-mix(in srgb, var(--foreground) 42%, transparent);
|
|
54
|
+
font-style: italic;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:global(.token.punctuation) {
|
|
58
|
+
color: color-mix(in srgb, var(--foreground) 62%, transparent);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:global(.token.property),
|
|
62
|
+
:global(.token.tag),
|
|
63
|
+
:global(.token.constant),
|
|
64
|
+
:global(.token.symbol),
|
|
65
|
+
:global(.token.deleted) {
|
|
66
|
+
color: var(--syntax-property);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:global(.token.boolean),
|
|
70
|
+
:global(.token.number) {
|
|
71
|
+
color: var(--syntax-number);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:global(.token.selector),
|
|
75
|
+
:global(.token.attr-name),
|
|
76
|
+
:global(.token.string),
|
|
77
|
+
:global(.token.char),
|
|
78
|
+
:global(.token.builtin),
|
|
79
|
+
:global(.token.inserted) {
|
|
80
|
+
color: var(--syntax-string);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:global(.token.operator),
|
|
84
|
+
:global(.token.entity),
|
|
85
|
+
:global(.token.url),
|
|
86
|
+
:global(.language-css .token.string),
|
|
87
|
+
:global(.style .token.string) {
|
|
88
|
+
color: var(--syntax-operator);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:global(.token.atrule),
|
|
92
|
+
:global(.token.attr-value),
|
|
93
|
+
:global(.token.keyword) {
|
|
94
|
+
color: var(--syntax-keyword);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:global(.token.function),
|
|
98
|
+
:global(.token.class-name) {
|
|
99
|
+
color: var(--syntax-function);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:global(.token.regex),
|
|
103
|
+
:global(.token.important),
|
|
104
|
+
:global(.token.variable) {
|
|
105
|
+
color: var(--syntax-variable);
|
|
106
|
+
}
|
|
107
|
+
</style>
|