microboard-temp 0.14.28 → 0.14.29

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.
@@ -11945,7 +11945,6 @@ class BaseItem {
11945
11945
  shouldUseRelativeAlignment = true;
11946
11946
  resizeEnabled = true;
11947
11947
  onlyProportionalResize = false;
11948
- opacity = 1;
11949
11948
  itemType = "";
11950
11949
  childIds = [];
11951
11950
  isHoverHighlighted = false;
@@ -12298,7 +12297,6 @@ class BaseItem {
12298
12297
  itemType: this.itemType,
12299
12298
  childIds: this.childIds,
12300
12299
  parent: this.parent,
12301
- opacity: this.opacity,
12302
12300
  resizeEnabled: this.resizeEnabled
12303
12301
  };
12304
12302
  }
@@ -12510,16 +12508,6 @@ class BaseItem {
12510
12508
  this.index.render(context);
12511
12509
  }
12512
12510
  }
12513
- renderWithOpacity(context) {
12514
- if (this.opacity === 1) {
12515
- this.render(context);
12516
- return;
12517
- }
12518
- context.ctx.save();
12519
- context.ctx.globalAlpha *= this.opacity;
12520
- this.render(context);
12521
- context.ctx.restore();
12522
- }
12523
12511
  getSnapAnchorPoints() {
12524
12512
  return this.getMbr().getSnapAnchorPoints();
12525
12513
  }
@@ -40931,9 +40919,7 @@ function registerHTMLRenderer(itemType, renderer) {
40931
40919
  }
40932
40920
  function renderItemToHTML(item, documentFactory) {
40933
40921
  const renderer = renderers[item.itemType] || defaultRenderer;
40934
- const element2 = renderer.render(item, documentFactory);
40935
- element2.style.opacity = `${item.opacity}`;
40936
- return element2;
40922
+ return renderer.render(item, documentFactory);
40937
40923
  }
