@ones-editor/editor 2.1.8-beta.7 → 2.1.8-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import { TypedEmitter } from 'tiny-typed-emitter';
3
3
  import { ColorPaletteItem } from '../color-palette';
4
4
  import { ColorPaletteEvents, ColorAction } from '../color-palette/color-palette';
5
5
  import './text-color-item.scss';
6
+ type Colors = [number | null, number | null];
6
7
  export declare class TextColorItem extends TypedEmitter<ColorPaletteEvents> implements CommandItem {
7
8
  editor: OnesEditor;
8
9
  private storageName;
@@ -16,9 +17,10 @@ export declare class TextColorItem extends TypedEmitter<ColorPaletteEvents> impl
16
17
  children: CommandItem[];
17
18
  element: HTMLButtonElement;
18
19
  colorPaletteItem: ColorPaletteItem;
19
- latestColors: [number | null, number | null];
20
+ latestColors: Colors;
20
21
  private currentTextColors;
21
22
  constructor(editor: OnesEditor, storageName?: string);
23
+ getColorsFromLocalStorage(): Colors;
22
24
  destroy(): void;
23
25
  handlePaletteClick: (type: ColorAction, value: number) => void;
24
26
  handleButtonClick: (event: MouseEvent) => void;
@@ -27,3 +29,4 @@ export declare class TextColorItem extends TypedEmitter<ColorPaletteEvents> impl
27
29
  updatePaletteColor(): void;
28
30
  setCurrentTextColors(colors: [number | null, number | null]): void;
29
31
  }
32
+ export {};
package/dist/index.js CHANGED
@@ -5219,8 +5219,8 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5219
5219
  pointer-events: none;
5220
5220
  mask-repeat: no-repeat;
5221
5221
  mask-position: center;
5222
- mask-size: auto clamp(20px, 10%, 60px);
5223
- -webkit-mask-size: auto clamp(20px, 10%, 60px);
5222
+ mask-size: auto clamp(20px, 50%, 60px);
5223
+ -webkit-mask-size: auto clamp(20px, 50%, 60px);
5224
5224
  mask-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMwLjAzMjggMjkuNjIzMkw0OC41NjE2IDExLjA2MTZNMzAuMDMyOCAyOS42MjMyTDQ4LjU2MTYgNDguMTg0N00zMC4wMzI4IDI5LjYyMzJMMTEuNDM4NCA0OC4xODQ3TTMwLjAzMjggMjkuNjIzMkwxMS40Mzg0IDExLjA2MTYiIHN0cm9rZT0iI0IyMUI1NyIgc3Ryb2tlLXdpZHRoPSI1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=);
5225
5225
  background-color: var(--op-color);
5226
5226
  z-index: 1;
@@ -5292,8 +5292,8 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5292
5292
  pointer-events: none;
5293
5293
  mask-repeat: no-repeat;
5294
5294
  mask-position: center;
5295
- mask-size: auto clamp(20px, 10%, 60px);
5296
- -webkit-mask-size: auto clamp(20px, 10%, 60px);
5295
+ mask-size: auto clamp(20px, 50%, 60px);
5296
+ -webkit-mask-size: auto clamp(20px, 50%, 60px);
5297
5297
  mask-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMwLjAzMjggMjkuNjIzMkw0OC41NjE2IDExLjA2MTZNMzAuMDMyOCAyOS42MjMyTDQ4LjU2MTYgNDguMTg0N00zMC4wMzI4IDI5LjYyMzJMMTEuNDM4NCA0OC4xODQ3TTMwLjAzMjggMjkuNjIzMkwxMS40Mzg0IDExLjA2MTYiIHN0cm9rZT0iI0IyMUI1NyIgc3Ryb2tlLXdpZHRoPSI1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=);
5298
5298
  background-color: var(--op-color);
5299
5299
  z-index: 1;
@@ -5343,61 +5343,6 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5343
5343
  border-radius: 3px;
