Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Grapes with Craft.js #62

Merged
merged 217 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
217 commits
Select commit Hold shift + click to select a range
bc725ad
added basic editor (todo fix add component issue & remove grapesjs st…
LiveDuo Oct 14, 2022
23a3a9b
fixed svg icons
LiveDuo Oct 14, 2022
ed8e3c1
removed public folder
LiveDuo Oct 14, 2022
a2a78ea
seperated craft from destack files
LiveDuo Oct 14, 2022
5dffcae
enabled tailwind config
LiveDuo Oct 14, 2022
80d128f
fixed tailwind config
LiveDuo Oct 14, 2022
3a8498e
fixed tailwind config js
LiveDuo Oct 14, 2022
4421c8b
cleanup utils
LiveDuo Oct 14, 2022
3016066
simplify folder structure
LiveDuo Oct 14, 2022
d4d78a5
renamed toolbox and sidebar to right and left sidebar
LiveDuo Oct 14, 2022
c211402
cleanup editor imports
LiveDuo Oct 14, 2022
69fd314
added export button
LiveDuo Oct 14, 2022
4780ac5
fixed typescript warnings
LiveDuo Oct 14, 2022
156023b
fixed more typescript warnings
LiveDuo Oct 14, 2022
24aa4f2
cleanup viewport
LiveDuo Oct 14, 2022
d62261a
various minor fixes
LiveDuo Oct 14, 2022
3c7bd80
cleanup resizer and render node, removed unused packages
LiveDuo Oct 14, 2022
832a915
undo change in resizer
LiveDuo Oct 14, 2022
036b574
fixed undo redo icons
LiveDuo Oct 14, 2022
5a8a716
removed grapesjs stuff
LiveDuo Oct 14, 2022
6190d86
removed material ui
LiveDuo Oct 14, 2022
48ecb48
added background to frame
LiveDuo Oct 14, 2022
0ec83c4
fixed tooltip zindex and render icons for app, various fixes in child
LiveDuo Oct 14, 2022
d0a630d
added data example
LiveDuo Oct 15, 2022
2a00a0f
added render from state
LiveDuo Oct 15, 2022
31e4b02
implemented render from state for a single component
LiveDuo Oct 15, 2022
5defa43
implemented render from state
LiveDuo Oct 15, 2022
587b3eb
connect craft to destack server
LiveDuo Oct 15, 2022
ea0522d
prevent saving on first load
LiveDuo Oct 15, 2022
aa3caa2
updated default json
LiveDuo Oct 15, 2022
b681de7
fixed render from state
LiveDuo Oct 15, 2022
dc776cc
fixed loading props in render from state
LiveDuo Oct 15, 2022
1c1aada
restored app background
LiveDuo Oct 15, 2022
a9dac36
removed paragraphs
LiveDuo Oct 15, 2022
5ee3b65
fixed content editable h2 in p
LiveDuo Oct 15, 2022
3eb940b
fixed child ids
LiveDuo Oct 15, 2022
3b9e07a
added image / button example, implement image parsing
LiveDuo Oct 16, 2022
d89cb0a
minor fixes
LiveDuo Oct 16, 2022
afa780f
added image and link components in child, implemented upload dialog w…
LiveDuo Oct 16, 2022
464d976
worked on left sidebar
LiveDuo Oct 17, 2022
7399e9b
added sample theme selector
LiveDuo Oct 17, 2022
7c74de5
added theme selection
LiveDuo Oct 17, 2022
bca667c
added store
LiveDuo Oct 17, 2022
e4cdd05
move select theme to header
LiveDuo Oct 17, 2022
8bd3954
changed store to typescript
LiveDuo Oct 17, 2022
2bfedb5
organised themes
LiveDuo Oct 18, 2022
92f39eb
minor cleanup
LiveDuo Oct 18, 2022
89f7752
merge resizer with container
LiveDuo Oct 18, 2022
2ddbc32
minor fix
LiveDuo Oct 18, 2022
0d53907
fixed child root param and editor containers
LiveDuo Oct 18, 2022
6ae57d6
implemented update link
LiveDuo Oct 18, 2022
db7580d
minor fixes
LiveDuo Oct 23, 2022
54a5774
renamed test block, worked on resolver
LiveDuo Oct 23, 2022
3158e18
simplified components
LiveDuo Oct 23, 2022
1fc5589
added component to hyper ui
LiveDuo Oct 23, 2022
55b82e6
minor fix
LiveDuo Oct 23, 2022
e5123ef
added hyper ui components
LiveDuo Oct 23, 2022
4e577a6
fixed aside elements
LiveDuo Oct 23, 2022
1c70f64
hide left sidebar scroll, move test block out of hyper ui
LiveDuo Oct 23, 2022
fa790c4
added tailblocks components
LiveDuo Oct 23, 2022
383e2b5
added meraki light components
LiveDuo Oct 23, 2022
b258b44
fixed theme select and sidebar key
LiveDuo Oct 24, 2022
9f68a02
fixed categories toggles
LiveDuo Oct 24, 2022
a869191
fixed resolver
LiveDuo Oct 24, 2022
64f6c9a
worked on reactjs
LiveDuo Oct 24, 2022
9b112d0
move link and image to seperate components
LiveDuo Oct 24, 2022
d86145d
move link and image dialogs to themes folder
LiveDuo Oct 24, 2022
a55e299
fixed image dialog
LiveDuo Oct 24, 2022
2361d95
added more elements to child
LiveDuo Oct 24, 2022
b784c81
added fixed width to container
LiveDuo Oct 24, 2022
181360d
added details and blockquote to child
LiveDuo Oct 24, 2022
115e64e
worked on link dialog
LiveDuo Oct 24, 2022
2f18a1f
move resolver to store
LiveDuo Oct 24, 2022
c025311
worked on link on click
LiveDuo Oct 24, 2022
5a70191
fixed default editor height
LiveDuo Oct 24, 2022
dc35b83
added standalone server param to save template
LiveDuo Oct 24, 2022
01691e9
fixed react version
LiveDuo Oct 24, 2022
1313fa9
worked on dynamic loading components
LiveDuo Oct 25, 2022
f0c3081
move theme provider to top
LiveDuo Oct 25, 2022
469d530
cleanup store
LiveDuo Oct 25, 2022
69aaa8c
added form elements to child
LiveDuo Oct 25, 2022
01a4ab8
fixed svg elements
LiveDuo Oct 25, 2022
e57fd12
added button component
LiveDuo Oct 26, 2022
1a3d72d
fixed mailto, fixed text in button, added form console log
LiveDuo Oct 26, 2022
ec4cb98
fixed action dialog loading props
LiveDuo Oct 26, 2022
839f98b
fixed svg properties
LiveDuo Oct 26, 2022
1b6b412
worked on button and link dialogs
LiveDuo Oct 27, 2022
a15ca5c
fixed type in button dialog
LiveDuo Oct 27, 2022
63d9c42
fixed form submit
LiveDuo Oct 27, 2022
6166cad
fixed prod width
LiveDuo Oct 30, 2022
0cb49b8
fixed react versions in lib build
LiveDuo Oct 30, 2022
5c7b63e
fixed text in prod
LiveDuo Nov 2, 2022
a4064f9
removed duplicated resolver items
LiveDuo Nov 4, 2022
482a0fa
cleanup component files
LiveDuo Nov 4, 2022
d61b94d
update package json
LiveDuo Nov 4, 2022
7eb826b
cleanup left sidebar
LiveDuo Nov 5, 2022
743a37d
removed unused import
LiveDuo Nov 5, 2022
8d70fab
speed up component loading, moved assets loading to local server, fix…
LiveDuo Nov 5, 2022
0b6e242
fixed asset path in server
LiveDuo Nov 5, 2022
15752be
added src to npm package
LiveDuo Nov 5, 2022
ffc51e2
hyper ui fixed folder name on stats and testimonials
nikolas-con Nov 23, 2022
58f52cd
fixed svg properties on child
nikolas-con Nov 23, 2022
81c86f9
hyper ui fixed navigation buttons
nikolas-con Nov 23, 2022
6ed46d5
fixed navigation icons , footer icons and footer buttons
nikolas-con Nov 23, 2022
0f1f8ad
Banner3 fixed bg
nikolas-con Nov 23, 2022
32439ec
child Nodes article, dd/dt/dl, link, ul/li, script
nikolas-con Nov 23, 2022
437d707
remove new line footer11
nikolas-con Nov 27, 2022
3e85d03
remove console log from child
nikolas-con Nov 27, 2022
a109bd1
Merge pull request #57 from nikolas-con/feature/craftjs
LiveDuo Nov 27, 2022
d7e5eb9
fixed image flickering
LiveDuo Nov 27, 2022
8507534
fixed switching to preview mode on refresh
LiveDuo Nov 27, 2022
4e57cce
cleanup render node
LiveDuo Nov 27, 2022
5c370d5
removed delete button for most elements
LiveDuo Nov 27, 2022
1438410
simplified canvas
LiveDuo Nov 27, 2022
0ec5d4b
simplified container
LiveDuo Nov 27, 2022
a4ed95d
Merge branch 'feature/craftjs' of https://github.com/LiveDuo/destack …
LiveDuo Nov 27, 2022
853f022
fixed container
LiveDuo Nov 27, 2022
8f7003f
fixed container size
LiveDuo Nov 27, 2022
5893ebe
fixed text, cleanup editable prop
LiveDuo Nov 27, 2022
1b65369
fixed text onclick
LiveDuo Nov 27, 2022
cb5b270
updated tailwindcss, suppressed content editable warning
LiveDuo Nov 27, 2022
bc4cff0
fix features images in tailblocks
LiveDuo Dec 9, 2022
b8b6064
fix hero 2 in tailblocks
LiveDuo Dec 9, 2022
454f866
fixed simple container, fixed steps in tailblocks
LiveDuo Dec 9, 2022
b72dffd
worked on meraki ui
LiveDuo Dec 10, 2022
2ca1cd7
fixed css
nikolas-con Dec 12, 2022
11a7dc5
Merge pull request #61 from nikolas-con/feature/craftjs
LiveDuo Dec 12, 2022
6b8d138
moved update link and image to render node
LiveDuo Dec 12, 2022
83f0e2e
fixed more css issues
LiveDuo Dec 12, 2022
cb8003b
fixed tailblocks contracts, fixed button dialog
LiveDuo Dec 12, 2022
102448a
fixed broken components
LiveDuo Dec 12, 2022
a9728da
fixed more broken components
LiveDuo Dec 12, 2022
d9ec60c
fixed portfolio in meraki ui
LiveDuo Dec 12, 2022
8d82a87
removed container simple from element
LiveDuo Dec 13, 2022
43cd265
updated assets
LiveDuo Dec 26, 2022
56ce3a0
organise project
LiveDuo Jan 8, 2023
3f235e9
fixed production editor bug
LiveDuo Jan 8, 2023
d060764
replaced puppeteer tests with playright
LiveDuo Jan 8, 2023
c531548
worked on e2e tests
LiveDuo Jan 8, 2023
a6906b6
updated github tests yml
LiveDuo Jan 8, 2023
e883b09
updated github tests yml again
LiveDuo Jan 8, 2023
50ff8ba
fixed github tests yml headless
LiveDuo Jan 8, 2023
03db04a
fixed github tests yml env var
LiveDuo Jan 8, 2023
bbe7188
removed safari from github actions
LiveDuo Jan 8, 2023
49e07ca
fixed test e2e build
LiveDuo Jan 8, 2023
78b84b2
fixed various theme components
LiveDuo Jan 8, 2023
d798d88
added missing dev dependency
LiveDuo Jan 8, 2023
a163b8e
updated viewport bottom text
LiveDuo Jan 8, 2023
0ddd76a
fixed e2e dev
LiveDuo Jan 9, 2023
0936781
added one more check in e2e build
LiveDuo Jan 9, 2023
1396a23
fixed bug with text component
LiveDuo Jan 9, 2023
334b670
minor name fixes
LiveDuo Jan 9, 2023
565e347
fixed react keys issue
LiveDuo Jan 9, 2023
61e058d
removed unused variables
LiveDuo Jan 9, 2023
da28908
fixed text updates
LiveDuo Jan 9, 2023
7fab421
removed unused theme components
LiveDuo Jan 10, 2023
9abe96a
fixed e2e tests
LiveDuo Jan 10, 2023
e603ac4
fixed saving issue
LiveDuo Jan 10, 2023
f8bfb57
minor fix
LiveDuo Jan 10, 2023
1d18483
updated tailwind config, updated lib dependencies
LiveDuo Jan 11, 2023
9c592c0
added delete before publishing
LiveDuo Jan 11, 2023
0c33b0e
added tree shaking to heroicons
LiveDuo Jan 11, 2023
a9e80f4
fixed text in prod
LiveDuo Jan 11, 2023
e12c01f
fixed component props
LiveDuo Jan 11, 2023
e715494
updated e2e timeouts
LiveDuo Jan 11, 2023
24c3191
updated github actions
LiveDuo Jan 11, 2023
6345802
trigger github actions
LiveDuo Jan 11, 2023
4f33e6c
add playwright cache
LiveDuo Jan 11, 2023
f866a60
updated github actions
LiveDuo Jan 11, 2023
fa92866
updated github actions
LiveDuo Jan 11, 2023
3ee62f1
added hashtag dialog
LiveDuo Jan 11, 2023
e8f6ace
fixes for hyperui theme
LiveDuo Jan 11, 2023
70582d7
fixed various minor bugs
LiveDuo Jan 11, 2023
1d16e21
added svg element
LiveDuo Jan 12, 2023
49aba8c
removed unused component, fixed powered by, fixed warning about class…
LiveDuo Jan 13, 2023
a2c4fcd
worked on multi page support
LiveDuo Jan 13, 2023
68939e3
fixed multi page support after build
LiveDuo Jan 13, 2023
c4d30bf
fixed rollup warnings
LiveDuo Jan 14, 2023
40401c4
added powered by
LiveDuo Jan 15, 2023
776f43a
added note to readme
LiveDuo Jan 28, 2023
9f23926
added back grapesjs lib, setup grapesjs in nextjs project
LiveDuo Feb 1, 2023
93d94f1
fixed types in nextjs example project
LiveDuo Feb 1, 2023
a396237
improve folder structure
LiveDuo Feb 1, 2023
cc2b40b
added nextjs example data
LiveDuo Feb 1, 2023
ea1db9e
fixed types, theme asset paths and tailwind css
LiveDuo Feb 1, 2023
b40943a
worked on grapes folder structure
LiveDuo Feb 1, 2023
ebde06d
worked on react version
LiveDuo Feb 1, 2023
06c4584
worked on react version
LiveDuo Feb 1, 2023
ac5bc4e
added react tests
LiveDuo Feb 1, 2023
b453229
cleanup grapesjs upload
LiveDuo Feb 1, 2023
1f4134a
added react test scripts to package json
LiveDuo Feb 1, 2023
582088f
moved themes data
LiveDuo Feb 1, 2023
7b7a1d6
fixed theme component names
LiveDuo Feb 1, 2023
ccb7405
added helper functions
LiveDuo Feb 1, 2023
a17b40a
fixed grapes themes data
LiveDuo Feb 1, 2023
c1df4db
updated gitignore
LiveDuo Feb 1, 2023
3b0263a
fixed tailwind css config
LiveDuo Feb 2, 2023
d7eba40
disabled image upload test in react, added react tests in e2e script
LiveDuo Feb 2, 2023
946cd9d
Merge pull request #70 from LiveDuo/feature/craftjs-with-grapes
LiveDuo Feb 2, 2023
e663b5b
updated readme
LiveDuo Feb 2, 2023
bc46961
updated github actions
LiveDuo Feb 2, 2023
6cdbccf
updated react project default json
LiveDuo Feb 2, 2023
17548a4
disabled cache
LiveDuo Feb 2, 2023
4b4a730
fixed github actions
LiveDuo Feb 2, 2023
96665a9
increase timeout
LiveDuo Feb 2, 2023
8bb81a3
worked on readme
LiveDuo Feb 4, 2023
68909be
added craft screenshot
LiveDuo Feb 4, 2023
90bd020
updated craft screenshot
LiveDuo Feb 4, 2023
44acc95
updated craft screenshot
LiveDuo Feb 4, 2023
5ea112b
more work on readme
LiveDuo Feb 4, 2023
e2c56cd
moved lib folder
LiveDuo Feb 4, 2023
ed4f8c4
fixed build scripts
LiveDuo Feb 4, 2023
aa37957
fixed react version
LiveDuo Feb 4, 2023
70733cf
fixed another react issue
LiveDuo Feb 4, 2023
fea1fc8
fixed publish script
LiveDuo Feb 4, 2023
bbbb4c7
fixed published files
LiveDuo Feb 4, 2023
7d15714
Merge branch 'main' into feature/craftjs
LiveDuo Feb 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 13 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Tests

on:
push:
branches: [main]
branches: [main, feature/**]
pull_request:
branches: [main]
branches: [main, feature/**]
workflow_dispatch:
inputs:
mode:
description: 'Runtime Mode: "standard" or "interactive"'
description: 'Runtime Mode: "standard" or "interactive"'
required: false
default: 'standard'

Expand All @@ -21,15 +21,16 @@ jobs:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g [email protected]
- uses: actions/cache@v3
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-1.28.0
- run: npm ci
- run: cd lib/destack && npm run build
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'interactive' }}
- run: npm test
- run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: CI=true npm run test:e2e
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# testing
/coverage
test-results

# next.js
/.next/
Expand Down
58 changes: 15 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

# Announcements

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

# What's Destack?

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.
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.

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

# Themes

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

<tr>
<td width="48%">
<img src="https://github.com/LiveDuo/destack/raw/main/assets/theme-modal.png"/>
<img src="https://raw.githubusercontent.com/LiveDuo/destack/feature/craftjs/assets/themes/screenshot-craft.png"/>
Theme selection
</td>
<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>
Expand All @@ -41,9 +41,10 @@ Destack now supports theme selection.
</tr>
</table>

<p>
<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"/>
</p>

### Contribute (add a new theme)

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).

# Features

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

#### 🃏 Delightful Builder

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.
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.

#### 🕹 Data Ownership

Expand Down Expand Up @@ -89,20 +90,20 @@ npm i destack

Create `pages/api/builder/handle.js` and add the following:
```js
export { handleData as default, config } from 'destack/build/server'
export { handleEditor as default, config } from 'destack/build/server'
```

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

On any Next.js page you want to setup Destack:
```js
import 'grapesjs/dist/css/grapes.min.css'
import 'destack/build/browser/index.css'
export { getStaticProps } from 'destack/build/server'
export { ContentProvider as default } from 'destack'
```

<details>
<summary>How to use along other components</summary>
<summary>How to use the legacy page-builder (Grapesjs)</summary>
<br>

```js
Expand Down Expand Up @@ -147,13 +148,13 @@ In `package.json`:

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

```

<details>
<summary>How to use along other components</summary>
<summary>How to use the legacy page-builder (Grapesjs)</summary>
<br>

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

### Show editor in production

- Install Destack to a new or existing project
- Set `showEditorInProd={true}` in the `ContentProvider` component
- The result should be similar to [Destack Online Builder](https://destack-page.vercel.app/)

Note: this is only available for Next.js.

<details>
<summary>Code snippet</summary>
<br>

```js
import { ContentProvider } from 'destack'
import 'grapesjs/dist/css/grapes.min.css'

export { getStaticProps } from 'destack/build/server'

export default function Page(props) {
return (
<div style={{height: '100%'}}>
<ContentProvider {...props} showEditorInProd={true}/>
</div>)
}
```
</details>

# Multi-page Support

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

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'.

> Next.js 🅧 ➕ Tailwind CSS 🍃 ➕ Grapes.js 🍇 = 💣💣
> Next.js 🅧 ➕ Tailwind CSS 🍃 ➕ Craft.js 🧶 = 💣💣

Please go and show these projects some love (⭐️).

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

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

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
35 changes: 35 additions & 0 deletions assets/saved/RenderState.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useEffect, useState } from 'react'

import Banner1 from '../themes/hyperui/Banner1'

const Components = {
Banner1: Banner1,
}

const parse = (json, nodeId: string, parentNodeId?: string) => {
const childNodeNames: string[] = json[nodeId]?.nodes || []
const ReactComponent = Components[json[nodeId].type.resolvedName]
const extendedProps = { ...json[nodeId].props, parentNodeId, nodeId, key: nodeId }

if (childNodeNames.length === 0) {
return <ReactComponent {...extendedProps} />
} else {
const childNodes = childNodeNames.map((childNodeId) => parse(json, childNodeId, nodeId))
if (ReactComponent) {
return <ReactComponent {...extendedProps}>{childNodes}</ReactComponent>
} else {
return <div>{childNodes}</div>
}
}
}

const RenderFromState = ({ data }) => {
const [json, setJson] = useState(null)

useEffect(() => {
setJson(JSON.parse(data[0].content))
}, [])

return json && parse(json, 'ROOT')
}
export default RenderFromState
Binary file added assets/themes/logo-hyperui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/themes/logo-merakiui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/themes/logo-tailblocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/themes/screenshot-craft.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
12 changes: 12 additions & 0 deletions dev/nextjs-project/data/another.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ROOT": {
"type": { "resolvedName": "Container" },
"isCanvas": true,
"props": { "width": "100%", "height": "800px" },
"displayName": "Container",
"custom": { "displayName": "App" },
"hidden": false,
"nodes": [],
"linkedNodes": {}
}
}
15 changes: 10 additions & 5 deletions dev/nextjs-project/data/default.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dev/nextjs-project/data/grapes.json
Original file line number Diff line number Diff line change
@@ -0,0 +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":"[]"}
2 changes: 2 additions & 0 deletions dev/nextjs-project/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require('../../../lib/build/browser/index.css')

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
require('./styles/index.module.css')
export { getStaticProps } from 'destack/build/server'
import { ContentProvider } from 'destack'

const Index = (props) => {
return (
<div style={{ height: '100%' }}>
<ContentProvider {...props} showEditorInProd={true} />
<ContentProvider {...props} />
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion dev/nextjs-project/pages/api/builder/handle.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { handleData as default, config } from 'destack/build/server'
export { handleEditor as default, config } from 'destack/build/server'
Loading