@questpie/admin 3.5.3 → 3.5.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 +8 -0
- package/dist/client/blocks/block-renderer.d.mts +2 -2
- package/dist/client/builder/index.d.mts +1 -1
- package/dist/client/builder/types/collection-types.d.mts +80 -5
- package/dist/client/builder/types/common.d.mts +5 -0
- package/dist/client/builder/types/field-types.d.mts +41 -1
- package/dist/client/builder/view/view.d.mts +3 -2
- package/dist/client/components/admin-link.d.mts +2 -2
- package/dist/client/components/fields/boolean-field.mjs +2 -1
- package/dist/client/components/fields/date-field.mjs +2 -1
- package/dist/client/components/fields/datetime-field.mjs +2 -1
- package/dist/client/components/fields/email-field.mjs +2 -1
- package/dist/client/components/fields/field-utils.d.mts +11 -0
- package/dist/client/components/fields/field-utils.mjs +3 -1
- package/dist/client/components/fields/field-wrapper.mjs +3 -3
- package/dist/client/components/fields/number-field.mjs +2 -1
- package/dist/client/components/fields/object-field.mjs +2 -1
- package/dist/client/components/fields/relation/displays/types.mjs +3 -3
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +2 -1
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +6 -2
- package/dist/client/components/fields/rich-text-editor/image-upload.mjs +2 -1
- package/dist/client/components/fields/rich-text-editor/index.d.mts +3 -2
- package/dist/client/components/fields/rich-text-editor/index.mjs +4 -3
- package/dist/client/components/fields/select-field.mjs +2 -1
- package/dist/client/components/fields/text-field.mjs +2 -1
- package/dist/client/components/fields/textarea-field.mjs +2 -1
- package/dist/client/components/fields/time-field.mjs +2 -1
- package/dist/client/components/layout/field-layout-renderer.mjs +4 -4
- package/dist/client/components/media/media-grid.mjs +2 -1
- package/dist/client/components/primitives/asset-preview.mjs +4 -2
- package/dist/client/components/primitives/dropzone.d.mts +100 -0
- package/dist/client/components/primitives/field-select-control.mjs +2 -1
- package/dist/client/components/ui/button.d.mts +23 -0
- package/dist/client/components/ui/button.mjs +2 -2
- package/dist/client/components/ui/dropdown-menu.d.mts +49 -0
- package/dist/client/components/ui/dropdown-menu.mjs +22 -1
- package/dist/client/components/ui/popover.mjs +1 -1
- package/dist/client/components/ui/search-input.d.mts +56 -0
- package/dist/client/components/ui/select.mjs +2 -2
- package/dist/client/components/ui/sheet.d.mts +40 -0
- package/dist/client/components/ui/table.d.mts +49 -0
- package/dist/client/components/ui/table.mjs +15 -1
- package/dist/client/components/ui/tooltip.d.mts +21 -0
- package/dist/client/contexts/focus-context.d.mts +2 -2
- package/dist/client/hooks/use-admin-config.mjs +20 -1
- package/dist/client/hooks/use-autosave.mjs +91 -0
- package/dist/client/hooks/use-collection.mjs +65 -23
- package/dist/client/hooks/use-upload.d.mts +40 -0
- package/dist/client/hooks/use-upload.mjs +4 -2
- package/dist/client/i18n/hooks.d.mts +20 -0
- package/dist/client/lib/utils.d.mts +6 -0
- 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-field.d.mts +4 -4
- package/dist/client/runtime/provider.mjs +22 -3
- package/dist/client/scope/picker.d.mts +2 -2
- package/dist/client/scope/provider.d.mts +2 -2
- package/dist/client/styles/base.css +22 -18
- package/dist/client/utils/asset-url.mjs +27 -0
- package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
- package/dist/client/views/auth/auth-layout.d.mts +3 -3
- package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
- package/dist/client/views/auth/login-form.d.mts +2 -2
- package/dist/client/views/auth/reset-password-form.d.mts +2 -2
- package/dist/client/views/auth/setup-form.d.mts +2 -2
- package/dist/client/views/collection/auto-form-fields.mjs +4 -4
- package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +7 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +3 -2
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +3 -2
- package/dist/client/views/collection/cells/upload-cells.mjs +2 -1
- package/dist/client/views/collection/document-view.d.mts +30 -0
- package/dist/client/views/collection/document-view.mjs +377 -0
- package/dist/client/views/collection/field-context.mjs +3 -2
- package/dist/client/views/collection/field-renderer.mjs +2 -2
- package/dist/client/views/collection/form-view.mjs +14 -80
- package/dist/client/views/collection/list-view.mjs +19 -15
- package/dist/client/views/collection/table-view.mjs +1 -1
- package/dist/client/views/layout/admin-layout-provider.mjs +4 -3
- package/dist/client/views/layout/admin-layout.mjs +107 -20
- package/dist/client/views/layout/admin-router.mjs +19 -3
- package/dist/client/views/layout/admin-sidebar.mjs +50 -6
- package/dist/client/views/layout/admin-view-layout.d.mts +36 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
- 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/invite-page.d.mts +2 -2
- package/dist/client/views/pages/login-page.d.mts +2 -2
- package/dist/client/views/pages/reset-password-page.d.mts +2 -2
- package/dist/client/views/pages/setup-page.d.mts +2 -2
- package/dist/client.d.mts +17 -2
- package/dist/client.mjs +16 -1
- package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
- package/dist/factories.d.mts +2 -2
- package/dist/factories.mjs +2 -2
- package/dist/index.d.mts +17 -3
- package/dist/index.mjs +16 -1
- package/dist/server/augmentation/actions.d.mts +5 -0
- package/dist/server/augmentation/form-layout.d.mts +5 -0
- package/dist/server/augmentation/views.d.mts +4 -1
- package/dist/server/fields/blocks.mjs +4 -1
- package/dist/server/fields/reactive-runtime.mjs +3 -0
- package/dist/server/modules/admin/.generated/module.d.mts +1 -1
- package/dist/server/modules/admin/auth-helpers.mjs +7 -1
- package/dist/server/modules/admin/block/introspection.mjs +28 -4
- package/dist/server/modules/admin/block/prefetch.d.mts +11 -0
- package/dist/server/modules/admin/block/prefetch.mjs +108 -27
- package/dist/server/modules/admin/client/.generated/module.d.mts +68 -67
- package/dist/server/modules/admin/client/.generated/module.mjs +2 -0
- package/dist/server/modules/admin/client/views/collection-document.d.mts +6 -0
- package/dist/server/modules/admin/client/views/collection-document.mjs +10 -0
- package/dist/server/modules/admin/collections/account.d.mts +46 -46
- package/dist/server/modules/admin/collections/admin-locks.d.mts +57 -57
- package/dist/server/modules/admin/collections/admin-preferences.d.mts +42 -42
- package/dist/server/modules/admin/collections/admin-saved-views.d.mts +50 -50
- package/dist/server/modules/admin/collections/apikey.d.mts +79 -71
- package/dist/server/modules/admin/collections/assets.d.mts +42 -42
- package/dist/server/modules/admin/collections/session.d.mts +45 -45
- package/dist/server/modules/admin/collections/user.d.mts +66 -66
- package/dist/server/modules/admin/collections/verification.d.mts +39 -39
- package/dist/server/modules/admin/dto/admin-config.dto.mjs +34 -4
- package/dist/server/modules/admin/factories.mjs +4 -34
- package/dist/server/modules/admin/routes/admin-config.d.mts +3 -2
- package/dist/server/modules/admin/routes/admin-config.mjs +18 -2
- package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
- package/dist/server/modules/admin/routes/execute-action.mjs +10 -4
- package/dist/server/modules/admin/routes/locales.d.mts +2 -2
- package/dist/server/modules/admin/routes/locales.mjs +1 -1
- package/dist/server/modules/admin/routes/preview.d.mts +11 -11
- package/dist/server/modules/admin/routes/preview.mjs +6 -5
- package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
- package/dist/server/modules/admin/routes/reactive.mjs +2 -2
- package/dist/server/modules/admin/routes/route-helpers.mjs +1 -1
- package/dist/server/modules/admin/routes/setup.d.mts +7 -7
- package/dist/server/modules/admin/routes/translations.d.mts +4 -4
- package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
- package/dist/server/modules/admin/routes/widget-data.mjs +1 -1
- package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
- package/dist/server/plugin.mjs +8 -3
- package/dist/server/proxy-factories.d.mts +8 -1
- package/dist/server/proxy-factories.mjs +33 -1
- package/package.json +4 -4
package/dist/client.d.mts
CHANGED
|
@@ -10,13 +10,26 @@ import { Admin, AppAdmin, InferAdminCMS } from "./client/builder/admin.mjs";
|
|
|
10
10
|
import { createAdminClient } from "./client/create-admin-client.mjs";
|
|
11
11
|
import { TypedHooks, createTypedHooks } from "./client/hooks/typed-hooks.mjs";
|
|
12
12
|
import { createAdminAuthClient, useAuthClient } from "./client/hooks/use-auth.mjs";
|
|
13
|
-
import { ComponentRegistry, FieldComponentProps, FormViewConfig } from "./client/builder/types/field-types.mjs";
|
|
13
|
+
import { ComponentRegistry, DocumentViewConfig, FieldComponentProps, FormViewConfig } from "./client/builder/types/field-types.mjs";
|
|
14
14
|
import { BrandLogoConfig, BrandingConfig } from "./client/types/admin-config.mjs";
|
|
15
15
|
import { AdminProvider, AdminProviderProps, AdminState, AdminStore, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore } from "./client/runtime/provider.mjs";
|
|
16
16
|
import { useShallow } from "./client/runtime/index.mjs";
|
|
17
17
|
import { AdminSidebarBrandProps, AdminSidebarNavItemProps } from "./client/views/layout/admin-sidebar.mjs";
|
|
18
18
|
import { AdminLayout, AdminShellRailProps } from "./client/views/layout/admin-layout.mjs";
|
|
19
19
|
import { AdminLayoutProvider } from "./client/views/layout/admin-layout-provider.mjs";
|
|
20
|
+
import { AdminViewHeader, AdminViewLayout } from "./client/views/layout/admin-view-layout.mjs";
|
|
21
|
+
import { DocumentView } from "./client/views/collection/document-view.mjs";
|
|
22
|
+
import { getFileIcon } from "./client/views/collection/cells/shared/asset-thumbnail.mjs";
|
|
23
|
+
import { SearchInput } from "./client/components/ui/search-input.mjs";
|
|
24
|
+
import { Button } from "./client/components/ui/button.mjs";
|
|
25
|
+
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./client/components/ui/table.mjs";
|
|
26
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./client/components/ui/tooltip.mjs";
|
|
27
|
+
import { Dropzone } from "./client/components/primitives/dropzone.mjs";
|
|
28
|
+
import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle } from "./client/components/ui/sheet.mjs";
|
|
29
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "./client/components/ui/dropdown-menu.mjs";
|
|
30
|
+
import { sanitizeFilename } from "./client/components/fields/field-utils.mjs";
|
|
31
|
+
import { cn } from "./client/lib/utils.mjs";
|
|
32
|
+
import { useResolveText } from "./client/i18n/hooks.mjs";
|
|
20
33
|
import { AdminRouter, AdminRouterProps } from "./client/views/layout/admin-router.mjs";
|
|
21
34
|
import { BlockCategory, BlockContent, BlockNode, BlockRendererProps as BlockRendererProps$1, EMPTY_BLOCK_CONTENT, isBlockContent } from "./client/blocks/types.mjs";
|
|
22
35
|
import { BlockRenderer, BlockRendererProps } from "./client/blocks/block-renderer.mjs";
|
|
@@ -48,6 +61,7 @@ import { LoginPage } from "./client/views/pages/login-page.mjs";
|
|
|
48
61
|
import { ResetPasswordPage } from "./client/views/pages/reset-password-page.mjs";
|
|
49
62
|
import { SetupPage, SetupPageProps } from "./client/views/pages/setup-page.mjs";
|
|
50
63
|
import { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions } from "./client/hooks/use-collection.mjs";
|
|
64
|
+
import { Asset, useUpload } from "./client/hooks/use-upload.mjs";
|
|
51
65
|
import { useCurrentUser } from "./client/hooks/use-current-user.mjs";
|
|
52
66
|
import { BrandSnapshot, useBrand, useBrandSnapshotRef } from "./client/hooks/use-brand.mjs";
|
|
53
67
|
import { OptionItem, UseFieldOptionsOptions, UseFieldOptionsResult, useFieldOptions } from "./client/hooks/use-field-options.mjs";
|
|
@@ -68,6 +82,7 @@ import { ScopeContextValue, ScopeOption, ScopePickerProps, ScopeProviderProps }
|
|
|
68
82
|
import { ScopePicker } from "./client/scope/picker.mjs";
|
|
69
83
|
import { ScopeProvider, createScopedFetch, useScope, useScopeSafe, useScopedFetch } from "./client/scope/provider.mjs";
|
|
70
84
|
import "./client/scope/index.mjs";
|
|
85
|
+
import { toast } from "sonner";
|
|
71
86
|
import { QuestpieApp, QuestpieClient } from "questpie/client";
|
|
72
87
|
import { CollectionInfer } from "questpie";
|
|
73
88
|
|
|
@@ -105,4 +120,4 @@ type CollectionFieldKeys<TApp extends QuestpieApp, TCollectionName extends strin
|
|
|
105
120
|
select: infer TSelect;
|
|
106
121
|
} ? keyof TSelect : never : never : never;
|
|
107
122
|
//#endregion
|
|
108
|
-
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, type AdminProviderProps, AdminRouter, type AdminRouterProps, type AdminShellRailProps, type AdminSidebarBrandProps, type AdminSidebarNavItemProps, type AdminState, type AdminStore, type AdminToPreviewMessage, AnyQuestpieClient, type AnyWidgetConfig, type AppAdmin, AuthDefaultLogo, AuthGuard, AuthLayout, type AuthLayoutProps, AuthLoading, Badge, type BadgeProps, type BaseFieldProps, type BaseWidgetAdminMeta, type BaseWidgetConfig, type BlockCategory, type BlockClickedMessage, type BlockContent, type BlockNode, BlockRenderer, type BlockRendererProps as BlockRendererComponentProps, type BlockRendererProps$1 as BlockRendererProps, type BlockScopeContextValue, BlockScopeProvider, type BlockScopeProviderProps, type BrandLogoConfig, BrandLogoMark, type BrandLogoMarkProps, type BrandSnapshot, type BrandingConfig, type ChartWidgetConfig, CollectionFieldKeys, type CollectionFormViewProps, CollectionItem, type CollectionListViewProps, CollectionNames, type CommitMessage, type ComponentRegistry, ComponentRenderer, type ComponentRendererProps, type ComponentRendererRegistry, type CustomWidgetConfig, DashboardPage, EMPTY_BLOCK_CONTENT, type FieldClickedMessage, type FieldComponentProps, type FieldDefinition, type FieldInstance, type FieldValueEditedMessage, type FlagConfig, type FocusContextValue, type FocusFieldMessage, FocusProvider, type FocusProviderProps, type FocusState, ForgotPasswordForm, ForgotPasswordPage, type FormViewConfig, type FormViewDefinition, type FullResyncMessage, type GlobalFormViewProps, GlobalNames, type I18nContext, type I18nText, type IconComponent, IconifyIcon, type IconifyIconProps, type InferAdminCMS, type InitSnapshotMessage, InvitePage, type ListViewDefinition, LoginForm, LoginPage, type MaybeLazyComponent, type OptionItem, type PageDefinition, type PatchAppliedMessage, type PatchBatchMessage, PreviewBanner, type PreviewBannerProps, type PreviewConfig, PreviewField, type PreviewFieldProps, type PreviewPatchOp, PreviewProvider, type PreviewReadyMessage, type PreviewRefreshMessage, type PreviewToAdminMessage, type ProgressWidgetConfig, type QuickActionsWidgetConfig, type ReactiveFieldResult, type ReactiveFieldState, type RecentItemsWidgetConfig, type RefreshCompleteMessage, ResetPasswordForm, ResetPasswordPage, type ResyncRequestMessage, RichTextEditor, type RichTextEditorProps, RichTextRenderer, type RichTextStyles, type ScopeContextValue, type ScopeOption, ScopePicker, type ScopePickerProps, ScopeProvider, type ScopeProviderProps, type SelectBlockMessage, SetupForm, type SetupFormValues, SetupPage, type SetupPageProps, type SetupStatus, StandalonePreviewField, type StatsWidgetConfig, type TableWidgetConfig, type TimelineWidgetConfig, type TipTapDoc, type TipTapNode, type TypedHooks, type UseCollectionPreviewOptions, type UseCollectionPreviewResult, type UseFieldOptionsOptions, type UseFieldOptionsResult, type UseReactiveFieldsOptions, type UseReactiveFieldsResult, type ValueWidgetConfig, type ViewDefinition, type ViewKind, type WidgetComponentProps, type WidgetConfig, type WidgetDefinition, type WidgetTypeRegistry, buildValidationSchema, buildZodFromIntrospection, configureField, createAdminAuthClient, createAdminClient, createFormSchema, createIconRenderer, createScopedFetch, createTypedHooks, field, getCountryCode, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, page, parsePreviewFieldPath, resolveIconElement, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore, useAuthClient, useBlockScope, useBrand, useBrandSnapshotRef, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalRevertVersion, useGlobalUpdate, useGlobalVersions, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useScope, useScopeSafe, useScopedFetch, useSearchParamToggle, useServerWidgetData, useSetupStatus, useShallow, useSidebarSearchParam, view, widget };
|
|
123
|
+
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, type AdminProviderProps, AdminRouter, type AdminRouterProps, type AdminShellRailProps, type AdminSidebarBrandProps, type AdminSidebarNavItemProps, type AdminState, type AdminStore, type AdminToPreviewMessage, AdminViewHeader, AdminViewLayout, AnyQuestpieClient, type AnyWidgetConfig, type AppAdmin, type Asset, AuthDefaultLogo, AuthGuard, AuthLayout, type AuthLayoutProps, AuthLoading, Badge, type BadgeProps, type BaseFieldProps, type BaseWidgetAdminMeta, type BaseWidgetConfig, type BlockCategory, type BlockClickedMessage, type BlockContent, type BlockNode, BlockRenderer, type BlockRendererProps as BlockRendererComponentProps, type BlockRendererProps$1 as BlockRendererProps, type BlockScopeContextValue, BlockScopeProvider, type BlockScopeProviderProps, type BrandLogoConfig, BrandLogoMark, type BrandLogoMarkProps, type BrandSnapshot, type BrandingConfig, Button, type ChartWidgetConfig, CollectionFieldKeys, type CollectionFormViewProps, CollectionItem, type CollectionListViewProps, CollectionNames, type CommitMessage, type ComponentRegistry, ComponentRenderer, type ComponentRendererProps, type ComponentRendererRegistry, type CustomWidgetConfig, DashboardPage, DocumentView, type DocumentViewConfig, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, Dropzone, EMPTY_BLOCK_CONTENT, type FieldClickedMessage, type FieldComponentProps, type FieldDefinition, type FieldInstance, type FieldValueEditedMessage, type FlagConfig, type FocusContextValue, type FocusFieldMessage, FocusProvider, type FocusProviderProps, type FocusState, ForgotPasswordForm, ForgotPasswordPage, type FormViewConfig, type FormViewDefinition, type FullResyncMessage, type GlobalFormViewProps, GlobalNames, type I18nContext, type I18nText, type IconComponent, IconifyIcon, type IconifyIconProps, type InferAdminCMS, type InitSnapshotMessage, InvitePage, type ListViewDefinition, LoginForm, LoginPage, type MaybeLazyComponent, type OptionItem, type PageDefinition, type PatchAppliedMessage, type PatchBatchMessage, PreviewBanner, type PreviewBannerProps, type PreviewConfig, PreviewField, type PreviewFieldProps, type PreviewPatchOp, PreviewProvider, type PreviewReadyMessage, type PreviewRefreshMessage, type PreviewToAdminMessage, type ProgressWidgetConfig, type QuickActionsWidgetConfig, type ReactiveFieldResult, type ReactiveFieldState, type RecentItemsWidgetConfig, type RefreshCompleteMessage, ResetPasswordForm, ResetPasswordPage, type ResyncRequestMessage, RichTextEditor, type RichTextEditorProps, RichTextRenderer, type RichTextStyles, type ScopeContextValue, type ScopeOption, ScopePicker, type ScopePickerProps, ScopeProvider, type ScopeProviderProps, SearchInput, type SelectBlockMessage, SetupForm, type SetupFormValues, SetupPage, type SetupPageProps, type SetupStatus, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, StandalonePreviewField, type StatsWidgetConfig, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, type TableWidgetConfig, type TimelineWidgetConfig, type TipTapDoc, type TipTapNode, Tooltip, TooltipContent, TooltipTrigger, type TypedHooks, type UseCollectionPreviewOptions, type UseCollectionPreviewResult, type UseFieldOptionsOptions, type UseFieldOptionsResult, type UseReactiveFieldsOptions, type UseReactiveFieldsResult, type ValueWidgetConfig, type ViewDefinition, type ViewKind, type WidgetComponentProps, type WidgetConfig, type WidgetDefinition, type WidgetTypeRegistry, buildValidationSchema, buildZodFromIntrospection, cn, configureField, createAdminAuthClient, createAdminClient, createFormSchema, createIconRenderer, createScopedFetch, createTypedHooks, field, getCountryCode, getFileIcon, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, page, parsePreviewFieldPath, resolveIconElement, sanitizeFilename, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, toast, useAdminStore, useAuthClient, useBlockScope, useBrand, useBrandSnapshotRef, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalRevertVersion, useGlobalUpdate, useGlobalVersions, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useResolveText, useScope, useScopeSafe, useScopedFetch, useSearchParamToggle, useServerWidgetData, useSetupStatus, useShallow, useSidebarSearchParam, useUpload, view, widget };
|
package/dist/client.mjs
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { view } from "./client/builder/view/view.mjs";
|
|
2
2
|
import { Admin } from "./client/builder/admin.mjs";
|
|
3
|
+
import { useResolveText } from "./client/i18n/hooks.mjs";
|
|
4
|
+
import { cn } from "./client/lib/utils.mjs";
|
|
3
5
|
import { AdminProvider, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore } from "./client/runtime/provider.mjs";
|
|
4
6
|
import { useShallow } from "./client/runtime/index.mjs";
|
|
5
7
|
import { Badge, ComponentRenderer, IconifyIcon, createIconRenderer, isComponentReference, resolveIconElement } from "./client/components/component-renderer.mjs";
|
|
6
8
|
import { configureField, field } from "./client/builder/field/field.mjs";
|
|
9
|
+
import { Button } from "./client/components/ui/button.mjs";
|
|
7
10
|
import { getCountryCode, getFlagConfig, getFlagUrl } from "./client/utils/locale-to-flag.mjs";
|
|
11
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "./client/components/ui/dropdown-menu.mjs";
|
|
12
|
+
import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle } from "./client/components/ui/sheet.mjs";
|
|
13
|
+
import { sanitizeFilename } from "./client/components/fields/field-utils.mjs";
|
|
8
14
|
import { EMPTY_BLOCK_CONTENT, isBlockContent } from "./client/blocks/types.mjs";
|
|
15
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./client/components/ui/tooltip.mjs";
|
|
16
|
+
import { getFileIcon } from "./client/views/collection/cells/shared/asset-thumbnail.mjs";
|
|
9
17
|
import { FocusProvider, parsePreviewFieldPath, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused } from "./client/contexts/focus-context.mjs";
|
|
10
18
|
import { useIsDesktop, useIsMobile, useMediaQuery } from "./client/hooks/use-media-query.mjs";
|
|
11
19
|
import { buildValidationSchema, buildZodFromIntrospection, createFormSchema } from "./client/builder/validation.mjs";
|
|
@@ -17,7 +25,11 @@ import { useSidebarSearchParam } from "./client/hooks/use-sidebar-search-param.m
|
|
|
17
25
|
import { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions } from "./client/hooks/use-collection.mjs";
|
|
18
26
|
import { createAdminAuthClient, useAuthClient } from "./client/hooks/use-auth.mjs";
|
|
19
27
|
import { useCurrentUser } from "./client/hooks/use-current-user.mjs";
|
|
28
|
+
import { AdminViewHeader, AdminViewLayout } from "./client/views/layout/admin-view-layout.mjs";
|
|
29
|
+
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./client/components/ui/table.mjs";
|
|
20
30
|
import { AdminLink } from "./client/components/admin-link.mjs";
|
|
31
|
+
import { useUpload } from "./client/hooks/use-upload.mjs";
|
|
32
|
+
import { Dropzone } from "./client/components/primitives/dropzone.mjs";
|
|
21
33
|
import { page } from "./client/builder/page/page.mjs";
|
|
22
34
|
import { widget } from "./client/builder/widget/widget.mjs";
|
|
23
35
|
import { createAdminClient } from "./client/create-admin-client.mjs";
|
|
@@ -27,6 +39,8 @@ import { AdminLayout } from "./client/views/layout/admin-layout.mjs";
|
|
|
27
39
|
import { AuthLoading } from "./client/components/auth/auth-loading.mjs";
|
|
28
40
|
import { AuthGuard } from "./client/components/auth/auth-guard.mjs";
|
|
29
41
|
import { AdminLayoutProvider } from "./client/views/layout/admin-layout-provider.mjs";
|
|
42
|
+
import DocumentView from "./client/views/collection/document-view.mjs";
|
|
43
|
+
import { SearchInput } from "./client/components/ui/search-input.mjs";
|
|
30
44
|
import { AdminRouter } from "./client/views/layout/admin-router.mjs";
|
|
31
45
|
import { BlockScopeProvider, useBlockScope, useResolveFieldPath } from "./client/preview/block-scope-context.mjs";
|
|
32
46
|
import { BlockRenderer } from "./client/blocks/block-renderer.mjs";
|
|
@@ -54,5 +68,6 @@ import { useFieldOptions } from "./client/hooks/use-field-options.mjs";
|
|
|
54
68
|
import { useServerWidgetData } from "./client/hooks/use-server-widget-data.mjs";
|
|
55
69
|
import { ScopeProvider, createScopedFetch, useScope, useScopeSafe, useScopedFetch } from "./client/scope/provider.mjs";
|
|
56
70
|
import { ScopePicker } from "./client/scope/picker.mjs";
|
|
71
|
+
import { toast } from "sonner";
|
|
57
72
|
|
|
58
|
-
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, AdminRouter, AuthDefaultLogo, AuthGuard, AuthLayout, AuthLoading, Badge, BlockRenderer, BlockScopeProvider, BrandLogoMark, ComponentRenderer, DashboardPage, EMPTY_BLOCK_CONTENT, FocusProvider, ForgotPasswordForm, ForgotPasswordPage, IconifyIcon, InvitePage, LoginForm, LoginPage, PreviewBanner, PreviewField, PreviewProvider, ResetPasswordForm, ResetPasswordPage, RichTextEditor, RichTextRenderer, ScopePicker, ScopeProvider, SetupForm, SetupPage, StandalonePreviewField, buildValidationSchema, buildZodFromIntrospection, configureField, createAdminAuthClient, createAdminClient, createFormSchema, createIconRenderer, createScopedFetch, createTypedHooks, field, getCountryCode, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, page, parsePreviewFieldPath, resolveIconElement, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore, useAuthClient, useBlockScope, useBrand, useBrandSnapshotRef, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalRevertVersion, useGlobalUpdate, useGlobalVersions, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useScope, useScopeSafe, useScopedFetch, useSearchParamToggle, useServerWidgetData, useSetupStatus, useShallow, useSidebarSearchParam, view, widget };
|
|
73
|
+
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, AdminRouter, AdminViewHeader, AdminViewLayout, AuthDefaultLogo, AuthGuard, AuthLayout, AuthLoading, Badge, BlockRenderer, BlockScopeProvider, BrandLogoMark, Button, ComponentRenderer, DashboardPage, DocumentView, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, Dropzone, EMPTY_BLOCK_CONTENT, FocusProvider, ForgotPasswordForm, ForgotPasswordPage, IconifyIcon, InvitePage, LoginForm, LoginPage, PreviewBanner, PreviewField, PreviewProvider, ResetPasswordForm, ResetPasswordPage, RichTextEditor, RichTextRenderer, ScopePicker, ScopeProvider, SearchInput, SetupForm, SetupPage, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, StandalonePreviewField, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tooltip, TooltipContent, TooltipTrigger, buildValidationSchema, buildZodFromIntrospection, cn, configureField, createAdminAuthClient, createAdminClient, createFormSchema, createIconRenderer, createScopedFetch, createTypedHooks, field, getCountryCode, getFileIcon, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, page, parsePreviewFieldPath, resolveIconElement, sanitizeFilename, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, toast, useAdminStore, useAuthClient, useBlockScope, useBrand, useBrandSnapshotRef, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalRevertVersion, useGlobalUpdate, useGlobalVersions, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useResolveText, useScope, useScopeSafe, useScopedFetch, useSearchParamToggle, useServerWidgetData, useSetupStatus, useShallow, useSidebarSearchParam, useUpload, view, widget };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime54 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/rich-text/rich-text-renderer.d.ts
|
|
4
4
|
/**
|
|
@@ -98,6 +98,6 @@ declare function RichTextRenderer({
|
|
|
98
98
|
content,
|
|
99
99
|
styles: customStyles,
|
|
100
100
|
className
|
|
101
|
-
}: RichTextRendererProps):
|
|
101
|
+
}: RichTextRendererProps): react_jsx_runtime54.JSX.Element | null;
|
|
102
102
|
//#endregion
|
|
103
103
|
export { RichTextRenderer, RichTextStyles, TipTapDoc, TipTapNode };
|
package/dist/factories.d.mts
CHANGED
|
@@ -12,8 +12,8 @@ import { BlockSchema, getBlocksByCategory, introspectBlock, introspectBlocks } f
|
|
|
12
12
|
import { BlocksPrefetchContext, createBlocksPrefetchHook, processBlocksDocument, processDocumentBlocksPrefetch } from "./server/modules/admin/block/prefetch.mjs";
|
|
13
13
|
import "./server/block/index.mjs";
|
|
14
14
|
import { component, editView, filterViewsByKind, listView, view } from "./server/registry-helpers.mjs";
|
|
15
|
-
import { createActionCallbackProxy, createActionProxy, createComponentCallbackProxy, createComponentProxy, createDashboardCallbackContext, createDashboardContributionProxy, createFieldProxy, createSidebarCallbackContext, createSidebarContributionProxy, createViewCallbackProxy, createViewProxy, resolveDashboardCallback, resolveSidebarCallback } from "./server/proxy-factories.mjs";
|
|
15
|
+
import { createActionCallbackProxy, createActionFieldBuilderProxy, createActionProxy, createComponentCallbackProxy, createComponentProxy, createDashboardCallbackContext, createDashboardContributionProxy, createFieldProxy, createSidebarCallbackContext, createSidebarContributionProxy, createViewCallbackProxy, createViewProxy, resolveDashboardCallback, resolveSidebarCallback } from "./server/proxy-factories.mjs";
|
|
16
16
|
import { AuthSession, GetAdminSessionOptions, RequireAdminAuthOptions, getAdminSession, isAdminUser, requireAdminAuth } from "./server/modules/admin/auth-helpers.mjs";
|
|
17
17
|
import { NextAuthMiddlewareOptions, createNextAuthMiddleware, getNextAdminSession } from "./server/adapters/nextjs.mjs";
|
|
18
18
|
import { BeforeLoadContext, TanStackAuthGuardOptions, createTanStackAuthGuard, createTanStackSessionLoader } from "./server/adapters/tanstack.mjs";
|
|
19
|
-
export { type ActionReference, type ActionsConfigContext, type AdminBlockConfig, type AdminCollectionConfig, type AdminConfigContext, type AdminConfigInput, type AdminGlobalConfig, type AdminLocaleConfig, type AdminShellRailPlacement, type AdminShellRouteRules, type AnyBlockBuilder, type AnyBlockDefinition, type AuthSession, BeforeLoadContext, BlockBuilder, type BlockBuilderState, type BlockCategoryConfig, type BlockDefinition, type BlockPrefetchContext, type BlockPrefetchFn, type BlockPrefetchWith, type BlockPrefetchWithOptions, type BlockSchema, type BlocksPrefetchContext, type BuiltinActionType, type ComponentDefinition, type ComponentFactory, type ComponentReference, type ComponentType, type ComponentTypeRegistry, type DashboardActionFactory, type DashboardActionProxy, type DashboardCallback, type DashboardCallbackContext, type DashboardConfigContext, type DashboardContribution, type DashboardItemDef, type DashboardProxy, type DashboardSectionDef, type EditViewDefinition, type EditViewFactory, type ExpandWithResult, type ExpandedRecord, type FieldLayoutItem, type FilterViewsByKind, type FormFieldLayoutItem, type FormReactiveConfig, type FormReactiveContext, type FormSectionLayout, type FormSidebarConfig, type FormTabConfig, type FormTabsLayout, type FormViewConfig, type FormViewConfigContext, type GetAdminSessionOptions, type InferBlockData, type InferBlockValues, type ListViewConfig, type ListViewConfigContext, type ListViewDefinition, type ListViewFactory, NextAuthMiddlewareOptions, type PreviewConfig, type RequireAdminAuthOptions, type ServerActionContext, type ServerActionDefinition, type ServerActionDownload, type ServerActionEffects, type ServerActionError, type ServerActionForm, type ServerActionFormField, type ServerActionHandler, type ServerActionRedirect, type ServerActionResult, type ServerActionSuccess, type ServerActionsConfig, type ServerAdminShellConfig, type ServerAdminShellRailConfig, type ServerBrandingConfig, type ServerChartWidget, type ServerCustomWidget, type ServerDashboardAction, type ServerDashboardConfig, type ServerDashboardItem, type ServerDashboardSection, type ServerDashboardTab, type ServerDashboardTabs, type ServerDashboardWidget, type ServerProgressWidget, type ServerQuickAction, type ServerQuickActionsWidget, type ServerRecentItemsWidget, type ServerSidebarCollectionItem, type ServerSidebarConfig, type ServerSidebarDividerItem, type ServerSidebarGlobalItem, type ServerSidebarItem, type ServerSidebarLinkItem, type ServerSidebarPageItem, type ServerSidebarSection, type ServerStatsWidget, type ServerTableWidget, type ServerTimelineWidget, type ServerValueWidget, type SidebarCallback, type SidebarCallbackContext, type SidebarConfigContext, type SidebarContribution, type SidebarItemDef, type SidebarProxy, type SidebarSectionDef, TanStackAuthGuardOptions, type ViewDefinition, type ViewKind, type ViewKindRegistry, type WidgetAccessRule, type WidgetFetchContext, adminConfig, block, component, createActionCallbackProxy, createActionProxy, createBlocksPrefetchHook, createComponentCallbackProxy, createComponentProxy, createDashboardCallbackContext, createDashboardContributionProxy, createFieldProxy, createNextAuthMiddleware, createSidebarCallbackContext, createSidebarContributionProxy, createTanStackAuthGuard, createTanStackSessionLoader, createViewCallbackProxy, createViewProxy, editView, filterViewsByKind, getAdminSession, getBlocksByCategory, getNextAdminSession, introspectBlock, introspectBlocks, isAdminUser, listView, processBlocksDocument, processDocumentBlocksPrefetch, requireAdminAuth, resolveDashboardCallback, resolveSidebarCallback, view };
|
|
19
|
+
export { type ActionReference, type ActionsConfigContext, type AdminBlockConfig, type AdminCollectionConfig, type AdminConfigContext, type AdminConfigInput, type AdminGlobalConfig, type AdminLocaleConfig, type AdminShellRailPlacement, type AdminShellRouteRules, type AnyBlockBuilder, type AnyBlockDefinition, type AuthSession, BeforeLoadContext, BlockBuilder, type BlockBuilderState, type BlockCategoryConfig, type BlockDefinition, type BlockPrefetchContext, type BlockPrefetchFn, type BlockPrefetchWith, type BlockPrefetchWithOptions, type BlockSchema, type BlocksPrefetchContext, type BuiltinActionType, type ComponentDefinition, type ComponentFactory, type ComponentReference, type ComponentType, type ComponentTypeRegistry, type DashboardActionFactory, type DashboardActionProxy, type DashboardCallback, type DashboardCallbackContext, type DashboardConfigContext, type DashboardContribution, type DashboardItemDef, type DashboardProxy, type DashboardSectionDef, type EditViewDefinition, type EditViewFactory, type ExpandWithResult, type ExpandedRecord, type FieldLayoutItem, type FilterViewsByKind, type FormFieldLayoutItem, type FormReactiveConfig, type FormReactiveContext, type FormSectionLayout, type FormSidebarConfig, type FormTabConfig, type FormTabsLayout, type FormViewConfig, type FormViewConfigContext, type GetAdminSessionOptions, type InferBlockData, type InferBlockValues, type ListViewConfig, type ListViewConfigContext, type ListViewDefinition, type ListViewFactory, NextAuthMiddlewareOptions, type PreviewConfig, type RequireAdminAuthOptions, type ServerActionContext, type ServerActionDefinition, type ServerActionDownload, type ServerActionEffects, type ServerActionError, type ServerActionForm, type ServerActionFormField, type ServerActionHandler, type ServerActionRedirect, type ServerActionResult, type ServerActionSuccess, type ServerActionsConfig, type ServerAdminShellConfig, type ServerAdminShellRailConfig, type ServerBrandingConfig, type ServerChartWidget, type ServerCustomWidget, type ServerDashboardAction, type ServerDashboardConfig, type ServerDashboardItem, type ServerDashboardSection, type ServerDashboardTab, type ServerDashboardTabs, type ServerDashboardWidget, type ServerProgressWidget, type ServerQuickAction, type ServerQuickActionsWidget, type ServerRecentItemsWidget, type ServerSidebarCollectionItem, type ServerSidebarConfig, type ServerSidebarDividerItem, type ServerSidebarGlobalItem, type ServerSidebarItem, type ServerSidebarLinkItem, type ServerSidebarPageItem, type ServerSidebarSection, type ServerStatsWidget, type ServerTableWidget, type ServerTimelineWidget, type ServerValueWidget, type SidebarCallback, type SidebarCallbackContext, type SidebarConfigContext, type SidebarContribution, type SidebarItemDef, type SidebarProxy, type SidebarSectionDef, TanStackAuthGuardOptions, type ViewDefinition, type ViewKind, type ViewKindRegistry, type WidgetAccessRule, type WidgetFetchContext, adminConfig, block, component, createActionCallbackProxy, createActionFieldBuilderProxy, createActionProxy, createBlocksPrefetchHook, createComponentCallbackProxy, createComponentProxy, createDashboardCallbackContext, createDashboardContributionProxy, createFieldProxy, createNextAuthMiddleware, createSidebarCallbackContext, createSidebarContributionProxy, createTanStackAuthGuard, createTanStackSessionLoader, createViewCallbackProxy, createViewProxy, editView, filterViewsByKind, getAdminSession, getBlocksByCategory, getNextAdminSession, introspectBlock, introspectBlocks, isAdminUser, listView, processBlocksDocument, processDocumentBlocksPrefetch, requireAdminAuth, resolveDashboardCallback, resolveSidebarCallback, view };
|
package/dist/factories.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { adminConfig } from "./server/augmentation/index.mjs";
|
|
2
2
|
import { component, editView, filterViewsByKind, listView, view } from "./server/registry-helpers.mjs";
|
|
3
|
-
import { createActionCallbackProxy, createActionProxy, createComponentCallbackProxy, createComponentProxy, createDashboardCallbackContext, createDashboardContributionProxy, createFieldProxy, createSidebarCallbackContext, createSidebarContributionProxy, createViewCallbackProxy, createViewProxy, resolveDashboardCallback, resolveSidebarCallback } from "./server/proxy-factories.mjs";
|
|
3
|
+
import { createActionCallbackProxy, createActionFieldBuilderProxy, createActionProxy, createComponentCallbackProxy, createComponentProxy, createDashboardCallbackContext, createDashboardContributionProxy, createFieldProxy, createSidebarCallbackContext, createSidebarContributionProxy, createViewCallbackProxy, createViewProxy, resolveDashboardCallback, resolveSidebarCallback } from "./server/proxy-factories.mjs";
|
|
4
4
|
import { createBlocksPrefetchHook, processBlocksDocument, processDocumentBlocksPrefetch } from "./server/modules/admin/block/prefetch.mjs";
|
|
5
5
|
import { BlockBuilder, block } from "./server/modules/admin/block/block-builder.mjs";
|
|
6
6
|
import { getBlocksByCategory, introspectBlock, introspectBlocks } from "./server/modules/admin/block/introspection.mjs";
|
|
@@ -8,4 +8,4 @@ import { getAdminSession, isAdminUser, requireAdminAuth } from "./server/modules
|
|
|
8
8
|
import { createNextAuthMiddleware, getNextAdminSession } from "./server/adapters/nextjs.mjs";
|
|
9
9
|
import { createTanStackAuthGuard, createTanStackSessionLoader } from "./server/adapters/tanstack.mjs";
|
|
10
10
|
|
|
11
|
-
export { BlockBuilder, adminConfig, block, component, createActionCallbackProxy, createActionProxy, createBlocksPrefetchHook, createComponentCallbackProxy, createComponentProxy, createDashboardCallbackContext, createDashboardContributionProxy, createFieldProxy, createNextAuthMiddleware, createSidebarCallbackContext, createSidebarContributionProxy, createTanStackAuthGuard, createTanStackSessionLoader, createViewCallbackProxy, createViewProxy, editView, filterViewsByKind, getAdminSession, getBlocksByCategory, getNextAdminSession, introspectBlock, introspectBlocks, isAdminUser, listView, processBlocksDocument, processDocumentBlocksPrefetch, requireAdminAuth, resolveDashboardCallback, resolveSidebarCallback, view };
|
|
11
|
+
export { BlockBuilder, adminConfig, block, component, createActionCallbackProxy, createActionFieldBuilderProxy, createActionProxy, createBlocksPrefetchHook, createComponentCallbackProxy, createComponentProxy, createDashboardCallbackContext, createDashboardContributionProxy, createFieldProxy, createNextAuthMiddleware, createSidebarCallbackContext, createSidebarContributionProxy, createTanStackAuthGuard, createTanStackSessionLoader, createViewCallbackProxy, createViewProxy, editView, filterViewsByKind, getAdminSession, getBlocksByCategory, getNextAdminSession, introspectBlock, introspectBlocks, isAdminUser, listView, processBlocksDocument, processDocumentBlocksPrefetch, requireAdminAuth, resolveDashboardCallback, resolveSidebarCallback, view };
|
package/dist/index.d.mts
CHANGED
|
@@ -10,13 +10,26 @@ import { Admin, AppAdmin, InferAdminCMS } from "./client/builder/admin.mjs";
|
|
|
10
10
|
import { createAdminClient } from "./client/create-admin-client.mjs";
|
|
11
11
|
import { TypedHooks, createTypedHooks } from "./client/hooks/typed-hooks.mjs";
|
|
12
12
|
import { createAdminAuthClient, useAuthClient } from "./client/hooks/use-auth.mjs";
|
|
13
|
-
import { ComponentRegistry, FieldComponentProps, FormViewConfig } from "./client/builder/types/field-types.mjs";
|
|
13
|
+
import { ComponentRegistry, DocumentViewConfig, FieldComponentProps, FormViewConfig } from "./client/builder/types/field-types.mjs";
|
|
14
14
|
import { BrandLogoConfig, BrandingConfig } from "./client/types/admin-config.mjs";
|
|
15
15
|
import { AdminProvider, AdminProviderProps, AdminState, AdminStore, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore } from "./client/runtime/provider.mjs";
|
|
16
16
|
import { useShallow } from "./client/runtime/index.mjs";
|
|
17
17
|
import { AdminSidebarBrandProps, AdminSidebarNavItemProps } from "./client/views/layout/admin-sidebar.mjs";
|
|
18
18
|
import { AdminLayout, AdminShellRailProps } from "./client/views/layout/admin-layout.mjs";
|
|
19
19
|
import { AdminLayoutProvider } from "./client/views/layout/admin-layout-provider.mjs";
|
|
20
|
+
import { AdminViewHeader, AdminViewLayout } from "./client/views/layout/admin-view-layout.mjs";
|
|
21
|
+
import { DocumentView } from "./client/views/collection/document-view.mjs";
|
|
22
|
+
import { getFileIcon } from "./client/views/collection/cells/shared/asset-thumbnail.mjs";
|
|
23
|
+
import { SearchInput } from "./client/components/ui/search-input.mjs";
|
|
24
|
+
import { Button } from "./client/components/ui/button.mjs";
|
|
25
|
+
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./client/components/ui/table.mjs";
|
|
26
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./client/components/ui/tooltip.mjs";
|
|
27
|
+
import { Dropzone } from "./client/components/primitives/dropzone.mjs";
|
|
28
|
+
import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle } from "./client/components/ui/sheet.mjs";
|
|
29
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "./client/components/ui/dropdown-menu.mjs";
|
|
30
|
+
import { sanitizeFilename } from "./client/components/fields/field-utils.mjs";
|
|
31
|
+
import { cn } from "./client/lib/utils.mjs";
|
|
32
|
+
import { useResolveText } from "./client/i18n/hooks.mjs";
|
|
20
33
|
import { AdminRouter, AdminRouterProps } from "./client/views/layout/admin-router.mjs";
|
|
21
34
|
import { BlockCategory, BlockContent, BlockNode, BlockRendererProps as BlockRendererProps$1, EMPTY_BLOCK_CONTENT, isBlockContent } from "./client/blocks/types.mjs";
|
|
22
35
|
import { BlockRenderer, BlockRendererProps } from "./client/blocks/block-renderer.mjs";
|
|
@@ -45,6 +58,7 @@ import { LoginPage } from "./client/views/pages/login-page.mjs";
|
|
|
45
58
|
import { ResetPasswordPage } from "./client/views/pages/reset-password-page.mjs";
|
|
46
59
|
import { SetupPage, SetupPageProps } from "./client/views/pages/setup-page.mjs";
|
|
47
60
|
import { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions } from "./client/hooks/use-collection.mjs";
|
|
61
|
+
import { Asset, useUpload } from "./client/hooks/use-upload.mjs";
|
|
48
62
|
import { useCurrentUser } from "./client/hooks/use-current-user.mjs";
|
|
49
63
|
import { BrandSnapshot, useBrand, useBrandSnapshotRef } from "./client/hooks/use-brand.mjs";
|
|
50
64
|
import { OptionItem, UseFieldOptionsOptions, UseFieldOptionsResult, useFieldOptions } from "./client/hooks/use-field-options.mjs";
|
|
@@ -64,5 +78,5 @@ import { FocusContextValue, FocusProvider, FocusProviderProps, FocusState, parse
|
|
|
64
78
|
import { ScopeContextValue, ScopeOption, ScopePickerProps, ScopeProviderProps } from "./client/scope/types.mjs";
|
|
65
79
|
import { ScopePicker } from "./client/scope/picker.mjs";
|
|
66
80
|
import { ScopeProvider, createScopedFetch, useScope, useScopeSafe, useScopedFetch } from "./client/scope/provider.mjs";
|
|
67
|
-
import { AnyQuestpieClient, CollectionFieldKeys, CollectionItem, CollectionNames, GlobalNames } from "./client.mjs";
|
|
68
|
-
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, AdminProviderProps, AdminRouter, AdminRouterProps, AdminShellRailProps, AdminSidebarBrandProps, AdminSidebarNavItemProps, AdminState, AdminStore, AdminToPreviewMessage, type AnyAdminMeta, AnyQuestpieClient, AnyWidgetConfig, AppAdmin, type ArrayFieldAdminMeta, AuthDefaultLogo, AuthGuard, AuthLayout, AuthLayoutProps, AuthLoading, Badge, BadgeProps, type BaseAdminMeta, BaseFieldProps, BaseWidgetAdminMeta, BaseWidgetConfig, BlockCategory, BlockClickedMessage, BlockContent, BlockNode, BlockRenderer, BlockRendererProps as BlockRendererComponentProps, BlockRendererProps$1 as BlockRendererProps, BlockScopeContextValue, BlockScopeProvider, BlockScopeProviderProps, type BooleanFieldAdminMeta, BrandLogoConfig, BrandLogoMark, BrandLogoMarkProps, BrandSnapshot, BrandingConfig, ChartWidgetConfig, CollectionFieldKeys, CollectionFormViewProps, CollectionItem, CollectionListViewProps, CollectionNames, CommitMessage, ComponentRegistry, ComponentRenderer, ComponentRendererProps, ComponentRendererRegistry, CustomWidgetConfig, DashboardPage, type DateFieldAdminMeta, EMPTY_BLOCK_CONTENT, FieldClickedMessage, FieldComponentProps, FieldDefinition, FieldInstance, FieldValueEditedMessage, FlagConfig, FocusContextValue, FocusFieldMessage, FocusProvider, FocusProviderProps, FocusState, ForgotPasswordForm, ForgotPasswordPage, FormViewConfig, FormViewDefinition, FullResyncMessage, GlobalFormViewProps, GlobalNames, I18nContext, I18nText, IconComponent, IconifyIcon, IconifyIconProps, InferAdminCMS, InitSnapshotMessage, InvitePage, type JsonFieldAdminMeta, ListViewDefinition, LoginForm, LoginPage, MaybeLazyComponent, type NumberFieldAdminMeta, type ObjectFieldAdminMeta, OptionItem, PageDefinition, PatchAppliedMessage, PatchBatchMessage, PreviewBanner, PreviewBannerProps, PreviewConfig, PreviewField, PreviewFieldProps, PreviewPatchOp, PreviewProvider, PreviewReadyMessage, PreviewRefreshMessage, PreviewToAdminMessage, ProgressWidgetConfig, QuickActionsWidgetConfig, ReactiveFieldResult, ReactiveFieldState, RecentItemsWidgetConfig, RefreshCompleteMessage, type RelationFieldAdminMeta, ResetPasswordForm, ResetPasswordPage, ResyncRequestMessage, RichTextEditor, RichTextEditorProps, RichTextRenderer, RichTextStyles, ScopeContextValue, ScopeOption, ScopePicker, ScopePickerProps, ScopeProvider, ScopeProviderProps, SelectBlockMessage, type SelectFieldAdminMeta, SetupForm, SetupFormValues, SetupPage, SetupPageProps, SetupStatus, StandalonePreviewField, StatsWidgetConfig, TableWidgetConfig, type TextFieldAdminMeta, type TextareaFieldAdminMeta, type TimeFieldAdminMeta, TimelineWidgetConfig, TipTapDoc, TipTapNode, TypedHooks, type UploadFieldAdminMeta, UseCollectionPreviewOptions, UseCollectionPreviewResult, UseFieldOptionsOptions, UseFieldOptionsResult, UseReactiveFieldsOptions, UseReactiveFieldsResult, ValueWidgetConfig, ViewDefinition, ViewKind, WidgetComponentProps, WidgetConfig, WidgetDefinition, WidgetTypeRegistry, buildValidationSchema, buildZodFromIntrospection, configureField, createAdminAuthClient, createAdminClient, createFormSchema, createIconRenderer, createScopedFetch, createTypedHooks, field, getCountryCode, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, page, parsePreviewFieldPath, resolveIconElement, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore, useAuthClient, useBlockScope, useBrand, useBrandSnapshotRef, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalRevertVersion, useGlobalUpdate, useGlobalVersions, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useScope, useScopeSafe, useScopedFetch, useSearchParamToggle, useServerWidgetData, useSetupStatus, useShallow, useSidebarSearchParam, view, widget };
|
|
81
|
+
import { AnyQuestpieClient, CollectionFieldKeys, CollectionItem, CollectionNames, GlobalNames, toast } from "./client.mjs";
|
|
82
|
+
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, AdminProviderProps, AdminRouter, AdminRouterProps, AdminShellRailProps, AdminSidebarBrandProps, AdminSidebarNavItemProps, AdminState, AdminStore, AdminToPreviewMessage, AdminViewHeader, AdminViewLayout, type AnyAdminMeta, AnyQuestpieClient, AnyWidgetConfig, AppAdmin, type ArrayFieldAdminMeta, Asset, AuthDefaultLogo, AuthGuard, AuthLayout, AuthLayoutProps, AuthLoading, Badge, BadgeProps, type BaseAdminMeta, BaseFieldProps, BaseWidgetAdminMeta, BaseWidgetConfig, BlockCategory, BlockClickedMessage, BlockContent, BlockNode, BlockRenderer, BlockRendererProps as BlockRendererComponentProps, BlockRendererProps$1 as BlockRendererProps, BlockScopeContextValue, BlockScopeProvider, BlockScopeProviderProps, type BooleanFieldAdminMeta, BrandLogoConfig, BrandLogoMark, BrandLogoMarkProps, BrandSnapshot, BrandingConfig, Button, ChartWidgetConfig, CollectionFieldKeys, CollectionFormViewProps, CollectionItem, CollectionListViewProps, CollectionNames, CommitMessage, ComponentRegistry, ComponentRenderer, ComponentRendererProps, ComponentRendererRegistry, CustomWidgetConfig, DashboardPage, type DateFieldAdminMeta, DocumentView, DocumentViewConfig, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, Dropzone, EMPTY_BLOCK_CONTENT, FieldClickedMessage, FieldComponentProps, FieldDefinition, FieldInstance, FieldValueEditedMessage, FlagConfig, FocusContextValue, FocusFieldMessage, FocusProvider, FocusProviderProps, FocusState, ForgotPasswordForm, ForgotPasswordPage, FormViewConfig, FormViewDefinition, FullResyncMessage, GlobalFormViewProps, GlobalNames, I18nContext, I18nText, IconComponent, IconifyIcon, IconifyIconProps, InferAdminCMS, InitSnapshotMessage, InvitePage, type JsonFieldAdminMeta, ListViewDefinition, LoginForm, LoginPage, MaybeLazyComponent, type NumberFieldAdminMeta, type ObjectFieldAdminMeta, OptionItem, PageDefinition, PatchAppliedMessage, PatchBatchMessage, PreviewBanner, PreviewBannerProps, PreviewConfig, PreviewField, PreviewFieldProps, PreviewPatchOp, PreviewProvider, PreviewReadyMessage, PreviewRefreshMessage, PreviewToAdminMessage, ProgressWidgetConfig, QuickActionsWidgetConfig, ReactiveFieldResult, ReactiveFieldState, RecentItemsWidgetConfig, RefreshCompleteMessage, type RelationFieldAdminMeta, ResetPasswordForm, ResetPasswordPage, ResyncRequestMessage, RichTextEditor, RichTextEditorProps, RichTextRenderer, RichTextStyles, ScopeContextValue, ScopeOption, ScopePicker, ScopePickerProps, ScopeProvider, ScopeProviderProps, SearchInput, SelectBlockMessage, type SelectFieldAdminMeta, SetupForm, SetupFormValues, SetupPage, SetupPageProps, SetupStatus, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, StandalonePreviewField, StatsWidgetConfig, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TableWidgetConfig, type TextFieldAdminMeta, type TextareaFieldAdminMeta, type TimeFieldAdminMeta, TimelineWidgetConfig, TipTapDoc, TipTapNode, Tooltip, TooltipContent, TooltipTrigger, TypedHooks, type UploadFieldAdminMeta, UseCollectionPreviewOptions, UseCollectionPreviewResult, UseFieldOptionsOptions, UseFieldOptionsResult, UseReactiveFieldsOptions, UseReactiveFieldsResult, ValueWidgetConfig, ViewDefinition, ViewKind, WidgetComponentProps, WidgetConfig, WidgetDefinition, WidgetTypeRegistry, buildValidationSchema, buildZodFromIntrospection, cn, configureField, createAdminAuthClient, createAdminClient, createFormSchema, createIconRenderer, createScopedFetch, createTypedHooks, field, getCountryCode, getFileIcon, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, page, parsePreviewFieldPath, resolveIconElement, sanitizeFilename, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, toast, useAdminStore, useAuthClient, useBlockScope, useBrand, useBrandSnapshotRef, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalRevertVersion, useGlobalUpdate, useGlobalVersions, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useResolveText, useScope, useScopeSafe, useScopedFetch, useSearchParamToggle, useServerWidgetData, useSetupStatus, useShallow, useSidebarSearchParam, useUpload, view, widget };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { view } from "./client/builder/view/view.mjs";
|
|
2
2
|
import { Admin } from "./client/builder/admin.mjs";
|
|
3
|
+
import { useResolveText } from "./client/i18n/hooks.mjs";
|
|
4
|
+
import { cn } from "./client/lib/utils.mjs";
|
|
3
5
|
import { AdminProvider, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore } from "./client/runtime/provider.mjs";
|
|
4
6
|
import { useShallow } from "./client/runtime/index.mjs";
|
|
5
7
|
import { Badge, ComponentRenderer, IconifyIcon, createIconRenderer, isComponentReference, resolveIconElement } from "./client/components/component-renderer.mjs";
|
|
6
8
|
import { configureField, field } from "./client/builder/field/field.mjs";
|
|
9
|
+
import { Button } from "./client/components/ui/button.mjs";
|
|
7
10
|
import { getCountryCode, getFlagConfig, getFlagUrl } from "./client/utils/locale-to-flag.mjs";
|
|
11
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "./client/components/ui/dropdown-menu.mjs";
|
|
12
|
+
import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle } from "./client/components/ui/sheet.mjs";
|
|
13
|
+
import { sanitizeFilename } from "./client/components/fields/field-utils.mjs";
|
|
8
14
|
import { EMPTY_BLOCK_CONTENT, isBlockContent } from "./client/blocks/types.mjs";
|
|
15
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./client/components/ui/tooltip.mjs";
|
|
16
|
+
import { getFileIcon } from "./client/views/collection/cells/shared/asset-thumbnail.mjs";
|
|
9
17
|
import { FocusProvider, parsePreviewFieldPath, scrollFieldIntoView, useFocus, useFocusOptional, useIsBlockFocused, useIsFieldFocused } from "./client/contexts/focus-context.mjs";
|
|
10
18
|
import { useIsDesktop, useIsMobile, useMediaQuery } from "./client/hooks/use-media-query.mjs";
|
|
11
19
|
import { buildValidationSchema, buildZodFromIntrospection, createFormSchema } from "./client/builder/validation.mjs";
|
|
@@ -17,7 +25,11 @@ import { useSidebarSearchParam } from "./client/hooks/use-sidebar-search-param.m
|
|
|
17
25
|
import { useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions } from "./client/hooks/use-collection.mjs";
|
|
18
26
|
import { createAdminAuthClient, useAuthClient } from "./client/hooks/use-auth.mjs";
|
|
19
27
|
import { useCurrentUser } from "./client/hooks/use-current-user.mjs";
|
|
28
|
+
import { AdminViewHeader, AdminViewLayout } from "./client/views/layout/admin-view-layout.mjs";
|
|
29
|
+
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./client/components/ui/table.mjs";
|
|
20
30
|
import { AdminLink } from "./client/components/admin-link.mjs";
|
|
31
|
+
import { useUpload } from "./client/hooks/use-upload.mjs";
|
|
32
|
+
import { Dropzone } from "./client/components/primitives/dropzone.mjs";
|
|
21
33
|
import { page } from "./client/builder/page/page.mjs";
|
|
22
34
|
import { widget } from "./client/builder/widget/widget.mjs";
|
|
23
35
|
import { createAdminClient } from "./client/create-admin-client.mjs";
|
|
@@ -27,6 +39,8 @@ import { AdminLayout } from "./client/views/layout/admin-layout.mjs";
|
|
|
27
39
|
import { AuthLoading } from "./client/components/auth/auth-loading.mjs";
|
|
28
40
|
import { AuthGuard } from "./client/components/auth/auth-guard.mjs";
|
|
29
41
|
import { AdminLayoutProvider } from "./client/views/layout/admin-layout-provider.mjs";
|
|
42
|
+
import DocumentView from "./client/views/collection/document-view.mjs";
|
|
43
|
+
import { SearchInput } from "./client/components/ui/search-input.mjs";
|
|
30
44
|
import { AdminRouter } from "./client/views/layout/admin-router.mjs";
|
|
31
45
|
import { BlockScopeProvider, useBlockScope, useResolveFieldPath } from "./client/preview/block-scope-context.mjs";
|
|
32
46
|
import { BlockRenderer } from "./client/blocks/block-renderer.mjs";
|
|
@@ -54,5 +68,6 @@ import { useFieldOptions } from "./client/hooks/use-field-options.mjs";
|
|
|
54
68
|
import { useServerWidgetData } from "./client/hooks/use-server-widget-data.mjs";
|
|
55
69
|
import { ScopeProvider, createScopedFetch, useScope, useScopeSafe, useScopedFetch } from "./client/scope/provider.mjs";
|
|
56
70
|
import { ScopePicker } from "./client/scope/picker.mjs";
|
|
71
|
+
import { toast } from "./client.mjs";
|
|
57
72
|
|
|
58
|
-
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, AdminRouter, AuthDefaultLogo, AuthGuard, AuthLayout, AuthLoading, Badge, BlockRenderer, BlockScopeProvider, BrandLogoMark, ComponentRenderer, DashboardPage, EMPTY_BLOCK_CONTENT, FocusProvider, ForgotPasswordForm, ForgotPasswordPage, IconifyIcon, InvitePage, LoginForm, LoginPage, PreviewBanner, PreviewField, PreviewProvider, ResetPasswordForm, ResetPasswordPage, RichTextEditor, RichTextRenderer, ScopePicker, ScopeProvider, SetupForm, SetupPage, StandalonePreviewField, buildValidationSchema, buildZodFromIntrospection, configureField, createAdminAuthClient, createAdminClient, createFormSchema, createIconRenderer, createScopedFetch, createTypedHooks, field, getCountryCode, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, page, parsePreviewFieldPath, resolveIconElement, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, useAdminStore, useAuthClient, useBlockScope, useBrand, useBrandSnapshotRef, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalRevertVersion, useGlobalUpdate, useGlobalVersions, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useScope, useScopeSafe, useScopedFetch, useSearchParamToggle, useServerWidgetData, useSetupStatus, useShallow, useSidebarSearchParam, view, widget };
|
|
73
|
+
export { AcceptInviteForm, AcceptInvitePage, Admin, AdminLayout, AdminLayoutProvider, AdminLink, AdminProvider, AdminRouter, AdminViewHeader, AdminViewLayout, AuthDefaultLogo, AuthGuard, AuthLayout, AuthLoading, Badge, BlockRenderer, BlockScopeProvider, BrandLogoMark, Button, ComponentRenderer, DashboardPage, DocumentView, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, Dropzone, EMPTY_BLOCK_CONTENT, FocusProvider, ForgotPasswordForm, ForgotPasswordPage, IconifyIcon, InvitePage, LoginForm, LoginPage, PreviewBanner, PreviewField, PreviewProvider, ResetPasswordForm, ResetPasswordPage, RichTextEditor, RichTextRenderer, ScopePicker, ScopeProvider, SearchInput, SetupForm, SetupPage, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, StandalonePreviewField, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tooltip, TooltipContent, TooltipTrigger, buildValidationSchema, buildZodFromIntrospection, cn, configureField, createAdminAuthClient, createAdminClient, createFormSchema, createIconRenderer, createScopedFetch, createTypedHooks, field, getCountryCode, getFileIcon, getFlagConfig, getFlagUrl, isAdminToPreviewMessage, isBlockContent, isComponentReference, isPreviewToAdminMessage, page, parsePreviewFieldPath, resolveIconElement, sanitizeFilename, scrollFieldIntoView, selectAdmin, selectBasePath, selectClient, selectNavigate, toast, useAdminStore, useAuthClient, useBlockScope, useBrand, useBrandSnapshotRef, useCollectionCreate, useCollectionDelete, useCollectionItem, useCollectionList, useCollectionPreview, useCollectionRestore, useCollectionRevertVersion, useCollectionUpdate, useCollectionVersions, useCurrentUser, useFieldOptions, useFocus, useFocusOptional, useGlobal, useGlobalRevertVersion, useGlobalUpdate, useGlobalVersions, useIsBlockFocused, useIsDesktop, useIsFieldFocused, useIsMobile, useMediaQuery, usePreviewContext, useReactiveFields, useResolveFieldPath, useResolveText, useScope, useScopeSafe, useScopedFetch, useSearchParamToggle, useServerWidgetData, useSetupStatus, useShallow, useSidebarSearchParam, useUpload, view, widget };
|
|
@@ -92,6 +92,11 @@ interface ServerActionContext<TData = Record<string, unknown>> {
|
|
|
92
92
|
locale?: string;
|
|
93
93
|
/** Translation function for admin messages */
|
|
94
94
|
t: (key: string, params?: Record<string, unknown>) => string;
|
|
95
|
+
/**
|
|
96
|
+
* Workflows API — present when a workflows plugin is registered.
|
|
97
|
+
* Resolved from the app like route handler contexts.
|
|
98
|
+
*/
|
|
99
|
+
workflows?: unknown;
|
|
95
100
|
}
|
|
96
101
|
/**
|
|
97
102
|
* Action handler function type
|
|
@@ -156,6 +156,11 @@ interface ListViewConfig {
|
|
|
156
156
|
searchable?: string[];
|
|
157
157
|
/** Filterable fields */
|
|
158
158
|
filterable?: string[];
|
|
159
|
+
/**
|
|
160
|
+
* Enable realtime invalidation for list queries.
|
|
161
|
+
* Falls back to AdminProvider realtime config when undefined.
|
|
162
|
+
*/
|
|
163
|
+
realtime?: boolean;
|
|
159
164
|
/** Client-side grouping options for the current fetched page */
|
|
160
165
|
grouping?: {
|
|
161
166
|
/** Fields users can group by */
|
|
@@ -31,6 +31,7 @@ import { FormViewConfig, ListViewConfig } from "./form-layout.mjs";
|
|
|
31
31
|
interface ViewKindRegistry {
|
|
32
32
|
list: {};
|
|
33
33
|
form: {};
|
|
34
|
+
document: {};
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
37
|
* Union of all registered view kind names.
|
|
@@ -191,7 +192,7 @@ type EditViewFactory<TEditViews extends Record<string, any> | string = string> =
|
|
|
191
192
|
* `TListViews` can be either a views record (per-view typed config)
|
|
192
193
|
* or a string union (backward-compatible, all views use `ListViewConfig`).
|
|
193
194
|
*/
|
|
194
|
-
interface ListViewConfigContext<TFields extends Record<string, any> = Record<string, any>, TListViews extends Record<string, any> | string = string> {
|
|
195
|
+
interface ListViewConfigContext<TFields extends Record<string, any> = Record<string, any>, TListViews extends Record<string, any> | string = string, TComponents extends Record<string, any> | string = string> {
|
|
195
196
|
/** View factory — per-view typed config extracted from ViewDefinition */
|
|
196
197
|
v: ListViewFactory<TListViews>;
|
|
197
198
|
/** Field reference proxy - returns field names as strings */
|
|
@@ -211,6 +212,8 @@ interface ListViewConfigContext<TFields extends Record<string, any> = Record<str
|
|
|
211
212
|
config?: unknown;
|
|
212
213
|
};
|
|
213
214
|
};
|
|
215
|
+
/** Component factory — produces ComponentReference objects */
|
|
216
|
+
c: ComponentFactory<TComponents>;
|
|
214
217
|
}
|
|
215
218
|
/**
|
|
216
219
|
* Context for form view config functions.
|
|
@@ -125,13 +125,16 @@ function createBlocksState() {
|
|
|
125
125
|
const doc = value;
|
|
126
126
|
if (!doc._tree || !doc._values) return value;
|
|
127
127
|
try {
|
|
128
|
-
const { app, db, locale } = getContext();
|
|
128
|
+
const { app, db, locale, session, accessMode, stage } = getContext();
|
|
129
129
|
const blockDefs = app.state?.blocks;
|
|
130
130
|
if (!blockDefs || Object.keys(blockDefs).length === 0) return value;
|
|
131
131
|
return await processBlocksDocument(doc, blockDefs, {
|
|
132
132
|
app,
|
|
133
133
|
db,
|
|
134
|
+
session,
|
|
134
135
|
locale,
|
|
136
|
+
accessMode,
|
|
137
|
+
stage,
|
|
135
138
|
collections: app.collections,
|
|
136
139
|
globals: app.globals
|
|
137
140
|
});
|
|
@@ -14,8 +14,8 @@ import { adminAssetsCollection } from "../collections/assets.mjs";
|
|
|
14
14
|
import { _default as _default$11 } from "../collections/session.mjs";
|
|
15
15
|
import { adminUserCollection } from "../collections/user.mjs";
|
|
16
16
|
import { _default as _default$12 } from "../collections/verification.mjs";
|
|
17
|
-
import { adminConfigFunctions } from "../routes/admin-config.mjs";
|
|
18
17
|
import { getApp } from "../routes/route-helpers.mjs";
|
|
18
|
+
import { adminConfigFunctions } from "../routes/admin-config.mjs";
|
|
19
19
|
import { actionFunctions } from "../routes/execute-action.mjs";
|
|
20
20
|
import { translateAdminMessage } from "../routes/i18n-helpers.mjs";
|
|
21
21
|
import { localeFunctions } from "../routes/locales.mjs";
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
//#region src/server/modules/admin/auth-helpers.ts
|
|
2
2
|
/**
|
|
3
|
+
* Check whether a route context belongs to an admin user.
|
|
4
|
+
*/
|
|
5
|
+
function hasAdminRole(ctx) {
|
|
6
|
+
return ctx.session?.user?.role === "admin";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
3
9
|
* Check if user is authenticated with required role on the server.
|
|
4
10
|
* Returns a redirect Response if not authenticated, null if authenticated.
|
|
5
11
|
*
|
|
@@ -104,4 +110,4 @@ async function isAdminUser({ request, app, requiredRole = "admin" }) {
|
|
|
104
110
|
}
|
|
105
111
|
|
|
106
112
|
//#endregion
|
|
107
|
-
export { getAdminSession, isAdminUser, requireAdminAuth };
|
|
113
|
+
export { getAdminSession, hasAdminRole, isAdminUser, requireAdminAuth };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { serializeFormLayoutProps, serializeReactivePropsRecord } from "../../../fields/reactive-runtime.mjs";
|
|
1
2
|
import { isI18nLocaleMap } from "questpie/shared";
|
|
2
3
|
|
|
3
4
|
//#region src/server/modules/admin/block/introspection.ts
|
|
@@ -11,6 +12,29 @@ function normalizeBlockDef(blockDef) {
|
|
|
11
12
|
if (typeof blockDef?.build === "function" && !blockDef.getFieldMetadata) return blockDef.build();
|
|
12
13
|
return blockDef;
|
|
13
14
|
}
|
|
15
|
+
function serializeBlockAdmin(admin) {
|
|
16
|
+
if (!admin) return void 0;
|
|
17
|
+
return {
|
|
18
|
+
label: admin.label,
|
|
19
|
+
description: admin.description,
|
|
20
|
+
icon: admin.icon,
|
|
21
|
+
category: admin.category,
|
|
22
|
+
order: admin.order,
|
|
23
|
+
hidden: admin.hidden
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function serializeBlockFields(fields) {
|
|
27
|
+
const serialized = {};
|
|
28
|
+
for (const [name, field] of Object.entries(fields)) {
|
|
29
|
+
const metadata = { ...field.metadata };
|
|
30
|
+
if (metadata.meta && typeof metadata.meta === "object") metadata.meta = serializeReactivePropsRecord(metadata.meta);
|
|
31
|
+
serialized[name] = {
|
|
32
|
+
...field,
|
|
33
|
+
metadata
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return serialized;
|
|
37
|
+
}
|
|
14
38
|
/**
|
|
15
39
|
* Introspect a single block definition.
|
|
16
40
|
* Handles both server BlockBuilder definitions and client BlockDefinition objects
|
|
@@ -21,12 +45,12 @@ function introspectBlock(blockDef) {
|
|
|
21
45
|
const state = resolved.state;
|
|
22
46
|
return {
|
|
23
47
|
name: state.name ?? resolved.name,
|
|
24
|
-
admin: state.admin,
|
|
48
|
+
admin: serializeBlockAdmin(state.admin),
|
|
25
49
|
allowChildren: state.allowChildren,
|
|
26
50
|
maxChildren: state.maxChildren,
|
|
27
|
-
hasPrefetch: typeof state.prefetch === "function",
|
|
28
|
-
fields: resolved.getFieldMetadata(),
|
|
29
|
-
form: state.form
|
|
51
|
+
hasPrefetch: typeof state.prefetch === "function" || Boolean(state.prefetchWith) || typeof state._prefetchLoader === "function",
|
|
52
|
+
fields: serializeBlockFields(resolved.getFieldMetadata()),
|
|
53
|
+
form: state.form ? { fields: serializeFormLayoutProps(state.form.fields) } : void 0
|
|
30
54
|
};
|
|
31
55
|
}
|
|
32
56
|
/**
|
|
@@ -12,8 +12,14 @@ interface BlocksPrefetchContext {
|
|
|
12
12
|
app: any;
|
|
13
13
|
/** Database client */
|
|
14
14
|
db: unknown;
|
|
15
|
+
/** Current session */
|
|
16
|
+
session?: unknown | null;
|
|
15
17
|
/** Current locale */
|
|
16
18
|
locale?: string;
|
|
19
|
+
/** Current CRUD access mode */
|
|
20
|
+
accessMode?: string;
|
|
21
|
+
/** Current workflow stage */
|
|
22
|
+
stage?: string;
|
|
17
23
|
/** Collections accessor */
|
|
18
24
|
collections?: unknown;
|
|
19
25
|
/** Globals accessor */
|
|
@@ -76,7 +82,12 @@ declare function createBlocksPrefetchHook(): (ctx: {
|
|
|
76
82
|
data: Record<string, unknown>;
|
|
77
83
|
app: any;
|
|
78
84
|
db: unknown;
|
|
85
|
+
session?: unknown | null;
|
|
79
86
|
locale?: string;
|
|
87
|
+
accessMode?: string;
|
|
88
|
+
stage?: string;
|
|
89
|
+
collections?: unknown;
|
|
90
|
+
globals?: unknown;
|
|
80
91
|
}) => Promise<void>;
|
|
81
92
|
//#endregion
|
|
82
93
|
export { BlocksPrefetchContext, createBlocksPrefetchHook, processBlocksDocument, processDocumentBlocksPrefetch };
|