5344
5344
  pointer-events: none;
5345
5345
  }
5346
- .editor-root.history [data-block-type=embed][data-embed-type=office].history-inserted-block {
5347
- position: relative;
5348
- }
5349
- .editor-root.history [data-block-type=embed][data-embed-type=office].history-inserted-block::before {
5350
- content: var(--history-mask-identifier);
5351
- color: transparent;
5352
- position: absolute;
5353
- top: -5px;
5354
- bottom: -5px;
5355
- left: -5px;
5356
- right: -5px;
5357
- background-color: var(--op-selected-color);
5358
- border-radius: 3px;
5359
- pointer-events: none;
5360
- right: calc(100% - 360px - 5px);
5361
- }
5362
- .editor-root.history [data-block-type=embed][data-embed-type=office].history-deleted-block {
5363
- position: relative;
5364
- }
5365
- .editor-root.history [data-block-type=embed][data-embed-type=office].history-deleted-block::before {
5366
- content: var(--history-mask-identifier);
5367
- color: transparent;
5368
- position: absolute;
5369
- top: -5px;
5370
- bottom: -5px;
5371
- left: -5px;
5372
- right: -5px;
5373
- background-color: var(--op-selected-color);
5374
- border-radius: 3px;
5375
- pointer-events: none;
5376
- mask-repeat: no-repeat;
5377
- mask-position: center;
5378
- mask-size: auto clamp(20px, 10%, 60px);
5379
- -webkit-mask-size: auto clamp(20px, 10%, 60px);
5380
- mask-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMwLjAzMjggMjkuNjIzMkw0OC41NjE2IDExLjA2MTZNMzAuMDMyOCAyOS42MjMyTDQ4LjU2MTYgNDguMTg0N00zMC4wMzI4IDI5LjYyMzJMMTEuNDM4NCA0OC4xODQ3TTMwLjAzMjggMjkuNjIzMkwxMS40Mzg0IDExLjA2MTYiIHN0cm9rZT0iI0IyMUI1NyIgc3Ryb2tlLXdpZHRoPSI1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=);
5381
- background-color: var(--op-color);
5382
- z-index: 1;
5383
- right: calc(100% - 360px - 5px);
5384
- }
5385
- .editor-root.history [data-block-type=embed][data-embed-type=office].history-deleted-block {
5386
- position: relative;
5387
- }
5388
- .editor-root.history [data-block-type=embed][data-embed-type=office].history-deleted-block::after {
5389
- content: var(--history-mask-identifier);
5390
- color: transparent;
5391
- position: absolute;
5392
- top: -5px;
5393
- bottom: -5px;
5394
- left: -5px;
5395
- right: -5px;
5396
- background-color: var(--op-selected-color);
5397
- border-radius: 3px;
5398
- pointer-events: none;
5399
- right: calc(100% - 360px - 5px);
5400
- }
5401
5346
  .editor-root.history .list-block.history-inserted-block {
5402
5347
  position: relative;
5403
5348
  }
@@ -5429,8 +5374,8 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5429
5374
  pointer-events: none;
5430
5375
  mask-repeat: no-repeat;
5431
5376
  mask-position: center;
5432
- mask-size: auto clamp(20px, 10%, 60px);
5433
- -webkit-mask-size: auto clamp(20px, 10%, 60px);
5377
+ mask-size: auto clamp(20px, 50%, 60px);
5378
+ -webkit-mask-size: auto clamp(20px, 50%, 60px);
5434
5379
  mask-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMwLjAzMjggMjkuNjIzMkw0OC41NjE2IDExLjA2MTZNMzAuMDMyOCAyOS42MjMyTDQ4LjU2MTYgNDguMTg0N00zMC4wMzI4IDI5LjYyMzJMMTEuNDM4NCA0OC4xODQ3TTMwLjAzMjggMjkuNjIzMkwxMS40Mzg0IDExLjA2MTYiIHN0cm9rZT0iI0IyMUI1NyIgc3Ryb2tlLXdpZHRoPSI1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=);
