@riducms/admin 0.2.2 → 0.3.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/THIRD_PARTY_NOTICES.md +60 -37
- package/package.json +27 -15
- package/src/app/admin-core-view-route.svelte +38 -53
- package/src/app/admin-extension-route.svelte +19 -0
- package/src/app/admin-layout.scss +175 -0
- package/src/app/admin-layout.svelte +144 -410
- package/src/app/admin-navigation-progress.svelte +11 -77
- package/src/app/admin-page-title.svelte +17 -85
- package/src/app/admin-page-title.ts +136 -0
- package/src/app/admin-route-error.svelte +24 -0
- package/src/app/admin-router-provider.svelte +34 -0
- package/src/app/admin-router-root.svelte +41 -0
- package/src/app/admin-routes.svelte +56 -19
- package/src/app/loading-boundary.svelte +3 -1
- package/src/app-meta.ts +13 -0
- package/src/app.css +138 -496
- package/src/app.svelte +60 -26
- package/src/components/brand/ridu-logo.svelte +19 -5
- package/src/components/data/list-table.scss +63 -0
- package/src/components/icons/LICENSE.md +24 -0
- package/src/components/icons/chevron.svelte +8 -0
- package/src/components/icons/plus.svelte +12 -0
- package/src/components/icons/search.svelte +12 -0
- package/src/components/icons/x.svelte +8 -0
- package/src/components/json-tree/json-tree-node.svelte +61 -67
- package/src/components/json-tree/json-viewer.scss +153 -0
- package/src/components/json-tree/json-viewer.svelte +57 -96
- package/src/components/ui/banner/banner.scss +28 -0
- package/src/components/ui/banner/banner.svelte +9 -8
- package/src/components/ui/banner/index.ts +1 -5
- package/src/components/ui/code-editor/code-editor.scss +20 -0
- package/src/components/ui/code-editor/code-editor.svelte +71 -0
- package/src/components/ui/code-editor/code-editor.ts +151 -0
- package/src/components/ui/code-editor/code-languages.ts +29 -0
- package/src/components/ui/collapsible-panel/collapsible-panel.scss +38 -0
- package/src/components/ui/collapsible-panel/collapsible-panel.svelte +13 -0
- package/src/components/ui/collapsible-panel/index.ts +1 -0
- package/src/components/ui/combobox/combobox.scss +163 -0
- package/src/components/ui/combobox/index.ts +22 -0
- package/src/components/ui/date-value-control/date-value-calendar.svelte +128 -16
- package/src/components/ui/date-value-control/date-value-control-loader.scss +26 -0
- package/src/components/ui/date-value-control/date-value-control-loader.svelte +35 -13
- package/src/components/ui/date-value-control/date-value-control.scss +223 -0
- package/src/components/ui/date-value-control/date-value-control.svelte +62 -44
- package/src/components/ui/drawer/drawer-depth.ts +8 -0
- package/src/components/ui/dropdown-menu/dropdown-menu-content.svelte +2 -5
- package/src/components/ui/dropdown-menu/dropdown-menu-item.svelte +2 -5
- package/src/components/ui/dropdown-menu/dropdown-menu-separator.svelte +2 -2
- package/src/components/ui/dropdown-menu/dropdown-menu.scss +62 -0
- package/src/components/ui/kbd/kbd.scss +17 -0
- package/src/components/ui/kbd/kbd.svelte +3 -10
- package/src/components/ui/navigation-drawer/navigation-drawer.scss +40 -0
- package/src/components/ui/navigation-drawer/navigation-drawer.svelte +38 -0
- package/src/components/ui/popover/popover-content.svelte +3 -5
- package/src/components/ui/popover/popover.scss +18 -0
- package/src/components/ui/radio-group/index.ts +0 -1
- package/src/components/ui/radio-group/radio-card-item.svelte +7 -12
- package/src/components/ui/radio-group/radio-group.svelte +2 -2
- package/src/components/ui/radio-group/radio.scss +45 -0
- package/src/components/ui/select/select-content.svelte +5 -6
- package/src/components/ui/select/select-item.svelte +8 -8
- package/src/components/ui/select/select-scroll-down-button.svelte +3 -5
- package/src/components/ui/select/select-scroll-up-button.svelte +3 -5
- package/src/components/ui/select/select-trigger.svelte +6 -7
- package/src/components/ui/select/select.scss +126 -0
- package/src/components/ui/sheet/sheet-content.svelte +6 -34
- package/src/components/ui/sheet/sheet-description.svelte +2 -2
- package/src/components/ui/sheet/sheet-overlay.svelte +2 -21
- package/src/components/ui/sheet/sheet-title.svelte +2 -2
- package/src/components/ui/sheet/sheet.scss +221 -0
- package/src/components/ui/skeleton/skeleton.scss +20 -0
- package/src/components/ui/skeleton/skeleton.svelte +4 -16
- package/src/components/ui/sonner/sonner.scss +121 -0
- package/src/components/ui/sonner/sonner.svelte +11 -10
- package/src/components/ui/status-indicator/status-indicator.scss +48 -0
- package/src/components/ui/status-indicator/status-indicator.svelte +14 -14
- package/src/components/ui/tabs/tabs-content.svelte +2 -2
- package/src/components/ui/tabs/tabs-list.svelte +7 -7
- package/src/components/ui/tabs/tabs-trigger.svelte +2 -8
- package/src/components/ui/tabs/tabs.scss +86 -0
- package/src/components/ui/tabs/tabs.svelte +2 -2
- package/src/components/ui/timezone-picker/timezone-picker.svelte +152 -0
- package/src/core/api/admin-client.ts +2 -2
- package/src/core/bootstrap/admin-bootstrap.ts +396 -0
- package/src/core/bootstrap/admin-prepared-state.ts +213 -0
- package/src/core/bootstrap/admin-route-modules.ts +66 -0
- package/src/core/clipboard/copy-feedback.svelte.ts +43 -0
- package/src/core/forms/embedded-fields.ts +4 -8
- package/src/core/forms/field-editor-authoring.ts +8 -0
- package/src/core/forms/field-issue-focus.ts +4 -4
- package/src/core/forms/field-occurrence.ts +4 -7
- package/src/core/forms/form-controller.svelte.ts +14 -21
- package/src/core/forms/form-draft-recovery.ts +17 -4
- package/src/core/forms/form-issue-correlation.ts +13 -13
- package/src/core/forms/form-path.ts +17 -0
- package/src/core/forms/form-schema.ts +12 -43
- package/src/core/forms/form-validation.ts +7 -46
- package/src/core/forms/plugin-field-authoring.ts +6 -2
- package/src/core/forms/plugin-field-write.ts +2 -6
- package/src/core/i18n/admin-i18n.svelte.ts +18 -0
- package/src/core/i18n/format-admin-date-time.ts +19 -0
- package/src/core/i18n/humanize-identifier.ts +5 -0
- package/src/core/i18n/time-zone-label.ts +20 -0
- package/src/core/loaders/admin-view-host.svelte +72 -0
- package/src/core/loaders/admin-view-loader.svelte.ts +90 -0
- package/src/core/notifications/validation-toast.svelte +2 -2
- package/src/core/plugins/field-registry.ts +7 -8
- package/src/core/routing/admin-paths.ts +53 -2
- package/src/core/routing/admin-scroll.svelte.ts +74 -0
- package/src/core/routing/admin-view-selection.ts +78 -0
- package/src/core/runtime/admin-runtime.svelte.ts +121 -124
- package/src/core/schema/field-default.ts +33 -0
- package/src/core/schema/field-localization.ts +15 -0
- package/src/core/schema/read-document-path.ts +11 -0
- package/src/features/account/account-menu.scss +37 -0
- package/src/features/account/account-menu.svelte +115 -0
- package/src/features/{auth → account}/account-navigation.svelte +16 -19
- package/src/features/{auth → account}/account-route.svelte +206 -49
- package/src/features/account/account-security-controller.svelte.ts +157 -0
- package/src/features/{auth → account}/account-security-route.svelte +140 -42
- package/src/features/api-reference/api-reference-code.svelte +64 -0
- package/src/features/api-reference/api-reference-content.svelte +258 -0
- package/src/features/api-reference/api-reference-drawer.scss +74 -0
- package/src/features/api-reference/api-reference-examples.ts +381 -0
- package/src/features/api-reference/api-reference-schema.ts +332 -0
- package/src/features/api-reference/api-reference.scss +190 -0
- package/src/features/api-reference/api-reference.svelte +74 -0
- package/src/features/auth/auth-brand.svelte +5 -3
- package/src/features/auth/auth-field.svelte +92 -0
- package/src/features/auth/auth-frame.svelte +5 -8
- package/src/features/auth/auth.scss +122 -0
- package/src/features/auth/create-first-user-controller.svelte.ts +20 -51
- package/src/features/auth/create-first-user-route.svelte +83 -122
- package/src/features/auth/forgot-password-route.svelte +31 -23
- package/src/features/auth/login-route.svelte +68 -116
- package/src/features/auth/logout-button.scss +34 -0
- package/src/features/auth/logout-button.svelte +52 -0
- package/src/features/auth/request-verification-route.svelte +27 -22
- package/src/features/auth/reset-password-route.svelte +108 -41
- package/src/features/auth/verify-email-route.svelte +49 -15
- package/src/features/bulk-edit/bulk-edit-fields.ts +23 -0
- package/src/features/bulk-edit/bulk-edit.scss +152 -0
- package/src/features/bulk-edit/field-picker.svelte +176 -0
- package/src/features/collections/bulk/bulk-actions.svelte +148 -0
- package/src/features/collections/bulk/bulk-confirmation.svelte +153 -0
- package/src/features/collections/bulk/bulk-editor-loader.svelte +95 -0
- package/src/features/collections/bulk/bulk-editor.svelte +186 -0
- package/src/features/collections/collection-list-cell-values.ts +144 -0
- package/src/features/collections/collection-list-controller.svelte.ts +268 -379
- package/src/features/collections/collection-list-preferences-controller.svelte.ts +54 -40
- package/src/features/collections/collection-list-query.ts +223 -0
- package/src/features/collections/collection-list-results.svelte +205 -329
- package/src/features/collections/collection-list-route.svelte +143 -884
- package/src/features/collections/collection-list.scss +261 -0
- package/src/features/collections/collection-list.svelte.ts +362 -0
- package/src/features/collections/controls/column-picker.svelte +110 -0
- package/src/features/collections/controls/column-pill.svelte +62 -0
- package/src/features/collections/controls/filter-builder.svelte +193 -0
- package/src/features/collections/controls/filter-row.svelte +142 -0
- package/src/features/collections/controls/list-controls.scss +196 -0
- package/src/features/collections/controls/list-options.svelte +203 -0
- package/src/features/collections/controls/list-pagination.scss +78 -0
- package/src/features/collections/controls/list-pagination.svelte +115 -0
- package/src/features/collections/controls/list-toolbar.svelte +132 -0
- package/src/features/collections/controls/sort-heading.scss +52 -0
- package/src/features/collections/controls/sort-heading.svelte +78 -0
- package/src/features/collections/list-columns.ts +43 -0
- package/src/features/collections/list-workspace.ts +155 -54
- package/src/features/dashboard/dashboard-route.svelte +82 -86
- package/src/features/dashboard/dashboard.scss +131 -0
- package/src/features/development/development-tools.svelte +20 -36
- package/src/features/documents/document-action-bar.svelte +438 -0
- package/src/features/documents/document-api-view-loader.svelte +17 -6
- package/src/features/documents/document-api-view.scss +120 -0
- package/src/features/documents/document-api-view.svelte +169 -454
- package/src/features/documents/document-controller.svelte.ts +526 -613
- package/src/features/documents/document-credentials.scss +37 -0
- package/src/features/documents/document-credentials.svelte +72 -0
- package/src/features/documents/{document-route-dirty.ts → document-credentials.ts} +25 -0
- package/src/features/documents/document-field-sections.scss +39 -0
- package/src/features/documents/document-field-sections.svelte +4 -13
- package/src/features/documents/document-loading.scss +24 -0
- package/src/features/documents/document-lock-controller.svelte.ts +187 -0
- package/src/features/documents/document-operation-dialogs.svelte +110 -0
- package/src/features/documents/document-route-loader.svelte +17 -5
- package/src/features/documents/document-route.svelte +305 -811
- package/src/features/documents/document-schedule.scss +127 -0
- package/src/features/documents/document-schedule.svelte +323 -0
- package/src/features/documents/document-title.ts +25 -0
- package/src/features/documents/document.scss +274 -0
- package/src/features/documents/live-preview-panel.scss +117 -0
- package/src/features/documents/live-preview-panel.svelte +167 -168
- package/src/features/documents/live-preview.ts +2 -10
- package/src/features/documents/upload-document-preview-loader.svelte +26 -23
- package/src/features/localization/content-locale-switcher.scss +43 -0
- package/src/features/localization/content-locale-switcher.svelte +24 -17
- package/src/features/navigation/admin-breadcrumbs.scss +56 -0
- package/src/features/navigation/admin-breadcrumbs.svelte +102 -37
- package/src/features/navigation/admin-command-menu.svelte +38 -15
- package/src/features/navigation/admin-navigation.scss +133 -0
- package/src/features/navigation/admin-navigation.svelte +169 -0
- package/src/features/navigation/breadcrumb-context.svelte.ts +15 -0
- package/src/features/navigation/navigation-preference.svelte.ts +70 -0
- package/src/features/reference-browser/reference-browser-editor.svelte +180 -0
- package/src/features/reference-browser/reference-browser-list.scss +113 -0
- package/src/features/reference-browser/reference-browser-list.svelte +370 -0
- package/src/features/reference-browser/reference-browser-loader.svelte +26 -8
- package/src/features/reference-browser/reference-browser-workflow.svelte.ts +335 -236
- package/src/features/reference-browser/reference-browser.scss +217 -0
- package/src/features/reference-browser/reference-browser.svelte +154 -797
- package/src/features/reference-browser/reference-collection-picker.svelte +116 -0
- package/src/features/reference-browser/reference-list-query.ts +35 -0
- package/src/features/uploads/bulk-upload-controller.svelte.ts +604 -0
- package/src/features/uploads/bulk-upload-edit-all.svelte +92 -0
- package/src/features/uploads/bulk-upload-editor.svelte +191 -0
- package/src/features/uploads/bulk-upload-file-picker.svelte +70 -0
- package/src/features/uploads/bulk-upload-remote.svelte +100 -0
- package/src/features/uploads/bulk-upload-route-loader.svelte +54 -0
- package/src/features/uploads/bulk-upload-route.svelte +172 -592
- package/src/features/uploads/bulk-upload-sidebar.svelte +125 -0
- package/src/features/uploads/bulk-upload.scss +526 -0
- package/src/features/uploads/bulk-upload.ts +105 -14
- package/src/features/uploads/crop-surface.ts +150 -0
- package/src/features/uploads/image-editor.svelte +231 -0
- package/src/features/uploads/rendition-preview.svelte +64 -0
- package/src/features/uploads/upload-control.svelte +340 -0
- package/src/features/uploads/upload-document-contracts.ts +30 -0
- package/src/features/uploads/upload-draft.svelte.ts +294 -0
- package/src/features/uploads/upload-metadata-fields.scss +32 -0
- package/src/features/uploads/upload-metadata-fields.svelte +8 -7
- package/src/features/uploads/upload-thumbnail.svelte +47 -0
- package/src/features/uploads/upload.scss +361 -0
- package/src/features/versions/version-comparison.svelte +361 -0
- package/src/features/versions/version-diff-fields.svelte +136 -0
- package/src/features/versions/version-diff.ts +296 -41
- package/src/features/versions/version-history-controller.svelte.ts +311 -0
- package/src/features/versions/version-history-route-loader.svelte +32 -0
- package/src/features/versions/version-history-route.svelte +157 -522
- package/src/features/versions/version-history.scss +444 -0
- package/src/features/versions/version-history.ts +45 -0
- package/src/features/versions/version-table.svelte +91 -0
- package/src/fields/embedded-schema-draft-editor.scss +48 -0
- package/src/fields/embedded-schema-draft-editor.svelte +24 -16
- package/src/fields/field-collapsible.svelte +14 -8
- package/src/fields/field-layout.scss +171 -0
- package/src/fields/field-layout.svelte +3 -5
- package/src/fields/field-renderer.svelte +17 -29
- package/src/fields/field-shell.svelte +1 -1
- package/src/fields/field-tab-layout.svelte +25 -19
- package/src/fields/join/join-field-controller.svelte.ts +513 -0
- package/src/fields/join/join-field-values.ts +111 -0
- package/src/fields/join/join-field.scss +189 -0
- package/src/fields/join/join-field.svelte +164 -332
- package/src/fields/live-validation-feedback.svelte +4 -3
- package/src/fields/local-field-editor.svelte +2 -2
- package/src/fields/nested/block-name-input.svelte +11 -12
- package/src/fields/nested/block-picker.scss +128 -0
- package/src/fields/nested/block-picker.svelte +81 -0
- package/src/fields/nested/block-placeholder.svg +2 -0
- package/src/fields/nested/nested-field.scss +331 -0
- package/src/fields/nested/nested-field.svelte +265 -245
- package/src/fields/nested/sortable-row.svelte +9 -7
- package/src/fields/plugin-field.svelte +4 -6
- package/src/fields/point/point-field.svelte +51 -38
- package/src/fields/primitive-list/primitive-list-field.svelte +63 -19
- package/src/fields/primitive-list/primitive-list.scss +109 -0
- package/src/fields/radio/radio-field.svelte +2 -1
- package/src/fields/relationship/relationship-field-controller.svelte.ts +81 -41
- package/src/fields/relationship/relationship-field.svelte +144 -175
- package/src/fields/relationship/relationship-lookup-controller.svelte.ts +58 -30
- package/src/fields/relationship/relationship-query.ts +2 -10
- package/src/fields/relationship/relationship-quick-picker-controller.svelte.ts +36 -62
- package/src/fields/relationship/relationship-quick-picker.svelte +178 -227
- package/src/fields/relationship/relationship-selection.svelte +120 -0
- package/src/fields/relationship/relationship-value.ts +46 -7
- package/src/fields/relationship/relationship.scss +182 -0
- package/src/fields/scalar/code-field.svelte +101 -0
- package/src/fields/scalar/date-control-value.ts +13 -0
- package/src/fields/scalar/scalar-field.svelte +25 -67
- package/src/fields/select/select-field.svelte +132 -94
- package/src/fields/text/slug-field.scss +28 -0
- package/src/fields/text/slug-field.svelte +19 -15
- package/src/fields/text/text-field.svelte +1 -2
- package/src/fields/ui/ui-field.svelte +7 -4
- package/src/fields/virtual/virtual-field.svelte +2 -5
- package/src/index.ts +1 -2
- package/src/routing.ts +2 -0
- package/src/app/deferred-redirect.svelte +0 -23
- package/src/components/code-block/code-block.svelte +0 -107
- package/src/components/ui/bulk-action-bar/bulk-action-bar.svelte +0 -50
- package/src/components/ui/bulk-action-bar/index.ts +0 -1
- package/src/components/ui/button/index.ts +0 -8
- package/src/components/ui/calendar/calendar-caption.svelte +0 -72
- package/src/components/ui/calendar/calendar-cell.svelte +0 -20
- package/src/components/ui/calendar/calendar-day.svelte +0 -27
- package/src/components/ui/calendar/calendar-grid-row.svelte +0 -13
- package/src/components/ui/calendar/calendar-grid.svelte +0 -17
- package/src/components/ui/calendar/calendar-head-cell.svelte +0 -20
- package/src/components/ui/calendar/calendar-header.svelte +0 -20
- package/src/components/ui/calendar/calendar-heading.svelte +0 -17
- package/src/components/ui/calendar/calendar-month-select.svelte +0 -45
- package/src/components/ui/calendar/calendar-month.svelte +0 -16
- package/src/components/ui/calendar/calendar-months.svelte +0 -20
- package/src/components/ui/calendar/calendar-nav.svelte +0 -20
- package/src/components/ui/calendar/calendar-next-button.svelte +0 -30
- package/src/components/ui/calendar/calendar-prev-button.svelte +0 -30
- package/src/components/ui/calendar/calendar-year-select.svelte +0 -44
- package/src/components/ui/calendar/calendar.svelte +0 -118
- package/src/components/ui/calendar/index.ts +0 -1
- package/src/components/ui/checkbox/checkbox.svelte +0 -35
- package/src/components/ui/checkbox/index.ts +0 -1
- package/src/components/ui/dialog/dialog-close.svelte +0 -11
- package/src/components/ui/dialog/dialog-content.svelte +0 -52
- package/src/components/ui/dialog/dialog-description.svelte +0 -20
- package/src/components/ui/dialog/dialog-footer.svelte +0 -20
- package/src/components/ui/dialog/dialog-header.svelte +0 -20
- package/src/components/ui/dialog/dialog-overlay.svelte +0 -20
- package/src/components/ui/dialog/dialog-title.svelte +0 -17
- package/src/components/ui/dialog/dialog-trigger.svelte +0 -11
- package/src/components/ui/dialog/dialog.svelte +0 -7
- package/src/components/ui/dialog/index.ts +0 -8
- package/src/components/ui/empty-state/empty-state.svelte +0 -34
- package/src/components/ui/empty-state/index.ts +0 -1
- package/src/components/ui/input/index.ts +0 -1
- package/src/components/ui/pagination/index.ts +0 -1
- package/src/components/ui/pagination/pagination.svelte +0 -88
- package/src/components/ui/radio-group/radio-group-item.svelte +0 -17
- package/src/components/ui/slider/index.ts +0 -3
- package/src/components/ui/slider/slider-content.svelte +0 -59
- package/src/components/ui/slider/slider.svelte +0 -35
- package/src/components/ui/table/index.ts +0 -6
- package/src/components/ui/table/table-body.svelte +0 -20
- package/src/components/ui/table/table-cell.svelte +0 -23
- package/src/components/ui/table/table-head.svelte +0 -23
- package/src/components/ui/table/table-header.svelte +0 -20
- package/src/components/ui/table/table-row.svelte +0 -23
- package/src/components/ui/table/table.svelte +0 -22
- package/src/components/ui/textarea/index.ts +0 -1
- package/src/components/ui/tooltip/index.ts +0 -4
- package/src/components/ui/tooltip/tooltip-content.svelte +0 -50
- package/src/components/ui/tooltip/tooltip-provider.svelte +0 -7
- package/src/components/ui/tooltip/tooltip-trigger.svelte +0 -7
- package/src/components/ui/tooltip/tooltip.svelte +0 -7
- package/src/features/auth/account-menu.svelte +0 -159
- package/src/features/auth/account-security-controller.svelte.ts +0 -119
- package/src/features/collections/collection-list-bulk-actions.svelte +0 -143
- package/src/features/collections/collection-list-bulk-editor.svelte +0 -157
- package/src/features/collections/collection-list-filter-popover.svelte +0 -238
- package/src/features/collections/collection-list-workspace-toolbar.svelte +0 -409
- package/src/features/collections/collection-table-skeleton.svelte +0 -44
- package/src/features/documents/document-heading.ts +0 -20
- package/src/features/documents/upload-document-preview.svelte +0 -525
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Combobox,
|
|
4
|
+
ComboboxInput,
|
|
5
|
+
ComboboxTrigger,
|
|
6
|
+
ComboboxPortal,
|
|
7
|
+
ComboboxViewport,
|
|
8
|
+
ComboboxContent,
|
|
9
|
+
ComboboxItem,
|
|
10
|
+
} from "@admin/components/ui/combobox";
|
|
2
11
|
import type { SchemaField } from "@riducms/protocol";
|
|
3
12
|
import { fieldControlARIA } from "@riducms/ui";
|
|
4
13
|
import XIcon from "~icons/lucide/x";
|
|
5
|
-
|
|
6
|
-
import { Button } from "@admin/components/ui/button";
|
|
7
|
-
import { Select, SelectContent, SelectItem, SelectTrigger } from "@admin/components/ui/select";
|
|
14
|
+
import ChevronDownIcon from "~icons/lucide/chevron-down";
|
|
8
15
|
import type { FormController } from "@admin/core/forms/form-controller.svelte";
|
|
9
16
|
import { getAdminRuntime } from "@admin/core/runtime/admin-runtime.svelte";
|
|
10
17
|
import FieldShell from "@admin/fields/field-shell.svelte";
|
|
@@ -13,120 +20,151 @@
|
|
|
13
20
|
selectOptionLabel,
|
|
14
21
|
selectManyValues,
|
|
15
22
|
} from "@admin/fields/select/select-value";
|
|
23
|
+
import "@admin/components/ui/combobox/combobox.scss";
|
|
16
24
|
|
|
17
|
-
|
|
18
|
-
field: SchemaField;
|
|
19
|
-
form: FormController;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let { field, form }: Props = $props();
|
|
25
|
+
let { field, form }: { field: SchemaField; form: FormController } = $props();
|
|
23
26
|
const runtime = getAdminRuntime();
|
|
24
|
-
|
|
27
|
+
let anchor = $state<HTMLDivElement | null>(null);
|
|
28
|
+
let open = $state(false);
|
|
29
|
+
let query = $state("");
|
|
30
|
+
|
|
31
|
+
const hasMany = $derived(field.select?.hasMany === true);
|
|
25
32
|
const value = $derived(String(form.get(field.path) ?? ""));
|
|
26
33
|
const values = $derived(selectManyValues(form.get(field.path)));
|
|
34
|
+
const options = $derived(field.select?.options ?? []);
|
|
35
|
+
const filtered = $derived(
|
|
36
|
+
options.filter((option) =>
|
|
37
|
+
option.label
|
|
38
|
+
.toLocaleLowerCase(runtime.i18n.language)
|
|
39
|
+
.includes(query.toLocaleLowerCase(runtime.i18n.language))
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
const selectedLabel = $derived(options.find((option) => option.value === value)?.label ?? "");
|
|
27
43
|
const placeholder = $derived(
|
|
28
44
|
field.admin.placeholder ?? runtime.i18n.t("fields:select", { label: field.admin.label })
|
|
29
45
|
);
|
|
30
|
-
const selectedLabel = $derived(
|
|
31
|
-
field.select?.options.find((option) => option.value === value)?.label ?? placeholder
|
|
32
|
-
);
|
|
33
|
-
const selectedLabels = $derived(
|
|
34
|
-
values.map((selected) => selectOptionLabel(field.select?.options ?? [], selected))
|
|
35
|
-
);
|
|
36
46
|
const issues = $derived(form.issuesFor(field.path));
|
|
37
47
|
const editingBlocked = $derived(field.admin.readOnly === true || form.editingBlocked);
|
|
38
48
|
const controlARIA = $derived(
|
|
39
49
|
fieldControlARIA(field.id, field.admin.description !== undefined, issues.length > 0)
|
|
40
50
|
);
|
|
51
|
+
const selection = $derived(
|
|
52
|
+
hasMany
|
|
53
|
+
? { type: "multiple" as const, value: values, onValueChange: setValues }
|
|
54
|
+
: { type: "single" as const, value, onValueChange: setValue }
|
|
55
|
+
);
|
|
41
56
|
|
|
42
57
|
$effect(() => form.register(field.path));
|
|
43
58
|
|
|
44
59
|
function setValues(next: string[]) {
|
|
45
|
-
if (editingBlocked)
|
|
46
|
-
form.set(field.path, [...next]);
|
|
60
|
+
if (!editingBlocked) form.set(field.path, [...next]);
|
|
47
61
|
}
|
|
48
62
|
|
|
49
|
-
function
|
|
50
|
-
if (editingBlocked)
|
|
51
|
-
form.set(field.path, removeSelectValue(values, selected));
|
|
63
|
+
function setValue(next: string) {
|
|
64
|
+
if (!editingBlocked) form.set(field.path, next);
|
|
52
65
|
}
|
|
53
66
|
</script>
|
|
54
67
|
|
|
55
68
|
<FieldShell {field} {issues}>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
aria-required={field.required}
|
|
63
|
-
aria-label={field.admin.label}
|
|
64
|
-
>
|
|
65
|
-
<span class={values.length === 0 ? "text-foreground-placeholder" : "truncate"}>
|
|
66
|
-
{values.length === 0 ? placeholder : runtime.i18n.formatList(selectedLabels)}
|
|
67
|
-
</span>
|
|
68
|
-
</SelectTrigger>
|
|
69
|
-
<SelectContent>
|
|
70
|
-
{#each field.select?.options ?? [] as option (option.value)}
|
|
71
|
-
<SelectItem value={option.value} label={option.label} />
|
|
72
|
-
{/each}
|
|
73
|
-
</SelectContent>
|
|
74
|
-
</Select>
|
|
75
|
-
{#if values.length > 0}
|
|
76
|
-
<ul
|
|
77
|
-
class="mt-2 flex flex-wrap gap-1.5"
|
|
78
|
-
aria-label={runtime.i18n.t("general:selected", { count: values.length })}
|
|
79
|
-
>
|
|
80
|
-
{#each values as selected, index (`${selected}:${index}`)}
|
|
81
|
-
<li
|
|
82
|
-
class="inline-flex max-w-full items-center gap-1 rounded-[3px] border border-control-border bg-background py-0.5 pe-0.5 ps-2 text-[12px] text-foreground-muted"
|
|
83
|
-
>
|
|
84
|
-
<span class="max-w-64 truncate">
|
|
85
|
-
{selectOptionLabel(field.select?.options ?? [], selected)}
|
|
86
|
-
</span>
|
|
87
|
-
{#if !field.admin.readOnly}
|
|
88
|
-
<Button
|
|
89
|
-
variant="ghost"
|
|
90
|
-
size="icon-xs"
|
|
91
|
-
disabled={editingBlocked}
|
|
92
|
-
onclick={() => removeValue(selected)}
|
|
93
|
-
aria-label={runtime.i18n.t("fields:remove", {
|
|
94
|
-
label: selectOptionLabel(field.select?.options ?? [], selected),
|
|
95
|
-
})}
|
|
96
|
-
>
|
|
97
|
-
<XIcon class="size-3" aria-hidden="true" />
|
|
98
|
-
</Button>
|
|
99
|
-
{/if}
|
|
100
|
-
</li>
|
|
101
|
-
{/each}
|
|
102
|
-
</ul>
|
|
103
|
-
{/if}
|
|
104
|
-
{:else}
|
|
105
|
-
<Select
|
|
106
|
-
type="single"
|
|
107
|
-
{value}
|
|
108
|
-
allowDeselect={!field.required}
|
|
109
|
-
onValueChange={(next) => {
|
|
110
|
-
if (!editingBlocked) form.set(field.path, next);
|
|
111
|
-
}}
|
|
69
|
+
<!-- The combobox must restart when a retained field switches between single and multiple. -->
|
|
70
|
+
{#key hasMany}
|
|
71
|
+
<Combobox
|
|
72
|
+
{...selection}
|
|
73
|
+
allowDeselect={false}
|
|
74
|
+
items={options}
|
|
112
75
|
disabled={editingBlocked}
|
|
76
|
+
bind:open={
|
|
77
|
+
() => open,
|
|
78
|
+
(next) => {
|
|
79
|
+
open = next;
|
|
80
|
+
if (!next) query = "";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
inputValue={open || hasMany ? query : selectedLabel}
|
|
113
84
|
>
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
class="
|
|
117
|
-
{
|
|
118
|
-
|
|
119
|
-
aria-label={field.admin.label}
|
|
85
|
+
<div
|
|
86
|
+
bind:this={anchor}
|
|
87
|
+
class="ridu-combobox"
|
|
88
|
+
aria-invalid={issues.length > 0}
|
|
89
|
+
data-disabled={editingBlocked}
|
|
120
90
|
>
|
|
121
|
-
<
|
|
122
|
-
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
91
|
+
<div class="ridu-combobox-value">
|
|
92
|
+
{#if hasMany}
|
|
93
|
+
{#each values as selected (selected)}
|
|
94
|
+
<span class="ridu-combobox-tag">
|
|
95
|
+
{selectOptionLabel(options, selected)}
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
class="ridu-combobox-icon"
|
|
99
|
+
disabled={editingBlocked}
|
|
100
|
+
aria-label={runtime.i18n.t("fields:remove", {
|
|
101
|
+
label: selectOptionLabel(options, selected),
|
|
102
|
+
})}
|
|
103
|
+
onclick={() => setValues(removeSelectValue(values, selected))}
|
|
104
|
+
>
|
|
105
|
+
<XIcon />
|
|
106
|
+
</button>
|
|
107
|
+
</span>
|
|
108
|
+
{/each}
|
|
109
|
+
{/if}
|
|
110
|
+
<ComboboxInput
|
|
111
|
+
id={field.id}
|
|
112
|
+
class="ridu-combobox-input"
|
|
113
|
+
autocomplete="off"
|
|
114
|
+
autocorrect="off"
|
|
115
|
+
autocapitalize="none"
|
|
116
|
+
spellcheck={false}
|
|
117
|
+
{placeholder}
|
|
118
|
+
{...controlARIA}
|
|
119
|
+
aria-label={field.admin.label}
|
|
120
|
+
aria-required={field.required}
|
|
121
|
+
clearOnDeselect
|
|
122
|
+
onpointerdown={() => (open = true)}
|
|
123
|
+
oninput={(event) => {
|
|
124
|
+
query = event.currentTarget.value;
|
|
125
|
+
open = true;
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
{#if !hasMany && value}
|
|
130
|
+
<button
|
|
131
|
+
type="button"
|
|
132
|
+
class="ridu-combobox-icon"
|
|
133
|
+
disabled={editingBlocked}
|
|
134
|
+
aria-label={runtime.i18n.t("general:clearSelection")}
|
|
135
|
+
onclick={() => setValue("")}
|
|
136
|
+
>
|
|
137
|
+
<XIcon />
|
|
138
|
+
</button>
|
|
139
|
+
{/if}
|
|
140
|
+
<ComboboxTrigger
|
|
141
|
+
type="button"
|
|
142
|
+
class="ridu-combobox-icon ridu-combobox-trigger"
|
|
143
|
+
aria-label={placeholder}
|
|
144
|
+
>
|
|
145
|
+
<ChevronDownIcon />
|
|
146
|
+
</ComboboxTrigger>
|
|
147
|
+
</div>
|
|
148
|
+
<ComboboxPortal>
|
|
149
|
+
<ComboboxContent
|
|
150
|
+
customAnchor={anchor}
|
|
151
|
+
sideOffset={0}
|
|
152
|
+
align="start"
|
|
153
|
+
class="ridu-combobox-popup"
|
|
154
|
+
>
|
|
155
|
+
<ComboboxViewport>
|
|
156
|
+
{#each filtered as option (option.value)}
|
|
157
|
+
<ComboboxItem value={option.value} label={option.label} class="ridu-combobox-option">
|
|
158
|
+
{option.label}
|
|
159
|
+
</ComboboxItem>
|
|
160
|
+
{:else}
|
|
161
|
+
<p class="ridu-combobox-message">
|
|
162
|
+
{runtime.i18n.t("fields:noMatch", { label: field.admin.label })}
|
|
163
|
+
</p>
|
|
164
|
+
{/each}
|
|
165
|
+
</ComboboxViewport>
|
|
166
|
+
</ComboboxContent>
|
|
167
|
+
</ComboboxPortal>
|
|
168
|
+
</Combobox>
|
|
169
|
+
{/key}
|
|
132
170
|
</FieldShell>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use "@riducms/ui/styles.scss";
|
|
2
|
+
|
|
3
|
+
@layer ridu.components {
|
|
4
|
+
.ridu-slug-field {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
gap: 4px 8px;
|
|
9
|
+
min-width: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ridu-slug-field__input {
|
|
13
|
+
min-width: 0;
|
|
14
|
+
flex: 1 1 18rem;
|
|
15
|
+
font-family: var(--font-mono);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ridu-slug-field__actions {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: flex-end;
|
|
22
|
+
flex: 0 0 max-content;
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
gap: 4px;
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
margin-inline-start: auto;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SchemaField } from "@riducms/protocol";
|
|
3
|
-
import { fieldControlARIA } from "@riducms/ui";
|
|
3
|
+
import { fieldControlARIA, Button, Input } from "@riducms/ui";
|
|
4
4
|
import { untrack } from "svelte";
|
|
5
5
|
|
|
6
|
-
import { Button } from "@admin/components/ui/button";
|
|
7
|
-
import { Input } from "@admin/components/ui/input";
|
|
8
6
|
import type {
|
|
9
7
|
DerivedTextBinding,
|
|
10
8
|
FormController,
|
|
@@ -12,6 +10,7 @@
|
|
|
12
10
|
import { getAdminRuntime } from "@admin/core/runtime/admin-runtime.svelte";
|
|
13
11
|
import FieldShell from "@admin/fields/field-shell.svelte";
|
|
14
12
|
import { normalizeSlug, slugFollowsSource } from "@admin/fields/text/slug";
|
|
13
|
+
import "@admin/fields/text/slug-field.scss";
|
|
15
14
|
|
|
16
15
|
interface Props {
|
|
17
16
|
field: SchemaField;
|
|
@@ -27,21 +26,26 @@
|
|
|
27
26
|
fieldControlARIA(field.id, field.admin.description !== undefined, issues.length > 0)
|
|
28
27
|
);
|
|
29
28
|
let locked = $state(true);
|
|
30
|
-
let binding
|
|
29
|
+
let binding: DerivedTextBinding | undefined;
|
|
31
30
|
|
|
32
31
|
$effect(() => {
|
|
33
32
|
form.revision;
|
|
34
33
|
const sourcePath = field.text?.slug?.sourcePath;
|
|
35
34
|
const fieldPath = field.path;
|
|
36
35
|
if (sourcePath === undefined) return;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
// Only the initialization snapshot is excluded: later changes are observed by
|
|
37
|
+
// FormController, while form.revision above owns reset/rebind synchronization.
|
|
38
|
+
const initial = untrack(() => ({
|
|
39
|
+
current: form.get(fieldPath),
|
|
40
|
+
source: form.get(sourcePath),
|
|
41
|
+
}));
|
|
42
|
+
binding = form.bindDerivedText(
|
|
43
|
+
fieldPath,
|
|
44
|
+
sourcePath,
|
|
45
|
+
(source) => normalizeSlug(String(source ?? "")),
|
|
46
|
+
(current, source) => String(current ?? "") === "" || slugFollowsSource(current, source),
|
|
47
|
+
initial
|
|
48
|
+
);
|
|
45
49
|
});
|
|
46
50
|
|
|
47
51
|
function generate() {
|
|
@@ -60,7 +64,7 @@
|
|
|
60
64
|
</script>
|
|
61
65
|
|
|
62
66
|
<FieldShell {field} {issues}>
|
|
63
|
-
<div class="
|
|
67
|
+
<div class="ridu-slug-field">
|
|
64
68
|
<Input
|
|
65
69
|
id={field.id}
|
|
66
70
|
name={field.path}
|
|
@@ -70,13 +74,13 @@
|
|
|
70
74
|
placeholder={field.admin.placeholder}
|
|
71
75
|
{...controlARIA}
|
|
72
76
|
readonly={editingBlocked || locked}
|
|
73
|
-
class="
|
|
77
|
+
class="ridu-slug-field__input"
|
|
74
78
|
{value}
|
|
75
79
|
oninput={(event) => setManualValue(event.currentTarget.value)}
|
|
76
80
|
onblur={normalizeManualValue}
|
|
77
81
|
/>
|
|
78
82
|
{#if !field.admin.readOnly}
|
|
79
|
-
<div class="
|
|
83
|
+
<div class="ridu-slug-field__actions">
|
|
80
84
|
{#if !locked}
|
|
81
85
|
<Button
|
|
82
86
|
type="button"
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SchemaField } from "@riducms/protocol";
|
|
3
|
-
import { fieldControlARIA } from "@riducms/ui";
|
|
3
|
+
import { fieldControlARIA, Input } from "@riducms/ui";
|
|
4
4
|
|
|
5
|
-
import { Input } from "@admin/components/ui/input";
|
|
6
5
|
import type { FormController } from "@admin/core/forms/form-controller.svelte";
|
|
7
6
|
import FieldShell from "@admin/fields/field-shell.svelte";
|
|
8
7
|
import SlugField from "@admin/fields/text/slug-field.svelte";
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { SchemaField } from "@riducms/protocol";
|
|
3
|
+
import "@admin/fields/field-layout.scss";
|
|
3
4
|
|
|
4
5
|
let { field }: { field: SchemaField } = $props();
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
|
-
<aside class="
|
|
8
|
-
<p class="
|
|
9
|
-
{#if field.admin.description}
|
|
8
|
+
<aside class="ridu-ui-field" data-ui-field={field.name}>
|
|
9
|
+
<p class="ridu-ui-field__title">{field.admin.label}</p>
|
|
10
|
+
{#if field.admin.description}
|
|
11
|
+
<p class="ridu-ui-field__description">
|
|
10
12
|
{field.admin.description}
|
|
11
|
-
</p>
|
|
13
|
+
</p>
|
|
14
|
+
{/if}
|
|
12
15
|
</aside>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import "@admin/fields/field-layout.scss";
|
|
2
3
|
import type { SchemaField } from "@riducms/protocol";
|
|
3
4
|
|
|
4
5
|
import type { FormController } from "@admin/core/forms/form-controller.svelte";
|
|
@@ -18,11 +19,7 @@
|
|
|
18
19
|
</script>
|
|
19
20
|
|
|
20
21
|
<FieldShell {field} issues={[]}>
|
|
21
|
-
<output
|
|
22
|
-
id={field.id}
|
|
23
|
-
class="block min-h-10 whitespace-pre-wrap rounded-[3px] border border-control-border-disabled bg-control-disabled px-3 py-2.5 text-[13px] leading-5 text-foreground-label"
|
|
24
|
-
data-virtual-field={field.name}
|
|
25
|
-
>
|
|
22
|
+
<output id={field.id} class="ridu-virtual-field" data-virtual-field={field.name}>
|
|
26
23
|
{formatted}
|
|
27
24
|
</output>
|
|
28
25
|
</FieldShell>
|
package/src/index.ts
CHANGED
package/src/routing.ts
ADDED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { useNavigate } from "@hvniel/svelte-router";
|
|
3
|
-
|
|
4
|
-
interface Props {
|
|
5
|
-
to: string;
|
|
6
|
-
replace?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
let { to, replace = false }: Props = $props();
|
|
10
|
-
const navigate = useNavigate();
|
|
11
|
-
|
|
12
|
-
$effect(() => {
|
|
13
|
-
let active = true;
|
|
14
|
-
// The router activates useNavigate in a parent effect. Deferring one
|
|
15
|
-
// microtask prevents a mounted redirect from racing that activation.
|
|
16
|
-
queueMicrotask(() => {
|
|
17
|
-
if (active) navigate(to, { replace });
|
|
18
|
-
});
|
|
19
|
-
return () => {
|
|
20
|
-
active = false;
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
</script>
|
|
@@ -1,107 +0,0 @@
|
|
|
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>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import XIcon from "~icons/lucide/x";
|
|
3
|
-
import type { Snippet } from "svelte";
|
|
4
|
-
import { getAdminI18n } from "@riducms/plugin";
|
|
5
|
-
|
|
6
|
-
import { Button } from "@admin/components/ui/button";
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
count,
|
|
10
|
-
onClear,
|
|
11
|
-
label,
|
|
12
|
-
selectionLabel,
|
|
13
|
-
clearLabel,
|
|
14
|
-
children,
|
|
15
|
-
}: {
|
|
16
|
-
count: number;
|
|
17
|
-
onClear: () => void;
|
|
18
|
-
label?: string;
|
|
19
|
-
selectionLabel?: string;
|
|
20
|
-
clearLabel?: string;
|
|
21
|
-
children?: Snippet;
|
|
22
|
-
} = $props();
|
|
23
|
-
const i18n = getAdminI18n();
|
|
24
|
-
const resolvedLabel = $derived(label ?? i18n.t("general:bulkActions"));
|
|
25
|
-
const resolvedSelectionLabel = $derived(selectionLabel ?? i18n.t("general:selected", { count }));
|
|
26
|
-
const resolvedClearLabel = $derived(clearLabel ?? i18n.t("general:clearSelection"));
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
{#if count > 0}
|
|
30
|
-
<div
|
|
31
|
-
data-slot="bulk-action-bar"
|
|
32
|
-
class="ridu-popover-enter fixed bottom-6 left-1/2 z-40 flex max-w-[calc(100vw-2rem)] -translate-x-1/2 items-center gap-2 rounded-[4px] border border-control-border bg-popover px-3 py-2 text-popover-foreground shadow-[var(--shadow-popover)]"
|
|
33
|
-
role="region"
|
|
34
|
-
aria-label={resolvedLabel}
|
|
35
|
-
>
|
|
36
|
-
<span
|
|
37
|
-
class="whitespace-nowrap px-2 text-[13.5px] font-medium text-foreground"
|
|
38
|
-
role="status"
|
|
39
|
-
aria-live="polite"
|
|
40
|
-
aria-atomic="true"
|
|
41
|
-
>
|
|
42
|
-
{resolvedSelectionLabel}
|
|
43
|
-
</span>
|
|
44
|
-
<span class="h-5 w-px bg-control-border" aria-hidden="true"></span>
|
|
45
|
-
{@render children?.()}
|
|
46
|
-
<Button variant="ghost" size="icon-sm" onclick={onClear} aria-label={resolvedClearLabel}>
|
|
47
|
-
<XIcon class="size-3.5" />
|
|
48
|
-
</Button>
|
|
49
|
-
</div>
|
|
50
|
-
{/if}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as BulkActionBar } from "@admin/components/ui/bulk-action-bar/bulk-action-bar.svelte";
|