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

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft

Combobox rework #3168

wants to merge 33 commits into from

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 and components

Examples of the new API:

Copy link

changeset-bot bot commented May 1, 2024

⚠️ No Changeset found

Latest commit: 751a9bb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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 May 6, 2024 6:48pm

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
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