@pantheon-systems/create-p1-starter-kit 0.1.0 → 0.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/package.json
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pantheon-systems/create-p1-starter-kit",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Scaffold a new P1 starter project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"create-p1-starter-kit": "./index.js"
|
|
8
8
|
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "node scripts/build-template.js",
|
|
11
|
+
"prepublishOnly": "npm run build"
|
|
12
|
+
},
|
|
9
13
|
"files": [
|
|
10
14
|
"index.js",
|
|
11
15
|
"lib/",
|
|
12
16
|
"template/"
|
|
13
17
|
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.org/",
|
|
21
|
+
"provenance": false
|
|
22
|
+
},
|
|
14
23
|
"repository": {
|
|
15
24
|
"type": "git",
|
|
16
25
|
"url": "https://github.com/pantheon-systems/puck-css-integration.git",
|
|
@@ -31,8 +40,5 @@
|
|
|
31
40
|
"@clack/prompts": "^1.5.1",
|
|
32
41
|
"picocolors": "^1.1.1"
|
|
33
42
|
},
|
|
34
|
-
"license": "MIT"
|
|
35
|
-
|
|
36
|
-
"build": "node scripts/build-template.js"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
43
|
+
"license": "MIT"
|
|
44
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isValidElement, type ReactNode } from "react";
|
|
1
2
|
import { blockPaddingClass } from "./block-padding";
|
|
2
3
|
import ReactMarkdown from "react-markdown";
|
|
3
4
|
|
|
@@ -19,7 +20,10 @@ export const paragraphBlock = {
|
|
|
19
20
|
defaultProps: {
|
|
20
21
|
text: "Add your copy here. You can use multiple lines.",
|
|
21
22
|
},
|
|
22
|
-
render: ({ text }: { text?: string }) => {
|
|
23
|
+
render: ({ text }: { text?: string | ReactNode }) => {
|
|
24
|
+
if (isValidElement(text)) {
|
|
25
|
+
return <div className={blockPaddingClass}>{text}</div>;
|
|
26
|
+
}
|
|
23
27
|
const markdown = asMarkdownText(text);
|
|
24
28
|
return (
|
|
25
29
|
<div className={blockPaddingClass}>
|
package/template/package.json
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@pantheon-systems/cpub-react-sdk": "^5.2.1",
|
|
14
|
-
"@pantheon-systems/css-client": "^0.4.
|
|
15
|
-
"@pantheon-systems/p1-next-sdk": "^0.1
|
|
16
|
-
"@pantheon-systems/puck-css": "^0.4.
|
|
14
|
+
"@pantheon-systems/css-client": "^0.4.1",
|
|
15
|
+
"@pantheon-systems/p1-next-sdk": "^0.4.1",
|
|
16
|
+
"@pantheon-systems/puck-css": "^0.4.1",
|
|
17
17
|
"@puckeditor/core": "^0.21.1",
|
|
18
18
|
"@tailwindcss/postcss": "^4.2.2",
|
|
19
19
|
"classnames": "^2.5.1",
|
package/template/README.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Content Publisher Site Sample
|
|
2
|
-
|
|
3
|
-
A sample Next.js site demonstrating the Content Publisher CMS — Pantheon's visual page-building and content management system. Content Publisher combines a Puck-based drag-and-drop editor with server-side datasource resolution, enabling authors to build dynamic, data-driven pages without writing code.
|
|
4
|
-
|
|
5
|
-
## What's included
|
|
6
|
-
|
|
7
|
-
- **Visual page editor** — Puck-powered drag-and-drop editing at `/p1/<path>` with built-in blocks for typography, media, layout, and actions
|
|
8
|
-
- **Site structure management** — Dashboard at `/p1` for creating and organizing pages and templates
|
|
9
|
-
- **Datasource bindings** — Connect page blocks to live data from Content Publisher articles, external APIs (SWAPI, Pokemon GraphQL), and URL route parameters
|
|
10
|
-
- **Next.js App Router** — Server components, catch-all routing, and API route handlers via `@pantheon-systems/p1-client-sdk`
|
|
11
|
-
|
|
12
|
-
## Getting started
|
|
13
|
-
|
|
14
|
-
1. Copy the environment file and fill in your credentials:
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
cp .env.example .env
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
| Variable | Description |
|
|
21
|
-
| ------------- | -------------------------- |
|
|
22
|
-
| `PCC_SITE_ID` | Your Content Cloud site ID |
|
|
23
|
-
| `PCC_TOKEN` | API token for your site |
|
|
24
|
-
|
|
25
|
-
2. Install dependencies and start the dev server:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
npm install
|
|
29
|
-
npm run dev
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
3. Open http://localhost:3000 to view the site, or http://localhost:3000/p1 for the page management dashboard.
|
|
33
|
-
|
|
34
|
-
## Project structure
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
app/
|
|
38
|
-
page.tsx # Site root (renders via Puck)
|
|
39
|
-
[...puckPath]/ # Catch-all route for published pages
|
|
40
|
-
p1/
|
|
41
|
-
page.tsx # P1 dashboard — lists pages, links to editor
|
|
42
|
-
[...p1]/ # Editor & renderer for any page path
|
|
43
|
-
api/[...p1]/route.ts # API handler (GET/POST/DELETE) for page data
|
|
44
|
-
components/puck/ # Block definitions (Heading, Paragraph, Image, etc.)
|
|
45
|
-
lib/builtin-datasources.ts # Datasource registry (SWAPI, Pokemon, articles, URL params)
|
|
46
|
-
puck.config.tsx # Puck editor configuration — block registry & categories
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Customization
|
|
50
|
-
|
|
51
|
-
- **Add blocks** — Create a new component in `components/puck/`, then register it in `puck.config.tsx`
|
|
52
|
-
- **Add datasources** — Define a new `DatasourceDefinition` in `lib/builtin-datasources.ts` to make external data available to block fields via `{{ datasource.field }}` expressions
|
|
53
|
-
- **Change styling** — The project uses Tailwind CSS v4; edit `app/styles.css` or individual block components
|