blocks-dusted 0.1.8 → 0.1.10
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/package.json +1 -1
- package/src/commands/header.js +13 -52
- package/templates/components/HeaderDD02/Component.client.tsx +9 -0
- package/templates/components/HeaderDD02/Component.tsx +10 -0
- package/templates/components/HeaderDD02/Header.config.ts +33 -0
- package/templates/components/HeaderDD02/MobileBottomNav/index.tsx +352 -257
- package/templates/components/HeaderDD02/Nav/index.tsx +9 -0
- package/templates/components/HeaderDD02/README.md +23 -16
- package/templates/components/HeaderDD02/hooks/revalidateHeader.ts +11 -0
- package/templates/components/HeaderDD02/index.tsx +313 -229
- package/templates/components/HeaderDD02/manifest.json +32 -16
|
@@ -4,48 +4,55 @@ HeaderDD02 is the exported Header02 implementation from DesignsDustedv3.
|
|
|
4
4
|
|
|
5
5
|
This header uses the shared `defaultLexical` editor standard from `@/fields/defaultLexical`. Project-specific Lexical blocks are intentionally not bundled. The nested `BlocksFeature` uses an empty `blocks` array so each target project can register only the blocks it requires.
|
|
6
6
|
|
|
7
|
+
The header workflow backs up the active `src/Header` folder before installing a complete replacement Header shell wired directly to `HeaderDD02`.
|
|
8
|
+
|
|
7
9
|
Included files:
|
|
8
10
|
|
|
9
|
-
- `
|
|
10
|
-
- `
|
|
11
|
-
- `
|
|
12
|
-
- `
|
|
11
|
+
- `Component.tsx` for the active server Header component.
|
|
12
|
+
- `Component.client.tsx` for the active client Header wrapper.
|
|
13
|
+
- `Nav/index.tsx` to render `HeaderDD02` directly.
|
|
14
|
+
- `config.ts` for the active Payload Header global.
|
|
15
|
+
- `hooks/revalidateHeader.ts` for Header global revalidation.
|
|
16
|
+
- `RowLabel.tsx` for Payload admin array labels.
|
|
17
|
+
- `variants/HeaderDD02/index.tsx` for the HeaderDD02 desktop runtime.
|
|
18
|
+
- `variants/HeaderDD02/MobileBottomNav/index.tsx` because Header02 imports it directly.
|
|
19
|
+
- `variants/HeaderDD02/config.ts` for the Header02 field structure adapted to `HeaderDD02` and `defaultLexical`.
|
|
13
20
|
|
|
14
21
|
Not included:
|
|
15
22
|
|
|
16
23
|
- Header01 and Header03 implementations.
|
|
17
|
-
- The parent multi-variant Header shell.
|
|
18
24
|
- Source project Lexical blocks: `AnimatedText`, `ButtonWithIcon`, `CounterBlock`, and `MediaBlock`.
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
Removed source Lexical block imports: `@/blocks/AnimatedText/config`, `@/blocks/ButtonWithIcon/config`, `@/blocks/CounterBlock/config`, `@/blocks/MediaBlock/config`.
|
|
27
|
+
|
|
28
|
+
Before activating this header in an existing project, inspect the current Header global schema and stored Header data. The header workflow preserves the old active Header folder as `src/Header.bak`, `src/Header.bak.1`, or the next available backup path. It does not rewrite stored rich text data or run destructive migrations.
|
|
21
29
|
|
|
22
30
|
## AI handover prompt
|
|
23
31
|
|
|
24
32
|
```prompt
|
|
25
|
-
Review the newly installed HeaderDD02 files
|
|
33
|
+
Review the newly installed HeaderDD02 files in this project
|
|
26
34
|
|
|
27
35
|
Do not assume the source project architecture matches this repository.
|
|
28
36
|
|
|
29
37
|
Tasks:
|
|
30
38
|
|
|
31
|
-
1. Inspect the
|
|
32
|
-
2.
|
|
39
|
+
1. Inspect the active Header component, Payload Header global, frontend layout, fields, utilities, generated types and styling conventions.
|
|
40
|
+
2. Confirm `src/Header/Component.tsx`, `src/Header/Component.client.tsx`, `src/Header/Nav/index.tsx`, and `src/Header/config.ts` now point to HeaderDD02.
|
|
33
41
|
3. Reuse existing project utilities and fields where appropriate.
|
|
34
|
-
4.
|
|
42
|
+
4. Confirm the active Header global has not created a duplicate Header registration.
|
|
35
43
|
5. Keep the shared defaultLexical standard.
|
|
36
44
|
6. Keep BlocksFeature({ blocks: [] }).
|
|
37
|
-
7.
|
|
38
|
-
8.
|
|
39
|
-
9.
|
|
40
|
-
10. Report every file modified and any manual content migration required.
|
|
45
|
+
7. Preserve layout, providers, transitions and mobile behaviour that are intentionally kept by the target project.
|
|
46
|
+
8. Add any required CSS variables or utility classes using the current project's styling system.
|
|
47
|
+
9. Report every file modified and any manual content migration required.
|
|
41
48
|
|
|
42
49
|
Do not modify database records automatically.
|
|
43
50
|
Do not run destructive migrations.
|
|
44
|
-
Do not
|
|
51
|
+
Do not delete the backup folder until the replacement is verified.
|
|
45
52
|
```
|
|
46
53
|
|
|
47
54
|
## Bundled shared UI primitives
|
|
48
55
|
|
|
49
56
|
HeaderDD02 includes shared templates for `src/components/ui/navigation-menu.tsx`, `src/components/animate-ui/components/animate/tooltip.tsx`, `src/components/animate-ui/primitives/animate/tooltip.tsx`, `src/components/animate-ui/primitives/animate/slot.tsx`, and `src/lib/get-strict-context.tsx`. The installer copies them only when missing and preserves existing target files.
|
|
50
57
|
|
|
51
|
-
If package dependencies are missing, run the install command printed by the CLI, for example `pnpm add @radix-ui/react-navigation-menu class-variance-authority motion @floating-ui/react`.
|
|
58
|
+
If package dependencies are missing, run the install command printed by the CLI, for example `pnpm add @radix-ui/react-navigation-menu class-variance-authority motion @floating-ui/react`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GlobalAfterChangeHook } from 'payload'
|
|
2
|
+
import { revalidateTag } from 'next/cache'
|
|
3
|
+
|
|
4
|
+
export const revalidateHeader: GlobalAfterChangeHook = ({ doc, req: { payload, context } }) => {
|
|
5
|
+
if (!context.disableRevalidate) {
|
|
6
|
+
payload.logger.info('Revalidating header')
|
|
7
|
+
revalidateTag('global_header')
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return doc
|
|
11
|
+
}
|