5435
5380
  background-color: var(--op-color);
5436
5381
  z-index: 1;
@@ -5485,8 +5430,8 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5485
5430
  pointer-events: none;
5486
5431
  mask-repeat: no-repeat;
5487
5432
  mask-position: center;
5488
- mask-size: auto clamp(20px, 10%, 60px);
5489
- -webkit-mask-size: auto clamp(20px, 10%, 60px);
5433
+ mask-size: auto clamp(20px, 50%, 60px);
5434
+ -webkit-mask-size: auto clamp(20px, 50%, 60px);
5490
5435
  mask-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMwLjAzMjggMjkuNjIzMkw0OC41NjE2IDExLjA2MTZNMzAuMDMyOCAyOS42MjMyTDQ4LjU2MTYgNDguMTg0N00zMC4wMzI4IDI5LjYyMzJMMTEuNDM4NCA0OC4xODQ3TTMwLjAzMjggMjkuNjIzMkwxMS40Mzg0IDExLjA2MTYiIHN0cm9rZT0iI0IyMUI1NyIgc3Ryb2tlLXdpZHRoPSI1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=);
5491
5436
  background-color: var(--op-color);
5492
5437
  z-index: 1;
@@ -5512,10 +5457,10 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5512
5457
  text-decoration: unset;
5513
5458
  color: unset;
5514
5459
  }
5515
- .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], [data-block-type=embed][data-embed-type=office], .table-block, .layout-block).history-inserted-block {
5460
+ .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], .table-block, .layout-block).history-inserted-block {
5516
5461
  position: relative;
5517
5462
  }
5518
- .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], [data-block-type=embed][data-embed-type=office], .table-block, .layout-block).history-inserted-block::before {
5463
+ .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], .table-block, .layout-block).history-inserted-block::before {
5519
5464
  content: var(--history-mask-identifier);
5520
5465
  color: transparent;
5521
5466
  position: absolute;
@@ -5527,10 +5472,10 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5527
5472
  border-radius: 3px;
5528
5473
  pointer-events: none;
5529
5474
  }
5530
- .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], [data-block-type=embed][data-embed-type=office], .table-block, .layout-block).history-deleted-block {
5475
+ .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], .table-block, .layout-block).history-deleted-block {
5531
5476
  position: relative;
5532
5477
  }
5533
- .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], [data-block-type=embed][data-embed-type=office], .table-block, .layout-block).history-deleted-block::before {
5478
+ .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], .table-block, .layout-block).history-deleted-block::before {
5534
5479
  content: var(--history-mask-identifier);
5535
5480
  color: transparent;
5536
5481
  position: absolute;
@@ -5543,16 +5488,16 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5543
5488
  pointer-events: none;
5544
5489
  mask-repeat: no-repeat;
5545
5490
  mask-position: center;
5546
- mask-size: auto clamp(20px, 10%, 60px);
5547
- -webkit-mask-size: auto clamp(20px, 10%, 60px);
5491
+ mask-size: auto clamp(20px, 50%, 60px);
5492
+ -webkit-mask-size: auto clamp(20px, 50%, 60px);
5548
5493
  mask-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMwLjAzMjggMjkuNjIzMkw0OC41NjE2IDExLjA2MTZNMzAuMDMyOCAyOS42MjMyTDQ4LjU2MTYgNDguMTg0N00zMC4wMzI4IDI5LjYyMzJMMTEuNDM4NCA0OC4xODQ3TTMwLjAzMjggMjkuNjIzMkwxMS40Mzg0IDExLjA2MTYiIHN0cm9rZT0iI0IyMUI1NyIgc3Ryb2tlLXdpZHRoPSI1IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=);
5549
5494
  background-color: var(--op-color);
5550
5495
  z-index: 1;
