microboard-ui-temp 0.3.6 → 0.3.8
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-f0mvcsbm.css → chunk-dn1bhr0e.css} +0 -6
- package/dist/{chunk-d5aw6qhs.js → chunk-mq91cbqc.js} +53 -38
- package/dist/example.html +2 -2
- package/dist/index.css +0 -6
- package/dist/index.html +2 -2
- package/dist/index.js +53 -38
- package/dist/spa.css +0 -6
- package/dist/spa.js +53 -38
- package/dist/types/shared/Lang/index.d.ts +10 -0
- package/package.json +2 -2
|
@@ -3003,12 +3003,6 @@ a.link_jFMnzg {
|
|
|
3003
3003
|
background-color: #f7f7f8;
|
|
3004
3004
|
}
|
|
3005
3005
|
|
|
3006
|
-
.quaternary_Lhh5GA {
|
|
3007
|
-
color: #fff;
|
|
3008
|
-
background-color: #924fe8;
|
|
3009
|
-
border: 1px solid #924fe8;
|
|
3010
|
-
}
|
|
3011
|
-
|
|
3012
3006
|
.quaternary_Lhh5GA:hover {
|
|
3013
3007
|
background-color: #b799f5;
|
|
3014
3008
|
border: 1px solid #924fe8;
|
|
@@ -264112,14 +264112,13 @@ function getControlPoint(data, findItem2) {
|
|
|
264112
264112
|
}
|
|
264113
264113
|
}
|
|
264114
264114
|
function toRelativePoint(point5, item) {
|
|
264115
|
-
const
|
|
264116
|
-
const inverse = matrix.getInverse();
|
|
264115
|
+
const inverse = item.transformation ? item.transformation.getInverse().toMatrix() : new Matrix2;
|
|
264117
264116
|
point5 = point5.copy();
|
|
264118
264117
|
point5.transform(inverse);
|
|
264119
264118
|
return point5;
|
|
264120
264119
|
}
|
|
264121
264120
|
function fromRelativePoint(relativePoint, item, edge) {
|
|
264122
|
-
const matrix = item.transformation?.
|
|
264121
|
+
const matrix = item.transformation?.toMatrix() ?? new Matrix2;
|
|
264123
264122
|
const point5 = relativePoint.copy();
|
|
264124
264123
|
point5.transform(matrix);
|
|
264125
264124
|
if (item instanceof RichText || item instanceof AINode) {
|
|
@@ -276880,32 +276879,31 @@ class Camera {
|
|
|
276880
276879
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
276881
276880
|
}
|
|
276882
276881
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
276883
|
-
const
|
|
276884
|
-
const
|
|
276885
|
-
const
|
|
276886
|
-
const
|
|
276882
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
276883
|
+
const startScaleX = base3.scaleX;
|
|
276884
|
+
const startScaleY = base3.scaleY;
|
|
276885
|
+
const startTranslateX = base3.translateX;
|
|
276886
|
+
const startTranslateY = base3.translateY;
|
|
276887
276887
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
276888
276888
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
276889
|
-
const
|
|
276890
|
-
const
|
|
276891
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
276892
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
276893
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
276894
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
276889
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
276890
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
276895
276891
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
276896
276892
|
return;
|
|
276897
276893
|
}
|
|
276894
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
276895
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
276898
276896
|
if (duration === 0) {
|
|
276899
|
-
this.matrix.translateX =
|
|
276900
|
-
this.matrix.translateY =
|
|
276897
|
+
this.matrix.translateX = finalTranslateX;
|
|
276898
|
+
this.matrix.translateY = finalTranslateY;
|
|
276901
276899
|
this.matrix.scaleX = finalScaleX;
|
|
276902
276900
|
this.matrix.scaleY = finalScaleY;
|
|
276903
276901
|
this.subject.publish(this);
|
|
276904
276902
|
return;
|
|
276905
276903
|
}
|
|
276906
276904
|
this.animateLocalToTarget({
|
|
276907
|
-
translateX:
|
|
276908
|
-
translateY:
|
|
276905
|
+
translateX: finalTranslateX,
|
|
276906
|
+
translateY: finalTranslateY,
|
|
276909
276907
|
scaleX: finalScaleX,
|
|
276910
276908
|
scaleY: finalScaleY
|
|
276911
276909
|
});
|
|
@@ -319844,7 +319842,12 @@ Upgrade to Plus to increase the limit and keep working`,
|
|
|
319844
319842
|
myBoards: "My boards",
|
|
319845
319843
|
notAvailable: "No boards available yet"
|
|
319846
319844
|
},
|
|
319847
|
-
addNew: "Add new"
|
|
319845
|
+
addNew: "Add new",
|
|
319846
|
+
itemsList: "Items list",
|
|
319847
|
+
itemsTitle: "Items",
|
|
319848
|
+
itemsSearch: "Search...",
|
|
319849
|
+
itemsEmpty: "No items",
|
|
319850
|
+
itemsNotFound: "Nothing found"
|
|
319848
319851
|
},
|
|
319849
319852
|
contextMenu: {
|
|
319850
319853
|
delete: "Delete",
|
|
@@ -321102,7 +321105,12 @@ var ru_default = {
|
|
|
321102
321105
|
myBoards: "Мои доски",
|
|
321103
321106
|
notAvailable: "Досок пока нет"
|
|
321104
321107
|
},
|
|
321105
|
-
addNew: "Добавить"
|
|
321108
|
+
addNew: "Добавить",
|
|
321109
|
+
itemsList: "Список предметов",
|
|
321110
|
+
itemsTitle: "Предметы",
|
|
321111
|
+
itemsSearch: "Поиск...",
|
|
321112
|
+
itemsEmpty: "Нет элементов",
|
|
321113
|
+
itemsNotFound: "Ничего не найдено"
|
|
321106
321114
|
},
|
|
321107
321115
|
contextMenu: {
|
|
321108
321116
|
delete: "Удалить",
|
|
@@ -370896,6 +370904,7 @@ function BoardItemsList({
|
|
|
370896
370904
|
}) {
|
|
370897
370905
|
const { board } = useAppContext();
|
|
370898
370906
|
const forceUpdate = useForceUpdate();
|
|
370907
|
+
const { t: t10 } = useTranslation();
|
|
370899
370908
|
useAppSubscription({
|
|
370900
370909
|
subjects: ["items"],
|
|
370901
370910
|
observer: forceUpdate
|
|
@@ -370909,7 +370918,7 @@ function BoardItemsList({
|
|
|
370909
370918
|
if (matched.length === 0) {
|
|
370910
370919
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370911
370920
|
className: BoardItemsList_module_default.empty
|
|
370912
|
-
}, "
|
|
370921
|
+
}, t10("sidePanel.itemsNotFound"));
|
|
370913
370922
|
}
|
|
370914
370923
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370915
370924
|
className: BoardItemsList_module_default.list
|
|
@@ -370924,7 +370933,7 @@ function BoardItemsList({
|
|
|
370924
370933
|
if (topLevelItems.length === 0) {
|
|
370925
370934
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370926
370935
|
className: BoardItemsList_module_default.empty
|
|
370927
|
-
}, "
|
|
370936
|
+
}, t10("sidePanel.itemsEmpty"));
|
|
370928
370937
|
}
|
|
370929
370938
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370930
370939
|
className: BoardItemsList_module_default.list
|
|
@@ -371191,7 +371200,7 @@ function SidePanel() {
|
|
|
371191
371200
|
iconName: "ArrowLeft1"
|
|
371192
371201
|
})), /* @__PURE__ */ import_react208.default.createElement("h3", {
|
|
371193
371202
|
className: SidePanel_module_default.title
|
|
371194
|
-
}, "
|
|
371203
|
+
}, t10("sidePanel.itemsTitle")), /* @__PURE__ */ import_react208.default.createElement(UiButton, {
|
|
371195
371204
|
onClick: toggleSideMenu,
|
|
371196
371205
|
variant: "secondary",
|
|
371197
371206
|
className: SidePanel_module_default.close
|
|
@@ -371206,7 +371215,7 @@ function SidePanel() {
|
|
|
371206
371215
|
className: SidePanel_module_default.itemsSearchIcon
|
|
371207
371216
|
}), /* @__PURE__ */ import_react208.default.createElement("input", {
|
|
371208
371217
|
className: SidePanel_module_default.itemsSearchInput,
|
|
371209
|
-
placeholder: "
|
|
371218
|
+
placeholder: t10("sidePanel.itemsSearch"),
|
|
371210
371219
|
ref: itemsSearchRef,
|
|
371211
371220
|
value: itemsQuery,
|
|
371212
371221
|
onChange: (e15) => setItemsQuery(e15.target.value)
|
|
@@ -371264,7 +371273,7 @@ function SidePanel() {
|
|
|
371264
371273
|
iconName: "Stack",
|
|
371265
371274
|
width: 16,
|
|
371266
371275
|
height: 16
|
|
371267
|
-
}), /* @__PURE__ */ import_react208.default.createElement("span", null, "
|
|
371276
|
+
}), /* @__PURE__ */ import_react208.default.createElement("span", null, t10("sidePanel.itemsList"))), /* @__PURE__ */ import_react208.default.createElement("button", {
|
|
371268
371277
|
className: SidePanel_module_default.add,
|
|
371269
371278
|
onClick: handleAddNewMenu
|
|
371270
371279
|
}, /* @__PURE__ */ import_react208.default.createElement(Icon, {
|
|
@@ -445804,6 +445813,25 @@ var BoardPage = () => {
|
|
|
445804
445813
|
});
|
|
445805
445814
|
app.render();
|
|
445806
445815
|
});
|
|
445816
|
+
} else if (window.opener) {
|
|
445817
|
+
boardsList.createBoard().then((boardId) => {
|
|
445818
|
+
app.openBoard(boardId).then(() => {
|
|
445819
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445820
|
+
app.render();
|
|
445821
|
+
console.log("[import] board ready, sending snapshot-ready to opener");
|
|
445822
|
+
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445823
|
+
const onMessage = (event) => {
|
|
445824
|
+
if (event.data?.type !== "microboard-snapshot")
|
|
445825
|
+
return;
|
|
445826
|
+
window.removeEventListener("message", onMessage);
|
|
445827
|
+
const { html: html5 } = event.data;
|
|
445828
|
+
console.log("[import] received snapshot, html length:", html5.length);
|
|
445829
|
+
const added = app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445830
|
+
console.log("[import] deserializeHTMLAndEmit added ids:", added);
|
|
445831
|
+
};
|
|
445832
|
+
window.addEventListener("message", onMessage);
|
|
445833
|
+
});
|
|
445834
|
+
});
|
|
445807
445835
|
} else {
|
|
445808
445836
|
const lastSeenBoard = localStorage.getItem(LAST_BOARD_KEY);
|
|
445809
445837
|
const isFirstVisit = !api7.get("first_visit");
|
|
@@ -445828,21 +445856,8 @@ var BoardPage = () => {
|
|
|
445828
445856
|
} else {
|
|
445829
445857
|
boardsList.createBoard().then((boardId) => {
|
|
445830
445858
|
app.openBoard(boardId).then(() => {
|
|
445831
|
-
navigate(`/boards/${boardId}`, {
|
|
445832
|
-
replace: true
|
|
445833
|
-
});
|
|
445859
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445834
445860
|
app.render();
|
|
445835
|
-
if (window.opener) {
|
|
445836
|
-
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445837
|
-
const onMessage = (event) => {
|
|
445838
|
-
if (event.data?.type !== "microboard-snapshot")
|
|
445839
|
-
return;
|
|
445840
|
-
window.removeEventListener("message", onMessage);
|
|
445841
|
-
const { html: html5 } = event.data;
|
|
445842
|
-
app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445843
|
-
};
|
|
445844
|
-
window.addEventListener("message", onMessage);
|
|
445845
|
-
}
|
|
445846
445861
|
});
|
|
445847
445862
|
});
|
|
445848
445863
|
}
|
package/dist/example.html
CHANGED
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
rel="stylesheet"
|
|
32
32
|
/>
|
|
33
33
|
|
|
34
|
-
<link rel="stylesheet" crossorigin href="/chunk-
|
|
35
|
-
<script type="module" crossorigin src="/chunk-
|
|
34
|
+
<link rel="stylesheet" crossorigin href="/chunk-dn1bhr0e.css"><script src="/env.js"></script>
|
|
35
|
+
<script type="module" crossorigin src="/chunk-mq91cbqc.js"></script></head>
|
|
36
36
|
|
|
37
37
|
<body
|
|
38
38
|
style="
|
package/dist/index.css
CHANGED
|
@@ -2862,12 +2862,6 @@ a.link_jFMnzg {
|
|
|
2862
2862
|
background-color: #f7f7f8;
|
|
2863
2863
|
}
|
|
2864
2864
|
|
|
2865
|
-
.quaternary_Lhh5GA {
|
|
2866
|
-
color: #fff;
|
|
2867
|
-
background-color: #924fe8;
|
|
2868
|
-
border: 1px solid #924fe8;
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
2865
|
.quaternary_Lhh5GA:hover {
|
|
2872
2866
|
background-color: #b799f5;
|
|
2873
2867
|
border: 1px solid #924fe8;
|
package/dist/index.html
CHANGED
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
rel="stylesheet"
|
|
32
32
|
/>
|
|
33
33
|
|
|
34
|
-
<link rel="stylesheet" crossorigin href="/chunk-
|
|
35
|
-
<script type="module" crossorigin src="/chunk-
|
|
34
|
+
<link rel="stylesheet" crossorigin href="/chunk-dn1bhr0e.css"><script src="/env.js"></script>
|
|
35
|
+
<script type="module" crossorigin src="/chunk-mq91cbqc.js"></script></head>
|
|
36
36
|
|
|
37
37
|
<body
|
|
38
38
|
style="
|
package/dist/index.js
CHANGED
|
@@ -264112,14 +264112,13 @@ function getControlPoint(data, findItem2) {
|
|
|
264112
264112
|
}
|
|
264113
264113
|
}
|
|
264114
264114
|
function toRelativePoint(point5, item) {
|
|
264115
|
-
const
|
|
264116
|
-
const inverse = matrix.getInverse();
|
|
264115
|
+
const inverse = item.transformation ? item.transformation.getInverse().toMatrix() : new Matrix2;
|
|
264117
264116
|
point5 = point5.copy();
|
|
264118
264117
|
point5.transform(inverse);
|
|
264119
264118
|
return point5;
|
|
264120
264119
|
}
|
|
264121
264120
|
function fromRelativePoint(relativePoint, item, edge) {
|
|
264122
|
-
const matrix = item.transformation?.
|
|
264121
|
+
const matrix = item.transformation?.toMatrix() ?? new Matrix2;
|
|
264123
264122
|
const point5 = relativePoint.copy();
|
|
264124
264123
|
point5.transform(matrix);
|
|
264125
264124
|
if (item instanceof RichText || item instanceof AINode) {
|
|
@@ -276880,32 +276879,31 @@ class Camera {
|
|
|
276880
276879
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
276881
276880
|
}
|
|
276882
276881
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
276883
|
-
const
|
|
276884
|
-
const
|
|
276885
|
-
const
|
|
276886
|
-
const
|
|
276882
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
276883
|
+
const startScaleX = base3.scaleX;
|
|
276884
|
+
const startScaleY = base3.scaleY;
|
|
276885
|
+
const startTranslateX = base3.translateX;
|
|
276886
|
+
const startTranslateY = base3.translateY;
|
|
276887
276887
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
276888
276888
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
276889
|
-
const
|
|
276890
|
-
const
|
|
276891
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
276892
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
276893
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
276894
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
276889
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
276890
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
276895
276891
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
276896
276892
|
return;
|
|
276897
276893
|
}
|
|
276894
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
276895
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
276898
276896
|
if (duration === 0) {
|
|
276899
|
-
this.matrix.translateX =
|
|
276900
|
-
this.matrix.translateY =
|
|
276897
|
+
this.matrix.translateX = finalTranslateX;
|
|
276898
|
+
this.matrix.translateY = finalTranslateY;
|
|
276901
276899
|
this.matrix.scaleX = finalScaleX;
|
|
276902
276900
|
this.matrix.scaleY = finalScaleY;
|
|
276903
276901
|
this.subject.publish(this);
|
|
276904
276902
|
return;
|
|
276905
276903
|
}
|
|
276906
276904
|
this.animateLocalToTarget({
|
|
276907
|
-
translateX:
|
|
276908
|
-
translateY:
|
|
276905
|
+
translateX: finalTranslateX,
|
|
276906
|
+
translateY: finalTranslateY,
|
|
276909
276907
|
scaleX: finalScaleX,
|
|
276910
276908
|
scaleY: finalScaleY
|
|
276911
276909
|
});
|
|
@@ -319844,7 +319842,12 @@ Upgrade to Plus to increase the limit and keep working`,
|
|
|
319844
319842
|
myBoards: "My boards",
|
|
319845
319843
|
notAvailable: "No boards available yet"
|
|
319846
319844
|
},
|
|
319847
|
-
addNew: "Add new"
|
|
319845
|
+
addNew: "Add new",
|
|
319846
|
+
itemsList: "Items list",
|
|
319847
|
+
itemsTitle: "Items",
|
|
319848
|
+
itemsSearch: "Search...",
|
|
319849
|
+
itemsEmpty: "No items",
|
|
319850
|
+
itemsNotFound: "Nothing found"
|
|
319848
319851
|
},
|
|
319849
319852
|
contextMenu: {
|
|
319850
319853
|
delete: "Delete",
|
|
@@ -321102,7 +321105,12 @@ var ru_default = {
|
|
|
321102
321105
|
myBoards: "Мои доски",
|
|
321103
321106
|
notAvailable: "Досок пока нет"
|
|
321104
321107
|
},
|
|
321105
|
-
addNew: "Добавить"
|
|
321108
|
+
addNew: "Добавить",
|
|
321109
|
+
itemsList: "Список предметов",
|
|
321110
|
+
itemsTitle: "Предметы",
|
|
321111
|
+
itemsSearch: "Поиск...",
|
|
321112
|
+
itemsEmpty: "Нет элементов",
|
|
321113
|
+
itemsNotFound: "Ничего не найдено"
|
|
321106
321114
|
},
|
|
321107
321115
|
contextMenu: {
|
|
321108
321116
|
delete: "Удалить",
|
|
@@ -370896,6 +370904,7 @@ function BoardItemsList({
|
|
|
370896
370904
|
}) {
|
|
370897
370905
|
const { board } = useAppContext();
|
|
370898
370906
|
const forceUpdate = useForceUpdate();
|
|
370907
|
+
const { t: t10 } = useTranslation();
|
|
370899
370908
|
useAppSubscription({
|
|
370900
370909
|
subjects: ["items"],
|
|
370901
370910
|
observer: forceUpdate
|
|
@@ -370909,7 +370918,7 @@ function BoardItemsList({
|
|
|
370909
370918
|
if (matched.length === 0) {
|
|
370910
370919
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370911
370920
|
className: BoardItemsList_module_default.empty
|
|
370912
|
-
}, "
|
|
370921
|
+
}, t10("sidePanel.itemsNotFound"));
|
|
370913
370922
|
}
|
|
370914
370923
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370915
370924
|
className: BoardItemsList_module_default.list
|
|
@@ -370924,7 +370933,7 @@ function BoardItemsList({
|
|
|
370924
370933
|
if (topLevelItems.length === 0) {
|
|
370925
370934
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370926
370935
|
className: BoardItemsList_module_default.empty
|
|
370927
|
-
}, "
|
|
370936
|
+
}, t10("sidePanel.itemsEmpty"));
|
|
370928
370937
|
}
|
|
370929
370938
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370930
370939
|
className: BoardItemsList_module_default.list
|
|
@@ -371191,7 +371200,7 @@ function SidePanel() {
|
|
|
371191
371200
|
iconName: "ArrowLeft1"
|
|
371192
371201
|
})), /* @__PURE__ */ import_react208.default.createElement("h3", {
|
|
371193
371202
|
className: SidePanel_module_default.title
|
|
371194
|
-
}, "
|
|
371203
|
+
}, t10("sidePanel.itemsTitle")), /* @__PURE__ */ import_react208.default.createElement(UiButton, {
|
|
371195
371204
|
onClick: toggleSideMenu,
|
|
371196
371205
|
variant: "secondary",
|
|
371197
371206
|
className: SidePanel_module_default.close
|
|
@@ -371206,7 +371215,7 @@ function SidePanel() {
|
|
|
371206
371215
|
className: SidePanel_module_default.itemsSearchIcon
|
|
371207
371216
|
}), /* @__PURE__ */ import_react208.default.createElement("input", {
|
|
371208
371217
|
className: SidePanel_module_default.itemsSearchInput,
|
|
371209
|
-
placeholder: "
|
|
371218
|
+
placeholder: t10("sidePanel.itemsSearch"),
|
|
371210
371219
|
ref: itemsSearchRef,
|
|
371211
371220
|
value: itemsQuery,
|
|
371212
371221
|
onChange: (e15) => setItemsQuery(e15.target.value)
|
|
@@ -371264,7 +371273,7 @@ function SidePanel() {
|
|
|
371264
371273
|
iconName: "Stack",
|
|
371265
371274
|
width: 16,
|
|
371266
371275
|
height: 16
|
|
371267
|
-
}), /* @__PURE__ */ import_react208.default.createElement("span", null, "
|
|
371276
|
+
}), /* @__PURE__ */ import_react208.default.createElement("span", null, t10("sidePanel.itemsList"))), /* @__PURE__ */ import_react208.default.createElement("button", {
|
|
371268
371277
|
className: SidePanel_module_default.add,
|
|
371269
371278
|
onClick: handleAddNewMenu
|
|
371270
371279
|
}, /* @__PURE__ */ import_react208.default.createElement(Icon, {
|
|
@@ -445804,6 +445813,25 @@ var BoardPage = () => {
|
|
|
445804
445813
|
});
|
|
445805
445814
|
app.render();
|
|
445806
445815
|
});
|
|
445816
|
+
} else if (window.opener) {
|
|
445817
|
+
boardsList.createBoard().then((boardId) => {
|
|
445818
|
+
app.openBoard(boardId).then(() => {
|
|
445819
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445820
|
+
app.render();
|
|
445821
|
+
console.log("[import] board ready, sending snapshot-ready to opener");
|
|
445822
|
+
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445823
|
+
const onMessage = (event) => {
|
|
445824
|
+
if (event.data?.type !== "microboard-snapshot")
|
|
445825
|
+
return;
|
|
445826
|
+
window.removeEventListener("message", onMessage);
|
|
445827
|
+
const { html: html5 } = event.data;
|
|
445828
|
+
console.log("[import] received snapshot, html length:", html5.length);
|
|
445829
|
+
const added = app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445830
|
+
console.log("[import] deserializeHTMLAndEmit added ids:", added);
|
|
445831
|
+
};
|
|
445832
|
+
window.addEventListener("message", onMessage);
|
|
445833
|
+
});
|
|
445834
|
+
});
|
|
445807
445835
|
} else {
|
|
445808
445836
|
const lastSeenBoard = localStorage.getItem(LAST_BOARD_KEY);
|
|
445809
445837
|
const isFirstVisit = !api7.get("first_visit");
|
|
@@ -445828,21 +445856,8 @@ var BoardPage = () => {
|
|
|
445828
445856
|
} else {
|
|
445829
445857
|
boardsList.createBoard().then((boardId) => {
|
|
445830
445858
|
app.openBoard(boardId).then(() => {
|
|
445831
|
-
navigate(`/boards/${boardId}`, {
|
|
445832
|
-
replace: true
|
|
445833
|
-
});
|
|
445859
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445834
445860
|
app.render();
|
|
445835
|
-
if (window.opener) {
|
|
445836
|
-
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445837
|
-
const onMessage = (event) => {
|
|
445838
|
-
if (event.data?.type !== "microboard-snapshot")
|
|
445839
|
-
return;
|
|
445840
|
-
window.removeEventListener("message", onMessage);
|
|
445841
|
-
const { html: html5 } = event.data;
|
|
445842
|
-
app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445843
|
-
};
|
|
445844
|
-
window.addEventListener("message", onMessage);
|
|
445845
|
-
}
|
|
445846
445861
|
});
|
|
445847
445862
|
});
|
|
445848
445863
|
}
|
package/dist/spa.css
CHANGED
|
@@ -2862,12 +2862,6 @@ a.link_jFMnzg {
|
|
|
2862
2862
|
background-color: #f7f7f8;
|
|
2863
2863
|
}
|
|
2864
2864
|
|
|
2865
|
-
.quaternary_Lhh5GA {
|
|
2866
|
-
color: #fff;
|
|
2867
|
-
background-color: #924fe8;
|
|
2868
|
-
border: 1px solid #924fe8;
|
|
2869
|
-
}
|
|
2870
|
-
|
|
2871
2865
|
.quaternary_Lhh5GA:hover {
|
|
2872
2866
|
background-color: #b799f5;
|
|
2873
2867
|
border: 1px solid #924fe8;
|
package/dist/spa.js
CHANGED
|
@@ -264112,14 +264112,13 @@ function getControlPoint(data, findItem2) {
|
|
|
264112
264112
|
}
|
|
264113
264113
|
}
|
|
264114
264114
|
function toRelativePoint(point5, item) {
|
|
264115
|
-
const
|
|
264116
|
-
const inverse = matrix.getInverse();
|
|
264115
|
+
const inverse = item.transformation ? item.transformation.getInverse().toMatrix() : new Matrix2;
|
|
264117
264116
|
point5 = point5.copy();
|
|
264118
264117
|
point5.transform(inverse);
|
|
264119
264118
|
return point5;
|
|
264120
264119
|
}
|
|
264121
264120
|
function fromRelativePoint(relativePoint, item, edge) {
|
|
264122
|
-
const matrix = item.transformation?.
|
|
264121
|
+
const matrix = item.transformation?.toMatrix() ?? new Matrix2;
|
|
264123
264122
|
const point5 = relativePoint.copy();
|
|
264124
264123
|
point5.transform(matrix);
|
|
264125
264124
|
if (item instanceof RichText || item instanceof AINode) {
|
|
@@ -276880,32 +276879,31 @@ class Camera {
|
|
|
276880
276879
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
276881
276880
|
}
|
|
276882
276881
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
276883
|
-
const
|
|
276884
|
-
const
|
|
276885
|
-
const
|
|
276886
|
-
const
|
|
276882
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
276883
|
+
const startScaleX = base3.scaleX;
|
|
276884
|
+
const startScaleY = base3.scaleY;
|
|
276885
|
+
const startTranslateX = base3.translateX;
|
|
276886
|
+
const startTranslateY = base3.translateY;
|
|
276887
276887
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
276888
276888
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
276889
|
-
const
|
|
276890
|
-
const
|
|
276891
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
276892
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
276893
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
276894
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
276889
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
276890
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
276895
276891
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
276896
276892
|
return;
|
|
276897
276893
|
}
|
|
276894
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
276895
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
276898
276896
|
if (duration === 0) {
|
|
276899
|
-
this.matrix.translateX =
|
|
276900
|
-
this.matrix.translateY =
|
|
276897
|
+
this.matrix.translateX = finalTranslateX;
|
|
276898
|
+
this.matrix.translateY = finalTranslateY;
|
|
276901
276899
|
this.matrix.scaleX = finalScaleX;
|
|
276902
276900
|
this.matrix.scaleY = finalScaleY;
|
|
276903
276901
|
this.subject.publish(this);
|
|
276904
276902
|
return;
|
|
276905
276903
|
}
|
|
276906
276904
|
this.animateLocalToTarget({
|
|
276907
|
-
translateX:
|
|
276908
|
-
translateY:
|
|
276905
|
+
translateX: finalTranslateX,
|
|
276906
|
+
translateY: finalTranslateY,
|
|
276909
276907
|
scaleX: finalScaleX,
|
|
276910
276908
|
scaleY: finalScaleY
|
|
276911
276909
|
});
|
|
@@ -319844,7 +319842,12 @@ Upgrade to Plus to increase the limit and keep working`,
|
|
|
319844
319842
|
myBoards: "My boards",
|
|
319845
319843
|
notAvailable: "No boards available yet"
|
|
319846
319844
|
},
|
|
319847
|
-
addNew: "Add new"
|
|
319845
|
+
addNew: "Add new",
|
|
319846
|
+
itemsList: "Items list",
|
|
319847
|
+
itemsTitle: "Items",
|
|
319848
|
+
itemsSearch: "Search...",
|
|
319849
|
+
itemsEmpty: "No items",
|
|
319850
|
+
itemsNotFound: "Nothing found"
|
|
319848
319851
|
},
|
|
319849
319852
|
contextMenu: {
|
|
319850
319853
|
delete: "Delete",
|
|
@@ -321102,7 +321105,12 @@ var ru_default = {
|
|
|
321102
321105
|
myBoards: "Мои доски",
|
|
321103
321106
|
notAvailable: "Досок пока нет"
|
|
321104
321107
|
},
|
|
321105
|
-
addNew: "Добавить"
|
|
321108
|
+
addNew: "Добавить",
|
|
321109
|
+
itemsList: "Список предметов",
|
|
321110
|
+
itemsTitle: "Предметы",
|
|
321111
|
+
itemsSearch: "Поиск...",
|
|
321112
|
+
itemsEmpty: "Нет элементов",
|
|
321113
|
+
itemsNotFound: "Ничего не найдено"
|
|
321106
321114
|
},
|
|
321107
321115
|
contextMenu: {
|
|
321108
321116
|
delete: "Удалить",
|
|
@@ -370896,6 +370904,7 @@ function BoardItemsList({
|
|
|
370896
370904
|
}) {
|
|
370897
370905
|
const { board } = useAppContext();
|
|
370898
370906
|
const forceUpdate = useForceUpdate();
|
|
370907
|
+
const { t: t10 } = useTranslation();
|
|
370899
370908
|
useAppSubscription({
|
|
370900
370909
|
subjects: ["items"],
|
|
370901
370910
|
observer: forceUpdate
|
|
@@ -370909,7 +370918,7 @@ function BoardItemsList({
|
|
|
370909
370918
|
if (matched.length === 0) {
|
|
370910
370919
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370911
370920
|
className: BoardItemsList_module_default.empty
|
|
370912
|
-
}, "
|
|
370921
|
+
}, t10("sidePanel.itemsNotFound"));
|
|
370913
370922
|
}
|
|
370914
370923
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370915
370924
|
className: BoardItemsList_module_default.list
|
|
@@ -370924,7 +370933,7 @@ function BoardItemsList({
|
|
|
370924
370933
|
if (topLevelItems.length === 0) {
|
|
370925
370934
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370926
370935
|
className: BoardItemsList_module_default.empty
|
|
370927
|
-
}, "
|
|
370936
|
+
}, t10("sidePanel.itemsEmpty"));
|
|
370928
370937
|
}
|
|
370929
370938
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370930
370939
|
className: BoardItemsList_module_default.list
|
|
@@ -371191,7 +371200,7 @@ function SidePanel() {
|
|
|
371191
371200
|
iconName: "ArrowLeft1"
|
|
371192
371201
|
})), /* @__PURE__ */ import_react208.default.createElement("h3", {
|
|
371193
371202
|
className: SidePanel_module_default.title
|
|
371194
|
-
}, "
|
|
371203
|
+
}, t10("sidePanel.itemsTitle")), /* @__PURE__ */ import_react208.default.createElement(UiButton, {
|
|
371195
371204
|
onClick: toggleSideMenu,
|
|
371196
371205
|
variant: "secondary",
|
|
371197
371206
|
className: SidePanel_module_default.close
|
|
@@ -371206,7 +371215,7 @@ function SidePanel() {
|
|
|
371206
371215
|
className: SidePanel_module_default.itemsSearchIcon
|
|
371207
371216
|
}), /* @__PURE__ */ import_react208.default.createElement("input", {
|
|
371208
371217
|
className: SidePanel_module_default.itemsSearchInput,
|
|
371209
|
-
placeholder: "
|
|
371218
|
+
placeholder: t10("sidePanel.itemsSearch"),
|
|
371210
371219
|
ref: itemsSearchRef,
|
|
371211
371220
|
value: itemsQuery,
|
|
371212
371221
|
onChange: (e15) => setItemsQuery(e15.target.value)
|
|
@@ -371264,7 +371273,7 @@ function SidePanel() {
|
|
|
371264
371273
|
iconName: "Stack",
|
|
371265
371274
|
width: 16,
|
|
371266
371275
|
height: 16
|
|
371267
|
-
}), /* @__PURE__ */ import_react208.default.createElement("span", null, "
|
|
371276
|
+
}), /* @__PURE__ */ import_react208.default.createElement("span", null, t10("sidePanel.itemsList"))), /* @__PURE__ */ import_react208.default.createElement("button", {
|
|
371268
371277
|
className: SidePanel_module_default.add,
|
|
371269
371278
|
onClick: handleAddNewMenu
|
|
371270
371279
|
}, /* @__PURE__ */ import_react208.default.createElement(Icon, {
|
|
@@ -445804,6 +445813,25 @@ var BoardPage = () => {
|
|
|
445804
445813
|
});
|
|
445805
445814
|
app.render();
|
|
445806
445815
|
});
|
|
445816
|
+
} else if (window.opener) {
|
|
445817
|
+
boardsList.createBoard().then((boardId) => {
|
|
445818
|
+
app.openBoard(boardId).then(() => {
|
|
445819
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445820
|
+
app.render();
|
|
445821
|
+
console.log("[import] board ready, sending snapshot-ready to opener");
|
|
445822
|
+
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445823
|
+
const onMessage = (event) => {
|
|
445824
|
+
if (event.data?.type !== "microboard-snapshot")
|
|
445825
|
+
return;
|
|
445826
|
+
window.removeEventListener("message", onMessage);
|
|
445827
|
+
const { html: html5 } = event.data;
|
|
445828
|
+
console.log("[import] received snapshot, html length:", html5.length);
|
|
445829
|
+
const added = app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445830
|
+
console.log("[import] deserializeHTMLAndEmit added ids:", added);
|
|
445831
|
+
};
|
|
445832
|
+
window.addEventListener("message", onMessage);
|
|
445833
|
+
});
|
|
445834
|
+
});
|
|
445807
445835
|
} else {
|
|
445808
445836
|
const lastSeenBoard = localStorage.getItem(LAST_BOARD_KEY);
|
|
445809
445837
|
const isFirstVisit = !api7.get("first_visit");
|
|
@@ -445828,21 +445856,8 @@ var BoardPage = () => {
|
|
|
445828
445856
|
} else {
|
|
445829
445857
|
boardsList.createBoard().then((boardId) => {
|
|
445830
445858
|
app.openBoard(boardId).then(() => {
|
|
445831
|
-
navigate(`/boards/${boardId}`, {
|
|
445832
|
-
replace: true
|
|
445833
|
-
});
|
|
445859
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445834
445860
|
app.render();
|
|
445835
|
-
if (window.opener) {
|
|
445836
|
-
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445837
|
-
const onMessage = (event) => {
|
|
445838
|
-
if (event.data?.type !== "microboard-snapshot")
|
|
445839
|
-
return;
|
|
445840
|
-
window.removeEventListener("message", onMessage);
|
|
445841
|
-
const { html: html5 } = event.data;
|
|
445842
|
-
app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445843
|
-
};
|
|
445844
|
-
window.addEventListener("message", onMessage);
|
|
445845
|
-
}
|
|
445846
445861
|
});
|
|
445847
445862
|
});
|
|
445848
445863
|
}
|
|
@@ -719,6 +719,11 @@ export declare const resources: {
|
|
|
719
719
|
notAvailable: string;
|
|
720
720
|
};
|
|
721
721
|
addNew: string;
|
|
722
|
+
itemsList: string;
|
|
723
|
+
itemsTitle: string;
|
|
724
|
+
itemsSearch: string;
|
|
725
|
+
itemsEmpty: string;
|
|
726
|
+
itemsNotFound: string;
|
|
722
727
|
};
|
|
723
728
|
contextMenu: {
|
|
724
729
|
delete: string;
|
|
@@ -1951,6 +1956,11 @@ export declare const resources: {
|
|
|
1951
1956
|
notAvailable: string;
|
|
1952
1957
|
};
|
|
1953
1958
|
addNew: string;
|
|
1959
|
+
itemsList: string;
|
|
1960
|
+
itemsTitle: string;
|
|
1961
|
+
itemsSearch: string;
|
|
1962
|
+
itemsEmpty: string;
|
|
1963
|
+
itemsNotFound: string;
|
|
1954
1964
|
};
|
|
1955
1965
|
contextMenu: {
|
|
1956
1966
|
delete: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microboard-ui-temp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
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.6.
|
|
82
|
+
"microboard-temp": "^0.6.5",
|
|
83
83
|
"nanoid": "^5.1.5",
|
|
84
84
|
"prop-types": "^15.8.1",
|
|
85
85
|
"react-hot-toast": "2.4.1",
|