40938
40924
  var defaultRenderer = {
40939
40925
  render(item, documentFactory) {
@@ -42703,6 +42689,7 @@ function parseHTMLDrawing(el) {
42703
42689
  transformation,
42704
42690
  strokeStyle: pathElement.getAttribute("stroke") || "",
42705
42691
  strokeWidth: parseFloat(pathElement.getAttribute("stroke-width") || "1"),
42692
+ borderOpacity: parseFloat(pathElement.getAttribute("stroke-opacity") || el.style.opacity || "1"),
42706
42693
  linkTo: el.getAttribute("data-link-to") || undefined
42707
42694
  };
42708
42695
  }
@@ -43157,7 +43144,7 @@ class DrawingHTMLRenderer {
43157
43144
  const pathElement = documentFactory.createElementNS("http://www.w3.org/2000/svg", "path");
43158
43145
  pathElement.setAttribute("d", this.getPathData(drawing));
43159
43146
  pathElement.setAttribute("stroke", resolveColor(drawing.borderColor, conf.theme, drawing.colorRole));
43160
- pathElement.setAttribute("stroke-opacity", `${drawing.opacity}`);
43147
+ pathElement.setAttribute("stroke-opacity", `${drawing.getStrokeOpacity()}`);
43161
43148
  pathElement.setAttribute("stroke-width", `${drawing.strokeWidth}`);
43162
43149
  pathElement.setAttribute("fill", "none");
43163
43150
  svg.appendChild(pathElement);
@@ -44220,7 +44207,7 @@ class SimpleSpatialIndex {
44220
44207
  }
44221
44208
  render(context) {
44222
44209
  this.itemsArray.forEach((item) => {
44223
- item.renderWithOpacity?.(context) ?? item.render(context);
44210
+ item.render(context);
44224
44211
  });
44225
44212
  }
44226
44213
  }
@@ -60537,7 +60524,7 @@ async function exportBoardScreenshot({
60537
60524
  const { left, top, right, bottom } = selection;
60538
60525
  const inView = board.items.index.listEnclosedOrCrossedBy(left, top, right, bottom);
60539
60526
  for (const item of inView) {
60540
- item.renderWithOpacity?.(context) ?? item.render(context);
60527
+ item.render(context);
60541
60528
  }
60542
60529
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
60543
60530
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -62992,6 +62979,7 @@ var DrawingDataSchema = exports_external.object({
62992
62979
  strokeStyle: ColorValueSchema,
62993
62980
  strokeWidth: exports_external.number(),
62994
62981
  colorRole: exports_external.enum(["foreground", "background"]).optional(),
62982
+ borderOpacity: exports_external.number().optional(),
62995
62983
  opacity: exports_external.number().optional(),
62996
62984
  linkTo: exports_external.string().optional()
62997
62985
  });
@@ -63009,6 +62997,7 @@ class Drawing extends BaseItem {
63009
62997
  borderStyle = "solid";
63010
62998
  colorRole = "foreground";
63011
62999
  linePattern = scalePatterns(this.strokeWidth)[this.borderStyle];
63000
+ borderOpacity = 1;
63012
63001
  transformationRenderBlock = undefined;
63013
63002
  points = [];
63014
63003
  constructor(board, id = "") {
@@ -63027,7 +63016,8 @@ class Drawing extends BaseItem {
63027
63016
  points,
63028
63017
  strokeStyle: this.borderColor,
63029
63018
  strokeWidth: this.strokeWidth,
63030
- colorRole: this.colorRole
63019
+ colorRole: this.colorRole,
63020
+ borderOpacity: this.borderOpacity
63031
63021
  };
63032
63022
  }
63033
63023
  deserialize(data) {
@@ -63045,7 +63035,7 @@ class Drawing extends BaseItem {
63045
63035
  if (data.colorRole) {
63046
63036
  this.colorRole = data.colorRole;
63047
63037
  }
63048
- this.opacity = data.opacity ?? this.opacity;
63038
+ this.borderOpacity = data.borderOpacity ?? data.opacity ?? this.borderOpacity;
63049
63039
  this.updateVisuals({ method: "deserialize", class: this.itemType }, "FullRebuild" /* FullRebuild */);
63050
63040
  return this;
63051
63041
  }
@@ -63160,6 +63150,7 @@ class Drawing extends BaseItem {
63160
63150
  const ctx = context.ctx;
63161
63151
  ctx.save();
63162
63152
  ctx.strokeStyle = resolveColor(this.borderColor, conf.theme, this.colorRole);
63153
+ ctx.globalAlpha = this.borderOpacity;
63163
63154
  ctx.lineWidth = this.strokeWidth;
63164
63155
  ctx.lineCap = "round";
63165
63156
  ctx.setLineDash(this.linePattern);
@@ -63289,7 +63280,7 @@ class Drawing extends BaseItem {
63289
63280
  "borderColor",
63290
63281
  "strokeWidth",
63291
63282
  "borderStyle",
63292
- "opacity",
63283
+ "borderOpacity",
63293
63284
  "colorRole",
63294
63285
  "strokeStyle"
63295
63286
  ];
@@ -63299,7 +63290,7 @@ class Drawing extends BaseItem {
63299
63290
  return super.getPropertyUpdateHint(property);
63300
63291
  }
63301
63292
  getStrokeOpacity() {
63302
- return this.opacity;
63293
+ return this.borderOpacity;
63303
63294
  }
63304
63295
  getBorderStyle() {
63305
63296
  return this.borderStyle;
@@ -63345,7 +63336,7 @@ registerItem({
63345
63336
  itemType: "Drawing",
63346
63337
  points: [],
63347
63338
  borderColor: coerceColorValue("#000000"),
63348
- opacity: 1,
63339
+ borderOpacity: 1,
63349
63340
  borderStyle: "solid",
63350
63341
  strokeWidth: 2,
63351
63342
  transformation: new DefaultTransformationData
@@ -64367,7 +64358,7 @@ class ShapeTool extends CustomTool {
64367
64358
  }
64368
64359
  render(context) {
64369
64360
  if (this.isDown) {
64370
- this.item.renderWithOpacity(context);
64361
+ this.item.render(context);
64371
64362
  this.bounds.render(context);
64372
64363
  }
64373
64364
  }
@@ -68853,13 +68844,13 @@ function createCanvasDrawer(board) {
68853
68844
  if (container2) {
68854
68845
  context.ctx.save();
68855
68846
  container2.getNestingMatrix().applyToContext(context.ctx);
68856
- item.renderWithOpacity(context);
68847
+ item.render(context);
68857
68848
  context.ctx.restore();
68858
68849
  } else {
68859
- item.renderWithOpacity(context);
68850
+ item.render(context);
68860
68851
  }
68861
68852
  } else {
68862
- item.renderWithOpacity(context);
68853
+ item.render(context);
68863
68854
  }
68864
68855
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
68865
68856
  }
@@ -73327,7 +73318,7 @@ class AddHighlighter extends AddDrawing {
73327
73318
  }
73328
73319
  applyDrawingRole(drawing) {
73329
73320
  drawing.setColorRole("background");
73330
- drawing.apply(propertyOps.setProperty([drawing], "opacity", 0.5));
73321
+ drawing.apply(propertyOps.setProperty([drawing], "borderOpacity", 0.5));
73331
73322
  }
73332
73323
  updateSettings() {
73333
73324
  localStorage.setItem(conf.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
package/dist/cjs/index.js CHANGED
@@ -11945,7 +11945,6 @@ class BaseItem {
11945
11945
  shouldUseRelativeAlignment = true;
11946
11946
  resizeEnabled = true;
11947
11947
  onlyProportionalResize = false;
11948
- opacity = 1;
11949
11948
  itemType = "";
11950
11949
  childIds = [];
11951
11950
  isHoverHighlighted = false;
@@ -12298,7 +12297,6 @@ class BaseItem {
12298
12297
  itemType: this.itemType,
12299
12298
  childIds: this.childIds,
12300
12299
  parent: this.parent,
12301
- opacity: this.opacity,
12302
12300
  resizeEnabled: this.resizeEnabled
12303
12301
  };
12304
12302
  }
@@ -12510,16 +12508,6 @@ class BaseItem {
12510
12508
  this.index.render(context);
12511
12509
  }
12512
12510
  }
12513
- renderWithOpacity(context) {
12514
- if (this.opacity === 1) {
12515
- this.render(context);
12516
- return;
12517
- }
12518
- context.ctx.save();
12519
- context.ctx.globalAlpha *= this.opacity;
12520
- this.render(context);
12521
- context.ctx.restore();
12522
- }
12523
12511
  getSnapAnchorPoints() {
12524
12512
  return this.getMbr().getSnapAnchorPoints();
12525
12513
  }
@@ -40931,9 +40919,7 @@ function registerHTMLRenderer(itemType, renderer) {
40931
40919
  }
40932
40920
  function renderItemToHTML(item, documentFactory) {
40933
40921
  const renderer = renderers[item.itemType] || defaultRenderer;
40934
- const element2 = renderer.render(item, documentFactory);
40935
- element2.style.opacity = `${item.opacity}`;
40936
- return element2;
40922
+ return renderer.render(item, documentFactory);
40937
40923
  }
40938
40924
  var defaultRenderer = {
40939
40925
  render(item, documentFactory) {
@@ -42703,6 +42689,7 @@ function parseHTMLDrawing(el) {
42703
42689
  transformation,
42704
42690
  strokeStyle: pathElement.getAttribute("stroke") || "",
42705
42691
  strokeWidth: parseFloat(pathElement.getAttribute("stroke-width") || "1"),
42692
+ borderOpacity: parseFloat(pathElement.getAttribute("stroke-opacity") || el.style.opacity || "1"),
42706
42693
  linkTo: el.getAttribute("data-link-to") || undefined
42707
42694
  };
42708
42695
  }
@@ -43157,7 +43144,7 @@ class DrawingHTMLRenderer {
43157
43144
  const pathElement = documentFactory.createElementNS("http://www.w3.org/2000/svg", "path");
43158
43145
  pathElement.setAttribute("d", this.getPathData(drawing));
43159
43146
  pathElement.setAttribute("stroke", resolveColor(drawing.borderColor, conf.theme, drawing.colorRole));
43160
- pathElement.setAttribute("stroke-opacity", `${drawing.opacity}`);
43147
+ pathElement.setAttribute("stroke-opacity", `${drawing.getStrokeOpacity()}`);
43161
43148
  pathElement.setAttribute("stroke-width", `${drawing.strokeWidth}`);
43162
43149
  pathElement.setAttribute("fill", "none");
43163
43150
  svg.appendChild(pathElement);
@@ -44220,7 +44207,7 @@ class SimpleSpatialIndex {
44220
44207
  }
44221
44208
  render(context) {
44222
44209
  this.itemsArray.forEach((item) => {
44223
- item.renderWithOpacity?.(context) ?? item.render(context);
44210
+ item.render(context);
44224
44211
  });
44225
44212
  }
44226
44213
  }
@@ -60537,7 +60524,7 @@ async function exportBoardScreenshot({
60537
60524
  const { left, top, right, bottom } = selection;
60538
60525
  const inView = board.items.index.listEnclosedOrCrossedBy(left, top, right, bottom);
60539
60526
  for (const item of inView) {
60540
- item.renderWithOpacity?.(context) ?? item.render(context);
60527
+ item.render(context);
60541
60528
  }
60542
60529
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
60543
60530
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -62992,6 +62979,7 @@ var DrawingDataSchema = exports_external.object({
62992
62979
  strokeStyle: ColorValueSchema,
62993
62980
  strokeWidth: exports_external.number(),
62994
62981
  colorRole: exports_external.enum(["foreground", "background"]).optional(),
62982
+ borderOpacity: exports_external.number().optional(),
62995
62983
  opacity: exports_external.number().optional(),
62996
62984
  linkTo: exports_external.string().optional()
62997
62985
  });
@@ -63009,6 +62997,7 @@ class Drawing extends BaseItem {
63009
62997
  borderStyle = "solid";
63010
62998
  colorRole = "foreground";
63011
62999
  linePattern = scalePatterns(this.strokeWidth)[this.borderStyle];
63000
+ borderOpacity = 1;
63012
63001
  transformationRenderBlock = undefined;
63013
63002
  points = [];
63014
63003
  constructor(board, id = "") {
@@ -63027,7 +63016,8 @@ class Drawing extends BaseItem {
63027
63016
  points,
63028
63017
  strokeStyle: this.borderColor,
63029
63018
  strokeWidth: this.strokeWidth,
63030
- colorRole: this.colorRole
63019
+ colorRole: this.colorRole,
63020
+ borderOpacity: this.borderOpacity
63031
63021
  };
63032
63022
  }
63033
63023
  deserialize(data) {
@@ -63045,7 +63035,7 @@ class Drawing extends BaseItem {
63045
63035
  if (data.colorRole) {
63046
63036
  this.colorRole = data.colorRole;
63047
63037
  }
63048
- this.opacity = data.opacity ?? this.opacity;
63038
+ this.borderOpacity = data.borderOpacity ?? data.opacity ?? this.borderOpacity;
63049
63039
  this.updateVisuals({ method: "deserialize", class: this.itemType }, "FullRebuild" /* FullRebuild */);
63050
63040
  return this;
63051
63041
  }
@@ -63160,6 +63150,7 @@ class Drawing extends BaseItem {
63160
63150
  const ctx = context.ctx;
63161
63151
  ctx.save();
63162
63152
  ctx.strokeStyle = resolveColor(this.borderColor, conf.theme, this.colorRole);
63153
+ ctx.globalAlpha = this.borderOpacity;
63163
63154
  ctx.lineWidth = this.strokeWidth;
63164
63155
  ctx.lineCap = "round";
63165
63156
  ctx.setLineDash(this.linePattern);
@@ -63289,7 +63280,7 @@ class Drawing extends BaseItem {
63289
63280
  "borderColor",
63290
63281
  "strokeWidth",
63291
63282
  "borderStyle",
63292
- "opacity",
63283
+ "borderOpacity",
63293
63284
  "colorRole",
63294
63285
  "strokeStyle"
63295
63286
  ];
@@ -63299,7 +63290,7 @@ class Drawing extends BaseItem {
63299
63290
  return super.getPropertyUpdateHint(property);
63300
63291
  }
63301
63292
  getStrokeOpacity() {
63302
- return this.opacity;
63293
+ return this.borderOpacity;
63303
63294
  }
63304
63295
  getBorderStyle() {
63305
63296
  return this.borderStyle;
@@ -63345,7 +63336,7 @@ registerItem({
63345
63336
  itemType: "Drawing",
63346
63337
  points: [],
63347
63338
  borderColor: coerceColorValue("#000000"),
63348
- opacity: 1,
63339
+ borderOpacity: 1,
63349
63340
  borderStyle: "solid",
63350
63341
  strokeWidth: 2,
63351
63342
  transformation: new DefaultTransformationData
@@ -64367,7 +64358,7 @@ class ShapeTool extends CustomTool {
64367
64358
  }
64368
64359
  render(context) {
64369
64360
  if (this.isDown) {
64370
- this.item.renderWithOpacity(context);
64361
+ this.item.render(context);
64371
64362
  this.bounds.render(context);
64372
64363
  }
64373
64364
  }
@@ -68853,13 +68844,13 @@ function createCanvasDrawer(board) {
68853
68844
  if (container2) {
68854
68845
  context.ctx.save();
68855
68846
  container2.getNestingMatrix().applyToContext(context.ctx);
68856
- item.renderWithOpacity(context);
68847
+ item.render(context);
68857
68848
  context.ctx.restore();
68858
68849
  } else {
68859
- item.renderWithOpacity(context);
68850
+ item.render(context);
68860
68851
  }
68861
68852
  } else {
68862
- item.renderWithOpacity(context);
68853
+ item.render(context);
68863
68854
  }
68864
68855
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
68865
68856
  }
@@ -73327,7 +73318,7 @@ class AddHighlighter extends AddDrawing {
73327
73318
  }
73328
73319
  applyDrawingRole(drawing) {
73329
73320
  drawing.setColorRole("background");
73330
- drawing.apply(propertyOps.setProperty([drawing], "opacity", 0.5));
73321
+ drawing.apply(propertyOps.setProperty([drawing], "borderOpacity", 0.5));
73331
73322
  }
73332
73323
  updateSettings() {
73333
73324
  localStorage.setItem(conf.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
package/dist/cjs/node.js CHANGED
@@ -12981,7 +12981,6 @@ class BaseItem {
12981
12981
  shouldUseRelativeAlignment = true;
12982
12982
  resizeEnabled = true;
12983
12983
  onlyProportionalResize = false;
12984
- opacity = 1;
12985
12984
  itemType = "";
12986
12985
  childIds = [];
12987
12986
  isHoverHighlighted = false;
@@ -13334,7 +13333,6 @@ class BaseItem {
13334
13333
  itemType: this.itemType,
13335
13334
  childIds: this.childIds,
13336
13335
  parent: this.parent,
13337
- opacity: this.opacity,
13338
13336
  resizeEnabled: this.resizeEnabled
13339
13337
  };
13340
13338
  }
@@ -13546,16 +13544,6 @@ class BaseItem {
13546
13544
  this.index.render(context);
13547
13545
  }
13548
13546
  }
13549
- renderWithOpacity(context) {
13550
- if (this.opacity === 1) {
13551
- this.render(context);
13552
- return;
13553
- }
13554
- context.ctx.save();
13555
- context.ctx.globalAlpha *= this.opacity;
13556
- this.render(context);
13557
- context.ctx.restore();
13558
- }
13559
13547
  getSnapAnchorPoints() {
13560
13548
  return this.getMbr().getSnapAnchorPoints();
13561
13549
  }
@@ -43403,9 +43391,7 @@ function registerHTMLRenderer(itemType, renderer) {
43403
43391
  }
43404
43392
  function renderItemToHTML(item, documentFactory) {
43405
43393
  const renderer = renderers[item.itemType] || defaultRenderer;
43406
- const element = renderer.render(item, documentFactory);
43407
- element.style.opacity = `${item.opacity}`;
43408
- return element;
43394
+ return renderer.render(item, documentFactory);
43409
43395
  }
43410
43396
  var defaultRenderer = {
43411
43397
  render(item, documentFactory) {
@@ -45175,6 +45161,7 @@ function parseHTMLDrawing(el) {
45175
45161
  transformation,
45176
45162
  strokeStyle: pathElement.getAttribute("stroke") || "",
45177
45163
  strokeWidth: parseFloat(pathElement.getAttribute("stroke-width") || "1"),
45164
+ borderOpacity: parseFloat(pathElement.getAttribute("stroke-opacity") || el.style.opacity || "1"),
45178
45165
  linkTo: el.getAttribute("data-link-to") || undefined
45179
45166
  };
45180
45167
  }
@@ -45629,7 +45616,7 @@ class DrawingHTMLRenderer {
45629
45616
  const pathElement = documentFactory.createElementNS("http://www.w3.org/2000/svg", "path");
45630
45617
  pathElement.setAttribute("d", this.getPathData(drawing));
45631
45618
  pathElement.setAttribute("stroke", resolveColor(drawing.borderColor, conf.theme, drawing.colorRole));
45632
- pathElement.setAttribute("stroke-opacity", `${drawing.opacity}`);
45619
+ pathElement.setAttribute("stroke-opacity", `${drawing.getStrokeOpacity()}`);
45633
45620
  pathElement.setAttribute("stroke-width", `${drawing.strokeWidth}`);
45634
45621
  pathElement.setAttribute("fill", "none");
45635
45622
  svg.appendChild(pathElement);
@@ -46692,7 +46679,7 @@ class SimpleSpatialIndex {
46692
46679
  }
46693
46680
  render(context) {
46694
46681
  this.itemsArray.forEach((item) => {
46695
- item.renderWithOpacity?.(context) ?? item.render(context);
46682
+ item.render(context);
46696
46683
  });
46697
46684
  }
46698
46685
  }
@@ -63010,7 +62997,7 @@ async function exportBoardScreenshot({
63010
62997
  const { left, top, right, bottom } = selection;
63011
62998
  const inView = board.items.index.listEnclosedOrCrossedBy(left, top, right, bottom);
63012
62999
  for (const item of inView) {
63013
- item.renderWithOpacity?.(context) ?? item.render(context);
63000
+ item.render(context);
63014
63001
  }
63015
63002
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
63016
63003
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -65465,6 +65452,7 @@ var DrawingDataSchema = exports_external.object({
65465
65452
  strokeStyle: ColorValueSchema,
65466
65453
  strokeWidth: exports_external.number(),
65467
65454
  colorRole: exports_external.enum(["foreground", "background"]).optional(),
65455
+ borderOpacity: exports_external.number().optional(),
65468
65456
  opacity: exports_external.number().optional(),
65469
65457
  linkTo: exports_external.string().optional()
65470
65458
  });
@@ -65482,6 +65470,7 @@ class Drawing extends BaseItem {
65482
65470
  borderStyle = "solid";
65483
65471
  colorRole = "foreground";
65484
65472
  linePattern = scalePatterns(this.strokeWidth)[this.borderStyle];
65473
+ borderOpacity = 1;
65485
65474
  transformationRenderBlock = undefined;
65486
65475
  points = [];
65487
65476
  constructor(board, id = "") {
@@ -65500,7 +65489,8 @@ class Drawing extends BaseItem {
65500
65489
  points,
65501
65490
  strokeStyle: this.borderColor,
65502
65491
  strokeWidth: this.strokeWidth,
65503
- colorRole: this.colorRole
65492
+ colorRole: this.colorRole,
65493
+ borderOpacity: this.borderOpacity
65504
65494
  };
65505
65495
  }
65506
65496
  deserialize(data) {
@@ -65518,7 +65508,7 @@ class Drawing extends BaseItem {
65518
65508
  if (data.colorRole) {
65519
65509
  this.colorRole = data.colorRole;
65520
65510
  }
65521
- this.opacity = data.opacity ?? this.opacity;
65511
+ this.borderOpacity = data.borderOpacity ?? data.opacity ?? this.borderOpacity;
65522
65512
  this.updateVisuals({ method: "deserialize", class: this.itemType }, "FullRebuild" /* FullRebuild */);
65523
65513
  return this;
65524
65514
  }
@@ -65633,6 +65623,7 @@ class Drawing extends BaseItem {
65633
65623
  const ctx = context.ctx;
65634
65624
  ctx.save();
65635
65625
  ctx.strokeStyle = resolveColor(this.borderColor, conf.theme, this.colorRole);
65626
+ ctx.globalAlpha = this.borderOpacity;
65636
65627
  ctx.lineWidth = this.strokeWidth;
65637
65628
  ctx.lineCap = "round";
65638
65629
  ctx.setLineDash(this.linePattern);
@@ -65762,7 +65753,7 @@ class Drawing extends BaseItem {
65762
65753
  "borderColor",
65763
65754
  "strokeWidth",
65764
65755
  "borderStyle",
65765
- "opacity",
65756
+ "borderOpacity",
65766
65757
  "colorRole",
65767
65758
  "strokeStyle"
65768
65759
  ];
@@ -65772,7 +65763,7 @@ class Drawing extends BaseItem {
65772
65763
  return super.getPropertyUpdateHint(property);
65773
65764
  }
65774
65765
  getStrokeOpacity() {
65775
- return this.opacity;
65766
+ return this.borderOpacity;
65776
65767
  }
65777
65768
  getBorderStyle() {
65778
65769
  return this.borderStyle;
@@ -65818,7 +65809,7 @@ registerItem({
65818
65809
  itemType: "Drawing",
65819
65810
  points: [],
65820
65811
  borderColor: coerceColorValue("#000000"),
65821
- opacity: 1,
65812
+ borderOpacity: 1,
65822
65813
  borderStyle: "solid",
65823
65814
  strokeWidth: 2,
65824
65815
  transformation: new DefaultTransformationData
@@ -66840,7 +66831,7 @@ class ShapeTool extends CustomTool {
66840
66831
  }
66841
66832
  render(context) {
66842
66833
  if (this.isDown) {
66843
- this.item.renderWithOpacity(context);
66834
+ this.item.render(context);
66844
66835
  this.bounds.render(context);
66845
66836
  }
66846
66837
  }
@@ -71326,13 +71317,13 @@ function createCanvasDrawer(board) {
71326
71317
  if (container2) {
71327
71318
  context.ctx.save();
71328
71319
  container2.getNestingMatrix().applyToContext(context.ctx);
71329
- item.renderWithOpacity(context);
71320
+ item.render(context);
71330
71321
  context.ctx.restore();
71331
71322
  } else {
71332
- item.renderWithOpacity(context);
71323
+ item.render(context);
71333
71324
  }
71334
71325
  } else {
71335
- item.renderWithOpacity(context);
71326
+ item.render(context);
71336
71327
  }
71337
71328
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
71338
71329
  }
@@ -75800,7 +75791,7 @@ class AddHighlighter extends AddDrawing {
75800
75791
  }
75801
75792
  applyDrawingRole(drawing) {
75802
75793
  drawing.setColorRole("background");
75803
- drawing.apply(propertyOps.setProperty([drawing], "opacity", 0.5));
75794
+ drawing.apply(propertyOps.setProperty([drawing], "borderOpacity", 0.5));
75804
75795
  }
75805
75796
  updateSettings() {
75806
75797
  localStorage.setItem(conf.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
@@ -11719,7 +11719,6 @@ class BaseItem {
11719
11719
  shouldUseRelativeAlignment = true;
11720
11720
  resizeEnabled = true;
11721
11721
  onlyProportionalResize = false;
11722
- opacity = 1;
11723
11722
  itemType = "";
11724
11723
  childIds = [];
11725
11724
  isHoverHighlighted = false;
@@ -12072,7 +12071,6 @@ class BaseItem {
12072
12071
  itemType: this.itemType,
12073
12072
  childIds: this.childIds,
12074
12073
  parent: this.parent,
12075
- opacity: this.opacity,
12076
12074
  resizeEnabled: this.resizeEnabled
12077
12075
  };
12078
12076
  }
@@ -12284,16 +12282,6 @@ class BaseItem {
12284
12282
  this.index.render(context);
12285
12283
  }
12286
12284
  }
12287
- renderWithOpacity(context) {
12288
- if (this.opacity === 1) {
12289
- this.render(context);
12290
- return;
12291
- }
12292
- context.ctx.save();
12293
- context.ctx.globalAlpha *= this.opacity;
12294
- this.render(context);
12295
- context.ctx.restore();
12296
- }
12297
12285
  getSnapAnchorPoints() {
12298
12286
  return this.getMbr().getSnapAnchorPoints();
12299
12287
  }
@@ -40713,9 +40701,7 @@ function registerHTMLRenderer(itemType, renderer) {
40713
40701
  }
40714
40702
  function renderItemToHTML(item, documentFactory) {
40715
40703
  const renderer = renderers[item.itemType] || defaultRenderer;
40716
- const element2 = renderer.render(item, documentFactory);
40717
- element2.style.opacity = `${item.opacity}`;
40718
- return element2;
40704
+ return renderer.render(item, documentFactory);
40719
40705
  }
40720
40706
  var defaultRenderer = {
40721
40707
  render(item, documentFactory) {
@@ -42485,6 +42471,7 @@ function parseHTMLDrawing(el) {
42485
42471
  transformation,
42486
42472
  strokeStyle: pathElement.getAttribute("stroke") || "",
42487
42473
  strokeWidth: parseFloat(pathElement.getAttribute("stroke-width") || "1"),
42474
+ borderOpacity: parseFloat(pathElement.getAttribute("stroke-opacity") || el.style.opacity || "1"),
42488
42475
  linkTo: el.getAttribute("data-link-to") || undefined
42489
42476
  };
42490
42477
  }
@@ -42939,7 +42926,7 @@ class DrawingHTMLRenderer {
42939
42926
  const pathElement = documentFactory.createElementNS("http://www.w3.org/2000/svg", "path");
42940
42927
  pathElement.setAttribute("d", this.getPathData(drawing));
42941
42928
  pathElement.setAttribute("stroke", resolveColor(drawing.borderColor, conf.theme, drawing.colorRole));
42942
- pathElement.setAttribute("stroke-opacity", `${drawing.opacity}`);
42929
+ pathElement.setAttribute("stroke-opacity", `${drawing.getStrokeOpacity()}`);
42943
42930
  pathElement.setAttribute("stroke-width", `${drawing.strokeWidth}`);
42944
42931
  pathElement.setAttribute("fill", "none");
42945
42932
  svg.appendChild(pathElement);
@@ -44002,7 +43989,7 @@ class SimpleSpatialIndex {
44002
43989
  }
44003
43990
  render(context) {
44004
43991
  this.itemsArray.forEach((item) => {
44005
- item.renderWithOpacity?.(context) ?? item.render(context);
43992
+ item.render(context);
44006
43993
  });
44007
43994
  }
44008
43995
  }
@@ -60319,7 +60306,7 @@ async function exportBoardScreenshot({
60319
60306
  const { left, top, right, bottom } = selection;
60320
60307
  const inView = board.items.index.listEnclosedOrCrossedBy(left, top, right, bottom);
60321
60308
  for (const item of inView) {
60322
- item.renderWithOpacity?.(context) ?? item.render(context);
60309
+ item.render(context);
60323
60310
  }
60324
60311
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
60325
60312
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -62774,6 +62761,7 @@ var DrawingDataSchema = exports_external.object({
62774
62761
  strokeStyle: ColorValueSchema,
62775
62762
  strokeWidth: exports_external.number(),
62776
62763
  colorRole: exports_external.enum(["foreground", "background"]).optional(),
62764
+ borderOpacity: exports_external.number().optional(),
62777
62765
  opacity: exports_external.number().optional(),
62778
62766
  linkTo: exports_external.string().optional()
62779
62767
  });
@@ -62791,6 +62779,7 @@ class Drawing extends BaseItem {
62791
62779
  borderStyle = "solid";
62792
62780
  colorRole = "foreground";
62793
62781
  linePattern = scalePatterns(this.strokeWidth)[this.borderStyle];
62782
+ borderOpacity = 1;
62794
62783
  transformationRenderBlock = undefined;
62795
62784
  points = [];
62796
62785
  constructor(board, id = "") {
@@ -62809,7 +62798,8 @@ class Drawing extends BaseItem {
62809
62798
  points,
62810
62799
  strokeStyle: this.borderColor,
62811
62800
  strokeWidth: this.strokeWidth,
62812
- colorRole: this.colorRole
62801
+ colorRole: this.colorRole,
62802
+ borderOpacity: this.borderOpacity
62813
62803
  };
62814
62804
  }
62815
62805
  deserialize(data) {
@@ -62827,7 +62817,7 @@ class Drawing extends BaseItem {
62827
62817
  if (data.colorRole) {
62828
62818
  this.colorRole = data.colorRole;
62829
62819
  }
62830
- this.opacity = data.opacity ?? this.opacity;
62820
+ this.borderOpacity = data.borderOpacity ?? data.opacity ?? this.borderOpacity;
62831
62821
  this.updateVisuals({ method: "deserialize", class: this.itemType }, "FullRebuild" /* FullRebuild */);
62832
62822
  return this;
62833
62823
  }
@@ -62942,6 +62932,7 @@ class Drawing extends BaseItem {
62942
62932
  const ctx = context.ctx;
62943
62933
  ctx.save();
62944
62934
  ctx.strokeStyle = resolveColor(this.borderColor, conf.theme, this.colorRole);
62935
+ ctx.globalAlpha = this.borderOpacity;
62945
62936
  ctx.lineWidth = this.strokeWidth;
62946
62937
  ctx.lineCap = "round";
62947
62938
  ctx.setLineDash(this.linePattern);
@@ -63071,7 +63062,7 @@ class Drawing extends BaseItem {
63071
63062
  "borderColor",
63072
63063
  "strokeWidth",
63073
63064
  "borderStyle",
63074
- "opacity",
63065
+ "borderOpacity",
63075
63066
  "colorRole",
63076
63067
  "strokeStyle"
63077
63068
  ];
@@ -63081,7 +63072,7 @@ class Drawing extends BaseItem {
63081
63072
  return super.getPropertyUpdateHint(property);
63082
63073
  }
63083
63074
  getStrokeOpacity() {
63084
- return this.opacity;
63075
+ return this.borderOpacity;
63085
63076
  }
63086
63077
  getBorderStyle() {
63087
63078
  return this.borderStyle;
@@ -63127,7 +63118,7 @@ registerItem({
63127
63118
  itemType: "Drawing",
63128
63119
  points: [],
63129
63120
  borderColor: coerceColorValue("#000000"),
63130
- opacity: 1,
63121
+ borderOpacity: 1,
63131
63122
  borderStyle: "solid",
63132
63123
  strokeWidth: 2,
63133
63124
  transformation: new DefaultTransformationData
@@ -64149,7 +64140,7 @@ class ShapeTool extends CustomTool {
64149
64140
  }
64150
64141
  render(context) {
64151
64142
  if (this.isDown) {
64152
- this.item.renderWithOpacity(context);
64143
+ this.item.render(context);
64153
64144
  this.bounds.render(context);
64154
64145
  }
64155
64146
  }
@@ -68635,13 +68626,13 @@ function createCanvasDrawer(board) {
68635
68626
  if (container2) {
68636
68627
  context.ctx.save();
68637
68628
  container2.getNestingMatrix().applyToContext(context.ctx);
68638
- item.renderWithOpacity(context);
68629
+ item.render(context);
68639
68630
  context.ctx.restore();
68640
68631
  } else {
68641
- item.renderWithOpacity(context);
68632
+ item.render(context);
68642
68633
  }
68643
68634
  } else {
68644
- item.renderWithOpacity(context);
68635
+ item.render(context);
68645
68636
  }
68646
68637
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
68647
68638
  }
@@ -73109,7 +73100,7 @@ class AddHighlighter extends AddDrawing {
73109
73100
  }
73110
73101
  applyDrawingRole(drawing) {
73111
73102
  drawing.setColorRole("background");
73112
- drawing.apply(propertyOps.setProperty([drawing], "opacity", 0.5));
73103
+ drawing.apply(propertyOps.setProperty([drawing], "borderOpacity", 0.5));
73113
73104
  }
73114
73105
  updateSettings() {
73115
73106
  localStorage.setItem(conf.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
package/dist/esm/index.js CHANGED
@@ -11712,7 +11712,6 @@ class BaseItem {
11712
11712
  shouldUseRelativeAlignment = true;
11713
11713
  resizeEnabled = true;
11714
11714
  onlyProportionalResize = false;
11715
- opacity = 1;
11716
11715
  itemType = "";
11717
11716
  childIds = [];
11718
11717
  isHoverHighlighted = false;
@@ -12065,7 +12064,6 @@ class BaseItem {
12065
12064
  itemType: this.itemType,
12066
12065
  childIds: this.childIds,
12067
12066
  parent: this.parent,
12068
- opacity: this.opacity,
12069
12067
  resizeEnabled: this.resizeEnabled
12070
12068
  };
12071
12069
  }
@@ -12277,16 +12275,6 @@ class BaseItem {
12277
12275
  this.index.render(context);
12278
12276
  }
12279
12277
  }
12280
- renderWithOpacity(context) {
12281
- if (this.opacity === 1) {
12282
- this.render(context);
12283
- return;
12284
- }
12285
- context.ctx.save();
12286
- context.ctx.globalAlpha *= this.opacity;
12287
- this.render(context);
12288
- context.ctx.restore();
12289
- }
12290
12278
  getSnapAnchorPoints() {
12291
12279
  return this.getMbr().getSnapAnchorPoints();
12292
12280
  }
@@ -40706,9 +40694,7 @@ function registerHTMLRenderer(itemType, renderer) {
40706
40694
  }
40707
40695
  function renderItemToHTML(item, documentFactory) {
40708
40696
  const renderer = renderers[item.itemType] || defaultRenderer;
40709
- const element2 = renderer.render(item, documentFactory);
40710
- element2.style.opacity = `${item.opacity}`;
40711
- return element2;
40697
+ return renderer.render(item, documentFactory);
40712
40698
  }
40713
40699
  var defaultRenderer = {
40714
40700
  render(item, documentFactory) {
@@ -42478,6 +42464,7 @@ function parseHTMLDrawing(el) {
42478
42464
  transformation,
42479
42465
  strokeStyle: pathElement.getAttribute("stroke") || "",
42480
42466
  strokeWidth: parseFloat(pathElement.getAttribute("stroke-width") || "1"),
42467
+ borderOpacity: parseFloat(pathElement.getAttribute("stroke-opacity") || el.style.opacity || "1"),
42481
42468
  linkTo: el.getAttribute("data-link-to") || undefined
42482
42469
  };
42483
42470
  }
@@ -42932,7 +42919,7 @@ class DrawingHTMLRenderer {
42932
42919
  const pathElement = documentFactory.createElementNS("http://www.w3.org/2000/svg", "path");
42933
42920
  pathElement.setAttribute("d", this.getPathData(drawing));
42934
42921
  pathElement.setAttribute("stroke", resolveColor(drawing.borderColor, conf.theme, drawing.colorRole));
42935
- pathElement.setAttribute("stroke-opacity", `${drawing.opacity}`);
42922
+ pathElement.setAttribute("stroke-opacity", `${drawing.getStrokeOpacity()}`);
42936
42923
  pathElement.setAttribute("stroke-width", `${drawing.strokeWidth}`);
42937
42924
  pathElement.setAttribute("fill", "none");
42938
42925
  svg.appendChild(pathElement);
@@ -43995,7 +43982,7 @@ class SimpleSpatialIndex {
43995
43982
  }
43996
43983
  render(context) {
43997
43984
  this.itemsArray.forEach((item) => {
43998
- item.renderWithOpacity?.(context) ?? item.render(context);
43985
+ item.render(context);
43999
43986
  });
44000
43987
  }
44001
43988
  }
@@ -60312,7 +60299,7 @@ async function exportBoardScreenshot({
60312
60299
  const { left, top, right, bottom } = selection;
60313
60300
  const inView = board.items.index.listEnclosedOrCrossedBy(left, top, right, bottom);
60314
60301
  for (const item of inView) {
60315
- item.renderWithOpacity?.(context) ?? item.render(context);
60302
+ item.render(context);
60316
60303
  }
60317
60304
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
60318
60305
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -62767,6 +62754,7 @@ var DrawingDataSchema = exports_external.object({
62767
62754
  strokeStyle: ColorValueSchema,
62768
62755
  strokeWidth: exports_external.number(),
62769
62756
  colorRole: exports_external.enum(["foreground", "background"]).optional(),
62757
+ borderOpacity: exports_external.number().optional(),
62770
62758
  opacity: exports_external.number().optional(),
62771
62759
  linkTo: exports_external.string().optional()
62772
62760
  });
@@ -62784,6 +62772,7 @@ class Drawing extends BaseItem {
62784
62772
  borderStyle = "solid";
62785
62773
  colorRole = "foreground";
62786
62774
  linePattern = scalePatterns(this.strokeWidth)[this.borderStyle];
62775
+ borderOpacity = 1;
62787
62776
  transformationRenderBlock = undefined;
62788
62777
  points = [];
62789
62778
  constructor(board, id = "") {
@@ -62802,7 +62791,8 @@ class Drawing extends BaseItem {
62802
62791
  points,
62803
62792
  strokeStyle: this.borderColor,
62804
62793
  strokeWidth: this.strokeWidth,
62805
- colorRole: this.colorRole
62794
+ colorRole: this.colorRole,
62795
+ borderOpacity: this.borderOpacity
62806
62796
  };
62807
62797
  }
62808
62798
  deserialize(data) {
@@ -62820,7 +62810,7 @@ class Drawing extends BaseItem {
62820
62810
  if (data.colorRole) {
62821
62811
  this.colorRole = data.colorRole;
62822
62812
  }
62823
- this.opacity = data.opacity ?? this.opacity;
62813
+ this.borderOpacity = data.borderOpacity ?? data.opacity ?? this.borderOpacity;
62824
62814
  this.updateVisuals({ method: "deserialize", class: this.itemType }, "FullRebuild" /* FullRebuild */);
62825
62815
  return this;
62826
62816
  }
@@ -62935,6 +62925,7 @@ class Drawing extends BaseItem {
62935
62925
  const ctx = context.ctx;
62936
62926
  ctx.save();
62937
62927
  ctx.strokeStyle = resolveColor(this.borderColor, conf.theme, this.colorRole);
62928
+ ctx.globalAlpha = this.borderOpacity;
62938
62929
  ctx.lineWidth = this.strokeWidth;
62939
62930
  ctx.lineCap = "round";
62940
62931
  ctx.setLineDash(this.linePattern);
@@ -63064,7 +63055,7 @@ class Drawing extends BaseItem {
63064
63055
  "borderColor",
63065
63056
  "strokeWidth",
63066
63057
  "borderStyle",
63067
- "opacity",
63058
+ "borderOpacity",
63068
63059
  "colorRole",
63069
63060
  "strokeStyle"
63070
63061
  ];
@@ -63074,7 +63065,7 @@ class Drawing extends BaseItem {
63074
63065
  return super.getPropertyUpdateHint(property);
63075
63066
  }
63076
63067
  getStrokeOpacity() {
63077
- return this.opacity;
63068
+ return this.borderOpacity;
63078
63069
  }
63079
63070
  getBorderStyle() {
63080
63071
  return this.borderStyle;
@@ -63120,7 +63111,7 @@ registerItem({
63120
63111
  itemType: "Drawing",
63121
63112
  points: [],
63122
63113
  borderColor: coerceColorValue("#000000"),
63123
- opacity: 1,
63114
+ borderOpacity: 1,
63124
63115
  borderStyle: "solid",
63125
63116
  strokeWidth: 2,
63126
63117
  transformation: new DefaultTransformationData
@@ -64142,7 +64133,7 @@ class ShapeTool extends CustomTool {
64142
64133
  }
64143
64134
  render(context) {
64144
64135
  if (this.isDown) {
64145
- this.item.renderWithOpacity(context);
64136
+ this.item.render(context);
64146
64137
  this.bounds.render(context);
64147
64138
  }
64148
64139
  }
@@ -68628,13 +68619,13 @@ function createCanvasDrawer(board) {
68628
68619
  if (container2) {
68629
68620
  context.ctx.save();
68630
68621
  container2.getNestingMatrix().applyToContext(context.ctx);
68631
- item.renderWithOpacity(context);
68622
+ item.render(context);
68632
68623
  context.ctx.restore();
68633
68624
  } else {
68634
- item.renderWithOpacity(context);
68625
+ item.render(context);
68635
68626
  }
68636
68627
  } else {
68637
- item.renderWithOpacity(context);
68628
+ item.render(context);
68638
68629
  }
68639
68630
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
68640
68631
  }
@@ -73102,7 +73093,7 @@ class AddHighlighter extends AddDrawing {
73102
73093
  }
73103
73094
  applyDrawingRole(drawing) {
73104
73095
  drawing.setColorRole("background");
73105
- drawing.apply(propertyOps.setProperty([drawing], "opacity", 0.5));
73096
+ drawing.apply(propertyOps.setProperty([drawing], "borderOpacity", 0.5));
73106
73097
  }
73107
73098
  updateSettings() {
73108
73099
  localStorage.setItem(conf.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
package/dist/esm/node.js CHANGED
@@ -12495,7 +12495,6 @@ class BaseItem {
12495
12495
  shouldUseRelativeAlignment = true;
12496
12496
  resizeEnabled = true;
12497
12497
  onlyProportionalResize = false;
12498
- opacity = 1;
12499
12498
  itemType = "";
12500
12499
  childIds = [];
12501
12500
  isHoverHighlighted = false;
@@ -12848,7 +12847,6 @@ class BaseItem {
12848
12847
  itemType: this.itemType,
12849
12848
  childIds: this.childIds,
12850
12849
  parent: this.parent,
12851
- opacity: this.opacity,
12852
12850
  resizeEnabled: this.resizeEnabled
12853
12851
  };
12854
12852
  }
@@ -13060,16 +13058,6 @@ class BaseItem {
13060
13058
  this.index.render(context);
13061
13059
  }
13062
13060
  }
13063
- renderWithOpacity(context) {
13064
- if (this.opacity === 1) {
13065
- this.render(context);
13066
- return;
13067
- }
13068
- context.ctx.save();
13069
- context.ctx.globalAlpha *= this.opacity;
13070
- this.render(context);
13071
- context.ctx.restore();
13072
- }
13073
13061
  getSnapAnchorPoints() {
13074
13062
  return this.getMbr().getSnapAnchorPoints();
13075
13063
  }
@@ -43173,9 +43161,7 @@ function registerHTMLRenderer(itemType, renderer) {
43173
43161
  }
43174
43162
  function renderItemToHTML(item, documentFactory) {
43175
43163
  const renderer = renderers[item.itemType] || defaultRenderer;
43176
- const element = renderer.render(item, documentFactory);
43177
- element.style.opacity = `${item.opacity}`;
43178
- return element;
43164
+ return renderer.render(item, documentFactory);
43179
43165
  }
43180
43166
  var defaultRenderer = {
43181
43167
  render(item, documentFactory) {
@@ -44945,6 +44931,7 @@ function parseHTMLDrawing(el) {
44945
44931
  transformation,
44946
44932
  strokeStyle: pathElement.getAttribute("stroke") || "",
44947
44933
  strokeWidth: parseFloat(pathElement.getAttribute("stroke-width") || "1"),
44934
+ borderOpacity: parseFloat(pathElement.getAttribute("stroke-opacity") || el.style.opacity || "1"),
44948
44935
  linkTo: el.getAttribute("data-link-to") || undefined
44949
44936
  };
44950
44937
  }
@@ -45399,7 +45386,7 @@ class DrawingHTMLRenderer {
45399
45386
  const pathElement = documentFactory.createElementNS("http://www.w3.org/2000/svg", "path");
45400
45387
  pathElement.setAttribute("d", this.getPathData(drawing));
45401
45388
  pathElement.setAttribute("stroke", resolveColor(drawing.borderColor, conf.theme, drawing.colorRole));
45402
- pathElement.setAttribute("stroke-opacity", `${drawing.opacity}`);
45389
+ pathElement.setAttribute("stroke-opacity", `${drawing.getStrokeOpacity()}`);
45403
45390
  pathElement.setAttribute("stroke-width", `${drawing.strokeWidth}`);
45404
45391
  pathElement.setAttribute("fill", "none");
45405
45392
  svg.appendChild(pathElement);
@@ -46462,7 +46449,7 @@ class SimpleSpatialIndex {
46462
46449
  }
46463
46450
  render(context) {
46464
46451
  this.itemsArray.forEach((item) => {
46465
- item.renderWithOpacity?.(context) ?? item.render(context);
46452
+ item.render(context);
46466
46453
  });
46467
46454
  }
46468
46455
  }
@@ -62780,7 +62767,7 @@ async function exportBoardScreenshot({
62780
62767
  const { left, top, right, bottom } = selection;
62781
62768
  const inView = board.items.index.listEnclosedOrCrossedBy(left, top, right, bottom);
62782
62769
  for (const item of inView) {
62783
- item.renderWithOpacity?.(context) ?? item.render(context);
62770
+ item.render(context);
62784
62771
  }
62785
62772
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
62786
62773
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -65235,6 +65222,7 @@ var DrawingDataSchema = exports_external.object({
65235
65222
  strokeStyle: ColorValueSchema,
65236
65223
  strokeWidth: exports_external.number(),
65237
65224
  colorRole: exports_external.enum(["foreground", "background"]).optional(),
65225
+ borderOpacity: exports_external.number().optional(),
65238
65226
  opacity: exports_external.number().optional(),
65239
65227
  linkTo: exports_external.string().optional()
65240
65228
  });
@@ -65252,6 +65240,7 @@ class Drawing extends BaseItem {
65252
65240
  borderStyle = "solid";
65253
65241
  colorRole = "foreground";
65254
65242
  linePattern = scalePatterns(this.strokeWidth)[this.borderStyle];
65243
+ borderOpacity = 1;
65255
65244
  transformationRenderBlock = undefined;
65256
65245
  points = [];
65257
65246
  constructor(board, id = "") {
@@ -65270,7 +65259,8 @@ class Drawing extends BaseItem {
65270
65259
  points,
65271
65260
  strokeStyle: this.borderColor,
65272
65261
  strokeWidth: this.strokeWidth,
65273
- colorRole: this.colorRole
65262
+ colorRole: this.colorRole,
65263
+ borderOpacity: this.borderOpacity
65274
65264
  };
65275
65265
  }
65276
65266
  deserialize(data) {
@@ -65288,7 +65278,7 @@ class Drawing extends BaseItem {
65288
65278
  if (data.colorRole) {
65289
65279
  this.colorRole = data.colorRole;
65290
65280
  }
65291
- this.opacity = data.opacity ?? this.opacity;
65281
+ this.borderOpacity = data.borderOpacity ?? data.opacity ?? this.borderOpacity;
65292
65282
  this.updateVisuals({ method: "deserialize", class: this.itemType }, "FullRebuild" /* FullRebuild */);
65293
65283
  return this;
65294
65284
  }
@@ -65403,6 +65393,7 @@ class Drawing extends BaseItem {
65403
65393
  const ctx = context.ctx;
65404
65394
  ctx.save();
65405
65395
  ctx.strokeStyle = resolveColor(this.borderColor, conf.theme, this.colorRole);
65396
+ ctx.globalAlpha = this.borderOpacity;
65406
65397
  ctx.lineWidth = this.strokeWidth;
65407
65398
  ctx.lineCap = "round";
65408
65399
  ctx.setLineDash(this.linePattern);
@@ -65532,7 +65523,7 @@ class Drawing extends BaseItem {
65532
65523
  "borderColor",
65533
65524
  "strokeWidth",
65534
65525
  "borderStyle",
65535
- "opacity",
65526
+ "borderOpacity",
65536
65527
  "colorRole",
65537
65528
  "strokeStyle"
65538
65529
  ];
@@ -65542,7 +65533,7 @@ class Drawing extends BaseItem {
65542
65533
  return super.getPropertyUpdateHint(property);
65543
65534
  }
65544
65535
  getStrokeOpacity() {
65545
- return this.opacity;
65536
+ return this.borderOpacity;
65546
65537
  }
65547
65538
  getBorderStyle() {
65548
65539
  return this.borderStyle;
@@ -65588,7 +65579,7 @@ registerItem({
65588
65579
  itemType: "Drawing",
65589
65580
  points: [],
65590
65581
  borderColor: coerceColorValue("#000000"),
65591
- opacity: 1,
65582
+ borderOpacity: 1,
65592
65583
  borderStyle: "solid",
65593
65584
  strokeWidth: 2,
65594
65585
  transformation: new DefaultTransformationData
@@ -66610,7 +66601,7 @@ class ShapeTool extends CustomTool {
66610
66601
  }
66611
66602
  render(context) {
66612
66603
  if (this.isDown) {
66613
- this.item.renderWithOpacity(context);
66604
+ this.item.render(context);
66614
66605
  this.bounds.render(context);
66615
66606
  }
66616
66607
  }
@@ -71096,13 +71087,13 @@ function createCanvasDrawer(board) {
71096
71087
  if (container2) {
71097
71088
  context.ctx.save();
71098
71089
  container2.getNestingMatrix().applyToContext(context.ctx);
71099
- item.renderWithOpacity(context);
71090
+ item.render(context);
71100
71091
  context.ctx.restore();
71101
71092
  } else {
71102
- item.renderWithOpacity(context);
71093
+ item.render(context);
71103
71094
  }
71104
71095
  } else {
71105
- item.renderWithOpacity(context);
71096
+ item.render(context);
71106
71097
  }
71107
71098
  board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
71108
71099
  }
@@ -75570,7 +75561,7 @@ class AddHighlighter extends AddDrawing {
75570
75561
  }
75571
75562
  applyDrawingRole(drawing) {
75572
75563
  drawing.setColorRole("background");
75573
- drawing.apply(propertyOps.setProperty([drawing], "opacity", 0.5));
75564
+ drawing.apply(propertyOps.setProperty([drawing], "borderOpacity", 0.5));
75574
75565
  }
75575
75566
  updateSettings() {
75576
75567
  localStorage.setItem(conf.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
@@ -29,7 +29,6 @@ export interface BaseItemData {
29
29
  linkTo?: string;
30
30
  childIds?: string[];
31
31
  parent?: string;
32
- opacity?: number;
33
32
  [key: string]: unknown;
34
33
  }
35
34
  export type SerializedItemData<T extends BaseItemData = BaseItemData> = T & {
@@ -54,7 +53,6 @@ export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry
54
53
  shouldUseRelativeAlignment: boolean;
55
54
  resizeEnabled: boolean;
56
55
  onlyProportionalResize: boolean;
57
- opacity: number;
58
56
  itemType: ItemType;
59
57
  childIds: string[];
60
58
  isHoverHighlighted: boolean;
@@ -158,7 +156,6 @@ export declare class BaseItem<T extends BaseItem<any> = any> implements Geometry
158
156
  clearHighlightMbr(): void;
159
157
  renderHoverHighlight(context: DrawingContext): void;
160
158
  render(context: DrawingContext): void;
161
- renderWithOpacity(context: DrawingContext): void;
162
159
  getSnapAnchorPoints(): Point[];
163
160
  getPointOnEdge(point: Point, _edge?: string): Point;
164
161
  handleTransform(params: TransformParams): TransformResult;
@@ -23,6 +23,7 @@ export interface DrawingData {
23
23
  strokeStyle: ColorValue | string;
24
24
  strokeWidth: number;
25
25
  colorRole?: ColorRole;
26
+ borderOpacity?: number;
26
27
  opacity?: number;
27
28
  linkTo?: string;
28
29
  [key: string]: unknown;
@@ -39,6 +40,7 @@ export declare class Drawing extends BaseItem<Drawing> {
39
40
  borderStyle: BorderStyle;
40
41
  colorRole: ColorRole;
41
42
  private linePattern;
43
+ private borderOpacity;
42
44
  transformationRenderBlock?: boolean;
43
45
  points: Point[];
44
46
  constructor(board: Board, id?: string);
@@ -37,6 +37,7 @@ export declare const DrawingDataSchema: z.ZodObject<{
37
37
  background: "background";
38
38
  foreground: "foreground";
39
39
  }>>;
40
+ borderOpacity: z.ZodOptional<z.ZodNumber>;
40
41
  opacity: z.ZodOptional<z.ZodNumber>;
41
42
  linkTo: z.ZodOptional<z.ZodString>;
42
43
  }, z.core.$strip>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.14.28",
3
+ "version": "0.14.29",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",