@dyrected/admin 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +1 -0
- package/dist/admin.css +2 -0
- package/dist/components/auth/auth-gate.d.ts +13 -0
- package/dist/components/error-boundary.d.ts +16 -0
- package/dist/components/forms/field-renderer.d.ts +22 -0
- package/dist/components/forms/fields/block-builder.d.ts +9 -0
- package/dist/components/forms/fields/date-picker.d.ts +8 -0
- package/dist/components/forms/fields/json-editor.d.ts +8 -0
- package/dist/components/forms/fields/media-picker.d.ts +12 -0
- package/dist/components/forms/fields/multi-select.d.ts +19 -0
- package/dist/components/forms/fields/radio-field.d.ts +8 -0
- package/dist/components/forms/fields/relationship-picker.d.ts +10 -0
- package/dist/components/forms/fields/rich-text-editor.d.ts +9 -0
- package/dist/components/forms/fields/select-field.d.ts +8 -0
- package/dist/components/forms/fields/switch-field.d.ts +6 -0
- package/dist/components/forms/fields/text-area-field.d.ts +8 -0
- package/dist/components/forms/fields/text-field.d.ts +8 -0
- package/dist/components/forms/form-engine.d.ts +14 -0
- package/dist/components/forms/form-field-renderer.d.ts +20 -0
- package/dist/components/forms/utils.d.ts +11 -0
- package/dist/components/layout/admin-shell.d.ts +5 -0
- package/dist/components/layout/branding-provider.d.ts +4 -0
- package/dist/components/live-preview/LivePreviewPane.d.ts +7 -0
- package/dist/components/media/focal-point-picker.d.ts +12 -0
- package/dist/components/media/media-card.d.ts +8 -0
- package/dist/components/media/media-grid.d.ts +8 -0
- package/dist/components/media/media-library-dialog.d.ts +11 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/command.d.ts +80 -0
- package/dist/components/ui/data-table.d.ts +14 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/form.d.ts +23 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/page-header.d.ts +10 -0
- package/dist/components/ui/pagination.d.ts +11 -0
- package/dist/components/ui/popover.d.ts +6 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/render-cell.d.ts +8 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +25 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/switch.d.ts +4 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-preferences.d.ts +6 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.mjs +69091 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/main.d.ts +0 -0
- package/dist/pages/auth/first-user-page.d.ts +4 -0
- package/dist/pages/auth/login-page.d.ts +4 -0
- package/dist/pages/collections/edit-page.d.ts +1 -0
- package/dist/pages/collections/list-page.d.ts +5 -0
- package/dist/pages/dashboard/dashboard.d.ts +1 -0
- package/dist/pages/globals/editor-page.d.ts +1 -0
- package/dist/pages/media/media-page.d.ts +4 -0
- package/dist/pages/setup/setup-prompt.d.ts +6 -0
- package/dist/providers/dyrected-provider.d.ts +29 -0
- package/dist/providers/query-provider.d.ts +3 -0
- package/package.json +6 -3
- package/CHANGELOG.md +0 -153
- package/components.json +0 -17
- package/eslint.config.js +0 -22
- package/index.html +0 -13
- package/postcss.config.js +0 -6
- package/scripts/prefix-tailwind-precision.py +0 -98
- package/scripts/prefix-tailwind.py +0 -67
- package/src/App.css +0 -184
- package/src/App.tsx +0 -25
- package/src/assets/dyrected.svg +0 -155
- package/src/assets/hero.png +0 -0
- package/src/assets/react.svg +0 -1
- package/src/assets/vite.svg +0 -1
- package/src/components/auth/auth-gate.tsx +0 -64
- package/src/components/error-boundary.tsx +0 -45
- package/src/components/forms/field-renderer.tsx +0 -111
- package/src/components/forms/fields/block-builder.tsx +0 -213
- package/src/components/forms/fields/date-picker.tsx +0 -60
- package/src/components/forms/fields/json-editor.tsx +0 -62
- package/src/components/forms/fields/media-picker.tsx +0 -286
- package/src/components/forms/fields/multi-select.tsx +0 -145
- package/src/components/forms/fields/radio-field.tsx +0 -51
- package/src/components/forms/fields/relationship-picker.tsx +0 -143
- package/src/components/forms/fields/rich-text-editor.tsx +0 -224
- package/src/components/forms/fields/select-field.tsx +0 -35
- package/src/components/forms/fields/switch-field.tsx +0 -16
- package/src/components/forms/fields/text-area-field.tsx +0 -15
- package/src/components/forms/fields/text-field.tsx +0 -24
- package/src/components/forms/form-engine.tsx +0 -87
- package/src/components/forms/form-field-renderer.tsx +0 -269
- package/src/components/forms/utils.ts +0 -97
- package/src/components/layout/admin-shell.tsx +0 -479
- package/src/components/layout/branding-provider.tsx +0 -112
- package/src/components/live-preview/LivePreviewPane.tsx +0 -128
- package/src/components/media/focal-point-picker.tsx +0 -66
- package/src/components/media/media-card.tsx +0 -44
- package/src/components/media/media-grid.tsx +0 -32
- package/src/components/media/media-library-dialog.tsx +0 -465
- package/src/components/ui/aspect-ratio.tsx +0 -7
- package/src/components/ui/badge.tsx +0 -36
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/calendar.tsx +0 -214
- package/src/components/ui/card.tsx +0 -79
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/command.tsx +0 -151
- package/src/components/ui/data-table.tsx +0 -219
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/dropdown-menu.tsx +0 -200
- package/src/components/ui/form.tsx +0 -178
- package/src/components/ui/input.tsx +0 -24
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/page-header.tsx +0 -30
- package/src/components/ui/pagination.tsx +0 -57
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/progress.tsx +0 -26
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/render-cell.tsx +0 -110
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -160
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/sheet.tsx +0 -140
- package/src/components/ui/sidebar.tsx +0 -771
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/sonner.tsx +0 -27
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -117
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -28
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-preferences.ts +0 -56
- package/src/index.css +0 -111
- package/src/index.tsx +0 -198
- package/src/lib/utils.ts +0 -36
- package/src/main.tsx +0 -10
- package/src/pages/auth/first-user-page.tsx +0 -115
- package/src/pages/auth/login-page.tsx +0 -91
- package/src/pages/collections/edit-page.tsx +0 -280
- package/src/pages/collections/list-page.tsx +0 -343
- package/src/pages/dashboard/dashboard.tsx +0 -150
- package/src/pages/globals/editor-page.tsx +0 -122
- package/src/pages/media/media-page.tsx +0 -564
- package/src/pages/setup/setup-prompt.tsx +0 -181
- package/src/providers/dyrected-provider.tsx +0 -122
- package/src/providers/query-provider.tsx +0 -19
- package/src/types/jexl.d.ts +0 -11
- package/tailwind.config.ts +0 -103
- package/tsconfig.app.json +0 -28
- package/tsconfig.json +0 -12
- package/tsconfig.node.json +0 -25
- package/vite.config.ts +0 -39
- /package/{public → dist}/favicon.svg +0 -0
- /package/{public → dist}/icons.svg +0 -0
package/dist/main.d.ts
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditEntryPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Dashboard(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GlobalEditorPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SetupPromptConfig } from '@dyrected/sdk';
|
|
2
|
+
export type { SetupPromptConfig };
|
|
3
|
+
export interface SetupPromptProps {
|
|
4
|
+
config: SetupPromptConfig;
|
|
5
|
+
}
|
|
6
|
+
export declare function SetupPromptUI({ config }: SetupPromptProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DyrectedClient } from '@dyrected/sdk';
|
|
3
|
+
interface DyrectedContextType {
|
|
4
|
+
client: DyrectedClient | null;
|
|
5
|
+
config: {
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
apiKey: string | undefined;
|
|
8
|
+
siteId: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
setAuth: (baseUrl: string, apiKey: string, siteId?: string) => void;
|
|
11
|
+
logout: () => void;
|
|
12
|
+
isAuthenticated: boolean;
|
|
13
|
+
schemas: {
|
|
14
|
+
collections: any[];
|
|
15
|
+
globals: any[];
|
|
16
|
+
admin?: any;
|
|
17
|
+
} | null;
|
|
18
|
+
user: any | null;
|
|
19
|
+
setToken: (token: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface DyrectedProviderProps {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
apiKey?: string;
|
|
24
|
+
baseUrl?: string;
|
|
25
|
+
siteId?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function DyrectedProvider({ children, apiKey: initialApiKey, baseUrl: initialBaseUrl, siteId: initialSiteId }: DyrectedProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const useDyrected: () => DyrectedContextType;
|
|
29
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyrected/admin",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
5
8
|
"main": "./dist/index.mjs",
|
|
6
9
|
"module": "./dist/index.mjs",
|
|
7
10
|
"types": "./dist/index.d.ts",
|
|
@@ -60,8 +63,8 @@
|
|
|
60
63
|
"tailwind-merge": "^3.5.0",
|
|
61
64
|
"tailwindcss-animate": "^1.0.7",
|
|
62
65
|
"zod": "^3.25.76",
|
|
63
|
-
"@dyrected/
|
|
64
|
-
"@dyrected/
|
|
66
|
+
"@dyrected/sdk": "^2.4.0",
|
|
67
|
+
"@dyrected/core": "^2.4.0"
|
|
65
68
|
},
|
|
66
69
|
"devDependencies": {
|
|
67
70
|
"@eslint/js": "^10.0.1",
|
package/CHANGELOG.md
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
# @dyrected/admin
|
|
2
|
-
|
|
3
|
-
## 2.4.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- Infrastructure standardization, MySQL adapter improvements, and SDK robustness testing.
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- Updated dependencies
|
|
12
|
-
- @dyrected/core@2.4.0
|
|
13
|
-
- @dyrected/sdk@2.4.0
|
|
14
|
-
|
|
15
|
-
## 2.3.0
|
|
16
|
-
|
|
17
|
-
### Minor Changes
|
|
18
|
-
|
|
19
|
-
- Standardize database infrastructure and implement field promotion.
|
|
20
|
-
- **Field Promotion**: Added 'promoted' option to Collection fields to extract JSON data into native SQL columns for indexing and performance.
|
|
21
|
-
- **Lazy Migrations**: Added 'renameTo' support for seamless field renames without breaking existing data.
|
|
22
|
-
- **Auto-Seeding**: Standardized 'initialData' seeding logic across all adapters.
|
|
23
|
-
- **MySQL Adapter**: New robust MySQL adapter implementation.
|
|
24
|
-
- **Strict Filtering**: Improved query translation parity across all SQL-based adapters.
|
|
25
|
-
|
|
26
|
-
### Patch Changes
|
|
27
|
-
|
|
28
|
-
- Updated dependencies
|
|
29
|
-
- @dyrected/core@2.3.0
|
|
30
|
-
- @dyrected/sdk@2.3.0
|
|
31
|
-
|
|
32
|
-
## 2.0.1
|
|
33
|
-
|
|
34
|
-
### Patch Changes
|
|
35
|
-
|
|
36
|
-
- 220818c: ### @dyrected/core
|
|
37
|
-
- **New Discovery Workflow**: Refined the AI setup prompt with a multi-step "Phase 0" discovery process to improve initial project scoping.
|
|
38
|
-
- **Nomenclature Standardization**: Updated all system prompts to use "Nuxt.js" nomenclature and improved schema definition examples.
|
|
39
|
-
|
|
40
|
-
### @dyrected/db-postgres & @dyrected/db-sqlite
|
|
41
|
-
- **Architecture Documentation**: Added source-level documentation explaining the use of raw SQL drivers (postgres.js/better-sqlite3) alongside Drizzle to support dynamic runtime schemas.
|
|
42
|
-
|
|
43
|
-
### @dyrected/admin
|
|
44
|
-
- **Internal Maintenance**: Synchronized internal documentation and field renderer context to support the latest core setup workflows.
|
|
45
|
-
|
|
46
|
-
- Updated dependencies [220818c]
|
|
47
|
-
- @dyrected/core@2.1.0
|
|
48
|
-
|
|
49
|
-
## 2.0.0
|
|
50
|
-
|
|
51
|
-
### Major Changes
|
|
52
|
-
|
|
53
|
-
- Updated all storage adapters to support `Uint8Array` buffers and file prefixing.
|
|
54
|
-
- **Storage API Update**: The `buffer` parameter in `StorageAdapter.upload` and `resolve` now expects a `Uint8Array` instead of a Node.js `Buffer`. This ensures better compatibility across different JavaScript environments.
|
|
55
|
-
- **File Prefixing**: Added support for an optional `prefix` parameter in `StorageAdapter.upload` to allow organizing files into subfolders or prefixes (supported by Cloudinary, S3, B2, and Local storage).
|
|
56
|
-
- **Alignment**: Standardized `CloudinaryStorageAdapter`, `LocalStorageAdapter`, `S3StorageAdapter`, and `B2StorageAdapter` to strictly follow the `@dyrected/core` interface.
|
|
57
|
-
|
|
58
|
-
### Patch Changes
|
|
59
|
-
|
|
60
|
-
- Updated dependencies
|
|
61
|
-
- @dyrected/core@2.0.0
|
|
62
|
-
- @dyrected/sdk@2.0.0
|
|
63
|
-
|
|
64
|
-
## 1.0.9
|
|
65
|
-
|
|
66
|
-
### Patch Changes
|
|
67
|
-
|
|
68
|
-
- d8e1f29: bump package versions and update export conditions for admin package
|
|
69
|
-
- Updated dependencies [d8e1f29]
|
|
70
|
-
- @dyrected/core@1.0.9
|
|
71
|
-
- @dyrected/sdk@1.0.9
|
|
72
|
-
|
|
73
|
-
## 1.0.6
|
|
74
|
-
|
|
75
|
-
### Patch Changes
|
|
76
|
-
|
|
77
|
-
- Add functional exports for all database and storage adapters (e.g., mongodbAdapter, sqliteAdapter, s3Storage) to provide a more ergonomic API and fix runtime re-attachment errors in Nuxt.
|
|
78
|
-
- Updated dependencies
|
|
79
|
-
- @dyrected/core@1.0.7
|
|
80
|
-
- @dyrected/sdk@1.0.5
|
|
81
|
-
|
|
82
|
-
## 1.0.5
|
|
83
|
-
|
|
84
|
-
### Patch Changes
|
|
85
|
-
|
|
86
|
-
- Standardize framework integrations for Next.js and Nuxt. Refactor AI setup prompt into a Senior Content Architect mission with explicit architecture and discovery requirements. Fix CLI Nuxt template for zero-import architecture.
|
|
87
|
-
- Updated dependencies
|
|
88
|
-
- @dyrected/core@1.0.6
|
|
89
|
-
- @dyrected/sdk@1.0.4
|
|
90
|
-
|
|
91
|
-
## 1.0.4
|
|
92
|
-
|
|
93
|
-
### Patch Changes
|
|
94
|
-
|
|
95
|
-
- Standardized environment variable handling across Next.js and Nuxt (prioritizing `NEXT_PUBLIC_` and `NUXT_PUBLIC_` prefixes).
|
|
96
|
-
Improved CLI initialization flow by saving AI setup prompts to `dyrected-ai-prompt.md` and refining the framework-specific setup instructions.
|
|
97
|
-
Fixed type emission and dependency exports for `@dyrected/admin` to ensure stable builds in consuming applications.
|
|
98
|
-
Added a drop-in `DyrectedAdmin` component for Next.js.
|
|
99
|
-
Updated documentation with clearer self-hosted and cloud integration steps.
|
|
100
|
-
- Updated dependencies
|
|
101
|
-
- @dyrected/core@1.0.4
|
|
102
|
-
|
|
103
|
-
## 1.0.3
|
|
104
|
-
|
|
105
|
-
### Patch Changes
|
|
106
|
-
|
|
107
|
-
- Standardized environment variable handling across Next.js and Nuxt integrations.
|
|
108
|
-
- CLI now generates .env templates with framework-specific prefixes (NEXT*PUBLIC* / NUXT*PUBLIC*).
|
|
109
|
-
- Next.js and Nuxt clients automatically resolve these prefixed variables for client-side use.
|
|
110
|
-
- Added a dedicated `@dyrected/next/admin` component for easy dashboard embedding in Next.js.
|
|
111
|
-
- Fixed TypeScript type generation for the Admin UI package.
|
|
112
|
-
- Updated dependencies
|
|
113
|
-
- @dyrected/core@1.0.3
|
|
114
|
-
- @dyrected/sdk@1.0.3
|
|
115
|
-
|
|
116
|
-
## 1.0.1
|
|
117
|
-
|
|
118
|
-
### Patch Changes
|
|
119
|
-
|
|
120
|
-
- bfc3468: Initial public release of the Dyrected CMS ecosystem.
|
|
121
|
-
- Updated dependencies [bfc3468]
|
|
122
|
-
- @dyrected/core@1.0.1
|
|
123
|
-
- @dyrected/sdk@1.0.1
|
|
124
|
-
|
|
125
|
-
## 1.0.0
|
|
126
|
-
|
|
127
|
-
### Major Changes
|
|
128
|
-
|
|
129
|
-
- 00f9439: Initial major release of the Dyrected CMS ecosystem. This release establishes the core monorepo architecture, featuring a flexible CMS engine, a premium React-based Admin UI with warm light aesthetics, and native Next.js/Nuxt integrations. Key highlights include Jexl-based RBAC, a specialized media library with S3/Cloudinary support, live preview, automated audit trails, and a separated auth model for enhanced security.
|
|
130
|
-
|
|
131
|
-
### Breaking Changes
|
|
132
|
-
|
|
133
|
-
**WHAT:**
|
|
134
|
-
- Renamed `createApp` to `createDyrectedApp` across all core and framework packages.
|
|
135
|
-
- Removed the hardcoded `/api` prefix from internal routing logic; API paths now default to the handler root or are controlled via `apiPrefix` config.
|
|
136
|
-
- Administrative users are now isolated in a reserved `__admins` collection by default.
|
|
137
|
-
- Standardized database adapter return types to ensure consistent ID handling across SQL and NoSQL providers.
|
|
138
|
-
|
|
139
|
-
**WHY:**
|
|
140
|
-
- The rename prevents naming collisions with native framework initializers (like Vue's `createApp`).
|
|
141
|
-
- Decoupling the `/api` prefix provides better compatibility with Next.js/Nuxt server routes and custom proxy configurations.
|
|
142
|
-
- The `__admins` separation ensures system-level security isolation from application-level user data.
|
|
143
|
-
|
|
144
|
-
**HOW:**
|
|
145
|
-
- Update your server entry points to use the new `createDyrectedApp` factory function.
|
|
146
|
-
- If you have custom integrations targeting internal endpoints, ensure your base URL paths are updated to reflect the removal of the mandatory `/api` prefix.
|
|
147
|
-
- If upgrading an existing installation, migrate your administrative users from the `users` collection to the new `__admins` collection.
|
|
148
|
-
|
|
149
|
-
### Patch Changes
|
|
150
|
-
|
|
151
|
-
- Updated dependencies [00f9439]
|
|
152
|
-
- @dyrected/core@1.0.0
|
|
153
|
-
- @dyrected/sdk@1.0.0
|
package/components.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "default",
|
|
4
|
-
"rsc": false,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "tailwind.config.ts",
|
|
8
|
-
"css": "src/index.css",
|
|
9
|
-
"baseColor": "slate",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@/components",
|
|
15
|
-
"utils": "@/lib/utils"
|
|
16
|
-
}
|
|
17
|
-
}
|
package/eslint.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js'
|
|
2
|
-
import globals from 'globals'
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
-
import tseslint from 'typescript-eslint'
|
|
6
|
-
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
7
|
-
|
|
8
|
-
export default defineConfig([
|
|
9
|
-
globalIgnores(['dist']),
|
|
10
|
-
{
|
|
11
|
-
files: ['**/*.{ts,tsx}'],
|
|
12
|
-
extends: [
|
|
13
|
-
js.configs.recommended,
|
|
14
|
-
tseslint.configs.recommended,
|
|
15
|
-
reactHooks.configs.flat.recommended,
|
|
16
|
-
reactRefresh.configs.vite,
|
|
17
|
-
],
|
|
18
|
-
languageOptions: {
|
|
19
|
-
globals: globals.browser,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
])
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>admin</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/postcss.config.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import re
|
|
3
|
-
|
|
4
|
-
EXCLUDED_WORDS = {
|
|
5
|
-
"default", "ghost", "outline", "secondary", "destructive", "link", "icon",
|
|
6
|
-
"sm", "md", "lg", "xl", "2xl", "top", "bottom", "left", "right",
|
|
7
|
-
"expanded", "collapsed", "sidebar", "floating", "inset", "offcanvas", "none",
|
|
8
|
-
"sidebar_state", "top-right", "asChild", "className", "variant", "size", "side",
|
|
9
|
-
"true", "false", "item", "index", "key", "id", "name", "type", "value", "variant"
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
def prefix_single_class(c):
|
|
13
|
-
if not c or c.startswith(("dy-", "{", "$", "--", "http")):
|
|
14
|
-
return c
|
|
15
|
-
|
|
16
|
-
if ":" in c:
|
|
17
|
-
parts = c.split(":")
|
|
18
|
-
modifiers = parts[:-1]
|
|
19
|
-
base = parts[-1]
|
|
20
|
-
|
|
21
|
-
new_modifiers = []
|
|
22
|
-
for m in modifiers:
|
|
23
|
-
if m.startswith(("group", "peer")):
|
|
24
|
-
new_modifiers.append(f"dy-{m}")
|
|
25
|
-
else:
|
|
26
|
-
new_modifiers.append(m)
|
|
27
|
-
|
|
28
|
-
if base and base not in EXCLUDED_WORDS and not base.startswith("["):
|
|
29
|
-
base = f"dy-{base}"
|
|
30
|
-
|
|
31
|
-
return ":".join(new_modifiers + [base])
|
|
32
|
-
else:
|
|
33
|
-
if c in EXCLUDED_WORDS or c.startswith("["):
|
|
34
|
-
return c
|
|
35
|
-
if c.startswith(("group", "peer")):
|
|
36
|
-
return f"dy-{c}"
|
|
37
|
-
return f"dy-{c}"
|
|
38
|
-
|
|
39
|
-
def prefix_classes_in_string(s):
|
|
40
|
-
if not s: return s
|
|
41
|
-
return " ".join([prefix_single_class(c) for c in s.split()])
|
|
42
|
-
|
|
43
|
-
def process_content(content):
|
|
44
|
-
# 1. className="literal"
|
|
45
|
-
def class_name_replacer(m):
|
|
46
|
-
quote = m.group(1)
|
|
47
|
-
classes = m.group(2)
|
|
48
|
-
return f'className={quote}{prefix_classes_in_string(classes)}{quote}'
|
|
49
|
-
content = re.sub(r'className=([\'"])(.*?)\1', class_name_replacer, content)
|
|
50
|
-
|
|
51
|
-
# 2. cn(...)
|
|
52
|
-
def cn_replacer(m):
|
|
53
|
-
inner = m.group(1)
|
|
54
|
-
def inner_string_replacer(sm):
|
|
55
|
-
quote = sm.group(1)
|
|
56
|
-
s = sm.group(2)
|
|
57
|
-
preceding = inner[:sm.start()]
|
|
58
|
-
# Only exclude if it's a comparison or arrow function
|
|
59
|
-
if preceding.strip().endswith(("===", "!==", "==", "!=", "=>")):
|
|
60
|
-
return sm.group(0)
|
|
61
|
-
|
|
62
|
-
return f'{quote}{prefix_classes_in_string(s)}{quote}'
|
|
63
|
-
new_inner = re.sub(r'([\'"])(.*?)\1', inner_string_replacer, inner)
|
|
64
|
-
return f'cn({new_inner})'
|
|
65
|
-
content = re.sub(r'cn\((.*?)\)', cn_replacer, content, flags=re.DOTALL)
|
|
66
|
-
|
|
67
|
-
# 3. cva(...)
|
|
68
|
-
def cva_replacer(m):
|
|
69
|
-
inner = m.group(1)
|
|
70
|
-
def cva_string_replacer(sm):
|
|
71
|
-
quote = sm.group(1)
|
|
72
|
-
s = sm.group(2)
|
|
73
|
-
following = inner[sm.end():]
|
|
74
|
-
if following.strip().startswith(":"):
|
|
75
|
-
return sm.group(0)
|
|
76
|
-
return f'{quote}{prefix_classes_in_string(s)}{quote}'
|
|
77
|
-
new_inner = re.sub(r'([\'"])(.*?)\1', cva_string_replacer, inner)
|
|
78
|
-
return f'cva({new_inner})'
|
|
79
|
-
content = re.sub(r'cva\((.*?)\)', cva_replacer, content, flags=re.DOTALL)
|
|
80
|
-
|
|
81
|
-
return content
|
|
82
|
-
|
|
83
|
-
def main():
|
|
84
|
-
src_dir = "packages/admin/src"
|
|
85
|
-
for root, dirs, files in os.walk(src_dir):
|
|
86
|
-
for file in files:
|
|
87
|
-
if file.endswith((".tsx", ".ts")):
|
|
88
|
-
filepath = os.path.join(root, file)
|
|
89
|
-
with open(filepath, 'r') as f:
|
|
90
|
-
content = f.read()
|
|
91
|
-
new_content = process_content(content)
|
|
92
|
-
if new_content != content:
|
|
93
|
-
with open(filepath, 'w') as f:
|
|
94
|
-
f.write(new_content)
|
|
95
|
-
print(f"Updated {filepath}")
|
|
96
|
-
|
|
97
|
-
if __name__ == "__main__":
|
|
98
|
-
main()
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import re
|
|
3
|
-
|
|
4
|
-
def prefix_classes_in_string(s):
|
|
5
|
-
# Skip empty strings or strings that already have the prefix
|
|
6
|
-
if not s or s.startswith("dy-"):
|
|
7
|
-
return s
|
|
8
|
-
|
|
9
|
-
# Split by whitespace, prefix each class, then rejoin
|
|
10
|
-
classes = s.split()
|
|
11
|
-
prefixed = []
|
|
12
|
-
for c in classes:
|
|
13
|
-
# Skip variables like {className} or strings that look like CSS variables
|
|
14
|
-
if c.startswith("{") or c.startswith("$") or c.startswith("--"):
|
|
15
|
-
prefixed.append(c)
|
|
16
|
-
# Skip already prefixed
|
|
17
|
-
elif c.startswith("dy-"):
|
|
18
|
-
prefixed.append(c)
|
|
19
|
-
# Prefix everything else (assuming they are tailwind classes)
|
|
20
|
-
else:
|
|
21
|
-
prefixed.append(f"dy-{c}")
|
|
22
|
-
return " ".join(prefixed)
|
|
23
|
-
|
|
24
|
-
def process_content(content):
|
|
25
|
-
# 1. Handle className="literal classes"
|
|
26
|
-
content = re.sub(r'className=([\'"])(.*?)\1',
|
|
27
|
-
lambda m: f'className={m.group(1)}{prefix_classes_in_string(m.group(2))}{m.group(1)}',
|
|
28
|
-
content)
|
|
29
|
-
|
|
30
|
-
# 2. Handle className={cn("literal classes", ...)}
|
|
31
|
-
# We look for strings inside cn(...)
|
|
32
|
-
def cn_match(m):
|
|
33
|
-
# This is a bit rough but works for simple cn calls
|
|
34
|
-
inner = m.group(1)
|
|
35
|
-
# Replace string literals inside the cn call
|
|
36
|
-
new_inner = re.sub(r'([\'"])(.*?)\1',
|
|
37
|
-
lambda sm: f'{sm.group(1)}{prefix_classes_in_string(sm.group(2))}{sm.group(1)}',
|
|
38
|
-
inner)
|
|
39
|
-
return f'cn({new_inner})'
|
|
40
|
-
|
|
41
|
-
content = re.sub(r'cn\((.*?)\)', cn_match, content, flags=re.DOTALL)
|
|
42
|
-
|
|
43
|
-
# 3. Handle @apply in CSS
|
|
44
|
-
content = re.sub(r'@apply (.*?);',
|
|
45
|
-
lambda m: f'@apply {prefix_classes_in_string(m.group(1))};',
|
|
46
|
-
content)
|
|
47
|
-
|
|
48
|
-
return content
|
|
49
|
-
|
|
50
|
-
def main():
|
|
51
|
-
src_dir = "packages/admin/src"
|
|
52
|
-
for root, dirs, files in os.walk(src_dir):
|
|
53
|
-
for file in files:
|
|
54
|
-
if file.endswith((".tsx", ".ts", ".css")):
|
|
55
|
-
filepath = os.path.join(root, file)
|
|
56
|
-
with open(filepath, 'r') as f:
|
|
57
|
-
content = f.read()
|
|
58
|
-
|
|
59
|
-
new_content = process_content(content)
|
|
60
|
-
|
|
61
|
-
if new_content != content:
|
|
62
|
-
with open(filepath, 'w') as f:
|
|
63
|
-
f.write(new_content)
|
|
64
|
-
print(f"Updated {filepath}")
|
|
65
|
-
|
|
66
|
-
if __name__ == "__main__":
|
|
67
|
-
main()
|
package/src/App.css
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
.counter {
|
|
2
|
-
font-size: 16px;
|
|
3
|
-
padding: 5px 10px;
|
|
4
|
-
border-radius: 5px;
|
|
5
|
-
color: var(--accent);
|
|
6
|
-
background: var(--accent-bg);
|
|
7
|
-
border: 2px solid transparent;
|
|
8
|
-
transition: border-color 0.3s;
|
|
9
|
-
margin-bottom: 24px;
|
|
10
|
-
|
|
11
|
-
&:hover {
|
|
12
|
-
border-color: var(--accent-border);
|
|
13
|
-
}
|
|
14
|
-
&:focus-visible {
|
|
15
|
-
outline: 2px solid var(--accent);
|
|
16
|
-
outline-offset: 2px;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.hero {
|
|
21
|
-
position: relative;
|
|
22
|
-
|
|
23
|
-
.base,
|
|
24
|
-
.framework,
|
|
25
|
-
.vite {
|
|
26
|
-
inset-inline: 0;
|
|
27
|
-
margin: 0 auto;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.base {
|
|
31
|
-
width: 170px;
|
|
32
|
-
position: relative;
|
|
33
|
-
z-index: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.framework,
|
|
37
|
-
.vite {
|
|
38
|
-
position: absolute;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.framework {
|
|
42
|
-
z-index: 1;
|
|
43
|
-
top: 34px;
|
|
44
|
-
height: 28px;
|
|
45
|
-
transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg)
|
|
46
|
-
scale(1.4);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.vite {
|
|
50
|
-
z-index: 0;
|
|
51
|
-
top: 107px;
|
|
52
|
-
height: 26px;
|
|
53
|
-
width: auto;
|
|
54
|
-
transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg)
|
|
55
|
-
scale(0.8);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
#center {
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
gap: 25px;
|
|
63
|
-
place-content: center;
|
|
64
|
-
place-items: center;
|
|
65
|
-
flex-grow: 1;
|
|
66
|
-
|
|
67
|
-
@media (max-width: 1024px) {
|
|
68
|
-
padding: 32px 20px 24px;
|
|
69
|
-
gap: 18px;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
#next-steps {
|
|
74
|
-
display: flex;
|
|
75
|
-
border-top: 1px solid var(--border);
|
|
76
|
-
text-align: left;
|
|
77
|
-
|
|
78
|
-
& > div {
|
|
79
|
-
flex: 1 1 0;
|
|
80
|
-
padding: 32px;
|
|
81
|
-
@media (max-width: 1024px) {
|
|
82
|
-
padding: 24px 20px;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.icon {
|
|
87
|
-
margin-bottom: 16px;
|
|
88
|
-
width: 22px;
|
|
89
|
-
height: 22px;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@media (max-width: 1024px) {
|
|
93
|
-
flex-direction: column;
|
|
94
|
-
text-align: center;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
#docs {
|
|
99
|
-
border-right: 1px solid var(--border);
|
|
100
|
-
|
|
101
|
-
@media (max-width: 1024px) {
|
|
102
|
-
border-right: none;
|
|
103
|
-
border-bottom: 1px solid var(--border);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
#next-steps ul {
|
|
108
|
-
list-style: none;
|
|
109
|
-
padding: 0;
|
|
110
|
-
display: flex;
|
|
111
|
-
gap: 8px;
|
|
112
|
-
margin: 32px 0 0;
|
|
113
|
-
|
|
114
|
-
.logo {
|
|
115
|
-
height: 18px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
a {
|
|
119
|
-
color: var(--text-h);
|
|
120
|
-
font-size: 16px;
|
|
121
|
-
border-radius: 6px;
|
|
122
|
-
background: var(--social-bg);
|
|
123
|
-
display: flex;
|
|
124
|
-
padding: 6px 12px;
|
|
125
|
-
align-items: center;
|
|
126
|
-
gap: 8px;
|
|
127
|
-
text-decoration: none;
|
|
128
|
-
transition: box-shadow 0.3s;
|
|
129
|
-
|
|
130
|
-
&:hover {
|
|
131
|
-
box-shadow: var(--shadow);
|
|
132
|
-
}
|
|
133
|
-
.button-icon {
|
|
134
|
-
height: 18px;
|
|
135
|
-
width: 18px;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
@media (max-width: 1024px) {
|
|
140
|
-
margin-top: 20px;
|
|
141
|
-
flex-wrap: wrap;
|
|
142
|
-
justify-content: center;
|
|
143
|
-
|
|
144
|
-
li {
|
|
145
|
-
flex: 1 1 calc(50% - 8px);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
a {
|
|
149
|
-
width: 100%;
|
|
150
|
-
justify-content: center;
|
|
151
|
-
box-sizing: border-box;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
#spacer {
|
|
157
|
-
height: 88px;
|
|
158
|
-
border-top: 1px solid var(--border);
|
|
159
|
-
@media (max-width: 1024px) {
|
|
160
|
-
height: 48px;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.ticks {
|
|
165
|
-
position: relative;
|
|
166
|
-
width: 100%;
|
|
167
|
-
|
|
168
|
-
&::before,
|
|
169
|
-
&::after {
|
|
170
|
-
content: '';
|
|
171
|
-
position: absolute;
|
|
172
|
-
top: -4.5px;
|
|
173
|
-
border: 5px solid transparent;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
&::before {
|
|
177
|
-
left: 0;
|
|
178
|
-
border-left-color: var(--border);
|
|
179
|
-
}
|
|
180
|
-
&::after {
|
|
181
|
-
right: 0;
|
|
182
|
-
border-right-color: var(--border);
|
|
183
|
-
}
|
|
184
|
-
}
|