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

Added abstract category class to trait_manager #5606

Merged
merged 3 commits into from Jan 19, 2024
Merged

Conversation

amirrahmani76
Copy link
Contributor

@amirrahmani76 amirrahmani76 commented Jan 10, 2024

An abstract category class was added to the trait_manager, like the block_manager, and refactoring the block_manager.
I've tried to fix this: (add category on traits)

trait

Usage:

    editor.DomComponents.addType('text', {
      isComponent: (el) => el.tagName == 'text',
      model: {
        defaults: {
          traits: [
            {
              label: 'My',
              type: 'text',
              name: 'me',
              category: { id: 'general', label: 'General' },
            },

            {
              label: 'My trait3',
              type: 'text',
              name: 'text',
              category: { id: 'ito', label: 'Ito' },
            },
          ],
          attributes: { type: 'text', required: true },
        },
      },
    });

@mrshaone
Copy link

wait-a-minute-696x523-2076809948

Unnecessary codes removed
@artf artf merged commit 00b1685 into GrapesJS:dev Jan 19, 2024
2 checks passed
@artf
Copy link
Member

artf commented Jan 19, 2024

@amirrahmani76 I did some cleanup before merge but overall it's a good PR. Thank you 🙏

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.

None yet

3 participants