@chelone/vue 0.7.0 → 0.10.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/dist/admin/admin.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/admin/auth-gate.js +1 -3
- package/dist/admin/resource-view.d.ts +8 -0
- package/dist/admin/resource-view.js +19 -0
- package/dist/auth/permissions-hooks.js +1 -3
- package/dist/choices/choices-context.d.ts +1 -2
- package/dist/choices/use-choices.d.ts +3 -3
- package/dist/choices/use-choices.js +13 -10
- package/dist/choices/use-reference-input.js +4 -4
- package/dist/components/admin/auth/auth-error.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/auth/auth-layout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/auth/can-access.vue.d.ts +2 -2
- package/dist/components/admin/auth/login-form.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/auth/login-with-email.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/admin/buttons/bulk-update-button.vue.d.ts +19 -6
- package/dist/components/admin/buttons/bulk-update-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/buttons/clone-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/clone-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/delete-button.vue.d.ts +19 -10
- package/dist/components/admin/buttons/delete-button.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/components/admin/buttons/dual-approval-button.vue_vue_type_script_setup_true_lang.js +14 -2
- package/dist/components/admin/buttons/edit-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/edit-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/export-button.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/buttons/fields-selector.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/buttons/filter-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/buttons/record-button-props.d.ts +12 -0
- package/dist/components/admin/buttons/show-button.vue.d.ts +19 -16
- package/dist/components/admin/buttons/show-button.vue_vue_type_script_setup_true_lang.js +4 -5
- package/dist/components/admin/buttons/status-transition-button.vue_vue_type_script_setup_true_lang.js +3 -7
- package/dist/components/admin/buttons/update-button.vue.d.ts +28 -24
- package/dist/components/admin/buttons/update-button.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/admin/common/application-updated-notification.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/common/i18n-key-editor.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/csv-import/csv-import.vue_vue_type_script_setup_true_lang.js +2 -5
- package/dist/components/admin/feedback/error.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/feedback/linear-progress.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/admin/feedback/loading.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/components/admin/feedback/placeholder.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/fields/api-key-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/api-key-field.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/components/admin/fields/array-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/badge-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/boolean-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/chip-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/color-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/cron-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/currency-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/date-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/diff-viewer.vue.d.ts +3 -3
- package/dist/components/admin/fields/duration-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/email-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/field-props.d.ts +2 -2
- package/dist/components/admin/fields/file-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/image-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/json-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/number-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/phone-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/phone-field.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/admin/fields/rating-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/rating-field.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/reference-array-field.vue.d.ts +20 -10
- package/dist/components/admin/fields/reference-field.vue.d.ts +22 -35
- package/dist/components/admin/fields/reference-many-count.vue.d.ts +20 -5
- package/dist/components/admin/fields/reference-many-field.vue.d.ts +20 -12
- package/dist/components/admin/fields/reference-one-field.vue.d.ts +22 -12
- package/dist/components/admin/fields/select-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/text-array-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/text-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/url-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/usage-meter-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/usage-meter-field.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +3 -3
- package/dist/components/admin/fields/webhook-endpoint-field.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/fields/wrapper-field.vue.d.ts +21 -11
- package/dist/components/admin/inputs/api-key-input.vue.d.ts +20 -5
- package/dist/components/admin/inputs/api-key-input.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/admin/inputs/array-input-row.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/checkbox-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/date-input-format.d.ts +4 -1
- package/dist/components/admin/inputs/date-input-format.js +10 -1
- package/dist/components/admin/inputs/date-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/date-time-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/duration-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/image-input-thumbnail.vue_vue_type_script_setup_true_lang.js +6 -5
- package/dist/components/admin/inputs/image-input.vue.d.ts +1 -0
- package/dist/components/admin/inputs/image-input.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/inputs/in-place-editor-form.vue.d.ts +3 -3
- package/dist/components/admin/inputs/in-place-editor-form.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/in-place-editor.vue.d.ts +3 -3
- package/dist/components/admin/inputs/number-input.vue.d.ts +6 -0
- package/dist/components/admin/inputs/number-input.vue_vue_type_script_setup_true_lang.js +9 -0
- package/dist/components/admin/inputs/password-input.vue_vue_type_script_setup_true_lang.js +34 -30
- package/dist/components/admin/inputs/phone-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/radio-button-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/inputs/rating-input.vue_vue_type_script_setup_true_lang.js +24 -12
- package/dist/components/admin/inputs/reference-input.vue.d.ts +1 -1
- package/dist/components/admin/inputs/reference-input.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +6 -4
- package/dist/components/admin/inputs/resettable-text-input.vue_vue_type_script_setup_true_lang.js +44 -39
- package/dist/components/admin/inputs/subscription-plan-picker.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/inputs/text-input.vue.d.ts +13 -2
- package/dist/components/admin/inputs/text-input.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/components/admin/inputs/time-input.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/admin/inputs/use-choice-input.d.ts +2 -2
- package/dist/components/admin/layout/app-sidebar.vue.d.ts +12 -1
- package/dist/components/admin/layout/app-sidebar.vue_vue_type_script_setup_true_lang.js +15 -11
- package/dist/components/admin/layout/command-menu-content.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/layout/command-menu.vue.d.ts +1 -1
- package/dist/components/admin/layout/command-menu.vue_vue_type_script_setup_true_lang.js +9 -63
- package/dist/components/admin/layout/data-provider-devtools-entry.vue.d.ts +1 -1
- package/dist/components/admin/layout/data-provider-devtools-entry.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/admin/layout/data-provider-devtools.vue_vue_type_script_setup_true_lang.js +62 -28
- package/dist/components/admin/layout/icons.d.ts +2 -0
- package/dist/components/admin/layout/icons.js +3 -1
- package/dist/components/admin/layout/layout.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/layout/menu-item-link.vue.d.ts +5 -0
- package/dist/components/admin/layout/menu-item-link.vue_vue_type_script_setup_true_lang.js +27 -8
- package/dist/components/admin/layout/onboarding-tour-overlay.vue_vue_type_script_setup_true_lang.js +1 -2
- package/dist/components/admin/layout/resource-menu-item-group.vue.d.ts +8 -1
- package/dist/components/admin/layout/resource-menu-item-group.vue_vue_type_script_setup_true_lang.js +8 -7
- package/dist/components/admin/layout/theme-provider.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/admin/layout/title-portal-id.d.ts +1 -1
- package/dist/components/admin/layout/title-portal-id.js +1 -9
- package/dist/components/admin/layout/top-toolbar.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/admin/list/approval-queue-row.vue.d.ts +2 -2
- package/dist/components/admin/list/approval-queue-row.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/list/approval-queue.vue.d.ts +3 -3
- package/dist/components/admin/list/calendar-agenda-view.vue.d.ts +23 -15
- package/dist/components/admin/list/calendar-event.vue.d.ts +21 -8
- package/dist/components/admin/list/calendar-list.vue.d.ts +29 -56
- package/dist/components/admin/list/calendar-list.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/components/admin/list/calendar-month-view.vue.d.ts +26 -20
- package/dist/components/admin/list/calendar-month-view.vue_vue_type_script_setup_true_lang.js +2 -6
- package/dist/components/admin/list/calendar-week-view.vue.d.ts +24 -17
- package/dist/components/admin/list/data-table-col.vue_vue_type_script_setup_true_lang.js +8 -5
- package/dist/components/admin/list/data-table-context.d.ts +9 -6
- package/dist/components/admin/list/data-table-context.js +9 -1
- package/dist/components/admin/list/data-table-row.vue.d.ts +19 -15
- package/dist/components/admin/list/data-table-row.vue_vue_type_script_setup_true_lang.js +5 -9
- package/dist/components/admin/list/data-table.vue.d.ts +35 -23
- package/dist/components/admin/list/data-table.vue_vue_type_script_setup_true_lang.js +4 -7
- package/dist/components/admin/list/list-pagination.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/admin/list/pivot-grid.vue.d.ts +3 -3
- package/dist/components/admin/list/record-timeline.vue.d.ts +3 -3
- package/dist/components/admin/list/record-timeline.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/list/simple-list-item.vue.d.ts +21 -19
- package/dist/components/admin/list/simple-list-item.vue_vue_type_script_setup_true_lang.js +3 -7
- package/dist/components/admin/list/simple-list.vue.d.ts +28 -20
- package/dist/components/admin/list/single-field-list-record.vue.d.ts +19 -9
- package/dist/components/admin/list/single-field-list.vue.d.ts +21 -11
- package/dist/components/admin/list/tree-list-context.d.ts +11 -6
- package/dist/components/admin/list/tree-list-node.vue.d.ts +19 -4
- package/dist/components/admin/list/tree-list.vue.d.ts +28 -37
- package/dist/components/admin/realtime/comments-thread.vue_vue_type_script_setup_true_lang.js +56 -44
- package/dist/components/admin/realtime/menu-live.vue.d.ts +3 -1
- package/dist/components/admin/realtime/menu-live.vue_vue_type_script_setup_true_lang.js +42 -12
- package/dist/components/admin/supabase/forgot-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/supabase/set-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/admin/supabase/use-password-recovery.js +11 -1
- package/dist/components/admin/view/create.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/view/edit.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/view/show.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/admin/widgets/job-monitor-row.vue.d.ts +24 -11
- package/dist/components/admin/widgets/job-monitor.vue.d.ts +3 -3
- package/dist/components/admin/widgets/job-monitor.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/block-editor/block-doc-field.vue.d.ts +3 -3
- package/dist/components/block-editor/block-drag-handle.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/components/block-editor/image-block-config.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/components/charts/bar-chart.vue.d.ts +6 -2
- package/dist/components/charts/bar-chart.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/components/charts/series-chart.d.ts +1 -1
- package/dist/components/charts/series-chart.js +9 -3
- package/dist/components/index.js +2 -2
- package/dist/components/inspector/configurable.vue.d.ts +0 -21
- package/dist/components/inspector/configurable.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/inspector/inspector.vue_vue_type_script_setup_true_lang.js +6 -8
- package/dist/components/kanban/kanban-board.vue.d.ts +3 -3
- package/dist/components/kanban/kanban-board.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/maps/bbox-field.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/maps/geo-json-field.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/maps/geo-json-layers.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/maps/geo-json-view.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/maps/lat-lng-field.vue_vue_type_script_setup_true_lang.js +4 -3
- package/dist/components/maps/lat-lng-input.vue_vue_type_script_setup_true_lang.js +5 -7
- package/dist/components/maps/map-canvas.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/components/maps/use-map.js +1 -3
- package/dist/components/maps-draw/shape-input.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/components/maps-draw/simplify-input.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/maps-osm/geocoding-input.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/maps-osm/map-with-search.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/mdx-editor/mdx-editor-theme.css +47 -0
- package/dist/components/mdx-editor/mdx-field.vue.d.ts +21 -11
- package/dist/components/mdx-editor/mdx-input.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/components/monaco/internal/use-json-schema.js +1 -2
- package/dist/components/monaco/internal/use-monaco-markers.d.ts +0 -6
- package/dist/components/monaco/internal/use-monaco-markers.js +4 -2
- package/dist/components/monaco/monaco-json-field-lazy.vue.d.ts +2 -2
- package/dist/components/monaco/monaco-json-field-lazy.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/monaco/monaco-json-field.vue.d.ts +3 -3
- package/dist/components/monaco/monaco-json-input-lazy.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/rich-text-input/rich-text-field.vue.d.ts +3 -3
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/badge.js +4 -4
- package/dist/components/ui/button-variants.js +1 -1
- package/dist/components/ui/chart/chart-container.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/command/command-dialog.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/sidebar/sidebar-menu-button.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/ui/sidebar/sidebar-parts.js +2 -2
- package/dist/components/ui/sidebar/sidebar.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/controllers/use-controller-for-id.d.ts +2 -2
- package/dist/controllers/use-prev-next-controller.d.ts +2 -2
- package/dist/controllers/use-reference-many-field-controller.d.ts +4 -4
- package/dist/controllers/use-reference-one-field-controller.d.ts +4 -4
- package/dist/create-resource-components.d.ts +225 -117
- package/dist/data/undoable.js +2 -2
- package/dist/form/use-form.d.ts +5 -3
- package/dist/form/use-form.js +1 -1
- package/dist/form/use-input.d.ts +0 -2
- package/dist/form/use-input.js +1 -2
- package/dist/index.js +2 -2
- package/dist/resource-context.d.ts +5 -1
- package/dist/resource-context.js +4 -0
- package/dist/router/use-get-path-for-record.d.ts +3 -3
- package/package.json +5 -5
|
@@ -2,11 +2,17 @@ import { useCheloneContext, useCheloneStore } from "../../../context.js";
|
|
|
2
2
|
import { useTranslate } from "../../../i18n/use-translate.js";
|
|
3
3
|
import { useMatch } from "../../../router/nav-composables.js";
|
|
4
4
|
import { Badge } from "../../ui/badge.js";
|
|
5
|
-
import {
|
|
5
|
+
import { SidebarContextKey } from "../../ui/sidebar/sidebar-context.js";
|
|
6
|
+
import sidebar_menu_button_default from "../../ui/sidebar/sidebar-menu-button.js";
|
|
7
|
+
import { SidebarMenuItem } from "../../ui/sidebar/sidebar-parts.js";
|
|
8
|
+
import { Fragment, computed, createBlock, createElementBlock, defineComponent, h, inject, mergeProps, openBlock, renderList, shallowRef, unref, watchEffect } from "vue";
|
|
6
9
|
import { assertRealtimeDataProvider, clearUnread, subscribeUnreadCount, unreadKey } from "@chelone/core";
|
|
7
10
|
import { RouterLink } from "vue-router";
|
|
8
11
|
// src/components/admin/realtime/menu-live.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var _hoisted_1 = {
|
|
12
|
+
var _hoisted_1 = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "flex flex-col gap-1"
|
|
15
|
+
};
|
|
10
16
|
var subscriptions = /* @__PURE__ */ new WeakMap();
|
|
11
17
|
var toEventsKey = (events) => [...new Set(events)].sort().join(",");
|
|
12
18
|
var fromEventsKey = (eventsKey) => eventsKey.split(",").filter(Boolean);
|
|
@@ -51,7 +57,9 @@ function acquire(dataProvider, store, resource, eventsKey) {
|
|
|
51
57
|
/**
|
|
52
58
|
* A menu link with a badge counting the resource's new records. The count
|
|
53
59
|
* lives in the store, so it survives a remount; it clears while the link's
|
|
54
|
-
* route is active.
|
|
60
|
+
* route is active. Inside a `<SidebarProvider>` it is a sidebar menu button,
|
|
61
|
+
* with the label as a `title` while the desktop rail is collapsed; elsewhere it is
|
|
62
|
+
* a plain link. Divergence from the React twin: the render props are slots.
|
|
55
63
|
* Declared as a render component so the file can also hold {@link MenuLive}.
|
|
56
64
|
*/
|
|
57
65
|
var MenuLiveItemLink = defineComponent({
|
|
@@ -86,6 +94,7 @@ var MenuLiveItemLink = defineComponent({
|
|
|
86
94
|
const { dataProvider } = useCheloneContext();
|
|
87
95
|
const store = useCheloneStore();
|
|
88
96
|
const translate = useTranslate();
|
|
97
|
+
const sidebar = inject(SidebarContextKey, null);
|
|
89
98
|
const match = useMatch({
|
|
90
99
|
path: props.to,
|
|
91
100
|
end: false
|
|
@@ -111,15 +120,30 @@ var MenuLiveItemLink = defineComponent({
|
|
|
111
120
|
return () => {
|
|
112
121
|
const n = count.value ?? 0;
|
|
113
122
|
const text = translate(props.label, { _: props.label });
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
class: "
|
|
117
|
-
}, () =>
|
|
123
|
+
const badge = n > 0 ? h(Badge, {
|
|
124
|
+
"data-testid": "menu-live-badge",
|
|
125
|
+
class: sidebar ? "group-data-[collapsible=icon]:absolute group-data-[collapsible=icon]:top-0 group-data-[collapsible=icon]:right-0 group-data-[collapsible=icon]:h-4 group-data-[collapsible=icon]:min-w-4 group-data-[collapsible=icon]:px-1 group-data-[collapsible=icon]:text-[10px]" : void 0
|
|
126
|
+
}, () => props.badgeLabel?.(n) ?? (n > 99 ? "99+" : String(n))) : null;
|
|
127
|
+
const content = () => [
|
|
118
128
|
props.icon ? h(props.icon) : null,
|
|
119
129
|
slots.icon?.(),
|
|
120
130
|
h("span", { class: "flex-1" }, text),
|
|
121
|
-
|
|
122
|
-
]
|
|
131
|
+
badge
|
|
132
|
+
];
|
|
133
|
+
if (sidebar) return h(SidebarMenuItem, null, () => h(sidebar_menu_button_default, {
|
|
134
|
+
as: RouterLink,
|
|
135
|
+
to: props.to,
|
|
136
|
+
isActive: match.value != null,
|
|
137
|
+
class: "relative",
|
|
138
|
+
title: sidebar.state.value === "collapsed" && !sidebar.isMobile.value ? text : void 0,
|
|
139
|
+
onClick: () => {
|
|
140
|
+
if (sidebar.openMobile.value) sidebar.setOpenMobile(false);
|
|
141
|
+
}
|
|
142
|
+
}, content));
|
|
143
|
+
return h(RouterLink, {
|
|
144
|
+
to: props.to,
|
|
145
|
+
class: "flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent"
|
|
146
|
+
}, content);
|
|
123
147
|
};
|
|
124
148
|
}
|
|
125
149
|
});
|
|
@@ -128,12 +152,18 @@ var menu_live_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
128
152
|
props: { items: {} },
|
|
129
153
|
setup(__props) {
|
|
130
154
|
/**
|
|
131
|
-
* `<MenuLive>` — a list of {@link MenuLiveItemLink}s, one per item.
|
|
155
|
+
* `<MenuLive>` — a list of {@link MenuLiveItemLink}s, one per item. Inside a
|
|
156
|
+
* sidebar it renders the items as sidebar menu entries with no wrapper, so
|
|
157
|
+
* place it in a `<SidebarMenu>`, such as a `<ResourceMenuItemGroup>`'s default
|
|
158
|
+
* slot.
|
|
132
159
|
*/
|
|
160
|
+
const sidebar = inject(SidebarContextKey, null);
|
|
133
161
|
return (_ctx, _cache) => {
|
|
134
|
-
return
|
|
162
|
+
return unref(sidebar) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.items, (item) => {
|
|
163
|
+
return openBlock(), createBlock(unref(MenuLiveItemLink), mergeProps({ key: item.to }, { ref_for: true }, item), null, 16);
|
|
164
|
+
}), 128)) : (openBlock(), createElementBlock("nav", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
135
165
|
return openBlock(), createBlock(unref(MenuLiveItemLink), mergeProps({ key: item.to }, { ref_for: true }, item), null, 16);
|
|
136
|
-
}), 128))]);
|
|
166
|
+
}), 128))]));
|
|
137
167
|
};
|
|
138
168
|
}
|
|
139
169
|
});
|
package/dist/components/admin/supabase/forgot-password-form.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -7,7 +7,7 @@ import spinner_default from "../../ui/spinner.js";
|
|
|
7
7
|
import text_input_default from "../inputs/text-input.js";
|
|
8
8
|
import { useResetPassword } from "./use-password-recovery.js";
|
|
9
9
|
import { createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
10
|
-
import { errorMessageOf, required } from "@chelone/core";
|
|
10
|
+
import { DEFAULT_LOGIN_PATH, errorMessageOf, required } from "@chelone/core";
|
|
11
11
|
import { RouterLink } from "vue-router";
|
|
12
12
|
// src/components/admin/supabase/forgot-password-form.vue?vue&type=script&setup=true&lang.ts
|
|
13
13
|
var forgot_password_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -41,6 +41,7 @@ var forgot_password_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
41
41
|
const { submit, submitting } = useForm({
|
|
42
42
|
record: { email: "" },
|
|
43
43
|
onSubmit: save,
|
|
44
|
+
recordForm: false,
|
|
44
45
|
resetOnSuccess: false
|
|
45
46
|
});
|
|
46
47
|
function handleSubmit(event) {
|
|
@@ -70,12 +71,12 @@ var forgot_password_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE
|
|
|
70
71
|
_: 1
|
|
71
72
|
}, 8, ["disabled"]),
|
|
72
73
|
createVNode(unref(RouterLink), {
|
|
73
|
-
to:
|
|
74
|
+
to: unref(DEFAULT_LOGIN_PATH),
|
|
74
75
|
class: "text-center text-sm text-muted-foreground underline underline-offset-4 hover:text-primary"
|
|
75
76
|
}, {
|
|
76
77
|
default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("ra-supabase.auth.back_to_login", { _: "Back to login" })), 1)]),
|
|
77
78
|
_: 1
|
|
78
|
-
})
|
|
79
|
+
}, 8, ["to"])
|
|
79
80
|
], 34);
|
|
80
81
|
};
|
|
81
82
|
}
|
package/dist/components/admin/supabase/set-password-form.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -7,7 +7,7 @@ import spinner_default from "../../ui/spinner.js";
|
|
|
7
7
|
import password_input_default from "../inputs/password-input.js";
|
|
8
8
|
import { useSetPassword, useSupabaseUrlTokens } from "./use-password-recovery.js";
|
|
9
9
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withCtx } from "vue";
|
|
10
|
-
import { errorMessageOf, required } from "@chelone/core";
|
|
10
|
+
import { DEFAULT_LOGIN_PATH, errorMessageOf, required } from "@chelone/core";
|
|
11
11
|
import { RouterLink } from "vue-router";
|
|
12
12
|
// src/components/admin/supabase/set-password-form.vue?vue&type=script&setup=true&lang.ts
|
|
13
13
|
var _hoisted_1 = {
|
|
@@ -63,6 +63,7 @@ var set_password_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
63
63
|
},
|
|
64
64
|
validate: validateMatch,
|
|
65
65
|
onSubmit: save,
|
|
66
|
+
recordForm: false,
|
|
66
67
|
resetOnSuccess: false
|
|
67
68
|
});
|
|
68
69
|
function handleSubmit(event) {
|
|
@@ -75,12 +76,12 @@ var set_password_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
75
76
|
key: 0,
|
|
76
77
|
class: normalizeClass(unref(cn)("flex flex-col gap-8", props.class))
|
|
77
78
|
}, [createElementVNode("p", _hoisted_1, toDisplayString(unref(translate)("ra-supabase.auth.missing_tokens", { _: "Access and refresh tokens are missing from the link" })), 1), createVNode(unref(RouterLink), {
|
|
78
|
-
to:
|
|
79
|
+
to: unref(DEFAULT_LOGIN_PATH),
|
|
79
80
|
class: normalizeClass(linkClass)
|
|
80
81
|
}, {
|
|
81
82
|
default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("ra-supabase.auth.back_to_login", { _: "Back to login" })), 1)]),
|
|
82
83
|
_: 1
|
|
83
|
-
})], 2)) : (openBlock(), createElementBlock("form", {
|
|
84
|
+
}, 8, ["to"])], 2)) : (openBlock(), createElementBlock("form", {
|
|
84
85
|
key: 1,
|
|
85
86
|
class: normalizeClass(unref(cn)("flex flex-col gap-8", props.class)),
|
|
86
87
|
novalidate: "",
|
|
@@ -2,9 +2,19 @@ import { useCheloneAuthProvider } from "../../../context.js";
|
|
|
2
2
|
import { useNotify } from "../../../notification-hooks.js";
|
|
3
3
|
import { useLocation, useNavigate, useRedirect } from "../../../router/nav-composables.js";
|
|
4
4
|
import { computed, ref, watch } from "vue";
|
|
5
|
+
import { DEFAULT_LOGIN_PATH } from "@chelone/core";
|
|
5
6
|
import { useMutation, useQueryClient } from "@tanstack/vue-query";
|
|
6
7
|
import { readSupabaseUrlParams } from "@chelone/supabase";
|
|
7
8
|
// src/components/admin/supabase/use-password-recovery.ts
|
|
9
|
+
/**
|
|
10
|
+
* Composables for the Supabase password-recovery flows: ask for a reset email,
|
|
11
|
+
* set a new password from the emailed link, and read that link's tokens. The
|
|
12
|
+
* Vue twin of `@chelone/react`'s `supabase/use-password-recovery.ts`.
|
|
13
|
+
*
|
|
14
|
+
* Vue-specific divergence: `useSupabaseUrlTokens` returns refs, because the
|
|
15
|
+
* adapter's `useLocation()` is a `ComputedRef` that follows the route. Tokens
|
|
16
|
+
* that arrive on a later navigation replace the kept ones.
|
|
17
|
+
*/
|
|
8
18
|
/** Whether `provider` carries the method the reset email flow calls. */
|
|
9
19
|
function canResetPassword(provider) {
|
|
10
20
|
return "resetPassword" in provider && typeof provider.resetPassword === "function";
|
|
@@ -26,7 +36,7 @@ function useResetPassword(options = {}) {
|
|
|
26
36
|
},
|
|
27
37
|
onSuccess: (...args) => {
|
|
28
38
|
notify("ra-supabase.auth.password_reset", { type: "info" });
|
|
29
|
-
redirect(
|
|
39
|
+
redirect(DEFAULT_LOGIN_PATH);
|
|
30
40
|
return options.onSuccess?.(...args);
|
|
31
41
|
}
|
|
32
42
|
});
|
|
@@ -14,7 +14,7 @@ var _hoisted_3 = {
|
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "text-2xl font-bold tracking-tight"
|
|
16
16
|
};
|
|
17
|
-
var _hoisted_4 = { class: "my-2" };
|
|
17
|
+
var _hoisted_4 = { class: "my-2 space-y-4" };
|
|
18
18
|
var create_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
19
19
|
__name: "create",
|
|
20
20
|
props: {
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* unmounting when a tab is left or a poll moves the job.
|
|
5
5
|
*/
|
|
6
6
|
import { type JobPlan } from "@chelone/core";
|
|
7
|
-
import type { LooseRecord } from "@chelone/core";
|
|
7
|
+
import type { LooseRecord, ResourceRecord } from "@chelone/core";
|
|
8
8
|
/** The record fields a job row reads, each a path. */
|
|
9
|
-
export interface JobFields {
|
|
10
|
-
statusSource: string;
|
|
9
|
+
export interface JobFields<TRecord extends ResourceRecord = LooseRecord> {
|
|
10
|
+
statusSource: keyof TRecord & string;
|
|
11
11
|
typeSource: string;
|
|
12
12
|
payloadSource: string;
|
|
13
13
|
errorSource: string;
|
|
@@ -22,18 +22,31 @@ export interface JobRules {
|
|
|
22
22
|
cancelValue?: string;
|
|
23
23
|
}
|
|
24
24
|
/** Props for {@link JobMonitorRow}. */
|
|
25
|
-
export interface JobMonitorRowProps {
|
|
26
|
-
job:
|
|
25
|
+
export interface JobMonitorRowProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
26
|
+
job: TRecord;
|
|
27
27
|
resource: string;
|
|
28
|
-
fields: JobFields
|
|
28
|
+
fields: JobFields<TRecord>;
|
|
29
29
|
rules: JobRules;
|
|
30
30
|
actions: boolean;
|
|
31
31
|
busy: boolean;
|
|
32
32
|
}
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
34
34
|
export default _default;
|
|
35
|
-
declare const __VLS_export:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
36
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<JobMonitorRowProps<TRecord> & {
|
|
37
|
+
onPlan?: ((plan: JobPlan<TRecord> | null) => any) | undefined;
|
|
38
|
+
}> & (typeof globalThis extends {
|
|
39
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
40
|
+
} ? P : {});
|
|
41
|
+
expose: (exposed: {}) => void;
|
|
42
|
+
attrs: any;
|
|
43
|
+
slots: {};
|
|
44
|
+
emit: (event: "plan", plan: JobPlan<TRecord> | null) => void;
|
|
45
|
+
}>) => import("vue").VNode & {
|
|
46
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
47
|
+
};
|
|
48
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} : {
|
|
51
|
+
[K in keyof T as K]: T[K];
|
|
52
|
+
}) & {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LooseRecord, SortPayload, SourceKey, SourceProp } from "@chelone/core";
|
|
1
|
+
import type { LooseRecord, ResourceRecord, SortPayload, SourceKey, SourceProp } from "@chelone/core";
|
|
2
2
|
/** Props for {@link JobMonitor}. */
|
|
3
|
-
export interface JobMonitorProps<TRecord extends
|
|
3
|
+
export interface JobMonitorProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
4
4
|
/** The jobs resource. Defaults to the resource context; with neither, nothing renders. */
|
|
5
5
|
resource?: string;
|
|
6
6
|
/** Milliseconds between reads. Default 5000, `0` turns polling off. */
|
|
@@ -39,7 +39,7 @@ export interface JobMonitorProps<TRecord extends LooseRecord = LooseRecord> {
|
|
|
39
39
|
}
|
|
40
40
|
declare const _default: typeof __VLS_export;
|
|
41
41
|
export default _default;
|
|
42
|
-
declare const __VLS_export: <TRecord extends
|
|
42
|
+
declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
43
43
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<JobMonitorProps<TRecord>> & (typeof globalThis extends {
|
|
44
44
|
__VLS_PROPS_FALLBACK: infer P;
|
|
45
45
|
} ? P : {});
|
|
@@ -12,7 +12,7 @@ import tabs_list_default from "../../ui/tabs/tabs-list.js";
|
|
|
12
12
|
import tabs_trigger_default from "../../ui/tabs/tabs-trigger.js";
|
|
13
13
|
import job_monitor_row_default from "./job-monitor-row.js";
|
|
14
14
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
|
|
15
|
-
import { DEFAULT_JOB_TABS, buildKanbanBuckets } from "@chelone/core";
|
|
15
|
+
import { DEFAULT_JOB_TABS, buildKanbanBuckets, jobStatusSource } from "@chelone/core";
|
|
16
16
|
// src/components/admin/widgets/job-monitor.vue?vue&type=script&setup=true&lang.ts
|
|
17
17
|
var _hoisted_1 = {
|
|
18
18
|
key: 0,
|
|
@@ -70,7 +70,7 @@ var job_monitor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
70
70
|
const notifications = useCheloneNotifications();
|
|
71
71
|
const { mutate, isPending: isWriting } = useUpdate(resource ?? "", { mutationMode: "pessimistic" });
|
|
72
72
|
const fields = computed(() => ({
|
|
73
|
-
statusSource: props.statusSource
|
|
73
|
+
statusSource: jobStatusSource(props.statusSource),
|
|
74
74
|
typeSource: props.typeSource ?? "type",
|
|
75
75
|
payloadSource: props.payloadSource ?? "payload",
|
|
76
76
|
errorSource: props.errorSource ?? "lastError",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type VNode } from "vue";
|
|
2
|
-
import type { LooseRecord, SourceProp } from "@chelone/core";
|
|
2
|
+
import type { LooseRecord, ResourceRecord, SourceProp } from "@chelone/core";
|
|
3
3
|
import type { BlockDefinition } from "./block-nodes.js";
|
|
4
4
|
/** Props for {@link BlockDocField}. */
|
|
5
|
-
export interface BlockDocFieldProps<RecordType extends
|
|
5
|
+
export interface BlockDocFieldProps<RecordType extends ResourceRecord = LooseRecord> {
|
|
6
6
|
source: SourceProp<RecordType>;
|
|
7
7
|
record?: RecordType;
|
|
8
8
|
/** Read once, when the editor mounts. Each block's `read` component draws it. */
|
|
@@ -13,7 +13,7 @@ export interface BlockDocFieldProps<RecordType extends LooseRecord = LooseRecord
|
|
|
13
13
|
}
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
export default _default;
|
|
16
|
-
declare const __VLS_export: <RecordType extends
|
|
16
|
+
declare const __VLS_export: <RecordType extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
17
17
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<BlockDocFieldProps<RecordType>> & (typeof globalThis extends {
|
|
18
18
|
__VLS_PROPS_FALLBACK: infer P;
|
|
19
19
|
} ? P : {});
|
package/dist/components/block-editor/block-drag-handle.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -3,6 +3,7 @@ import { GripVerticalIcon } from "./block-icons.js";
|
|
|
3
3
|
import block_drop_gap_default from "./block-drop-gap.js";
|
|
4
4
|
import { moveTopLevelBlock } from "./block-toolbar.vue_vue_type_script_setup_true_lang.js";
|
|
5
5
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, shallowRef, unref, watch } from "vue";
|
|
6
|
+
import { GAP_PREFIX, HANDLE_ID } from "@chelone/core";
|
|
6
7
|
import { Accessibility, PointerSensor } from "@dnd-kit/dom";
|
|
7
8
|
import { useDragDropMonitor, useDraggable } from "@dnd-kit/vue";
|
|
8
9
|
// src/components/block-editor/block-drag-handle.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -21,8 +22,6 @@ var block_drag_handle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
21
22
|
* `@chelone/react`'s `block-editor/block-drag-handle.tsx`, on `@dnd-kit/vue`.
|
|
22
23
|
*/
|
|
23
24
|
const props = __props;
|
|
24
|
-
const HANDLE_ID = "block-drag-handle";
|
|
25
|
-
const GAP_PREFIX = "block-gap-";
|
|
26
25
|
const sameBoxes = (a, b) => a.length === b.length && a.every((box, i) => box.top === b[i]?.top && box.bottom === b[i]?.bottom);
|
|
27
26
|
const translate = useTranslate();
|
|
28
27
|
const layer = ref();
|
|
@@ -101,7 +100,7 @@ var block_drag_handle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
101
100
|
hovered.value = null;
|
|
102
101
|
if (canceled || typeof target !== "string") return;
|
|
103
102
|
if (!target.startsWith(GAP_PREFIX)) return;
|
|
104
|
-
const gap = Number(target.slice(
|
|
103
|
+
const gap = Number(target.slice(GAP_PREFIX.length));
|
|
105
104
|
const from = index.value;
|
|
106
105
|
moveTopLevelBlock(props.editor, from, gap > from ? gap - 1 : gap);
|
|
107
106
|
} });
|
|
@@ -142,7 +141,7 @@ var block_drag_handle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
142
141
|
}, [createVNode(unref(GripVerticalIcon))], 14, _hoisted_1)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(gaps.value, (gap) => {
|
|
143
142
|
return openBlock(), createBlock(block_drop_gap_default, {
|
|
144
143
|
key: gap.gap,
|
|
145
|
-
id: `${GAP_PREFIX}${gap.gap}`,
|
|
144
|
+
id: `${unref(GAP_PREFIX)}${gap.gap}`,
|
|
146
145
|
start: gap.start,
|
|
147
146
|
end: gap.end,
|
|
148
147
|
line: gap.line
|
package/dist/components/block-editor/image-block-config.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -2,7 +2,7 @@ import { useTranslate } from "../../i18n/use-translate.js";
|
|
|
2
2
|
import { FieldLabel } from "../ui/field.js";
|
|
3
3
|
import input_default from "../ui/input.js";
|
|
4
4
|
import { createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, toDisplayString, unref, useId, withCtx } from "vue";
|
|
5
|
-
import { isSafeImageSrc } from "@chelone/core";
|
|
5
|
+
import { MAX_IMAGE_BYTES, isSafeImageSrc } from "@chelone/core";
|
|
6
6
|
// src/components/block-editor/image-block-config.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var _hoisted_1 = { class: "grid gap-3 sm:grid-cols-2" };
|
|
8
8
|
var _hoisted_2 = { class: "flex flex-col gap-1.5" };
|
|
@@ -14,7 +14,6 @@ var _hoisted_6 = {
|
|
|
14
14
|
role: "alert",
|
|
15
15
|
class: "text-destructive text-sm"
|
|
16
16
|
};
|
|
17
|
-
var maxImageBytes = 5242880;
|
|
18
17
|
var image_block_config_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
19
18
|
__name: "image-block-config",
|
|
20
19
|
props: {
|
|
@@ -48,7 +47,7 @@ var image_block_config_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
48
47
|
input.value = "";
|
|
49
48
|
const { onChange } = props;
|
|
50
49
|
if (!file) return;
|
|
51
|
-
if (!file.type.startsWith("image/") || file.size >
|
|
50
|
+
if (!file.type.startsWith("image/") || file.size > MAX_IMAGE_BYTES) {
|
|
52
51
|
failed.value = true;
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { LooseRecord } from "@chelone/core";
|
|
2
2
|
import type { SeriesChartProps } from "./series-chart.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface BarChartProps<TRow extends object = LooseRecord, TX extends keyof TRow & string = keyof TRow & string> extends SeriesChartProps<TRow, TX> {
|
|
4
|
+
/** Any CSS color. Left out, each bar draws in the next theme chart color. */
|
|
5
|
+
color?: string;
|
|
6
|
+
/** Any CSS colors, cycled over the bars when `color` is left out. Defaults to the theme's chart colors. */
|
|
7
|
+
colors?: readonly string[];
|
|
8
|
+
}
|
|
5
9
|
declare const _default: typeof __VLS_export;
|
|
6
10
|
export default _default;
|
|
7
11
|
declare const __VLS_export: <TRow extends object = LooseRecord, TX extends keyof TRow & string = keyof TRow & string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
@@ -2,17 +2,18 @@ import chart_container_default from "../ui/chart/chart-container.js";
|
|
|
2
2
|
import chart_frame_default from "./chart-frame.js";
|
|
3
3
|
import { rowX, rowY, useSeriesRows } from "./series-chart.js";
|
|
4
4
|
import { createBlock, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, unref, withCtx } from "vue";
|
|
5
|
-
import { hasChartValues } from "@chelone/core";
|
|
5
|
+
import { DEFAULT_CHART_COLORS, chartColor, hasChartValues } from "@chelone/core";
|
|
6
6
|
import { VisAxis, VisCrosshair, VisGroupedBar, VisTooltip, VisXYContainer } from "@unovis/vue";
|
|
7
7
|
// src/components/charts/bar-chart.vue?vue&type=script&setup=true&lang.ts
|
|
8
8
|
var bar_chart_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
__name: "bar-chart",
|
|
10
10
|
props: {
|
|
11
|
+
color: {},
|
|
12
|
+
colors: { default: () => DEFAULT_CHART_COLORS },
|
|
11
13
|
data: {},
|
|
12
14
|
xField: {},
|
|
13
15
|
yField: {},
|
|
14
16
|
title: {},
|
|
15
|
-
color: { default: "var(--primary)" },
|
|
16
17
|
height: { default: 200 },
|
|
17
18
|
loading: {
|
|
18
19
|
type: Boolean,
|
|
@@ -38,8 +39,9 @@ var bar_chart_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
38
39
|
*/
|
|
39
40
|
const props = __props;
|
|
40
41
|
const { rows, config, xAxis, tooltipFor } = useSeriesRows(props);
|
|
41
|
-
const
|
|
42
|
-
const
|
|
42
|
+
const colorOf = (index) => props.color ?? chartColor(index, props.colors);
|
|
43
|
+
const color = (row) => colorOf(row.index);
|
|
44
|
+
const tooltipTemplate = (row) => tooltipFor(row, row.y, colorOf(row.index));
|
|
43
45
|
return (_ctx, _cache) => {
|
|
44
46
|
return openBlock(), createBlock(chart_frame_default, {
|
|
45
47
|
"data-slot": "bar-chart",
|
|
@@ -41,6 +41,6 @@ export declare function useSeriesRows<TRow extends object, TX extends keyof TRow
|
|
|
41
41
|
tickValues: number[];
|
|
42
42
|
tickFormat: (position: number | Date) => string;
|
|
43
43
|
}>;
|
|
44
|
-
tooltipFor: (row: import("@chelone/core").CartesianRow<TRow[TX]>, value: number | string | null) => string;
|
|
44
|
+
tooltipFor: (row: import("@chelone/core").CartesianRow<TRow[TX]>, value: number | string | null, color?: string) => string;
|
|
45
45
|
};
|
|
46
46
|
export {};
|
|
@@ -28,9 +28,15 @@ function useSeriesRows(props) {
|
|
|
28
28
|
const step = Math.max(1, Math.ceil(rows.value.length / 7));
|
|
29
29
|
return rows.value.filter((row) => row.index % step === 0).map(rowX);
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
/**
|
|
32
|
+
* The crosshair's HTML for a row, with `value` shown in place of the row's y.
|
|
33
|
+
* `color` draws the row's own indicator, for a chart whose color is not the
|
|
34
|
+
* same for every row.
|
|
35
|
+
*/
|
|
36
|
+
const tooltipFor = (row, value, color) => componentToString(config.value, chart_tooltip_content_default, {
|
|
37
|
+
labelFormatter: xLabel,
|
|
38
|
+
...color === void 0 ? {} : { color }
|
|
39
|
+
})?.({ [props.yField]: value }, row.index) ?? "";
|
|
34
40
|
return {
|
|
35
41
|
rows,
|
|
36
42
|
config,
|
package/dist/components/index.js
CHANGED
|
@@ -23,6 +23,7 @@ import skeleton_default from "./ui/skeleton.js";
|
|
|
23
23
|
import logout_default from "./admin/auth/logout.js";
|
|
24
24
|
import user_menu_default from "./admin/layout/user-menu.js";
|
|
25
25
|
import app_bar_default from "./admin/layout/app-bar.js";
|
|
26
|
+
import keyboard_shortcut_default from "./admin/common/keyboard-shortcut.js";
|
|
26
27
|
import menu_item_link_default from "./admin/layout/menu-item-link.js";
|
|
27
28
|
import dashboard_menu_item_default from "./admin/layout/dashboard-menu-item.js";
|
|
28
29
|
import resource_menu_item_default from "./admin/layout/resource-menu-item.js";
|
|
@@ -90,7 +91,6 @@ import field_label_text_default from "./admin/common/field-label-text.js";
|
|
|
90
91
|
import i18n_key_editor_default from "./admin/common/i18n-key-editor.js";
|
|
91
92
|
import icon_button_with_tooltip_default from "./admin/common/icon-button-with-tooltip.js";
|
|
92
93
|
import input_helper_text_default from "./admin/common/input-helper-text.js";
|
|
93
|
-
import keyboard_shortcut_default from "./admin/common/keyboard-shortcut.js";
|
|
94
94
|
import link_default from "./admin/common/link.js";
|
|
95
95
|
import title_default from "./admin/layout/title.js";
|
|
96
96
|
import error_default from "./admin/feedback/error.js";
|
|
@@ -201,7 +201,6 @@ import command_group_default from "./ui/command/command-group.js";
|
|
|
201
201
|
import command_input_default from "./ui/command/command-input.js";
|
|
202
202
|
import command_item_default from "./ui/command/command-item.js";
|
|
203
203
|
import { CommandEmpty, CommandList, CommandSeparator, CommandShortcut } from "./ui/command/parts.js";
|
|
204
|
-
import sheet_default from "./ui/sheet.js";
|
|
205
204
|
import command_menu_default from "./admin/layout/command-menu.js";
|
|
206
205
|
import data_provider_devtools_default from "./admin/layout/data-provider-devtools.js";
|
|
207
206
|
import hide_on_scroll_default from "./admin/layout/hide-on-scroll.js";
|
|
@@ -209,6 +208,7 @@ import onboarding_tour_default from "./admin/layout/onboarding-tour.js";
|
|
|
209
208
|
import top_toolbar_default from "./admin/layout/top-toolbar.js";
|
|
210
209
|
import textarea_default from "./ui/textarea.js";
|
|
211
210
|
import approval_queue_default from "./admin/list/approval-queue.js";
|
|
211
|
+
import sheet_default from "./ui/sheet.js";
|
|
212
212
|
import bulk_edit_drawer_default from "./admin/list/bulk-edit-drawer.js";
|
|
213
213
|
import calendar_list_default from "./admin/list/calendar-list.js";
|
|
214
214
|
import count_default from "./admin/list/count.js";
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `<Configurable>` — marks a piece of the page as configurable. While the
|
|
3
|
-
* inspector's configure mode is on it is outlined and shows a Customize button
|
|
4
|
-
* that opens its `#editor` slot in the panel. The Vue twin of
|
|
5
|
-
* `@chelone/react`'s `Configurable`. Without an `<Inspector>` it renders its
|
|
6
|
-
* default slot and nothing else.
|
|
7
|
-
*
|
|
8
|
-
* The wrapper is there whether or not the mode is on, so turning it on never
|
|
9
|
-
* remounts the content.
|
|
10
|
-
*
|
|
11
|
-
* The editor is teleported into the panel, so it reads the contexts around this
|
|
12
|
-
* (resource, list, record), not the ones around the `<Inspector>`.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* <Configurable preference-key="posts.columns" title="Columns">
|
|
16
|
-
* <PostTable />
|
|
17
|
-
* <template #editor>
|
|
18
|
-
* <SortableFieldsSelector store-key="posts.datatable" />
|
|
19
|
-
* </template>
|
|
20
|
-
* </Configurable>
|
|
21
|
-
*/
|
|
22
1
|
import { type VNode } from "vue";
|
|
23
2
|
/** Props for {@link Configurable}. */
|
|
24
3
|
export interface ConfigurableProps {
|
|
@@ -4,6 +4,7 @@ import { SlidersHorizontalIcon } from "../admin/buttons/icons.js";
|
|
|
4
4
|
import button_default from "../ui/button.js";
|
|
5
5
|
import { useInspector, useInspectorBody } from "./inspector-context.js";
|
|
6
6
|
import { Teleport, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, onScopeDispose, openBlock, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
|
|
7
|
+
import { INSPECTOR_OPEN_LABEL } from "@chelone/core";
|
|
7
8
|
// src/components/inspector/configurable.vue?vue&type=script&setup=true&lang.ts
|
|
8
9
|
var _hoisted_1 = ["data-inspector-enabled", "data-selected"];
|
|
9
10
|
var configurable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -40,7 +41,6 @@ var configurable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
40
41
|
const translate = useTranslate();
|
|
41
42
|
const inspector = useInspector();
|
|
42
43
|
const body = useInspectorBody();
|
|
43
|
-
const defaultOpenLabel = "chelone.inspector.customize";
|
|
44
44
|
const enabled = computed(() => inspector?.value.enabled ?? false);
|
|
45
45
|
const isSelected = computed(() => inspector?.value.selected?.key === props.preferenceKey);
|
|
46
46
|
const editor = () => [];
|
|
@@ -71,7 +71,7 @@ var configurable_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
71
71
|
class: "absolute top-1 right-1 z-10 h-6 gap-1 px-2 text-xs opacity-0 focus-visible:opacity-100 group-focus-within/configurable:opacity-100 group-hover/configurable:opacity-100 group-data-[selected]/configurable:opacity-100",
|
|
72
72
|
onClick: open
|
|
73
73
|
}, {
|
|
74
|
-
default: withCtx(() => [createVNode(unref(SlidersHorizontalIcon)), createTextVNode(" " + toDisplayString(unref(translate)(props.openButtonLabel ??
|
|
74
|
+
default: withCtx(() => [createVNode(unref(SlidersHorizontalIcon)), createTextVNode(" " + toDisplayString(unref(translate)(props.openButtonLabel ?? unref(INSPECTOR_OPEN_LABEL), { _: props.openButtonLabel ?? "Customize" })), 1)]),
|
|
75
75
|
_: 1
|
|
76
76
|
})) : createCommentVNode("", true),
|
|
77
77
|
isSelected.value && unref(body) ? (openBlock(), createBlock(Teleport, {
|
|
@@ -7,7 +7,7 @@ import { XIcon } from "../admin/buttons/icons.js";
|
|
|
7
7
|
import button_default from "../ui/button.js";
|
|
8
8
|
import { provideInspector, provideInspectorBody } from "./inspector-context.js";
|
|
9
9
|
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, shallowRef, toDisplayString, unref, withCtx } from "vue";
|
|
10
|
-
import { clampInspectorPosition, createInspector, inspectorPositionKey } from "@chelone/core";
|
|
10
|
+
import { INSPECTOR_KEY_STEP, PANEL_WIDTH, clampInspectorPosition, createInspector, inspectorPositionKey } from "@chelone/core";
|
|
11
11
|
// src/components/inspector/inspector.vue?vue&type=script&setup=true&lang.ts
|
|
12
12
|
var _hoisted_1 = ["aria-label"];
|
|
13
13
|
var _hoisted_2 = ["aria-label"];
|
|
@@ -37,24 +37,22 @@ var inspector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
37
37
|
* </template>
|
|
38
38
|
* </Admin>
|
|
39
39
|
*/
|
|
40
|
-
const PANEL_WIDTH = 320;
|
|
41
|
-
const KEY_STEP = 16;
|
|
42
40
|
const ARROWS = {
|
|
43
41
|
ArrowLeft: {
|
|
44
|
-
x: -
|
|
42
|
+
x: -INSPECTOR_KEY_STEP,
|
|
45
43
|
y: 0
|
|
46
44
|
},
|
|
47
45
|
ArrowRight: {
|
|
48
|
-
x:
|
|
46
|
+
x: INSPECTOR_KEY_STEP,
|
|
49
47
|
y: 0
|
|
50
48
|
},
|
|
51
49
|
ArrowUp: {
|
|
52
50
|
x: 0,
|
|
53
|
-
y: -
|
|
51
|
+
y: -INSPECTOR_KEY_STEP
|
|
54
52
|
},
|
|
55
53
|
ArrowDown: {
|
|
56
54
|
x: 0,
|
|
57
|
-
y:
|
|
55
|
+
y: INSPECTOR_KEY_STEP
|
|
58
56
|
}
|
|
59
57
|
};
|
|
60
58
|
const props = __props;
|
|
@@ -142,7 +140,7 @@ var inspector_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
142
140
|
style: normalizeStyle({
|
|
143
141
|
left: `${position.value.x}px`,
|
|
144
142
|
top: `${position.value.y}px`,
|
|
145
|
-
width: `${PANEL_WIDTH}px`
|
|
143
|
+
width: `${unref(PANEL_WIDTH)}px`
|
|
146
144
|
}),
|
|
147
145
|
class: normalizeClass(unref(cn)("fixed z-50 flex max-h-[80vh] max-w-[calc(100vw-1rem)] flex-col rounded-lg border bg-popover text-popover-foreground shadow-lg", props.class))
|
|
148
146
|
}, [createElementVNode("div", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VNode } from "vue";
|
|
2
|
-
import type { KanbanColumnDef, LooseRecord, SourceKey, SourceProp } from "@chelone/core";
|
|
2
|
+
import type { KanbanColumnDef, LooseRecord, ResourceRecord, SourceKey, SourceProp } from "@chelone/core";
|
|
3
3
|
/** Props for {@link KanbanBoard}. */
|
|
4
|
-
export interface KanbanBoardProps<TRecord extends
|
|
4
|
+
export interface KanbanBoardProps<TRecord extends ResourceRecord = LooseRecord> {
|
|
5
5
|
/**
|
|
6
6
|
* The top-level field whose value names a column; a drop writes the target
|
|
7
7
|
* column's `id` to it.
|
|
@@ -22,7 +22,7 @@ export interface KanbanBoardProps<TRecord extends LooseRecord = LooseRecord> {
|
|
|
22
22
|
}
|
|
23
23
|
declare const _default: typeof __VLS_export;
|
|
24
24
|
export default _default;
|
|
25
|
-
declare const __VLS_export: <TRecord extends
|
|
25
|
+
declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
26
26
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<KanbanBoardProps<TRecord> & {
|
|
27
27
|
"onSelect-card"?: ((record: TRecord) => any) | undefined;
|
|
28
28
|
}> & (typeof globalThis extends {
|