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.
@@ -0,0 +1,9 @@
1
+ 'use client'
2
+
3
+ import type { Header as HeaderType } from '@/payload-types'
4
+
5
+ import HeaderDD02 from '@/Header/variants/HeaderDD02'
6
+
7
+ export const HeaderNav: React.FC<{ data: HeaderType }> = ({ data }) => {
8
+ return <HeaderDD02 data={data} />
9
+ }
@@ -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
- - `index.tsx` for the HeaderDD02 desktop runtime.
10
- - `MobileBottomNav/index.tsx` because Header02 imports it directly.
11
- - `config.ts` for the Header02 field structure adapted to `HeaderDD02` and `defaultLexical`.
12
- - `RowLabel.tsx` because the Header02 config references `/Header/RowLabel.tsx#RowLabel` for Payload admin array labels.
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
- Before activating this header in an existing project, inspect the current Header global schema and stored Header data. The template installer copies files and backs up the `HeaderDD02` destination folder when it already exists, but it does not automatically replace the active Header global or inspect database content.
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 and integrate them into this project
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 current Header component, Payload Header global, frontend layout, fields, utilities, generated types and styling conventions.
32
- 2. Resolve HeaderDD02 imports against the current project.
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. Adapt HeaderDD02 config to the current Header global without deleting or destructively renaming existing database-backed fields.
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. Integrate the component into the existing header render flow.
38
- 8. Preserve the existing layout, providers, transitions and mobile behaviour.
39
- 9. Add any required CSS variables or utility classes using the current project's styling system.
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 remove the existing header until the replacement is verified.
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
+ }