@dyrected/admin 2.5.29 → 2.5.32

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.
@@ -0,0 +1,4 @@
1
+ import { LucideIcon } from 'lucide-react';
2
+ import { AdminIconName } from '@dyrected/core';
3
+ export declare function isAdminIconName(value: unknown): value is AdminIconName;
4
+ export declare function resolveAdminIcon(value: unknown, fallback: LucideIcon): LucideIcon;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,5 @@
1
+ import { CollectionConfig } from '@dyrected/core';
1
2
  export declare function MediaPage({ collectionSlug, schema }: {
2
- collectionSlug?: string;
3
- schema?: {
4
- labels?: {
5
- plural?: string;
6
- };
7
- label?: string;
8
- };
3
+ collectionSlug: string;
4
+ schema: CollectionConfig;
9
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,14 @@
1
- import { SetupPromptConfig } from '@dyrected/sdk';
2
- export type { SetupPromptConfig };
1
+ export interface SetupPromptConfig {
2
+ siteName?: string;
3
+ siteId?: string;
4
+ apiKey?: string;
5
+ baseUrl?: string;
6
+ isSelfHosted?: boolean;
7
+ existingSite?: boolean;
8
+ defaultTechStack?: string;
9
+ }
3
10
  export interface SetupPromptProps {
4
11
  config: SetupPromptConfig;
5
12
  }
13
+ export declare function buildGuideUrl(config: SetupPromptConfig): string;
6
14
  export declare function SetupPromptUI({ config }: SetupPromptProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { DyrectedClient } from '@dyrected/sdk';
3
+ import { AdminComponents, AdminSchemas } from '../types/admin-components';
3
4
  interface DyrectedContextType {
4
5
  client: DyrectedClient | null;
5
6
  config: {
@@ -11,18 +12,11 @@ interface DyrectedContextType {
11
12
  setAuth: (baseUrl: string, apiKey: string, siteId?: string) => void;
12
13
  logout: () => void;
13
14
  isAuthenticated: boolean;
14
- schemas: {
15
- collections: any[];
16
- globals: any[];
17
- admin?: any;
18
- } | null;
15
+ schemas: AdminSchemas | null;
19
16
  user: any | null;
20
17
  setToken: (token: string) => void;
21
18
  initialToken?: string;
22
- components?: {
23
- fields?: Record<string, React.ComponentType<any>>;
24
- [key: string]: any;
25
- };
19
+ components?: AdminComponents;
26
20
  }
27
21
  export interface DyrectedProviderProps {
28
22
  children: React.ReactNode;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,42 @@
1
+ import { ComponentType } from 'react';
2
+ import { AdminConfig, CollectionConfig, GlobalConfig } from '@dyrected/core';
3
+ import { DyrectedClient, PaginatedResult } from '@dyrected/sdk';
4
+ export interface AdminSchemas {
5
+ collections: CollectionConfig[];
6
+ globals: GlobalConfig[];
7
+ admin?: AdminConfig;
8
+ }
9
+ export interface DashboardSlotProps {
10
+ client: DyrectedClient;
11
+ user: Record<string, unknown> | null;
12
+ schemas: AdminSchemas;
13
+ }
14
+ export interface CollectionListSlotProps {
15
+ client: DyrectedClient;
16
+ user: Record<string, unknown> | null;
17
+ collection: CollectionConfig;
18
+ collectionSlug: string;
19
+ response: PaginatedResult<Record<string, unknown>> | undefined;
20
+ documents: Record<string, unknown>[];
21
+ isLoading: boolean;
22
+ pagination: {
23
+ page: number;
24
+ totalPages: number;
25
+ total: number;
26
+ hasNextPage: boolean;
27
+ hasPrevPage: boolean;
28
+ };
29
+ permissions: {
30
+ canRead: boolean;
31
+ canCreate: boolean;
32
+ };
33
+ urls: {
34
+ collection: string;
35
+ create: string;
36
+ };
37
+ }
38
+ export interface AdminComponents {
39
+ fields?: Record<string, ComponentType<any>>;
40
+ dashboard?: Record<string, ComponentType<DashboardSlotProps>>;
41
+ collectionList?: Record<string, ComponentType<CollectionListSlotProps>>;
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/admin",
3
- "version": "2.5.29",
3
+ "version": "2.5.32",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -62,8 +62,8 @@
62
62
  "tailwind-merge": "^3.5.0",
63
63
  "tailwindcss-animate": "^1.0.7",
64
64
  "zod": "^3.25.76",
65
- "@dyrected/core": "^2.5.29",
66
- "@dyrected/sdk": "^2.5.29"
65
+ "@dyrected/core": "^2.5.32",
66
+ "@dyrected/sdk": "^2.5.32"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@tanstack/react-query": "^5.0.0",