@orion-studios/payload-blocks 0.1.0
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/LICENSE +21 -0
- package/README.md +134 -0
- package/dist/index.d.mts +51 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +844 -0
- package/dist/index.mjs +803 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Orion Studios
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# @orion-studios/payload-blocks
|
|
2
|
+
|
|
3
|
+
Reusable Payload CMS block definitions and admin components for building content-rich websites.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @orion-studios/payload-blocks
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **9 Production-Ready Blocks**: Hero, RichText, Media, FeatureGrid, Testimonials, FAQ, CTA, FormEmbed, BookingEmbed
|
|
14
|
+
- **Admin UI Components**: Custom block labels and controls
|
|
15
|
+
- **Section Presets**: Pre-configured block combinations for common page sections
|
|
16
|
+
- **Template Starters**: Complete page layouts for contact, landing, services pages
|
|
17
|
+
- **TypeScript Support**: Full type definitions included
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Quick Start
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
// src/collections/Pages.ts
|
|
25
|
+
import { CollectionConfig } from 'payload'
|
|
26
|
+
import { defaultPageLayoutBlocks } from '@orion-studios/payload-blocks'
|
|
27
|
+
|
|
28
|
+
export const Pages: CollectionConfig = {
|
|
29
|
+
slug: 'pages',
|
|
30
|
+
fields: [
|
|
31
|
+
{
|
|
32
|
+
name: 'title',
|
|
33
|
+
type: 'text',
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'layout',
|
|
38
|
+
type: 'blocks',
|
|
39
|
+
blocks: defaultPageLayoutBlocks, // All 9 blocks ready to use
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Using Individual Blocks
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import {
|
|
49
|
+
HeroBlock,
|
|
50
|
+
CtaBlock,
|
|
51
|
+
FaqBlock,
|
|
52
|
+
} from '@orion-studios/payload-blocks'
|
|
53
|
+
|
|
54
|
+
export const Pages: CollectionConfig = {
|
|
55
|
+
slug: 'pages',
|
|
56
|
+
fields: [
|
|
57
|
+
{
|
|
58
|
+
name: 'layout',
|
|
59
|
+
type: 'blocks',
|
|
60
|
+
blocks: [HeroBlock, CtaBlock, FaqBlock], // Pick only what you need
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Using Presets
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import {
|
|
70
|
+
sectionPresets,
|
|
71
|
+
templateStarterPresets,
|
|
72
|
+
clonePresetBlocks,
|
|
73
|
+
} from '@orion-studios/payload-blocks'
|
|
74
|
+
|
|
75
|
+
// Section presets for common patterns
|
|
76
|
+
console.log(sectionPresets)
|
|
77
|
+
// [
|
|
78
|
+
// { id: 'hero-conversion', title: 'Hero + Conversion CTA', blocks: [...] },
|
|
79
|
+
// { id: 'services-grid', title: 'Services Grid', blocks: [...] },
|
|
80
|
+
// { id: 'social-proof', title: 'Testimonials + FAQ', blocks: [...] },
|
|
81
|
+
// { id: 'lead-capture', title: 'Lead Capture', blocks: [...] }
|
|
82
|
+
// ]
|
|
83
|
+
|
|
84
|
+
// Template starters for entire pages
|
|
85
|
+
console.log(Object.keys(templateStarterPresets))
|
|
86
|
+
// ['contact', 'landing', 'services', 'standard']
|
|
87
|
+
|
|
88
|
+
// Clone preset blocks for customization
|
|
89
|
+
const myBlocks = clonePresetBlocks(templateStarterPresets.landing)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Available Blocks
|
|
93
|
+
|
|
94
|
+
### 1. Hero Block
|
|
95
|
+
Large hero section with headline, subheadline, CTA buttons, and optional background image.
|
|
96
|
+
|
|
97
|
+
### 2. Rich Text Block
|
|
98
|
+
Full-featured rich text editor powered by Lexical.
|
|
99
|
+
|
|
100
|
+
### 3. Media Block
|
|
101
|
+
Image/video display with caption support.
|
|
102
|
+
|
|
103
|
+
### 4. Feature Grid Block
|
|
104
|
+
Grid layout for showcasing features, services, or benefits. Supports two variants: cards and highlights.
|
|
105
|
+
|
|
106
|
+
### 5. Testimonials Block
|
|
107
|
+
Customer testimonials with quotes, names, and locations.
|
|
108
|
+
|
|
109
|
+
### 6. FAQ Block
|
|
110
|
+
Frequently asked questions in an accordion format.
|
|
111
|
+
|
|
112
|
+
### 7. CTA Block
|
|
113
|
+
Call-to-action section with headline, description, and button.
|
|
114
|
+
|
|
115
|
+
### 8. Form Embed Block
|
|
116
|
+
Embed form components (customize for your needs).
|
|
117
|
+
|
|
118
|
+
### 9. Booking Embed Block
|
|
119
|
+
Embed booking/scheduling components.
|
|
120
|
+
|
|
121
|
+
## Admin Components
|
|
122
|
+
|
|
123
|
+
The package includes custom admin UI components that enhance the Payload admin experience:
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import { BuilderBlockLabel } from '@orion-studios/payload-blocks'
|
|
127
|
+
|
|
128
|
+
// Used automatically with defaultPageLayoutBlocks
|
|
129
|
+
// Provides better visual labels for blocks in the admin panel
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT © Orion Studios
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as payload from 'payload';
|
|
2
|
+
import { Block } from 'payload';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
declare const BookingEmbedBlock: Block;
|
|
6
|
+
|
|
7
|
+
declare const CtaBlock: Block;
|
|
8
|
+
|
|
9
|
+
declare const FaqBlock: Block;
|
|
10
|
+
|
|
11
|
+
declare const FeatureGridBlock: Block;
|
|
12
|
+
|
|
13
|
+
declare const FormEmbedBlock: Block;
|
|
14
|
+
|
|
15
|
+
declare const HeroBlock: Block;
|
|
16
|
+
|
|
17
|
+
declare const MediaBlock: Block;
|
|
18
|
+
|
|
19
|
+
declare const RichTextBlock: Block;
|
|
20
|
+
|
|
21
|
+
declare const TestimonialsBlock: Block;
|
|
22
|
+
|
|
23
|
+
declare const builderBlockLabelComponent: {
|
|
24
|
+
exportName: string;
|
|
25
|
+
path: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type Props = {
|
|
29
|
+
blockType: string;
|
|
30
|
+
rowLabel?: string;
|
|
31
|
+
rowNumber?: number;
|
|
32
|
+
};
|
|
33
|
+
declare function BuilderBlockLabel({ blockType, rowLabel, rowNumber }: Props): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
type BuilderBlock = {
|
|
36
|
+
blockType: string;
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
};
|
|
39
|
+
type SectionPreset = {
|
|
40
|
+
id: string;
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
blocks: BuilderBlock[];
|
|
44
|
+
};
|
|
45
|
+
declare const sectionPresets: SectionPreset[];
|
|
46
|
+
declare const templateStarterPresets: Record<string, BuilderBlock[]>;
|
|
47
|
+
declare function clonePresetBlocks(blocks: BuilderBlock[]): BuilderBlock[];
|
|
48
|
+
|
|
49
|
+
declare const defaultPageLayoutBlocks: payload.Block[];
|
|
50
|
+
|
|
51
|
+
export { BookingEmbedBlock, BuilderBlockLabel, CtaBlock, FaqBlock, FeatureGridBlock, FormEmbedBlock, HeroBlock, MediaBlock, RichTextBlock, type SectionPreset, TestimonialsBlock, builderBlockLabelComponent, clonePresetBlocks, defaultPageLayoutBlocks, sectionPresets, templateStarterPresets };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as payload from 'payload';
|
|
2
|
+
import { Block } from 'payload';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
declare const BookingEmbedBlock: Block;
|
|
6
|
+
|
|
7
|
+
declare const CtaBlock: Block;
|
|
8
|
+
|
|
9
|
+
declare const FaqBlock: Block;
|
|
10
|
+
|
|
11
|
+
declare const FeatureGridBlock: Block;
|
|
12
|
+
|
|
13
|
+
declare const FormEmbedBlock: Block;
|
|
14
|
+
|
|
15
|
+
declare const HeroBlock: Block;
|
|
16
|
+
|
|
17
|
+
declare const MediaBlock: Block;
|
|
18
|
+
|
|
19
|
+
declare const RichTextBlock: Block;
|
|
20
|
+
|
|
21
|
+
declare const TestimonialsBlock: Block;
|
|
22
|
+
|
|
23
|
+
declare const builderBlockLabelComponent: {
|
|
24
|
+
exportName: string;
|
|
25
|
+
path: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type Props = {
|
|
29
|
+
blockType: string;
|
|
30
|
+
rowLabel?: string;
|
|
31
|
+
rowNumber?: number;
|
|
32
|
+
};
|
|
33
|
+
declare function BuilderBlockLabel({ blockType, rowLabel, rowNumber }: Props): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
type BuilderBlock = {
|
|
36
|
+
blockType: string;
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
};
|
|
39
|
+
type SectionPreset = {
|
|
40
|
+
id: string;
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
blocks: BuilderBlock[];
|
|
44
|
+
};
|
|
45
|
+
declare const sectionPresets: SectionPreset[];
|
|
46
|
+
declare const templateStarterPresets: Record<string, BuilderBlock[]>;
|
|
47
|
+
declare function clonePresetBlocks(blocks: BuilderBlock[]): BuilderBlock[];
|
|
48
|
+
|
|
49
|
+
declare const defaultPageLayoutBlocks: payload.Block[];
|
|
50
|
+
|
|
51
|
+
export { BookingEmbedBlock, BuilderBlockLabel, CtaBlock, FaqBlock, FeatureGridBlock, FormEmbedBlock, HeroBlock, MediaBlock, RichTextBlock, type SectionPreset, TestimonialsBlock, builderBlockLabelComponent, clonePresetBlocks, defaultPageLayoutBlocks, sectionPresets, templateStarterPresets };
|