microboard-temp 0.5.113 → 0.5.114

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.
@@ -42207,6 +42207,7 @@ class ImageItem extends BaseItem {
42207
42207
  beforeLoadCallbacks = [];
42208
42208
  transformationRenderBlock = undefined;
42209
42209
  storageLink;
42210
+ signedUrl = "";
42210
42211
  imageDimension;
42211
42212
  board;
42212
42213
  constructor({ base64, storageLink, imageDimension }, board, events, id = "") {
@@ -42230,8 +42231,10 @@ class ImageItem extends BaseItem {
42230
42231
  });
42231
42232
  this.transformation.subject.subscribe(this.onTransform);
42232
42233
  }
42233
- setStorageLink(link2) {
42234
+ async setStorageLink(link2) {
42234
42235
  this.storageLink = link2;
42236
+ this.signedUrl = await getMediaSignedUrl(link2, this.board.getAccount()?.accessToken() || null) || "";
42237
+ this.image.src = this.signedUrl;
42235
42238
  }
42236
42239
  getStorageId() {
42237
42240
  return this.storageLink.split("/").pop();
@@ -42341,7 +42344,6 @@ class ImageItem extends BaseItem {
42341
42344
  this.onLoad();
42342
42345
  };
42343
42346
  storageImage.onerror = this.onError;
42344
- storageImage.src = this.storageLink;
42345
42347
  return this;
42346
42348
  }
42347
42349
  emit(operation) {
@@ -42453,7 +42455,7 @@ class ImageItem extends BaseItem {
42453
42455
  }
42454
42456
  download() {
42455
42457
  const linkElem = document.createElement("a");
42456
- linkElem.href = this.storageLink;
42458
+ linkElem.href = this.signedUrl;
42457
42459
  linkElem.setAttribute("download", "");
42458
42460
  linkElem.click();
42459
42461
  }
@@ -53743,6 +53745,7 @@ class Board {
53743
53745
  boardId;
53744
53746
  accessKey;
53745
53747
  saveEditingFile;
53748
+ account;
53746
53749
  events;
53747
53750
  isBoardMenuOpen = false;
53748
53751
  selection;
@@ -53765,10 +53768,11 @@ class Board {
53765
53768
  connecting = new Promise((resolve2) => {
53766
53769
  this.resolveConnecting = resolve2;
53767
53770
  });
53768
- constructor(boardId = "", accessKey, saveEditingFile) {
53771
+ constructor(boardId = "", accessKey, saveEditingFile, account) {
53769
53772
  this.boardId = boardId;
53770
53773
  this.accessKey = accessKey;
53771
53774
  this.saveEditingFile = saveEditingFile;
53775
+ this.account = account;
53772
53776
  this.selection = new BoardSelection(this);
53773
53777
  this.presence = new Presence(this);
53774
53778
  this.tools.navigate();
@@ -53780,6 +53784,9 @@ class Board {
53780
53784
  this.items = this.index.items;
53781
53785
  this.presence.events = this.events;
53782
53786
  }
53787
+ getAccount() {
53788
+ return this.account || null;
53789
+ }
53783
53790
  getNewItemId() {
53784
53791
  return v4_default();
53785
53792
  }
package/dist/cjs/index.js CHANGED
@@ -42207,6 +42207,7 @@ class ImageItem extends BaseItem {
42207
42207
  beforeLoadCallbacks = [];
42208
42208
  transformationRenderBlock = undefined;
42209
42209
  storageLink;
42210
+ signedUrl = "";
42210
42211
  imageDimension;
42211
42212
  board;
42212
42213
  constructor({ base64, storageLink, imageDimension }, board, events, id = "") {
@@ -42230,8 +42231,10 @@ class ImageItem extends BaseItem {
42230
42231
  });
42231
42232
  this.transformation.subject.subscribe(this.onTransform);
42232
42233
  }
42233
- setStorageLink(link2) {
42234
+ async setStorageLink(link2) {
42234
42235
  this.storageLink = link2;
42236
+ this.signedUrl = await getMediaSignedUrl(link2, this.board.getAccount()?.accessToken() || null) || "";
42237
+ this.image.src = this.signedUrl;
42235
42238
  }
42236
42239
  getStorageId() {
42237
42240
  return this.storageLink.split("/").pop();
@@ -42341,7 +42344,6 @@ class ImageItem extends BaseItem {
42341
42344
  this.onLoad();
42342
42345
  };
42343
42346
  storageImage.onerror = this.onError;
42344
- storageImage.src = this.storageLink;
42345
42347
  return this;
42346
42348
  }
42347
42349
  emit(operation) {
@@ -42453,7 +42455,7 @@ class ImageItem extends BaseItem {
42453
42455
  }
42454
42456
  download() {
42455
42457
  const linkElem = document.createElement("a");
42456
- linkElem.href = this.storageLink;
42458
+ linkElem.href = this.signedUrl;
42457
42459
  linkElem.setAttribute("download", "");
42458
42460
  linkElem.click();
42459
42461
  }
@@ -53743,6 +53745,7 @@ class Board {
53743
53745
  boardId;
53744
53746
  accessKey;
53745
53747
  saveEditingFile;
53748
+ account;
53746
53749
  events;
53747
53750
  isBoardMenuOpen = false;
53748
53751
  selection;
@@ -53765,10 +53768,11 @@ class Board {
53765
53768
  connecting = new Promise((resolve2) => {
53766
53769
  this.resolveConnecting = resolve2;
53767
53770
  });
53768
- constructor(boardId = "", accessKey, saveEditingFile) {
53771
+ constructor(boardId = "", accessKey, saveEditingFile, account) {
53769
53772
  this.boardId = boardId;
53770
53773
  this.accessKey = accessKey;
53771
53774
  this.saveEditingFile = saveEditingFile;
53775
+ this.account = account;
53772
53776
  this.selection = new BoardSelection(this);
53773
53777
  this.presence = new Presence(this);
53774
53778
  this.tools.navigate();
@@ -53780,6 +53784,9 @@ class Board {
53780
53784
  this.items = this.index.items;
53781
53785
  this.presence.events = this.events;
53782
53786
  }
53787
+ getAccount() {
53788
+ return this.account || null;
53789
+ }
53783
53790
  getNewItemId() {
53784
53791
  return v4_default();
53785
53792
  }
package/dist/cjs/node.js CHANGED
@@ -44680,6 +44680,7 @@ class ImageItem extends BaseItem {
44680
44680
  beforeLoadCallbacks = [];
44681
44681
  transformationRenderBlock = undefined;
44682
44682
  storageLink;
44683
+ signedUrl = "";
44683
44684
  imageDimension;
44684
44685
  board;
44685
44686
  constructor({ base64, storageLink, imageDimension }, board, events, id = "") {
@@ -44703,8 +44704,10 @@ class ImageItem extends BaseItem {
44703
44704
  });
44704
44705
  this.transformation.subject.subscribe(this.onTransform);
44705
44706
  }
44706
- setStorageLink(link2) {
44707
+ async setStorageLink(link2) {
44707
44708
  this.storageLink = link2;
44709
+ this.signedUrl = await getMediaSignedUrl(link2, this.board.getAccount()?.accessToken() || null) || "";
44710
+ this.image.src = this.signedUrl;
44708
44711
  }
44709
44712
  getStorageId() {
44710
44713
  return this.storageLink.split("/").pop();
@@ -44814,7 +44817,6 @@ class ImageItem extends BaseItem {
44814
44817
  this.onLoad();
44815
44818
  };
44816
44819
  storageImage.onerror = this.onError;
44817
- storageImage.src = this.storageLink;
44818
44820
  return this;
44819
44821
  }
44820
44822
  emit(operation) {
@@ -44926,7 +44928,7 @@ class ImageItem extends BaseItem {
44926
44928
  }
44927
44929
  download() {
44928
44930
  const linkElem = document.createElement("a");
44929
- linkElem.href = this.storageLink;
44931
+ linkElem.href = this.signedUrl;
44930
44932
  linkElem.setAttribute("download", "");
44931
44933
  linkElem.click();
44932
44934
  }
@@ -56216,6 +56218,7 @@ class Board {
56216
56218
  boardId;
56217
56219
  accessKey;
56218
56220
  saveEditingFile;
56221
+ account;
56219
56222
  events;
56220
56223
  isBoardMenuOpen = false;
56221
56224
  selection;
@@ -56238,10 +56241,11 @@ class Board {
56238
56241
  connecting = new Promise((resolve2) => {
56239
56242
  this.resolveConnecting = resolve2;
56240
56243
  });
56241
- constructor(boardId = "", accessKey, saveEditingFile) {
56244
+ constructor(boardId = "", accessKey, saveEditingFile, account) {
56242
56245
  this.boardId = boardId;
56243
56246
  this.accessKey = accessKey;
56244
56247
  this.saveEditingFile = saveEditingFile;
56248
+ this.account = account;
56245
56249
  this.selection = new BoardSelection(this);
56246
56250
  this.presence = new Presence(this);
56247
56251
  this.tools.navigate();
@@ -56253,6 +56257,9 @@ class Board {
56253
56257
  this.items = this.index.items;
56254
56258
  this.presence.events = this.events;
56255
56259
  }
56260
+ getAccount() {
56261
+ return this.account || null;
56262
+ }
56256
56263
  getNewItemId() {
56257
56264
  return v4_default();
56258
56265
  }
@@ -42051,6 +42051,7 @@ class ImageItem extends BaseItem {
42051
42051
  beforeLoadCallbacks = [];
42052
42052
  transformationRenderBlock = undefined;
42053
42053
  storageLink;
42054
+ signedUrl = "";
42054
42055
  imageDimension;
42055
42056
  board;
42056
42057
  constructor({ base64, storageLink, imageDimension }, board, events, id = "") {
@@ -42074,8 +42075,10 @@ class ImageItem extends BaseItem {
42074
42075
  });
42075
42076
  this.transformation.subject.subscribe(this.onTransform);
42076
42077
  }
42077
- setStorageLink(link2) {
42078
+ async setStorageLink(link2) {
42078
42079
  this.storageLink = link2;
42080
+ this.signedUrl = await getMediaSignedUrl(link2, this.board.getAccount()?.accessToken() || null) || "";
42081
+ this.image.src = this.signedUrl;
42079
42082
  }
42080
42083
  getStorageId() {
42081
42084
  return this.storageLink.split("/").pop();
@@ -42185,7 +42188,6 @@ class ImageItem extends BaseItem {
42185
42188
  this.onLoad();
42186
42189
  };
42187
42190
  storageImage.onerror = this.onError;
42188
- storageImage.src = this.storageLink;
42189
42191
  return this;
42190
42192
  }
42191
42193
  emit(operation) {
@@ -42297,7 +42299,7 @@ class ImageItem extends BaseItem {
42297
42299
  }
42298
42300
  download() {
42299
42301
  const linkElem = document.createElement("a");
42300
- linkElem.href = this.storageLink;
42302
+ linkElem.href = this.signedUrl;
42301
42303
  linkElem.setAttribute("download", "");
42302
42304
  linkElem.click();
42303
42305
  }
@@ -53587,6 +53589,7 @@ class Board {
53587
53589
  boardId;
53588
53590
  accessKey;
53589
53591
  saveEditingFile;
53592
+ account;
53590
53593
  events;
53591
53594
  isBoardMenuOpen = false;
53592
53595
  selection;
@@ -53609,10 +53612,11 @@ class Board {
53609
53612
  connecting = new Promise((resolve2) => {
53610
53613
  this.resolveConnecting = resolve2;
53611
53614
  });
53612
- constructor(boardId = "", accessKey, saveEditingFile) {
53615
+ constructor(boardId = "", accessKey, saveEditingFile, account) {
53613
53616
  this.boardId = boardId;
53614
53617
  this.accessKey = accessKey;
53615
53618
  this.saveEditingFile = saveEditingFile;
53619
+ this.account = account;
53616
53620
  this.selection = new BoardSelection(this);
53617
53621
  this.presence = new Presence(this);
53618
53622
  this.tools.navigate();
@@ -53624,6 +53628,9 @@ class Board {
53624
53628
  this.items = this.index.items;
53625
53629
  this.presence.events = this.events;
53626
53630
  }
53631
+ getAccount() {
53632
+ return this.account || null;
53633
+ }
53627
53634
  getNewItemId() {
53628
53635
  return v4_default();
53629
53636
  }
package/dist/esm/index.js CHANGED
@@ -42044,6 +42044,7 @@ class ImageItem extends BaseItem {
42044
42044
  beforeLoadCallbacks = [];
42045
42045
  transformationRenderBlock = undefined;
42046
42046
  storageLink;
42047
+ signedUrl = "";
42047
42048
  imageDimension;
42048
42049
  board;
42049
42050
  constructor({ base64, storageLink, imageDimension }, board, events, id = "") {
@@ -42067,8 +42068,10 @@ class ImageItem extends BaseItem {
42067
42068
  });
42068
42069
  this.transformation.subject.subscribe(this.onTransform);
42069
42070
  }
42070
- setStorageLink(link2) {
42071
+ async setStorageLink(link2) {
42071
42072
  this.storageLink = link2;
42073
+ this.signedUrl = await getMediaSignedUrl(link2, this.board.getAccount()?.accessToken() || null) || "";
42074
+ this.image.src = this.signedUrl;
42072
42075
  }
42073
42076
  getStorageId() {
42074
42077
  return this.storageLink.split("/").pop();
@@ -42178,7 +42181,6 @@ class ImageItem extends BaseItem {
42178
42181
  this.onLoad();
42179
42182
  };
42180
42183
  storageImage.onerror = this.onError;
42181
- storageImage.src = this.storageLink;
42182
42184
  return this;
42183
42185
  }
42184
42186
  emit(operation) {
@@ -42290,7 +42292,7 @@ class ImageItem extends BaseItem {
42290
42292
  }
42291
42293
  download() {
42292
42294
  const linkElem = document.createElement("a");
42293
- linkElem.href = this.storageLink;
42295
+ linkElem.href = this.signedUrl;
42294
42296
  linkElem.setAttribute("download", "");
42295
42297
  linkElem.click();
42296
42298
  }
@@ -53580,6 +53582,7 @@ class Board {
53580
53582
  boardId;
53581
53583
  accessKey;
53582
53584
  saveEditingFile;
53585
+ account;
53583
53586
  events;
53584
53587
  isBoardMenuOpen = false;
53585
53588
  selection;
@@ -53602,10 +53605,11 @@ class Board {
53602
53605
  connecting = new Promise((resolve2) => {
53603
53606
  this.resolveConnecting = resolve2;
53604
53607
  });
53605
- constructor(boardId = "", accessKey, saveEditingFile) {
53608
+ constructor(boardId = "", accessKey, saveEditingFile, account) {
53606
53609
  this.boardId = boardId;
53607
53610
  this.accessKey = accessKey;
53608
53611
  this.saveEditingFile = saveEditingFile;
53612
+ this.account = account;
53609
53613
  this.selection = new BoardSelection(this);
53610
53614
  this.presence = new Presence(this);
53611
53615
  this.tools.navigate();
@@ -53617,6 +53621,9 @@ class Board {
53617
53621
  this.items = this.index.items;
53618
53622
  this.presence.events = this.events;
53619
53623
  }
53624
+ getAccount() {
53625
+ return this.account || null;
53626
+ }
53620
53627
  getNewItemId() {
53621
53628
  return v4_default();
53622
53629
  }
package/dist/esm/node.js CHANGED
@@ -44512,6 +44512,7 @@ class ImageItem extends BaseItem {
44512
44512
  beforeLoadCallbacks = [];
44513
44513
  transformationRenderBlock = undefined;
44514
44514
  storageLink;
44515
+ signedUrl = "";
44515
44516
  imageDimension;
44516
44517
  board;
44517
44518
  constructor({ base64, storageLink, imageDimension }, board, events, id = "") {
@@ -44535,8 +44536,10 @@ class ImageItem extends BaseItem {
44535
44536
  });
44536
44537
  this.transformation.subject.subscribe(this.onTransform);
44537
44538
  }
44538
- setStorageLink(link2) {
44539
+ async setStorageLink(link2) {
44539
44540
  this.storageLink = link2;
44541
+ this.signedUrl = await getMediaSignedUrl(link2, this.board.getAccount()?.accessToken() || null) || "";
44542
+ this.image.src = this.signedUrl;
44540
44543
  }
44541
44544
  getStorageId() {
44542
44545
  return this.storageLink.split("/").pop();
@@ -44646,7 +44649,6 @@ class ImageItem extends BaseItem {
44646
44649
  this.onLoad();
44647
44650
  };
44648
44651
  storageImage.onerror = this.onError;
44649
- storageImage.src = this.storageLink;
44650
44652
  return this;
44651
44653
  }
44652
44654
  emit(operation) {
@@ -44758,7 +44760,7 @@ class ImageItem extends BaseItem {
44758
44760
  }
44759
44761
  download() {
44760
44762
  const linkElem = document.createElement("a");
44761
- linkElem.href = this.storageLink;
44763
+ linkElem.href = this.signedUrl;
44762
44764
  linkElem.setAttribute("download", "");
44763
44765
  linkElem.click();
44764
44766
  }
@@ -56048,6 +56050,7 @@ class Board {
56048
56050
  boardId;
56049
56051
  accessKey;
56050
56052
  saveEditingFile;
56053
+ account;
56051
56054
  events;
56052
56055
  isBoardMenuOpen = false;
56053
56056
  selection;
@@ -56070,10 +56073,11 @@ class Board {
56070
56073
  connecting = new Promise((resolve2) => {
56071
56074
  this.resolveConnecting = resolve2;
56072
56075
  });
56073
- constructor(boardId = "", accessKey, saveEditingFile) {
56076
+ constructor(boardId = "", accessKey, saveEditingFile, account) {
56074
56077
  this.boardId = boardId;
56075
56078
  this.accessKey = accessKey;
56076
56079
  this.saveEditingFile = saveEditingFile;
56080
+ this.account = account;
56077
56081
  this.selection = new BoardSelection(this);
56078
56082
  this.presence = new Presence(this);
56079
56083
  this.tools.navigate();
@@ -56085,6 +56089,9 @@ class Board {
56085
56089
  this.items = this.index.items;
56086
56090
  this.presence.events = this.events;
56087
56091
  }
56092
+ getAccount() {
56093
+ return this.account || null;
56094
+ }
56088
56095
  getNewItemId() {
56089
56096
  return v4_default();
56090
56097
  }
@@ -16,11 +16,13 @@ import { Subject } from "./Subject";
16
16
  import { Tools } from "./Tools";
17
17
  import { ItemsMap } from "./Validators";
18
18
  import { ItemDataWithId } from "./Items/Item";
19
+ import { Account } from "./types/Account";
19
20
  export type InterfaceType = "edit" | "view" | "loading";
20
21
  export declare class Board {
21
22
  private boardId;
22
23
  private accessKey?;
23
24
  saveEditingFile?: (() => Promise<void>) | undefined;
25
+ private account?;
24
26
  events: Events;
25
27
  private isBoardMenuOpen;
26
28
  readonly selection: BoardSelection;
@@ -41,11 +43,12 @@ export declare class Board {
41
43
  private isOpen;
42
44
  resolveConnecting: () => void;
43
45
  connecting: Promise<void>;
44
- constructor(boardId?: string, accessKey?: string | undefined, saveEditingFile?: (() => Promise<void>) | undefined);
46
+ constructor(boardId?: string, accessKey?: string | undefined, saveEditingFile?: (() => Promise<void>) | undefined, account?: Account | undefined);
45
47
  /**
46
48
  * Disconnects from the connection and sets the board mode to "loading"
47
49
  */
48
50
  disconnect(): void;
51
+ getAccount(): Account | null;
49
52
  getNewItemId(): string;
50
53
  emit(operation: BoardOps): void;
51
54
  getBoardId(): string;
@@ -39,10 +39,11 @@ export declare class ImageItem extends BaseItem {
39
39
  beforeLoadCallbacks: ((image: ImageItem) => void)[];
40
40
  transformationRenderBlock?: boolean;
41
41
  private storageLink;
42
+ private signedUrl;
42
43
  imageDimension: Dimension;
43
44
  board: Board;
44
45
  constructor({ base64, storageLink, imageDimension }: ImageConstructorData, board: Board, events?: Events | undefined, id?: string);
45
- setStorageLink(link: string): void;
46
+ setStorageLink(link: string): Promise<void>;
46
47
  getStorageId(): string | undefined;
47
48
  handleError: () => void;
48
49
  onLoad: () => Promise<void>;
@@ -0,0 +1,16 @@
1
+ import { Subject } from "../Subject";
2
+ type AccountInfo = {
3
+ id: number;
4
+ email?: string;
5
+ address?: string;
6
+ name: string;
7
+ avatar: string;
8
+ avatarGenerated: boolean;
9
+ newsletter: boolean;
10
+ };
11
+ export interface Account {
12
+ accessToken: () => string | null;
13
+ subject: Subject<AccountInfo | null>;
14
+ info: null | AccountInfo;
15
+ }
16
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.5.113",
3
+ "version": "0.5.114",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",