microboard-ui-temp 0.3.6 → 0.3.7
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-d5aw6qhs.js → chunk-c47kwavk.js} +40 -24
- package/dist/example.html +1 -1
- package/dist/index.html +1 -1
- package/dist/index.js +40 -24
- package/dist/spa.js +40 -24
- package/dist/types/shared/Lang/index.d.ts +10 -0
- package/package.json +2 -2
|
@@ -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) {
|
|
@@ -319844,7 +319843,12 @@ Upgrade to Plus to increase the limit and keep working`,
|
|
|
319844
319843
|
myBoards: "My boards",
|
|
319845
319844
|
notAvailable: "No boards available yet"
|
|
319846
319845
|
},
|
|
319847
|
-
addNew: "Add new"
|
|
319846
|
+
addNew: "Add new",
|
|
319847
|
+
itemsList: "Items list",
|
|
319848
|
+
itemsTitle: "Items",
|
|
319849
|
+
itemsSearch: "Search...",
|
|
319850
|
+
itemsEmpty: "No items",
|
|
319851
|
+
itemsNotFound: "Nothing found"
|
|
319848
319852
|
},
|
|
319849
319853
|
contextMenu: {
|
|
319850
319854
|
delete: "Delete",
|
|
@@ -321102,7 +321106,12 @@ var ru_default = {
|
|
|
321102
321106
|
myBoards: "Мои доски",
|
|
321103
321107
|
notAvailable: "Досок пока нет"
|
|
321104
321108
|
},
|
|
321105
|
-
addNew: "Добавить"
|
|
321109
|
+
addNew: "Добавить",
|
|
321110
|
+
itemsList: "Список предметов",
|
|
321111
|
+
itemsTitle: "Предметы",
|
|
321112
|
+
itemsSearch: "Поиск...",
|
|
321113
|
+
itemsEmpty: "Нет элементов",
|
|
321114
|
+
itemsNotFound: "Ничего не найдено"
|
|
321106
321115
|
},
|
|
321107
321116
|
contextMenu: {
|
|
321108
321117
|
delete: "Удалить",
|
|
@@ -370896,6 +370905,7 @@ function BoardItemsList({
|
|
|
370896
370905
|
}) {
|
|
370897
370906
|
const { board } = useAppContext();
|
|
370898
370907
|
const forceUpdate = useForceUpdate();
|
|
370908
|
+
const { t: t10 } = useTranslation();
|
|
370899
370909
|
useAppSubscription({
|
|
370900
370910
|
subjects: ["items"],
|
|
370901
370911
|
observer: forceUpdate
|
|
@@ -370909,7 +370919,7 @@ function BoardItemsList({
|
|
|
370909
370919
|
if (matched.length === 0) {
|
|
370910
370920
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370911
370921
|
className: BoardItemsList_module_default.empty
|
|
370912
|
-
}, "
|
|
370922
|
+
}, t10("sidePanel.itemsNotFound"));
|
|
370913
370923
|
}
|
|
370914
370924
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370915
370925
|
className: BoardItemsList_module_default.list
|
|
@@ -370924,7 +370934,7 @@ function BoardItemsList({
|
|
|
370924
370934
|
if (topLevelItems.length === 0) {
|
|
370925
370935
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370926
370936
|
className: BoardItemsList_module_default.empty
|
|
370927
|
-
}, "
|
|
370937
|
+
}, t10("sidePanel.itemsEmpty"));
|
|
370928
370938
|
}
|
|
370929
370939
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370930
370940
|
className: BoardItemsList_module_default.list
|
|
@@ -371191,7 +371201,7 @@ function SidePanel() {
|
|
|
371191
371201
|
iconName: "ArrowLeft1"
|
|
371192
371202
|
})), /* @__PURE__ */ import_react208.default.createElement("h3", {
|
|
371193
371203
|
className: SidePanel_module_default.title
|
|
371194
|
-
}, "
|
|
371204
|
+
}, t10("sidePanel.itemsTitle")), /* @__PURE__ */ import_react208.default.createElement(UiButton, {
|
|
371195
371205
|
onClick: toggleSideMenu,
|
|
371196
371206
|
variant: "secondary",
|
|
371197
371207
|
className: SidePanel_module_default.close
|
|
@@ -371206,7 +371216,7 @@ function SidePanel() {
|
|
|
371206
371216
|
className: SidePanel_module_default.itemsSearchIcon
|
|
371207
371217
|
}), /* @__PURE__ */ import_react208.default.createElement("input", {
|
|
371208
371218
|
className: SidePanel_module_default.itemsSearchInput,
|
|
371209
|
-
placeholder: "
|
|
371219
|
+
placeholder: t10("sidePanel.itemsSearch"),
|
|
371210
371220
|
ref: itemsSearchRef,
|
|
371211
371221
|
value: itemsQuery,
|
|
371212
371222
|
onChange: (e15) => setItemsQuery(e15.target.value)
|
|
@@ -371264,7 +371274,7 @@ function SidePanel() {
|
|
|
371264
371274
|
iconName: "Stack",
|
|
371265
371275
|
width: 16,
|
|
371266
371276
|
height: 16
|
|
371267
|
-
}), /* @__PURE__ */ import_react208.default.createElement("span", null, "
|
|
371277
|
+
}), /* @__PURE__ */ import_react208.default.createElement("span", null, t10("sidePanel.itemsList"))), /* @__PURE__ */ import_react208.default.createElement("button", {
|
|
371268
371278
|
className: SidePanel_module_default.add,
|
|
371269
371279
|
onClick: handleAddNewMenu
|
|
371270
371280
|
}, /* @__PURE__ */ import_react208.default.createElement(Icon, {
|
|
@@ -445804,6 +445814,25 @@ var BoardPage = () => {
|
|
|
445804
445814
|
});
|
|
445805
445815
|
app.render();
|
|
445806
445816
|
});
|
|
445817
|
+
} else if (window.opener) {
|
|
445818
|
+
boardsList.createBoard().then((boardId) => {
|
|
445819
|
+
app.openBoard(boardId).then(() => {
|
|
445820
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445821
|
+
app.render();
|
|
445822
|
+
console.log("[import] board ready, sending snapshot-ready to opener");
|
|
445823
|
+
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445824
|
+
const onMessage = (event) => {
|
|
445825
|
+
if (event.data?.type !== "microboard-snapshot")
|
|
445826
|
+
return;
|
|
445827
|
+
window.removeEventListener("message", onMessage);
|
|
445828
|
+
const { html: html5 } = event.data;
|
|
445829
|
+
console.log("[import] received snapshot, html length:", html5.length);
|
|
445830
|
+
const added = app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445831
|
+
console.log("[import] deserializeHTMLAndEmit added ids:", added);
|
|
445832
|
+
};
|
|
445833
|
+
window.addEventListener("message", onMessage);
|
|
445834
|
+
});
|
|
445835
|
+
});
|
|
445807
445836
|
} else {
|
|
445808
445837
|
const lastSeenBoard = localStorage.getItem(LAST_BOARD_KEY);
|
|
445809
445838
|
const isFirstVisit = !api7.get("first_visit");
|
|
@@ -445828,21 +445857,8 @@ var BoardPage = () => {
|
|
|
445828
445857
|
} else {
|
|
445829
445858
|
boardsList.createBoard().then((boardId) => {
|
|
445830
445859
|
app.openBoard(boardId).then(() => {
|
|
445831
|
-
navigate(`/boards/${boardId}`, {
|
|
445832
|
-
replace: true
|
|
445833
|
-
});
|
|
445860
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445834
445861
|
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
445862
|
});
|
|
445847
445863
|
});
|
|
445848
445864
|
}
|
package/dist/example.html
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
/>
|
|
33
33
|
|
|
34
34
|
<link rel="stylesheet" crossorigin href="/chunk-f0mvcsbm.css"><script src="/env.js"></script>
|
|
35
|
-
<script type="module" crossorigin src="/chunk-
|
|
35
|
+
<script type="module" crossorigin src="/chunk-c47kwavk.js"></script></head>
|
|
36
36
|
|
|
37
37
|
<body
|
|
38
38
|
style="
|
package/dist/index.html
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
/>
|
|
33
33
|
|
|
34
34
|
<link rel="stylesheet" crossorigin href="/chunk-f0mvcsbm.css"><script src="/env.js"></script>
|
|
35
|
-
<script type="module" crossorigin src="/chunk-
|
|
35
|
+
<script type="module" crossorigin src="/chunk-c47kwavk.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) {
|
|
@@ -319844,7 +319843,12 @@ Upgrade to Plus to increase the limit and keep working`,
|
|
|
319844
319843
|
myBoards: "My boards",
|
|
319845
319844
|
notAvailable: "No boards available yet"
|
|
319846
319845
|
},
|
|
319847
|
-
addNew: "Add new"
|
|
319846
|
+
addNew: "Add new",
|
|
319847
|
+
itemsList: "Items list",
|
|
319848
|
+
itemsTitle: "Items",
|
|
319849
|
+
itemsSearch: "Search...",
|
|
319850
|
+
itemsEmpty: "No items",
|
|
319851
|
+
itemsNotFound: "Nothing found"
|
|
319848
319852
|
},
|
|
319849
319853
|
contextMenu: {
|
|
319850
319854
|
delete: "Delete",
|
|
@@ -321102,7 +321106,12 @@ var ru_default = {
|
|
|
321102
321106
|
myBoards: "Мои доски",
|
|
321103
321107
|
notAvailable: "Досок пока нет"
|
|
321104
321108
|
},
|
|
321105
|
-
addNew: "Добавить"
|
|
321109
|
+
addNew: "Добавить",
|
|
321110
|
+
itemsList: "Список предметов",
|
|
321111
|
+
itemsTitle: "Предметы",
|
|
321112
|
+
itemsSearch: "Поиск...",
|
|
321113
|
+
itemsEmpty: "Нет элементов",
|
|
321114
|
+
itemsNotFound: "Ничего не найдено"
|
|
321106
321115
|
},
|
|
321107
321116
|
contextMenu: {
|
|
321108
321117
|
delete: "Удалить",
|
|
@@ -370896,6 +370905,7 @@ function BoardItemsList({
|
|
|
370896
370905
|
}) {
|
|
370897
370906
|
const { board } = useAppContext();
|
|
370898
370907
|
const forceUpdate = useForceUpdate();
|
|
370908
|
+
const { t: t10 } = useTranslation();
|
|
370899
370909
|
useAppSubscription({
|
|
370900
370910
|
subjects: ["items"],
|
|
370901
370911
|
observer: forceUpdate
|
|
@@ -370909,7 +370919,7 @@ function BoardItemsList({
|
|
|
370909
370919
|
if (matched.length === 0) {
|
|
370910
370920
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370911
370921
|
className: BoardItemsList_module_default.empty
|
|
370912
|
-
}, "
|
|
370922
|
+
}, t10("sidePanel.itemsNotFound"));
|
|
370913
370923
|
}
|
|
370914
370924
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370915
370925
|
className: BoardItemsList_module_default.list
|
|
@@ -370924,7 +370934,7 @@ function BoardItemsList({
|
|
|
370924
370934
|
if (topLevelItems.length === 0) {
|
|
370925
370935
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370926
370936
|
className: BoardItemsList_module_default.empty
|
|
370927
|
-
}, "
|
|
370937
|
+
}, t10("sidePanel.itemsEmpty"));
|
|
370928
370938
|
}
|
|
370929
370939
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370930
370940
|
className: BoardItemsList_module_default.list
|
|
@@ -371191,7 +371201,7 @@ function SidePanel() {
|
|
|
371191
371201
|
iconName: "ArrowLeft1"
|
|
371192
371202
|
})), /* @__PURE__ */ import_react208.default.createElement("h3", {
|
|
371193
371203
|
className: SidePanel_module_default.title
|
|
371194
|
-
}, "
|
|
371204
|
+
}, t10("sidePanel.itemsTitle")), /* @__PURE__ */ import_react208.default.createElement(UiButton, {
|
|
371195
371205
|
onClick: toggleSideMenu,
|
|
371196
371206
|
variant: "secondary",
|
|
371197
371207
|
className: SidePanel_module_default.close
|
|
@@ -371206,7 +371216,7 @@ function SidePanel() {
|
|
|
371206
371216
|
className: SidePanel_module_default.itemsSearchIcon
|
|
371207
371217
|
}), /* @__PURE__ */ import_react208.default.createElement("input", {
|
|
371208
371218
|
className: SidePanel_module_default.itemsSearchInput,
|
|
371209
|
-
placeholder: "
|
|
371219
|
+
placeholder: t10("sidePanel.itemsSearch"),
|
|
371210
371220
|
ref: itemsSearchRef,
|
|
371211
371221
|
value: itemsQuery,
|
|
371212
371222
|
onChange: (e15) => setItemsQuery(e15.target.value)
|
|
@@ -371264,7 +371274,7 @@ function SidePanel() {
|
|
|
371264
371274
|
iconName: "Stack",
|
|
371265
371275
|
width: 16,
|
|
371266
371276
|
height: 16
|
|
371267
|
-
}), /* @__PURE__ */ import_react208.default.createElement("span", null, "
|
|
371277
|
+
}), /* @__PURE__ */ import_react208.default.createElement("span", null, t10("sidePanel.itemsList"))), /* @__PURE__ */ import_react208.default.createElement("button", {
|
|
371268
371278
|
className: SidePanel_module_default.add,
|
|
371269
371279
|
onClick: handleAddNewMenu
|
|
371270
371280
|
}, /* @__PURE__ */ import_react208.default.createElement(Icon, {
|
|
@@ -445804,6 +445814,25 @@ var BoardPage = () => {
|
|
|
445804
445814
|
});
|
|
445805
445815
|
app.render();
|
|
445806
445816
|
});
|
|
445817
|
+
} else if (window.opener) {
|
|
445818
|
+
boardsList.createBoard().then((boardId) => {
|
|
445819
|
+
app.openBoard(boardId).then(() => {
|
|
445820
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445821
|
+
app.render();
|
|
445822
|
+
console.log("[import] board ready, sending snapshot-ready to opener");
|
|
445823
|
+
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445824
|
+
const onMessage = (event) => {
|
|
445825
|
+
if (event.data?.type !== "microboard-snapshot")
|
|
445826
|
+
return;
|
|
445827
|
+
window.removeEventListener("message", onMessage);
|
|
445828
|
+
const { html: html5 } = event.data;
|
|
445829
|
+
console.log("[import] received snapshot, html length:", html5.length);
|
|
445830
|
+
const added = app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445831
|
+
console.log("[import] deserializeHTMLAndEmit added ids:", added);
|
|
445832
|
+
};
|
|
445833
|
+
window.addEventListener("message", onMessage);
|
|
445834
|
+
});
|
|
445835
|
+
});
|
|
445807
445836
|
} else {
|
|
445808
445837
|
const lastSeenBoard = localStorage.getItem(LAST_BOARD_KEY);
|
|
445809
445838
|
const isFirstVisit = !api7.get("first_visit");
|
|
@@ -445828,21 +445857,8 @@ var BoardPage = () => {
|
|
|
445828
445857
|
} else {
|
|
445829
445858
|
boardsList.createBoard().then((boardId) => {
|
|
445830
445859
|
app.openBoard(boardId).then(() => {
|
|
445831
|
-
navigate(`/boards/${boardId}`, {
|
|
445832
|
-
replace: true
|
|
445833
|
-
});
|
|
445860
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445834
445861
|
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
445862
|
});
|
|
445847
445863
|
});
|
|
445848
445864
|
}
|
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) {
|
|
@@ -319844,7 +319843,12 @@ Upgrade to Plus to increase the limit and keep working`,
|
|
|
319844
319843
|
myBoards: "My boards",
|
|
319845
319844
|
notAvailable: "No boards available yet"
|
|
319846
319845
|
},
|
|
319847
|
-
addNew: "Add new"
|
|
319846
|
+
addNew: "Add new",
|
|
319847
|
+
itemsList: "Items list",
|
|
319848
|
+
itemsTitle: "Items",
|
|
319849
|
+
itemsSearch: "Search...",
|
|
319850
|
+
itemsEmpty: "No items",
|
|
319851
|
+
itemsNotFound: "Nothing found"
|
|
319848
319852
|
},
|
|
319849
319853
|
contextMenu: {
|
|
319850
319854
|
delete: "Delete",
|
|
@@ -321102,7 +321106,12 @@ var ru_default = {
|
|
|
321102
321106
|
myBoards: "Мои доски",
|
|
321103
321107
|
notAvailable: "Досок пока нет"
|
|
321104
321108
|
},
|
|
321105
|
-
addNew: "Добавить"
|
|
321109
|
+
addNew: "Добавить",
|
|
321110
|
+
itemsList: "Список предметов",
|
|
321111
|
+
itemsTitle: "Предметы",
|
|
321112
|
+
itemsSearch: "Поиск...",
|
|
321113
|
+
itemsEmpty: "Нет элементов",
|
|
321114
|
+
itemsNotFound: "Ничего не найдено"
|
|
321106
321115
|
},
|
|
321107
321116
|
contextMenu: {
|
|
321108
321117
|
delete: "Удалить",
|
|
@@ -370896,6 +370905,7 @@ function BoardItemsList({
|
|
|
370896
370905
|
}) {
|
|
370897
370906
|
const { board } = useAppContext();
|
|
370898
370907
|
const forceUpdate = useForceUpdate();
|
|
370908
|
+
const { t: t10 } = useTranslation();
|
|
370899
370909
|
useAppSubscription({
|
|
370900
370910
|
subjects: ["items"],
|
|
370901
370911
|
observer: forceUpdate
|
|
@@ -370909,7 +370919,7 @@ function BoardItemsList({
|
|
|
370909
370919
|
if (matched.length === 0) {
|
|
370910
370920
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370911
370921
|
className: BoardItemsList_module_default.empty
|
|
370912
|
-
}, "
|
|
370922
|
+
}, t10("sidePanel.itemsNotFound"));
|
|
370913
370923
|
}
|
|
370914
370924
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370915
370925
|
className: BoardItemsList_module_default.list
|
|
@@ -370924,7 +370934,7 @@ function BoardItemsList({
|
|
|
370924
370934
|
if (topLevelItems.length === 0) {
|
|
370925
370935
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370926
370936
|
className: BoardItemsList_module_default.empty
|
|
370927
|
-
}, "
|
|
370937
|
+
}, t10("sidePanel.itemsEmpty"));
|
|
370928
370938
|
}
|
|
370929
370939
|
return /* @__PURE__ */ import_react205.default.createElement("div", {
|
|
370930
370940
|
className: BoardItemsList_module_default.list
|
|
@@ -371191,7 +371201,7 @@ function SidePanel() {
|
|
|
371191
371201
|
iconName: "ArrowLeft1"
|
|
371192
371202
|
})), /* @__PURE__ */ import_react208.default.createElement("h3", {
|
|
371193
371203
|
className: SidePanel_module_default.title
|
|
371194
|
-
}, "
|
|
371204
|
+
}, t10("sidePanel.itemsTitle")), /* @__PURE__ */ import_react208.default.createElement(UiButton, {
|
|
371195
371205
|
onClick: toggleSideMenu,
|
|
371196
371206
|
variant: "secondary",
|
|
371197
371207
|
className: SidePanel_module_default.close
|
|
@@ -371206,7 +371216,7 @@ function SidePanel() {
|
|
|
371206
371216
|
className: SidePanel_module_default.itemsSearchIcon
|
|
371207
371217
|
}), /* @__PURE__ */ import_react208.default.createElement("input", {
|
|
371208
371218
|
className: SidePanel_module_default.itemsSearchInput,
|
|
371209
|
-
placeholder: "
|
|
371219
|
+
placeholder: t10("sidePanel.itemsSearch"),
|
|
371210
371220
|
ref: itemsSearchRef,
|
|
371211
371221
|
value: itemsQuery,
|
|
371212
371222
|
onChange: (e15) => setItemsQuery(e15.target.value)
|
|
@@ -371264,7 +371274,7 @@ function SidePanel() {
|
|
|
371264
371274
|
iconName: "Stack",
|
|
371265
371275
|
width: 16,
|
|
371266
371276
|
height: 16
|
|
371267
|
-
}), /* @__PURE__ */ import_react208.default.createElement("span", null, "
|
|
371277
|
+
}), /* @__PURE__ */ import_react208.default.createElement("span", null, t10("sidePanel.itemsList"))), /* @__PURE__ */ import_react208.default.createElement("button", {
|
|
371268
371278
|
className: SidePanel_module_default.add,
|
|
371269
371279
|
onClick: handleAddNewMenu
|
|
371270
371280
|
}, /* @__PURE__ */ import_react208.default.createElement(Icon, {
|
|
@@ -445804,6 +445814,25 @@ var BoardPage = () => {
|
|
|
445804
445814
|
});
|
|
445805
445815
|
app.render();
|
|
445806
445816
|
});
|
|
445817
|
+
} else if (window.opener) {
|
|
445818
|
+
boardsList.createBoard().then((boardId) => {
|
|
445819
|
+
app.openBoard(boardId).then(() => {
|
|
445820
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445821
|
+
app.render();
|
|
445822
|
+
console.log("[import] board ready, sending snapshot-ready to opener");
|
|
445823
|
+
window.opener.postMessage({ type: "microboard-snapshot-ready" }, "*");
|
|
445824
|
+
const onMessage = (event) => {
|
|
445825
|
+
if (event.data?.type !== "microboard-snapshot")
|
|
445826
|
+
return;
|
|
445827
|
+
window.removeEventListener("message", onMessage);
|
|
445828
|
+
const { html: html5 } = event.data;
|
|
445829
|
+
console.log("[import] received snapshot, html length:", html5.length);
|
|
445830
|
+
const added = app.getBoard().deserializeHTMLAndEmit(html5);
|
|
445831
|
+
console.log("[import] deserializeHTMLAndEmit added ids:", added);
|
|
445832
|
+
};
|
|
445833
|
+
window.addEventListener("message", onMessage);
|
|
445834
|
+
});
|
|
445835
|
+
});
|
|
445807
445836
|
} else {
|
|
445808
445837
|
const lastSeenBoard = localStorage.getItem(LAST_BOARD_KEY);
|
|
445809
445838
|
const isFirstVisit = !api7.get("first_visit");
|
|
@@ -445828,21 +445857,8 @@ var BoardPage = () => {
|
|
|
445828
445857
|
} else {
|
|
445829
445858
|
boardsList.createBoard().then((boardId) => {
|
|
445830
445859
|
app.openBoard(boardId).then(() => {
|
|
445831
|
-
navigate(`/boards/${boardId}`, {
|
|
445832
|
-
replace: true
|
|
445833
|
-
});
|
|
445860
|
+
navigate(`/boards/${boardId}`, { replace: true });
|
|
445834
445861
|
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
445862
|
});
|
|
445847
445863
|
});
|
|
445848
445864
|
}
|
|
@@ -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.7",
|
|
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.4",
|
|
83
83
|
"nanoid": "^5.1.5",
|
|
84
84
|
"prop-types": "^15.8.1",
|
|
85
85
|
"react-hot-toast": "2.4.1",
|