Skip to content

Commit 23d50a5

Browse files
authored
Merge pull request #62 from LiveDuo/feature/craftjs
Replace Grapes with Craft.js
2 parents a613c34 + 7d15714 commit 23d50a5

File tree

779 files changed

+21086
-20278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

779 files changed

+21086
-20278
lines changed

.github/workflows/tests.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Tests
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, feature/**]
66
pull_request:
7-
branches: [main]
7+
branches: [main, feature/**]
88
workflow_dispatch:
99
inputs:
1010
mode:
11-
description: 'Runtime Mode: "standard" or "interactive"'
11+
description: 'Runtime Mode: "standard" or "interactive"'
1212
required: false
1313
default: 'standard'
1414

@@ -21,15 +21,16 @@ jobs:
2121
node-version: [16.x]
2222

2323
steps:
24-
- uses: actions/checkout@v2
25-
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v1
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-node@v3
2726
with:
2827
node-version: ${{ matrix.node-version }}
29-
- run: npm i -g npm@7.5
28+
- uses: actions/cache@v3
29+
id: playwright-cache
30+
with:
31+
path: ~/.cache/ms-playwright
32+
key: ${{ runner.os }}-playwright-1.28.0
3033
- run: npm ci
31-
- run: cd lib/destack && npm run build
32-
- name: Setup tmate session
33-
uses: mxschmitt/action-tmate@v3
34-
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'interactive' }}
35-
- run: npm test
34+
- run: npx playwright install --with-deps
35+
if: steps.playwright-cache.outputs.cache-hit != 'true'
36+
- run: CI=true npm run test:e2e

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
# testing
99
/coverage
10+
test-results
1011

1112
# next.js
1213
/.next/

README.md

+15-43
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Build landing pages visually right in your React or Next.js projects. Deploy them zero further configuration!
44

5-
**Examples:** [prettyfunnels.com](https://www.prettyfunnels.com/landing), [Destack Online Builder](https://destack-page.vercel.app/)
5+
**🏭 Examples:** [prettyfunnels.com](https://www.prettyfunnels.com/landing), [getdestack.com](https://www.getdestack.com/)
66

77
# Announcements
88

@@ -18,9 +18,9 @@ You can check it out at [destack-starter-beta](https://github.com/LiveDuo/destac
1818

1919
# What's Destack?
2020

21-
It's a tool to build landing pages within your [React](https://reactjs.org/) or [Next.js](https://nextjs.org/) projects. It's powered by [Grapes.js](https://grapesjs.com/) and includes the complete set of blocks from [Tailblocks](https://tailblocks.cc/), [Meraki UI](https://merakiui.com/) and [Hyper UI](https://www.hyperui.dev/). Supports asset uploading, form submission and a variaty of Tailwind colors.
21+
It's a tool to build landing pages within your [React](https://reactjs.org/) or [Next.js](https://nextjs.org/) projects. Destack includes multiple components from [Tailblocks](https://tailblocks.cc/), [Meraki UI](https://merakiui.com/) and [Hyper UI](https://www.hyperui.dev/). It also supports image uploads and form submissions.
2222

23-
*Destack is a tool to help you stop worrying about the marketing pages and focus on your project.*
23+
*Destack helps you stop worrying about marketing pages so you can focus on your project.*
2424

2525
# Themes
2626

@@ -30,7 +30,7 @@ Destack now supports theme selection.
3030

3131
<tr>
3232
<td width="48%">
33-
<img src="https://github.com/LiveDuo/destack/raw/main/assets/theme-modal.png"/>
33+
<img src="https://raw.githubusercontent.com/LiveDuo/destack/feature/craftjs/assets/themes/screenshot-craft.png"/>
3434
Theme selection
3535
</td>
3636
<td width="48%"><img src="https://github.com/LiveDuo/destack/raw/main/assets/theme-meraki-ui.png"/>Meraki UI (<a href="https://merakiui.com/components">Components</a>)</td>
@@ -41,9 +41,10 @@ Destack now supports theme selection.
4141
</tr>
4242
</table>
4343

44-
<p>
45-
<b>Tip:</b> Change theme by clicking the theme icon. <img align="center" width="80px" src="https://github.com/LiveDuo/destack/raw/main/assets/theme-icon.png"/>
46-
</p>
44+
45+
### Contribute (add a new theme)
46+
47+
There are many open source Tailwind themes that Destack can support. If you want to help adding a new theme create a new topic in [discussions](https://github.com/LiveDuo/destack/discussions) or reach out to me on [twitter](https://twitter.com/andreas_tzionis).
4748

4849
# Features
4950

@@ -53,7 +54,7 @@ There are hundreds of well designed and heavily functional blocks from [Tailbloc
5354

5455
#### 🃏 Delightful Builder
5556

56-
Powered by [Grapes.js](https://grapesjs.com/), a flexible and feature-full editor similar to Webflow that supports margins, paddings, borders and a lot of others CSS-like options that are familiar to developers.
57+
Powered by [Craft.js](https://craft.js.org/), a minimal page-builder framework. The builder was created with simplicity in mind and aims to be quickest way to build a landing page for a side-project.
5758

5859
#### 🕹 Data Ownership
5960

@@ -89,20 +90,20 @@ npm i destack
8990

9091
Create `pages/api/builder/handle.js` and add the following:
9192
```js
92-
export { handleData as default, config } from 'destack/build/server'
93+
export { handleEditor as default, config } from 'destack/build/server'
9394
```
9495

9596
##### 3. Then create a new page
9697

9798
On any Next.js page you want to setup Destack:
9899
```js
99-
import 'grapesjs/dist/css/grapes.min.css'
100+
import 'destack/build/browser/index.css'
100101
export { getStaticProps } from 'destack/build/server'
101102
export { ContentProvider as default } from 'destack'
102103
```
103104

104105
<details>
105-
<summary>How to use along other components</summary>
106+
<summary>How to use the legacy page-builder (Grapesjs)</summary>
106107
<br>
107108

108109
```js
@@ -147,13 +148,13 @@ In `package.json`:
147148

148149
In any React.js component you want to setup Destack:
149150
```js
150-
import 'grapesjs/dist/css/grapes.min.css'
151+
import 'destack/build/browser/index.css'
151152
export { ContentProviderReact as default } from 'destack'
152153

153154
```
154155

155156
<details>
156-
<summary>How to use along other components</summary>
157+
<summary>How to use the legacy page-builder (Grapesjs)</summary>
157158
<br>
158159

159160
```js
@@ -203,33 +204,6 @@ export default App
203204
- Select the image you want to update and click on it to add it to the page
204205
- Note: Images are uploaded to `public/uploaded` with their original filenames
205206

206-
### Show editor in production
207-
208-
- Install Destack to a new or existing project
209-
- Set `showEditorInProd={true}` in the `ContentProvider` component
210-
- The result should be similar to [Destack Online Builder](https://destack-page.vercel.app/)
211-
212-
Note: this is only available for Next.js.
213-
214-
<details>
215-
<summary>Code snippet</summary>
216-
<br>
217-
218-
```js
219-
import { ContentProvider } from 'destack'
220-
import 'grapesjs/dist/css/grapes.min.css'
221-
222-
export { getStaticProps } from 'destack/build/server'
223-
224-
export default function Page(props) {
225-
return (
226-
<div style={{height: '100%'}}>
227-
<ContentProvider {...props} showEditorInProd={true}/>
228-
</div>)
229-
}
230-
```
231-
</details>
232-
233207
# Multi-page Support
234208

235209
### Next.js
@@ -248,7 +222,7 @@ Install a routing library such as `react-router-dom` or `router-tutorial` in the
248222

249223
This project was nothing that was planned and design in depth in advance. Instead it was evolved out of the need and enjoyment of using some amazing tools and prototype quickly. These projects heavily improved my developer life and a few of my friends'.
250224

251-
> Next.js 🅧 ➕ Tailwind CSS 🍃 ➕ Grapes.js 🍇 = 💣💣
225+
> Next.js 🅧 ➕ Tailwind CSS 🍃 ➕ Craft.js 🧶 = 💣💣
252226
253227
Please go and show these projects some love (⭐️).
254228

@@ -262,7 +236,5 @@ Don't forget to check out [Tailblocks](https://tailblocks.cc/), [Meraki UI](http
262236
Made with [contributors-img](https://contrib.rocks).
263237

264238
# Upcoming Tasks
265-
- [ ] Custom tailwind.config.js file
266239
- [ ] Add admin UI as a Next.js route
267-
- [ ] Migrate to Craft.js (or similar)
268240

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/saved/RenderState.tsx

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React, { useEffect, useState } from 'react'
2+
3+
import Banner1 from '../themes/hyperui/Banner1'
4+
5+
const Components = {
6+
Banner1: Banner1,
7+
}
8+
9+
const parse = (json, nodeId: string, parentNodeId?: string) => {
10+
const childNodeNames: string[] = json[nodeId]?.nodes || []
11+
const ReactComponent = Components[json[nodeId].type.resolvedName]
12+
const extendedProps = { ...json[nodeId].props, parentNodeId, nodeId, key: nodeId }
13+
14+
if (childNodeNames.length === 0) {
15+
return <ReactComponent {...extendedProps} />
16+
} else {
17+
const childNodes = childNodeNames.map((childNodeId) => parse(json, childNodeId, nodeId))
18+
if (ReactComponent) {
19+
return <ReactComponent {...extendedProps}>{childNodes}</ReactComponent>
20+
} else {
21+
return <div>{childNodes}</div>
22+
}
23+
}
24+
}
25+
26+
const RenderFromState = ({ data }) => {
27+
const [json, setJson] = useState(null)
28+
29+
useEffect(() => {
30+
setJson(JSON.parse(data[0].content))
31+
}, [])
32+
33+
return json && parse(json, 'ROOT')
34+
}
35+
export default RenderFromState

assets/themes/logo-hyperui.png

1.73 KB
Loading

assets/themes/logo-merakiui.png

2.77 KB
Loading

assets/themes/logo-tailblocks.png

4.47 KB
Loading

assets/themes/screenshot-craft.png

217 KB
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

dev/nextjs-project/data/another.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"ROOT": {
3+
"type": { "resolvedName": "Container" },
4+
"isCanvas": true,
5+
"props": { "width": "100%", "height": "800px" },
6+
"displayName": "Container",
7+
"custom": { "displayName": "App" },
8+
"hidden": false,
9+
"nodes": [],
10+
"linkedNodes": {}
11+
}
12+
}

dev/nextjs-project/data/default.json

+10-5
Large diffs are not rendered by default.

dev/nextjs-project/data/grapes.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"html":"<section class=\"text-gray-600 body-font\"><div class=\"container px-5 py-24 mx-auto\"><div class=\"text-center mb-20\"><h1 class=\"sm:text-3xl text-2xl font-medium title-font text-gray-900 mb-4\">Raw Denim Heirloom Man Braid</h1><p class=\"text-base leading-relaxed xl:w-2/4 lg:w-3/4 mx-auto text-gray-500s\">Blue bottle crucifix vinyl post-ironic four dollar toast vegan taxidermy. Gastropub indxgo juice poutine, ramps microdosing banh mi pug.</p><div class=\"flex mt-6 justify-center\"><div class=\"w-16 h-1 rounded-full bg-indigo-500 inline-flex\"></div></div></div><div class=\"flex flex-wrap sm:-m-4 -mx-4 -mb-10 -mt-4 md:space-y-0 space-y-6\"><div class=\"p-4 md:w-1/3 flex flex-col text-center items-center\"><div class=\"w-20 h-20 inline-flex items-center justify-center rounded-full bg-indigo-100 text-indigo-500 mb-5 flex-shrink-0\"><svg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewBox=\"0 0 24 24\" class=\"w-10 h-10\"><path d=\"M22 12h-4l-3 9L9 3l-3 9H2\"></path></svg></div><div class=\"flex-grow\"><h2 class=\"text-gray-900 text-lg title-font font-medium mb-3\">Shooting Stars</h2><p class=\"leading-relaxed text-base\">Blue bottle crucifix vinyl post-ironic four dollar toast vegan taxidermy. Gastropub indxgo juice poutine, ramps microdosing banh mi pug VHS try-hard.</p><a class=\"mt-3 text-indigo-500 inline-flex items-center\">Learn More\n <svg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewBox=\"0 0 24 24\" class=\"w-4 h-4 ml-2\"><path d=\"M5 12h14M12 5l7 7-7 7\"></path></svg></a></div></div><div class=\"p-4 md:w-1/3 flex flex-col text-center items-center\"><div class=\"w-20 h-20 inline-flex items-center justify-center rounded-full bg-indigo-100 text-indigo-500 mb-5 flex-shrink-0\"><svg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewBox=\"0 0 24 24\" class=\"w-10 h-10\"><circle cx=\"6\" cy=\"6\" r=\"3\"></circle><circle cx=\"6\" cy=\"18\" r=\"3\"></circle><path d=\"M20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12\"></path></svg></div><div class=\"flex-grow\"><h2 class=\"text-gray-900 text-lg title-font font-medium mb-3\">The Catalyzer</h2><p class=\"leading-relaxed text-base\">Blue bottle crucifix vinyl post-ironic four dollar toast vegan taxidermy. Gastropub indxgo juice poutine, ramps microdosing banh mi pug VHS try-hard.</p><a class=\"mt-3 text-indigo-500 inline-flex items-center\">Learn More\n <svg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewBox=\"0 0 24 24\" class=\"w-4 h-4 ml-2\"><path d=\"M5 12h14M12 5l7 7-7 7\"></path></svg></a></div></div><div class=\"p-4 md:w-1/3 flex flex-col text-center items-center\"><div class=\"w-20 h-20 inline-flex items-center justify-center rounded-full bg-indigo-100 text-indigo-500 mb-5 flex-shrink-0\"><svg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewBox=\"0 0 24 24\" class=\"w-10 h-10\"><path d=\"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2\"></path><circle cx=\"12\" cy=\"7\" r=\"4\"></circle></svg></div><div class=\"flex-grow\"><h2 class=\"text-gray-900 text-lg title-font font-medium mb-3\">Neptune</h2><p class=\"leading-relaxed text-base\">Blue bottle crucifix vinyl post-ironic four dollar toast vegan taxidermy. Gastropub indxgo juice poutine, ramps microdosing banh mi pug VHS try-hard.</p><a class=\"mt-3 text-indigo-500 inline-flex items-center\">Learn More\n <svg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewBox=\"0 0 24 24\" class=\"w-4 h-4 ml-2\"><path d=\"M5 12h14M12 5l7 7-7 7\"></path></svg></a></div></div></div><button type=\"button\" class=\"flex mx-auto mt-16 text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-none hover:bg-indigo-600 rounded text-lg\">Button</button></div></section>","components":"[{\"tagName\":\"section\",\"classes\":[\"text-gray-600\",\"body-font\"],\"components\":[{\"classes\":[\"container\",\"px-5\",\"py-24\",\"mx-auto\"],\"components\":[{\"classes\":[\"text-center\",\"mb-20\"],\"components\":[{\"tagName\":\"h1\",\"type\":\"text\",\"classes\":[\"sm:text-3xl\",\"text-2xl\",\"font-medium\",\"title-font\",\"text-gray-900\",\"mb-4\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Raw Denim Heirloom Man Braid\"}]},{\"tagName\":\"p\",\"type\":\"text\",\"classes\":[\"text-base\",\"leading-relaxed\",\"xl:w-2/4\",\"lg:w-3/4\",\"mx-auto\",\"text-gray-500s\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Blue bottle crucifix vinyl post-ironic four dollar toast vegan taxidermy. Gastropub indxgo juice poutine, ramps microdosing banh mi pug.\"}]},{\"classes\":[\"flex\",\"mt-6\",\"justify-center\"],\"components\":[{\"classes\":[\"w-16\",\"h-1\",\"rounded-full\",\"bg-indigo-500\",\"inline-flex\"]}]}]},{\"classes\":[\"flex\",\"flex-wrap\",\"sm:-m-4\",\"-mx-4\",\"-mb-10\",\"-mt-4\",\"md:space-y-0\",\"space-y-6\"],\"components\":[{\"classes\":[\"p-4\",\"md:w-1/3\",\"flex\",\"flex-col\",\"text-center\",\"items-center\"],\"components\":[{\"classes\":[\"w-20\",\"h-20\",\"inline-flex\",\"items-center\",\"justify-center\",\"rounded-full\",\"bg-indigo-100\",\"text-indigo-500\",\"mb-5\",\"flex-shrink-0\"],\"components\":[{\"type\":\"svg\",\"classes\":[\"w-10\",\"h-10\"],\"attributes\":{\"fill\":\"none\",\"stroke\":\"currentColor\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"2\",\"viewBox\":\"0 0 24 24\"},\"components\":[{\"tagName\":\"path\",\"type\":\"svg-in\",\"attributes\":{\"d\":\"M22 12h-4l-3 9L9 3l-3 9H2\"}}]}]},{\"classes\":[\"flex-grow\"],\"components\":[{\"tagName\":\"h2\",\"type\":\"text\",\"classes\":[\"text-gray-900\",\"text-lg\",\"title-font\",\"font-medium\",\"mb-3\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Shooting Stars\"}]},{\"tagName\":\"p\",\"type\":\"text\",\"classes\":[\"leading-relaxed\",\"text-base\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Blue bottle crucifix vinyl post-ironic four dollar toast vegan taxidermy. Gastropub indxgo juice poutine, ramps microdosing banh mi pug VHS try-hard.\"}]},{\"type\":\"link\",\"classes\":[\"mt-3\",\"text-indigo-500\",\"inline-flex\",\"items-center\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Learn More\\n \"},{\"type\":\"svg\",\"classes\":[\"w-4\",\"h-4\",\"ml-2\"],\"attributes\":{\"fill\":\"none\",\"stroke\":\"currentColor\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"2\",\"viewBox\":\"0 0 24 24\"},\"components\":[{\"tagName\":\"path\",\"type\":\"svg-in\",\"attributes\":{\"d\":\"M5 12h14M12 5l7 7-7 7\"}}]}]}]}]},{\"classes\":[\"p-4\",\"md:w-1/3\",\"flex\",\"flex-col\",\"text-center\",\"items-center\"],\"components\":[{\"classes\":[\"w-20\",\"h-20\",\"inline-flex\",\"items-center\",\"justify-center\",\"rounded-full\",\"bg-indigo-100\",\"text-indigo-500\",\"mb-5\",\"flex-shrink-0\"],\"components\":[{\"type\":\"svg\",\"classes\":[\"w-10\",\"h-10\"],\"attributes\":{\"fill\":\"none\",\"stroke\":\"currentColor\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"2\",\"viewBox\":\"0 0 24 24\"},\"components\":[{\"tagName\":\"circle\",\"type\":\"svg-in\",\"attributes\":{\"cx\":\"6\",\"cy\":\"6\",\"r\":\"3\"}},{\"tagName\":\"circle\",\"type\":\"svg-in\",\"attributes\":{\"cx\":\"6\",\"cy\":\"18\",\"r\":\"3\"}},{\"tagName\":\"path\",\"type\":\"svg-in\",\"attributes\":{\"d\":\"M20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12\"}}]}]},{\"classes\":[\"flex-grow\"],\"components\":[{\"tagName\":\"h2\",\"type\":\"text\",\"classes\":[\"text-gray-900\",\"text-lg\",\"title-font\",\"font-medium\",\"mb-3\"],\"components\":[{\"type\":\"textnode\",\"content\":\"The Catalyzer\"}]},{\"tagName\":\"p\",\"type\":\"text\",\"classes\":[\"leading-relaxed\",\"text-base\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Blue bottle crucifix vinyl post-ironic four dollar toast vegan taxidermy. Gastropub indxgo juice poutine, ramps microdosing banh mi pug VHS try-hard.\"}]},{\"type\":\"link\",\"classes\":[\"mt-3\",\"text-indigo-500\",\"inline-flex\",\"items-center\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Learn More\\n \"},{\"type\":\"svg\",\"classes\":[\"w-4\",\"h-4\",\"ml-2\"],\"attributes\":{\"fill\":\"none\",\"stroke\":\"currentColor\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"2\",\"viewBox\":\"0 0 24 24\"},\"components\":[{\"tagName\":\"path\",\"type\":\"svg-in\",\"attributes\":{\"d\":\"M5 12h14M12 5l7 7-7 7\"}}]}]}]}]},{\"classes\":[\"p-4\",\"md:w-1/3\",\"flex\",\"flex-col\",\"text-center\",\"items-center\"],\"components\":[{\"classes\":[\"w-20\",\"h-20\",\"inline-flex\",\"items-center\",\"justify-center\",\"rounded-full\",\"bg-indigo-100\",\"text-indigo-500\",\"mb-5\",\"flex-shrink-0\"],\"components\":[{\"type\":\"svg\",\"classes\":[\"w-10\",\"h-10\"],\"attributes\":{\"fill\":\"none\",\"stroke\":\"currentColor\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"2\",\"viewBox\":\"0 0 24 24\"},\"components\":[{\"tagName\":\"path\",\"type\":\"svg-in\",\"attributes\":{\"d\":\"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2\"}},{\"tagName\":\"circle\",\"type\":\"svg-in\",\"attributes\":{\"cx\":\"12\",\"cy\":\"7\",\"r\":\"4\"}}]}]},{\"classes\":[\"flex-grow\"],\"components\":[{\"tagName\":\"h2\",\"type\":\"text\",\"classes\":[\"text-gray-900\",\"text-lg\",\"title-font\",\"font-medium\",\"mb-3\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Neptune\"}]},{\"tagName\":\"p\",\"type\":\"text\",\"classes\":[\"leading-relaxed\",\"text-base\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Blue bottle crucifix vinyl post-ironic four dollar toast vegan taxidermy. Gastropub indxgo juice poutine, ramps microdosing banh mi pug VHS try-hard.\"}]},{\"type\":\"link\",\"classes\":[\"mt-3\",\"text-indigo-500\",\"inline-flex\",\"items-center\"],\"components\":[{\"type\":\"textnode\",\"content\":\"Learn More\\n \"},{\"type\":\"svg\",\"classes\":[\"w-4\",\"h-4\",\"ml-2\"],\"attributes\":{\"fill\":\"none\",\"stroke\":\"currentColor\",\"stroke-linecap\":\"round\",\"stroke-linejoin\":\"round\",\"stroke-width\":\"2\",\"viewBox\":\"0 0 24 24\"},\"components\":[{\"tagName\":\"path\",\"type\":\"svg-in\",\"attributes\":{\"d\":\"M5 12h14M12 5l7 7-7 7\"}}]}]}]}]}]},{\"type\":\"button\",\"classes\":[\"flex\",\"mx-auto\",\"mt-16\",\"text-white\",\"bg-indigo-500\",\"border-0\",\"py-2\",\"px-8\",\"focus:outline-none\",\"hover:bg-indigo-600\",\"rounded\",\"text-lg\"],\"attributes\":{\"type\":\"button\"},\"components\":[{\"type\":\"textnode\",\"content\":\"Button\"}],\"text\":\"Button\"}]}]}]","assets":"[]","css":"* { box-sizing: border-box; } body {margin: 0;}","styles":"[]"}

dev/nextjs-project/pages/_app.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require('../../../lib/build/browser/index.css')
2+
13
function MyApp({ Component, pageProps }) {
24
return <Component {...pageProps} />
35
}

dev/nextjs-project/pages/editor.js renamed to dev/nextjs-project/pages/another.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
require('./styles/index.module.css')
21
export { getStaticProps } from 'destack/build/server'
32
import { ContentProvider } from 'destack'
43

54
const Index = (props) => {
65
return (
76
<div style={{ height: '100%' }}>
8-
<ContentProvider {...props} showEditorInProd={true} />
7+
<ContentProvider {...props} />
98
</div>
109
)
1110
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { handleData as default, config } from 'destack/build/server'
1+
export { handleEditor as default, config } from 'destack/build/server'

0 commit comments

Comments
 (0)