@questpie/admin 3.0.3 → 3.0.5
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/README.md +34 -5
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/blocks/block-renderer.mjs +4 -1
- package/dist/client/builder/types/action-types.d.mts +31 -3
- package/dist/client/builder/types/collection-types.d.mts +140 -0
- package/dist/client/builder/types/ui-config.d.mts +16 -2
- package/dist/client/builder/types/views.d.mts +57 -0
- package/dist/client/builder/types/widget-types.d.mts +5 -0
- package/dist/client/components/actions/action-button.mjs +137 -199
- package/dist/client/components/actions/action-dialog.mjs +198 -156
- package/dist/client/components/actions/confirmation-dialog.mjs +2 -2
- package/dist/client/components/actions/header-actions.mjs +52 -53
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/auth/auth-loading.mjs +41 -18
- package/dist/client/components/blocks/block-editor-layout.mjs +2 -2
- package/dist/client/components/blocks/block-fields-renderer.mjs +64 -28
- package/dist/client/components/blocks/block-insert-button.mjs +4 -4
- package/dist/client/components/blocks/block-item.mjs +2 -2
- package/dist/client/components/blocks/block-library-sidebar.mjs +91 -63
- package/dist/client/components/component-renderer.mjs +1 -1
- package/dist/client/components/fields/array-field.mjs +14 -14
- package/dist/client/components/fields/asset-preview-field.mjs +1 -1
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +84 -104
- package/dist/client/components/fields/json-field.mjs +2 -2
- package/dist/client/components/fields/object-array-field.mjs +22 -22
- package/dist/client/components/fields/object-field.mjs +5 -5
- package/dist/client/components/fields/relation/displays/cards-display.mjs +16 -9
- package/dist/client/components/fields/relation/displays/chips-display.mjs +15 -12
- package/dist/client/components/fields/relation/displays/grid-display.mjs +15 -11
- package/dist/client/components/fields/relation/displays/list-display.mjs +33 -20
- package/dist/client/components/fields/relation/displays/table-display.mjs +62 -93
- package/dist/client/components/fields/relation/relation-items-display.mjs +1 -1
- package/dist/client/components/fields/relation-picker.mjs +7 -6
- package/dist/client/components/fields/relation-select.mjs +71 -47
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +392 -82
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +54 -23
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +24 -50
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +66 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +38 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +637 -376
- package/dist/client/components/fields/rich-text-editor/link-utils.mjs +26 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +10 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +27 -6
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +464 -346
- package/dist/client/components/fields/rich-text-editor/types.d.mts +77 -0
- package/dist/client/components/fields/upload-field.mjs +45 -49
- package/dist/client/components/filter-builder/columns-tab.mjs +69 -62
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +473 -308
- package/dist/client/components/filter-builder/filters-tab.mjs +109 -82
- package/dist/client/components/filter-builder/saved-views-tab.mjs +300 -198
- package/dist/client/components/history-sidebar.mjs +850 -340
- package/dist/client/components/layout/field-layout-renderer.mjs +6 -5
- package/dist/client/components/locale-switcher.mjs +8 -8
- package/dist/client/components/media/media-grid.mjs +106 -86
- package/dist/client/components/media/media-picker-dialog.mjs +242 -230
- package/dist/client/components/preview/live-preview-mode.mjs +1 -1
- package/dist/client/components/primitives/asset-preview.mjs +37 -22
- package/dist/client/components/primitives/date-input.mjs +212 -249
- package/dist/client/components/primitives/dropzone.mjs +192 -159
- package/dist/client/components/primitives/field-select-control.mjs +93 -0
- package/dist/client/components/primitives/select-multi.mjs +406 -365
- package/dist/client/components/primitives/select-single.mjs +391 -323
- package/dist/client/components/primitives/time-input.mjs +2 -2
- package/dist/client/components/sheets/resource-sheet.mjs +2 -0
- package/dist/client/components/ui/accordion.mjs +4 -4
- package/dist/client/components/ui/alert.mjs +3 -3
- package/dist/client/components/ui/badge.mjs +4 -4
- package/dist/client/components/ui/button.mjs +47 -37
- package/dist/client/components/ui/card.mjs +2 -2
- package/dist/client/components/ui/checkbox.mjs +1 -1
- package/dist/client/components/ui/command.mjs +5 -5
- package/dist/client/components/ui/dialog.mjs +3 -3
- package/dist/client/components/ui/drawer.mjs +1 -1
- package/dist/client/components/ui/dropdown-menu.mjs +157 -15
- package/dist/client/components/ui/empty-state.mjs +88 -59
- package/dist/client/components/ui/field.mjs +2 -2
- package/dist/client/components/ui/input-group.mjs +3 -3
- package/dist/client/components/ui/input.mjs +1 -1
- package/dist/client/components/ui/kbd.mjs +1 -1
- package/dist/client/components/ui/label.mjs +1 -1
- package/dist/client/components/ui/popover.mjs +19 -11
- package/dist/client/components/ui/scroll-fade.mjs +170 -0
- package/dist/client/components/ui/search-input.mjs +1 -1
- package/dist/client/components/ui/select.mjs +129 -27
- package/dist/client/components/ui/sheet.mjs +54 -34
- package/dist/client/components/ui/sidebar.mjs +15 -14
- package/dist/client/components/ui/skeleton.mjs +28 -12
- package/dist/client/components/ui/switch.mjs +2 -2
- package/dist/client/components/ui/table.mjs +82 -74
- package/dist/client/components/ui/tabs.mjs +26 -31
- package/dist/client/components/ui/textarea.mjs +1 -1
- package/dist/client/components/ui/tooltip.mjs +1 -1
- package/dist/client/components/widgets/chart-widget.mjs +154 -100
- package/dist/client/components/widgets/progress-widget.mjs +63 -36
- package/dist/client/components/widgets/quick-actions-widget.mjs +207 -115
- package/dist/client/components/widgets/recent-items-widget.mjs +147 -103
- package/dist/client/components/widgets/stats-widget.mjs +91 -72
- package/dist/client/components/widgets/table-widget.mjs +161 -247
- package/dist/client/components/widgets/timeline-widget.mjs +119 -78
- package/dist/client/components/widgets/value-widget.mjs +286 -157
- package/dist/client/components/widgets/widget-empty-state.mjs +88 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +53 -20
- package/dist/client/contexts/focus-context.d.mts +2 -2
- package/dist/client/hooks/use-action.mjs +63 -55
- package/dist/client/hooks/use-audit-history.mjs +1 -65
- package/dist/client/hooks/use-collection-validation.mjs +36 -23
- package/dist/client/hooks/use-collection.mjs +96 -1
- package/dist/client/hooks/use-saved-views.mjs +70 -49
- package/dist/client/hooks/use-server-actions.mjs +70 -46
- package/dist/client/hooks/use-server-validation.mjs +156 -41
- package/dist/client/hooks/use-server-widget-data.mjs +1 -1
- package/dist/client/hooks/use-setup-status.d.mts +3 -3
- package/dist/client/hooks/use-setup-status.mjs +2 -2
- package/dist/client/hooks/use-transition-stage.mjs +2 -10
- package/dist/client/hooks/use-validation-error-map.mjs +31 -13
- package/dist/client/hooks/use-view-state.mjs +238 -174
- package/dist/client/i18n/date-locale.mjs +33 -0
- package/dist/client/i18n/hooks.mjs +17 -1
- package/dist/client/lib/utils.mjs +3 -2
- package/dist/client/preview/block-scope-context.d.mts +2 -2
- package/dist/client/preview/preview-banner.d.mts +2 -2
- package/dist/client/preview/preview-banner.mjs +75 -46
- package/dist/client/preview/preview-field.d.mts +4 -4
- package/dist/client/preview/preview-field.mjs +2 -2
- package/dist/client/runtime/provider.mjs +8 -1
- package/dist/client/runtime/translations-provider.mjs +1 -1
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/styles/base.css +1022 -0
- package/dist/client/styles/index.css +3 -589
- package/dist/client/utils/auto-expand-fields.mjs +4 -2
- package/dist/client/utils/keyboard-shortcuts.mjs +26 -0
- package/dist/client/utils/use-lazy-component.mjs +80 -0
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/auth-layout.d.mts +17 -10
- package/dist/client/views/auth/auth-layout.mjs +291 -80
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/forgot-password-form.mjs +2 -2
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.mjs +1 -1
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.mjs +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/auto-form-fields.mjs +11 -9
- package/dist/client/views/collection/bulk-action-toolbar.mjs +173 -138
- package/dist/client/views/collection/cells/complex-cells.mjs +22 -22
- package/dist/client/views/collection/cells/primitive-cells.mjs +1 -1
- package/dist/client/views/collection/cells/relation-cells.mjs +147 -129
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +224 -278
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +64 -36
- package/dist/client/views/collection/cells/upload-cells.mjs +199 -9
- package/dist/client/views/collection/columns/build-columns.mjs +29 -9
- package/dist/client/views/collection/columns/column-defaults.mjs +2 -2
- package/dist/client/views/collection/field-renderer.mjs +50 -89
- package/dist/client/views/collection/form-view.mjs +237 -227
- package/dist/client/views/collection/table-view.mjs +1167 -234
- package/dist/client/views/collection/view-skeletons.mjs +222 -79
- package/dist/client/views/common/global-search.mjs +29 -18
- package/dist/client/views/dashboard/dashboard-grid.mjs +678 -501
- package/dist/client/views/dashboard/dashboard-widget.mjs +6 -3
- package/dist/client/views/dashboard/widget-card.mjs +23 -14
- package/dist/client/views/globals/global-form-view.mjs +634 -589
- package/dist/client/views/layout/admin-layout-provider.mjs +67 -70
- package/dist/client/views/layout/admin-layout.d.mts +3 -6
- package/dist/client/views/layout/admin-layout.mjs +152 -155
- package/dist/client/views/layout/admin-router.mjs +936 -616
- package/dist/client/views/layout/admin-sidebar.d.mts +38 -1
- package/dist/client/views/layout/admin-sidebar.mjs +762 -592
- package/dist/client/views/layout/admin-theme.d.mts +10 -0
- package/dist/client/views/layout/admin-theme.mjs +84 -0
- package/dist/client/views/layout/admin-view-layout.mjs +161 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- package/dist/client/views/pages/accept-invite-page.mjs +49 -26
- package/dist/client/views/pages/dashboard-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
- package/dist/client/views/pages/forgot-password-page.mjs +2 -19
- package/dist/client/views/pages/invite-page.d.mts +2 -2
- package/dist/client/views/pages/invite-page.mjs +2 -19
- package/dist/client/views/pages/login-page.d.mts +3 -3
- package/dist/client/views/pages/login-page.mjs +4 -21
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.mjs +3 -20
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.mjs +70 -71
- package/dist/client.d.mts +6 -2
- package/dist/client.mjs +2 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +2 -1
- package/dist/server/augmentation/dashboard.d.mts +67 -3
- package/dist/server/augmentation/form-layout.d.mts +21 -0
- package/dist/server/augmentation/index.d.mts +1 -1
- package/dist/server/codegen/admin-client-template.mjs +4 -0
- package/dist/server/fields/blocks.d.mts +1 -1
- package/dist/server/fields/blocks.mjs +12 -0
- package/dist/server/fields/rich-text.d.mts +1 -1
- package/dist/server/fields/rich-text.mjs +8 -0
- package/dist/server/i18n/index.mjs +29 -7
- package/dist/server/i18n/messages/cs.mjs +414 -1
- package/dist/server/i18n/messages/de.mjs +412 -1
- package/dist/server/i18n/messages/en.mjs +166 -1
- package/dist/server/i18n/messages/es.mjs +412 -1
- package/dist/server/i18n/messages/fr.mjs +412 -1
- package/dist/server/i18n/messages/pl.mjs +416 -1
- package/dist/server/i18n/messages/pt.mjs +409 -1
- package/dist/server/i18n/messages/sk.mjs +216 -2
- package/dist/server/modules/admin/block/introspection.mjs +4 -1
- package/dist/server/modules/admin/block/prefetch.mjs +12 -2
- package/dist/server/modules/admin/collections/account.d.mts +2 -2
- package/dist/server/modules/admin/collections/admin-locks.d.mts +2 -2
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
- package/dist/server/modules/admin/collections/apikey.d.mts +42 -42
- package/dist/server/modules/admin/collections/assets.d.mts +20 -20
- package/dist/server/modules/admin/collections/assets.mjs +0 -1
- package/dist/server/modules/admin/collections/session.d.mts +42 -42
- package/dist/server/modules/admin/collections/user.d.mts +40 -28
- package/dist/server/modules/admin/collections/user.mjs +40 -9
- package/dist/server/modules/admin/collections/verification.d.mts +36 -36
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +2 -0
- package/dist/server/modules/admin/factories.mjs +7 -18
- package/dist/server/modules/admin/index.d.mts +1 -1
- package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
- package/dist/server/modules/admin/routes/admin-config.mjs +34 -16
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +67 -28
- package/dist/server/modules/admin/routes/i18n-helpers.mjs +34 -0
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/preview.mjs +25 -17
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/route-helpers.mjs +1 -1
- package/dist/server/modules/admin/routes/setup.d.mts +10 -10
- package/dist/server/modules/admin/routes/setup.mjs +16 -13
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/translations.mjs +5 -1
- package/dist/server/modules/admin-preferences/collections/admin-preferences.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +2 -2
- package/dist/server/modules/audit/.generated/module.d.mts +1 -1
- package/dist/server/modules/audit/.generated/module.mjs +1 -1
- package/dist/server/modules/audit/collections/audit-log.d.mts +2 -2
- package/dist/server/modules/audit/collections/audit-log.mjs +1 -1
- package/dist/server/modules/audit/config/app.mjs +99 -42
- package/dist/server/modules/audit/jobs/audit-cleanup.mjs +1 -1
- package/dist/server/plugin.mjs +4 -2
- package/dist/server/proxy-factories.d.mts +4 -3
- package/dist/server/proxy-factories.mjs +34 -8
- package/dist/shared/types/saved-views.types.d.mts +2 -0
- package/package.json +6 -4
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +0 -85
- package/dist/client/components/ui/spinner.mjs +0 -52
- package/dist/client/components/ui/toolbar.mjs +0 -136
- package/dist/client/contexts/breadcrumb-context.mjs +0 -60
- package/dist/client/views/layout/admin-topbar.mjs +0 -236
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { useResolveText } from "../../i18n/hooks.mjs";
|
|
1
|
+
import { useResolveText, useTranslation } from "../../i18n/hooks.mjs";
|
|
2
2
|
import { cn } from "../../lib/utils.mjs";
|
|
3
3
|
import { selectClient, useAdminStore } from "../../runtime/provider.mjs";
|
|
4
4
|
import { resolveIconElement } from "../component-renderer.mjs";
|
|
5
5
|
import { WidgetCard } from "../../views/dashboard/widget-card.mjs";
|
|
6
6
|
import { useServerWidgetData } from "../../hooks/use-server-widget-data.mjs";
|
|
7
|
+
import { WidgetEmptyState } from "./widget-empty-state.mjs";
|
|
7
8
|
import { TimelineWidgetSkeleton } from "./widget-skeletons.mjs";
|
|
8
9
|
import { c } from "react/compiler-runtime";
|
|
9
10
|
import { Icon } from "@iconify/react";
|
|
@@ -27,11 +28,14 @@ const variantStyles = {
|
|
|
27
28
|
/**
|
|
28
29
|
* Format timestamp based on format option
|
|
29
30
|
*/
|
|
30
|
-
function formatTimestamp(date, format = "relative") {
|
|
31
|
+
function formatTimestamp(date, format = "relative", t, formatDate) {
|
|
31
32
|
const d = typeof date === "string" ? new Date(date) : date;
|
|
32
33
|
switch (format) {
|
|
33
|
-
case "absolute": return d
|
|
34
|
-
case "datetime": return d
|
|
34
|
+
case "absolute": return formatDate(d);
|
|
35
|
+
case "datetime": return formatDate(d, {
|
|
36
|
+
dateStyle: "medium",
|
|
37
|
+
timeStyle: "short"
|
|
38
|
+
});
|
|
35
39
|
case "relative":
|
|
36
40
|
default: {
|
|
37
41
|
const diff = (/* @__PURE__ */ new Date()).getTime() - d.getTime();
|
|
@@ -39,11 +43,11 @@ function formatTimestamp(date, format = "relative") {
|
|
|
39
43
|
const minutes = Math.floor(seconds / 60);
|
|
40
44
|
const hours = Math.floor(minutes / 60);
|
|
41
45
|
const days = Math.floor(hours / 24);
|
|
42
|
-
if (days > 7) return d
|
|
43
|
-
if (days > 0) return
|
|
44
|
-
if (hours > 0) return
|
|
45
|
-
if (minutes > 0) return
|
|
46
|
-
return "
|
|
46
|
+
if (days > 7) return formatDate(d);
|
|
47
|
+
if (days > 0) return t("time.daysAgoShort", { count: days });
|
|
48
|
+
if (hours > 0) return t("time.hoursAgoShort", { count: hours });
|
|
49
|
+
if (minutes > 0) return t("time.minutesAgoShort", { count: minutes });
|
|
50
|
+
return t("time.justNow");
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
}
|
|
@@ -77,10 +81,11 @@ function formatTimestamp(date, format = "relative") {
|
|
|
77
81
|
* ```
|
|
78
82
|
*/
|
|
79
83
|
function TimelineWidget(t0) {
|
|
80
|
-
const $ = c(
|
|
84
|
+
const $ = c(64);
|
|
81
85
|
const { config, navigate } = t0;
|
|
82
86
|
const client = useAdminStore(selectClient);
|
|
83
87
|
const resolveText = useResolveText();
|
|
88
|
+
const { t, formatDate } = useTranslation();
|
|
84
89
|
const { maxItems: t1, showTimestamps: t2, timestampFormat: t3, emptyMessage } = config;
|
|
85
90
|
const maxItems = t1 === void 0 ? 10 : t1;
|
|
86
91
|
const showTimestamps = t2 === void 0 ? true : t2;
|
|
@@ -130,48 +135,62 @@ function TimelineWidget(t0) {
|
|
|
130
135
|
$[12] = t8;
|
|
131
136
|
} else t8 = $[12];
|
|
132
137
|
const clientQuery = useQuery(t8);
|
|
133
|
-
const { data, isLoading, error, refetch } = useServerData ? serverQuery : clientQuery;
|
|
138
|
+
const { data, isLoading, error, refetch, isFetching } = useServerData ? serverQuery : clientQuery;
|
|
134
139
|
let t9;
|
|
135
140
|
let title;
|
|
136
|
-
if ($[13] !== config.title || $[14] !== data || $[15] !== emptyMessage || $[16] !==
|
|
141
|
+
if ($[13] !== config.title || $[14] !== data || $[15] !== emptyMessage || $[16] !== formatDate || $[17] !== maxItems || $[18] !== navigate || $[19] !== resolveText || $[20] !== showTimestamps || $[21] !== t || $[22] !== timestampFormat) {
|
|
137
142
|
const items = data?.slice(0, maxItems) ?? [];
|
|
138
143
|
let t10$1;
|
|
139
|
-
if ($[
|
|
144
|
+
if ($[25] !== config.title || $[26] !== resolveText) {
|
|
140
145
|
t10$1 = config.title ? resolveText(config.title) : void 0;
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
} else t10$1 = $[
|
|
146
|
+
$[25] = config.title;
|
|
147
|
+
$[26] = resolveText;
|
|
148
|
+
$[27] = t10$1;
|
|
149
|
+
} else t10$1 = $[27];
|
|
145
150
|
title = t10$1;
|
|
146
151
|
let t11$1;
|
|
147
|
-
if ($[
|
|
152
|
+
if ($[28] !== navigate) {
|
|
148
153
|
t11$1 = (item) => {
|
|
149
154
|
if (item.href && navigate) navigate(item.href);
|
|
150
155
|
};
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
} else t11$1 = $[
|
|
156
|
+
$[28] = navigate;
|
|
157
|
+
$[29] = t11$1;
|
|
158
|
+
} else t11$1 = $[29];
|
|
154
159
|
const handleItemClick = t11$1;
|
|
155
160
|
let t12$1;
|
|
156
|
-
if ($[
|
|
157
|
-
t12$1 = emptyMessage ? resolveText(emptyMessage) :
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
} else t12$1 = $[
|
|
161
|
+
if ($[30] !== emptyMessage || $[31] !== resolveText) {
|
|
162
|
+
t12$1 = emptyMessage ? resolveText(emptyMessage) : void 0;
|
|
163
|
+
$[30] = emptyMessage;
|
|
164
|
+
$[31] = resolveText;
|
|
165
|
+
$[32] = t12$1;
|
|
166
|
+
} else t12$1 = $[32];
|
|
167
|
+
const resolvedEmptyMessage = t12$1;
|
|
162
168
|
let t13$1;
|
|
163
|
-
if ($[
|
|
164
|
-
t13$1 =
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
if ($[33] !== resolvedEmptyMessage || $[34] !== t) {
|
|
170
|
+
t13$1 = resolvedEmptyMessage ?? t("widget.timeline.emptyTitle");
|
|
171
|
+
$[33] = resolvedEmptyMessage;
|
|
172
|
+
$[34] = t;
|
|
173
|
+
$[35] = t13$1;
|
|
174
|
+
} else t13$1 = $[35];
|
|
175
|
+
let t14$1;
|
|
176
|
+
if ($[36] !== resolvedEmptyMessage || $[37] !== t) {
|
|
177
|
+
t14$1 = resolvedEmptyMessage ? void 0 : t("widget.timeline.emptyDescription");
|
|
178
|
+
$[36] = resolvedEmptyMessage;
|
|
179
|
+
$[37] = t;
|
|
180
|
+
$[38] = t14$1;
|
|
181
|
+
} else t14$1 = $[38];
|
|
182
|
+
let t15$1;
|
|
183
|
+
if ($[39] !== t13$1 || $[40] !== t14$1) {
|
|
184
|
+
t15$1 = /* @__PURE__ */ jsx(WidgetEmptyState, {
|
|
185
|
+
iconName: "ph:clock-counter-clockwise",
|
|
186
|
+
title: t13$1,
|
|
187
|
+
description: t14$1
|
|
170
188
|
});
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
|
|
174
|
-
|
|
189
|
+
$[39] = t13$1;
|
|
190
|
+
$[40] = t14$1;
|
|
191
|
+
$[41] = t15$1;
|
|
192
|
+
} else t15$1 = $[41];
|
|
193
|
+
const emptyContent = t15$1;
|
|
175
194
|
t9 = items.length === 0 ? emptyContent : /* @__PURE__ */ jsx("div", {
|
|
176
195
|
className: "space-y-0",
|
|
177
196
|
children: items.map((item_0, index) => {
|
|
@@ -201,7 +220,7 @@ function TimelineWidget(t0) {
|
|
|
201
220
|
}),
|
|
202
221
|
showTimestamps && item_0.timestamp && /* @__PURE__ */ jsx("p", {
|
|
203
222
|
className: "text-muted-foreground mt-1 text-xs",
|
|
204
|
-
children: formatTimestamp(item_0.timestamp, timestampFormat)
|
|
223
|
+
children: formatTimestamp(item_0.timestamp, timestampFormat, t, formatDate)
|
|
205
224
|
})
|
|
206
225
|
]
|
|
207
226
|
})
|
|
@@ -224,55 +243,77 @@ function TimelineWidget(t0) {
|
|
|
224
243
|
$[13] = config.title;
|
|
225
244
|
$[14] = data;
|
|
226
245
|
$[15] = emptyMessage;
|
|
227
|
-
$[16] =
|
|
228
|
-
$[17] =
|
|
229
|
-
$[18] =
|
|
230
|
-
$[19] =
|
|
231
|
-
$[20] =
|
|
232
|
-
$[21] =
|
|
233
|
-
$[22] =
|
|
246
|
+
$[16] = formatDate;
|
|
247
|
+
$[17] = maxItems;
|
|
248
|
+
$[18] = navigate;
|
|
249
|
+
$[19] = resolveText;
|
|
250
|
+
$[20] = showTimestamps;
|
|
251
|
+
$[21] = t;
|
|
252
|
+
$[22] = timestampFormat;
|
|
253
|
+
$[23] = t9;
|
|
254
|
+
$[24] = title;
|
|
234
255
|
} else {
|
|
235
|
-
t9 = $[
|
|
236
|
-
title = $[
|
|
256
|
+
t9 = $[23];
|
|
257
|
+
title = $[24];
|
|
237
258
|
}
|
|
238
259
|
const timelineContent = t9;
|
|
239
260
|
let t10;
|
|
240
|
-
if ($[
|
|
241
|
-
t10 =
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
t11 = error instanceof Error ? error : error ? new Error(String(error)) : null;
|
|
248
|
-
$[35] = error;
|
|
249
|
-
$[36] = t11;
|
|
250
|
-
} else t11 = $[36];
|
|
261
|
+
if ($[42] !== config.description || $[43] !== resolveText) {
|
|
262
|
+
t10 = config.description ? resolveText(config.description) : void 0;
|
|
263
|
+
$[42] = config.description;
|
|
264
|
+
$[43] = resolveText;
|
|
265
|
+
$[44] = t10;
|
|
266
|
+
} else t10 = $[44];
|
|
267
|
+
const t11 = isFetching && !isLoading;
|
|
251
268
|
let t12;
|
|
252
|
-
if ($[
|
|
253
|
-
t12 = (
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
} else t12 = $[
|
|
269
|
+
if ($[45] !== maxItems) {
|
|
270
|
+
t12 = /* @__PURE__ */ jsx(TimelineWidgetSkeleton, { count: maxItems });
|
|
271
|
+
$[45] = maxItems;
|
|
272
|
+
$[46] = t12;
|
|
273
|
+
} else t12 = $[46];
|
|
257
274
|
let t13;
|
|
258
|
-
if ($[
|
|
259
|
-
t13 =
|
|
275
|
+
if ($[47] !== error) {
|
|
276
|
+
t13 = error instanceof Error ? error : error ? new Error(String(error)) : null;
|
|
277
|
+
$[47] = error;
|
|
278
|
+
$[48] = t13;
|
|
279
|
+
} else t13 = $[48];
|
|
280
|
+
let t14;
|
|
281
|
+
if ($[49] !== refetch) {
|
|
282
|
+
t14 = () => refetch();
|
|
283
|
+
$[49] = refetch;
|
|
284
|
+
$[50] = t14;
|
|
285
|
+
} else t14 = $[50];
|
|
286
|
+
let t15;
|
|
287
|
+
if ($[51] !== config.actions || $[52] !== config.cardVariant || $[53] !== config.className || $[54] !== config.icon || $[55] !== isLoading || $[56] !== t10 || $[57] !== t11 || $[58] !== t12 || $[59] !== t13 || $[60] !== t14 || $[61] !== timelineContent || $[62] !== title) {
|
|
288
|
+
t15 = /* @__PURE__ */ jsx(WidgetCard, {
|
|
260
289
|
title,
|
|
290
|
+
description: t10,
|
|
291
|
+
icon: config.icon,
|
|
292
|
+
variant: config.cardVariant,
|
|
261
293
|
isLoading,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
294
|
+
isRefreshing: t11,
|
|
295
|
+
loadingSkeleton: t12,
|
|
296
|
+
error: t13,
|
|
297
|
+
onRefresh: t14,
|
|
298
|
+
actions: config.actions,
|
|
299
|
+
className: config.className,
|
|
265
300
|
children: timelineContent
|
|
266
301
|
});
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
|
|
275
|
-
|
|
302
|
+
$[51] = config.actions;
|
|
303
|
+
$[52] = config.cardVariant;
|
|
304
|
+
$[53] = config.className;
|
|
305
|
+
$[54] = config.icon;
|
|
306
|
+
$[55] = isLoading;
|
|
307
|
+
$[56] = t10;
|
|
308
|
+
$[57] = t11;
|
|
309
|
+
$[58] = t12;
|
|
310
|
+
$[59] = t13;
|
|
311
|
+
$[60] = t14;
|
|
312
|
+
$[61] = timelineContent;
|
|
313
|
+
$[62] = title;
|
|
314
|
+
$[63] = t15;
|
|
315
|
+
} else t15 = $[63];
|
|
316
|
+
return t15;
|
|
276
317
|
}
|
|
277
318
|
|
|
278
319
|
//#endregion
|