refactor(icons): migrate workspace to Icones

This commit is contained in:
Maofeng
2026-09-20 15:52:22 +08:00
parent 1fc56b6982
commit ea00a71112
95 changed files with 1409 additions and 725 deletions
+6 -1
View File
@@ -3,7 +3,12 @@
import * as React from "react"
import type { ComponentType, ReactElement, ReactNode } from "react"
import type { Klass, LexicalNode } from "lexical"
import { AlignLeft, CaseSensitive, Pilcrow, Plus } from "lucide-react"
import {
AlignLeft,
CaseSensitive,
Pilcrow,
Plus,
} from "@workspace/ui/components/icon"
import {
boldAction,
+1 -1
View File
@@ -1,4 +1,4 @@
import { Check, ChevronDown } from "lucide-react"
import { Check, ChevronDown } from "@workspace/ui/components/icon"
import { Button } from "@workspace/ui/components/button"
import {
DropdownMenu,
+6 -1
View File
@@ -1,4 +1,9 @@
import { AlignCenter, AlignJustify, AlignLeft, AlignRight } from "lucide-react"
import {
AlignCenter,
AlignJustify,
AlignLeft,
AlignRight,
} from "@workspace/ui/components/icon"
import {
$getSelection,
$isRangeSelection,
+7 -1
View File
@@ -8,7 +8,13 @@ import {
} from "@lexical/rich-text"
import type { HeadingTagType } from "@lexical/rich-text"
import { $setBlocksType } from "@lexical/selection"
import { Heading1, Heading2, Heading3, Pilcrow, Quote } from "lucide-react"
import {
Heading1,
Heading2,
Heading3,
Pilcrow,
Quote,
} from "@workspace/ui/components/icon"
import { $createParagraphNode, $getSelection, $isRangeSelection } from "lexical"
import type { LexicalActionDefinition } from "../types"
import { lexicalMessages } from "../messages"
@@ -1,7 +1,7 @@
import { TOGGLE_LINK_COMMAND } from "@lexical/link"
import { REMOVE_LIST_COMMAND } from "@lexical/list"
import { $patchStyleText, $setBlocksType } from "@lexical/selection"
import { Eraser } from "lucide-react"
import { Eraser } from "@workspace/ui/components/icon"
import { $createParagraphNode, $getSelection, $isRangeSelection } from "lexical"
import type { LexicalActionDefinition } from "../types"
import { lexicalMessages } from "../messages"
@@ -2,7 +2,7 @@ import {
$getSelectionStyleValueForProperty,
$patchStyleText,
} from "@lexical/selection"
import { Baseline, Pipette } from "lucide-react"
import { Baseline, Pipette } from "@workspace/ui/components/icon"
import { $getSelection, $isRangeSelection, $setSelection } from "lexical"
import type { LexicalEditor, RangeSelection } from "lexical"
import { useRef, useState } from "react"
+1 -1
View File
@@ -1,4 +1,4 @@
import { CalendarDays } from "lucide-react"
import { CalendarDays } from "@workspace/ui/components/icon"
import { Button } from "@workspace/ui/components/button"
import { DropdownMenuItem } from "@workspace/ui/components/dropdown-menu"
import { cn } from "@workspace/ui/lib/utils"
+1 -1
View File
@@ -2,7 +2,7 @@ import {
$getSelectionStyleValueForProperty,
$patchStyleText,
} from "@lexical/selection"
import { ALargeSmall, ChevronDown } from "lucide-react"
import { ALargeSmall, ChevronDown } from "@workspace/ui/components/icon"
import { $getSelection, $isRangeSelection } from "lexical"
import { Button } from "@workspace/ui/components/button"
import {
+1 -1
View File
@@ -1,5 +1,5 @@
import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin"
import { Redo2, Undo2 } from "lucide-react"
import { Redo2, Undo2 } from "@workspace/ui/components/icon"
import { REDO_COMMAND, UNDO_COMMAND } from "lexical"
import type { LexicalActionDefinition } from "../types"
import { lexicalMessages } from "../messages"
@@ -3,7 +3,7 @@ import {
HorizontalRuleNode,
} from "@lexical/extension"
import { $insertNodeToNearestRoot } from "@lexical/utils"
import { Minus } from "lucide-react"
import { Minus } from "@workspace/ui/components/icon"
import { $getSelection, $isRangeSelection } from "lexical"
import type { LexicalActionDefinition } from "../types"
import { lexicalMessages } from "../messages"
+1 -1
View File
@@ -1,4 +1,4 @@
import { IndentDecrease, IndentIncrease } from "lucide-react"
import { IndentDecrease, IndentIncrease } from "@workspace/ui/components/icon"
import { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from "lexical"
import type { LexicalActionDefinition } from "../types"
import { lexicalMessages } from "../messages"
+1 -1
View File
@@ -1,6 +1,6 @@
import { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from "@lexical/link"
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin"
import { Link } from "lucide-react"
import { Link } from "@workspace/ui/components/icon"
import { $findMatchingParent, $getSelection, $isRangeSelection } from "lexical"
import { Button } from "@workspace/ui/components/button"
import {
+1 -1
View File
@@ -9,7 +9,7 @@ import {
} from "@lexical/list"
import { CheckListPlugin } from "@lexical/react/LexicalCheckListPlugin"
import { ListPlugin } from "@lexical/react/LexicalListPlugin"
import { List, ListChecks, ListOrdered } from "lucide-react"
import { List, ListChecks, ListOrdered } from "@workspace/ui/components/icon"
import { $getSelection, $isRangeSelection } from "lexical"
import type { LexicalCommand, LexicalEditor } from "lexical"
import type { LexicalActionDefinition, LexicalActionName } from "../types"
+1 -1
View File
@@ -1,4 +1,4 @@
import { ImageIcon, VideoIcon } from "lucide-react"
import { ImageIcon, VideoIcon } from "@workspace/ui/components/icon"
import { $insertNodes } from "lexical"
import {
+1 -1
View File
@@ -8,7 +8,7 @@ import {
Subscript,
Superscript,
Underline,
} from "lucide-react"
} from "@workspace/ui/components/icon"
import { $getSelection, $isRangeSelection, FORMAT_TEXT_COMMAND } from "lexical"
import type { TextFormatType } from "lexical"
import type { LexicalActionDefinition, LexicalActionName } from "../types"
+6 -1
View File
@@ -22,7 +22,12 @@ import type {
Spread,
} from "lexical"
import { cn } from "@workspace/ui/lib/utils"
import { AlignCenter, AlignLeft, AlignRight, Trash2 } from "lucide-react"
import {
AlignCenter,
AlignLeft,
AlignRight,
Trash2,
} from "@workspace/ui/components/icon"
import { useTranslate } from "@workspace/i18n"
import { ImageResizer } from "../components/image-resizer"
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react"
import { Trash2 } from "lucide-react"
import { Trash2 } from "@workspace/ui/components/icon"
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext"
import {
$getNearestNodeFromDOMNode,
@@ -9,7 +9,7 @@ import {
} from "react"
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext"
import { DraggableBlockPlugin_EXPERIMENTAL } from "@lexical/react/LexicalDraggableBlockPlugin"
import { GripVertical } from "lucide-react"
import { GripVertical } from "@workspace/ui/components/icon"
import { $getRoot, $isParagraphNode } from "lexical"
import { useLexicalMessage } from "../i18n"
@@ -1,7 +1,7 @@
import { useEffect, useId, useRef, useState } from "react"
import { $isLinkNode, $toggleLink } from "@lexical/link"
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext"
import { Check, Pencil, Trash2 } from "lucide-react"
import { Check, Pencil, Trash2 } from "@workspace/ui/components/icon"
import {
$findMatchingParent,
$getNearestNodeFromDOMNode,
+2 -2
View File
@@ -1,6 +1,6 @@
import type { ComponentType, ReactNode } from "react"
import type { Klass, LexicalEditor, LexicalNode } from "lexical"
import type { LucideIcon } from "lucide-react"
import type { IconComponent } from "@workspace/ui/components/icon"
import type { LexicalActionState } from "./context"
import type { LexicalEmbedDefinition } from "./embed"
import type { LexicalMessage } from "./i18n"
@@ -54,7 +54,7 @@ export interface LexicalActionDefinition<Value = string> {
name: string
label: LexicalMessage
hidden?: boolean
icon?: LucideIcon
icon?: IconComponent
group?: LexicalActionGroup
execute: (context: LexicalActionContext, value?: Value) => void
isActive?: (context: LexicalActionContext) => boolean