microboard-temp 0.4.11 → 0.4.13
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.
- package/dist/cjs/browser.js +18 -12
- package/dist/cjs/index.js +18 -12
- package/dist/cjs/node.js +18 -12
- package/dist/esm/browser.js +18 -12
- package/dist/esm/index.js +18 -12
- package/dist/esm/node.js +18 -12
- package/dist/types/Items/Examples/CardGame/Card/Card.d.ts +7 -3
- package/dist/types/Settings.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -6743,6 +6743,7 @@ var conf = {
|
|
|
6743
6743
|
beforeMediaRemove: async (...args) => false,
|
|
6744
6744
|
onUploadMediaError: async (...args) => false
|
|
6745
6745
|
},
|
|
6746
|
+
getAccessToken: () => null,
|
|
6746
6747
|
openModal: () => {},
|
|
6747
6748
|
notify: () => "",
|
|
6748
6749
|
disMissNotification: () => {},
|
|
@@ -45930,25 +45931,30 @@ function throttle(func, delay) {
|
|
|
45930
45931
|
var defaultCardData = {
|
|
45931
45932
|
itemType: "Card",
|
|
45932
45933
|
isOpen: false,
|
|
45933
|
-
|
|
45934
|
+
faceUrl: "",
|
|
45935
|
+
backsideUrl: "",
|
|
45934
45936
|
isInDeck: false
|
|
45935
45937
|
};
|
|
45936
45938
|
var CARD_DIMENSIONS = { width: 250, height: 400 };
|
|
45937
45939
|
|
|
45938
45940
|
class Card extends BaseItem {
|
|
45939
45941
|
subject = new Subject;
|
|
45940
|
-
|
|
45942
|
+
faceUrl = "";
|
|
45943
|
+
backsideUrl = "";
|
|
45941
45944
|
isOpen = false;
|
|
45942
45945
|
isInDeck = false;
|
|
45943
45946
|
throttledBringToFront;
|
|
45944
|
-
|
|
45947
|
+
face = null;
|
|
45945
45948
|
backside = null;
|
|
45946
45949
|
imageToRender = null;
|
|
45947
45950
|
shouldUseCustomRender = false;
|
|
45948
|
-
constructor(board, id = "",
|
|
45951
|
+
constructor(board, id = "", urls) {
|
|
45949
45952
|
super(board, id, defaultCardData);
|
|
45950
|
-
|
|
45951
|
-
|
|
45953
|
+
if (urls) {
|
|
45954
|
+
this.faceUrl = urls.faceUrl;
|
|
45955
|
+
this.backsideUrl = urls.backsideUrl;
|
|
45956
|
+
this.createImages();
|
|
45957
|
+
}
|
|
45952
45958
|
this.throttledBringToFront = throttle(() => {
|
|
45953
45959
|
this.board.bringToFront(this);
|
|
45954
45960
|
}, 1000);
|
|
@@ -45961,11 +45967,11 @@ class Card extends BaseItem {
|
|
|
45961
45967
|
this.updateMbr();
|
|
45962
45968
|
}
|
|
45963
45969
|
createImages() {
|
|
45964
|
-
this.
|
|
45970
|
+
this.face = conf.documentFactory.createElement("img");
|
|
45965
45971
|
this.backside = conf.documentFactory.createElement("img");
|
|
45966
|
-
this.
|
|
45967
|
-
this.backside.src =
|
|
45968
|
-
this.
|
|
45972
|
+
this.face.src = this.faceUrl;
|
|
45973
|
+
this.backside.src = this.backsideUrl;
|
|
45974
|
+
this.face.onload = () => {
|
|
45969
45975
|
this.subject.publish(this);
|
|
45970
45976
|
};
|
|
45971
45977
|
this.backside.onload = () => {
|
|
@@ -45984,7 +45990,7 @@ class Card extends BaseItem {
|
|
|
45984
45990
|
updateImageToRender() {
|
|
45985
45991
|
this.imageToRender = this.backside;
|
|
45986
45992
|
if (this.isOpen) {
|
|
45987
|
-
this.imageToRender = this.
|
|
45993
|
+
this.imageToRender = this.face;
|
|
45988
45994
|
}
|
|
45989
45995
|
}
|
|
45990
45996
|
render(context, deckRenderData) {
|
|
@@ -55782,7 +55788,7 @@ function handleAudioGenerate(response, board) {
|
|
|
55782
55788
|
}
|
|
55783
55789
|
function handleImageGenerate(response, board) {
|
|
55784
55790
|
if (response.status === "completed" && response.base64) {
|
|
55785
|
-
prepareImage(response.base64,
|
|
55791
|
+
prepareImage(response.base64, conf.getAccessToken(), board.getBoardId()).then((imageData) => {
|
|
55786
55792
|
const placeholderId = board.aiImagePlaceholder?.getId();
|
|
55787
55793
|
if (placeholderId) {
|
|
55788
55794
|
const placeholderNode = board.items.getById(placeholderId);
|
package/dist/cjs/index.js
CHANGED
|
@@ -6743,6 +6743,7 @@ var conf = {
|
|
|
6743
6743
|
beforeMediaRemove: async (...args) => false,
|
|
6744
6744
|
onUploadMediaError: async (...args) => false
|
|
6745
6745
|
},
|
|
6746
|
+
getAccessToken: () => null,
|
|
6746
6747
|
openModal: () => {},
|
|
6747
6748
|
notify: () => "",
|
|
6748
6749
|
disMissNotification: () => {},
|
|
@@ -45930,25 +45931,30 @@ function throttle(func, delay) {
|
|
|
45930
45931
|
var defaultCardData = {
|
|
45931
45932
|
itemType: "Card",
|
|
45932
45933
|
isOpen: false,
|
|
45933
|
-
|
|
45934
|
+
faceUrl: "",
|
|
45935
|
+
backsideUrl: "",
|
|
45934
45936
|
isInDeck: false
|
|
45935
45937
|
};
|
|
45936
45938
|
var CARD_DIMENSIONS = { width: 250, height: 400 };
|
|
45937
45939
|
|
|
45938
45940
|
class Card extends BaseItem {
|
|
45939
45941
|
subject = new Subject;
|
|
45940
|
-
|
|
45942
|
+
faceUrl = "";
|
|
45943
|
+
backsideUrl = "";
|
|
45941
45944
|
isOpen = false;
|
|
45942
45945
|
isInDeck = false;
|
|
45943
45946
|
throttledBringToFront;
|
|
45944
|
-
|
|
45947
|
+
face = null;
|
|
45945
45948
|
backside = null;
|
|
45946
45949
|
imageToRender = null;
|
|
45947
45950
|
shouldUseCustomRender = false;
|
|
45948
|
-
constructor(board, id = "",
|
|
45951
|
+
constructor(board, id = "", urls) {
|
|
45949
45952
|
super(board, id, defaultCardData);
|
|
45950
|
-
|
|
45951
|
-
|
|
45953
|
+
if (urls) {
|
|
45954
|
+
this.faceUrl = urls.faceUrl;
|
|
45955
|
+
this.backsideUrl = urls.backsideUrl;
|
|
45956
|
+
this.createImages();
|
|
45957
|
+
}
|
|
45952
45958
|
this.throttledBringToFront = throttle(() => {
|
|
45953
45959
|
this.board.bringToFront(this);
|
|
45954
45960
|
}, 1000);
|
|
@@ -45961,11 +45967,11 @@ class Card extends BaseItem {
|
|
|
45961
45967
|
this.updateMbr();
|
|
45962
45968
|
}
|
|
45963
45969
|
createImages() {
|
|
45964
|
-
this.
|
|
45970
|
+
this.face = conf.documentFactory.createElement("img");
|
|
45965
45971
|
this.backside = conf.documentFactory.createElement("img");
|
|
45966
|
-
this.
|
|
45967
|
-
this.backside.src =
|
|
45968
|
-
this.
|
|
45972
|
+
this.face.src = this.faceUrl;
|
|
45973
|
+
this.backside.src = this.backsideUrl;
|
|
45974
|
+
this.face.onload = () => {
|
|
45969
45975
|
this.subject.publish(this);
|
|
45970
45976
|
};
|
|
45971
45977
|
this.backside.onload = () => {
|
|
@@ -45984,7 +45990,7 @@ class Card extends BaseItem {
|
|
|
45984
45990
|
updateImageToRender() {
|
|
45985
45991
|
this.imageToRender = this.backside;
|
|
45986
45992
|
if (this.isOpen) {
|
|
45987
|
-
this.imageToRender = this.
|
|
45993
|
+
this.imageToRender = this.face;
|
|
45988
45994
|
}
|
|
45989
45995
|
}
|
|
45990
45996
|
render(context, deckRenderData) {
|
|
@@ -55782,7 +55788,7 @@ function handleAudioGenerate(response, board) {
|
|
|
55782
55788
|
}
|
|
55783
55789
|
function handleImageGenerate(response, board) {
|
|
55784
55790
|
if (response.status === "completed" && response.base64) {
|
|
55785
|
-
prepareImage(response.base64,
|
|
55791
|
+
prepareImage(response.base64, conf.getAccessToken(), board.getBoardId()).then((imageData) => {
|
|
55786
55792
|
const placeholderId = board.aiImagePlaceholder?.getId();
|
|
55787
55793
|
if (placeholderId) {
|
|
55788
55794
|
const placeholderNode = board.items.getById(placeholderId);
|
package/dist/cjs/node.js
CHANGED
|
@@ -7780,6 +7780,7 @@ var conf = {
|
|
|
7780
7780
|
beforeMediaRemove: async (...args) => false,
|
|
7781
7781
|
onUploadMediaError: async (...args) => false
|
|
7782
7782
|
},
|
|
7783
|
+
getAccessToken: () => null,
|
|
7783
7784
|
openModal: () => {},
|
|
7784
7785
|
notify: () => "",
|
|
7785
7786
|
disMissNotification: () => {},
|
|
@@ -48470,25 +48471,30 @@ function throttle(func, delay) {
|
|
|
48470
48471
|
var defaultCardData = {
|
|
48471
48472
|
itemType: "Card",
|
|
48472
48473
|
isOpen: false,
|
|
48473
|
-
|
|
48474
|
+
faceUrl: "",
|
|
48475
|
+
backsideUrl: "",
|
|
48474
48476
|
isInDeck: false
|
|
48475
48477
|
};
|
|
48476
48478
|
var CARD_DIMENSIONS = { width: 250, height: 400 };
|
|
48477
48479
|
|
|
48478
48480
|
class Card extends BaseItem {
|
|
48479
48481
|
subject = new Subject;
|
|
48480
|
-
|
|
48482
|
+
faceUrl = "";
|
|
48483
|
+
backsideUrl = "";
|
|
48481
48484
|
isOpen = false;
|
|
48482
48485
|
isInDeck = false;
|
|
48483
48486
|
throttledBringToFront;
|
|
48484
|
-
|
|
48487
|
+
face = null;
|
|
48485
48488
|
backside = null;
|
|
48486
48489
|
imageToRender = null;
|
|
48487
48490
|
shouldUseCustomRender = false;
|
|
48488
|
-
constructor(board, id = "",
|
|
48491
|
+
constructor(board, id = "", urls) {
|
|
48489
48492
|
super(board, id, defaultCardData);
|
|
48490
|
-
|
|
48491
|
-
|
|
48493
|
+
if (urls) {
|
|
48494
|
+
this.faceUrl = urls.faceUrl;
|
|
48495
|
+
this.backsideUrl = urls.backsideUrl;
|
|
48496
|
+
this.createImages();
|
|
48497
|
+
}
|
|
48492
48498
|
this.throttledBringToFront = throttle(() => {
|
|
48493
48499
|
this.board.bringToFront(this);
|
|
48494
48500
|
}, 1000);
|
|
@@ -48501,11 +48507,11 @@ class Card extends BaseItem {
|
|
|
48501
48507
|
this.updateMbr();
|
|
48502
48508
|
}
|
|
48503
48509
|
createImages() {
|
|
48504
|
-
this.
|
|
48510
|
+
this.face = conf.documentFactory.createElement("img");
|
|
48505
48511
|
this.backside = conf.documentFactory.createElement("img");
|
|
48506
|
-
this.
|
|
48507
|
-
this.backside.src =
|
|
48508
|
-
this.
|
|
48512
|
+
this.face.src = this.faceUrl;
|
|
48513
|
+
this.backside.src = this.backsideUrl;
|
|
48514
|
+
this.face.onload = () => {
|
|
48509
48515
|
this.subject.publish(this);
|
|
48510
48516
|
};
|
|
48511
48517
|
this.backside.onload = () => {
|
|
@@ -48524,7 +48530,7 @@ class Card extends BaseItem {
|
|
|
48524
48530
|
updateImageToRender() {
|
|
48525
48531
|
this.imageToRender = this.backside;
|
|
48526
48532
|
if (this.isOpen) {
|
|
48527
|
-
this.imageToRender = this.
|
|
48533
|
+
this.imageToRender = this.face;
|
|
48528
48534
|
}
|
|
48529
48535
|
}
|
|
48530
48536
|
render(context, deckRenderData) {
|
|
@@ -58255,7 +58261,7 @@ function handleAudioGenerate(response, board) {
|
|
|
58255
58261
|
}
|
|
58256
58262
|
function handleImageGenerate(response, board) {
|
|
58257
58263
|
if (response.status === "completed" && response.base64) {
|
|
58258
|
-
prepareImage(response.base64,
|
|
58264
|
+
prepareImage(response.base64, conf.getAccessToken(), board.getBoardId()).then((imageData) => {
|
|
58259
58265
|
const placeholderId = board.aiImagePlaceholder?.getId();
|
|
58260
58266
|
if (placeholderId) {
|
|
58261
58267
|
const placeholderNode = board.items.getById(placeholderId);
|
package/dist/esm/browser.js
CHANGED
|
@@ -6585,6 +6585,7 @@ var conf = {
|
|
|
6585
6585
|
beforeMediaRemove: async (...args) => false,
|
|
6586
6586
|
onUploadMediaError: async (...args) => false
|
|
6587
6587
|
},
|
|
6588
|
+
getAccessToken: () => null,
|
|
6588
6589
|
openModal: () => {},
|
|
6589
6590
|
notify: () => "",
|
|
6590
6591
|
disMissNotification: () => {},
|
|
@@ -45781,25 +45782,30 @@ function throttle(func, delay) {
|
|
|
45781
45782
|
var defaultCardData = {
|
|
45782
45783
|
itemType: "Card",
|
|
45783
45784
|
isOpen: false,
|
|
45784
|
-
|
|
45785
|
+
faceUrl: "",
|
|
45786
|
+
backsideUrl: "",
|
|
45785
45787
|
isInDeck: false
|
|
45786
45788
|
};
|
|
45787
45789
|
var CARD_DIMENSIONS = { width: 250, height: 400 };
|
|
45788
45790
|
|
|
45789
45791
|
class Card extends BaseItem {
|
|
45790
45792
|
subject = new Subject;
|
|
45791
|
-
|
|
45793
|
+
faceUrl = "";
|
|
45794
|
+
backsideUrl = "";
|
|
45792
45795
|
isOpen = false;
|
|
45793
45796
|
isInDeck = false;
|
|
45794
45797
|
throttledBringToFront;
|
|
45795
|
-
|
|
45798
|
+
face = null;
|
|
45796
45799
|
backside = null;
|
|
45797
45800
|
imageToRender = null;
|
|
45798
45801
|
shouldUseCustomRender = false;
|
|
45799
|
-
constructor(board, id = "",
|
|
45802
|
+
constructor(board, id = "", urls) {
|
|
45800
45803
|
super(board, id, defaultCardData);
|
|
45801
|
-
|
|
45802
|
-
|
|
45804
|
+
if (urls) {
|
|
45805
|
+
this.faceUrl = urls.faceUrl;
|
|
45806
|
+
this.backsideUrl = urls.backsideUrl;
|
|
45807
|
+
this.createImages();
|
|
45808
|
+
}
|
|
45803
45809
|
this.throttledBringToFront = throttle(() => {
|
|
45804
45810
|
this.board.bringToFront(this);
|
|
45805
45811
|
}, 1000);
|
|
@@ -45812,11 +45818,11 @@ class Card extends BaseItem {
|
|
|
45812
45818
|
this.updateMbr();
|
|
45813
45819
|
}
|
|
45814
45820
|
createImages() {
|
|
45815
|
-
this.
|
|
45821
|
+
this.face = conf.documentFactory.createElement("img");
|
|
45816
45822
|
this.backside = conf.documentFactory.createElement("img");
|
|
45817
|
-
this.
|
|
45818
|
-
this.backside.src =
|
|
45819
|
-
this.
|
|
45823
|
+
this.face.src = this.faceUrl;
|
|
45824
|
+
this.backside.src = this.backsideUrl;
|
|
45825
|
+
this.face.onload = () => {
|
|
45820
45826
|
this.subject.publish(this);
|
|
45821
45827
|
};
|
|
45822
45828
|
this.backside.onload = () => {
|
|
@@ -45835,7 +45841,7 @@ class Card extends BaseItem {
|
|
|
45835
45841
|
updateImageToRender() {
|
|
45836
45842
|
this.imageToRender = this.backside;
|
|
45837
45843
|
if (this.isOpen) {
|
|
45838
|
-
this.imageToRender = this.
|
|
45844
|
+
this.imageToRender = this.face;
|
|
45839
45845
|
}
|
|
45840
45846
|
}
|
|
45841
45847
|
render(context, deckRenderData) {
|
|
@@ -55633,7 +55639,7 @@ function handleAudioGenerate(response, board) {
|
|
|
55633
55639
|
}
|
|
55634
55640
|
function handleImageGenerate(response, board) {
|
|
55635
55641
|
if (response.status === "completed" && response.base64) {
|
|
55636
|
-
prepareImage(response.base64,
|
|
55642
|
+
prepareImage(response.base64, conf.getAccessToken(), board.getBoardId()).then((imageData) => {
|
|
55637
55643
|
const placeholderId = board.aiImagePlaceholder?.getId();
|
|
55638
55644
|
if (placeholderId) {
|
|
55639
55645
|
const placeholderNode = board.items.getById(placeholderId);
|
package/dist/esm/index.js
CHANGED
|
@@ -6578,6 +6578,7 @@ var conf = {
|
|
|
6578
6578
|
beforeMediaRemove: async (...args) => false,
|
|
6579
6579
|
onUploadMediaError: async (...args) => false
|
|
6580
6580
|
},
|
|
6581
|
+
getAccessToken: () => null,
|
|
6581
6582
|
openModal: () => {},
|
|
6582
6583
|
notify: () => "",
|
|
6583
6584
|
disMissNotification: () => {},
|
|
@@ -45774,25 +45775,30 @@ function throttle(func, delay) {
|
|
|
45774
45775
|
var defaultCardData = {
|
|
45775
45776
|
itemType: "Card",
|
|
45776
45777
|
isOpen: false,
|
|
45777
|
-
|
|
45778
|
+
faceUrl: "",
|
|
45779
|
+
backsideUrl: "",
|
|
45778
45780
|
isInDeck: false
|
|
45779
45781
|
};
|
|
45780
45782
|
var CARD_DIMENSIONS = { width: 250, height: 400 };
|
|
45781
45783
|
|
|
45782
45784
|
class Card extends BaseItem {
|
|
45783
45785
|
subject = new Subject;
|
|
45784
|
-
|
|
45786
|
+
faceUrl = "";
|
|
45787
|
+
backsideUrl = "";
|
|
45785
45788
|
isOpen = false;
|
|
45786
45789
|
isInDeck = false;
|
|
45787
45790
|
throttledBringToFront;
|
|
45788
|
-
|
|
45791
|
+
face = null;
|
|
45789
45792
|
backside = null;
|
|
45790
45793
|
imageToRender = null;
|
|
45791
45794
|
shouldUseCustomRender = false;
|
|
45792
|
-
constructor(board, id = "",
|
|
45795
|
+
constructor(board, id = "", urls) {
|
|
45793
45796
|
super(board, id, defaultCardData);
|
|
45794
|
-
|
|
45795
|
-
|
|
45797
|
+
if (urls) {
|
|
45798
|
+
this.faceUrl = urls.faceUrl;
|
|
45799
|
+
this.backsideUrl = urls.backsideUrl;
|
|
45800
|
+
this.createImages();
|
|
45801
|
+
}
|
|
45796
45802
|
this.throttledBringToFront = throttle(() => {
|
|
45797
45803
|
this.board.bringToFront(this);
|
|
45798
45804
|
}, 1000);
|
|
@@ -45805,11 +45811,11 @@ class Card extends BaseItem {
|
|
|
45805
45811
|
this.updateMbr();
|
|
45806
45812
|
}
|
|
45807
45813
|
createImages() {
|
|
45808
|
-
this.
|
|
45814
|
+
this.face = conf.documentFactory.createElement("img");
|
|
45809
45815
|
this.backside = conf.documentFactory.createElement("img");
|
|
45810
|
-
this.
|
|
45811
|
-
this.backside.src =
|
|
45812
|
-
this.
|
|
45816
|
+
this.face.src = this.faceUrl;
|
|
45817
|
+
this.backside.src = this.backsideUrl;
|
|
45818
|
+
this.face.onload = () => {
|
|
45813
45819
|
this.subject.publish(this);
|
|
45814
45820
|
};
|
|
45815
45821
|
this.backside.onload = () => {
|
|
@@ -45828,7 +45834,7 @@ class Card extends BaseItem {
|
|
|
45828
45834
|
updateImageToRender() {
|
|
45829
45835
|
this.imageToRender = this.backside;
|
|
45830
45836
|
if (this.isOpen) {
|
|
45831
|
-
this.imageToRender = this.
|
|
45837
|
+
this.imageToRender = this.face;
|
|
45832
45838
|
}
|
|
45833
45839
|
}
|
|
45834
45840
|
render(context, deckRenderData) {
|
|
@@ -55626,7 +55632,7 @@ function handleAudioGenerate(response, board) {
|
|
|
55626
55632
|
}
|
|
55627
55633
|
function handleImageGenerate(response, board) {
|
|
55628
55634
|
if (response.status === "completed" && response.base64) {
|
|
55629
|
-
prepareImage(response.base64,
|
|
55635
|
+
prepareImage(response.base64, conf.getAccessToken(), board.getBoardId()).then((imageData) => {
|
|
55630
55636
|
const placeholderId = board.aiImagePlaceholder?.getId();
|
|
55631
55637
|
if (placeholderId) {
|
|
55632
55638
|
const placeholderNode = board.items.getById(placeholderId);
|
package/dist/esm/node.js
CHANGED
|
@@ -7362,6 +7362,7 @@ var conf = {
|
|
|
7362
7362
|
beforeMediaRemove: async (...args) => false,
|
|
7363
7363
|
onUploadMediaError: async (...args) => false
|
|
7364
7364
|
},
|
|
7365
|
+
getAccessToken: () => null,
|
|
7365
7366
|
openModal: () => {},
|
|
7366
7367
|
notify: () => "",
|
|
7367
7368
|
disMissNotification: () => {},
|
|
@@ -48309,25 +48310,30 @@ function throttle(func, delay) {
|
|
|
48309
48310
|
var defaultCardData = {
|
|
48310
48311
|
itemType: "Card",
|
|
48311
48312
|
isOpen: false,
|
|
48312
|
-
|
|
48313
|
+
faceUrl: "",
|
|
48314
|
+
backsideUrl: "",
|
|
48313
48315
|
isInDeck: false
|
|
48314
48316
|
};
|
|
48315
48317
|
var CARD_DIMENSIONS = { width: 250, height: 400 };
|
|
48316
48318
|
|
|
48317
48319
|
class Card extends BaseItem {
|
|
48318
48320
|
subject = new Subject;
|
|
48319
|
-
|
|
48321
|
+
faceUrl = "";
|
|
48322
|
+
backsideUrl = "";
|
|
48320
48323
|
isOpen = false;
|
|
48321
48324
|
isInDeck = false;
|
|
48322
48325
|
throttledBringToFront;
|
|
48323
|
-
|
|
48326
|
+
face = null;
|
|
48324
48327
|
backside = null;
|
|
48325
48328
|
imageToRender = null;
|
|
48326
48329
|
shouldUseCustomRender = false;
|
|
48327
|
-
constructor(board, id = "",
|
|
48330
|
+
constructor(board, id = "", urls) {
|
|
48328
48331
|
super(board, id, defaultCardData);
|
|
48329
|
-
|
|
48330
|
-
|
|
48332
|
+
if (urls) {
|
|
48333
|
+
this.faceUrl = urls.faceUrl;
|
|
48334
|
+
this.backsideUrl = urls.backsideUrl;
|
|
48335
|
+
this.createImages();
|
|
48336
|
+
}
|
|
48331
48337
|
this.throttledBringToFront = throttle(() => {
|
|
48332
48338
|
this.board.bringToFront(this);
|
|
48333
48339
|
}, 1000);
|
|
@@ -48340,11 +48346,11 @@ class Card extends BaseItem {
|
|
|
48340
48346
|
this.updateMbr();
|
|
48341
48347
|
}
|
|
48342
48348
|
createImages() {
|
|
48343
|
-
this.
|
|
48349
|
+
this.face = conf.documentFactory.createElement("img");
|
|
48344
48350
|
this.backside = conf.documentFactory.createElement("img");
|
|
48345
|
-
this.
|
|
48346
|
-
this.backside.src =
|
|
48347
|
-
this.
|
|
48351
|
+
this.face.src = this.faceUrl;
|
|
48352
|
+
this.backside.src = this.backsideUrl;
|
|
48353
|
+
this.face.onload = () => {
|
|
48348
48354
|
this.subject.publish(this);
|
|
48349
48355
|
};
|
|
48350
48356
|
this.backside.onload = () => {
|
|
@@ -48363,7 +48369,7 @@ class Card extends BaseItem {
|
|
|
48363
48369
|
updateImageToRender() {
|
|
48364
48370
|
this.imageToRender = this.backside;
|
|
48365
48371
|
if (this.isOpen) {
|
|
48366
|
-
this.imageToRender = this.
|
|
48372
|
+
this.imageToRender = this.face;
|
|
48367
48373
|
}
|
|
48368
48374
|
}
|
|
48369
48375
|
render(context, deckRenderData) {
|
|
@@ -58094,7 +58100,7 @@ function handleAudioGenerate(response, board) {
|
|
|
58094
58100
|
}
|
|
58095
58101
|
function handleImageGenerate(response, board) {
|
|
58096
58102
|
if (response.status === "completed" && response.base64) {
|
|
58097
|
-
prepareImage(response.base64,
|
|
58103
|
+
prepareImage(response.base64, conf.getAccessToken(), board.getBoardId()).then((imageData) => {
|
|
58098
58104
|
const placeholderId = board.aiImagePlaceholder?.getId();
|
|
58099
58105
|
if (placeholderId) {
|
|
58100
58106
|
const placeholderNode = board.items.getById(placeholderId);
|
|
@@ -19,15 +19,19 @@ export declare const CARD_DIMENSIONS: {
|
|
|
19
19
|
};
|
|
20
20
|
export declare class Card extends BaseItem {
|
|
21
21
|
readonly subject: Subject<Card>;
|
|
22
|
-
private
|
|
22
|
+
private faceUrl;
|
|
23
|
+
private backsideUrl;
|
|
23
24
|
private isOpen;
|
|
24
25
|
private isInDeck;
|
|
25
26
|
private throttledBringToFront;
|
|
26
|
-
|
|
27
|
+
face: HTMLImageElement | null;
|
|
27
28
|
backside: HTMLImageElement | null;
|
|
28
29
|
private imageToRender;
|
|
29
30
|
shouldUseCustomRender: boolean;
|
|
30
|
-
constructor(board: Board, id
|
|
31
|
+
constructor(board: Board, id?: string, urls?: {
|
|
32
|
+
faceUrl: string;
|
|
33
|
+
backsideUrl: string;
|
|
34
|
+
});
|
|
31
35
|
createImages(): void;
|
|
32
36
|
setIsInDeck(isInDeck: boolean): void;
|
|
33
37
|
updateImageToRender(): void;
|
package/dist/types/Settings.d.ts
CHANGED
|
@@ -98,6 +98,7 @@ export interface ExportSnapshotSelection {
|
|
|
98
98
|
endX: number;
|
|
99
99
|
endY: number;
|
|
100
100
|
}
|
|
101
|
+
type GetAccessTokenFunction = () => string | null;
|
|
101
102
|
type OpenModalFunction = (modalId: string) => void;
|
|
102
103
|
type NotifyWrapperFunction = NotifyFunction;
|
|
103
104
|
type DisMissNotificationFunction = (toastId?: string) => void;
|
|
@@ -128,6 +129,7 @@ export declare const conf: {
|
|
|
128
129
|
beforeMediaRemove: (...args: any[]) => Promise<boolean>;
|
|
129
130
|
onUploadMediaError: (...args: any[]) => Promise<boolean>;
|
|
130
131
|
};
|
|
132
|
+
getAccessToken: GetAccessTokenFunction;
|
|
131
133
|
openModal: OpenModalFunction;
|
|
132
134
|
notify: NotifyWrapperFunction;
|
|
133
135
|
disMissNotification: DisMissNotificationFunction;
|