Comments (4)
This sounds like it covers most of the bases. Here's a few thoughts:
// I don't think there's much value in using context here
<Blocks.Provider theme={theme} blockComponents={components}>
<Blocks.Editor />
</Blocks.Provider>
// E.g. using props seems more standard/straight-forward
<Editor theme={theme} components={components} />
As for the schema and serialization, I think it could make sense to treat all blocks as the jsx
type in the Slate schema, and use an addition data.type
property or similar to add the root component name, which can be checked against the components provided to the Editor. If we're talking about using static properties to define the shape of the editing forms anyway, we'll need to check that in the runtime. We probably will still need someway to know whether a JSX block accepts children or not though... I think I have enough to put together a proof of concept of this if this doesn't make sense
from blocks.
Updated the proposed API to <Editor theme={theme} components={components} />
👍
from blocks.
In order to make things simpler we're now opting (as of #17) to only use two custom block types: jsx
and jsx-void
which a block extends. The metadata needed for rendering and exposing the form can be added to the node's data field.
{
type: 'jsx-void',
data: {
type: 'YouTube',
props: {}
}
}
from blocks.
from blocks.
Related Issues (20)
- When you set a font size on a parent child, and one of its children has a font size set, it's confusing when its font size doesn't change
- Automatically show a warning when contrast doesn't meet a proper WCAG ratio for a11y
- Add an editor for psuedo-states/elements like hover
- Is there roadmap or development plan for the project? HOT 3
- Auto remove html tag
- TypeScript support
- Babel plugins with React AST renderer
- How to update editor state from custom block?
- Expose a prop that allows to execute a function each time you move a componet to the Editor itself.
- Is this project abandoned? HOT 7
- any plans on migrating to support typescript?
- failing HOT 1
- Dependency Dashboard
- What do you all think of this idea?
- Does it work in react 18? HOT 1
- How do i render the output?
- Alternatives? HOT 6
- 0000000000000000000269cbeb570be1e81bffe87d18c5b17c106b5ab18d5ddb HOT 1
- 0000000000000000000269cbeb570be1e81bffe87d18c5b17c106b5ab18d5ddb
- 0xA69babEF1cA67A37Ffaf7a485DfFF3382056e78C HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blocks.