microboard-temp 0.5.152 → 0.6.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.
@@ -21576,6 +21576,8 @@ class BaseItem extends Mbr {
21576
21576
  onlyProportionalResize = false;
21577
21577
  itemType = "";
21578
21578
  children = [];
21579
+ isHoverHighlighted = false;
21580
+ static HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
21579
21581
  constructor(board, id = "", defaultItemData, isGroupItem) {
21580
21582
  super();
21581
21583
  this.defaultItemData = defaultItemData;
@@ -21863,10 +21865,24 @@ class BaseItem extends Mbr {
21863
21865
  getPath() {
21864
21866
  return new Path(this.getMbr().getLines(), true);
21865
21867
  }
21868
+ highlightMbr() {
21869
+ this.isHoverHighlighted = true;
21870
+ this.subject.publish(this);
21871
+ }
21872
+ clearHighlightMbr() {
21873
+ this.isHoverHighlighted = false;
21874
+ this.subject.publish(this);
21875
+ }
21866
21876
  render(context) {
21867
21877
  if (this.index) {
21868
21878
  this.index.render(context);
21869
21879
  }
21880
+ if (this.isHoverHighlighted) {
21881
+ const mbr = this.getMbr();
21882
+ mbr.strokeWidth = 2 / context.matrix.scaleX;
21883
+ mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
21884
+ mbr.render(context);
21885
+ }
21870
21886
  }
21871
21887
  renderHTML(documentFactory) {
21872
21888
  const div = documentFactory.createElement("base-item");
package/dist/cjs/index.js CHANGED
@@ -21576,6 +21576,8 @@ class BaseItem extends Mbr {
21576
21576
  onlyProportionalResize = false;
21577
21577
  itemType = "";
21578
21578
  children = [];
21579
+ isHoverHighlighted = false;
21580
+ static HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
21579
21581
  constructor(board, id = "", defaultItemData, isGroupItem) {
21580
21582
  super();
21581
21583
  this.defaultItemData = defaultItemData;
@@ -21863,10 +21865,24 @@ class BaseItem extends Mbr {
21863
21865
  getPath() {
21864
21866
  return new Path(this.getMbr().getLines(), true);
21865
21867
  }
21868
+ highlightMbr() {
21869
+ this.isHoverHighlighted = true;
21870
+ this.subject.publish(this);
21871
+ }
21872
+ clearHighlightMbr() {
21873
+ this.isHoverHighlighted = false;
21874
+ this.subject.publish(this);
21875
+ }
21866
21876
  render(context) {
21867
21877
  if (this.index) {
21868
21878
  this.index.render(context);
21869
21879
  }
21880
+ if (this.isHoverHighlighted) {
21881
+ const mbr = this.getMbr();
21882
+ mbr.strokeWidth = 2 / context.matrix.scaleX;
21883
+ mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
21884
+ mbr.render(context);
21885
+ }
21870
21886
  }
21871
21887
  renderHTML(documentFactory) {
21872
21888
  const div = documentFactory.createElement("base-item");
package/dist/cjs/node.js CHANGED
@@ -24048,6 +24048,8 @@ class BaseItem extends Mbr {
24048
24048
  onlyProportionalResize = false;
24049
24049
  itemType = "";
24050
24050
  children = [];
24051
+ isHoverHighlighted = false;
24052
+ static HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
24051
24053
  constructor(board, id = "", defaultItemData, isGroupItem) {
24052
24054
  super();
24053
24055
  this.defaultItemData = defaultItemData;
@@ -24335,10 +24337,24 @@ class BaseItem extends Mbr {
24335
24337
  getPath() {
24336
24338
  return new Path(this.getMbr().getLines(), true);
24337
24339
  }
24340
+ highlightMbr() {
24341
+ this.isHoverHighlighted = true;
24342
+ this.subject.publish(this);
24343
+ }
24344
+ clearHighlightMbr() {
24345
+ this.isHoverHighlighted = false;
24346
+ this.subject.publish(this);
24347
+ }
24338
24348
  render(context) {
24339
24349
  if (this.index) {
24340
24350
  this.index.render(context);
24341
24351
  }
24352
+ if (this.isHoverHighlighted) {
24353
+ const mbr = this.getMbr();
24354
+ mbr.strokeWidth = 2 / context.matrix.scaleX;
24355
+ mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
24356
+ mbr.render(context);
24357
+ }
24342
24358
  }
24343
24359
  renderHTML(documentFactory) {
24344
24360
  const div = documentFactory.createElement("base-item");
@@ -21419,6 +21419,8 @@ class BaseItem extends Mbr {
21419
21419
  onlyProportionalResize = false;
21420
21420
  itemType = "";
21421
21421
  children = [];
21422
+ isHoverHighlighted = false;
21423
+ static HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
21422
21424
  constructor(board, id = "", defaultItemData, isGroupItem) {
21423
21425
  super();
21424
21426
  this.defaultItemData = defaultItemData;
@@ -21706,10 +21708,24 @@ class BaseItem extends Mbr {
21706
21708
  getPath() {
21707
21709
  return new Path(this.getMbr().getLines(), true);
21708
21710
  }
21711
+ highlightMbr() {
21712
+ this.isHoverHighlighted = true;
21713
+ this.subject.publish(this);
21714
+ }
21715
+ clearHighlightMbr() {
21716
+ this.isHoverHighlighted = false;
21717
+ this.subject.publish(this);
21718
+ }
21709
21719
  render(context) {
21710
21720
  if (this.index) {
21711
21721
  this.index.render(context);
21712
21722
  }
21723
+ if (this.isHoverHighlighted) {
21724
+ const mbr = this.getMbr();
21725
+ mbr.strokeWidth = 2 / context.matrix.scaleX;
21726
+ mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
21727
+ mbr.render(context);
21728
+ }
21713
21729
  }
21714
21730
  renderHTML(documentFactory) {
21715
21731
  const div = documentFactory.createElement("base-item");
package/dist/esm/index.js CHANGED
@@ -21412,6 +21412,8 @@ class BaseItem extends Mbr {
21412
21412
  onlyProportionalResize = false;
21413
21413
  itemType = "";
21414
21414
  children = [];
21415
+ isHoverHighlighted = false;
21416
+ static HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
21415
21417
  constructor(board, id = "", defaultItemData, isGroupItem) {
21416
21418
  super();
21417
21419
  this.defaultItemData = defaultItemData;
@@ -21699,10 +21701,24 @@ class BaseItem extends Mbr {
21699
21701
  getPath() {
21700
21702
  return new Path(this.getMbr().getLines(), true);
21701
21703
  }
21704
+ highlightMbr() {
21705
+ this.isHoverHighlighted = true;
21706
+ this.subject.publish(this);
21707
+ }
21708
+ clearHighlightMbr() {
21709
+ this.isHoverHighlighted = false;
21710
+ this.subject.publish(this);
21711
+ }
21702
21712
  render(context) {
21703
21713
  if (this.index) {
21704
21714
  this.index.render(context);
21705
21715
  }
21716
+ if (this.isHoverHighlighted) {
21717
+ const mbr = this.getMbr();
21718
+ mbr.strokeWidth = 2 / context.matrix.scaleX;
21719
+ mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
21720
+ mbr.render(context);
21721
+ }
21706
21722
  }
21707
21723
  renderHTML(documentFactory) {
21708
21724
  const div = documentFactory.createElement("base-item");
package/dist/esm/node.js CHANGED
@@ -23879,6 +23879,8 @@ class BaseItem extends Mbr {
23879
23879
  onlyProportionalResize = false;
23880
23880
  itemType = "";
23881
23881
  children = [];
23882
+ isHoverHighlighted = false;
23883
+ static HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
23882
23884
  constructor(board, id = "", defaultItemData, isGroupItem) {
23883
23885
  super();
23884
23886
  this.defaultItemData = defaultItemData;
@@ -24166,10 +24168,24 @@ class BaseItem extends Mbr {
24166
24168
  getPath() {
24167
24169
  return new Path(this.getMbr().getLines(), true);
24168
24170
  }
24171
+ highlightMbr() {
24172
+ this.isHoverHighlighted = true;
24173
+ this.subject.publish(this);
24174
+ }
24175
+ clearHighlightMbr() {
24176
+ this.isHoverHighlighted = false;
24177
+ this.subject.publish(this);
24178
+ }
24169
24179
  render(context) {
24170
24180
  if (this.index) {
24171
24181
  this.index.render(context);
24172
24182
  }
24183
+ if (this.isHoverHighlighted) {
24184
+ const mbr = this.getMbr();
24185
+ mbr.strokeWidth = 2 / context.matrix.scaleX;
24186
+ mbr.borderColor = BaseItem.HOVER_HIGHLIGHT_COLOR;
24187
+ mbr.render(context);
24188
+ }
24173
24189
  }
24174
24190
  renderHTML(documentFactory) {
24175
24191
  const div = documentFactory.createElement("base-item");
@@ -41,6 +41,8 @@ export declare class BaseItem extends Mbr implements Geometry {
41
41
  onlyProportionalResize: boolean;
42
42
  itemType: string;
43
43
  children: string[];
44
+ isHoverHighlighted: boolean;
45
+ static readonly HOVER_HIGHLIGHT_COLOR = "rgba(71, 120, 245, 0.7)";
44
46
  constructor(board: Board, id?: string, defaultItemData?: BaseItemData | undefined, isGroupItem?: boolean);
45
47
  updateChildrenIds(): void;
46
48
  getId(): string;
@@ -77,6 +79,8 @@ export declare class BaseItem extends Mbr implements Geometry {
77
79
  isEnclosedOrCrossedBy(rect: Mbr): boolean;
78
80
  getMbrWithChildren(): Mbr;
79
81
  getPath(): Path | Paths;
82
+ highlightMbr(): void;
83
+ clearHighlightMbr(): void;
80
84
  render(context: DrawingContext): void;
81
85
  renderHTML(documentFactory: DocumentFactory): HTMLElement;
82
86
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.5.152",
3
+ "version": "0.6.0",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",