microboard-ui-temp 0.1.55 → 0.1.57
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/index.js +50 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -230226,7 +230226,15 @@ class BaseItem extends Mbr {
|
|
|
230226
230226
|
}
|
|
230227
230227
|
renderHTML(documentFactory) {
|
|
230228
230228
|
const div = documentFactory.createElement("base-item");
|
|
230229
|
-
|
|
230229
|
+
const { translateX, translateY } = this.transformation.matrix;
|
|
230230
|
+
const transform = `translate(${translateX}px, ${translateY}px) scale(1, 1)`;
|
|
230231
|
+
div.style.backgroundColor = "#b2b0c3";
|
|
230232
|
+
div.id = this.getId();
|
|
230233
|
+
div.style.width = `${this.getWidth()}px`;
|
|
230234
|
+
div.style.height = `${this.getHeight()}px`;
|
|
230235
|
+
div.style.transformOrigin = "top left";
|
|
230236
|
+
div.style.transform = transform;
|
|
230237
|
+
div.style.position = "absolute";
|
|
230230
230238
|
div.setAttribute("serialized-data", JSON.stringify(this.serialize()));
|
|
230231
230239
|
return div;
|
|
230232
230240
|
}
|
|
@@ -255879,6 +255887,8 @@ class Card extends BaseItem {
|
|
|
255879
255887
|
createImages() {
|
|
255880
255888
|
this.face = conf.documentFactory.createElement("img");
|
|
255881
255889
|
this.backside = conf.documentFactory.createElement("img");
|
|
255890
|
+
this.face.crossOrigin = "anonymous";
|
|
255891
|
+
this.backside.crossOrigin = "anonymous";
|
|
255882
255892
|
this.face.src = this.faceUrl;
|
|
255883
255893
|
this.backside.src = this.backsideUrl;
|
|
255884
255894
|
this.face.onload = () => {
|
|
@@ -255909,6 +255919,20 @@ class Card extends BaseItem {
|
|
|
255909
255919
|
ctx.restore();
|
|
255910
255920
|
}
|
|
255911
255921
|
}
|
|
255922
|
+
renderHTML(documentFactory) {
|
|
255923
|
+
const div = super.renderHTML(documentFactory);
|
|
255924
|
+
const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
|
|
255925
|
+
const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
|
|
255926
|
+
div.style.backgroundImage = `url(${this.imageToRender?.src || this.backsideUrl})`;
|
|
255927
|
+
div.id = this.getId();
|
|
255928
|
+
div.style.width = `${conf.CARD_DIMENSIONS.width}px`;
|
|
255929
|
+
div.style.height = `${conf.CARD_DIMENSIONS.height}px`;
|
|
255930
|
+
div.style.transformOrigin = "top left";
|
|
255931
|
+
div.style.transform = transform;
|
|
255932
|
+
div.style.position = "absolute";
|
|
255933
|
+
div.style.backgroundSize = "cover";
|
|
255934
|
+
return div;
|
|
255935
|
+
}
|
|
255912
255936
|
updateMbr() {
|
|
255913
255937
|
const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
|
|
255914
255938
|
this.left = translateX;
|
|
@@ -256139,6 +256163,23 @@ class Deck extends BaseItem {
|
|
|
256139
256163
|
ctx.restore();
|
|
256140
256164
|
}
|
|
256141
256165
|
}
|
|
256166
|
+
renderHTML(documentFactory) {
|
|
256167
|
+
const div = super.renderHTML(documentFactory);
|
|
256168
|
+
if (!this.cachedCanvas || !this.cachedCanvas.width || !this.cachedCanvas.height) {
|
|
256169
|
+
return div;
|
|
256170
|
+
}
|
|
256171
|
+
const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
|
|
256172
|
+
const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
|
|
256173
|
+
div.style.backgroundImage = `url(${this.cachedCanvas.toDataURL("image/png")})`;
|
|
256174
|
+
div.id = this.getId();
|
|
256175
|
+
div.style.width = `${this.getWidth()}px`;
|
|
256176
|
+
div.style.height = `${this.getHeight()}px`;
|
|
256177
|
+
div.style.transformOrigin = "top left";
|
|
256178
|
+
div.style.transform = transform;
|
|
256179
|
+
div.style.position = "absolute";
|
|
256180
|
+
div.style.backgroundSize = "cover";
|
|
256181
|
+
return div;
|
|
256182
|
+
}
|
|
256142
256183
|
updateCache(context) {
|
|
256143
256184
|
const cards = this.index?.list();
|
|
256144
256185
|
const topCard = cards[cards.length - 1];
|
|
@@ -256732,6 +256773,14 @@ class Screen extends BaseItem {
|
|
|
256732
256773
|
super.render(context);
|
|
256733
256774
|
}
|
|
256734
256775
|
}
|
|
256776
|
+
renderHTML(documentFactory) {
|
|
256777
|
+
const div = super.renderHTML(documentFactory);
|
|
256778
|
+
div.style.backgroundColor = this.backgroundColor;
|
|
256779
|
+
div.style.borderColor = this.borderColor;
|
|
256780
|
+
div.style.borderWidth = `${this.borderWidth}px`;
|
|
256781
|
+
div.style.borderStyle = this.borderStyle;
|
|
256782
|
+
return div;
|
|
256783
|
+
}
|
|
256735
256784
|
}
|
|
256736
256785
|
registerItem({
|
|
256737
256786
|
item: Screen,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microboard-ui-temp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.57",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
61
61
|
"js-cookie": "^3.0.5",
|
|
62
62
|
"jwt-decode": "^4.0.0",
|
|
63
|
-
"microboard-temp": "^0.5.
|
|
63
|
+
"microboard-temp": "^0.5.17",
|
|
64
64
|
"nanoid": "^5.1.5",
|
|
65
65
|
"prop-types": "^15.8.1",
|
|
66
66
|
"react-hot-toast": "2.4.1",
|