microboard-temp 0.7.0 → 0.8.0

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.
@@ -9565,7 +9565,7 @@ function fillHighlight(ctx, textBlock) {
9565
9565
  return;
9566
9566
  }
9567
9567
  const measure = textBlock.measure;
9568
- ctx.fillStyle = textBlock.style.backgroundColor;
9568
+ ctx.fillStyle = resolveColor(textBlock.style.backgroundColor, conf.theme, "background");
9569
9569
  ctx.fillRect(textBlock.x, textBlock.y - measure.ascent, measure.width, measure.height);
9570
9570
  }
9571
9571
  function underline(ctx, textBlock) {
@@ -9577,14 +9577,13 @@ function underline(ctx, textBlock) {
9577
9577
  const style = textBlock.style;
9578
9578
  const measure = textBlock.measure;
9579
9579
  const width = measure.width - (textBlock.marginLeft || 0);
9580
- const color = style.color;
9581
- ctx.strokeStyle = color;
9580
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
9582
9581
  ctx.lineWidth = textBlock.fontSize / 14;
9583
9582
  ctx.beginPath();
9584
9583
  ctx.moveTo(x, y + 2 * textBlock.fontSize / 14);
9585
9584
  ctx.lineTo(x + width, y + 2 * textBlock.fontSize / 14);
9586
9585
  ctx.stroke();
9587
- ctx.strokeStyle = style.backgroundColor ?? "black";
9586
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
9588
9587
  ctx.lineWidth = 2;
9589
9588
  }
9590
9589
  function cross(ctx, textBlock) {
@@ -9597,19 +9596,18 @@ function cross(ctx, textBlock) {
9597
9596
  const measure = textBlock.measure;
9598
9597
  const width = measure.width;
9599
9598
  const height = measure.height;
9600
- const color = style.color;
9601
- ctx.strokeStyle = color;
9599
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
9602
9600
  ctx.lineWidth = textBlock.fontSize / 14;
9603
9601
  ctx.beginPath();
9604
9602
  ctx.moveTo(x, y - height / 4);
9605
9603
  ctx.lineTo(x + width, y - height / 4);
9606
9604
  ctx.stroke();
9607
- ctx.strokeStyle = style.backgroundColor ?? "black";
9605
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
9608
9606
  ctx.lineWidth = 2;
9609
9607
  }
9610
9608
  function fillText(ctx, textBlock) {
9611
9609
  const { text, style, x, y } = textBlock;
9612
- ctx.fillStyle = style.color;
9610
+ ctx.fillStyle = resolveColor(style.color, conf.theme, "foreground");
9613
9611
  ctx.fillText(text, x, y);
9614
9612
  if (textBlock.listMark) {
9615
9613
  ctx.fillText(textBlock.listMark, x - measureText(textBlock.listMark, style).width - 4, y);
@@ -16896,7 +16894,7 @@ function setSelectionFontHighlight(editor, format, selectionContext) {
16896
16894
  }
16897
16895
  if (format === "none") {
16898
16896
  import_slate25.Editor.removeMark(editor, "fontHighlight");
16899
- } else if (marks.fontHighlight === format) {
16897
+ } else if (typeof format === "string" && marks.fontHighlight === format) {
16900
16898
  import_slate25.Editor.removeMark(editor, "fontHighlight");
16901
16899
  } else {
16902
16900
  import_slate25.Editor.addMark(editor, "fontHighlight", format);
@@ -22651,8 +22649,8 @@ class RichText extends BaseItem {
22651
22649
  node2.underline ? "underline" : "",
22652
22650
  node2["line-through"] ? "line-through" : ""
22653
22651
  ].filter(Boolean).join(" "),
22654
- color: node2.fontColor || conf.DEFAULT_TEXT_STYLES.fontColor,
22655
- backgroundColor: node2.fontHighlight || conf.DEFAULT_TEXT_STYLES.fontHighlight,
22652
+ color: node2.fontColor ? resolveColor(node2.fontColor, conf.theme, "foreground") : conf.DEFAULT_TEXT_STYLES.fontColor,
22653
+ backgroundColor: node2.fontHighlight ? resolveColor(node2.fontHighlight, conf.theme, "background") : conf.DEFAULT_TEXT_STYLES.fontHighlight,
22656
22654
  fontSize: node2.fontSize ? `${node2.fontSize}px` : `${conf.DEFAULT_TEXT_STYLES.fontSize}px`,
22657
22655
  fontFamily: node2.fontFamily || conf.DEFAULT_TEXT_STYLES.fontFamily
22658
22656
  });
@@ -37817,6 +37815,12 @@ class Connector2 extends BaseItem {
37817
37815
  mbr.strokeWidth = 3;
37818
37816
  mbr.borderStyle = "solid";
37819
37817
  this.clipText(context);
37818
+ const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
37819
+ this.lines.setBorderColor(resolvedLineColor);
37820
+ this.startPointer.path.setBorderColor(resolvedLineColor);
37821
+ this.startPointer.path.setBackgroundColor(resolvedLineColor);
37822
+ this.endPointer.path.setBorderColor(resolvedLineColor);
37823
+ this.endPointer.path.setBackgroundColor(resolvedLineColor);
37820
37824
  if (!this.text.isRenderEnabled && this.board.selection.getContext() !== "EditTextUnderPointer") {
37821
37825
  this.lines.render(context);
37822
37826
  }
@@ -38098,17 +38102,11 @@ class Connector2 extends BaseItem {
38098
38102
  const endPoint = this.endPoint;
38099
38103
  this.lines = getLine(this.lineStyle, startPoint, endPoint, this.middlePoint).addConnectedItemType(this.itemType);
38100
38104
  this.startPointer = getStartPointer(startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
38101
- const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
38102
- this.startPointer.path.setBorderColor(resolvedLineColor);
38103
38105
  this.startPointer.path.setBorderWidth(this.lineWidth);
38104
- this.startPointer.path.setBackgroundColor(resolvedLineColor);
38105
38106
  this.endPointer = getEndPointer(endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
38106
- this.endPointer.path.setBorderColor(resolvedLineColor);
38107
38107
  this.endPointer.path.setBorderWidth(this.lineWidth);
38108
- this.endPointer.path.setBackgroundColor(resolvedLineColor);
38109
38108
  this.offsetLines();
38110
38109
  this.lines.setBorderWidth(this.lineWidth);
38111
- this.lines.setBorderColor(resolvedLineColor);
38112
38110
  this.lines.setBorderStyle(this.borderStyle);
38113
38111
  this.updateTitle();
38114
38112
  }
@@ -39888,7 +39886,6 @@ class Shape extends BaseItem {
39888
39886
  }
39889
39887
  applyBackgroundColor(backgroundColor) {
39890
39888
  this.backgroundColor = backgroundColor;
39891
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
39892
39889
  }
39893
39890
  setBackgroundColor(backgroundColor) {
39894
39891
  this.emit({
@@ -39924,7 +39921,6 @@ class Shape extends BaseItem {
39924
39921
  }
39925
39922
  applyBorderColor(borderColor) {
39926
39923
  this.borderColor = borderColor;
39927
- this.path.setBorderColor(resolveColor(borderColor, conf.theme, "foreground"));
39928
39924
  }
39929
39925
  setBorderColor(borderColor) {
39930
39926
  this.emit({
@@ -40032,6 +40028,8 @@ class Shape extends BaseItem {
40032
40028
  if (this.transformationRenderBlock) {
40033
40029
  return;
40034
40030
  }
40031
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40032
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
40035
40033
  this.path.render(context);
40036
40034
  this.text.render(context);
40037
40035
  if (this.getLinkTo()) {
@@ -40132,9 +40130,7 @@ class Shape extends BaseItem {
40132
40130
  this.text.setContainer(this.textContainer.copy());
40133
40131
  this.textContainer.transform(this.transformation.toMatrix());
40134
40132
  this.path.transform(this.transformation.toMatrix());
40135
- this.path.setBackgroundColor(this.backgroundColor);
40136
40133
  this.path.setBackgroundOpacity(this.backgroundOpacity);
40137
- this.path.setBorderColor(this.borderColor);
40138
40134
  this.path.setBorderWidth(this.borderWidth);
40139
40135
  this.path.setBorderStyle(this.borderStyle);
40140
40136
  this.path.setBorderOpacity(this.borderOpacity);
@@ -40321,7 +40317,6 @@ class Sticker extends BaseItem {
40321
40317
  this.stickerPath.transform(this.transformation.toMatrix());
40322
40318
  this.text.setContainer(this.textContainer.copy());
40323
40319
  this.textContainer.transform(this.transformation.toMatrix());
40324
- this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40325
40320
  this.saveStickerData();
40326
40321
  }
40327
40322
  setId(id) {
@@ -40365,7 +40360,6 @@ class Sticker extends BaseItem {
40365
40360
  }
40366
40361
  applyBackgroundColor(backgroundColor) {
40367
40362
  this.backgroundColor = backgroundColor;
40368
- this.stickerPath.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
40369
40363
  }
40370
40364
  setBackgroundColor(backgroundColor) {
40371
40365
  this.emit({
@@ -40412,6 +40406,7 @@ class Sticker extends BaseItem {
40412
40406
  return;
40413
40407
  }
40414
40408
  this.renderShadow(context);
40409
+ this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40415
40410
  this.stickerPath.render(context);
40416
40411
  this.text.render(context);
40417
40412
  if (this.getLinkTo()) {
@@ -40954,9 +40949,7 @@ class Frame2 extends BaseItem {
40954
40949
  this.path.transform(this.transformation.toMatrix());
40955
40950
  this.textContainer.transform(this.transformation.toMatrix());
40956
40951
  }
40957
- this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40958
40952
  this.path.setBackgroundOpacity(this.backgroundOpacity);
40959
- this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
40960
40953
  this.path.setBorderWidth(this.borderWidth);
40961
40954
  this.path.setBorderStyle(this.borderStyle);
40962
40955
  this.path.setBorderOpacity(this.borderOpacity);
@@ -41107,7 +41100,6 @@ class Frame2 extends BaseItem {
41107
41100
  }
41108
41101
  applyBackgroundColor(backgroundColor) {
41109
41102
  this.backgroundColor = backgroundColor;
41110
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
41111
41103
  }
41112
41104
  setBackgroundColor(backgroundColor) {
41113
41105
  this.emit({
@@ -41155,6 +41147,8 @@ class Frame2 extends BaseItem {
41155
41147
  if (this.transformationRenderBlock) {
41156
41148
  return;
41157
41149
  }
41150
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
41151
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
41158
41152
  this.path.render(context);
41159
41153
  this.renderNewShape(context);
41160
41154
  if (this.getLinkTo()) {
package/dist/cjs/index.js CHANGED
@@ -9565,7 +9565,7 @@ function fillHighlight(ctx, textBlock) {
9565
9565
  return;
9566
9566
  }
9567
9567
  const measure = textBlock.measure;
9568
- ctx.fillStyle = textBlock.style.backgroundColor;
9568
+ ctx.fillStyle = resolveColor(textBlock.style.backgroundColor, conf.theme, "background");
9569
9569
  ctx.fillRect(textBlock.x, textBlock.y - measure.ascent, measure.width, measure.height);
9570
9570
  }
9571
9571
  function underline(ctx, textBlock) {
@@ -9577,14 +9577,13 @@ function underline(ctx, textBlock) {
9577
9577
  const style = textBlock.style;
9578
9578
  const measure = textBlock.measure;
9579
9579
  const width = measure.width - (textBlock.marginLeft || 0);
9580
- const color = style.color;
9581
- ctx.strokeStyle = color;
9580
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
9582
9581
  ctx.lineWidth = textBlock.fontSize / 14;
9583
9582
  ctx.beginPath();
9584
9583
  ctx.moveTo(x, y + 2 * textBlock.fontSize / 14);
9585
9584
  ctx.lineTo(x + width, y + 2 * textBlock.fontSize / 14);
9586
9585
  ctx.stroke();
9587
- ctx.strokeStyle = style.backgroundColor ?? "black";
9586
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
9588
9587
  ctx.lineWidth = 2;
9589
9588
  }
9590
9589
  function cross(ctx, textBlock) {
@@ -9597,19 +9596,18 @@ function cross(ctx, textBlock) {
9597
9596
  const measure = textBlock.measure;
9598
9597
  const width = measure.width;
9599
9598
  const height = measure.height;
9600
- const color = style.color;
9601
- ctx.strokeStyle = color;
9599
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
9602
9600
  ctx.lineWidth = textBlock.fontSize / 14;
9603
9601
  ctx.beginPath();
9604
9602
  ctx.moveTo(x, y - height / 4);
9605
9603
  ctx.lineTo(x + width, y - height / 4);
9606
9604
  ctx.stroke();
9607
- ctx.strokeStyle = style.backgroundColor ?? "black";
9605
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
9608
9606
  ctx.lineWidth = 2;
9609
9607
  }
9610
9608
  function fillText(ctx, textBlock) {
9611
9609
  const { text, style, x, y } = textBlock;
9612
- ctx.fillStyle = style.color;
9610
+ ctx.fillStyle = resolveColor(style.color, conf.theme, "foreground");
9613
9611
  ctx.fillText(text, x, y);
9614
9612
  if (textBlock.listMark) {
9615
9613
  ctx.fillText(textBlock.listMark, x - measureText(textBlock.listMark, style).width - 4, y);
@@ -16896,7 +16894,7 @@ function setSelectionFontHighlight(editor, format, selectionContext) {
16896
16894
  }
16897
16895
  if (format === "none") {
16898
16896
  import_slate25.Editor.removeMark(editor, "fontHighlight");
16899
- } else if (marks.fontHighlight === format) {
16897
+ } else if (typeof format === "string" && marks.fontHighlight === format) {
16900
16898
  import_slate25.Editor.removeMark(editor, "fontHighlight");
16901
16899
  } else {
16902
16900
  import_slate25.Editor.addMark(editor, "fontHighlight", format);
@@ -22651,8 +22649,8 @@ class RichText extends BaseItem {
22651
22649
  node2.underline ? "underline" : "",
22652
22650
  node2["line-through"] ? "line-through" : ""
22653
22651
  ].filter(Boolean).join(" "),
22654
- color: node2.fontColor || conf.DEFAULT_TEXT_STYLES.fontColor,
22655
- backgroundColor: node2.fontHighlight || conf.DEFAULT_TEXT_STYLES.fontHighlight,
22652
+ color: node2.fontColor ? resolveColor(node2.fontColor, conf.theme, "foreground") : conf.DEFAULT_TEXT_STYLES.fontColor,
22653
+ backgroundColor: node2.fontHighlight ? resolveColor(node2.fontHighlight, conf.theme, "background") : conf.DEFAULT_TEXT_STYLES.fontHighlight,
22656
22654
  fontSize: node2.fontSize ? `${node2.fontSize}px` : `${conf.DEFAULT_TEXT_STYLES.fontSize}px`,
22657
22655
  fontFamily: node2.fontFamily || conf.DEFAULT_TEXT_STYLES.fontFamily
22658
22656
  });
@@ -37817,6 +37815,12 @@ class Connector2 extends BaseItem {
37817
37815
  mbr.strokeWidth = 3;
37818
37816
  mbr.borderStyle = "solid";
37819
37817
  this.clipText(context);
37818
+ const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
37819
+ this.lines.setBorderColor(resolvedLineColor);
37820
+ this.startPointer.path.setBorderColor(resolvedLineColor);
37821
+ this.startPointer.path.setBackgroundColor(resolvedLineColor);
37822
+ this.endPointer.path.setBorderColor(resolvedLineColor);
37823
+ this.endPointer.path.setBackgroundColor(resolvedLineColor);
37820
37824
  if (!this.text.isRenderEnabled && this.board.selection.getContext() !== "EditTextUnderPointer") {
37821
37825
  this.lines.render(context);
37822
37826
  }
@@ -38098,17 +38102,11 @@ class Connector2 extends BaseItem {
38098
38102
  const endPoint = this.endPoint;
38099
38103
  this.lines = getLine(this.lineStyle, startPoint, endPoint, this.middlePoint).addConnectedItemType(this.itemType);
38100
38104
  this.startPointer = getStartPointer(startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
38101
- const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
38102
- this.startPointer.path.setBorderColor(resolvedLineColor);
38103
38105
  this.startPointer.path.setBorderWidth(this.lineWidth);
38104
- this.startPointer.path.setBackgroundColor(resolvedLineColor);
38105
38106
  this.endPointer = getEndPointer(endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
38106
- this.endPointer.path.setBorderColor(resolvedLineColor);
38107
38107
  this.endPointer.path.setBorderWidth(this.lineWidth);
38108
- this.endPointer.path.setBackgroundColor(resolvedLineColor);
38109
38108
  this.offsetLines();
38110
38109
  this.lines.setBorderWidth(this.lineWidth);
38111
- this.lines.setBorderColor(resolvedLineColor);
38112
38110
  this.lines.setBorderStyle(this.borderStyle);
38113
38111
  this.updateTitle();
38114
38112
  }
@@ -39888,7 +39886,6 @@ class Shape extends BaseItem {
39888
39886
  }
39889
39887
  applyBackgroundColor(backgroundColor) {
39890
39888
  this.backgroundColor = backgroundColor;
39891
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
39892
39889
  }
39893
39890
  setBackgroundColor(backgroundColor) {
39894
39891
  this.emit({
@@ -39924,7 +39921,6 @@ class Shape extends BaseItem {
39924
39921
  }
39925
39922
  applyBorderColor(borderColor) {
39926
39923
  this.borderColor = borderColor;
39927
- this.path.setBorderColor(resolveColor(borderColor, conf.theme, "foreground"));
39928
39924
  }
39929
39925
  setBorderColor(borderColor) {
39930
39926
  this.emit({
@@ -40032,6 +40028,8 @@ class Shape extends BaseItem {
40032
40028
  if (this.transformationRenderBlock) {
40033
40029
  return;
40034
40030
  }
40031
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40032
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
40035
40033
  this.path.render(context);
40036
40034
  this.text.render(context);
40037
40035
  if (this.getLinkTo()) {
@@ -40132,9 +40130,7 @@ class Shape extends BaseItem {
40132
40130
  this.text.setContainer(this.textContainer.copy());
40133
40131
  this.textContainer.transform(this.transformation.toMatrix());
40134
40132
  this.path.transform(this.transformation.toMatrix());
40135
- this.path.setBackgroundColor(this.backgroundColor);
40136
40133
  this.path.setBackgroundOpacity(this.backgroundOpacity);
40137
- this.path.setBorderColor(this.borderColor);
40138
40134
  this.path.setBorderWidth(this.borderWidth);
40139
40135
  this.path.setBorderStyle(this.borderStyle);
40140
40136
  this.path.setBorderOpacity(this.borderOpacity);
@@ -40321,7 +40317,6 @@ class Sticker extends BaseItem {
40321
40317
  this.stickerPath.transform(this.transformation.toMatrix());
40322
40318
  this.text.setContainer(this.textContainer.copy());
40323
40319
  this.textContainer.transform(this.transformation.toMatrix());
40324
- this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40325
40320
  this.saveStickerData();
40326
40321
  }
40327
40322
  setId(id) {
@@ -40365,7 +40360,6 @@ class Sticker extends BaseItem {
40365
40360
  }
40366
40361
  applyBackgroundColor(backgroundColor) {
40367
40362
  this.backgroundColor = backgroundColor;
40368
- this.stickerPath.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
40369
40363
  }
40370
40364
  setBackgroundColor(backgroundColor) {
40371
40365
  this.emit({
@@ -40412,6 +40406,7 @@ class Sticker extends BaseItem {
40412
40406
  return;
40413
40407
  }
40414
40408
  this.renderShadow(context);
40409
+ this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40415
40410
  this.stickerPath.render(context);
40416
40411
  this.text.render(context);
40417
40412
  if (this.getLinkTo()) {
@@ -40954,9 +40949,7 @@ class Frame2 extends BaseItem {
40954
40949
  this.path.transform(this.transformation.toMatrix());
40955
40950
  this.textContainer.transform(this.transformation.toMatrix());
40956
40951
  }
40957
- this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40958
40952
  this.path.setBackgroundOpacity(this.backgroundOpacity);
40959
- this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
40960
40953
  this.path.setBorderWidth(this.borderWidth);
40961
40954
  this.path.setBorderStyle(this.borderStyle);
40962
40955
  this.path.setBorderOpacity(this.borderOpacity);
@@ -41107,7 +41100,6 @@ class Frame2 extends BaseItem {
41107
41100
  }
41108
41101
  applyBackgroundColor(backgroundColor) {
41109
41102
  this.backgroundColor = backgroundColor;
41110
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
41111
41103
  }
41112
41104
  setBackgroundColor(backgroundColor) {
41113
41105
  this.emit({
@@ -41155,6 +41147,8 @@ class Frame2 extends BaseItem {
41155
41147
  if (this.transformationRenderBlock) {
41156
41148
  return;
41157
41149
  }
41150
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
41151
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
41158
41152
  this.path.render(context);
41159
41153
  this.renderNewShape(context);
41160
41154
  if (this.getLinkTo()) {
package/dist/cjs/node.js CHANGED
@@ -10602,7 +10602,7 @@ function fillHighlight(ctx, textBlock) {
10602
10602
  return;
10603
10603
  }
10604
10604
  const measure = textBlock.measure;
10605
- ctx.fillStyle = textBlock.style.backgroundColor;
10605
+ ctx.fillStyle = resolveColor(textBlock.style.backgroundColor, conf.theme, "background");
10606
10606
  ctx.fillRect(textBlock.x, textBlock.y - measure.ascent, measure.width, measure.height);
10607
10607
  }
10608
10608
  function underline(ctx, textBlock) {
@@ -10614,14 +10614,13 @@ function underline(ctx, textBlock) {
10614
10614
  const style = textBlock.style;
10615
10615
  const measure = textBlock.measure;
10616
10616
  const width = measure.width - (textBlock.marginLeft || 0);
10617
- const color = style.color;
10618
- ctx.strokeStyle = color;
10617
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
10619
10618
  ctx.lineWidth = textBlock.fontSize / 14;
10620
10619
  ctx.beginPath();
10621
10620
  ctx.moveTo(x, y + 2 * textBlock.fontSize / 14);
10622
10621
  ctx.lineTo(x + width, y + 2 * textBlock.fontSize / 14);
10623
10622
  ctx.stroke();
10624
- ctx.strokeStyle = style.backgroundColor ?? "black";
10623
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
10625
10624
  ctx.lineWidth = 2;
10626
10625
  }
10627
10626
  function cross(ctx, textBlock) {
@@ -10634,19 +10633,18 @@ function cross(ctx, textBlock) {
10634
10633
  const measure = textBlock.measure;
10635
10634
  const width = measure.width;
10636
10635
  const height = measure.height;
10637
- const color = style.color;
10638
- ctx.strokeStyle = color;
10636
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
10639
10637
  ctx.lineWidth = textBlock.fontSize / 14;
10640
10638
  ctx.beginPath();
10641
10639
  ctx.moveTo(x, y - height / 4);
10642
10640
  ctx.lineTo(x + width, y - height / 4);
10643
10641
  ctx.stroke();
10644
- ctx.strokeStyle = style.backgroundColor ?? "black";
10642
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
10645
10643
  ctx.lineWidth = 2;
10646
10644
  }
10647
10645
  function fillText(ctx, textBlock) {
10648
10646
  const { text, style, x, y } = textBlock;
10649
- ctx.fillStyle = style.color;
10647
+ ctx.fillStyle = resolveColor(style.color, conf.theme, "foreground");
10650
10648
  ctx.fillText(text, x, y);
10651
10649
  if (textBlock.listMark) {
10652
10650
  ctx.fillText(textBlock.listMark, x - measureText(textBlock.listMark, style).width - 4, y);
@@ -19436,7 +19434,7 @@ function setSelectionFontHighlight(editor, format, selectionContext) {
19436
19434
  }
19437
19435
  if (format === "none") {
19438
19436
  import_slate24.Editor.removeMark(editor, "fontHighlight");
19439
- } else if (marks.fontHighlight === format) {
19437
+ } else if (typeof format === "string" && marks.fontHighlight === format) {
19440
19438
  import_slate24.Editor.removeMark(editor, "fontHighlight");
19441
19439
  } else {
19442
19440
  import_slate24.Editor.addMark(editor, "fontHighlight", format);
@@ -25123,8 +25121,8 @@ class RichText extends BaseItem {
25123
25121
  node2.underline ? "underline" : "",
25124
25122
  node2["line-through"] ? "line-through" : ""
25125
25123
  ].filter(Boolean).join(" "),
25126
- color: node2.fontColor || conf.DEFAULT_TEXT_STYLES.fontColor,
25127
- backgroundColor: node2.fontHighlight || conf.DEFAULT_TEXT_STYLES.fontHighlight,
25124
+ color: node2.fontColor ? resolveColor(node2.fontColor, conf.theme, "foreground") : conf.DEFAULT_TEXT_STYLES.fontColor,
25125
+ backgroundColor: node2.fontHighlight ? resolveColor(node2.fontHighlight, conf.theme, "background") : conf.DEFAULT_TEXT_STYLES.fontHighlight,
25128
25126
  fontSize: node2.fontSize ? `${node2.fontSize}px` : `${conf.DEFAULT_TEXT_STYLES.fontSize}px`,
25129
25127
  fontFamily: node2.fontFamily || conf.DEFAULT_TEXT_STYLES.fontFamily
25130
25128
  });
@@ -40290,6 +40288,12 @@ class Connector2 extends BaseItem {
40290
40288
  mbr.strokeWidth = 3;
40291
40289
  mbr.borderStyle = "solid";
40292
40290
  this.clipText(context);
40291
+ const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
40292
+ this.lines.setBorderColor(resolvedLineColor);
40293
+ this.startPointer.path.setBorderColor(resolvedLineColor);
40294
+ this.startPointer.path.setBackgroundColor(resolvedLineColor);
40295
+ this.endPointer.path.setBorderColor(resolvedLineColor);
40296
+ this.endPointer.path.setBackgroundColor(resolvedLineColor);
40293
40297
  if (!this.text.isRenderEnabled && this.board.selection.getContext() !== "EditTextUnderPointer") {
40294
40298
  this.lines.render(context);
40295
40299
  }
@@ -40571,17 +40575,11 @@ class Connector2 extends BaseItem {
40571
40575
  const endPoint = this.endPoint;
40572
40576
  this.lines = getLine(this.lineStyle, startPoint, endPoint, this.middlePoint).addConnectedItemType(this.itemType);
40573
40577
  this.startPointer = getStartPointer(startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
40574
- const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
40575
- this.startPointer.path.setBorderColor(resolvedLineColor);
40576
40578
  this.startPointer.path.setBorderWidth(this.lineWidth);
40577
- this.startPointer.path.setBackgroundColor(resolvedLineColor);
40578
40579
  this.endPointer = getEndPointer(endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
40579
- this.endPointer.path.setBorderColor(resolvedLineColor);
40580
40580
  this.endPointer.path.setBorderWidth(this.lineWidth);
40581
- this.endPointer.path.setBackgroundColor(resolvedLineColor);
40582
40581
  this.offsetLines();
40583
40582
  this.lines.setBorderWidth(this.lineWidth);
40584
- this.lines.setBorderColor(resolvedLineColor);
40585
40583
  this.lines.setBorderStyle(this.borderStyle);
40586
40584
  this.updateTitle();
40587
40585
  }
@@ -42361,7 +42359,6 @@ class Shape extends BaseItem {
42361
42359
  }
42362
42360
  applyBackgroundColor(backgroundColor) {
42363
42361
  this.backgroundColor = backgroundColor;
42364
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
42365
42362
  }
42366
42363
  setBackgroundColor(backgroundColor) {
42367
42364
  this.emit({
@@ -42397,7 +42394,6 @@ class Shape extends BaseItem {
42397
42394
  }
42398
42395
  applyBorderColor(borderColor) {
42399
42396
  this.borderColor = borderColor;
42400
- this.path.setBorderColor(resolveColor(borderColor, conf.theme, "foreground"));
42401
42397
  }
42402
42398
  setBorderColor(borderColor) {
42403
42399
  this.emit({
@@ -42505,6 +42501,8 @@ class Shape extends BaseItem {
42505
42501
  if (this.transformationRenderBlock) {
42506
42502
  return;
42507
42503
  }
42504
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
42505
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
42508
42506
  this.path.render(context);
42509
42507
  this.text.render(context);
42510
42508
  if (this.getLinkTo()) {
@@ -42605,9 +42603,7 @@ class Shape extends BaseItem {
42605
42603
  this.text.setContainer(this.textContainer.copy());
42606
42604
  this.textContainer.transform(this.transformation.toMatrix());
42607
42605
  this.path.transform(this.transformation.toMatrix());
42608
- this.path.setBackgroundColor(this.backgroundColor);
42609
42606
  this.path.setBackgroundOpacity(this.backgroundOpacity);
42610
- this.path.setBorderColor(this.borderColor);
42611
42607
  this.path.setBorderWidth(this.borderWidth);
42612
42608
  this.path.setBorderStyle(this.borderStyle);
42613
42609
  this.path.setBorderOpacity(this.borderOpacity);
@@ -42794,7 +42790,6 @@ class Sticker extends BaseItem {
42794
42790
  this.stickerPath.transform(this.transformation.toMatrix());
42795
42791
  this.text.setContainer(this.textContainer.copy());
42796
42792
  this.textContainer.transform(this.transformation.toMatrix());
42797
- this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
42798
42793
  this.saveStickerData();
42799
42794
  }
42800
42795
  setId(id) {
@@ -42838,7 +42833,6 @@ class Sticker extends BaseItem {
42838
42833
  }
42839
42834
  applyBackgroundColor(backgroundColor) {
42840
42835
  this.backgroundColor = backgroundColor;
42841
- this.stickerPath.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
42842
42836
  }
42843
42837
  setBackgroundColor(backgroundColor) {
42844
42838
  this.emit({
@@ -42885,6 +42879,7 @@ class Sticker extends BaseItem {
42885
42879
  return;
42886
42880
  }
42887
42881
  this.renderShadow(context);
42882
+ this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
42888
42883
  this.stickerPath.render(context);
42889
42884
  this.text.render(context);
42890
42885
  if (this.getLinkTo()) {
@@ -43427,9 +43422,7 @@ class Frame2 extends BaseItem {
43427
43422
  this.path.transform(this.transformation.toMatrix());
43428
43423
  this.textContainer.transform(this.transformation.toMatrix());
43429
43424
  }
43430
- this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
43431
43425
  this.path.setBackgroundOpacity(this.backgroundOpacity);
43432
- this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
43433
43426
  this.path.setBorderWidth(this.borderWidth);
43434
43427
  this.path.setBorderStyle(this.borderStyle);
43435
43428
  this.path.setBorderOpacity(this.borderOpacity);
@@ -43580,7 +43573,6 @@ class Frame2 extends BaseItem {
43580
43573
  }
43581
43574
  applyBackgroundColor(backgroundColor) {
43582
43575
  this.backgroundColor = backgroundColor;
43583
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
43584
43576
  }
43585
43577
  setBackgroundColor(backgroundColor) {
43586
43578
  this.emit({
@@ -43628,6 +43620,8 @@ class Frame2 extends BaseItem {
43628
43620
  if (this.transformationRenderBlock) {
43629
43621
  return;
43630
43622
  }
43623
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
43624
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
43631
43625
  this.path.render(context);
43632
43626
  this.renderNewShape(context);
43633
43627
  if (this.getLinkTo()) {
@@ -9391,7 +9391,7 @@ function fillHighlight(ctx, textBlock) {
9391
9391
  return;
9392
9392
  }
9393
9393
  const measure = textBlock.measure;
9394
- ctx.fillStyle = textBlock.style.backgroundColor;
9394
+ ctx.fillStyle = resolveColor(textBlock.style.backgroundColor, conf.theme, "background");
9395
9395
  ctx.fillRect(textBlock.x, textBlock.y - measure.ascent, measure.width, measure.height);
9396
9396
  }
9397
9397
  function underline(ctx, textBlock) {
@@ -9403,14 +9403,13 @@ function underline(ctx, textBlock) {
9403
9403
  const style = textBlock.style;
9404
9404
  const measure = textBlock.measure;
9405
9405
  const width = measure.width - (textBlock.marginLeft || 0);
9406
- const color = style.color;
9407
- ctx.strokeStyle = color;
9406
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
9408
9407
  ctx.lineWidth = textBlock.fontSize / 14;
9409
9408
  ctx.beginPath();
9410
9409
  ctx.moveTo(x, y + 2 * textBlock.fontSize / 14);
9411
9410
  ctx.lineTo(x + width, y + 2 * textBlock.fontSize / 14);
9412
9411
  ctx.stroke();
9413
- ctx.strokeStyle = style.backgroundColor ?? "black";
9412
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
9414
9413
  ctx.lineWidth = 2;
9415
9414
  }
9416
9415
  function cross(ctx, textBlock) {
@@ -9423,19 +9422,18 @@ function cross(ctx, textBlock) {
9423
9422
  const measure = textBlock.measure;
9424
9423
  const width = measure.width;
9425
9424
  const height = measure.height;
9426
- const color = style.color;
9427
- ctx.strokeStyle = color;
9425
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
9428
9426
  ctx.lineWidth = textBlock.fontSize / 14;
9429
9427
  ctx.beginPath();
9430
9428
  ctx.moveTo(x, y - height / 4);
9431
9429
  ctx.lineTo(x + width, y - height / 4);
9432
9430
  ctx.stroke();
9433
- ctx.strokeStyle = style.backgroundColor ?? "black";
9431
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
9434
9432
  ctx.lineWidth = 2;
9435
9433
  }
9436
9434
  function fillText(ctx, textBlock) {
9437
9435
  const { text, style, x, y } = textBlock;
9438
- ctx.fillStyle = style.color;
9436
+ ctx.fillStyle = resolveColor(style.color, conf.theme, "foreground");
9439
9437
  ctx.fillText(text, x, y);
9440
9438
  if (textBlock.listMark) {
9441
9439
  ctx.fillText(textBlock.listMark, x - measureText(textBlock.listMark, style).width - 4, y);
@@ -16726,7 +16724,7 @@ function setSelectionFontHighlight(editor, format, selectionContext) {
16726
16724
  }
16727
16725
  if (format === "none") {
16728
16726
  Editor22.removeMark(editor, "fontHighlight");
16729
- } else if (marks.fontHighlight === format) {
16727
+ } else if (typeof format === "string" && marks.fontHighlight === format) {
16730
16728
  Editor22.removeMark(editor, "fontHighlight");
16731
16729
  } else {
16732
16730
  Editor22.addMark(editor, "fontHighlight", format);
@@ -22481,8 +22479,8 @@ class RichText extends BaseItem {
22481
22479
  node2.underline ? "underline" : "",
22482
22480
  node2["line-through"] ? "line-through" : ""
22483
22481
  ].filter(Boolean).join(" "),
22484
- color: node2.fontColor || conf.DEFAULT_TEXT_STYLES.fontColor,
22485
- backgroundColor: node2.fontHighlight || conf.DEFAULT_TEXT_STYLES.fontHighlight,
22482
+ color: node2.fontColor ? resolveColor(node2.fontColor, conf.theme, "foreground") : conf.DEFAULT_TEXT_STYLES.fontColor,
22483
+ backgroundColor: node2.fontHighlight ? resolveColor(node2.fontHighlight, conf.theme, "background") : conf.DEFAULT_TEXT_STYLES.fontHighlight,
22486
22484
  fontSize: node2.fontSize ? `${node2.fontSize}px` : `${conf.DEFAULT_TEXT_STYLES.fontSize}px`,
22487
22485
  fontFamily: node2.fontFamily || conf.DEFAULT_TEXT_STYLES.fontFamily
22488
22486
  });
@@ -37647,6 +37645,12 @@ class Connector2 extends BaseItem {
37647
37645
  mbr.strokeWidth = 3;
37648
37646
  mbr.borderStyle = "solid";
37649
37647
  this.clipText(context);
37648
+ const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
37649
+ this.lines.setBorderColor(resolvedLineColor);
37650
+ this.startPointer.path.setBorderColor(resolvedLineColor);
37651
+ this.startPointer.path.setBackgroundColor(resolvedLineColor);
37652
+ this.endPointer.path.setBorderColor(resolvedLineColor);
37653
+ this.endPointer.path.setBackgroundColor(resolvedLineColor);
37650
37654
  if (!this.text.isRenderEnabled && this.board.selection.getContext() !== "EditTextUnderPointer") {
37651
37655
  this.lines.render(context);
37652
37656
  }
@@ -37928,17 +37932,11 @@ class Connector2 extends BaseItem {
37928
37932
  const endPoint = this.endPoint;
37929
37933
  this.lines = getLine(this.lineStyle, startPoint, endPoint, this.middlePoint).addConnectedItemType(this.itemType);
37930
37934
  this.startPointer = getStartPointer(startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
37931
- const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
37932
- this.startPointer.path.setBorderColor(resolvedLineColor);
37933
37935
  this.startPointer.path.setBorderWidth(this.lineWidth);
37934
- this.startPointer.path.setBackgroundColor(resolvedLineColor);
37935
37936
  this.endPointer = getEndPointer(endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
37936
- this.endPointer.path.setBorderColor(resolvedLineColor);
37937
37937
  this.endPointer.path.setBorderWidth(this.lineWidth);
37938
- this.endPointer.path.setBackgroundColor(resolvedLineColor);
37939
37938
  this.offsetLines();
37940
37939
  this.lines.setBorderWidth(this.lineWidth);
37941
- this.lines.setBorderColor(resolvedLineColor);
37942
37940
  this.lines.setBorderStyle(this.borderStyle);
37943
37941
  this.updateTitle();
37944
37942
  }
@@ -39718,7 +39716,6 @@ class Shape extends BaseItem {
39718
39716
  }
39719
39717
  applyBackgroundColor(backgroundColor) {
39720
39718
  this.backgroundColor = backgroundColor;
39721
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
39722
39719
  }
39723
39720
  setBackgroundColor(backgroundColor) {
39724
39721
  this.emit({
@@ -39754,7 +39751,6 @@ class Shape extends BaseItem {
39754
39751
  }
39755
39752
  applyBorderColor(borderColor) {
39756
39753
  this.borderColor = borderColor;
39757
- this.path.setBorderColor(resolveColor(borderColor, conf.theme, "foreground"));
39758
39754
  }
39759
39755
  setBorderColor(borderColor) {
39760
39756
  this.emit({
@@ -39862,6 +39858,8 @@ class Shape extends BaseItem {
39862
39858
  if (this.transformationRenderBlock) {
39863
39859
  return;
39864
39860
  }
39861
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
39862
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
39865
39863
  this.path.render(context);
39866
39864
  this.text.render(context);
39867
39865
  if (this.getLinkTo()) {
@@ -39962,9 +39960,7 @@ class Shape extends BaseItem {
39962
39960
  this.text.setContainer(this.textContainer.copy());
39963
39961
  this.textContainer.transform(this.transformation.toMatrix());
39964
39962
  this.path.transform(this.transformation.toMatrix());
39965
- this.path.setBackgroundColor(this.backgroundColor);
39966
39963
  this.path.setBackgroundOpacity(this.backgroundOpacity);
39967
- this.path.setBorderColor(this.borderColor);
39968
39964
  this.path.setBorderWidth(this.borderWidth);
39969
39965
  this.path.setBorderStyle(this.borderStyle);
39970
39966
  this.path.setBorderOpacity(this.borderOpacity);
@@ -40151,7 +40147,6 @@ class Sticker extends BaseItem {
40151
40147
  this.stickerPath.transform(this.transformation.toMatrix());
40152
40148
  this.text.setContainer(this.textContainer.copy());
40153
40149
  this.textContainer.transform(this.transformation.toMatrix());
40154
- this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40155
40150
  this.saveStickerData();
40156
40151
  }
40157
40152
  setId(id) {
@@ -40195,7 +40190,6 @@ class Sticker extends BaseItem {
40195
40190
  }
40196
40191
  applyBackgroundColor(backgroundColor) {
40197
40192
  this.backgroundColor = backgroundColor;
40198
- this.stickerPath.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
40199
40193
  }
40200
40194
  setBackgroundColor(backgroundColor) {
40201
40195
  this.emit({
@@ -40242,6 +40236,7 @@ class Sticker extends BaseItem {
40242
40236
  return;
40243
40237
  }
40244
40238
  this.renderShadow(context);
40239
+ this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40245
40240
  this.stickerPath.render(context);
40246
40241
  this.text.render(context);
40247
40242
  if (this.getLinkTo()) {
@@ -40784,9 +40779,7 @@ class Frame2 extends BaseItem {
40784
40779
  this.path.transform(this.transformation.toMatrix());
40785
40780
  this.textContainer.transform(this.transformation.toMatrix());
40786
40781
  }
40787
- this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40788
40782
  this.path.setBackgroundOpacity(this.backgroundOpacity);
40789
- this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
40790
40783
  this.path.setBorderWidth(this.borderWidth);
40791
40784
  this.path.setBorderStyle(this.borderStyle);
40792
40785
  this.path.setBorderOpacity(this.borderOpacity);
@@ -40937,7 +40930,6 @@ class Frame2 extends BaseItem {
40937
40930
  }
40938
40931
  applyBackgroundColor(backgroundColor) {
40939
40932
  this.backgroundColor = backgroundColor;
40940
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
40941
40933
  }
40942
40934
  setBackgroundColor(backgroundColor) {
40943
40935
  this.emit({
@@ -40985,6 +40977,8 @@ class Frame2 extends BaseItem {
40985
40977
  if (this.transformationRenderBlock) {
40986
40978
  return;
40987
40979
  }
40980
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40981
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
40988
40982
  this.path.render(context);
40989
40983
  this.renderNewShape(context);
40990
40984
  if (this.getLinkTo()) {
package/dist/esm/index.js CHANGED
@@ -9384,7 +9384,7 @@ function fillHighlight(ctx, textBlock) {
9384
9384
  return;
9385
9385
  }
9386
9386
  const measure = textBlock.measure;
9387
- ctx.fillStyle = textBlock.style.backgroundColor;
9387
+ ctx.fillStyle = resolveColor(textBlock.style.backgroundColor, conf.theme, "background");
9388
9388
  ctx.fillRect(textBlock.x, textBlock.y - measure.ascent, measure.width, measure.height);
9389
9389
  }
9390
9390
  function underline(ctx, textBlock) {
@@ -9396,14 +9396,13 @@ function underline(ctx, textBlock) {
9396
9396
  const style = textBlock.style;
9397
9397
  const measure = textBlock.measure;
9398
9398
  const width = measure.width - (textBlock.marginLeft || 0);
9399
- const color = style.color;
9400
- ctx.strokeStyle = color;
9399
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
9401
9400
  ctx.lineWidth = textBlock.fontSize / 14;
9402
9401
  ctx.beginPath();
9403
9402
  ctx.moveTo(x, y + 2 * textBlock.fontSize / 14);
9404
9403
  ctx.lineTo(x + width, y + 2 * textBlock.fontSize / 14);
9405
9404
  ctx.stroke();
9406
- ctx.strokeStyle = style.backgroundColor ?? "black";
9405
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
9407
9406
  ctx.lineWidth = 2;
9408
9407
  }
9409
9408
  function cross(ctx, textBlock) {
@@ -9416,19 +9415,18 @@ function cross(ctx, textBlock) {
9416
9415
  const measure = textBlock.measure;
9417
9416
  const width = measure.width;
9418
9417
  const height = measure.height;
9419
- const color = style.color;
9420
- ctx.strokeStyle = color;
9418
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
9421
9419
  ctx.lineWidth = textBlock.fontSize / 14;
9422
9420
  ctx.beginPath();
9423
9421
  ctx.moveTo(x, y - height / 4);
9424
9422
  ctx.lineTo(x + width, y - height / 4);
9425
9423
  ctx.stroke();
9426
- ctx.strokeStyle = style.backgroundColor ?? "black";
9424
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
9427
9425
  ctx.lineWidth = 2;
9428
9426
  }
9429
9427
  function fillText(ctx, textBlock) {
9430
9428
  const { text, style, x, y } = textBlock;
9431
- ctx.fillStyle = style.color;
9429
+ ctx.fillStyle = resolveColor(style.color, conf.theme, "foreground");
9432
9430
  ctx.fillText(text, x, y);
9433
9431
  if (textBlock.listMark) {
9434
9432
  ctx.fillText(textBlock.listMark, x - measureText(textBlock.listMark, style).width - 4, y);
@@ -16719,7 +16717,7 @@ function setSelectionFontHighlight(editor, format, selectionContext) {
16719
16717
  }
16720
16718
  if (format === "none") {
16721
16719
  Editor22.removeMark(editor, "fontHighlight");
16722
- } else if (marks.fontHighlight === format) {
16720
+ } else if (typeof format === "string" && marks.fontHighlight === format) {
16723
16721
  Editor22.removeMark(editor, "fontHighlight");
16724
16722
  } else {
16725
16723
  Editor22.addMark(editor, "fontHighlight", format);
@@ -22474,8 +22472,8 @@ class RichText extends BaseItem {
22474
22472
  node2.underline ? "underline" : "",
22475
22473
  node2["line-through"] ? "line-through" : ""
22476
22474
  ].filter(Boolean).join(" "),
22477
- color: node2.fontColor || conf.DEFAULT_TEXT_STYLES.fontColor,
22478
- backgroundColor: node2.fontHighlight || conf.DEFAULT_TEXT_STYLES.fontHighlight,
22475
+ color: node2.fontColor ? resolveColor(node2.fontColor, conf.theme, "foreground") : conf.DEFAULT_TEXT_STYLES.fontColor,
22476
+ backgroundColor: node2.fontHighlight ? resolveColor(node2.fontHighlight, conf.theme, "background") : conf.DEFAULT_TEXT_STYLES.fontHighlight,
22479
22477
  fontSize: node2.fontSize ? `${node2.fontSize}px` : `${conf.DEFAULT_TEXT_STYLES.fontSize}px`,
22480
22478
  fontFamily: node2.fontFamily || conf.DEFAULT_TEXT_STYLES.fontFamily
22481
22479
  });
@@ -37640,6 +37638,12 @@ class Connector2 extends BaseItem {
37640
37638
  mbr.strokeWidth = 3;
37641
37639
  mbr.borderStyle = "solid";
37642
37640
  this.clipText(context);
37641
+ const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
37642
+ this.lines.setBorderColor(resolvedLineColor);
37643
+ this.startPointer.path.setBorderColor(resolvedLineColor);
37644
+ this.startPointer.path.setBackgroundColor(resolvedLineColor);
37645
+ this.endPointer.path.setBorderColor(resolvedLineColor);
37646
+ this.endPointer.path.setBackgroundColor(resolvedLineColor);
37643
37647
  if (!this.text.isRenderEnabled && this.board.selection.getContext() !== "EditTextUnderPointer") {
37644
37648
  this.lines.render(context);
37645
37649
  }
@@ -37921,17 +37925,11 @@ class Connector2 extends BaseItem {
37921
37925
  const endPoint = this.endPoint;
37922
37926
  this.lines = getLine(this.lineStyle, startPoint, endPoint, this.middlePoint).addConnectedItemType(this.itemType);
37923
37927
  this.startPointer = getStartPointer(startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
37924
- const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
37925
- this.startPointer.path.setBorderColor(resolvedLineColor);
37926
37928
  this.startPointer.path.setBorderWidth(this.lineWidth);
37927
- this.startPointer.path.setBackgroundColor(resolvedLineColor);
37928
37929
  this.endPointer = getEndPointer(endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
37929
- this.endPointer.path.setBorderColor(resolvedLineColor);
37930
37930
  this.endPointer.path.setBorderWidth(this.lineWidth);
37931
- this.endPointer.path.setBackgroundColor(resolvedLineColor);
37932
37931
  this.offsetLines();
37933
37932
  this.lines.setBorderWidth(this.lineWidth);
37934
- this.lines.setBorderColor(resolvedLineColor);
37935
37933
  this.lines.setBorderStyle(this.borderStyle);
37936
37934
  this.updateTitle();
37937
37935
  }
@@ -39711,7 +39709,6 @@ class Shape extends BaseItem {
39711
39709
  }
39712
39710
  applyBackgroundColor(backgroundColor) {
39713
39711
  this.backgroundColor = backgroundColor;
39714
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
39715
39712
  }
39716
39713
  setBackgroundColor(backgroundColor) {
39717
39714
  this.emit({
@@ -39747,7 +39744,6 @@ class Shape extends BaseItem {
39747
39744
  }
39748
39745
  applyBorderColor(borderColor) {
39749
39746
  this.borderColor = borderColor;
39750
- this.path.setBorderColor(resolveColor(borderColor, conf.theme, "foreground"));
39751
39747
  }
39752
39748
  setBorderColor(borderColor) {
39753
39749
  this.emit({
@@ -39855,6 +39851,8 @@ class Shape extends BaseItem {
39855
39851
  if (this.transformationRenderBlock) {
39856
39852
  return;
39857
39853
  }
39854
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
39855
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
39858
39856
  this.path.render(context);
39859
39857
  this.text.render(context);
39860
39858
  if (this.getLinkTo()) {
@@ -39955,9 +39953,7 @@ class Shape extends BaseItem {
39955
39953
  this.text.setContainer(this.textContainer.copy());
39956
39954
  this.textContainer.transform(this.transformation.toMatrix());
39957
39955
  this.path.transform(this.transformation.toMatrix());
39958
- this.path.setBackgroundColor(this.backgroundColor);
39959
39956
  this.path.setBackgroundOpacity(this.backgroundOpacity);
39960
- this.path.setBorderColor(this.borderColor);
39961
39957
  this.path.setBorderWidth(this.borderWidth);
39962
39958
  this.path.setBorderStyle(this.borderStyle);
39963
39959
  this.path.setBorderOpacity(this.borderOpacity);
@@ -40144,7 +40140,6 @@ class Sticker extends BaseItem {
40144
40140
  this.stickerPath.transform(this.transformation.toMatrix());
40145
40141
  this.text.setContainer(this.textContainer.copy());
40146
40142
  this.textContainer.transform(this.transformation.toMatrix());
40147
- this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40148
40143
  this.saveStickerData();
40149
40144
  }
40150
40145
  setId(id) {
@@ -40188,7 +40183,6 @@ class Sticker extends BaseItem {
40188
40183
  }
40189
40184
  applyBackgroundColor(backgroundColor) {
40190
40185
  this.backgroundColor = backgroundColor;
40191
- this.stickerPath.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
40192
40186
  }
40193
40187
  setBackgroundColor(backgroundColor) {
40194
40188
  this.emit({
@@ -40235,6 +40229,7 @@ class Sticker extends BaseItem {
40235
40229
  return;
40236
40230
  }
40237
40231
  this.renderShadow(context);
40232
+ this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40238
40233
  this.stickerPath.render(context);
40239
40234
  this.text.render(context);
40240
40235
  if (this.getLinkTo()) {
@@ -40777,9 +40772,7 @@ class Frame2 extends BaseItem {
40777
40772
  this.path.transform(this.transformation.toMatrix());
40778
40773
  this.textContainer.transform(this.transformation.toMatrix());
40779
40774
  }
40780
- this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40781
40775
  this.path.setBackgroundOpacity(this.backgroundOpacity);
40782
- this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
40783
40776
  this.path.setBorderWidth(this.borderWidth);
40784
40777
  this.path.setBorderStyle(this.borderStyle);
40785
40778
  this.path.setBorderOpacity(this.borderOpacity);
@@ -40930,7 +40923,6 @@ class Frame2 extends BaseItem {
40930
40923
  }
40931
40924
  applyBackgroundColor(backgroundColor) {
40932
40925
  this.backgroundColor = backgroundColor;
40933
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
40934
40926
  }
40935
40927
  setBackgroundColor(backgroundColor) {
40936
40928
  this.emit({
@@ -40978,6 +40970,8 @@ class Frame2 extends BaseItem {
40978
40970
  if (this.transformationRenderBlock) {
40979
40971
  return;
40980
40972
  }
40973
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
40974
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
40981
40975
  this.path.render(context);
40982
40976
  this.renderNewShape(context);
40983
40977
  if (this.getLinkTo()) {
package/dist/esm/node.js CHANGED
@@ -10168,7 +10168,7 @@ function fillHighlight(ctx, textBlock) {
10168
10168
  return;
10169
10169
  }
10170
10170
  const measure = textBlock.measure;
10171
- ctx.fillStyle = textBlock.style.backgroundColor;
10171
+ ctx.fillStyle = resolveColor(textBlock.style.backgroundColor, conf.theme, "background");
10172
10172
  ctx.fillRect(textBlock.x, textBlock.y - measure.ascent, measure.width, measure.height);
10173
10173
  }
10174
10174
  function underline(ctx, textBlock) {
@@ -10180,14 +10180,13 @@ function underline(ctx, textBlock) {
10180
10180
  const style = textBlock.style;
10181
10181
  const measure = textBlock.measure;
10182
10182
  const width = measure.width - (textBlock.marginLeft || 0);
10183
- const color = style.color;
10184
- ctx.strokeStyle = color;
10183
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
10185
10184
  ctx.lineWidth = textBlock.fontSize / 14;
10186
10185
  ctx.beginPath();
10187
10186
  ctx.moveTo(x, y + 2 * textBlock.fontSize / 14);
10188
10187
  ctx.lineTo(x + width, y + 2 * textBlock.fontSize / 14);
10189
10188
  ctx.stroke();
10190
- ctx.strokeStyle = style.backgroundColor ?? "black";
10189
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
10191
10190
  ctx.lineWidth = 2;
10192
10191
  }
10193
10192
  function cross(ctx, textBlock) {
@@ -10200,19 +10199,18 @@ function cross(ctx, textBlock) {
10200
10199
  const measure = textBlock.measure;
10201
10200
  const width = measure.width;
10202
10201
  const height = measure.height;
10203
- const color = style.color;
10204
- ctx.strokeStyle = color;
10202
+ ctx.strokeStyle = resolveColor(style.color, conf.theme, "foreground");
10205
10203
  ctx.lineWidth = textBlock.fontSize / 14;
10206
10204
  ctx.beginPath();
10207
10205
  ctx.moveTo(x, y - height / 4);
10208
10206
  ctx.lineTo(x + width, y - height / 4);
10209
10207
  ctx.stroke();
10210
- ctx.strokeStyle = style.backgroundColor ?? "black";
10208
+ ctx.strokeStyle = style.backgroundColor ? resolveColor(style.backgroundColor, conf.theme, "background") : "black";
10211
10209
  ctx.lineWidth = 2;
10212
10210
  }
10213
10211
  function fillText(ctx, textBlock) {
10214
10212
  const { text, style, x, y } = textBlock;
10215
- ctx.fillStyle = style.color;
10213
+ ctx.fillStyle = resolveColor(style.color, conf.theme, "foreground");
10216
10214
  ctx.fillText(text, x, y);
10217
10215
  if (textBlock.listMark) {
10218
10216
  ctx.fillText(textBlock.listMark, x - measureText(textBlock.listMark, style).width - 4, y);
@@ -19254,7 +19252,7 @@ function setSelectionFontHighlight(editor, format, selectionContext) {
19254
19252
  }
19255
19253
  if (format === "none") {
19256
19254
  Editor21.removeMark(editor, "fontHighlight");
19257
- } else if (marks.fontHighlight === format) {
19255
+ } else if (typeof format === "string" && marks.fontHighlight === format) {
19258
19256
  Editor21.removeMark(editor, "fontHighlight");
19259
19257
  } else {
19260
19258
  Editor21.addMark(editor, "fontHighlight", format);
@@ -24941,8 +24939,8 @@ class RichText extends BaseItem {
24941
24939
  node2.underline ? "underline" : "",
24942
24940
  node2["line-through"] ? "line-through" : ""
24943
24941
  ].filter(Boolean).join(" "),
24944
- color: node2.fontColor || conf.DEFAULT_TEXT_STYLES.fontColor,
24945
- backgroundColor: node2.fontHighlight || conf.DEFAULT_TEXT_STYLES.fontHighlight,
24942
+ color: node2.fontColor ? resolveColor(node2.fontColor, conf.theme, "foreground") : conf.DEFAULT_TEXT_STYLES.fontColor,
24943
+ backgroundColor: node2.fontHighlight ? resolveColor(node2.fontHighlight, conf.theme, "background") : conf.DEFAULT_TEXT_STYLES.fontHighlight,
24946
24944
  fontSize: node2.fontSize ? `${node2.fontSize}px` : `${conf.DEFAULT_TEXT_STYLES.fontSize}px`,
24947
24945
  fontFamily: node2.fontFamily || conf.DEFAULT_TEXT_STYLES.fontFamily
24948
24946
  });
@@ -40108,6 +40106,12 @@ class Connector2 extends BaseItem {
40108
40106
  mbr.strokeWidth = 3;
40109
40107
  mbr.borderStyle = "solid";
40110
40108
  this.clipText(context);
40109
+ const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
40110
+ this.lines.setBorderColor(resolvedLineColor);
40111
+ this.startPointer.path.setBorderColor(resolvedLineColor);
40112
+ this.startPointer.path.setBackgroundColor(resolvedLineColor);
40113
+ this.endPointer.path.setBorderColor(resolvedLineColor);
40114
+ this.endPointer.path.setBackgroundColor(resolvedLineColor);
40111
40115
  if (!this.text.isRenderEnabled && this.board.selection.getContext() !== "EditTextUnderPointer") {
40112
40116
  this.lines.render(context);
40113
40117
  }
@@ -40389,17 +40393,11 @@ class Connector2 extends BaseItem {
40389
40393
  const endPoint = this.endPoint;
40390
40394
  this.lines = getLine(this.lineStyle, startPoint, endPoint, this.middlePoint).addConnectedItemType(this.itemType);
40391
40395
  this.startPointer = getStartPointer(startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
40392
- const resolvedLineColor = resolveColor(this.lineColor, conf.theme, "foreground");
40393
- this.startPointer.path.setBorderColor(resolvedLineColor);
40394
40396
  this.startPointer.path.setBorderWidth(this.lineWidth);
40395
- this.startPointer.path.setBackgroundColor(resolvedLineColor);
40396
40397
  this.endPointer = getEndPointer(endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.2);
40397
- this.endPointer.path.setBorderColor(resolvedLineColor);
40398
40398
  this.endPointer.path.setBorderWidth(this.lineWidth);
40399
- this.endPointer.path.setBackgroundColor(resolvedLineColor);
40400
40399
  this.offsetLines();
40401
40400
  this.lines.setBorderWidth(this.lineWidth);
40402
- this.lines.setBorderColor(resolvedLineColor);
40403
40401
  this.lines.setBorderStyle(this.borderStyle);
40404
40402
  this.updateTitle();
40405
40403
  }
@@ -42179,7 +42177,6 @@ class Shape extends BaseItem {
42179
42177
  }
42180
42178
  applyBackgroundColor(backgroundColor) {
42181
42179
  this.backgroundColor = backgroundColor;
42182
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
42183
42180
  }
42184
42181
  setBackgroundColor(backgroundColor) {
42185
42182
  this.emit({
@@ -42215,7 +42212,6 @@ class Shape extends BaseItem {
42215
42212
  }
42216
42213
  applyBorderColor(borderColor) {
42217
42214
  this.borderColor = borderColor;
42218
- this.path.setBorderColor(resolveColor(borderColor, conf.theme, "foreground"));
42219
42215
  }
42220
42216
  setBorderColor(borderColor) {
42221
42217
  this.emit({
@@ -42323,6 +42319,8 @@ class Shape extends BaseItem {
42323
42319
  if (this.transformationRenderBlock) {
42324
42320
  return;
42325
42321
  }
42322
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
42323
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
42326
42324
  this.path.render(context);
42327
42325
  this.text.render(context);
42328
42326
  if (this.getLinkTo()) {
@@ -42423,9 +42421,7 @@ class Shape extends BaseItem {
42423
42421
  this.text.setContainer(this.textContainer.copy());
42424
42422
  this.textContainer.transform(this.transformation.toMatrix());
42425
42423
  this.path.transform(this.transformation.toMatrix());
42426
- this.path.setBackgroundColor(this.backgroundColor);
42427
42424
  this.path.setBackgroundOpacity(this.backgroundOpacity);
42428
- this.path.setBorderColor(this.borderColor);
42429
42425
  this.path.setBorderWidth(this.borderWidth);
42430
42426
  this.path.setBorderStyle(this.borderStyle);
42431
42427
  this.path.setBorderOpacity(this.borderOpacity);
@@ -42612,7 +42608,6 @@ class Sticker extends BaseItem {
42612
42608
  this.stickerPath.transform(this.transformation.toMatrix());
42613
42609
  this.text.setContainer(this.textContainer.copy());
42614
42610
  this.textContainer.transform(this.transformation.toMatrix());
42615
- this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
42616
42611
  this.saveStickerData();
42617
42612
  }
42618
42613
  setId(id) {
@@ -42656,7 +42651,6 @@ class Sticker extends BaseItem {
42656
42651
  }
42657
42652
  applyBackgroundColor(backgroundColor) {
42658
42653
  this.backgroundColor = backgroundColor;
42659
- this.stickerPath.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
42660
42654
  }
42661
42655
  setBackgroundColor(backgroundColor) {
42662
42656
  this.emit({
@@ -42703,6 +42697,7 @@ class Sticker extends BaseItem {
42703
42697
  return;
42704
42698
  }
42705
42699
  this.renderShadow(context);
42700
+ this.stickerPath.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
42706
42701
  this.stickerPath.render(context);
42707
42702
  this.text.render(context);
42708
42703
  if (this.getLinkTo()) {
@@ -43245,9 +43240,7 @@ class Frame2 extends BaseItem {
43245
43240
  this.path.transform(this.transformation.toMatrix());
43246
43241
  this.textContainer.transform(this.transformation.toMatrix());
43247
43242
  }
43248
- this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
43249
43243
  this.path.setBackgroundOpacity(this.backgroundOpacity);
43250
- this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
43251
43244
  this.path.setBorderWidth(this.borderWidth);
43252
43245
  this.path.setBorderStyle(this.borderStyle);
43253
43246
  this.path.setBorderOpacity(this.borderOpacity);
@@ -43398,7 +43391,6 @@ class Frame2 extends BaseItem {
43398
43391
  }
43399
43392
  applyBackgroundColor(backgroundColor) {
43400
43393
  this.backgroundColor = backgroundColor;
43401
- this.path.setBackgroundColor(resolveColor(backgroundColor, conf.theme, "background"));
43402
43394
  }
43403
43395
  setBackgroundColor(backgroundColor) {
43404
43396
  this.emit({
@@ -43446,6 +43438,8 @@ class Frame2 extends BaseItem {
43446
43438
  if (this.transformationRenderBlock) {
43447
43439
  return;
43448
43440
  }
43441
+ this.path.setBackgroundColor(resolveColor(this.backgroundColor, conf.theme, "background"));
43442
+ this.path.setBorderColor(resolveColor(this.borderColor, conf.theme, "foreground"));
43449
43443
  this.path.render(context);
43450
43444
  this.renderNewShape(context);
43451
43445
  if (this.getLinkTo()) {
@@ -27,8 +27,8 @@ interface LayoutTextNode {
27
27
  interface LeafStyle {
28
28
  fontStyle: string;
29
29
  fontWeight: string;
30
- color: string;
31
- backgroundColor: string | undefined;
30
+ color: string | import("../../../..").ColorValue;
31
+ backgroundColor: string | import("../../../..").ColorValue | undefined;
32
32
  fontSize: number | "auto";
33
33
  fontFamily: string;
34
34
  textDecorationLine?: 'underline';
@@ -1,4 +1,5 @@
1
1
  import { HorisontalAlignment } from "../../Alignment";
2
+ import type { ColorValue } from "../../../..";
2
3
  export declare const TextStyles: string[];
3
4
  export type TextStyle = (typeof TextStyles)[number];
4
5
  export type TextNode = {
@@ -14,9 +15,9 @@ export type TextNode = {
14
15
  subscript: boolean;
15
16
  superscript: boolean;
16
17
  fontFamily?: string;
17
- fontColor?: string;
18
+ fontColor?: string | ColorValue;
18
19
  fontSize?: number | "auto";
19
- fontHighlight?: string;
20
+ fontHighlight?: string | ColorValue;
20
21
  enableAuto?: boolean;
21
22
  paddingTop?: number;
22
23
  paddingBottom?: number;
@@ -47,7 +47,7 @@ export declare class RichText extends BaseItem {
47
47
  private selection?;
48
48
  transformationRenderBlock?: boolean;
49
49
  lastClickPoint?: Point;
50
- initialFontColor?: string;
50
+ initialFontColor?: string | import("../../..").ColorValue;
51
51
  frameMbr?: Mbr;
52
52
  private _onLimitReached;
53
53
  private shrinkWidth;
@@ -109,7 +109,7 @@ export declare class RichText extends BaseItem {
109
109
  set onLimitReached(handler: () => void);
110
110
  setSelectionFontColor(format: string, selectionContext?: SelectionContext): SlateOp[];
111
111
  setHyperLink(link: string | undefined, selection: BaseRange | null): SlateOp[];
112
- applySelectionFontColor(fontColor: string): void;
112
+ applySelectionFontColor(fontColor: string | import("../../..").ColorValue): void;
113
113
  setSelectionFontStyle(style: TextStyle | TextStyle[], selectionContext?: SelectionContext): SlateOp[];
114
114
  applySelectionFontSize(fontSize: number, selectionContext?: SelectionContext): void;
115
115
  setSelectionFontSize(fontSize: number | "auto", selectionContext?: SelectionContext): SlateOp[];
@@ -118,11 +118,11 @@ export declare class RichText extends BaseItem {
118
118
  setSelectionHorisontalAlignment(horisontalAlignment: HorisontalAlignment, selectionContext?: SelectionContext): SlateOp[];
119
119
  applySetSelectionHorisontalAlignment(horisontalAlignment: HorisontalAlignment, selectionContext?: SelectionContext): void;
120
120
  getFontStyles(): TextStyle[];
121
- getFontColor(): string;
121
+ getFontColor(): string | import("../../..").ColorValue;
122
122
  getFontFamily(): string;
123
123
  getFontSize(): number;
124
124
  getMinFontSize(): number;
125
- getFontHighlight(): string;
125
+ getFontHighlight(): string | import("../../..").ColorValue;
126
126
  getBlockType(): BlockType;
127
127
  getHorisontalAlignment(): HorisontalAlignment | undefined;
128
128
  getVerticalAlignment(): VerticalAlignment;
@@ -1,2 +1,3 @@
1
1
  import { Editor } from 'slate';
2
- export declare function applySelectionFontColor(editor: Editor, fontColor: string): void;
2
+ import type { ColorValue } from '../../../../..';
3
+ export declare function applySelectionFontColor(editor: Editor, fontColor: string | ColorValue): void;
@@ -1,2 +1,3 @@
1
1
  import { Editor } from 'slate';
2
- export declare function setSelectionFontHighlight(editor: Editor, format: string, selectionContext?: string): void;
2
+ import type { ColorValue } from '../../../../..';
3
+ export declare function setSelectionFontHighlight(editor: Editor, format: string | ColorValue, selectionContext?: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",