22import type { LinkedList } from "parchment" ;
33import Quill from "quill" ;
44import Delta from "quill-delta" ;
5- import cellIcon from "../assets/icon/cell.svg" ;
6- import columnIcon from "../assets/icon/column.svg" ;
7- import copyIcon from "../assets/icon/copy.svg" ;
8- import deleteIcon from "../assets/icon/delete.svg" ;
9- import downIcon from "../assets/icon/down.svg" ;
10- import mergeIcon from "../assets/icon/merge.svg" ;
11- import rowIcon from "../assets/icon/row.svg" ;
12- import tableIcon from "../assets/icon/table.svg" ;
13- import wrapIcon from "../assets/icon/wrap.svg" ;
145import { CELL_DEFAULT_VALUES , CELL_DEFAULT_WIDTH , CELL_PROPERTIES , DEVIATION , TABLE_PROPERTIES } from "../config" ;
156import { TableCell , tableId } from "../formats/table" ;
167import type {
@@ -62,7 +53,7 @@ function getMenusConfig(useLanguage: UseLanguageHandler, menus?: string[]): Menu
6253 const DEFAULT : MenusDefaults = {
6354 column : {
6455 content : useLanguage ( "col" ) ,
65- icon : columnIcon ,
56+ icon : "icons icon-Column" ,
6657 handler ( list : HTMLUListElement , tooltip : HTMLDivElement ) {
6758 this . toggleAttribute ( list , tooltip ) ;
6859 } ,
@@ -97,7 +88,7 @@ function getMenusConfig(useLanguage: UseLanguageHandler, menus?: string[]): Menu
9788 } ,
9889 row : {
9990 content : useLanguage ( "row" ) ,
100- icon : rowIcon ,
91+ icon : "icons icon-Row" ,
10192 handler ( list : HTMLUListElement , tooltip : HTMLDivElement ) {
10293 this . toggleAttribute ( list , tooltip ) ;
10394 } ,
@@ -128,7 +119,7 @@ function getMenusConfig(useLanguage: UseLanguageHandler, menus?: string[]): Menu
128119 } ,
129120 merge : {
130121 content : useLanguage ( "mCells" ) ,
131- icon : mergeIcon ,
122+ icon : "icons icon-Merge" ,
132123 handler ( list : HTMLUListElement , tooltip : HTMLDivElement ) {
133124 this . toggleAttribute ( list , tooltip ) ;
134125 } ,
@@ -151,7 +142,7 @@ function getMenusConfig(useLanguage: UseLanguageHandler, menus?: string[]): Menu
151142 } ,
152143 table : {
153144 content : useLanguage ( "tblProps" ) ,
154- icon : tableIcon ,
145+ icon : "icons icon-Table" ,
155146 handler ( list : HTMLUListElement , tooltip : HTMLDivElement ) {
156147 const attribute = {
157148 ...getElementStyle ( this . table , TABLE_PROPERTIES ) ,
@@ -164,7 +155,7 @@ function getMenusConfig(useLanguage: UseLanguageHandler, menus?: string[]): Menu
164155 } ,
165156 cell : {
166157 content : useLanguage ( "cellProps" ) ,
167- icon : cellIcon ,
158+ icon : "icons icon-Cell" ,
168159 handler ( list : HTMLUListElement , tooltip : HTMLDivElement ) {
169160 const { selectedTds } = this . tableBetter . cellSelection ;
170161 const attribute =
@@ -178,7 +169,7 @@ function getMenusConfig(useLanguage: UseLanguageHandler, menus?: string[]): Menu
178169 } ,
179170 wrap : {
180171 content : useLanguage ( "insParaOTbl" ) ,
181- icon : wrapIcon ,
172+ icon : "icons icon-Wrap" ,
182173 handler ( list : HTMLUListElement , tooltip : HTMLDivElement ) {
183174 this . toggleAttribute ( list , tooltip ) ;
184175 } ,
@@ -199,7 +190,7 @@ function getMenusConfig(useLanguage: UseLanguageHandler, menus?: string[]): Menu
199190 } ,
200191 delete : {
201192 content : useLanguage ( "delTable" ) ,
202- icon : deleteIcon ,
193+ icon : "icons icon-Delete" ,
203194 handler ( ) {
204195 this . deleteTable ( ) ;
205196 }
@@ -208,7 +199,7 @@ function getMenusConfig(useLanguage: UseLanguageHandler, menus?: string[]): Menu
208199 const EXTRA : MenusDefaults = {
209200 copy : {
210201 content : useLanguage ( "copyTable" ) ,
211- icon : copyIcon ,
202+ icon : "icons icon-Copy" ,
212203 handler ( ) {
213204 this . copyTable ( ) ;
214205 }
@@ -282,17 +273,19 @@ class TableMenus {
282273
283274 createMenu ( left : string , right : string , isDropDown : boolean ) {
284275 const container = this . quill . root . ownerDocument . createElement ( "div" ) ;
276+ container . classList . add ( "ql-table-dropdown" ) ;
285277 const dropDown = this . quill . root . ownerDocument . createElement ( "span" ) ;
286- const leftIcon = this . quill . root . ownerDocument . createElement ( "img" ) ;
287- leftIcon . setAttribute ( "src" , left ) ;
288- dropDown . appendChild ( leftIcon ) ;
278+ dropDown . classList . add ( "ql-table-tooltip-hover" ) ;
279+ const classes = left . split ( " " ) ;
280+ const icon = this . quill . root . ownerDocument . createElement ( "span" ) ;
281+ icon . classList . add ( ...classes ) ;
282+ dropDown . appendChild ( icon ) ;
289283 if ( isDropDown ) {
290- const rightIcon = this . quill . root . ownerDocument . createElement ( "img" ) ;
291- rightIcon . setAttribute ( "src" , right ) ;
292- dropDown . appendChild ( rightIcon ) ;
284+ const classes = right . split ( " " ) ;
285+ const dropDownIcon = this . quill . root . ownerDocument . createElement ( "span" ) ;
286+ dropDownIcon . classList . add ( ...classes ) ;
287+ dropDown . appendChild ( dropDownIcon ) ;
293288 }
294- container . classList . add ( "ql-table-dropdown" ) ;
295- dropDown . classList . add ( "ql-table-tooltip-hover" ) ;
296289 container . appendChild ( dropDown ) ;
297290 return container ;
298291 }
@@ -307,7 +300,7 @@ class TableMenus {
307300 const { content, icon, children, handler } = val ;
308301 const list = this . createList ( children ) ;
309302 const tooltip = createTooltip ( content ) ;
310- const menu = this . createMenu ( icon , downIcon , ! ! children ) ;
303+ const menu = this . createMenu ( icon , "icons icon-Arrow-down" , ! ! children ) ;
311304 menu . appendChild ( tooltip ) ;
312305 list && menu . appendChild ( list ) ;
313306 container . appendChild ( menu ) ;
0 commit comments