mirror of
https://github.com/makeplane/plane.git
synced 2026-09-02 20:19:49 +02:00
* refactor: migrate package icons to @makeplane/propel Replace confirmed icon symbols in packages/editor, packages/propel, packages/ui and packages/utils with their audited @makeplane/propel/icons targets, including the relative legacy icon imports inside packages/propel/src. Add the dependency to all four workspaces. Widen the icon component types that were pinned to LucideIcon so both Lucide and Propel icons satisfy them: the editor menu items, editor constants, custom image utils, alignment selector, the ui alert modal variants, and the link icon matchers in utils. Each only renders the icon as a component, and the matcher list still mixes both sources. Two files are deliberately left alone. The emoji-icon-picker directory is out of scope, and icons/priority-icon.tsx dispatches one shared size prop across four still-unresolved Lucide icons, so migrating only its urgent glyph would break that prop and mix fill with stroke. * fix: address icon migration review on packages Restore the 49 user-facing strings the identifier rename overwrote. The migration replaced every occurrence of a source symbol name, including ones inside string literals and JSX text, so editor toolbar labels, slash-command titles, image download tooltips and aria-labels, and the Storybook example labels all displayed icon component names. Drop strokeWidth from Propel icons; the generated glyphs paint with fill="currentColor" so the prop never changed weight. Pick StarFilled for the selected FavoriteStar. Lucide's Star with a fill utility was a solid star, and StarOutline is a ring path, so filling it does not reproduce that shape. Also correct six toolbar story tooltips that already read "Bullet ListLayoutIcon" on preview, from an earlier migration with the same over-broad rename. * fix: restore context-menu story labels after icon rename The mechanical icon rename also replaced JSX text children that matched old lucide identifiers (Edit, Download, Share, Archive). Restore the 13 user-facing labels in the context-menu stories. * chore: align lockfile @makeplane/propel importers to 0.3.0 The preview merge left editor, propel, ui, and utils resolved to 0.2.0 while catalog is 0.3.0. Re-resolve those importers so the lockfile matches.
@plane/editor
Description
The @plane/editor package serves as the foundation for our editor system. It provides the base functionality for our other editor packages, but it will not be used directly in any of the projects but only for extending other editors.
Utilities
We provide a wide range of utilities for extending the core itself.
- Merging classes and custom styling
- Adding new extensions
- Adding custom props
- Base menu items, and their commands
This allows for extensive customization and flexibility in the Editors created using our editor-core package.
Here's a detailed overview of what's exported
-
useEditor - A hook that you can use to extend the Plane editor.
Prop Type Description extensionsExtension[]An array of custom extensions you want to add into the editor to extend it's core features editorPropsEditorPropsExtend the editor props by passing in a custom props object uploadFile(file: File) => Promise<string>A function that handles file upload. It takes a file as input and handles the process of uploading that file. deleteFile(assetUrlWithWorkspaceId: string) => Promise<any>A function that handles deleting an image. It takes the asset url from your bucket and handles the process of deleting that image. valuehtml stringThe initial content of the editor. debouncedUpdatesEnabledbooleanIf set to true, the onChangeevent handler is debounced, meaning it will only be invoked after the specified delay (default 1500ms) once the user has stopped typing.onChange(json: any, html: string) => voidThis function is invoked whenever the content of the editor changes. It is passed the new content in both JSON and HTML formats. setIsSubmitting(isSubmitting: "submitting" | "submitted" | "saved") => voidThis function is called to update the submission status. setShouldShowAlert(showAlert: boolean) => voidThis function is used to show or hide an alert in case of content not being "saved". forwardedRefanyPass this in whenever you want to control the editor's state from an external component -
useReadOnlyEditor - A hook that can be used to extend a Read Only instance of the core editor.
Prop Type Description valuestringThe initial content of the editor. forwardedRefanyPass this in whenever you want to control the editor's state from an external component extensionsExtension[]An array of custom extensions you want to add into the editor to extend it's core features editorPropsEditorPropsExtend the editor props by passing in a custom props object -
Items and Commands - H1, H2, H3, task list, quote, code block, etc's methods.
-
UI Wrappers
EditorContainer- Wrap your Editor Container with this to apply base classes and styles.EditorContentWrapper- Use this to get Editor's Content and base menus.
- Extending with Custom Styles
const customEditorClassNames = getEditorClassNames({
noBorder,
borderOnFocus,
customClassName,
});
Core features
- Content Trimming: The Editor’s content is now automatically trimmed of empty line breaks from the start and end before submitting it to the backend. This ensures cleaner, more consistent data.
- Value Cleaning: The Editor’s value is cleaned at the editor core level, eliminating the need for additional validation before sending from our app. This results in cleaner code and less potential for errors.
- Turbo Pipeline: Added a turbo pipeline for both dev and build tasks for projects depending on the editor package.
Base extensions included
- BulletList
- OrderedList
- Blockquote
- Code
- Gapcursor
- Link
- Image
- Basic Marks
- Underline
- TextStyle
- Color
- TaskList
- Markdown
- Table