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

Create API methods for manipulating with block elements #135

Merged

Conversation

Darginec05
Copy link
Collaborator

@Darginec05 Darginec05 commented May 5, 2024

This PR about:

  • Creating getElement, createElement, deleteElement
  • Simplifying API for manipulating with block elements
  • Create @yoopta/accordion package
  • Added new API's Elements and Blocks

Fixed issues:
#131
#174
#176
#175

@Darginec05 Darginec05 requested a review from maZahaca May 5, 2024 14:14
@Darginec05 Darginec05 linked an issue May 5, 2024 that may be closed by this pull request
1 task
Copy link

vercel bot commented May 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yoopta-editor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 4:29pm

package.json Outdated Show resolved Hide resolved
packages/accordion/src/react-svg.d.ts Outdated Show resolved Hide resolved
},
'accordion-list-item': {
render: AccordionItem,
children: ['accordion-list-item-heading', 'accordion-list-item-content'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering an issue if you mistype the 'key', or if they will be the same within one plugin for multiple items

return (
<li
{...attributes}
className="yoo-accordion-border yoo-accordion-border-[#525252] yoo-accordion-bg-[#303030] yoo-accordion-rounded-none yoo-accordion-relative yoo-accordion-w-full"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering those two [#525252] is a standard coloring schema for yoopta, or/and might be re-used from somewhere or taken from Props with default values as defined in the code?

@@ -0,0 +1,11 @@
# `yoopta-accordion`

> TODO: description
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if README is mandatory file for publishing the plugin to npm, it's a bit misleading.

packages/core/src/editor/transforms/createBlock.ts Outdated Show resolved Hide resolved
packages/core/src/editor/types.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,66 @@
import { generateId, SlateElement, YooptaBlockData } from '@yoopta/editor';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a very strong feeling that example should be stored within plugin and be generated to the website by Lerna, e.g.

in your plugin you have:

./README.md - docs
./test - tests folder
./example/

Also it gives a bit more understanding to the person who looks into the plugin repo of how to use it.

packages/core/src/editor/elements/getElement.ts Outdated Show resolved Hide resolved
packages/core/src/editor/elements/deleteElement.ts Outdated Show resolved Hide resolved
@maZahaca
Copy link
Collaborator

maZahaca commented May 7, 2024

In overall I think we can easily split this PR to smaller chunks (worth in future):

  1. api changes
  2. new plugin

@Darginec05 Darginec05 added the WIP Work in progress label May 7, 2024
@Darginec05 Darginec05 merged commit e655c06 into master Jun 5, 2024
3 checks passed
@Darginec05 Darginec05 deleted the 131-feature-simplify-api-for-creating-custom-plugin branch June 5, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Simplify API for creating custom plugin
2 participants