microboard-temp 0.5.119 → 0.5.120
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 +17 -10
- package/dist/cjs/index.js +17 -10
- package/dist/cjs/node.js +17 -10
- package/dist/esm/browser.js +17 -10
- package/dist/esm/index.js +17 -10
- package/dist/esm/node.js +17 -10
- package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -41171,7 +41171,7 @@ class VideoItem extends BaseItem {
|
|
|
41171
41171
|
this.playBtnMbr = new Mbr(this.left + this.getWidth() / 2 - scaledPlayBtn / 2, this.top + this.getHeight() / 2 - scaledPlayBtn / 2, this.right - this.getWidth() / 2 + scaledPlayBtn / 2, this.bottom - this.getHeight() / 2 + scaledPlayBtn / 2);
|
|
41172
41172
|
}
|
|
41173
41173
|
render(context) {
|
|
41174
|
-
if (this.transformationRenderBlock || !this.preview.complete) {
|
|
41174
|
+
if (this.transformationRenderBlock || !this.preview.complete || this.preview.naturalWidth === 0) {
|
|
41175
41175
|
return;
|
|
41176
41176
|
}
|
|
41177
41177
|
const ctx = context.ctx;
|
|
@@ -48068,7 +48068,7 @@ class Card extends BaseItem {
|
|
|
48068
48068
|
return;
|
|
48069
48069
|
}
|
|
48070
48070
|
const ctx = context.ctx;
|
|
48071
|
-
if (this.imageToRender && this.imageToRender.complete) {
|
|
48071
|
+
if (this.imageToRender && this.imageToRender.complete && this.imageToRender.naturalWidth > 0) {
|
|
48072
48072
|
ctx.save();
|
|
48073
48073
|
let { x: centerX, y: centerY } = this.getMbr().getCenter();
|
|
48074
48074
|
const width2 = this.getWidth();
|
|
@@ -48708,19 +48708,19 @@ class Dice extends BaseItem {
|
|
|
48708
48708
|
this.path.setBorderColor(this.borderColor);
|
|
48709
48709
|
this.path.setBorderWidth(this.borderWidth);
|
|
48710
48710
|
}
|
|
48711
|
-
updateRenderValues() {
|
|
48712
|
-
this.values.forEach((value, index2) => {
|
|
48711
|
+
async updateRenderValues() {
|
|
48712
|
+
this.values.forEach(async (value, index2) => {
|
|
48713
48713
|
if (typeof value === "number") {
|
|
48714
48714
|
this.renderValues[index2] = value;
|
|
48715
48715
|
} else {
|
|
48716
48716
|
const image2 = conf.documentFactory.createElement("img");
|
|
48717
|
-
image2.src = value;
|
|
48717
|
+
image2.src = await getMediaSignedUrl(value, this.board.getAccount()?.accessToken || null) || "";
|
|
48718
48718
|
this.renderValues[index2] = image2;
|
|
48719
48719
|
image2.onload = () => {
|
|
48720
48720
|
this.subject.publish(this);
|
|
48721
48721
|
};
|
|
48722
48722
|
image2.onerror = () => {
|
|
48723
|
-
this.renderValues[index2] = 1;
|
|
48723
|
+
this.renderValues[index2] = index2 + 1;
|
|
48724
48724
|
this.subject.publish(this);
|
|
48725
48725
|
};
|
|
48726
48726
|
}
|
|
@@ -49140,12 +49140,19 @@ class Screen extends BaseItem {
|
|
|
49140
49140
|
prevData: { borderColor: this.borderColor }
|
|
49141
49141
|
});
|
|
49142
49142
|
}
|
|
49143
|
-
applyBackgroundUrl(url) {
|
|
49143
|
+
async applyBackgroundUrl(url) {
|
|
49144
49144
|
this.backgroundUrl = url || "";
|
|
49145
49145
|
if (url) {
|
|
49146
|
-
this.backgroundImage =
|
|
49147
|
-
this.backgroundImage.src = url;
|
|
49146
|
+
this.backgroundImage = conf.documentFactory.createElement("img");
|
|
49147
|
+
this.backgroundImage.src = await getMediaSignedUrl(url, this.board.getAccount()?.accessToken || null) || "";
|
|
49148
49148
|
this.applyBackgroundColor("none");
|
|
49149
|
+
this.backgroundImage.onload = () => {
|
|
49150
|
+
this.subject.publish(this);
|
|
49151
|
+
};
|
|
49152
|
+
this.backgroundImage.onerror = () => {
|
|
49153
|
+
this.backgroundImage = null;
|
|
49154
|
+
this.subject.publish(this);
|
|
49155
|
+
};
|
|
49149
49156
|
} else {
|
|
49150
49157
|
this.backgroundImage = null;
|
|
49151
49158
|
}
|
|
@@ -49206,7 +49213,7 @@ class Screen extends BaseItem {
|
|
|
49206
49213
|
if (this.transformationRenderBlock) {
|
|
49207
49214
|
return;
|
|
49208
49215
|
}
|
|
49209
|
-
if (this.backgroundImage && this.backgroundImage.complete) {
|
|
49216
|
+
if (this.backgroundImage && this.backgroundImage.complete && this.backgroundImage.naturalWidth > 0) {
|
|
49210
49217
|
const ctx = context.ctx;
|
|
49211
49218
|
ctx.save();
|
|
49212
49219
|
ctx.drawImage(this.backgroundImage, this.left, this.top, this.getWidth(), this.getHeight());
|
package/dist/cjs/index.js
CHANGED
|
@@ -41171,7 +41171,7 @@ class VideoItem extends BaseItem {
|
|
|
41171
41171
|
this.playBtnMbr = new Mbr(this.left + this.getWidth() / 2 - scaledPlayBtn / 2, this.top + this.getHeight() / 2 - scaledPlayBtn / 2, this.right - this.getWidth() / 2 + scaledPlayBtn / 2, this.bottom - this.getHeight() / 2 + scaledPlayBtn / 2);
|
|
41172
41172
|
}
|
|
41173
41173
|
render(context) {
|
|
41174
|
-
if (this.transformationRenderBlock || !this.preview.complete) {
|
|
41174
|
+
if (this.transformationRenderBlock || !this.preview.complete || this.preview.naturalWidth === 0) {
|
|
41175
41175
|
return;
|
|
41176
41176
|
}
|
|
41177
41177
|
const ctx = context.ctx;
|
|
@@ -48068,7 +48068,7 @@ class Card extends BaseItem {
|
|
|
48068
48068
|
return;
|
|
48069
48069
|
}
|
|
48070
48070
|
const ctx = context.ctx;
|
|
48071
|
-
if (this.imageToRender && this.imageToRender.complete) {
|
|
48071
|
+
if (this.imageToRender && this.imageToRender.complete && this.imageToRender.naturalWidth > 0) {
|
|
48072
48072
|
ctx.save();
|
|
48073
48073
|
let { x: centerX, y: centerY } = this.getMbr().getCenter();
|
|
48074
48074
|
const width2 = this.getWidth();
|
|
@@ -48708,19 +48708,19 @@ class Dice extends BaseItem {
|
|
|
48708
48708
|
this.path.setBorderColor(this.borderColor);
|
|
48709
48709
|
this.path.setBorderWidth(this.borderWidth);
|
|
48710
48710
|
}
|
|
48711
|
-
updateRenderValues() {
|
|
48712
|
-
this.values.forEach((value, index2) => {
|
|
48711
|
+
async updateRenderValues() {
|
|
48712
|
+
this.values.forEach(async (value, index2) => {
|
|
48713
48713
|
if (typeof value === "number") {
|
|
48714
48714
|
this.renderValues[index2] = value;
|
|
48715
48715
|
} else {
|
|
48716
48716
|
const image2 = conf.documentFactory.createElement("img");
|
|
48717
|
-
image2.src = value;
|
|
48717
|
+
image2.src = await getMediaSignedUrl(value, this.board.getAccount()?.accessToken || null) || "";
|
|
48718
48718
|
this.renderValues[index2] = image2;
|
|
48719
48719
|
image2.onload = () => {
|
|
48720
48720
|
this.subject.publish(this);
|
|
48721
48721
|
};
|
|
48722
48722
|
image2.onerror = () => {
|
|
48723
|
-
this.renderValues[index2] = 1;
|
|
48723
|
+
this.renderValues[index2] = index2 + 1;
|
|
48724
48724
|
this.subject.publish(this);
|
|
48725
48725
|
};
|
|
48726
48726
|
}
|
|
@@ -49140,12 +49140,19 @@ class Screen extends BaseItem {
|
|
|
49140
49140
|
prevData: { borderColor: this.borderColor }
|
|
49141
49141
|
});
|
|
49142
49142
|
}
|
|
49143
|
-
applyBackgroundUrl(url) {
|
|
49143
|
+
async applyBackgroundUrl(url) {
|
|
49144
49144
|
this.backgroundUrl = url || "";
|
|
49145
49145
|
if (url) {
|
|
49146
|
-
this.backgroundImage =
|
|
49147
|
-
this.backgroundImage.src = url;
|
|
49146
|
+
this.backgroundImage = conf.documentFactory.createElement("img");
|
|
49147
|
+
this.backgroundImage.src = await getMediaSignedUrl(url, this.board.getAccount()?.accessToken || null) || "";
|
|
49148
49148
|
this.applyBackgroundColor("none");
|
|
49149
|
+
this.backgroundImage.onload = () => {
|
|
49150
|
+
this.subject.publish(this);
|
|
49151
|
+
};
|
|
49152
|
+
this.backgroundImage.onerror = () => {
|
|
49153
|
+
this.backgroundImage = null;
|
|
49154
|
+
this.subject.publish(this);
|
|
49155
|
+
};
|
|
49149
49156
|
} else {
|
|
49150
49157
|
this.backgroundImage = null;
|
|
49151
49158
|
}
|
|
@@ -49206,7 +49213,7 @@ class Screen extends BaseItem {
|
|
|
49206
49213
|
if (this.transformationRenderBlock) {
|
|
49207
49214
|
return;
|
|
49208
49215
|
}
|
|
49209
|
-
if (this.backgroundImage && this.backgroundImage.complete) {
|
|
49216
|
+
if (this.backgroundImage && this.backgroundImage.complete && this.backgroundImage.naturalWidth > 0) {
|
|
49210
49217
|
const ctx = context.ctx;
|
|
49211
49218
|
ctx.save();
|
|
49212
49219
|
ctx.drawImage(this.backgroundImage, this.left, this.top, this.getWidth(), this.getHeight());
|
package/dist/cjs/node.js
CHANGED
|
@@ -43644,7 +43644,7 @@ class VideoItem extends BaseItem {
|
|
|
43644
43644
|
this.playBtnMbr = new Mbr(this.left + this.getWidth() / 2 - scaledPlayBtn / 2, this.top + this.getHeight() / 2 - scaledPlayBtn / 2, this.right - this.getWidth() / 2 + scaledPlayBtn / 2, this.bottom - this.getHeight() / 2 + scaledPlayBtn / 2);
|
|
43645
43645
|
}
|
|
43646
43646
|
render(context) {
|
|
43647
|
-
if (this.transformationRenderBlock || !this.preview.complete) {
|
|
43647
|
+
if (this.transformationRenderBlock || !this.preview.complete || this.preview.naturalWidth === 0) {
|
|
43648
43648
|
return;
|
|
43649
43649
|
}
|
|
43650
43650
|
const ctx = context.ctx;
|
|
@@ -50541,7 +50541,7 @@ class Card extends BaseItem {
|
|
|
50541
50541
|
return;
|
|
50542
50542
|
}
|
|
50543
50543
|
const ctx = context.ctx;
|
|
50544
|
-
if (this.imageToRender && this.imageToRender.complete) {
|
|
50544
|
+
if (this.imageToRender && this.imageToRender.complete && this.imageToRender.naturalWidth > 0) {
|
|
50545
50545
|
ctx.save();
|
|
50546
50546
|
let { x: centerX, y: centerY } = this.getMbr().getCenter();
|
|
50547
50547
|
const width2 = this.getWidth();
|
|
@@ -51181,19 +51181,19 @@ class Dice extends BaseItem {
|
|
|
51181
51181
|
this.path.setBorderColor(this.borderColor);
|
|
51182
51182
|
this.path.setBorderWidth(this.borderWidth);
|
|
51183
51183
|
}
|
|
51184
|
-
updateRenderValues() {
|
|
51185
|
-
this.values.forEach((value, index2) => {
|
|
51184
|
+
async updateRenderValues() {
|
|
51185
|
+
this.values.forEach(async (value, index2) => {
|
|
51186
51186
|
if (typeof value === "number") {
|
|
51187
51187
|
this.renderValues[index2] = value;
|
|
51188
51188
|
} else {
|
|
51189
51189
|
const image2 = conf.documentFactory.createElement("img");
|
|
51190
|
-
image2.src = value;
|
|
51190
|
+
image2.src = await getMediaSignedUrl(value, this.board.getAccount()?.accessToken || null) || "";
|
|
51191
51191
|
this.renderValues[index2] = image2;
|
|
51192
51192
|
image2.onload = () => {
|
|
51193
51193
|
this.subject.publish(this);
|
|
51194
51194
|
};
|
|
51195
51195
|
image2.onerror = () => {
|
|
51196
|
-
this.renderValues[index2] = 1;
|
|
51196
|
+
this.renderValues[index2] = index2 + 1;
|
|
51197
51197
|
this.subject.publish(this);
|
|
51198
51198
|
};
|
|
51199
51199
|
}
|
|
@@ -51613,12 +51613,19 @@ class Screen extends BaseItem {
|
|
|
51613
51613
|
prevData: { borderColor: this.borderColor }
|
|
51614
51614
|
});
|
|
51615
51615
|
}
|
|
51616
|
-
applyBackgroundUrl(url) {
|
|
51616
|
+
async applyBackgroundUrl(url) {
|
|
51617
51617
|
this.backgroundUrl = url || "";
|
|
51618
51618
|
if (url) {
|
|
51619
|
-
this.backgroundImage =
|
|
51620
|
-
this.backgroundImage.src = url;
|
|
51619
|
+
this.backgroundImage = conf.documentFactory.createElement("img");
|
|
51620
|
+
this.backgroundImage.src = await getMediaSignedUrl(url, this.board.getAccount()?.accessToken || null) || "";
|
|
51621
51621
|
this.applyBackgroundColor("none");
|
|
51622
|
+
this.backgroundImage.onload = () => {
|
|
51623
|
+
this.subject.publish(this);
|
|
51624
|
+
};
|
|
51625
|
+
this.backgroundImage.onerror = () => {
|
|
51626
|
+
this.backgroundImage = null;
|
|
51627
|
+
this.subject.publish(this);
|
|
51628
|
+
};
|
|
51622
51629
|
} else {
|
|
51623
51630
|
this.backgroundImage = null;
|
|
51624
51631
|
}
|
|
@@ -51679,7 +51686,7 @@ class Screen extends BaseItem {
|
|
|
51679
51686
|
if (this.transformationRenderBlock) {
|
|
51680
51687
|
return;
|
|
51681
51688
|
}
|
|
51682
|
-
if (this.backgroundImage && this.backgroundImage.complete) {
|
|
51689
|
+
if (this.backgroundImage && this.backgroundImage.complete && this.backgroundImage.naturalWidth > 0) {
|
|
51683
51690
|
const ctx = context.ctx;
|
|
51684
51691
|
ctx.save();
|
|
51685
51692
|
ctx.drawImage(this.backgroundImage, this.left, this.top, this.getWidth(), this.getHeight());
|
package/dist/esm/browser.js
CHANGED
|
@@ -41015,7 +41015,7 @@ class VideoItem extends BaseItem {
|
|
|
41015
41015
|
this.playBtnMbr = new Mbr(this.left + this.getWidth() / 2 - scaledPlayBtn / 2, this.top + this.getHeight() / 2 - scaledPlayBtn / 2, this.right - this.getWidth() / 2 + scaledPlayBtn / 2, this.bottom - this.getHeight() / 2 + scaledPlayBtn / 2);
|
|
41016
41016
|
}
|
|
41017
41017
|
render(context) {
|
|
41018
|
-
if (this.transformationRenderBlock || !this.preview.complete) {
|
|
41018
|
+
if (this.transformationRenderBlock || !this.preview.complete || this.preview.naturalWidth === 0) {
|
|
41019
41019
|
return;
|
|
41020
41020
|
}
|
|
41021
41021
|
const ctx = context.ctx;
|
|
@@ -47912,7 +47912,7 @@ class Card extends BaseItem {
|
|
|
47912
47912
|
return;
|
|
47913
47913
|
}
|
|
47914
47914
|
const ctx = context.ctx;
|
|
47915
|
-
if (this.imageToRender && this.imageToRender.complete) {
|
|
47915
|
+
if (this.imageToRender && this.imageToRender.complete && this.imageToRender.naturalWidth > 0) {
|
|
47916
47916
|
ctx.save();
|
|
47917
47917
|
let { x: centerX, y: centerY } = this.getMbr().getCenter();
|
|
47918
47918
|
const width2 = this.getWidth();
|
|
@@ -48552,19 +48552,19 @@ class Dice extends BaseItem {
|
|
|
48552
48552
|
this.path.setBorderColor(this.borderColor);
|
|
48553
48553
|
this.path.setBorderWidth(this.borderWidth);
|
|
48554
48554
|
}
|
|
48555
|
-
updateRenderValues() {
|
|
48556
|
-
this.values.forEach((value, index2) => {
|
|
48555
|
+
async updateRenderValues() {
|
|
48556
|
+
this.values.forEach(async (value, index2) => {
|
|
48557
48557
|
if (typeof value === "number") {
|
|
48558
48558
|
this.renderValues[index2] = value;
|
|
48559
48559
|
} else {
|
|
48560
48560
|
const image2 = conf.documentFactory.createElement("img");
|
|
48561
|
-
image2.src = value;
|
|
48561
|
+
image2.src = await getMediaSignedUrl(value, this.board.getAccount()?.accessToken || null) || "";
|
|
48562
48562
|
this.renderValues[index2] = image2;
|
|
48563
48563
|
image2.onload = () => {
|
|
48564
48564
|
this.subject.publish(this);
|
|
48565
48565
|
};
|
|
48566
48566
|
image2.onerror = () => {
|
|
48567
|
-
this.renderValues[index2] = 1;
|
|
48567
|
+
this.renderValues[index2] = index2 + 1;
|
|
48568
48568
|
this.subject.publish(this);
|
|
48569
48569
|
};
|
|
48570
48570
|
}
|
|
@@ -48984,12 +48984,19 @@ class Screen extends BaseItem {
|
|
|
48984
48984
|
prevData: { borderColor: this.borderColor }
|
|
48985
48985
|
});
|
|
48986
48986
|
}
|
|
48987
|
-
applyBackgroundUrl(url) {
|
|
48987
|
+
async applyBackgroundUrl(url) {
|
|
48988
48988
|
this.backgroundUrl = url || "";
|
|
48989
48989
|
if (url) {
|
|
48990
|
-
this.backgroundImage =
|
|
48991
|
-
this.backgroundImage.src = url;
|
|
48990
|
+
this.backgroundImage = conf.documentFactory.createElement("img");
|
|
48991
|
+
this.backgroundImage.src = await getMediaSignedUrl(url, this.board.getAccount()?.accessToken || null) || "";
|
|
48992
48992
|
this.applyBackgroundColor("none");
|
|
48993
|
+
this.backgroundImage.onload = () => {
|
|
48994
|
+
this.subject.publish(this);
|
|
48995
|
+
};
|
|
48996
|
+
this.backgroundImage.onerror = () => {
|
|
48997
|
+
this.backgroundImage = null;
|
|
48998
|
+
this.subject.publish(this);
|
|
48999
|
+
};
|
|
48993
49000
|
} else {
|
|
48994
49001
|
this.backgroundImage = null;
|
|
48995
49002
|
}
|
|
@@ -49050,7 +49057,7 @@ class Screen extends BaseItem {
|
|
|
49050
49057
|
if (this.transformationRenderBlock) {
|
|
49051
49058
|
return;
|
|
49052
49059
|
}
|
|
49053
|
-
if (this.backgroundImage && this.backgroundImage.complete) {
|
|
49060
|
+
if (this.backgroundImage && this.backgroundImage.complete && this.backgroundImage.naturalWidth > 0) {
|
|
49054
49061
|
const ctx = context.ctx;
|
|
49055
49062
|
ctx.save();
|
|
49056
49063
|
ctx.drawImage(this.backgroundImage, this.left, this.top, this.getWidth(), this.getHeight());
|
package/dist/esm/index.js
CHANGED
|
@@ -41008,7 +41008,7 @@ class VideoItem extends BaseItem {
|
|
|
41008
41008
|
this.playBtnMbr = new Mbr(this.left + this.getWidth() / 2 - scaledPlayBtn / 2, this.top + this.getHeight() / 2 - scaledPlayBtn / 2, this.right - this.getWidth() / 2 + scaledPlayBtn / 2, this.bottom - this.getHeight() / 2 + scaledPlayBtn / 2);
|
|
41009
41009
|
}
|
|
41010
41010
|
render(context) {
|
|
41011
|
-
if (this.transformationRenderBlock || !this.preview.complete) {
|
|
41011
|
+
if (this.transformationRenderBlock || !this.preview.complete || this.preview.naturalWidth === 0) {
|
|
41012
41012
|
return;
|
|
41013
41013
|
}
|
|
41014
41014
|
const ctx = context.ctx;
|
|
@@ -47905,7 +47905,7 @@ class Card extends BaseItem {
|
|
|
47905
47905
|
return;
|
|
47906
47906
|
}
|
|
47907
47907
|
const ctx = context.ctx;
|
|
47908
|
-
if (this.imageToRender && this.imageToRender.complete) {
|
|
47908
|
+
if (this.imageToRender && this.imageToRender.complete && this.imageToRender.naturalWidth > 0) {
|
|
47909
47909
|
ctx.save();
|
|
47910
47910
|
let { x: centerX, y: centerY } = this.getMbr().getCenter();
|
|
47911
47911
|
const width2 = this.getWidth();
|
|
@@ -48545,19 +48545,19 @@ class Dice extends BaseItem {
|
|
|
48545
48545
|
this.path.setBorderColor(this.borderColor);
|
|
48546
48546
|
this.path.setBorderWidth(this.borderWidth);
|
|
48547
48547
|
}
|
|
48548
|
-
updateRenderValues() {
|
|
48549
|
-
this.values.forEach((value, index2) => {
|
|
48548
|
+
async updateRenderValues() {
|
|
48549
|
+
this.values.forEach(async (value, index2) => {
|
|
48550
48550
|
if (typeof value === "number") {
|
|
48551
48551
|
this.renderValues[index2] = value;
|
|
48552
48552
|
} else {
|
|
48553
48553
|
const image2 = conf.documentFactory.createElement("img");
|
|
48554
|
-
image2.src = value;
|
|
48554
|
+
image2.src = await getMediaSignedUrl(value, this.board.getAccount()?.accessToken || null) || "";
|
|
48555
48555
|
this.renderValues[index2] = image2;
|
|
48556
48556
|
image2.onload = () => {
|
|
48557
48557
|
this.subject.publish(this);
|
|
48558
48558
|
};
|
|
48559
48559
|
image2.onerror = () => {
|
|
48560
|
-
this.renderValues[index2] = 1;
|
|
48560
|
+
this.renderValues[index2] = index2 + 1;
|
|
48561
48561
|
this.subject.publish(this);
|
|
48562
48562
|
};
|
|
48563
48563
|
}
|
|
@@ -48977,12 +48977,19 @@ class Screen extends BaseItem {
|
|
|
48977
48977
|
prevData: { borderColor: this.borderColor }
|
|
48978
48978
|
});
|
|
48979
48979
|
}
|
|
48980
|
-
applyBackgroundUrl(url) {
|
|
48980
|
+
async applyBackgroundUrl(url) {
|
|
48981
48981
|
this.backgroundUrl = url || "";
|
|
48982
48982
|
if (url) {
|
|
48983
|
-
this.backgroundImage =
|
|
48984
|
-
this.backgroundImage.src = url;
|
|
48983
|
+
this.backgroundImage = conf.documentFactory.createElement("img");
|
|
48984
|
+
this.backgroundImage.src = await getMediaSignedUrl(url, this.board.getAccount()?.accessToken || null) || "";
|
|
48985
48985
|
this.applyBackgroundColor("none");
|
|
48986
|
+
this.backgroundImage.onload = () => {
|
|
48987
|
+
this.subject.publish(this);
|
|
48988
|
+
};
|
|
48989
|
+
this.backgroundImage.onerror = () => {
|
|
48990
|
+
this.backgroundImage = null;
|
|
48991
|
+
this.subject.publish(this);
|
|
48992
|
+
};
|
|
48986
48993
|
} else {
|
|
48987
48994
|
this.backgroundImage = null;
|
|
48988
48995
|
}
|
|
@@ -49043,7 +49050,7 @@ class Screen extends BaseItem {
|
|
|
49043
49050
|
if (this.transformationRenderBlock) {
|
|
49044
49051
|
return;
|
|
49045
49052
|
}
|
|
49046
|
-
if (this.backgroundImage && this.backgroundImage.complete) {
|
|
49053
|
+
if (this.backgroundImage && this.backgroundImage.complete && this.backgroundImage.naturalWidth > 0) {
|
|
49047
49054
|
const ctx = context.ctx;
|
|
49048
49055
|
ctx.save();
|
|
49049
49056
|
ctx.drawImage(this.backgroundImage, this.left, this.top, this.getWidth(), this.getHeight());
|
package/dist/esm/node.js
CHANGED
|
@@ -43476,7 +43476,7 @@ class VideoItem extends BaseItem {
|
|
|
43476
43476
|
this.playBtnMbr = new Mbr(this.left + this.getWidth() / 2 - scaledPlayBtn / 2, this.top + this.getHeight() / 2 - scaledPlayBtn / 2, this.right - this.getWidth() / 2 + scaledPlayBtn / 2, this.bottom - this.getHeight() / 2 + scaledPlayBtn / 2);
|
|
43477
43477
|
}
|
|
43478
43478
|
render(context) {
|
|
43479
|
-
if (this.transformationRenderBlock || !this.preview.complete) {
|
|
43479
|
+
if (this.transformationRenderBlock || !this.preview.complete || this.preview.naturalWidth === 0) {
|
|
43480
43480
|
return;
|
|
43481
43481
|
}
|
|
43482
43482
|
const ctx = context.ctx;
|
|
@@ -50373,7 +50373,7 @@ class Card extends BaseItem {
|
|
|
50373
50373
|
return;
|
|
50374
50374
|
}
|
|
50375
50375
|
const ctx = context.ctx;
|
|
50376
|
-
if (this.imageToRender && this.imageToRender.complete) {
|
|
50376
|
+
if (this.imageToRender && this.imageToRender.complete && this.imageToRender.naturalWidth > 0) {
|
|
50377
50377
|
ctx.save();
|
|
50378
50378
|
let { x: centerX, y: centerY } = this.getMbr().getCenter();
|
|
50379
50379
|
const width2 = this.getWidth();
|
|
@@ -51013,19 +51013,19 @@ class Dice extends BaseItem {
|
|
|
51013
51013
|
this.path.setBorderColor(this.borderColor);
|
|
51014
51014
|
this.path.setBorderWidth(this.borderWidth);
|
|
51015
51015
|
}
|
|
51016
|
-
updateRenderValues() {
|
|
51017
|
-
this.values.forEach((value, index2) => {
|
|
51016
|
+
async updateRenderValues() {
|
|
51017
|
+
this.values.forEach(async (value, index2) => {
|
|
51018
51018
|
if (typeof value === "number") {
|
|
51019
51019
|
this.renderValues[index2] = value;
|
|
51020
51020
|
} else {
|
|
51021
51021
|
const image2 = conf.documentFactory.createElement("img");
|
|
51022
|
-
image2.src = value;
|
|
51022
|
+
image2.src = await getMediaSignedUrl(value, this.board.getAccount()?.accessToken || null) || "";
|
|
51023
51023
|
this.renderValues[index2] = image2;
|
|
51024
51024
|
image2.onload = () => {
|
|
51025
51025
|
this.subject.publish(this);
|
|
51026
51026
|
};
|
|
51027
51027
|
image2.onerror = () => {
|
|
51028
|
-
this.renderValues[index2] = 1;
|
|
51028
|
+
this.renderValues[index2] = index2 + 1;
|
|
51029
51029
|
this.subject.publish(this);
|
|
51030
51030
|
};
|
|
51031
51031
|
}
|
|
@@ -51445,12 +51445,19 @@ class Screen extends BaseItem {
|
|
|
51445
51445
|
prevData: { borderColor: this.borderColor }
|
|
51446
51446
|
});
|
|
51447
51447
|
}
|
|
51448
|
-
applyBackgroundUrl(url) {
|
|
51448
|
+
async applyBackgroundUrl(url) {
|
|
51449
51449
|
this.backgroundUrl = url || "";
|
|
51450
51450
|
if (url) {
|
|
51451
|
-
this.backgroundImage =
|
|
51452
|
-
this.backgroundImage.src = url;
|
|
51451
|
+
this.backgroundImage = conf.documentFactory.createElement("img");
|
|
51452
|
+
this.backgroundImage.src = await getMediaSignedUrl(url, this.board.getAccount()?.accessToken || null) || "";
|
|
51453
51453
|
this.applyBackgroundColor("none");
|
|
51454
|
+
this.backgroundImage.onload = () => {
|
|
51455
|
+
this.subject.publish(this);
|
|
51456
|
+
};
|
|
51457
|
+
this.backgroundImage.onerror = () => {
|
|
51458
|
+
this.backgroundImage = null;
|
|
51459
|
+
this.subject.publish(this);
|
|
51460
|
+
};
|
|
51454
51461
|
} else {
|
|
51455
51462
|
this.backgroundImage = null;
|
|
51456
51463
|
}
|
|
@@ -51511,7 +51518,7 @@ class Screen extends BaseItem {
|
|
|
51511
51518
|
if (this.transformationRenderBlock) {
|
|
51512
51519
|
return;
|
|
51513
51520
|
}
|
|
51514
|
-
if (this.backgroundImage && this.backgroundImage.complete) {
|
|
51521
|
+
if (this.backgroundImage && this.backgroundImage.complete && this.backgroundImage.naturalWidth > 0) {
|
|
51515
51522
|
const ctx = context.ctx;
|
|
51516
51523
|
ctx.save();
|
|
51517
51524
|
ctx.drawImage(this.backgroundImage, this.left, this.top, this.getWidth(), this.getHeight());
|
|
@@ -20,7 +20,7 @@ export declare class Dice extends BaseItem {
|
|
|
20
20
|
drawingContext: DrawingContext | null;
|
|
21
21
|
constructor(board: Board, id?: string, type?: DiceType, values?: (number | string)[]);
|
|
22
22
|
private transformPath;
|
|
23
|
-
updateRenderValues(): void
|
|
23
|
+
updateRenderValues(): Promise<void>;
|
|
24
24
|
render(context: DrawingContext): void;
|
|
25
25
|
updateMbr(): void;
|
|
26
26
|
getPath(): Path;
|