5551
5496
  }
5552
- .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], [data-block-type=embed][data-embed-type=office], .table-block, .layout-block).history-deleted-block {
5497
+ .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], .table-block, .layout-block).history-deleted-block {
5553
5498
  position: relative;
5554
5499
  }
5555
- .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], [data-block-type=embed][data-embed-type=office], .table-block, .layout-block).history-deleted-block::after {
5500
+ .editor-root.history [data-type=editor-block]:not(.list-block, .text-block, [data-style-quoted=true], .table-block, .layout-block).history-deleted-block::after {
5556
5501
  content: var(--history-mask-identifier);
5557
5502
  color: transparent;
5558
5503
  position: absolute;
@@ -5630,6 +5575,7 @@ div.editor-root:not(.mobile) div.editor-content div[data-type=editor-container]
5630
5575
  background-color: var(--op-selected-color);
5631
5576
  border-radius: 0px;
5632
5577
  pointer-events: none;
5578
+ z-index: 1;
5633
5579
  }
5634
5580
  .editor-root.history .mention-box.history-inserted-box {
5635
5581
  position: relative;
@@ -6616,94 +6562,94 @@ div[data-command-bar-id=mobile-bottom-menu] .mobile-menu-wrap.editor-mention .co
6616
6562
  .editor-root [data-type=editor-container].root div[data-type=editor-block].callout-block:not(.selected):not(.full-selected) .callout-root[data-border-color="13"] {
6617
6563
  border-color: #bc9bfa;
6618
6564
  }
6619
- .command-item[data-id=callout-background-color] .color-button {
6565
+ .command-item[data-id=callout-background-color] .color-button.color-button {
6620
6566
  all: unset;
6621
6567
  width: 16px;
6622
6568
  height: 16px;
6623
6569
  margin-right: 4px;
6624
6570
  }
6625
- .command-item[data-id=callout-background-color] .color-button[data-background-color="0"] {
6571
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="0"] {
6626
6572
  background-color: #f2f2f2;
6627
6573
  }
6628
- .command-item[data-id=callout-background-color] .color-button[data-border-color="0"] {
6574
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="0"] {
6629
6575
  border-color: #d9d9d9;
6630
6576
  }
6631
- .command-item[data-id=callout-background-color] .color-button[data-background-color="1"] {
6577
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="1"] {
6632
6578
  background-color: #ffeae8;
6633
6579
  }
6634
- .command-item[data-id=callout-background-color] .color-button[data-border-color="1"] {
6580
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="1"] {
6635
6581
  border-color: #fbbcb5;
6636
6582
  }
6637
- .command-item[data-id=callout-background-color] .color-button[data-background-color="2"] {
6583
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="2"] {
6638
6584
  background-color: #fff0d9;
6639
6585
  }
6640
- .command-item[data-id=callout-background-color] .color-button[data-border-color="2"] {
6586
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="2"] {
6641
6587
  border-color: #ffd28f;
6642
6588
  }
6643
- .command-item[data-id=callout-background-color] .color-button[data-background-color="3"] {
6589
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="3"] {
6644
6590
  background-color: #eaf5d5;
6645
6591
  }
6646
- .command-item[data-id=callout-background-color] .color-button[data-border-color="3"] {
6592
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="3"] {
6647
6593
  border-color: #c5e092;
6648
6594
  }
6649
- .command-item[data-id=callout-background-color] .color-button[data-background-color="4"] {
6595
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="4"] {
6650
6596
  background-color: #d7f7ea;
6651
6597
  }
6652
- .command-item[data-id=callout-background-color] .color-button[data-border-color="4"] {
6598
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="4"] {
6653
6599
  border-color: #8de3c0;
6654
6600
  }
6655
- .command-item[data-id=callout-background-color] .color-button[data-background-color="5"] {
6601
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="5"] {
6656
6602
  background-color: #e3eeff;
6657
6603
  }
6658
- .command-item[data-id=callout-background-color] .color-button[data-border-color="5"] {
6604
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="5"] {
6659
6605
  border-color: #abcdff;
6660
6606
  }
6661
- .command-item[data-id=callout-background-color] .color-button[data-background-color="6"] {
6607
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="6"] {
6662
6608
  background-color: #f0e8ff;
6663
6609
  }
6664
- .command-item[data-id=callout-background-color] .color-button[data-border-color="6"] {
6610
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="6"] {
6665
6611
  border-color: #d3befa;
6666
6612
  }
6667
- .command-item[data-id=callout-background-color] .color-button[data-background-color="7"] {
6613
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="7"] {
6668
6614
  background-color: #e6e6e6;
6669
6615
  }
6670
- .command-item[data-id=callout-background-color] .color-button[data-border-color="7"] {
6616
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="7"] {
6671
6617
  border-color: #c2c2c2;
6672
6618
  }
6673
- .command-item[data-id=callout-background-color] .color-button[data-background-color="8"] {
6619
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="8"] {
6674
6620
  background-color: #fddcd8;
6675
6621
  }
6676
- .command-item[data-id=callout-background-color] .color-button[data-border-color="8"] {
6622
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="8"] {
6677
6623
  border-color: #fa9287;
6678
6624
  }
6679
- .command-item[data-id=callout-background-color] .color-button[data-background-color="9"] {
6625
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="9"] {
6680
6626
  background-color: #fee4bc;
6681
6627
  }
6682
- .command-item[data-id=callout-background-color] .color-button[data-border-color="9"] {
6628
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="9"] {
6683
6629
  border-color: #ffbd59;
6684
6630
  }
6685
- .command-item[data-id=callout-background-color] .color-button[data-background-color="10"] {
6631
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="10"] {
6686
6632
  background-color: #dcedbb;
6687
6633
  }
6688
- .command-item[data-id=callout-background-color] .color-button[data-border-color="10"] {
6634
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="10"] {
6689
6635
  border-color: #a8d15c;
6690
6636
  }
6691
- .command-item[data-id=callout-background-color] .color-button[data-background-color="11"] {
6637
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="11"] {
6692
6638
  background-color: #b9f0d9;
6693
6639
  }
6694
- .command-item[data-id=callout-background-color] .color-button[data-border-color="11"] {
6640
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="11"] {
6695
6641
  border-color: #60d1a4;
6696
6642
  }
6697
- .command-item[data-id=callout-background-color] .color-button[data-background-color="12"] {
6643
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="12"] {
6698
6644
  background-color: #cfe2ff;
6699
6645
  }
6700
- .command-item[data-id=callout-background-color] .color-button[data-border-color="12"] {
6646
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="12"] {
6701
6647
  border-color: #7aafff;
6702
6648
  }
6703
- .command-item[data-id=callout-background-color] .color-button[data-background-color="13"] {
6649
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-background-color="13"] {
6704
6650
  background-color: #e4d7fc;
6705
6651
  }
6706
- .command-item[data-id=callout-background-color] .color-button[data-border-color="13"] {
6652
+ .command-item[data-id=callout-background-color] .color-button.color-button[data-border-color="13"] {
6707
6653
  border-color: #bc9bfa;
6708
6654
  }
6709
6655
  .command-item[data-id=callout-background-color] .color-palette .bar-desc {
@@ -41641,16 +41587,22 @@ ${codeText}
41641
41587
  this.children.push(this.colorPaletteItem);
41642
41588
  this.element = createColorButton();
41643
41589
  this.element.addEventListener("click", this.handleButtonClick);
41644
- const color = Number.parseInt(editor.settingsProvider.getItem(`${storageName}-color`) || "", 10);
41645
- const backgroundColor = Number.parseInt(editor.settingsProvider.getItem(`${storageName}-backgroundColor`) || `${DEFAULT_BG_COLOR}`, 10);
41590
+ const existColors = this.getColorsFromLocalStorage();
41591
+ this.latestColors = existColors;
41592
+ setColorButtonColor(this.element, this.latestColors);
41593
+ this.element.setAttribute(`data-editor-tooltip-${editor.clientId}`, this.name);
41594
+ }
41595
+ getColorsFromLocalStorage() {
41596
+ const colors = [null, null];
41597
+ const color = Number.parseInt(this.editor.settingsProvider.getItem(`${this.storageName}-color`) || "", 10);
41598
+ const backgroundColor = Number.parseInt(this.editor.settingsProvider.getItem(`${this.storageName}-backgroundColor`) || `${DEFAULT_BG_COLOR}`, 10);
41646
41599
  if (!Number.isNaN(color)) {
41647
- this.latestColors[0] = color;
41600
+ colors[0] = color;
41648
41601
  }
41649
41602
  if (!Number.isNaN(backgroundColor)) {
41650
- this.latestColors[1] = backgroundColor;
41603
+ colors[1] = backgroundColor;
41651
41604
  }
41652
- setColorButtonColor(this.element, this.latestColors);
41653
- this.element.setAttribute(`data-editor-tooltip-${editor.clientId}`, this.name);
41605
+ return colors;
41654
41606
  }
41655
41607
  destroy() {
41656
41608
  this.colorPaletteItem.destroy();
@@ -41663,6 +41615,7 @@ ${codeText}
41663
41615
  }
41664
41616
  setCurrentTextColors(colors) {
41665
41617
  this.currentTextColors = colors;
41618
+ setColorButtonColor(this.element, this.currentTextColors);
41666
41619
  }
41667
41620
  }
41668
41621
  const input = "";
@@ -59489,8 +59442,8 @@ $$${mathData.mathjaxText}$$
59489
59442
  setColorToAttributes(attributes, type, value);
59490
59443
  (_c = this.blockAttributesHandler) == null ? void 0 : _c.setEmptyBlockTextAttributes(blockId, attributes);
59491
59444
  });
59492
- __publicField(this, "updateButtonColor", (range) => {
59493
- const colors = editorRangeGetColor(this.editor, range, this.getEmptyTextBlockColor);
59445
+ __publicField(this, "updateButtonColor", () => {
59446
+ const colors = this.colorItem.getColorsFromLocalStorage();
59494
59447
  this.colorItem.setCurrentTextColors(colors);
59495
59448
  });
59496
59449
  __publicField(this, "setActiveAttribute", (type, value) => {
@@ -59537,7 +59490,7 @@ $$${mathData.mathjaxText}$$
59537
59490
  if (disable && (params == null ? void 0 : params.isFilter)) {
59538
59491
  return [];
59539
59492
  }
59540
- this.updateButtonColor(range);
59493
+ this.updateButtonColor();
59541
59494
  return [{ ...this.colorItem, states: disable ? ["disabled"] : [], childrenPlacement: "bottom" }];
59542
59495
  }
59543
59496
  getInsertCommands() {
@@ -87821,7 +87774,7 @@ ${data2.flowchartText}
87821
87774
  }
87822
87775
  }
87823
87776
  });
87824
- editor.version = "2.1.8-beta.7";
87777
+ editor.version = "2.1.8-beta.8";
87825
87778
  if (Logger$2.level === LogLevel.DEBUG) {
87826
87779
  window.setReauthFail = (fail) => {
87827
87780
  window.isReauthError = fail;
@@ -87922,7 +87875,7 @@ ${data2.flowchartText}
87922
87875
  });
87923
87876
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
87924
87877
  OnesEditorToolbar.register(editor);
87925
- editor.version = "2.1.8-beta.7";
87878
+ editor.version = "2.1.8-beta.8";
87926
87879
  return editor;
87927
87880
  }
87928
87881
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.1.8-beta.7",
3
+ "version": "2.1.8-beta.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",