Coder Social home page Coder Social logo

Comments (4)

mtias avatar mtias commented on September 18, 2024

Related WordPress/gutenberg#27575.

from pattern-directory.

ryelle avatar ryelle commented on September 18, 2024

Block patterns can have a blockTypes property, which identifies blocks that can be converted into this pattern. For example, the paragraph block:

Screen Shot 2021-04-21 at 2 31 17 PM

We should add some (optional) way of flagging patterns as related to block types, and on the validation side, make sure the pattern can be transformed from the chosen block. It seems like patterns can be related to more than one block type, but I think in practice, it's usually just one.

The API & proxy API will also need to be updated to allow a "blockTypes" parameter for fetching patterns.

from pattern-directory.

ryelle avatar ryelle commented on September 18, 2024

There is a PR on the Gutenberg side to use the blockTypes meta value when registering patterns: WordPress/gutenberg#32113

We still need to create a flow for setting the blockType value when creating a pattern.

from pattern-directory.

ryelle avatar ryelle commented on September 18, 2024

We can set blockTypes for a pattern, and that will pass through the API to the editor to make it work (once WordPress/gutenberg#32113 is merged).

The unanswered question here is how that should work (in the UI) when creating a pattern. Since we still don't have a design here, and the gutenberg API has no traction (so it won't make 5.9), I've pulled this out of the pattern creation v1 milestone. We can revisit it post-beta or post-launch.

from pattern-directory.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.