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

Combobox rework #3168

Merged
merged 41 commits into from
Jun 6, 2024
Merged

Combobox rework #3168

merged 41 commits into from
Jun 6, 2024

Conversation

12joan
Copy link
Collaborator

@12joan 12joan commented May 1, 2024

Description

See changesets.

To do:

  • Use new API for slash commands
  • Use new API for mentions
  • Use new API for emoji
  • Remove old combobox API
  • Register new components
  • Changesets for packages
  • Component changelogs

Examples of the new API:

Copy link

changeset-bot bot commented May 1, 2024

🦋 Changeset detected

Latest commit: 4dac4cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@udecode/plate-combobox Major
@udecode/plate-emoji Major
@udecode/plate-mention Major
@udecode/plate-slash-command Major
@udecode/plate Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented May 1, 2024

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

Name Status Preview Comments Updated (UTC)
plate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 4:11pm

Copy link
Member

@zbeyens zbeyens left a comment

Choose a reason for hiding this comment

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

Exciting how cleaner it gets! Left a few comments

apps/www/src/registry/default/plate-ui/inline-combobox.tsx Outdated Show resolved Hide resolved
packages/combobox/src/types.ts Outdated Show resolved Hide resolved
packages/combobox/src/types.ts Outdated Show resolved Hide resolved
packages/slash-command/src/types.ts Outdated Show resolved Hide resolved
packages/combobox/src/withInsertTextTriggerCombobox.ts Outdated Show resolved Hide resolved
apps/www/src/registry/default/plate-ui/inline-combobox.tsx Outdated Show resolved Hide resolved
apps/www/src/registry/default/plate-ui/inline-combobox.tsx Outdated Show resolved Hide resolved
packages/combobox/src/types.ts Outdated Show resolved Hide resolved
Copy link
Member

@zbeyens zbeyens left a comment

Choose a reason for hiding this comment

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

Left a few comments

@dylans
Copy link
Collaborator

dylans commented May 3, 2024

I suggest getting feedback from @nemanja-tosic on this if he has time to review. It took quite a bit of effort to get mentions working previously, and I'm hoping for a smooth upgrade when this is done.

@12joan
Copy link
Collaborator Author

12joan commented May 3, 2024

I suggest getting feedback from @nemanja-tosic on this if he has time to review. It took quite a bit of effort to get mentions working previously, and I'm hoping for a smooth upgrade when this is done.

Hi @dylans. Getting some more feedback on the new combobox API would definitely be helpful, especially with regard to the mentions plugin.

The main changes are a deprecation of the old combobox store (combobox state should now be managed by the developer) and using a void element for the mention input node. Switching to a void isn't a decision I took lightly, but I found it was the only way to get assistive technologies to consistently recognise that the cursor is inside a combobox.

zbeyens added 2 commits May 6, 2024 20:05
# Conflicts:
#	apps/www/public/registry/index.json
#	apps/www/public/registry/styles/default/mention-input-element.json
#	apps/www/src/lib/plate/demo/values/mentionables.ts
#	apps/www/src/lib/plate/demo/values/slashRules.ts
#	apps/www/src/registry/default/example/playground-demo.tsx
#	apps/www/src/registry/default/plate-ui/mention-combobox.tsx
#	apps/www/src/registry/default/plate-ui/mention-input-element.tsx
#	apps/www/src/registry/default/plate-ui/slash-combobox.tsx
#	apps/www/src/registry/default/plate-ui/slash-input-element.tsx
#	apps/www/src/registry/registry.ts
#	packages/mention/src/__tests__/createEditorWithMentions.tsx
#	packages/mention/src/createMentionPlugin.ts
#	packages/mention/src/getMentionOnSelectItem.ts
#	packages/mention/src/handlers/index.ts
#	packages/mention/src/handlers/mentionOnKeyDownHandler.spec.tsx
#	packages/mention/src/handlers/mentionOnKeyDownHandler.ts
#	packages/mention/src/queries/findMentionInput.ts
#	packages/mention/src/queries/index.ts
#	packages/mention/src/queries/isNodeMentionInput.ts
#	packages/mention/src/queries/isSelectionInMentionInput.ts
#	packages/mention/src/transforms/index.ts
#	packages/mention/src/transforms/removeMentionInput.ts
#	packages/mention/src/types.ts
#	packages/mention/src/withMention.spec.tsx
#	packages/mention/src/withMention.ts
#	packages/slash-command/src/createSlashPlugin.ts
#	packages/slash-command/src/getSlashOnSelectItem.ts
#	packages/slash-command/src/handlers/index.ts
#	packages/slash-command/src/handlers/slashOnKeyDownHandler.ts
#	packages/slash-command/src/queries/findSlashInput.ts
#	packages/slash-command/src/queries/index.ts
#	packages/slash-command/src/queries/isNodeSlashInput.ts
#	packages/slash-command/src/queries/isSelectionInSlashInput.ts
#	packages/slash-command/src/transforms/index.ts
#	packages/slash-command/src/transforms/removeSlashInput.ts
#	packages/slash-command/src/types.ts
#	packages/slash-command/src/withSlashCommand.ts
#	packages/slate/src/interfaces/element/TElement.ts
#	packages/slate/src/interfaces/node/TAncestor.ts
@12joan 12joan marked this pull request as ready for review June 5, 2024 15:15
@12joan 12joan requested a review from zbeyens June 5, 2024 15:59
@zbeyens zbeyens merged commit e7dc8c3 into main Jun 6, 2024
6 checks passed
@zbeyens zbeyens deleted the feat/combobox branch June 6, 2024 00:32
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