From 1fcd57807f933abc7270e05d8404d5edc2a02fbb Mon Sep 17 00:00:00 2001 From: Hyko Date: Sat, 25 Apr 2026 18:07:18 -0400 Subject: [PATCH] refactor(BlockEditor): replace text symbols with icon components in block controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - replace `+` and `⋮⋮` text with `PlusSignIcon` and `DragDropVerticalIcon` components - add `Add01Icon` export to shared icons index - update README to reference icon names and link to icons source --- src/shared/components/BlockEditor/Block.client.js | 5 +++-- src/shared/components/BlockEditor/README.md | 6 ++++-- src/shared/icons/index.js | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/shared/components/BlockEditor/Block.client.js b/src/shared/components/BlockEditor/Block.client.js index 3ba5ed2..bf1c8d1 100644 --- a/src/shared/components/BlockEditor/Block.client.js +++ b/src/shared/components/BlockEditor/Block.client.js @@ -1,6 +1,7 @@ 'use client'; import React, { useEffect, useImperativeHandle, useRef, useState, forwardRef } from 'react'; +import { PlusSignIcon, DragDropVerticalIcon } from '@zen/core/shared/icons'; import { getBlockDef } from './blockRegistry.js'; import { getCaretOffset, @@ -257,7 +258,7 @@ const Block = forwardRef(function Block( disabled={disabled} className="w-5 h-5 flex items-center justify-center rounded text-neutral-500 hover:bg-neutral-200 dark:hover:bg-neutral-700/60 hover:text-neutral-900 dark:hover:text-white text-sm leading-none" > - + + diff --git a/src/shared/components/BlockEditor/README.md b/src/shared/components/BlockEditor/README.md index 5c60947..fb3cf9c 100644 --- a/src/shared/components/BlockEditor/README.md +++ b/src/shared/components/BlockEditor/README.md @@ -77,8 +77,10 @@ En mode sélection multi-blocs : ## Drag and drop Chaque bloc affiche au survol : -- une poignée `+` pour insérer un bloc en dessous (ouvre le slash menu) -- une poignée `⋮⋮` pour glisser-déposer (réordonner) +- une poignée `PlusSignIcon` pour insérer un bloc en dessous (ouvre le slash menu) +- une poignée `DragDropVerticalIcon` pour glisser-déposer (réordonner) + +Les icônes proviennent de [`src/shared/icons/index.js`](../../icons/index.js). Le drag-and-drop utilise l'API HTML5 native, pas de dépendance externe. diff --git a/src/shared/icons/index.js b/src/shared/icons/index.js index 9d54218..ef2094a 100644 --- a/src/shared/icons/index.js +++ b/src/shared/icons/index.js @@ -554,4 +554,10 @@ export const DragDropVerticalIcon = (props) => ( +); + +export const Add01Icon = (props) => ( + + + ); \ No newline at end of file