microboard-ui-temp 0.10.1 → 0.10.2
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/{chunk-63m1m4n2.js → chunk-e1r2sk6e.js} +97 -41
- package/dist/example.html +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +97 -41
- package/dist/spa.css +0 -6
- package/dist/spa.js +134 -78
- package/package.json +2 -2
|
@@ -248398,7 +248398,13 @@ var conf = {
|
|
|
248398
248398
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
248399
248399
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
248400
248400
|
MAX_CARD_SIZE: 500,
|
|
248401
|
-
CONNECTOR_ITEM_OFFSET: 20
|
|
248401
|
+
CONNECTOR_ITEM_OFFSET: 20,
|
|
248402
|
+
GRAVITY_G: 80,
|
|
248403
|
+
GRAVITY_G_CENTER: 120,
|
|
248404
|
+
GRAVITY_DAMPING: 0.96,
|
|
248405
|
+
GRAVITY_RESTITUTION: 0.5,
|
|
248406
|
+
GRAVITY_REPULSION: 200,
|
|
248407
|
+
GRAVITY_MAX_DISTANCE: 3000
|
|
248402
248408
|
};
|
|
248403
248409
|
initDefaultI18N();
|
|
248404
248410
|
var BG_LIGHT = "rgb(248, 249, 251)";
|
|
@@ -265528,6 +265534,8 @@ class RichText extends BaseItem {
|
|
|
265528
265534
|
_onLimitReached = () => {};
|
|
265529
265535
|
shrinkWidth = false;
|
|
265530
265536
|
prevMbr = null;
|
|
265537
|
+
customTransformationMatrix;
|
|
265538
|
+
renderingScale;
|
|
265531
265539
|
rtCounter = 0;
|
|
265532
265540
|
constructor(board, container, id2 = "", transformation = new Transformation(id2, board.events), linkTo, placeholderText = conf.i18n?.t("board.textPlaceholder"), isInShape = false, autoSize = false, insideOf, initialTextStyles = conf.DEFAULT_TEXT_STYLES) {
|
|
265533
265541
|
super(board, id2);
|
|
@@ -265650,10 +265658,10 @@ class RichText extends BaseItem {
|
|
|
265650
265658
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
265651
265659
|
if (shouldUpdateLayout) {
|
|
265652
265660
|
this.updateElement();
|
|
265653
|
-
this.subject.publish(this);
|
|
265654
265661
|
} else {
|
|
265655
265662
|
this.transformCanvas();
|
|
265656
265663
|
this.recoordinate(maxWidth);
|
|
265664
|
+
this.subject.publish(this);
|
|
265657
265665
|
}
|
|
265658
265666
|
}
|
|
265659
265667
|
handleFocus = () => {
|
|
@@ -265717,10 +265725,10 @@ class RichText extends BaseItem {
|
|
|
265717
265725
|
}
|
|
265718
265726
|
getMaxWidth() {
|
|
265719
265727
|
if (this.autoSize) {
|
|
265720
|
-
return this.editor.maxWidth || this.
|
|
265728
|
+
return this.editor.maxWidth || this.container.getWidth();
|
|
265721
265729
|
}
|
|
265722
265730
|
if (this.isContainerSet) {
|
|
265723
|
-
return this.
|
|
265731
|
+
return this.container.getWidth();
|
|
265724
265732
|
} else {
|
|
265725
265733
|
return this.containerMaxWidth || this.editor.maxWidth;
|
|
265726
265734
|
}
|
|
@@ -265821,13 +265829,17 @@ class RichText extends BaseItem {
|
|
|
265821
265829
|
return this.shrinkWidth;
|
|
265822
265830
|
}
|
|
265823
265831
|
getTransformedContainer() {
|
|
265824
|
-
|
|
265825
|
-
|
|
265826
|
-
|
|
265827
|
-
|
|
265828
|
-
|
|
265832
|
+
const cameraScale = this.board.camera.getScale();
|
|
265833
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
265834
|
+
let matrix;
|
|
265835
|
+
if (this.customTransformationMatrix) {
|
|
265836
|
+
matrix = this.customTransformationMatrix();
|
|
265837
|
+
} else {
|
|
265838
|
+
matrix = this.transformation.toMatrix();
|
|
265829
265839
|
}
|
|
265830
|
-
|
|
265840
|
+
const { translateX, translateY, scaleX, scaleY } = matrix;
|
|
265841
|
+
const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
|
|
265842
|
+
return this.container.getTransformed(scaledMatrix);
|
|
265831
265843
|
}
|
|
265832
265844
|
emitWithoutApplying = (op) => {
|
|
265833
265845
|
if (this.board.events) {
|
|
@@ -266186,10 +266198,20 @@ class RichText extends BaseItem {
|
|
|
266186
266198
|
const { ctx } = context;
|
|
266187
266199
|
ctx.save();
|
|
266188
266200
|
ctx.translate(this.left, this.top);
|
|
266201
|
+
const cameraScale = context.getCameraScale();
|
|
266202
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
266203
|
+
let matrix;
|
|
266204
|
+
if (this.customTransformationMatrix) {
|
|
266205
|
+
matrix = this.customTransformationMatrix();
|
|
266206
|
+
} else {
|
|
266207
|
+
matrix = this.transformation.toMatrix();
|
|
266208
|
+
}
|
|
266209
|
+
const { scaleX, scaleY } = matrix;
|
|
266189
266210
|
const shouldScale = !this.isInShape && !this.autoSize;
|
|
266190
266211
|
if (shouldScale) {
|
|
266191
|
-
|
|
266192
|
-
|
|
266212
|
+
ctx.scale(scaleX * extraScale, scaleY * extraScale);
|
|
266213
|
+
} else if (extraScale !== 1) {
|
|
266214
|
+
ctx.scale(extraScale, extraScale);
|
|
266193
266215
|
}
|
|
266194
266216
|
const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
|
|
266195
266217
|
if (shouldClip) {
|
|
@@ -266321,10 +266343,18 @@ class RichText extends BaseItem {
|
|
|
266321
266343
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
266322
266344
|
};
|
|
266323
266345
|
const elements = this.editor.editor.children.map(renderNode);
|
|
266324
|
-
const
|
|
266325
|
-
const
|
|
266326
|
-
|
|
266327
|
-
|
|
266346
|
+
const cameraScale = this.board.camera.getScale();
|
|
266347
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
266348
|
+
let matrix;
|
|
266349
|
+
if (this.customTransformationMatrix) {
|
|
266350
|
+
matrix = this.customTransformationMatrix();
|
|
266351
|
+
} else {
|
|
266352
|
+
matrix = this.transformation.toMatrix();
|
|
266353
|
+
}
|
|
266354
|
+
const { scaleX, scaleY } = matrix;
|
|
266355
|
+
const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
|
|
266356
|
+
const transformedWidth = this.getMbr().getWidth();
|
|
266357
|
+
const transformedHeight = this.getMbr().getHeight();
|
|
266328
266358
|
const div = documentFactory.createElement("rich-text");
|
|
266329
266359
|
div.id = this.getId();
|
|
266330
266360
|
div.style.width = `${transformedWidth + 5}px`;
|
|
@@ -282909,7 +282939,9 @@ class Shape extends BaseItem {
|
|
|
282909
282939
|
this.subject.publish(this);
|
|
282910
282940
|
});
|
|
282911
282941
|
this.text.insideOf = this.itemType;
|
|
282942
|
+
this.transformPath();
|
|
282912
282943
|
this.updateMbr();
|
|
282944
|
+
this.subject.publish(this);
|
|
282913
282945
|
}
|
|
282914
282946
|
saveShapeData() {
|
|
282915
282947
|
tempStorage.setShapeData({
|
|
@@ -283458,6 +283490,8 @@ class Sticker extends BaseItem {
|
|
|
283458
283490
|
this.subject.publish(this);
|
|
283459
283491
|
});
|
|
283460
283492
|
this.text.updateElement();
|
|
283493
|
+
this.transformPath();
|
|
283494
|
+
this.subject.publish(this);
|
|
283461
283495
|
}
|
|
283462
283496
|
emit(operation) {
|
|
283463
283497
|
if (this.board.events) {
|
|
@@ -283844,11 +283878,11 @@ function convertBlobToDataUrl(blob) {
|
|
|
283844
283878
|
};
|
|
283845
283879
|
});
|
|
283846
283880
|
}
|
|
283847
|
-
var FRAME_BORDER_COLOR = "
|
|
283881
|
+
var FRAME_BORDER_COLOR = semanticColor("contrastGray");
|
|
283848
283882
|
var FRAME_HIGHLIGHTER_BORDER_COLOR = "#93AFF6";
|
|
283849
283883
|
var FRAME_CHILDREN_HIGHLIGHTER_COLOR = "rgb(10, 15, 41, .08)";
|
|
283850
283884
|
var FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR = "#4778F5";
|
|
283851
|
-
var FRAME_TITLE_COLOR = "
|
|
283885
|
+
var FRAME_TITLE_COLOR = semanticColor("contrastNeutral");
|
|
283852
283886
|
var FRAME_TYPES = [
|
|
283853
283887
|
{ id: "Custom", label: "Custom" },
|
|
283854
283888
|
{ id: "Frame16x9", label: "16:9" },
|
|
@@ -283893,7 +283927,7 @@ class DefaultFrameData {
|
|
|
283893
283927
|
canChangeRatio;
|
|
283894
283928
|
linkTo;
|
|
283895
283929
|
itemType = "Frame";
|
|
283896
|
-
constructor(shapeType = "Custom", backgroundColor =
|
|
283930
|
+
constructor(shapeType = "Custom", backgroundColor = semanticColor("contrastNeutral"), backgroundOpacity = 1, borderColor = FRAME_BORDER_COLOR, borderOpacity = 1, borderStyle = "solid", borderWidth = 0.2, transformation = new DefaultTransformationData, children = [], text5 = new DefaultRichTextData([], "top", 600), canChangeRatio = true, linkTo) {
|
|
283897
283931
|
this.shapeType = shapeType;
|
|
283898
283932
|
this.backgroundColor = backgroundColor;
|
|
283899
283933
|
this.backgroundOpacity = backgroundOpacity;
|
|
@@ -283909,6 +283943,8 @@ class DefaultFrameData {
|
|
|
283909
283943
|
}
|
|
283910
283944
|
}
|
|
283911
283945
|
var defaultFrameData = new DefaultFrameData;
|
|
283946
|
+
var HEADING_TOP_OFFSET = -33;
|
|
283947
|
+
var HEADING_BOTTOM_OFFSET = -5;
|
|
283912
283948
|
|
|
283913
283949
|
class Frame2 extends BaseItem {
|
|
283914
283950
|
getItemById;
|
|
@@ -283924,7 +283960,7 @@ class Frame2 extends BaseItem {
|
|
|
283924
283960
|
parent = "Board";
|
|
283925
283961
|
transformation;
|
|
283926
283962
|
subject = new Subject;
|
|
283927
|
-
textContainer;
|
|
283963
|
+
textContainer = new Mbr;
|
|
283928
283964
|
path;
|
|
283929
283965
|
children = [];
|
|
283930
283966
|
mbr = new Mbr;
|
|
@@ -283945,12 +283981,23 @@ class Frame2 extends BaseItem {
|
|
|
283945
283981
|
this.borderOpacity = borderOpacity;
|
|
283946
283982
|
this.borderStyle = borderStyle;
|
|
283947
283983
|
this.borderWidth = borderWidth;
|
|
283948
|
-
this.textContainer = Frames[this.shapeType].textBounds.copy();
|
|
283949
283984
|
this.path = Frames[this.shapeType].path.copy();
|
|
283950
283985
|
this.transformation = new Transformation(this.id, board.events);
|
|
283951
283986
|
this.linkTo = new LinkTo(this.id, board.events);
|
|
283952
|
-
|
|
283987
|
+
const textBounds = Frames[this.shapeType].textBounds.copy();
|
|
283988
|
+
textBounds.top = HEADING_TOP_OFFSET;
|
|
283989
|
+
textBounds.bottom = HEADING_BOTTOM_OFFSET;
|
|
283990
|
+
this.textContainer = textBounds;
|
|
283991
|
+
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
|
|
283992
|
+
this.text.editor.verticalAlignment = "bottom";
|
|
283953
283993
|
this.text.setSelectionHorisontalAlignment("left");
|
|
283994
|
+
this.text.customTransformationMatrix = () => {
|
|
283995
|
+
const matrix = this.transformation.toMatrix();
|
|
283996
|
+
return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
|
|
283997
|
+
};
|
|
283998
|
+
this.text.renderingScale = (cameraScale) => {
|
|
283999
|
+
return Math.max(1, Math.min(6, 1.2 / cameraScale));
|
|
284000
|
+
};
|
|
283954
284001
|
this.transformation.subject.subscribe(() => {
|
|
283955
284002
|
this.transformPath();
|
|
283956
284003
|
this.updateMbr();
|
|
@@ -283975,9 +284022,17 @@ class Frame2 extends BaseItem {
|
|
|
283975
284022
|
}
|
|
283976
284023
|
initPath() {
|
|
283977
284024
|
this.path = Frames[this.shapeType].path.copy();
|
|
283978
|
-
this.
|
|
283979
|
-
|
|
283980
|
-
|
|
284025
|
+
this.updateTextContainer();
|
|
284026
|
+
}
|
|
284027
|
+
updateTextContainer() {
|
|
284028
|
+
const textBounds = Frames[this.shapeType].textBounds.copy();
|
|
284029
|
+
textBounds.top = HEADING_TOP_OFFSET;
|
|
284030
|
+
textBounds.bottom = HEADING_BOTTOM_OFFSET;
|
|
284031
|
+
this.textContainer = textBounds;
|
|
284032
|
+
if (this.text) {
|
|
284033
|
+
this.text.setContainer(this.textContainer.copy());
|
|
284034
|
+
this.text.updateElement();
|
|
284035
|
+
}
|
|
283981
284036
|
}
|
|
283982
284037
|
getPaths() {
|
|
283983
284038
|
return this.path;
|
|
@@ -284120,6 +284175,7 @@ class Frame2 extends BaseItem {
|
|
|
284120
284175
|
}
|
|
284121
284176
|
if (data.text) {
|
|
284122
284177
|
this.text.deserialize(data.text);
|
|
284178
|
+
this.updateTextContainer();
|
|
284123
284179
|
}
|
|
284124
284180
|
this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
|
|
284125
284181
|
this.subject.publish(this);
|
|
@@ -284135,15 +284191,13 @@ class Frame2 extends BaseItem {
|
|
|
284135
284191
|
}
|
|
284136
284192
|
transformPath(saveProportions = false) {
|
|
284137
284193
|
this.path = Frames[this.shapeType].path.copy();
|
|
284138
|
-
this.
|
|
284194
|
+
this.updateTextContainer();
|
|
284139
284195
|
if (saveProportions) {
|
|
284140
284196
|
const newMatrix = this.getSavedProportionsMatrix();
|
|
284141
284197
|
this.path.transform(newMatrix);
|
|
284142
|
-
this.textContainer.transform(newMatrix);
|
|
284143
284198
|
this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
|
|
284144
284199
|
} else {
|
|
284145
284200
|
this.path.transform(this.transformation.toMatrix());
|
|
284146
|
-
this.textContainer.transform(this.transformation.toMatrix());
|
|
284147
284201
|
}
|
|
284148
284202
|
this.path.setBackgroundOpacity(this.backgroundOpacity);
|
|
284149
284203
|
this.path.setBorderWidth(this.borderWidth);
|
|
@@ -297058,13 +297112,8 @@ class GravityEngine {
|
|
|
297058
297112
|
tickTimer = null;
|
|
297059
297113
|
syncTimer = null;
|
|
297060
297114
|
lastSyncedPositions = new Map;
|
|
297061
|
-
G = 80;
|
|
297062
|
-
G_CENTER = 120;
|
|
297063
|
-
DAMPING = 0.92;
|
|
297064
|
-
REPULSION = 800;
|
|
297065
297115
|
TICK_MS = 33;
|
|
297066
297116
|
SYNC_MS = 300;
|
|
297067
|
-
MAX_DISTANCE = 3000;
|
|
297068
297117
|
SOFTENING_SQ = 50 * 50;
|
|
297069
297118
|
MIN_MOVE_PX = 0.1;
|
|
297070
297119
|
constructor(board) {
|
|
@@ -297133,8 +297182,8 @@ class GravityEngine {
|
|
|
297133
297182
|
const dcx = centerX - s1.cx;
|
|
297134
297183
|
const dcy = centerY - s1.cy;
|
|
297135
297184
|
const distCenter = Math.sqrt(dcx * dcx + dcy * dcy) + 1;
|
|
297136
|
-
ax +=
|
|
297137
|
-
ay +=
|
|
297185
|
+
ax += conf.GRAVITY_G_CENTER * dcx / distCenter;
|
|
297186
|
+
ay += conf.GRAVITY_G_CENTER * dcy / distCenter;
|
|
297138
297187
|
for (let j = 0;j < snap.length; j++) {
|
|
297139
297188
|
if (i === j)
|
|
297140
297189
|
continue;
|
|
@@ -297142,7 +297191,7 @@ class GravityEngine {
|
|
|
297142
297191
|
const dx = s2.cx - s1.cx;
|
|
297143
297192
|
const dy = s2.cy - s1.cy;
|
|
297144
297193
|
const dist = Math.sqrt(dx * dx + dy * dy) + 0.001;
|
|
297145
|
-
if (dist >
|
|
297194
|
+
if (dist > conf.GRAVITY_MAX_DISTANCE)
|
|
297146
297195
|
continue;
|
|
297147
297196
|
const overlapping = s1.right > s2.left && s2.right > s1.left && s1.bottom > s2.top && s2.bottom > s1.top;
|
|
297148
297197
|
if (overlapping) {
|
|
@@ -297150,20 +297199,27 @@ class GravityEngine {
|
|
|
297150
297199
|
const overlapY = Math.min(s1.bottom, s2.bottom) - Math.max(s1.top, s2.top);
|
|
297151
297200
|
if (overlapX < overlapY) {
|
|
297152
297201
|
const sign = s1.cx < s2.cx ? -1 : 1;
|
|
297153
|
-
|
|
297202
|
+
if (sign * vel.vx < 0)
|
|
297203
|
+
vel.vx = -vel.vx * conf.GRAVITY_RESTITUTION;
|
|
297204
|
+
ax += sign * conf.GRAVITY_REPULSION * overlapX;
|
|
297154
297205
|
} else {
|
|
297155
297206
|
const sign = s1.cy < s2.cy ? -1 : 1;
|
|
297156
|
-
|
|
297207
|
+
if (sign * vel.vy < 0)
|
|
297208
|
+
vel.vy = -vel.vy * conf.GRAVITY_RESTITUTION;
|
|
297209
|
+
ay += sign * conf.GRAVITY_REPULSION * overlapY;
|
|
297157
297210
|
}
|
|
297158
297211
|
} else {
|
|
297212
|
+
const touchDist = (s1.w + s2.w + s1.h + s2.h) * 0.25;
|
|
297213
|
+
if (dist < touchDist + 5)
|
|
297214
|
+
continue;
|
|
297159
297215
|
const distSq = dx * dx + dy * dy;
|
|
297160
|
-
const gravAcc =
|
|
297216
|
+
const gravAcc = conf.GRAVITY_G * s2.mass / (distSq + this.SOFTENING_SQ);
|
|
297161
297217
|
ax += gravAcc * dx / dist;
|
|
297162
297218
|
ay += gravAcc * dy / dist;
|
|
297163
297219
|
}
|
|
297164
297220
|
}
|
|
297165
|
-
vel.vx = (vel.vx + ax * dt) *
|
|
297166
|
-
vel.vy = (vel.vy + ay * dt) *
|
|
297221
|
+
vel.vx = (vel.vx + ax * dt) * conf.GRAVITY_DAMPING;
|
|
297222
|
+
vel.vy = (vel.vy + ay * dt) * conf.GRAVITY_DAMPING;
|
|
297167
297223
|
const moveX = vel.vx * dt;
|
|
297168
297224
|
const moveY = vel.vy * dt;
|
|
297169
297225
|
if (Math.abs(moveX) >= this.MIN_MOVE_PX || Math.abs(moveY) >= this.MIN_MOVE_PX) {
|
package/dist/example.html
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
document.documentElement.setAttribute("data-theme", t);
|
|
45
45
|
})();
|
|
46
46
|
</script>
|
|
47
|
-
<link rel="stylesheet" crossorigin href="/chunk-ccbp3q1g.css"><script type="module" crossorigin src="/chunk-
|
|
47
|
+
<link rel="stylesheet" crossorigin href="/chunk-ccbp3q1g.css"><script type="module" crossorigin src="/chunk-e1r2sk6e.js"></script></head>
|
|
48
48
|
|
|
49
49
|
<body
|
|
50
50
|
style="
|
package/dist/index.html
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
document.documentElement.setAttribute("data-theme", t);
|
|
45
45
|
})();
|
|
46
46
|
</script>
|
|
47
|
-
<link rel="stylesheet" crossorigin href="/chunk-ccbp3q1g.css"><script type="module" crossorigin src="/chunk-
|
|
47
|
+
<link rel="stylesheet" crossorigin href="/chunk-ccbp3q1g.css"><script type="module" crossorigin src="/chunk-e1r2sk6e.js"></script></head>
|
|
48
48
|
|
|
49
49
|
<body
|
|
50
50
|
style="
|
package/dist/index.js
CHANGED
|
@@ -248398,7 +248398,13 @@ var conf = {
|
|
|
248398
248398
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
248399
248399
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
248400
248400
|
MAX_CARD_SIZE: 500,
|
|
248401
|
-
CONNECTOR_ITEM_OFFSET: 20
|
|
248401
|
+
CONNECTOR_ITEM_OFFSET: 20,
|
|
248402
|
+
GRAVITY_G: 80,
|
|
248403
|
+
GRAVITY_G_CENTER: 120,
|
|
248404
|
+
GRAVITY_DAMPING: 0.96,
|
|
248405
|
+
GRAVITY_RESTITUTION: 0.5,
|
|
248406
|
+
GRAVITY_REPULSION: 200,
|
|
248407
|
+
GRAVITY_MAX_DISTANCE: 3000
|
|
248402
248408
|
};
|
|
248403
248409
|
initDefaultI18N();
|
|
248404
248410
|
var BG_LIGHT = "rgb(248, 249, 251)";
|
|
@@ -265528,6 +265534,8 @@ class RichText extends BaseItem {
|
|
|
265528
265534
|
_onLimitReached = () => {};
|
|
265529
265535
|
shrinkWidth = false;
|
|
265530
265536
|
prevMbr = null;
|
|
265537
|
+
customTransformationMatrix;
|
|
265538
|
+
renderingScale;
|
|
265531
265539
|
rtCounter = 0;
|
|
265532
265540
|
constructor(board, container, id2 = "", transformation = new Transformation(id2, board.events), linkTo, placeholderText = conf.i18n?.t("board.textPlaceholder"), isInShape = false, autoSize = false, insideOf, initialTextStyles = conf.DEFAULT_TEXT_STYLES) {
|
|
265533
265541
|
super(board, id2);
|
|
@@ -265650,10 +265658,10 @@ class RichText extends BaseItem {
|
|
|
265650
265658
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
265651
265659
|
if (shouldUpdateLayout) {
|
|
265652
265660
|
this.updateElement();
|
|
265653
|
-
this.subject.publish(this);
|
|
265654
265661
|
} else {
|
|
265655
265662
|
this.transformCanvas();
|
|
265656
265663
|
this.recoordinate(maxWidth);
|
|
265664
|
+
this.subject.publish(this);
|
|
265657
265665
|
}
|
|
265658
265666
|
}
|
|
265659
265667
|
handleFocus = () => {
|
|
@@ -265717,10 +265725,10 @@ class RichText extends BaseItem {
|
|
|
265717
265725
|
}
|
|
265718
265726
|
getMaxWidth() {
|
|
265719
265727
|
if (this.autoSize) {
|
|
265720
|
-
return this.editor.maxWidth || this.
|
|
265728
|
+
return this.editor.maxWidth || this.container.getWidth();
|
|
265721
265729
|
}
|
|
265722
265730
|
if (this.isContainerSet) {
|
|
265723
|
-
return this.
|
|
265731
|
+
return this.container.getWidth();
|
|
265724
265732
|
} else {
|
|
265725
265733
|
return this.containerMaxWidth || this.editor.maxWidth;
|
|
265726
265734
|
}
|
|
@@ -265821,13 +265829,17 @@ class RichText extends BaseItem {
|
|
|
265821
265829
|
return this.shrinkWidth;
|
|
265822
265830
|
}
|
|
265823
265831
|
getTransformedContainer() {
|
|
265824
|
-
|
|
265825
|
-
|
|
265826
|
-
|
|
265827
|
-
|
|
265828
|
-
|
|
265832
|
+
const cameraScale = this.board.camera.getScale();
|
|
265833
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
265834
|
+
let matrix;
|
|
265835
|
+
if (this.customTransformationMatrix) {
|
|
265836
|
+
matrix = this.customTransformationMatrix();
|
|
265837
|
+
} else {
|
|
265838
|
+
matrix = this.transformation.toMatrix();
|
|
265829
265839
|
}
|
|
265830
|
-
|
|
265840
|
+
const { translateX, translateY, scaleX, scaleY } = matrix;
|
|
265841
|
+
const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
|
|
265842
|
+
return this.container.getTransformed(scaledMatrix);
|
|
265831
265843
|
}
|
|
265832
265844
|
emitWithoutApplying = (op) => {
|
|
265833
265845
|
if (this.board.events) {
|
|
@@ -266186,10 +266198,20 @@ class RichText extends BaseItem {
|
|
|
266186
266198
|
const { ctx } = context;
|
|
266187
266199
|
ctx.save();
|
|
266188
266200
|
ctx.translate(this.left, this.top);
|
|
266201
|
+
const cameraScale = context.getCameraScale();
|
|
266202
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
266203
|
+
let matrix;
|
|
266204
|
+
if (this.customTransformationMatrix) {
|
|
266205
|
+
matrix = this.customTransformationMatrix();
|
|
266206
|
+
} else {
|
|
266207
|
+
matrix = this.transformation.toMatrix();
|
|
266208
|
+
}
|
|
266209
|
+
const { scaleX, scaleY } = matrix;
|
|
266189
266210
|
const shouldScale = !this.isInShape && !this.autoSize;
|
|
266190
266211
|
if (shouldScale) {
|
|
266191
|
-
|
|
266192
|
-
|
|
266212
|
+
ctx.scale(scaleX * extraScale, scaleY * extraScale);
|
|
266213
|
+
} else if (extraScale !== 1) {
|
|
266214
|
+
ctx.scale(extraScale, extraScale);
|
|
266193
266215
|
}
|
|
266194
266216
|
const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
|
|
266195
266217
|
if (shouldClip) {
|
|
@@ -266321,10 +266343,18 @@ class RichText extends BaseItem {
|
|
|
266321
266343
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
266322
266344
|
};
|
|
266323
266345
|
const elements = this.editor.editor.children.map(renderNode);
|
|
266324
|
-
const
|
|
266325
|
-
const
|
|
266326
|
-
|
|
266327
|
-
|
|
266346
|
+
const cameraScale = this.board.camera.getScale();
|
|
266347
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
266348
|
+
let matrix;
|
|
266349
|
+
if (this.customTransformationMatrix) {
|
|
266350
|
+
matrix = this.customTransformationMatrix();
|
|
266351
|
+
} else {
|
|
266352
|
+
matrix = this.transformation.toMatrix();
|
|
266353
|
+
}
|
|
266354
|
+
const { scaleX, scaleY } = matrix;
|
|
266355
|
+
const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
|
|
266356
|
+
const transformedWidth = this.getMbr().getWidth();
|
|
266357
|
+
const transformedHeight = this.getMbr().getHeight();
|
|
266328
266358
|
const div = documentFactory.createElement("rich-text");
|
|
266329
266359
|
div.id = this.getId();
|
|
266330
266360
|
div.style.width = `${transformedWidth + 5}px`;
|
|
@@ -282909,7 +282939,9 @@ class Shape extends BaseItem {
|
|
|
282909
282939
|
this.subject.publish(this);
|
|
282910
282940
|
});
|
|
282911
282941
|
this.text.insideOf = this.itemType;
|
|
282942
|
+
this.transformPath();
|
|
282912
282943
|
this.updateMbr();
|
|
282944
|
+
this.subject.publish(this);
|
|
282913
282945
|
}
|
|
282914
282946
|
saveShapeData() {
|
|
282915
282947
|
tempStorage.setShapeData({
|
|
@@ -283458,6 +283490,8 @@ class Sticker extends BaseItem {
|
|
|
283458
283490
|
this.subject.publish(this);
|
|
283459
283491
|
});
|
|
283460
283492
|
this.text.updateElement();
|
|
283493
|
+
this.transformPath();
|
|
283494
|
+
this.subject.publish(this);
|
|
283461
283495
|
}
|
|
283462
283496
|
emit(operation) {
|
|
283463
283497
|
if (this.board.events) {
|
|
@@ -283844,11 +283878,11 @@ function convertBlobToDataUrl(blob) {
|
|
|
283844
283878
|
};
|
|
283845
283879
|
});
|
|
283846
283880
|
}
|
|
283847
|
-
var FRAME_BORDER_COLOR = "
|
|
283881
|
+
var FRAME_BORDER_COLOR = semanticColor("contrastGray");
|
|
283848
283882
|
var FRAME_HIGHLIGHTER_BORDER_COLOR = "#93AFF6";
|
|
283849
283883
|
var FRAME_CHILDREN_HIGHLIGHTER_COLOR = "rgb(10, 15, 41, .08)";
|
|
283850
283884
|
var FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR = "#4778F5";
|
|
283851
|
-
var FRAME_TITLE_COLOR = "
|
|
283885
|
+
var FRAME_TITLE_COLOR = semanticColor("contrastNeutral");
|
|
283852
283886
|
var FRAME_TYPES = [
|
|
283853
283887
|
{ id: "Custom", label: "Custom" },
|
|
283854
283888
|
{ id: "Frame16x9", label: "16:9" },
|
|
@@ -283893,7 +283927,7 @@ class DefaultFrameData {
|
|
|
283893
283927
|
canChangeRatio;
|
|
283894
283928
|
linkTo;
|
|
283895
283929
|
itemType = "Frame";
|
|
283896
|
-
constructor(shapeType = "Custom", backgroundColor =
|
|
283930
|
+
constructor(shapeType = "Custom", backgroundColor = semanticColor("contrastNeutral"), backgroundOpacity = 1, borderColor = FRAME_BORDER_COLOR, borderOpacity = 1, borderStyle = "solid", borderWidth = 0.2, transformation = new DefaultTransformationData, children = [], text5 = new DefaultRichTextData([], "top", 600), canChangeRatio = true, linkTo) {
|
|
283897
283931
|
this.shapeType = shapeType;
|
|
283898
283932
|
this.backgroundColor = backgroundColor;
|
|
283899
283933
|
this.backgroundOpacity = backgroundOpacity;
|
|
@@ -283909,6 +283943,8 @@ class DefaultFrameData {
|
|
|
283909
283943
|
}
|
|
283910
283944
|
}
|
|
283911
283945
|
var defaultFrameData = new DefaultFrameData;
|
|
283946
|
+
var HEADING_TOP_OFFSET = -33;
|
|
283947
|
+
var HEADING_BOTTOM_OFFSET = -5;
|
|
283912
283948
|
|
|
283913
283949
|
class Frame2 extends BaseItem {
|
|
283914
283950
|
getItemById;
|
|
@@ -283924,7 +283960,7 @@ class Frame2 extends BaseItem {
|
|
|
283924
283960
|
parent = "Board";
|
|
283925
283961
|
transformation;
|
|
283926
283962
|
subject = new Subject;
|
|
283927
|
-
textContainer;
|
|
283963
|
+
textContainer = new Mbr;
|
|
283928
283964
|
path;
|
|
283929
283965
|
children = [];
|
|
283930
283966
|
mbr = new Mbr;
|
|
@@ -283945,12 +283981,23 @@ class Frame2 extends BaseItem {
|
|
|
283945
283981
|
this.borderOpacity = borderOpacity;
|
|
283946
283982
|
this.borderStyle = borderStyle;
|
|
283947
283983
|
this.borderWidth = borderWidth;
|
|
283948
|
-
this.textContainer = Frames[this.shapeType].textBounds.copy();
|
|
283949
283984
|
this.path = Frames[this.shapeType].path.copy();
|
|
283950
283985
|
this.transformation = new Transformation(this.id, board.events);
|
|
283951
283986
|
this.linkTo = new LinkTo(this.id, board.events);
|
|
283952
|
-
|
|
283987
|
+
const textBounds = Frames[this.shapeType].textBounds.copy();
|
|
283988
|
+
textBounds.top = HEADING_TOP_OFFSET;
|
|
283989
|
+
textBounds.bottom = HEADING_BOTTOM_OFFSET;
|
|
283990
|
+
this.textContainer = textBounds;
|
|
283991
|
+
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
|
|
283992
|
+
this.text.editor.verticalAlignment = "bottom";
|
|
283953
283993
|
this.text.setSelectionHorisontalAlignment("left");
|
|
283994
|
+
this.text.customTransformationMatrix = () => {
|
|
283995
|
+
const matrix = this.transformation.toMatrix();
|
|
283996
|
+
return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
|
|
283997
|
+
};
|
|
283998
|
+
this.text.renderingScale = (cameraScale) => {
|
|
283999
|
+
return Math.max(1, Math.min(6, 1.2 / cameraScale));
|
|
284000
|
+
};
|
|
283954
284001
|
this.transformation.subject.subscribe(() => {
|
|
283955
284002
|
this.transformPath();
|
|
283956
284003
|
this.updateMbr();
|
|
@@ -283975,9 +284022,17 @@ class Frame2 extends BaseItem {
|
|
|
283975
284022
|
}
|
|
283976
284023
|
initPath() {
|
|
283977
284024
|
this.path = Frames[this.shapeType].path.copy();
|
|
283978
|
-
this.
|
|
283979
|
-
|
|
283980
|
-
|
|
284025
|
+
this.updateTextContainer();
|
|
284026
|
+
}
|
|
284027
|
+
updateTextContainer() {
|
|
284028
|
+
const textBounds = Frames[this.shapeType].textBounds.copy();
|
|
284029
|
+
textBounds.top = HEADING_TOP_OFFSET;
|
|
284030
|
+
textBounds.bottom = HEADING_BOTTOM_OFFSET;
|
|
284031
|
+
this.textContainer = textBounds;
|
|
284032
|
+
if (this.text) {
|
|
284033
|
+
this.text.setContainer(this.textContainer.copy());
|
|
284034
|
+
this.text.updateElement();
|
|
284035
|
+
}
|
|
283981
284036
|
}
|
|
283982
284037
|
getPaths() {
|
|
283983
284038
|
return this.path;
|
|
@@ -284120,6 +284175,7 @@ class Frame2 extends BaseItem {
|
|
|
284120
284175
|
}
|
|
284121
284176
|
if (data.text) {
|
|
284122
284177
|
this.text.deserialize(data.text);
|
|
284178
|
+
this.updateTextContainer();
|
|
284123
284179
|
}
|
|
284124
284180
|
this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
|
|
284125
284181
|
this.subject.publish(this);
|
|
@@ -284135,15 +284191,13 @@ class Frame2 extends BaseItem {
|
|
|
284135
284191
|
}
|
|
284136
284192
|
transformPath(saveProportions = false) {
|
|
284137
284193
|
this.path = Frames[this.shapeType].path.copy();
|
|
284138
|
-
this.
|
|
284194
|
+
this.updateTextContainer();
|
|
284139
284195
|
if (saveProportions) {
|
|
284140
284196
|
const newMatrix = this.getSavedProportionsMatrix();
|
|
284141
284197
|
this.path.transform(newMatrix);
|
|
284142
|
-
this.textContainer.transform(newMatrix);
|
|
284143
284198
|
this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
|
|
284144
284199
|
} else {
|
|
284145
284200
|
this.path.transform(this.transformation.toMatrix());
|
|
284146
|
-
this.textContainer.transform(this.transformation.toMatrix());
|
|
284147
284201
|
}
|
|
284148
284202
|
this.path.setBackgroundOpacity(this.backgroundOpacity);
|
|
284149
284203
|
this.path.setBorderWidth(this.borderWidth);
|
|
@@ -297058,13 +297112,8 @@ class GravityEngine {
|
|
|
297058
297112
|
tickTimer = null;
|
|
297059
297113
|
syncTimer = null;
|
|
297060
297114
|
lastSyncedPositions = new Map;
|
|
297061
|
-
G = 80;
|
|
297062
|
-
G_CENTER = 120;
|
|
297063
|
-
DAMPING = 0.92;
|
|
297064
|
-
REPULSION = 800;
|
|
297065
297115
|
TICK_MS = 33;
|
|
297066
297116
|
SYNC_MS = 300;
|
|
297067
|
-
MAX_DISTANCE = 3000;
|
|
297068
297117
|
SOFTENING_SQ = 50 * 50;
|
|
297069
297118
|
MIN_MOVE_PX = 0.1;
|
|
297070
297119
|
constructor(board) {
|
|
@@ -297133,8 +297182,8 @@ class GravityEngine {
|
|
|
297133
297182
|
const dcx = centerX - s1.cx;
|
|
297134
297183
|
const dcy = centerY - s1.cy;
|
|
297135
297184
|
const distCenter = Math.sqrt(dcx * dcx + dcy * dcy) + 1;
|
|
297136
|
-
ax +=
|
|
297137
|
-
ay +=
|
|
297185
|
+
ax += conf.GRAVITY_G_CENTER * dcx / distCenter;
|
|
297186
|
+
ay += conf.GRAVITY_G_CENTER * dcy / distCenter;
|
|
297138
297187
|
for (let j = 0;j < snap.length; j++) {
|
|
297139
297188
|
if (i === j)
|
|
297140
297189
|
continue;
|
|
@@ -297142,7 +297191,7 @@ class GravityEngine {
|
|
|
297142
297191
|
const dx = s2.cx - s1.cx;
|
|
297143
297192
|
const dy = s2.cy - s1.cy;
|
|
297144
297193
|
const dist = Math.sqrt(dx * dx + dy * dy) + 0.001;
|
|
297145
|
-
if (dist >
|
|
297194
|
+
if (dist > conf.GRAVITY_MAX_DISTANCE)
|
|
297146
297195
|
continue;
|
|
297147
297196
|
const overlapping = s1.right > s2.left && s2.right > s1.left && s1.bottom > s2.top && s2.bottom > s1.top;
|
|
297148
297197
|
if (overlapping) {
|
|
@@ -297150,20 +297199,27 @@ class GravityEngine {
|
|
|
297150
297199
|
const overlapY = Math.min(s1.bottom, s2.bottom) - Math.max(s1.top, s2.top);
|
|
297151
297200
|
if (overlapX < overlapY) {
|
|
297152
297201
|
const sign = s1.cx < s2.cx ? -1 : 1;
|
|
297153
|
-
|
|
297202
|
+
if (sign * vel.vx < 0)
|
|
297203
|
+
vel.vx = -vel.vx * conf.GRAVITY_RESTITUTION;
|
|
297204
|
+
ax += sign * conf.GRAVITY_REPULSION * overlapX;
|
|
297154
297205
|
} else {
|
|
297155
297206
|
const sign = s1.cy < s2.cy ? -1 : 1;
|
|
297156
|
-
|
|
297207
|
+
if (sign * vel.vy < 0)
|
|
297208
|
+
vel.vy = -vel.vy * conf.GRAVITY_RESTITUTION;
|
|
297209
|
+
ay += sign * conf.GRAVITY_REPULSION * overlapY;
|
|
297157
297210
|
}
|
|
297158
297211
|
} else {
|
|
297212
|
+
const touchDist = (s1.w + s2.w + s1.h + s2.h) * 0.25;
|
|
297213
|
+
if (dist < touchDist + 5)
|
|
297214
|
+
continue;
|
|
297159
297215
|
const distSq = dx * dx + dy * dy;
|
|
297160
|
-
const gravAcc =
|
|
297216
|
+
const gravAcc = conf.GRAVITY_G * s2.mass / (distSq + this.SOFTENING_SQ);
|
|
297161
297217
|
ax += gravAcc * dx / dist;
|
|
297162
297218
|
ay += gravAcc * dy / dist;
|
|
297163
297219
|
}
|
|
297164
297220
|
}
|
|
297165
|
-
vel.vx = (vel.vx + ax * dt) *
|
|
297166
|
-
vel.vy = (vel.vy + ay * dt) *
|
|
297221
|
+
vel.vx = (vel.vx + ax * dt) * conf.GRAVITY_DAMPING;
|
|
297222
|
+
vel.vy = (vel.vy + ay * dt) * conf.GRAVITY_DAMPING;
|
|
297167
297223
|
const moveX = vel.vx * dt;
|
|
297168
297224
|
const moveY = vel.vy * dt;
|
|
297169
297225
|
if (Math.abs(moveX) >= this.MIN_MOVE_PX || Math.abs(moveY) >= this.MIN_MOVE_PX) {
|
package/dist/spa.css
CHANGED
|
@@ -2883,12 +2883,6 @@ a.link_jFMnzg {
|
|
|
2883
2883
|
background-color: #f7f7f8;
|
|
2884
2884
|
}
|
|
2885
2885
|
|
|
2886
|
-
.quaternary_Lhh5GA {
|
|
2887
|
-
color: #fff;
|
|
2888
|
-
background-color: #924fe8;
|
|
2889
|
-
border: 1px solid #924fe8;
|
|
2890
|
-
}
|
|
2891
|
-
|
|
2892
2886
|
.quaternary_Lhh5GA:hover {
|
|
2893
2887
|
background-color: #b799f5;
|
|
2894
2888
|
border: 1px solid #924fe8;
|
package/dist/spa.js
CHANGED
|
@@ -43029,14 +43029,14 @@ __export(exports_SignatureEnvelope, {
|
|
|
43029
43029
|
validate: () => validate7,
|
|
43030
43030
|
types: () => types9,
|
|
43031
43031
|
toRpc: () => toRpc5,
|
|
43032
|
-
serialize: () =>
|
|
43032
|
+
serialize: () => serialize5,
|
|
43033
43033
|
magicBytes: () => magicBytes3,
|
|
43034
43034
|
getType: () => getType,
|
|
43035
43035
|
fromRpc: () => fromRpc4,
|
|
43036
43036
|
from: () => from15,
|
|
43037
43037
|
extractPublicKey: () => extractPublicKey,
|
|
43038
43038
|
extractAddress: () => extractAddress,
|
|
43039
|
-
deserialize: () =>
|
|
43039
|
+
deserialize: () => deserialize6,
|
|
43040
43040
|
assert: () => assert11,
|
|
43041
43041
|
VerificationError: () => VerificationError2,
|
|
43042
43042
|
MissingPropertiesError: () => MissingPropertiesError2,
|
|
@@ -43128,7 +43128,7 @@ function extractPublicKey(options) {
|
|
|
43128
43128
|
return extractPublicKey({ payload, signature: signature.inner });
|
|
43129
43129
|
}
|
|
43130
43130
|
}
|
|
43131
|
-
function
|
|
43131
|
+
function deserialize6(value) {
|
|
43132
43132
|
const serialized = value.endsWith(magicBytes3.slice(2)) ? slice6(value, 0, -size5(magicBytes3)) : value;
|
|
43133
43133
|
const size8 = size5(serialized);
|
|
43134
43134
|
if (size8 === 65) {
|
|
@@ -43204,7 +43204,7 @@ function deserialize5(value) {
|
|
|
43204
43204
|
}
|
|
43205
43205
|
if (typeId === serializedKeychainType || typeId === serializedKeychainV2Type) {
|
|
43206
43206
|
const userAddress = slice6(data, 0, 20);
|
|
43207
|
-
const inner =
|
|
43207
|
+
const inner = deserialize6(slice6(data, 20));
|
|
43208
43208
|
return {
|
|
43209
43209
|
userAddress,
|
|
43210
43210
|
inner,
|
|
@@ -43219,7 +43219,7 @@ function deserialize5(value) {
|
|
|
43219
43219
|
}
|
|
43220
43220
|
function from15(value, options) {
|
|
43221
43221
|
if (typeof value === "string")
|
|
43222
|
-
return
|
|
43222
|
+
return deserialize6(value);
|
|
43223
43223
|
if (typeof value === "object" && value !== null && "r" in value && "s" in value && "yParity" in value)
|
|
43224
43224
|
return { signature: value, type: "secp256k1" };
|
|
43225
43225
|
const type = getType(value);
|
|
@@ -43333,7 +43333,7 @@ function getType(envelope) {
|
|
|
43333
43333
|
envelope
|
|
43334
43334
|
});
|
|
43335
43335
|
}
|
|
43336
|
-
function
|
|
43336
|
+
function serialize5(envelope, options = {}) {
|
|
43337
43337
|
const type = getType(envelope);
|
|
43338
43338
|
if (type === "secp256k1") {
|
|
43339
43339
|
const secp256k14 = envelope;
|
|
@@ -43351,7 +43351,7 @@ function serialize3(envelope, options = {}) {
|
|
|
43351
43351
|
if (type === "keychain") {
|
|
43352
43352
|
const keychain = envelope;
|
|
43353
43353
|
const keychainTypeId = keychain.version === "v1" ? serializedKeychainType : serializedKeychainV2Type;
|
|
43354
|
-
return concat5(keychainTypeId, keychain.userAddress,
|
|
43354
|
+
return concat5(keychainTypeId, keychain.userAddress, serialize5(keychain.inner), options.magic ? magicBytes3 : "0x");
|
|
43355
43355
|
}
|
|
43356
43356
|
throw new CoercionError({ envelope });
|
|
43357
43357
|
}
|
|
@@ -43611,7 +43611,7 @@ function fromTuple2(tuple) {
|
|
|
43611
43611
|
} : {}
|
|
43612
43612
|
};
|
|
43613
43613
|
if (signatureSerialized)
|
|
43614
|
-
args.signature =
|
|
43614
|
+
args.signature = deserialize6(signatureSerialized);
|
|
43615
43615
|
return from16(args);
|
|
43616
43616
|
}
|
|
43617
43617
|
function toRpc6(authorization) {
|
|
@@ -43630,7 +43630,7 @@ function toRpc6(authorization) {
|
|
|
43630
43630
|
}
|
|
43631
43631
|
function toTuple3(authorization) {
|
|
43632
43632
|
const { address, chainId, expiry, limits } = authorization;
|
|
43633
|
-
const signature = authorization.signature ?
|
|
43633
|
+
const signature = authorization.signature ? serialize5(authorization.signature) : undefined;
|
|
43634
43634
|
const type = (() => {
|
|
43635
43635
|
switch (authorization.type) {
|
|
43636
43636
|
case "secp256k1":
|
|
@@ -43801,7 +43801,7 @@ function fromTuple3(tuple) {
|
|
|
43801
43801
|
nonce: nonce === "0x" ? 0n : BigInt(nonce)
|
|
43802
43802
|
};
|
|
43803
43803
|
if (signatureSerialized)
|
|
43804
|
-
args.signature =
|
|
43804
|
+
args.signature = deserialize6(signatureSerialized);
|
|
43805
43805
|
return from17(args);
|
|
43806
43806
|
}
|
|
43807
43807
|
function fromTupleList(tupleList) {
|
|
@@ -43824,7 +43824,7 @@ function toRpcList2(authorizationList) {
|
|
|
43824
43824
|
}
|
|
43825
43825
|
function toTuple4(authorization) {
|
|
43826
43826
|
const { address, chainId, nonce } = authorization;
|
|
43827
|
-
const signature = authorization.signature ?
|
|
43827
|
+
const signature = authorization.signature ? serialize5(authorization.signature) : undefined;
|
|
43828
43828
|
return [
|
|
43829
43829
|
chainId ? fromNumber(chainId) : "0x",
|
|
43830
43830
|
address,
|
|
@@ -44196,13 +44196,13 @@ __export(exports_TxEnvelopeTempo, {
|
|
|
44196
44196
|
validate: () => validate8,
|
|
44197
44197
|
type: () => type,
|
|
44198
44198
|
serializedType: () => serializedType,
|
|
44199
|
-
serialize: () =>
|
|
44199
|
+
serialize: () => serialize6,
|
|
44200
44200
|
hash: () => hash5,
|
|
44201
44201
|
getSignPayload: () => getSignPayload3,
|
|
44202
44202
|
getFeePayerSignPayload: () => getFeePayerSignPayload,
|
|
44203
44203
|
from: () => from18,
|
|
44204
44204
|
feePayerMagic: () => feePayerMagic,
|
|
44205
|
-
deserialize: () =>
|
|
44205
|
+
deserialize: () => deserialize7,
|
|
44206
44206
|
assert: () => assert12,
|
|
44207
44207
|
InvalidValidityWindowError: () => InvalidValidityWindowError,
|
|
44208
44208
|
CallsEmptyError: () => CallsEmptyError
|
|
@@ -44234,7 +44234,7 @@ function assert12(envelope) {
|
|
|
44234
44234
|
maxPriorityFeePerGas
|
|
44235
44235
|
});
|
|
44236
44236
|
}
|
|
44237
|
-
function
|
|
44237
|
+
function deserialize7(serialized) {
|
|
44238
44238
|
const transactionArray = toHex4(slice6(serialized, 1));
|
|
44239
44239
|
const [chainId, maxPriorityFeePerGas, maxFeePerGas, gas, calls, accessList, nonceKey, nonce, validBefore, validAfter, feeToken, feePayerSignatureOrSender, authorizationList, keyAuthorizationOrSignature, maybeSignature] = transactionArray;
|
|
44240
44240
|
const keyAuthorization = Array.isArray(keyAuthorizationOrSignature) ? keyAuthorizationOrSignature : undefined;
|
|
@@ -44311,7 +44311,7 @@ function deserialize6(serialized) {
|
|
|
44311
44311
|
}
|
|
44312
44312
|
if (keyAuthorization)
|
|
44313
44313
|
transaction.keyAuthorization = fromTuple2(keyAuthorization);
|
|
44314
|
-
const signatureEnvelope = signature ?
|
|
44314
|
+
const signatureEnvelope = signature ? deserialize6(signature) : undefined;
|
|
44315
44315
|
if (signatureEnvelope)
|
|
44316
44316
|
transaction = {
|
|
44317
44317
|
...transaction,
|
|
@@ -44331,7 +44331,7 @@ function deserialize6(serialized) {
|
|
|
44331
44331
|
}
|
|
44332
44332
|
function from18(envelope, options = {}) {
|
|
44333
44333
|
const { feePayerSignature, signature } = options;
|
|
44334
|
-
const envelope_ = typeof envelope === "string" ?
|
|
44334
|
+
const envelope_ = typeof envelope === "string" ? deserialize7(envelope) : envelope;
|
|
44335
44335
|
if (envelope_.from)
|
|
44336
44336
|
envelope_.from = resolve2(envelope_.from);
|
|
44337
44337
|
if (envelope_.calls)
|
|
@@ -44347,7 +44347,7 @@ function from18(envelope, options = {}) {
|
|
|
44347
44347
|
type: "tempo"
|
|
44348
44348
|
};
|
|
44349
44349
|
}
|
|
44350
|
-
function
|
|
44350
|
+
function serialize6(envelope, options = {}) {
|
|
44351
44351
|
const { accessList, authorizationList, calls, chainId, feeToken, gas, keyAuthorization, nonce, nonceKey, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter } = envelope;
|
|
44352
44352
|
assert12(envelope);
|
|
44353
44353
|
const accessTupleList = toTupleList2(accessList);
|
|
@@ -44398,7 +44398,7 @@ function serialize5(envelope, options = {}) {
|
|
|
44398
44398
|
feePayerSignatureOrSender,
|
|
44399
44399
|
authorizationTupleList,
|
|
44400
44400
|
...keyAuthorization ? [toTuple3(keyAuthorization)] : [],
|
|
44401
|
-
...signature ? [
|
|
44401
|
+
...signature ? [serialize5(from15(signature))] : []
|
|
44402
44402
|
];
|
|
44403
44403
|
return concat5(options.format === "feePayer" ? feePayerMagic : serializedType, fromHex4(serialized));
|
|
44404
44404
|
}
|
|
@@ -44409,7 +44409,7 @@ function getSignPayload3(envelope, options = {}) {
|
|
|
44409
44409
|
return sigHash;
|
|
44410
44410
|
}
|
|
44411
44411
|
function hash5(envelope, options = {}) {
|
|
44412
|
-
const serialized =
|
|
44412
|
+
const serialized = serialize6({
|
|
44413
44413
|
...envelope,
|
|
44414
44414
|
...options.presign ? {
|
|
44415
44415
|
signature: undefined,
|
|
@@ -44420,7 +44420,7 @@ function hash5(envelope, options = {}) {
|
|
|
44420
44420
|
}
|
|
44421
44421
|
function getFeePayerSignPayload(envelope, options) {
|
|
44422
44422
|
const sender = resolve2(options.sender);
|
|
44423
|
-
const serialized =
|
|
44423
|
+
const serialized = serialize6({ ...envelope, signature: undefined }, {
|
|
44424
44424
|
sender,
|
|
44425
44425
|
format: "feePayer"
|
|
44426
44426
|
});
|
|
@@ -44500,7 +44500,7 @@ function isTempo(transaction) {
|
|
|
44500
44500
|
return false;
|
|
44501
44501
|
}
|
|
44502
44502
|
}
|
|
44503
|
-
async function
|
|
44503
|
+
async function serialize7(transaction, signature) {
|
|
44504
44504
|
if (!isTempo(transaction)) {
|
|
44505
44505
|
if (signature && "type" in signature && signature.type !== "secp256k1")
|
|
44506
44506
|
throw new Error("Unsupported signature type. Expected `secp256k1` but got `" + signature.type + "`.");
|
|
@@ -44761,7 +44761,7 @@ var init_chainConfig5 = __esm(() => {
|
|
|
44761
44761
|
{ runAt: ["beforeFillTransaction", "afterFillParameters"] }
|
|
44762
44762
|
],
|
|
44763
44763
|
serializers: {
|
|
44764
|
-
transaction: (transaction, signature) =>
|
|
44764
|
+
transaction: (transaction, signature) => serialize7(transaction, signature)
|
|
44765
44765
|
},
|
|
44766
44766
|
async verifyHash(client, parameters) {
|
|
44767
44767
|
const { address, hash: hash6, signature } = parameters;
|
|
@@ -52146,7 +52146,7 @@ function isValidCode(code3) {
|
|
|
52146
52146
|
}
|
|
52147
52147
|
return false;
|
|
52148
52148
|
}
|
|
52149
|
-
function
|
|
52149
|
+
function serialize8(error2, { shouldIncludeStack = false } = {}) {
|
|
52150
52150
|
const serialized = {};
|
|
52151
52151
|
if (error2 && typeof error2 === "object" && !Array.isArray(error2) && hasKey(error2, "code") && isValidCode(error2.code)) {
|
|
52152
52152
|
const _error = error2;
|
|
@@ -53372,7 +53372,7 @@ var init_Communicator = __esm(() => {
|
|
|
53372
53372
|
|
|
53373
53373
|
// node_modules/wagmi/node_modules/@wagmi/connectors/node_modules/@base-org/account/dist/core/error/serialize.js
|
|
53374
53374
|
function serializeError(error2) {
|
|
53375
|
-
const serialized =
|
|
53375
|
+
const serialized = serialize8(getErrorObject(error2), {
|
|
53376
53376
|
shouldIncludeStack: true
|
|
53377
53377
|
});
|
|
53378
53378
|
const docUrl = new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");
|
|
@@ -61104,7 +61104,7 @@ var defaultGetStoreFunc;
|
|
|
61104
61104
|
var init_dist = () => {};
|
|
61105
61105
|
|
|
61106
61106
|
// node_modules/wagmi/node_modules/@wagmi/connectors/node_modules/@base-org/account/dist/kms/crypto-key/storage.js
|
|
61107
|
-
function
|
|
61107
|
+
function createStorage3(scope, name) {
|
|
61108
61108
|
const store2 = typeof indexedDB !== "undefined" ? createStore4(scope, name) : undefined;
|
|
61109
61109
|
return {
|
|
61110
61110
|
getItem: async (key) => {
|
|
@@ -61209,7 +61209,7 @@ var init_crypto_key = __esm(() => {
|
|
|
61209
61209
|
init__esm2();
|
|
61210
61210
|
init__esm();
|
|
61211
61211
|
init_storage();
|
|
61212
|
-
storage =
|
|
61212
|
+
storage = createStorage3(STORAGE_SCOPE, STORAGE_NAME);
|
|
61213
61213
|
});
|
|
61214
61214
|
|
|
61215
61215
|
// node_modules/wagmi/node_modules/@wagmi/connectors/node_modules/@base-org/account/dist/sign/base-account/SCWKeyManager.js
|
|
@@ -113650,10 +113650,10 @@ var require_createWalletClient = __commonJS((exports2) => {
|
|
|
113650
113650
|
// node_modules/viem/_cjs/clients/transports/createTransport.js
|
|
113651
113651
|
var require_createTransport = __commonJS((exports2) => {
|
|
113652
113652
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
113653
|
-
exports2.createTransport =
|
|
113653
|
+
exports2.createTransport = createTransport3;
|
|
113654
113654
|
var buildRequest_js_1 = require_buildRequest();
|
|
113655
113655
|
var uid_js_1 = require_uid();
|
|
113656
|
-
function
|
|
113656
|
+
function createTransport3({ key, methods: methods3, name, request: request2, retryCount = 3, retryDelay = 150, timeout: timeout2, type: type2 }, value2) {
|
|
113657
113657
|
const uid4 = (0, uid_js_1.uid)();
|
|
113658
113658
|
return {
|
|
113659
113659
|
config: {
|
|
@@ -126347,7 +126347,7 @@ var init_unstorage_zVDD2mZo = () => {};
|
|
|
126347
126347
|
function defineDriver(factory) {
|
|
126348
126348
|
return factory;
|
|
126349
126349
|
}
|
|
126350
|
-
function
|
|
126350
|
+
function createStorage4(options2 = {}) {
|
|
126351
126351
|
const context = {
|
|
126352
126352
|
mounts: { "": options2.driver || memory() },
|
|
126353
126353
|
mountpoints: [""],
|
|
@@ -126730,7 +126730,7 @@ var init_dist4 = __esm(() => {
|
|
|
126730
126730
|
// node_modules/@walletconnect/keyvaluestorage/dist/index.es.js
|
|
126731
126731
|
class _4 {
|
|
126732
126732
|
constructor() {
|
|
126733
|
-
this.indexedDb =
|
|
126733
|
+
this.indexedDb = createStorage4({ driver: z4({ dbName: D4, storeName: E2 }) });
|
|
126734
126734
|
}
|
|
126735
126735
|
async getKeys() {
|
|
126736
126736
|
return this.indexedDb.getKeys();
|
|
@@ -248398,7 +248398,13 @@ var conf = {
|
|
|
248398
248398
|
CARD_DIMENSIONS: { width: 250, height: 400 },
|
|
248399
248399
|
DEFAULT_GAME_ITEM_DIMENSIONS: { width: 200, height: 200 },
|
|
248400
248400
|
MAX_CARD_SIZE: 500,
|
|
248401
|
-
CONNECTOR_ITEM_OFFSET: 20
|
|
248401
|
+
CONNECTOR_ITEM_OFFSET: 20,
|
|
248402
|
+
GRAVITY_G: 80,
|
|
248403
|
+
GRAVITY_G_CENTER: 120,
|
|
248404
|
+
GRAVITY_DAMPING: 0.96,
|
|
248405
|
+
GRAVITY_RESTITUTION: 0.5,
|
|
248406
|
+
GRAVITY_REPULSION: 200,
|
|
248407
|
+
GRAVITY_MAX_DISTANCE: 3000
|
|
248402
248408
|
};
|
|
248403
248409
|
initDefaultI18N();
|
|
248404
248410
|
var BG_LIGHT = "rgb(248, 249, 251)";
|
|
@@ -265528,6 +265534,8 @@ class RichText extends BaseItem {
|
|
|
265528
265534
|
_onLimitReached = () => {};
|
|
265529
265535
|
shrinkWidth = false;
|
|
265530
265536
|
prevMbr = null;
|
|
265537
|
+
customTransformationMatrix;
|
|
265538
|
+
renderingScale;
|
|
265531
265539
|
rtCounter = 0;
|
|
265532
265540
|
constructor(board, container, id2 = "", transformation = new Transformation(id2, board.events), linkTo, placeholderText = conf.i18n?.t("board.textPlaceholder"), isInShape = false, autoSize = false, insideOf, initialTextStyles = conf.DEFAULT_TEXT_STYLES) {
|
|
265533
265541
|
super(board, id2);
|
|
@@ -265650,10 +265658,10 @@ class RichText extends BaseItem {
|
|
|
265650
265658
|
const shouldUpdateLayout = this.getTextWidth() > (maxWidth || 0);
|
|
265651
265659
|
if (shouldUpdateLayout) {
|
|
265652
265660
|
this.updateElement();
|
|
265653
|
-
this.subject.publish(this);
|
|
265654
265661
|
} else {
|
|
265655
265662
|
this.transformCanvas();
|
|
265656
265663
|
this.recoordinate(maxWidth);
|
|
265664
|
+
this.subject.publish(this);
|
|
265657
265665
|
}
|
|
265658
265666
|
}
|
|
265659
265667
|
handleFocus = () => {
|
|
@@ -265717,10 +265725,10 @@ class RichText extends BaseItem {
|
|
|
265717
265725
|
}
|
|
265718
265726
|
getMaxWidth() {
|
|
265719
265727
|
if (this.autoSize) {
|
|
265720
|
-
return this.editor.maxWidth || this.
|
|
265728
|
+
return this.editor.maxWidth || this.container.getWidth();
|
|
265721
265729
|
}
|
|
265722
265730
|
if (this.isContainerSet) {
|
|
265723
|
-
return this.
|
|
265731
|
+
return this.container.getWidth();
|
|
265724
265732
|
} else {
|
|
265725
265733
|
return this.containerMaxWidth || this.editor.maxWidth;
|
|
265726
265734
|
}
|
|
@@ -265821,13 +265829,17 @@ class RichText extends BaseItem {
|
|
|
265821
265829
|
return this.shrinkWidth;
|
|
265822
265830
|
}
|
|
265823
265831
|
getTransformedContainer() {
|
|
265824
|
-
|
|
265825
|
-
|
|
265826
|
-
|
|
265827
|
-
|
|
265828
|
-
|
|
265832
|
+
const cameraScale = this.board.camera.getScale();
|
|
265833
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
265834
|
+
let matrix;
|
|
265835
|
+
if (this.customTransformationMatrix) {
|
|
265836
|
+
matrix = this.customTransformationMatrix();
|
|
265837
|
+
} else {
|
|
265838
|
+
matrix = this.transformation.toMatrix();
|
|
265829
265839
|
}
|
|
265830
|
-
|
|
265840
|
+
const { translateX, translateY, scaleX, scaleY } = matrix;
|
|
265841
|
+
const scaledMatrix = new Matrix(translateX, translateY, scaleX, scaleY);
|
|
265842
|
+
return this.container.getTransformed(scaledMatrix);
|
|
265831
265843
|
}
|
|
265832
265844
|
emitWithoutApplying = (op) => {
|
|
265833
265845
|
if (this.board.events) {
|
|
@@ -266186,10 +266198,20 @@ class RichText extends BaseItem {
|
|
|
266186
266198
|
const { ctx } = context;
|
|
266187
266199
|
ctx.save();
|
|
266188
266200
|
ctx.translate(this.left, this.top);
|
|
266201
|
+
const cameraScale = context.getCameraScale();
|
|
266202
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
266203
|
+
let matrix;
|
|
266204
|
+
if (this.customTransformationMatrix) {
|
|
266205
|
+
matrix = this.customTransformationMatrix();
|
|
266206
|
+
} else {
|
|
266207
|
+
matrix = this.transformation.toMatrix();
|
|
266208
|
+
}
|
|
266209
|
+
const { scaleX, scaleY } = matrix;
|
|
266189
266210
|
const shouldScale = !this.isInShape && !this.autoSize;
|
|
266190
266211
|
if (shouldScale) {
|
|
266191
|
-
|
|
266192
|
-
|
|
266212
|
+
ctx.scale(scaleX * extraScale, scaleY * extraScale);
|
|
266213
|
+
} else if (extraScale !== 1) {
|
|
266214
|
+
ctx.scale(extraScale, extraScale);
|
|
266193
266215
|
}
|
|
266194
266216
|
const shouldClip = this.insideOf === "Shape" || this.insideOf === "Sticker";
|
|
266195
266217
|
if (shouldClip) {
|
|
@@ -266321,10 +266343,18 @@ class RichText extends BaseItem {
|
|
|
266321
266343
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
266322
266344
|
};
|
|
266323
266345
|
const elements = this.editor.editor.children.map(renderNode);
|
|
266324
|
-
const
|
|
266325
|
-
const
|
|
266326
|
-
|
|
266327
|
-
|
|
266346
|
+
const cameraScale = this.board.camera.getScale();
|
|
266347
|
+
const extraScale = this.renderingScale ? this.renderingScale(cameraScale) : 1;
|
|
266348
|
+
let matrix;
|
|
266349
|
+
if (this.customTransformationMatrix) {
|
|
266350
|
+
matrix = this.customTransformationMatrix();
|
|
266351
|
+
} else {
|
|
266352
|
+
matrix = this.transformation.toMatrix();
|
|
266353
|
+
}
|
|
266354
|
+
const { scaleX, scaleY } = matrix;
|
|
266355
|
+
const transform = `translate(${this.left}px, ${this.top}px) scale(${scaleX * extraScale}, ${scaleY * extraScale})`;
|
|
266356
|
+
const transformedWidth = this.getMbr().getWidth();
|
|
266357
|
+
const transformedHeight = this.getMbr().getHeight();
|
|
266328
266358
|
const div = documentFactory.createElement("rich-text");
|
|
266329
266359
|
div.id = this.getId();
|
|
266330
266360
|
div.style.width = `${transformedWidth + 5}px`;
|
|
@@ -282909,7 +282939,9 @@ class Shape extends BaseItem {
|
|
|
282909
282939
|
this.subject.publish(this);
|
|
282910
282940
|
});
|
|
282911
282941
|
this.text.insideOf = this.itemType;
|
|
282942
|
+
this.transformPath();
|
|
282912
282943
|
this.updateMbr();
|
|
282944
|
+
this.subject.publish(this);
|
|
282913
282945
|
}
|
|
282914
282946
|
saveShapeData() {
|
|
282915
282947
|
tempStorage.setShapeData({
|
|
@@ -283458,6 +283490,8 @@ class Sticker extends BaseItem {
|
|
|
283458
283490
|
this.subject.publish(this);
|
|
283459
283491
|
});
|
|
283460
283492
|
this.text.updateElement();
|
|
283493
|
+
this.transformPath();
|
|
283494
|
+
this.subject.publish(this);
|
|
283461
283495
|
}
|
|
283462
283496
|
emit(operation) {
|
|
283463
283497
|
if (this.board.events) {
|
|
@@ -283844,11 +283878,11 @@ function convertBlobToDataUrl(blob) {
|
|
|
283844
283878
|
};
|
|
283845
283879
|
});
|
|
283846
283880
|
}
|
|
283847
|
-
var FRAME_BORDER_COLOR = "
|
|
283881
|
+
var FRAME_BORDER_COLOR = semanticColor("contrastGray");
|
|
283848
283882
|
var FRAME_HIGHLIGHTER_BORDER_COLOR = "#93AFF6";
|
|
283849
283883
|
var FRAME_CHILDREN_HIGHLIGHTER_COLOR = "rgb(10, 15, 41, .08)";
|
|
283850
283884
|
var FRAME_CHILDREN_HIGHLIGHTER_BORDER_COLOR = "#4778F5";
|
|
283851
|
-
var FRAME_TITLE_COLOR = "
|
|
283885
|
+
var FRAME_TITLE_COLOR = semanticColor("contrastNeutral");
|
|
283852
283886
|
var FRAME_TYPES = [
|
|
283853
283887
|
{ id: "Custom", label: "Custom" },
|
|
283854
283888
|
{ id: "Frame16x9", label: "16:9" },
|
|
@@ -283893,7 +283927,7 @@ class DefaultFrameData {
|
|
|
283893
283927
|
canChangeRatio;
|
|
283894
283928
|
linkTo;
|
|
283895
283929
|
itemType = "Frame";
|
|
283896
|
-
constructor(shapeType = "Custom", backgroundColor =
|
|
283930
|
+
constructor(shapeType = "Custom", backgroundColor = semanticColor("contrastNeutral"), backgroundOpacity = 1, borderColor = FRAME_BORDER_COLOR, borderOpacity = 1, borderStyle = "solid", borderWidth = 0.2, transformation = new DefaultTransformationData, children = [], text5 = new DefaultRichTextData([], "top", 600), canChangeRatio = true, linkTo) {
|
|
283897
283931
|
this.shapeType = shapeType;
|
|
283898
283932
|
this.backgroundColor = backgroundColor;
|
|
283899
283933
|
this.backgroundOpacity = backgroundOpacity;
|
|
@@ -283909,6 +283943,8 @@ class DefaultFrameData {
|
|
|
283909
283943
|
}
|
|
283910
283944
|
}
|
|
283911
283945
|
var defaultFrameData = new DefaultFrameData;
|
|
283946
|
+
var HEADING_TOP_OFFSET = -33;
|
|
283947
|
+
var HEADING_BOTTOM_OFFSET = -5;
|
|
283912
283948
|
|
|
283913
283949
|
class Frame2 extends BaseItem {
|
|
283914
283950
|
getItemById;
|
|
@@ -283924,7 +283960,7 @@ class Frame2 extends BaseItem {
|
|
|
283924
283960
|
parent = "Board";
|
|
283925
283961
|
transformation;
|
|
283926
283962
|
subject = new Subject;
|
|
283927
|
-
textContainer;
|
|
283963
|
+
textContainer = new Mbr;
|
|
283928
283964
|
path;
|
|
283929
283965
|
children = [];
|
|
283930
283966
|
mbr = new Mbr;
|
|
@@ -283945,12 +283981,23 @@ class Frame2 extends BaseItem {
|
|
|
283945
283981
|
this.borderOpacity = borderOpacity;
|
|
283946
283982
|
this.borderStyle = borderStyle;
|
|
283947
283983
|
this.borderWidth = borderWidth;
|
|
283948
|
-
this.textContainer = Frames[this.shapeType].textBounds.copy();
|
|
283949
283984
|
this.path = Frames[this.shapeType].path.copy();
|
|
283950
283985
|
this.transformation = new Transformation(this.id, board.events);
|
|
283951
283986
|
this.linkTo = new LinkTo(this.id, board.events);
|
|
283952
|
-
|
|
283987
|
+
const textBounds = Frames[this.shapeType].textBounds.copy();
|
|
283988
|
+
textBounds.top = HEADING_TOP_OFFSET;
|
|
283989
|
+
textBounds.bottom = HEADING_BOTTOM_OFFSET;
|
|
283990
|
+
this.textContainer = textBounds;
|
|
283991
|
+
this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontSize: 18, fontColor: FRAME_TITLE_COLOR });
|
|
283992
|
+
this.text.editor.verticalAlignment = "bottom";
|
|
283953
283993
|
this.text.setSelectionHorisontalAlignment("left");
|
|
283994
|
+
this.text.customTransformationMatrix = () => {
|
|
283995
|
+
const matrix = this.transformation.toMatrix();
|
|
283996
|
+
return new Matrix(matrix.translateX, matrix.translateY, 1, 1);
|
|
283997
|
+
};
|
|
283998
|
+
this.text.renderingScale = (cameraScale) => {
|
|
283999
|
+
return Math.max(1, Math.min(6, 1.2 / cameraScale));
|
|
284000
|
+
};
|
|
283954
284001
|
this.transformation.subject.subscribe(() => {
|
|
283955
284002
|
this.transformPath();
|
|
283956
284003
|
this.updateMbr();
|
|
@@ -283975,9 +284022,17 @@ class Frame2 extends BaseItem {
|
|
|
283975
284022
|
}
|
|
283976
284023
|
initPath() {
|
|
283977
284024
|
this.path = Frames[this.shapeType].path.copy();
|
|
283978
|
-
this.
|
|
283979
|
-
|
|
283980
|
-
|
|
284025
|
+
this.updateTextContainer();
|
|
284026
|
+
}
|
|
284027
|
+
updateTextContainer() {
|
|
284028
|
+
const textBounds = Frames[this.shapeType].textBounds.copy();
|
|
284029
|
+
textBounds.top = HEADING_TOP_OFFSET;
|
|
284030
|
+
textBounds.bottom = HEADING_BOTTOM_OFFSET;
|
|
284031
|
+
this.textContainer = textBounds;
|
|
284032
|
+
if (this.text) {
|
|
284033
|
+
this.text.setContainer(this.textContainer.copy());
|
|
284034
|
+
this.text.updateElement();
|
|
284035
|
+
}
|
|
283981
284036
|
}
|
|
283982
284037
|
getPaths() {
|
|
283983
284038
|
return this.path;
|
|
@@ -284120,6 +284175,7 @@ class Frame2 extends BaseItem {
|
|
|
284120
284175
|
}
|
|
284121
284176
|
if (data.text) {
|
|
284122
284177
|
this.text.deserialize(data.text);
|
|
284178
|
+
this.updateTextContainer();
|
|
284123
284179
|
}
|
|
284124
284180
|
this.canChangeRatio = data.canChangeRatio ?? this.canChangeRatio;
|
|
284125
284181
|
this.subject.publish(this);
|
|
@@ -284135,15 +284191,13 @@ class Frame2 extends BaseItem {
|
|
|
284135
284191
|
}
|
|
284136
284192
|
transformPath(saveProportions = false) {
|
|
284137
284193
|
this.path = Frames[this.shapeType].path.copy();
|
|
284138
|
-
this.
|
|
284194
|
+
this.updateTextContainer();
|
|
284139
284195
|
if (saveProportions) {
|
|
284140
284196
|
const newMatrix = this.getSavedProportionsMatrix();
|
|
284141
284197
|
this.path.transform(newMatrix);
|
|
284142
|
-
this.textContainer.transform(newMatrix);
|
|
284143
284198
|
this.transformation.applyScaleTo(newMatrix.scaleX, newMatrix.scaleY);
|
|
284144
284199
|
} else {
|
|
284145
284200
|
this.path.transform(this.transformation.toMatrix());
|
|
284146
|
-
this.textContainer.transform(this.transformation.toMatrix());
|
|
284147
284201
|
}
|
|
284148
284202
|
this.path.setBackgroundOpacity(this.backgroundOpacity);
|
|
284149
284203
|
this.path.setBorderWidth(this.borderWidth);
|
|
@@ -297058,13 +297112,8 @@ class GravityEngine {
|
|
|
297058
297112
|
tickTimer = null;
|
|
297059
297113
|
syncTimer = null;
|
|
297060
297114
|
lastSyncedPositions = new Map;
|
|
297061
|
-
G = 80;
|
|
297062
|
-
G_CENTER = 120;
|
|
297063
|
-
DAMPING = 0.92;
|
|
297064
|
-
REPULSION = 800;
|
|
297065
297115
|
TICK_MS = 33;
|
|
297066
297116
|
SYNC_MS = 300;
|
|
297067
|
-
MAX_DISTANCE = 3000;
|
|
297068
297117
|
SOFTENING_SQ = 50 * 50;
|
|
297069
297118
|
MIN_MOVE_PX = 0.1;
|
|
297070
297119
|
constructor(board) {
|
|
@@ -297133,8 +297182,8 @@ class GravityEngine {
|
|
|
297133
297182
|
const dcx = centerX - s1.cx;
|
|
297134
297183
|
const dcy = centerY - s1.cy;
|
|
297135
297184
|
const distCenter = Math.sqrt(dcx * dcx + dcy * dcy) + 1;
|
|
297136
|
-
ax +=
|
|
297137
|
-
ay +=
|
|
297185
|
+
ax += conf.GRAVITY_G_CENTER * dcx / distCenter;
|
|
297186
|
+
ay += conf.GRAVITY_G_CENTER * dcy / distCenter;
|
|
297138
297187
|
for (let j = 0;j < snap.length; j++) {
|
|
297139
297188
|
if (i === j)
|
|
297140
297189
|
continue;
|
|
@@ -297142,7 +297191,7 @@ class GravityEngine {
|
|
|
297142
297191
|
const dx = s2.cx - s1.cx;
|
|
297143
297192
|
const dy = s2.cy - s1.cy;
|
|
297144
297193
|
const dist = Math.sqrt(dx * dx + dy * dy) + 0.001;
|
|
297145
|
-
if (dist >
|
|
297194
|
+
if (dist > conf.GRAVITY_MAX_DISTANCE)
|
|
297146
297195
|
continue;
|
|
297147
297196
|
const overlapping = s1.right > s2.left && s2.right > s1.left && s1.bottom > s2.top && s2.bottom > s1.top;
|
|
297148
297197
|
if (overlapping) {
|
|
@@ -297150,20 +297199,27 @@ class GravityEngine {
|
|
|
297150
297199
|
const overlapY = Math.min(s1.bottom, s2.bottom) - Math.max(s1.top, s2.top);
|
|
297151
297200
|
if (overlapX < overlapY) {
|
|
297152
297201
|
const sign = s1.cx < s2.cx ? -1 : 1;
|
|
297153
|
-
|
|
297202
|
+
if (sign * vel.vx < 0)
|
|
297203
|
+
vel.vx = -vel.vx * conf.GRAVITY_RESTITUTION;
|
|
297204
|
+
ax += sign * conf.GRAVITY_REPULSION * overlapX;
|
|
297154
297205
|
} else {
|
|
297155
297206
|
const sign = s1.cy < s2.cy ? -1 : 1;
|
|
297156
|
-
|
|
297207
|
+
if (sign * vel.vy < 0)
|
|
297208
|
+
vel.vy = -vel.vy * conf.GRAVITY_RESTITUTION;
|
|
297209
|
+
ay += sign * conf.GRAVITY_REPULSION * overlapY;
|
|
297157
297210
|
}
|
|
297158
297211
|
} else {
|
|
297212
|
+
const touchDist = (s1.w + s2.w + s1.h + s2.h) * 0.25;
|
|
297213
|
+
if (dist < touchDist + 5)
|
|
297214
|
+
continue;
|
|
297159
297215
|
const distSq = dx * dx + dy * dy;
|
|
297160
|
-
const gravAcc =
|
|
297216
|
+
const gravAcc = conf.GRAVITY_G * s2.mass / (distSq + this.SOFTENING_SQ);
|
|
297161
297217
|
ax += gravAcc * dx / dist;
|
|
297162
297218
|
ay += gravAcc * dy / dist;
|
|
297163
297219
|
}
|
|
297164
297220
|
}
|
|
297165
|
-
vel.vx = (vel.vx + ax * dt) *
|
|
297166
|
-
vel.vy = (vel.vy + ay * dt) *
|
|
297221
|
+
vel.vx = (vel.vx + ax * dt) * conf.GRAVITY_DAMPING;
|
|
297222
|
+
vel.vy = (vel.vy + ay * dt) * conf.GRAVITY_DAMPING;
|
|
297167
297223
|
const moveX = vel.vx * dt;
|
|
297168
297224
|
const moveY = vel.vy * dt;
|
|
297169
297225
|
if (Math.abs(moveX) >= this.MIN_MOVE_PX || Math.abs(moveY) >= this.MIN_MOVE_PX) {
|
|
@@ -423235,7 +423291,7 @@ function comment$1(value2, root4, parent3) {
|
|
|
423235
423291
|
function declaration(value2, root4, parent3, length22) {
|
|
423236
423292
|
return node4(value2, root4, parent3, DECLARATION, substr(value2, 0, length22), substr(value2, length22 + 1, -1), length22);
|
|
423237
423293
|
}
|
|
423238
|
-
function
|
|
423294
|
+
function serialize9(children, callback) {
|
|
423239
423295
|
var output2 = "";
|
|
423240
423296
|
var length22 = sizeof(children);
|
|
423241
423297
|
for (var i22 = 0;i22 < length22; i22++)
|
|
@@ -423253,11 +423309,11 @@ function stringify14(element5, index4, children, callback) {
|
|
|
423253
423309
|
case COMMENT2:
|
|
423254
423310
|
return "";
|
|
423255
423311
|
case KEYFRAMES:
|
|
423256
|
-
return element5.return = element5.value + "{" +
|
|
423312
|
+
return element5.return = element5.value + "{" + serialize9(element5.children, callback) + "}";
|
|
423257
423313
|
case RULESET:
|
|
423258
423314
|
element5.value = element5.props.join(",");
|
|
423259
423315
|
}
|
|
423260
|
-
return strlen(children =
|
|
423316
|
+
return strlen(children = serialize9(element5.children, callback)) ? element5.return = element5.value + "{" + children + "}" : "";
|
|
423261
423317
|
}
|
|
423262
423318
|
function middleware(collection) {
|
|
423263
423319
|
var length22 = sizeof(collection);
|
|
@@ -423480,7 +423536,7 @@ var prefixer = function prefixer2(element5, index4, children, callback) {
|
|
|
423480
423536
|
element5["return"] = prefix2(element5.value, element5.length);
|
|
423481
423537
|
break;
|
|
423482
423538
|
case KEYFRAMES:
|
|
423483
|
-
return
|
|
423539
|
+
return serialize9([copy7(element5, {
|
|
423484
423540
|
value: replace(element5.value, "@", "@" + WEBKIT)
|
|
423485
423541
|
})], callback);
|
|
423486
423542
|
case RULESET:
|
|
@@ -423489,11 +423545,11 @@ var prefixer = function prefixer2(element5, index4, children, callback) {
|
|
|
423489
423545
|
switch (match(value2, /(::plac\w+|:read-\w+)/)) {
|
|
423490
423546
|
case ":read-only":
|
|
423491
423547
|
case ":read-write":
|
|
423492
|
-
return
|
|
423548
|
+
return serialize9([copy7(element5, {
|
|
423493
423549
|
props: [replace(value2, /:(read-\w+)/, ":" + MOZ + "$1")]
|
|
423494
423550
|
})], callback);
|
|
423495
423551
|
case "::placeholder":
|
|
423496
|
-
return
|
|
423552
|
+
return serialize9([copy7(element5, {
|
|
423497
423553
|
props: [replace(value2, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
|
|
423498
423554
|
}), copy7(element5, {
|
|
423499
423555
|
props: [replace(value2, /:(plac\w+)/, ":" + MOZ + "$1")]
|
|
@@ -423543,7 +423599,7 @@ var createCache = function createCache2(options2) {
|
|
|
423543
423599
|
})];
|
|
423544
423600
|
var serializer2 = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
423545
423601
|
var stylis = function stylis2(styles2) {
|
|
423546
|
-
return
|
|
423602
|
+
return serialize9(compile(styles2), serializer2);
|
|
423547
423603
|
};
|
|
423548
423604
|
_insert = function insert2(selector, serialized, sheet, shouldCache) {
|
|
423549
423605
|
currentSheet = sheet;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microboard-ui-temp",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
80
80
|
"js-cookie": "^3.0.5",
|
|
81
81
|
"jwt-decode": "^4.0.0",
|
|
82
|
-
"microboard-temp": "0.12
|
|
82
|
+
"microboard-temp": "0.13.12",
|
|
83
83
|
"nanoid": "^5.1.5",
|
|
84
84
|
"prop-types": "^15.8.1",
|
|
85
85
|
"react-hot-toast": "2.4.1",
|