@ones-editor/editor 2.1.8-beta.10 → 2.1.8-beta.12

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.
@@ -28,5 +28,6 @@ export declare class TextColorItem extends TypedEmitter<ColorPaletteEvents> impl
28
28
  beforePopup: () => void;
29
29
  updatePaletteColor(): void;
30
30
  setCurrentTextColors(colors: [number | null, number | null]): void;
31
+ setCurrentButtonColor(colors: [number | null, number | null]): void;
31
32
  }
32
33
  export {};
package/dist/index.js CHANGED
@@ -39087,7 +39087,7 @@ ${codeText}
39087
39087
  const zhCN$w = {
39088
39088
  colorPalette: {
39089
39089
  colorDesc: "\u5B57\u4F53\u989C\u8272",
39090
- name: "\u6587\u672C\u989C\u8272",
39090
+ name: "\u5B57\u4F53\u989C\u8272",
39091
39091
  backgroundDesc: "\u80CC\u666F\u989C\u8272",
39092
39092
  reset: "\u6062\u590D\u9ED8\u8BA4",
39093
39093
  more: "\u66F4\u591A\u989C\u8272"
@@ -39151,7 +39151,7 @@ ${codeText}
39151
39151
  const jaJP$w = {
39152
39152
  colorPalette: {
39153
39153
  colorDesc: "\u30D5\u30A9\u30F3\u30C8\u306E\u8272",
39154
- name: "\u30C6\u30AD\u30B9\u30C8\u306E\u8272",
39154
+ name: "\u30D5\u30A9\u30F3\u30C8\u306E\u8272",
39155
39155
  backgroundDesc: "\u80CC\u666F\u8272",
39156
39156
  reset: "\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u623B\u3059",
39157
39157
  more: "\u305D\u306E\u4ED6\u306E\u8272"
@@ -41572,7 +41572,7 @@ ${codeText}
41572
41572
  this.latestColors[1] = DEFAULT_BG_COLOR;
41573
41573
  }
41574
41574
  }
41575
- setColorButtonColor(this.element, this.latestColors);
41575
+ this.setCurrentButtonColor(this.latestColors);
41576
41576
  this.editor.settingsProvider.setItem(`${this.storageName}-color`, ((_a = this.latestColors[0]) == null ? void 0 : _a.toString()) || "");
41577
41577
  this.editor.settingsProvider.setItem(`${this.storageName}-backgroundColor`, ((_b = this.latestColors[1]) == null ? void 0 : _b.toString()) || "");
41578
41578
  });
@@ -41589,7 +41589,7 @@ ${codeText}
41589
41589
  this.element.addEventListener("click", this.handleButtonClick);
41590
41590
  const existColors = this.getColorsFromLocalStorage();
41591
41591
  this.latestColors = existColors;
41592
- setColorButtonColor(this.element, this.latestColors);
41592
+ this.setCurrentButtonColor(this.latestColors);
41593
41593
  this.element.setAttribute(`data-editor-tooltip-${editor.clientId}`, this.name);
41594
41594
  }
41595
41595
  getColorsFromLocalStorage() {
@@ -41615,7 +41615,9 @@ ${codeText}
41615
41615
  }
41616
41616
  setCurrentTextColors(colors) {
41617
41617
  this.currentTextColors = colors;
41618
- setColorButtonColor(this.element, this.currentTextColors);
41618
+ }
41619
+ setCurrentButtonColor(colors) {
41620
+ setColorButtonColor(this.element, colors);
41619
41621
  }
41620
41622
  }
41621
41623
  const input = "";
@@ -59442,9 +59444,11 @@ $$${mathData.mathjaxText}$$
59442
59444
  setColorToAttributes(attributes, type, value);
59443
59445
  (_c = this.blockAttributesHandler) == null ? void 0 : _c.setEmptyBlockTextAttributes(blockId, attributes);
59444
59446
  });
59445
- __publicField(this, "updateButtonColor", () => {
59446
- const colors = this.colorItem.getColorsFromLocalStorage();
59447
- this.colorItem.setCurrentTextColors(colors);
59447
+ __publicField(this, "updateButtonColor", (range) => {
59448
+ const currentTextColor = editorRangeGetColor(this.editor, range, this.getEmptyTextBlockColor);
59449
+ this.colorItem.setCurrentTextColors(currentTextColor);
59450
+ const lastButtonColor = this.colorItem.getColorsFromLocalStorage();
59451
+ this.colorItem.setCurrentButtonColor(lastButtonColor);
59448
59452
  });
59449
59453
  __publicField(this, "setActiveAttribute", (type, value) => {
59450
59454
  if (type === "color" || type === "backgroundColor") {
@@ -59490,7 +59494,7 @@ $$${mathData.mathjaxText}$$
59490
59494
  if (disable && (params == null ? void 0 : params.isFilter)) {
59491
59495
  return [];
59492
59496
  }
59493
- this.updateButtonColor();
59497
+ this.updateButtonColor(range);
59494
59498
  return [{ ...this.colorItem, states: disable ? ["disabled"] : [], childrenPlacement: "bottom" }];
59495
59499
  }
59496
59500
  getInsertCommands() {
@@ -87774,7 +87778,7 @@ ${data2.flowchartText}
87774
87778
  }
87775
87779
  }
87776
87780
  });
87777
- editor.version = "2.1.8-beta.10";
87781
+ editor.version = "2.1.8-beta.12";
87778
87782
  if (Logger$2.level === LogLevel.DEBUG) {
87779
87783
  window.setReauthFail = (fail) => {
87780
87784
  window.isReauthError = fail;
@@ -87875,7 +87879,7 @@ ${data2.flowchartText}
87875
87879
  });
87876
87880
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
87877
87881
  OnesEditorToolbar.register(editor);
87878
- editor.version = "2.1.8-beta.10";
87882
+ editor.version = "2.1.8-beta.12";
87879
87883
  return editor;
87880
87884
  }
87881
87885
  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.10",
3
+ "version": "2.1.8-beta.12",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",