microboard-ui-temp 0.1.74 → 0.1.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.css CHANGED
@@ -2871,6 +2871,12 @@ a.link_jFMnzg {
2871
2871
  background-color: #f7f7f8;
2872
2872
  }
2873
2873
 
2874
+ .quaternary_Lhh5GA {
2875
+ color: #fff;
2876
+ background-color: #924fe8;
2877
+ border: 1px solid #924fe8;
2878
+ }
2879
+
2874
2880
  .quaternary_Lhh5GA:hover {
2875
2881
  background-color: #b799f5;
2876
2882
  border: 1px solid #924fe8;
package/dist/index.js CHANGED
@@ -330907,15 +330907,15 @@ function useAppContext() {
330907
330907
 
330908
330908
  // src/App/useAccount.ts
330909
330909
  function useAccount2() {
330910
- const { app: app2 } = useAppContext();
330910
+ const { app } = useAppContext();
330911
330911
  const forceUpdate = useForceUpdate2();
330912
330912
  import_react110.useLayoutEffect(() => {
330913
- app2.account.subject.subscribe(forceUpdate);
330913
+ app.account.subject.subscribe(forceUpdate);
330914
330914
  return () => {
330915
- app2.account.subject.unsubscribe(forceUpdate);
330915
+ app.account.subject.unsubscribe(forceUpdate);
330916
330916
  };
330917
330917
  }, []);
330918
- return app2.account;
330918
+ return app.account;
330919
330919
  }
330920
330920
 
330921
330921
  // src/features/WalletLoginButton/WalletLoginButton.tsx
@@ -339632,7 +339632,7 @@ var MIRO_IMG_AUTH_CLIPBOARD = Symbol("imgAuthClipboardNotification");
339632
339632
  var ImgAuthClipboardModal = () => {
339633
339633
  const { t: t10 } = useTranslation();
339634
339634
  const { closeModal: closeModal2 } = useUiModalContext();
339635
- const { app: app2 } = useAppContext();
339635
+ const { app } = useAppContext();
339636
339636
  const onAuthClick = () => {
339637
339637
  closeModal2();
339638
339638
  const clientId = import.meta.env.MIRO_CLIENT_ID;
@@ -339642,7 +339642,7 @@ var ImgAuthClipboardModal = () => {
339642
339642
  };
339643
339643
  const onContinueClick = () => {
339644
339644
  closeModal2();
339645
- useCopyBoardItems(app2.getBoard(), app2.account.accessToken, undefined, true);
339645
+ useCopyBoardItems(app.getBoard(), app.account.accessToken, undefined, true);
339646
339646
  };
339647
339647
  return /* @__PURE__ */ import_react141.default.createElement(UiModal, {
339648
339648
  modalId: MIRO_IMG_AUTH_CLIPBOARD,
@@ -345098,14 +345098,14 @@ var AIContextProvider = ({
345098
345098
  children
345099
345099
  }) => {
345100
345100
  const { t: t10 } = useTranslation();
345101
- const { app: app2 } = useAppContext();
345101
+ const { app } = useAppContext();
345102
345102
  const [model, setModel] = import_react176.useState("gpt-4o-mini");
345103
345103
  const [responseNodeId, setResponseNodeId] = import_react176.useState();
345104
345104
  const [quotedText, setQuotedText] = import_react176.useState();
345105
345105
  const account = useAccount2();
345106
345106
  const { openModal: openModal2 } = useUiModalContext();
345107
345107
  const stopStream = async (boardId, itemId, account2) => {
345108
- const connection = app2.getConnection();
345108
+ const connection = app.getConnection();
345109
345109
  const stopMessage = {
345110
345110
  type: "AiChat",
345111
345111
  boardId,
@@ -345118,7 +345118,7 @@ var AIContextProvider = ({
345118
345118
  await account2.fetchBillingInfo();
345119
345119
  };
345120
345120
  function createNodesWithConnectors(idea, itemToContinueThread, contextItems = [], isIdeaFromInput = true) {
345121
- const board = app2.getBoard();
345121
+ const board = app.getBoard();
345122
345122
  const reverseIndexMap = { 0: 1, 1: 0, 2: 3, 3: 2 };
345123
345123
  let requestAdded;
345124
345124
  if (itemToContinueThread && itemToContinueThread.itemType === "AINode" && itemToContinueThread.getIsUserRequest() && !isIdeaFromInput) {
@@ -345169,7 +345169,7 @@ var AIContextProvider = ({
345169
345169
  return { responseAdded, requestAdded };
345170
345170
  }
345171
345171
  const tryToSendGenerationRequest = async (fallback3, startGenerationCb) => {
345172
- const board = app2.getBoard();
345172
+ const board = app.getBoard();
345173
345173
  if (!account.isLoggedIn) {
345174
345174
  return openModal2(AI_UNAVAILABLE_MODAL_ID);
345175
345175
  }
@@ -345206,8 +345206,8 @@ var AIContextProvider = ({
345206
345206
  }
345207
345207
  };
345208
345208
  const startGeneration = async () => {
345209
- const connection = app2.getConnection();
345210
- const board = app2.getBoard();
345209
+ const connection = app.getConnection();
345210
+ const board = app.getBoard();
345211
345211
  const ideaFromSelection = getIdeaFromSelection(board.selection.items.list());
345212
345212
  if (!connection) {
345213
345213
  console.error("Ws no open");
@@ -345297,26 +345297,14 @@ var import_react178 = __toESM(require_react(), 1);
345297
345297
  // src/App/useBoardSubscription.ts
345298
345298
  var import_react177 = __toESM(require_react(), 1);
345299
345299
  function useAppSubscription(subscription) {
345300
- const { app: app2 } = useAppContext();
345300
+ const { app } = useAppContext();
345301
345301
  import_react177.useLayoutEffect(() => {
345302
- app2.subscriptions.add(subscription);
345302
+ app.subscriptions.add(subscription);
345303
345303
  return () => {
345304
- app2.subscriptions.remove(subscription);
345304
+ app.subscriptions.remove(subscription);
345305
345305
  };
345306
345306
  }, []);
345307
345307
  }
345308
- function useTools() {
345309
- const { board } = useAppContext();
345310
- const [tools, setTools] = import_react177.default.useState(board.tools);
345311
- useAppSubscription({
345312
- subjects: ["tools"],
345313
- observer: () => {
345314
- setTools(board.tools);
345315
- }
345316
- });
345317
- import_react177.useEffect(() => {}, [tools]);
345318
- return tools;
345319
- }
345320
345308
 
345321
345309
  // src/entities/AIInput/AIGenerationButton.tsx
345322
345310
  var AiGenerationButton = () => {
@@ -345795,7 +345783,7 @@ var getCorrectEnding = (number3) => {
345795
345783
  var sessionStorage5 = new SessionStorage2;
345796
345784
  var AIInput = () => {
345797
345785
  const { t: t10 } = useTranslation();
345798
- const { app: app2, board } = useAppContext();
345786
+ const { app, board } = useAppContext();
345799
345787
  const [inputValue, setInputValue] = import_react183.useState("");
345800
345788
  const disabledRef = import_react183.useRef(!!board.aiGeneratingOnItem);
345801
345789
  const inputRef = import_react183.useRef(null);
@@ -345879,7 +345867,7 @@ var AIInput = () => {
345879
345867
  }
345880
345868
  };
345881
345869
  const sendInputData = async () => {
345882
- const connection = app2.getConnection();
345870
+ const connection = app.getConnection();
345883
345871
  if (!connection) {
345884
345872
  console.error("Ws no open");
345885
345873
  return;
@@ -345977,7 +345965,7 @@ var AIInput = () => {
345977
345965
  }
345978
345966
  };
345979
345967
  const handleStopClick = async () => {
345980
- const boardId2 = app2.getBoard().getBoardId();
345968
+ const boardId2 = app.getBoard().getBoardId();
345981
345969
  if (responseNodeId) {
345982
345970
  await stopStream(boardId2, responseNodeId, account);
345983
345971
  board.aiGeneratingOnItem = undefined;
@@ -346319,7 +346307,7 @@ class CanvasBase extends React146.Component {
346319
346307
  var Canvas = withRouter(CanvasBase);
346320
346308
  // src/entities/Canvas/CanvasNoRouter.tsx
346321
346309
  var import_react186 = __toESM(require_react(), 1);
346322
- var CanvasNoRouter = ({ app: app2, board, children }) => {
346310
+ var CanvasNoRouter = ({ app, board, children }) => {
346323
346311
  const stageRef = import_react186.useRef(null);
346324
346312
  const canvasRef = import_react186.useRef(null);
346325
346313
  const cursorsCanvasRef = import_react186.useRef(null);
@@ -346351,13 +346339,13 @@ var CanvasNoRouter = ({ app: app2, board, children }) => {
346351
346339
  }, [board]);
346352
346340
  const initCanvasRendering = import_react186.useCallback(() => {
346353
346341
  renderToContext();
346354
- app2.subscriptions.add(drawingContextSubscription);
346355
- app2.subscriptions.add(cursorSubscription);
346356
- app2.subscriptions.add(resizeSubscription);
346357
- }, [app2, renderToContext]);
346342
+ app.subscriptions.add(drawingContextSubscription);
346343
+ app.subscriptions.add(cursorSubscription);
346344
+ app.subscriptions.add(resizeSubscription);
346345
+ }, [app, renderToContext]);
346358
346346
  import_react186.useEffect(() => {
346359
346347
  const stage = stageRef.current;
346360
- const controller16 = app2.controller;
346348
+ const controller16 = app.controller;
346361
346349
  if (stage) {
346362
346350
  const handlePointerDown = (event) => {
346363
346351
  controller16.onPointerDown(event);
@@ -346391,13 +346379,13 @@ var CanvasNoRouter = ({ app: app2, board, children }) => {
346391
346379
  });
346392
346380
  stage.removeEventListener("dblclick", controller16.onClick);
346393
346381
  stage.removeEventListener("pointermove", controller16.onPointerMove);
346394
- app2.subscriptions.remove(drawingContextSubscription);
346395
- app2.subscriptions.remove(cursorSubscription);
346396
- app2.subscriptions.remove(resizeSubscription);
346382
+ app.subscriptions.remove(drawingContextSubscription);
346383
+ app.subscriptions.remove(cursorSubscription);
346384
+ app.subscriptions.remove(resizeSubscription);
346397
346385
  };
346398
346386
  }
346399
346387
  return () => {};
346400
- }, [app2, initCanvasRendering]);
346388
+ }, [app, initCanvasRendering]);
346401
346389
  const drawingContextSubscription = {
346402
346390
  observer: renderToContext,
346403
346391
  subjects: ["camera", "items", "tools", "selection", "presence"]
@@ -346549,15 +346537,15 @@ function AccessDeniedModal() {
346549
346537
  // src/App/useBoardsList.ts
346550
346538
  var import_react188 = __toESM(require_react(), 1);
346551
346539
  function useBoardsList() {
346552
- const { app: app2 } = useAppContext();
346540
+ const { app } = useAppContext();
346553
346541
  const forceUpdate = useForceUpdate2();
346554
346542
  import_react188.useEffect(() => {
346555
- app2.boardsList.subject.subscribe(forceUpdate);
346543
+ app.boardsList.subject.subscribe(forceUpdate);
346556
346544
  return () => {
346557
- app2.boardsList.subject.unsubscribe(forceUpdate);
346545
+ app.boardsList.subject.unsubscribe(forceUpdate);
346558
346546
  };
346559
346547
  }, []);
346560
- return app2.boardsList;
346548
+ return app.boardsList;
346561
346549
  }
346562
346550
 
346563
346551
  // src/features/ContextMenu/ContextMenu.tsx
@@ -352187,15 +352175,15 @@ function SidePanelContextProvider({
352187
352175
  const [isOpen, setIsOpen] = import_react206.useState(false);
352188
352176
  const [stamp, setStamp] = import_react206.useState(null);
352189
352177
  const [highlighted, setHighlighted] = import_react206.useState(false);
352190
- const { app: app2 } = useAppContext();
352178
+ const { app } = useAppContext();
352191
352179
  const navigate = useNavigate();
352192
352180
  const boardsList = useBoardsList();
352193
352181
  const timeoutRef = import_react206.useRef();
352194
352182
  const { close } = useContextMenuContext();
352195
352183
  const forceUpdate = useForceUpdate2();
352196
352184
  import_react206.useEffect(() => {
352197
- app2.boardSubject.subscribe(forceUpdate);
352198
- return () => app2.boardSubject.unsubscribe(forceUpdate);
352185
+ app.boardSubject.subscribe(forceUpdate);
352186
+ return () => app.boardSubject.unsubscribe(forceUpdate);
352199
352187
  }, []);
352200
352188
  const toggleSideMenu = () => {
352201
352189
  setIsOpen((prev) => {
@@ -352226,7 +352214,7 @@ function SidePanelContextProvider({
352226
352214
  }, [isOpen]);
352227
352215
  const handleAddNew = async (cb) => {
352228
352216
  const boardId = await boardsList.createBoard();
352229
- await app2.openBoard(boardId);
352217
+ await app.openBoard(boardId);
352230
352218
  navigate(`/boards/${boardId}`, {
352231
352219
  replace: true
352232
352220
  });
@@ -352526,7 +352514,7 @@ var FolderItem_module_default = {
352526
352514
 
352527
352515
  // src/entities/Folder/FolderItem.tsx
352528
352516
  var FolderItem = import_react211.forwardRef(({ board, folder, handleOpenBoard }, ref4) => {
352529
- const { app: app2, board: currentBoard } = useAppContext();
352517
+ const { app, board: currentBoard } = useAppContext();
352530
352518
  const navigate = useNavigate();
352531
352519
  const { open } = useContextMenuContext();
352532
352520
  const { setRenamingId, setNewName, renamingId } = useRenameContext();
@@ -352550,7 +352538,7 @@ var FolderItem = import_react211.forwardRef(({ board, folder, handleOpenBoard },
352550
352538
  if (handleOpenBoard) {
352551
352539
  return handleOpenBoard(board);
352552
352540
  }
352553
- await app2.openBoard(board.id);
352541
+ await app.openBoard(board.id);
352554
352542
  navigate(`/boards/${board.id}`);
352555
352543
  }, (ev) => {
352556
352544
  ev.preventDefault();
@@ -352917,7 +352905,7 @@ function ContextMenu() {
352917
352905
  const { setNewName, setRenamingId } = useRenameContext();
352918
352906
  const boardsList = useBoardsList();
352919
352907
  const account = useAccount2();
352920
- const { board, app: app2 } = useAppContext();
352908
+ const { board, app } = useAppContext();
352921
352909
  const { t: t10 } = useTranslation();
352922
352910
  const { openModalConfirm } = useConfirmModalContext();
352923
352911
  const { openModal: openModal2 } = useUiModalContext();
@@ -352951,34 +352939,34 @@ function ContextMenu() {
352951
352939
  setRenamingId(boardId2);
352952
352940
  setNewName(boardInfo2?.title ?? "");
352953
352941
  setId(boardId2);
352954
- app2.openBoard(boardId2).then(() => navigate(`/boards/${boardId2}`));
352942
+ app.openBoard(boardId2).then(() => navigate(`/boards/${boardId2}`));
352955
352943
  };
352956
352944
  const deserializeBoard = (stringedHTML, emit5 = false) => {
352957
352945
  if (emit5) {
352958
- app2.getBoard().deserializeHTMLAndEmit(stringedHTML);
352946
+ app.getBoard().deserializeHTMLAndEmit(stringedHTML);
352959
352947
  } else {
352960
- app2.getBoard().deserializeHTML(stringedHTML);
352948
+ app.getBoard().deserializeHTML(stringedHTML);
352961
352949
  }
352962
- app2.render();
352963
- const sumMbr = app2.getBoard().items.listAll().reduce((acc, item) => {
352950
+ app.render();
352951
+ const sumMbr = app.getBoard().items.listAll().reduce((acc, item) => {
352964
352952
  if (!acc) {
352965
352953
  return item.getMbr();
352966
352954
  }
352967
352955
  return acc.combine(item.getMbr());
352968
352956
  }, undefined);
352969
352957
  if (sumMbr) {
352970
- app2.getBoard().camera.zoomToFit(sumMbr);
352958
+ app.getBoard().camera.zoomToFit(sumMbr);
352971
352959
  }
352972
352960
  };
352973
352961
  const handleEditLocalFile = async (ev) => {
352974
352962
  ev.preventDefault();
352975
352963
  ev.stopPropagation();
352976
352964
  setIsEditingLocalFile(true);
352977
- const stringedHTML = await app2.openAndEditFile();
352965
+ const stringedHTML = await app.openAndEditFile();
352978
352966
  if (stringedHTML) {
352979
352967
  close();
352980
352968
  setId(boardId);
352981
- app2.openBoardFromFile();
352969
+ app.openBoardFromFile();
352982
352970
  navigate(`/boards/local`);
352983
352971
  deserializeBoard(stringedHTML);
352984
352972
  }
@@ -353023,7 +353011,7 @@ function ContextMenu() {
353023
353011
  const boardId2 = await boardsList.createBoard(boardName, folderInfo?.type === exports_folders.FolderType.DRAFTS, folderId ?? undefined);
353024
353012
  close();
353025
353013
  setId(boardId2);
353026
- await app2.openBoard(boardId2);
353014
+ await app.openBoard(boardId2);
353027
353015
  navigate(`/boards/${boardId2}`);
353028
353016
  deserializeBoard(htmlContent, true);
353029
353017
  }
@@ -353068,7 +353056,7 @@ function ContextMenu() {
353068
353056
  }
353069
353057
  if (boardId === currentBoardId) {
353070
353058
  navigate("/boards/blank");
353071
- await app2.openBoard("blank");
353059
+ await app.openBoard("blank");
353072
353060
  board.disconnect();
353073
353061
  }
353074
353062
  setIsDeletingBoard(true);
@@ -353096,7 +353084,7 @@ function ContextMenu() {
353096
353084
  return;
353097
353085
  }
353098
353086
  if (boardsList.isFolderContainsBoard(folderId, board.getBoardId())) {
353099
- app2.openBoard("blank");
353087
+ app.openBoard("blank");
353100
353088
  navigate("/boards/blank");
353101
353089
  }
353102
353090
  boardsList.removeFolder(folderId);
@@ -353243,7 +353231,7 @@ function ContextMenuItem({
353243
353231
  // src/App/useDomMbr.ts
353244
353232
  var import_react216 = __toESM(require_react(), 1);
353245
353233
  function useDomMbr({
353246
- app: app2,
353234
+ app,
353247
353235
  board,
353248
353236
  ref: ref4,
353249
353237
  subjects = ["camera", "selection"],
@@ -353588,7 +353576,7 @@ var ConnectorType_module_default = {
353588
353576
  var MENU_NAME = "ConnectorType";
353589
353577
  function ConnectorType() {
353590
353578
  const { toggleMenu, openedMenu, panelMbr, windowHeight } = usePanelContext();
353591
- const { board, app: app2 } = useAppContext();
353579
+ const { board, app } = useAppContext();
353592
353580
  const { t: t10 } = useTranslation();
353593
353581
  const connectorType = board.selection.getConnectorLineStyle();
353594
353582
  const connectorLineWidth = board.selection.getConnectorLineWidth();
@@ -353598,17 +353586,17 @@ function ConnectorType() {
353598
353586
  };
353599
353587
  const handlePick = (type) => {
353600
353588
  board.selection.setConnectorLineStyle(type);
353601
- app2.sessionStorage.setConnectorLineStyle(type);
353589
+ app.sessionStorage.setConnectorLineStyle(type);
353602
353590
  toggleMenu("None");
353603
353591
  };
353604
353592
  const handleStrokeStylePick = (style2) => {
353605
353593
  board.selection.setStrokeStyle(style2);
353606
- app2.sessionStorage.setConnectorStrokeStyle(style2);
353594
+ app.sessionStorage.setConnectorStrokeStyle(style2);
353607
353595
  toggleMenu("None");
353608
353596
  };
353609
353597
  const handleSliderChange = (width2) => {
353610
353598
  board.selection.setStrokeWidth(width2);
353611
- app2.sessionStorage.setConnectorLineWidth(width2);
353599
+ app.sessionStorage.setConnectorLineWidth(width2);
353612
353600
  };
353613
353601
  return /* @__PURE__ */ import_react223.default.createElement(ButtonWithMenu, {
353614
353602
  menuName: MENU_NAME,
@@ -354078,7 +354066,7 @@ var EndPointer_module_default = {
354078
354066
  var MENU_NAME3 = "EndPointer";
354079
354067
  function EndPointer() {
354080
354068
  const { toggleMenu, openedMenu, panelMbr, windowHeight } = usePanelContext();
354081
- const { board, app: app2 } = useAppContext();
354069
+ const { board, app } = useAppContext();
354082
354070
  const { t: t10 } = useTranslation();
354083
354071
  const pointerStartStyle = board.selection.getEndPointerStyle();
354084
354072
  const handleClick = () => {
@@ -354086,7 +354074,7 @@ function EndPointer() {
354086
354074
  };
354087
354075
  const handlePick = (type) => {
354088
354076
  board.selection.setEndPointerStyle(type);
354089
- app2.sessionStorage.setConnectorPointer(type, "end");
354077
+ app.sessionStorage.setConnectorPointer(type, "end");
354090
354078
  toggleMenu("None");
354091
354079
  };
354092
354080
  return /* @__PURE__ */ import_react236.default.createElement(ButtonWithMenu, {
@@ -354971,7 +354959,7 @@ var StartPointer_module_default = {
354971
354959
  var MENU_NAME11 = "StartPointer";
354972
354960
  function StartPointer() {
354973
354961
  const { toggleMenu, openedMenu, panelMbr, windowHeight } = usePanelContext();
354974
- const { board, app: app2 } = useAppContext();
354962
+ const { board, app } = useAppContext();
354975
354963
  const { t: t10 } = useTranslation();
354976
354964
  const pointerStartStyle = board.selection.getStartPointerStyle();
354977
354965
  const handleClick = () => {
@@ -354979,7 +354967,7 @@ function StartPointer() {
354979
354967
  };
354980
354968
  const handlePick = (type) => {
354981
354969
  board.selection.setStartPointerStyle(type);
354982
- app2.sessionStorage.setConnectorPointer(type, "start");
354970
+ app.sessionStorage.setConnectorPointer(type, "start");
354983
354971
  toggleMenu("None");
354984
354972
  };
354985
354973
  return /* @__PURE__ */ import_react255.default.createElement(ButtonWithMenu, {
@@ -355535,7 +355523,7 @@ var import_react266 = __toESM(require_react(), 1);
355535
355523
  var MENU_NAME17 = "ConnectorLineColor";
355536
355524
  function ConnectorLineColor() {
355537
355525
  const { toggleMenu, openedMenu, panelMbr, windowHeight } = usePanelContext();
355538
- const { board, app: app2 } = useAppContext();
355526
+ const { board, app } = useAppContext();
355539
355527
  const { t: t10 } = useTranslation();
355540
355528
  const connectorLineColor = board.selection.getConnectorLineColor();
355541
355529
  const handleClick = () => {
@@ -355543,11 +355531,11 @@ function ConnectorLineColor() {
355543
355531
  };
355544
355532
  const handlePick = (color2) => {
355545
355533
  board.selection.setStrokeColor(color2);
355546
- app2.sessionStorage.setConnectorFillColor(color2);
355534
+ app.sessionStorage.setConnectorFillColor(color2);
355547
355535
  toggleMenu("None");
355548
355536
  };
355549
355537
  const handleCustomPick = (color2) => {
355550
- app2.sessionStorage.setConnectorFillColor(color2);
355538
+ app.sessionStorage.setConnectorFillColor(color2);
355551
355539
  board.selection.setStrokeColor(color2);
355552
355540
  };
355553
355541
  const isPredefinedColor = conf.SHAPE_STROKE_COLORS.some((color2) => color2 === connectorLineColor);
@@ -356431,11 +356419,11 @@ function FlipDeck({ rounded = "none" }) {
356431
356419
 
356432
356420
  // src/features/ContextPanel/ContextPanel.tsx
356433
356421
  function ContextPanel() {
356434
- const { app: app2, board } = useAppContext();
356422
+ const { app, board } = useAppContext();
356435
356423
  const [openedMenu, setOpenedMenu] = import_react289.useState("None");
356436
356424
  const panelRef = import_react289.useRef(null);
356437
356425
  const mbr = useDomMbr({
356438
- app: app2,
356426
+ app,
356439
356427
  board,
356440
356428
  ref: panelRef
356441
356429
  });
@@ -356769,7 +356757,7 @@ var HyperLink_module_default = {
356769
356757
  var HyperLink = () => {
356770
356758
  const [currentLink, setCurrentLink] = import_react292.useState(null);
356771
356759
  const [isTooltipUnderPointer, setIsTooltipUnderPointer] = import_react292.useState(false);
356772
- const { board, app: app2 } = useAppContext();
356760
+ const { board, app } = useAppContext();
356773
356761
  const forceUpdate = useForceUpdate2();
356774
356762
  const link2 = board.items.getUnderPointer().pop()?.getRichText()?.getHyperLinkByPointerCoordinates(board.pointer.point);
356775
356763
  if (link2 && !isTooltipUnderPointer && link2.hyperLink !== currentLink?.hyperLink) {
@@ -356784,7 +356772,7 @@ var HyperLink = () => {
356784
356772
  });
356785
356773
  const linkContainerRef = import_react292.useRef(null);
356786
356774
  const mbr = useDomMbr({
356787
- app: app2,
356775
+ app,
356788
356776
  board,
356789
356777
  ref: linkContainerRef,
356790
356778
  targetMbr: currentLink?.linkMbr,
@@ -356827,7 +356815,7 @@ var HyperLinkInput_module_default = {
356827
356815
  var HyperLinkInput = () => {
356828
356816
  const [inputValue, setInputValue] = import_react293.useState("");
356829
356817
  const { isEditingLink, setIsEditingLink, hyperLinkData, setHyperLinkData } = useHyperLinkContext();
356830
- const { board, app: app2 } = useAppContext();
356818
+ const { board, app } = useAppContext();
356831
356819
  const { t: t10 } = useTranslation();
356832
356820
  const containerRef = useClickOutside(() => {
356833
356821
  if (isEditingLink) {
@@ -356835,7 +356823,7 @@ var HyperLinkInput = () => {
356835
356823
  }
356836
356824
  }, [], true);
356837
356825
  const mbr = useDomMbr({
356838
- app: app2,
356826
+ app,
356839
356827
  board,
356840
356828
  ref: containerRef,
356841
356829
  targetMbr: board.selection.items.getSingle()?.getRichText()?.getMbr(),
@@ -356970,7 +356958,7 @@ var HyperLinkInput = () => {
356970
356958
  // src/features/ImportMiro/ImportMiroBoards/ImportMiro.tsx
356971
356959
  var import_react294 = __toESM(require_react(), 1);
356972
356960
  function ImportMiro() {
356973
- const { app: app2 } = useAppContext();
356961
+ const { app } = useAppContext();
356974
356962
  const navigate = useNavigate();
356975
356963
  const location3 = useLocation();
356976
356964
  const searchParams = new URLSearchParams(location3.search);
@@ -357000,19 +356988,19 @@ function ImportMiro() {
357000
356988
  }
357001
356989
  };
357002
356990
  const openSeenLastBoard = async () => {
357003
- const lastSeenBoardId = app2.getLastBoardId();
356991
+ const lastSeenBoardId = app.getLastBoardId();
357004
356992
  if (!lastSeenBoardId) {
357005
356993
  console.error("Last seen board is undefined");
357006
356994
  return;
357007
356995
  }
357008
- await app2.openBoard(lastSeenBoardId).then(() => {
356996
+ await app.openBoard(lastSeenBoardId).then(() => {
357009
356997
  navigate(`/boards/${lastSeenBoardId}?clipboard=true`, {
357010
356998
  replace: true
357011
356999
  });
357012
- app2.render();
357000
+ app.render();
357013
357001
  });
357014
- const lastSeenBoard = app2.getBoard();
357015
- useCopyBoardItems(lastSeenBoard, app2.account.accessToken);
357002
+ const lastSeenBoard = app.getBoard();
357003
+ useCopyBoardItems(lastSeenBoard, app.account.accessToken);
357016
357004
  };
357017
357005
  import_react294.useEffect(() => {
357018
357006
  const token = api10.get("miro_accessToken");
@@ -357031,14 +357019,14 @@ function ImportMiro() {
357031
357019
  // src/features/ItemTooltip/ItemTooltip.tsx
357032
357020
  var import_react295 = __toESM(require_react(), 1);
357033
357021
  function ItemTooltip() {
357034
- const { app: app2, board } = useAppContext();
357022
+ const { app, board } = useAppContext();
357035
357023
  const { t: t10 } = useTranslation();
357036
357024
  const { items, camera } = board;
357037
357025
  const [openedMenu, setOpenedMenu] = import_react295.useState("HoverUnderPointer");
357038
357026
  const panelRef = import_react295.useRef(null);
357039
357027
  const placeholders = items.getUnderPointer().filter((item) => item.itemType === "Placeholder" && item.getMiroData()?.type !== "image" /* IMAGE */);
357040
357028
  const mbr = useDomMbr({
357041
- app: app2,
357029
+ app,
357042
357030
  board,
357043
357031
  ref: panelRef,
357044
357032
  subjects: undefined,
@@ -357321,18 +357309,18 @@ var LocalFileSaveProgress_module_default = {
357321
357309
 
357322
357310
  // src/features/LocalFileSavingProgress/LocalFileSaveProgress.tsx
357323
357311
  var LocalFileSaveProgress = () => {
357324
- const { app: app2 } = useAppContext();
357312
+ const { app } = useAppContext();
357325
357313
  const forceUpdate = useForceUpdate2();
357326
357314
  useAppSubscription({
357327
357315
  subjects: ["board"],
357328
357316
  observer: forceUpdate
357329
357317
  });
357330
- if (!app2.getBoard().getBoardId().includes("local") || !app2.getLocalEditFileHandler()) {
357318
+ if (!app.getBoard().getBoardId().includes("local") || !app.getLocalEditFileHandler()) {
357331
357319
  return null;
357332
357320
  }
357333
357321
  return /* @__PURE__ */ import_react299.default.createElement(UiPanel, {
357334
357322
  className: LocalFileSaveProgress_module_default.unauthText
357335
- }, app2.getBoard().events?.log.saveFileTimeout ? "Saving..." : "Saved");
357323
+ }, app.getBoard().events?.log.saveFileTimeout ? "Saving..." : "Saved");
357336
357324
  };
357337
357325
  var LocalFileSaveProgress_default = LocalFileSaveProgress;
357338
357326
  // src/features/Modal/CookiesModal.tsx
@@ -357469,8 +357457,8 @@ var import_react302 = __toESM(require_react(), 1);
357469
357457
  function InactiveBoardHidder({
357470
357458
  children
357471
357459
  }) {
357472
- const { app: app2 } = useAppContext();
357473
- const appBoardId = app2.getBoard().getBoardId();
357460
+ const { app } = useAppContext();
357461
+ const appBoardId = app.getBoard().getBoardId();
357474
357462
  if (appBoardId === "blank") {
357475
357463
  return /* @__PURE__ */ import_react302.default.createElement(import_react302.default.Fragment, null);
357476
357464
  }
@@ -418448,7 +418436,7 @@ ButtonWithMenu2.displayName = "ButtonWithMenu";
418448
418436
 
418449
418437
  // src/features/ToolsPanel/Buttons/AddConnector.tsx
418450
418438
  function AddConnector2() {
418451
- const { board, app: app2 } = useAppContext();
418439
+ const { board, app } = useAppContext();
418452
418440
  const { t: t11 } = useTranslation();
418453
418441
  const [isActive, setIsActive] = import_react318.useState(Boolean(board.tools.getAddConnector()));
418454
418442
  const addTool = board.tools.getAddConnector();
@@ -418467,7 +418455,7 @@ function AddConnector2() {
418467
418455
  const tool = board.tools.getAddConnector();
418468
418456
  if (tool) {
418469
418457
  tool.applyLineStyle(lineStyle);
418470
- app2.sessionStorage.setConnectorLineStyle(lineStyle);
418458
+ app.sessionStorage.setConnectorLineStyle(lineStyle);
418471
418459
  setIsActive(false);
418472
418460
  }
418473
418461
  };
@@ -419905,7 +419893,7 @@ function getOperationAppendix(operation) {
419905
419893
  }
419906
419894
  if (operation.method === "transformMany") {
419907
419895
  const appendixes = Object.values(operation.items).map((op2) => getOperationAppendix(op2));
419908
- if (appendixes.every((app2) => app2 === appendixes[0])) {
419896
+ if (appendixes.every((app) => app === appendixes[0])) {
419909
419897
  appendix.push(appendixes[0]);
419910
419898
  }
419911
419899
  }
@@ -420632,7 +420620,12 @@ function AddGameItem() {
420632
420620
  function ToolsPanel() {
420633
420621
  const [openedMenu, setOpenedMenu] = import_react354.useState("None");
420634
420622
  const toggleMenu = (menu) => setOpenedMenu((prev2) => prev2 === menu ? "None" : menu);
420635
- useTools();
420623
+ const { app } = useAppContext();
420624
+ const forceUpdate = useForceUpdate2();
420625
+ useAppSubscription({
420626
+ subjects: ["tools"],
420627
+ observer: forceUpdate
420628
+ });
420636
420629
  import_react354.useEffect(() => {}, [window.showDebug]);
420637
420630
  return /* @__PURE__ */ import_react354.default.createElement(PanelContext2.Provider, {
420638
420631
  value: { toggleMenu, openedMenu }
@@ -421975,7 +421968,7 @@ var TogglePresenceRender_module_default = {
421975
421968
  var TogglePresenceRender = () => {
421976
421969
  const { t: t11 } = useTranslation();
421977
421970
  const [cursorsActive, setCursorsActive] = import_react370.useState(true);
421978
- const { app: app2 } = useAppContext();
421971
+ const { app } = useAppContext();
421979
421972
  return /* @__PURE__ */ import_react370.default.createElement(UiButton, {
421980
421973
  id: "tool-cursors-toggle",
421981
421974
  tooltipPosition: "bottom",
@@ -421985,7 +421978,7 @@ var TogglePresenceRender = () => {
421985
421978
  variant: "secondary",
421986
421979
  rounded: "none",
421987
421980
  onClick: () => {
421988
- const cursorsEnabled = app2.getBoard().presence.toggleCursorsRendering();
421981
+ const cursorsEnabled = app.getBoard().presence.toggleCursorsRendering();
421989
421982
  setCursorsActive(cursorsEnabled);
421990
421983
  }
421991
421984
  }, /* @__PURE__ */ import_react370.default.createElement(Icon, {
@@ -422827,13 +422820,13 @@ var CommentContainer = ({ comment: comment3 }) => {
422827
422820
  const commentRef = import_react384.useRef(null);
422828
422821
  const [isPreviewOpen, setIsPreviewOpen] = import_react384.useState(false);
422829
422822
  const initialCommentPosition = import_react384.useRef(comment3.getAnchorPoint());
422830
- const { app: app2, board } = useAppContext();
422823
+ const { app, board } = useAppContext();
422831
422824
  const { openedThreadId, setOpenedThreadId, setMovingComment, movingComment } = useCommentsContext();
422832
422825
  const movingCommentRef = import_react384.useRef(movingComment);
422833
422826
  const isThreadOpen = openedThreadId === comment3.getId();
422834
422827
  const account = useAccount2();
422835
422828
  const mbr = useDomMbr({
422836
- app: app2,
422829
+ app,
422837
422830
  board,
422838
422831
  ref: isThreadOpen ? threadPanelRef : commentContainerRef,
422839
422832
  targetMbr: comment3.getAnchorMbr(),
@@ -422859,14 +422852,14 @@ var CommentContainer = ({ comment: comment3 }) => {
422859
422852
  const width3 = 12 + 24 + 18 * (commentators.length > 3 ? 2 : commentators.length - 1);
422860
422853
  import_react384.useEffect(() => {
422861
422854
  if (commentRef.current) {
422862
- commentRef.current.addEventListener("wheel", app2.controller.onWheel, {
422855
+ commentRef.current.addEventListener("wheel", app.controller.onWheel, {
422863
422856
  capture: true,
422864
422857
  passive: false
422865
422858
  });
422866
422859
  }
422867
422860
  return () => {
422868
422861
  if (commentRef.current) {
422869
- commentRef.current.removeEventListener("wheel", app2.controller.onWheel);
422862
+ commentRef.current.removeEventListener("wheel", app.controller.onWheel);
422870
422863
  }
422871
422864
  };
422872
422865
  }, [isThreadOpen]);
@@ -422985,10 +422978,10 @@ var CreateComment = ({
422985
422978
  }) => {
422986
422979
  const formRef = import_react385.useRef(null);
422987
422980
  const [value2, setValue] = import_react385.useState("");
422988
- const { app: app2, board } = useAppContext();
422981
+ const { app, board } = useAppContext();
422989
422982
  const account = useAccount2();
422990
422983
  const mbr = useDomMbr({
422991
- app: app2,
422984
+ app,
422992
422985
  board,
422993
422986
  ref: formRef,
422994
422987
  targetMbr: comment3.getMbr(),
@@ -423041,10 +423034,10 @@ var Cluster_module_default = {
423041
423034
  // src/entities/comments/Cluster/Cluster.tsx
423042
423035
  var Cluster = ({ comments }) => {
423043
423036
  const clusterRef = import_react386.useRef(null);
423044
- const { board, app: app2 } = useAppContext();
423037
+ const { board, app } = useAppContext();
423045
423038
  const account = useAccount2();
423046
423039
  const mbr = useDomMbr({
423047
- app: app2,
423040
+ app,
423048
423041
  board,
423049
423042
  ref: clusterRef,
423050
423043
  targetMbr: comments[0].getAnchorMbr(),
@@ -423053,14 +423046,14 @@ var Cluster = ({ comments }) => {
423053
423046
  });
423054
423047
  import_react386.useEffect(() => {
423055
423048
  if (clusterRef.current) {
423056
- clusterRef.current.addEventListener("wheel", app2.controller.onWheel, {
423049
+ clusterRef.current.addEventListener("wheel", app.controller.onWheel, {
423057
423050
  capture: true,
423058
423051
  passive: false
423059
423052
  });
423060
423053
  }
423061
423054
  return () => {
423062
423055
  if (clusterRef.current) {
423063
- clusterRef.current.removeEventListener("wheel", app2.controller.onWheel);
423056
+ clusterRef.current.removeEventListener("wheel", app.controller.onWheel);
423064
423057
  }
423065
423058
  };
423066
423059
  }, []);
@@ -423540,7 +423533,7 @@ var CommentsPanel = () => {
423540
423533
  var UserPanel = () => {
423541
423534
  const { t: t11 } = useTranslation();
423542
423535
  const navigate = useNavigate();
423543
- const { app: app2, board } = useAppContext();
423536
+ const { app, board } = useAppContext();
423544
423537
  const account = useAccount2();
423545
423538
  const insideOfMicroboard = document.referrer.includes("https://microboard.io/") || document.referrer.includes("https://microboard.ru/");
423546
423539
  if (!account.isLoggedIn) {
@@ -423578,7 +423571,7 @@ var UserPanel = () => {
423578
423571
  padding: 0,
423579
423572
  className: UserPanel_module_default.wrapper
423580
423573
  }, /* @__PURE__ */ import_react393.default.createElement(ActionButtons, null), /* @__PURE__ */ import_react393.default.createElement(PresenceUsers, {
423581
- app: app2
423574
+ app
423582
423575
  }), board.getBoardId() !== "blank" && /* @__PURE__ */ import_react393.default.createElement("div", {
423583
423576
  className: UserPanel_module_default.container
423584
423577
  }, /* @__PURE__ */ import_react393.default.createElement(ShareBtn, null))), /* @__PURE__ */ import_react393.default.createElement(CommentsPanel, null));
@@ -423757,10 +423750,10 @@ var LinkToButton = ({
423757
423750
  const [iconUrl, setIconUrl] = import_react397.useState(undefined);
423758
423751
  const imgRef = import_react397.useRef(null);
423759
423752
  const [isTooltipOpen, setIsTooltipOpen] = import_react397.useState(false);
423760
- const { app: app2, board } = useAppContext();
423753
+ const { app, board } = useAppContext();
423761
423754
  const closeTooltipTimeoutId = import_react397.useRef();
423762
423755
  const mbr = useDomMbr({
423763
- app: app2,
423756
+ app,
423764
423757
  board,
423765
423758
  ref: linkToButtonRef,
423766
423759
  targetMbr: item instanceof Connector2 ? item.endPointer.path.getMbr() : item.getMbr(),
@@ -423992,7 +423985,7 @@ var QuickAddPanel_module_default = {
423992
423985
 
423993
423986
  // src/features/AppView/QuickAddPanel/QuickAddPanel.tsx
423994
423987
  function QuickAddPanel() {
423995
- const { app: app2 } = useAppContext();
423988
+ const { app } = useAppContext();
423996
423989
  const { t: t11 } = useTranslation();
423997
423990
  const forceUpdate = useForceUpdate2();
423998
423991
  useAppSubscription({
@@ -424001,7 +423994,7 @@ function QuickAddPanel() {
424001
423994
  forceUpdate();
424002
423995
  }
424003
423996
  });
424004
- const appBoard = app2.getBoard();
423997
+ const appBoard = app.getBoard();
424005
423998
  const single = appBoard.selection.items.getSingle();
424006
423999
  if (!appBoard.selection.showQuickAddPanel || !single || single.itemType !== "Connector") {
424007
424000
  return null;
@@ -424290,8 +424283,8 @@ var MouseOrTracpadModal_module_default = {
424290
424283
  var MOUSE_OR_TRACKPAD_MODAL = Symbol("mouseOrTrackpadModal");
424291
424284
  var modes = ["mouse", "trackpad", "auto"];
424292
424285
  var MouseOrTrackpadModal = () => {
424293
- const { app: app2 } = useAppContext();
424294
- const [selectedMode, setSelectedMode] = import_react404.useState(app2.getSettings().controlMode);
424286
+ const { app } = useAppContext();
424287
+ const [selectedMode, setSelectedMode] = import_react404.useState(app.getSettings().controlMode);
424295
424288
  const { closeModal: closeModal2 } = useUiModalContext();
424296
424289
  const { t: t11 } = useTranslation();
424297
424290
  const mouseCards = [
@@ -424325,7 +424318,7 @@ var MouseOrTrackpadModal = () => {
424325
424318
  }
424326
424319
  };
424327
424320
  const setControlMode = () => {
424328
- app2.setControlMode(selectedMode);
424321
+ app.setControlMode(selectedMode);
424329
424322
  closeModal2();
424330
424323
  };
424331
424324
  return /* @__PURE__ */ import_react404.default.createElement(UiModal, {
@@ -424379,16 +424372,16 @@ var Card6 = ({ iconName, style: style3, text: text5 }) => {
424379
424372
  // src/entities/BoardMenu/sections/MouseOrTrackpad.tsx
424380
424373
  var MouseOrTrackpad = () => {
424381
424374
  const [isSetControlModeOpen, setIsSetControlModeOpen] = import_react405.useState(false);
424382
- const { app: app2, board } = useAppContext();
424375
+ const { app, board } = useAppContext();
424383
424376
  const { t: t11 } = useTranslation();
424384
424377
  const forceUpdate = useForceUpdate2();
424385
424378
  const { openModal: openModal2 } = useUiModalContext();
424386
424379
  const setControlMode = (mode) => {
424387
- app2.setControlMode(mode);
424380
+ app.setControlMode(mode);
424388
424381
  forceUpdate();
424389
424382
  };
424390
424383
  const getIsActive = (mode) => {
424391
- return app2.getSettings().controlMode === mode;
424384
+ return app.getSettings().controlMode === mode;
424392
424385
  };
424393
424386
  return /* @__PURE__ */ import_react405.default.createElement(ButtonWithMenu2, {
424394
424387
  className: BoardMenu_module_default.buttonWithMenu,
@@ -424463,7 +424456,7 @@ var MouseOrTrackpad = () => {
424463
424456
  // src/entities/BoardMenu/BoardMenu.tsx
424464
424457
  var BoardMenu = () => {
424465
424458
  const menuRef = import_react406.useRef(null);
424466
- const { board, app: app2 } = useAppContext();
424459
+ const { board, app } = useAppContext();
424467
424460
  const cursorPosition2 = board.pointer.point;
424468
424461
  const [isOpen, setIsOpen] = import_react406.useState(false);
424469
424462
  const position5 = import_react406.useRef(new Mbr);
@@ -424482,7 +424475,7 @@ var BoardMenu = () => {
424482
424475
  }
424483
424476
  });
424484
424477
  const mbr = useDomMbr({
424485
- app: app2,
424478
+ app,
424486
424479
  board,
424487
424480
  ref: menuRef,
424488
424481
  targetMbr: new Mbr(cursorPosition2.x, cursorPosition2.y, cursorPosition2.x, cursorPosition2.y),
@@ -424889,14 +424882,14 @@ var YouTube_default = YouTube;
424889
424882
 
424890
424883
  // src/features/VideoPlayer/VideoPlayer.tsx
424891
424884
  var VideoPlayer = ({ item }) => {
424892
- const { board, app: app2 } = useAppContext();
424885
+ const { board, app } = useAppContext();
424893
424886
  const videoId = conf.getYouTubeId(item.getUrl());
424894
424887
  const videoRef = import_react410.useRef(null);
424895
424888
  const containerRef = import_react410.useRef(null);
424896
424889
  const stopTimeoutRef = import_react410.useRef(null);
424897
424890
  const timeoutDuration = videoId ? 300 : 10;
424898
424891
  import_react410.useEffect(() => {
424899
- containerRef.current?.addEventListener("wheel", app2.controller.onWheel, {
424892
+ containerRef.current?.addEventListener("wheel", app.controller.onWheel, {
424900
424893
  capture: true,
424901
424894
  passive: false
424902
424895
  });
@@ -424915,7 +424908,7 @@ var VideoPlayer = ({ item }) => {
424915
424908
  if (videoRef.current) {
424916
424909
  videoRef.current.removeEventListener("loadedmetadata", handleLoadedMetadata);
424917
424910
  }
424918
- containerRef.current?.removeEventListener("wheel", app2.controller.onWheel);
424911
+ containerRef.current?.removeEventListener("wheel", app.controller.onWheel);
424919
424912
  };
424920
424913
  }, []);
424921
424914
  const stopVideo = () => {
@@ -427261,7 +427254,7 @@ function Sprite() {
427261
427254
 
427262
427255
  // src/features/AppView/AppView.tsx
427263
427256
  function AppView() {
427264
- const { app: app2, board } = useAppContext();
427257
+ const { app, board } = useAppContext();
427265
427258
  const { setQuotedText, tryToSendGenerationRequest } = useAIContext();
427266
427259
  const { setHyperLinkData, hyperLinkData } = useHyperLinkContext();
427267
427260
  const location3 = useLocation();
@@ -427304,9 +427297,9 @@ function AppView() {
427304
427297
  controller16.onPaste(event);
427305
427298
  canPasteAgain = false;
427306
427299
  };
427307
- app2.boardSubject.subscribe(update);
427300
+ app.boardSubject.subscribe(update);
427308
427301
  const container = containerRef.current;
427309
- const controller16 = app2.controller;
427302
+ const controller16 = app.controller;
427310
427303
  const abortController2 = new AbortController;
427311
427304
  if (container) {
427312
427305
  container.addEventListener("touchmove", preventDefault2, {
@@ -427352,11 +427345,11 @@ function AppView() {
427352
427345
  });
427353
427346
  }
427354
427347
  return () => {
427355
- app2.boardSubject.unsubscribe(update);
427348
+ app.boardSubject.unsubscribe(update);
427356
427349
  abortController2.abort();
427357
427350
  };
427358
427351
  }, [containerRef.current]);
427359
- const appBoard = app2.getBoard();
427352
+ const appBoard = app.getBoard();
427360
427353
  return /* @__PURE__ */ import_react414.default.createElement(ErrorBoundary, null, /* @__PURE__ */ import_react414.default.createElement("div", {
427361
427354
  className: AppView_module_default.wrapper
427362
427355
  }, shouldShow("titlePanel") && /* @__PURE__ */ import_react414.default.createElement(LandingMenu, null), shouldShow("titlePanel") && /* @__PURE__ */ import_react414.default.createElement(MobileLandingMenu, null), /* @__PURE__ */ import_react414.default.createElement(InactiveBoardHidder, null, /* @__PURE__ */ import_react414.default.createElement("div", {
@@ -427369,12 +427362,12 @@ function AppView() {
427369
427362
  }, /* @__PURE__ */ import_react414.default.createElement(UIMainLoader, null))
427370
427363
  }), /* @__PURE__ */ import_react414.default.createElement(Canvas, {
427371
427364
  router: { location: location3, navigate, params },
427372
- app: app2,
427365
+ app,
427373
427366
  board
427374
427367
  }, /* @__PURE__ */ import_react414.default.createElement(LinksProvider, null), /* @__PURE__ */ import_react414.default.createElement(ItemsProvider, {
427375
427368
  itemsComponents
427376
427369
  })), /* @__PURE__ */ import_react414.default.createElement(TextEditors, {
427377
- app: app2,
427370
+ app,
427378
427371
  board,
427379
427372
  setQuotedText,
427380
427373
  setHyperLinkData,
@@ -427390,7 +427383,7 @@ function AppView() {
427390
427383
  }
427391
427384
  return null;
427392
427385
  })), /* @__PURE__ */ import_react414.default.createElement(ExportVisible, null, /* @__PURE__ */ import_react414.default.createElement(UserPanelLayout, {
427393
- app: app2
427386
+ app
427394
427387
  }), /* @__PURE__ */ import_react414.default.createElement(CommentsProvider, null)), /* @__PURE__ */ import_react414.default.createElement(ExportVisible, null, /* @__PURE__ */ import_react414.default.createElement(UserTracking, {
427395
427388
  board
427396
427389
  })), /* @__PURE__ */ import_react414.default.createElement(InactiveBoardHidder, null, /* @__PURE__ */ import_react414.default.createElement(ZoomPanel, null)), /* @__PURE__ */ import_react414.default.createElement(ViewModeGuard, null, /* @__PURE__ */ import_react414.default.createElement(ContextPanel, null), /* @__PURE__ */ import_react414.default.createElement(QuickAddPanel, null), /* @__PURE__ */ import_react414.default.createElement(ExportPanel, null), /* @__PURE__ */ import_react414.default.createElement(BoardMenu, null)), /* @__PURE__ */ import_react414.default.createElement(HyperLink, null), /* @__PURE__ */ import_react414.default.createElement(AiGenerationButton, null), /* @__PURE__ */ import_react414.default.createElement(HyperLinkInput, null), /* @__PURE__ */ import_react414.default.createElement(ToastProvider, null), authCode && teamIdSearch ? /* @__PURE__ */ import_react414.default.createElement(ImportMiro, null) : null, /* @__PURE__ */ import_react414.default.createElement(CookiesModal, null), /* @__PURE__ */ import_react414.default.createElement(UiModalBackground, null, /* @__PURE__ */ import_react414.default.createElement(ImportMiroStartModal, null), /* @__PURE__ */ import_react414.default.createElement(SelectPaymentModal, null), /* @__PURE__ */ import_react414.default.createElement(UserPlanModal, null), /* @__PURE__ */ import_react414.default.createElement(LimitsModal, null), /* @__PURE__ */ import_react414.default.createElement(HistoryModal, null), /* @__PURE__ */ import_react414.default.createElement(ShareModal, null), /* @__PURE__ */ import_react414.default.createElement(ShareSnapshotModal, null), /* @__PURE__ */ import_react414.default.createElement(ProfileSettingsModal, null), /* @__PURE__ */ import_react414.default.createElement(ChangePasswordModal, null), /* @__PURE__ */ import_react414.default.createElement(AccessDeniedModal, null), /* @__PURE__ */ import_react414.default.createElement(AiUnavailableModal, null), /* @__PURE__ */ import_react414.default.createElement(MediaUnavailableModal, null), /* @__PURE__ */ import_react414.default.createElement(SelectTemplateModal, null), /* @__PURE__ */ import_react414.default.createElement(AuthClipboardModal, null), /* @__PURE__ */ import_react414.default.createElement(ImgAuthClipboardModal, null), /* @__PURE__ */ import_react414.default.createElement(LoadingNotification, null), /* @__PURE__ */ import_react414.default.createElement(ErrorNotification, null), /* @__PURE__ */ import_react414.default.createElement(SuccessNotification, null), /* @__PURE__ */ import_react414.default.createElement(WarnClipboardNotification, null), /* @__PURE__ */ import_react414.default.createElement(WarnNotification, null), /* @__PURE__ */ import_react414.default.createElement(SetLinkToModal, null), /* @__PURE__ */ import_react414.default.createElement(CreateTemplateModal, null), /* @__PURE__ */ import_react414.default.createElement(MouseOrTrackpadModal, null), /* @__PURE__ */ import_react414.default.createElement(CreateCardsModal, null), /* @__PURE__ */ import_react414.default.createElement(CreateDiceModal, null)), /* @__PURE__ */ import_react414.default.createElement(LocalFileSaveProgress_default, null)), /* @__PURE__ */ import_react414.default.createElement(Sprite, null));
@@ -427401,7 +427394,7 @@ function preventDefault2(event) {
427401
427394
  // src/features/AppView/LocalAppView.tsx
427402
427395
  var import_react415 = __toESM(require_react(), 1);
427403
427396
  function LocalAppView() {
427404
- const { app: app2, board } = useAppContext();
427397
+ const { app, board } = useAppContext();
427405
427398
  const forceUpdate = useForceUpdate2();
427406
427399
  const animationId = import_react415.useRef(null);
427407
427400
  const containerRef = import_react415.useRef(null);
@@ -427438,9 +427431,9 @@ function LocalAppView() {
427438
427431
  controller16.onPaste(event);
427439
427432
  canPasteAgain = false;
427440
427433
  };
427441
- app2.boardSubject.subscribe(update);
427434
+ app.boardSubject.subscribe(update);
427442
427435
  const container = containerRef.current;
427443
- const controller16 = app2.controller;
427436
+ const controller16 = app.controller;
427444
427437
  if (container) {
427445
427438
  document.addEventListener("touchmove", preventDefault3, {
427446
427439
  passive: false
@@ -427468,7 +427461,7 @@ function LocalAppView() {
427468
427461
  window.addEventListener("dragover", (event) => event.preventDefault());
427469
427462
  }
427470
427463
  return () => {
427471
- app2.boardSubject.unsubscribe(update);
427464
+ app.boardSubject.unsubscribe(update);
427472
427465
  if (container) {
427473
427466
  document.removeEventListener("touchmove", preventDefault3);
427474
427467
  container.removeEventListener("wheel", controller16.onWheel);
@@ -427489,10 +427482,10 @@ function LocalAppView() {
427489
427482
  }, /* @__PURE__ */ import_react415.default.createElement(InactiveBoardHidder, null, /* @__PURE__ */ import_react415.default.createElement("div", {
427490
427483
  ref: containerRef
427491
427484
  }, /* @__PURE__ */ import_react415.default.createElement(CanvasNoRouter, {
427492
- app: app2,
427485
+ app,
427493
427486
  board
427494
427487
  }, /* @__PURE__ */ import_react415.default.createElement(LinksProvider, null)), /* @__PURE__ */ import_react415.default.createElement(TextEditors, {
427495
- app: app2,
427488
+ app,
427496
427489
  board,
427497
427490
  setQuotedText,
427498
427491
  setHyperLinkData,
@@ -446310,30 +446303,30 @@ var pasteWelcomeBoardData = (board, lang) => {
446310
446303
  board.camera.zoomToFit(mbr);
446311
446304
  };
446312
446305
  function WelcomePage() {
446313
- const { app: app2 } = useAppContext();
446306
+ const { app } = useAppContext();
446314
446307
  const navigate = useNavigate();
446315
446308
  const { i18n: i18n7, t: t11 } = useTranslation();
446316
446309
  const boardsList = useBoardsList();
446317
- const createPublicBoard = async (app3) => {
446318
- const lastBoardId = app3.getLastBoardId();
446310
+ const createPublicBoard = async (app2) => {
446311
+ const lastBoardId = app2.getLastBoardId();
446319
446312
  if (lastBoardId) {
446320
- await app3.openBoard(lastBoardId);
446313
+ await app2.openBoard(lastBoardId);
446321
446314
  return lastBoardId;
446322
446315
  }
446323
446316
  return "welcome";
446324
446317
  };
446325
446318
  import_react419.default.useEffect(() => {
446326
- createPublicBoard(app2).then((boardId) => {
446319
+ createPublicBoard(app).then((boardId) => {
446327
446320
  navigate(`/boards/${boardId}`);
446328
446321
  }).catch(console.error);
446329
- }, [app2]);
446322
+ }, [app]);
446330
446323
  return null;
446331
446324
  }
446332
446325
 
446333
446326
  // src/pages/BoardPage.tsx
446334
446327
  var BoardPage = () => {
446335
- const { app: app2 } = useAppContext();
446336
- const board = app2.getBoard();
446328
+ const { app } = useAppContext();
446329
+ const board = app.getBoard();
446337
446330
  const params = useParams();
446338
446331
  const { t: t11, i18n: i18n7 } = useTranslation();
446339
446332
  const navigate = useNavigate();
@@ -446345,10 +446338,10 @@ var BoardPage = () => {
446345
446338
  const boardsList = useBoardsList();
446346
446339
  const account = useAccount2();
446347
446340
  const { openModal: openModal2 } = useUiModalContext();
446348
- app2.connection.onAccessDenied = async (deniedBoardId, forceUpdate = false) => {
446341
+ app.connection.onAccessDenied = async (deniedBoardId, forceUpdate = false) => {
446349
446342
  if (forceUpdate || deniedBoardId === board.getBoardId() && !isOpenMiroBoards) {
446350
446343
  openModal2(ACCESS_DENIED_MODAL);
446351
- const deniedBoard = app2.getConnectedBoard(deniedBoardId);
446344
+ const deniedBoard = app.getConnectedBoard(deniedBoardId);
446352
446345
  if (deniedBoard) {
446353
446346
  deniedBoard.disconnect();
446354
446347
  }
@@ -446356,54 +446349,54 @@ var BoardPage = () => {
446356
446349
  await boardsList.removeBoard(board.getBoardId());
446357
446350
  }
446358
446351
  navigate("/boards/blank");
446359
- await app2.openBoard("blank");
446360
- app2.render();
446352
+ await app.openBoard("blank");
446353
+ app.render();
446361
446354
  }
446362
446355
  };
446363
446356
  import_react420.useLayoutEffect(() => {
446364
446357
  boardsList.loadBoards().then(() => {
446365
446358
  if (params.boardId?.includes("local")) {
446366
- app2.openBoardFromFile().then(() => {
446359
+ app.openBoardFromFile().then(() => {
446367
446360
  navigate(`/boards/${params.boardId}${search3}`, {
446368
446361
  replace: true
446369
446362
  });
446370
- app2.render();
446363
+ app.render();
446371
446364
  });
446372
446365
  } else if (params.boardId && params.boardId !== "blank") {
446373
- app2.openBoard(params.boardId, searchParams.get("accessKey") || undefined).then(() => {
446366
+ app.openBoard(params.boardId, searchParams.get("accessKey") || undefined).then(() => {
446374
446367
  navigate(`/boards/${params.boardId}${search3}`, {
446375
446368
  replace: true
446376
446369
  });
446377
- app2.render();
446370
+ app.render();
446378
446371
  });
446379
446372
  } else {
446380
446373
  const lastSeenBoard = localStorage.getItem(LAST_BOARD_KEY);
446381
446374
  const isFirstVisit = !api10.get("first_visit");
446382
446375
  if (lastSeenBoard) {
446383
- app2.openBoard(lastSeenBoard).then(() => {
446376
+ app.openBoard(lastSeenBoard).then(() => {
446384
446377
  navigate(`/boards/${lastSeenBoard}${search3}`, {
446385
446378
  replace: true
446386
446379
  });
446387
- app2.render();
446380
+ app.render();
446388
446381
  });
446389
446382
  } else if (isFirstVisit) {
446390
446383
  boardsList.createBoard(t11("board.welcomeBoardTitle"), true).then((boardId) => {
446391
- app2.openBoard(boardId).then(() => {
446384
+ app.openBoard(boardId).then(() => {
446392
446385
  navigate(`/boards/${boardId}`, {
446393
446386
  replace: true
446394
446387
  });
446395
- app2.render();
446396
- const board2 = app2.getBoard();
446388
+ app.render();
446389
+ const board2 = app.getBoard();
446397
446390
  pasteWelcomeBoardData(board2, i18n7.language);
446398
446391
  });
446399
446392
  });
446400
446393
  } else {
446401
446394
  boardsList.createBoard().then((boardId) => {
446402
- app2.openBoard(boardId).then(() => {
446395
+ app.openBoard(boardId).then(() => {
446403
446396
  navigate(`/boards/${boardId}`, {
446404
446397
  replace: true
446405
446398
  });
446406
- app2.render();
446399
+ app.render();
446407
446400
  });
446408
446401
  });
446409
446402
  }
@@ -446442,7 +446435,7 @@ var BoardPage = () => {
446442
446435
  return /* @__PURE__ */ import_react420.default.createElement("div", null);
446443
446436
  }
446444
446437
  return /* @__PURE__ */ import_react420.default.createElement(AppContext2.Provider, {
446445
- value: { app: app2, board }
446438
+ value: { app, board }
446446
446439
  }, /* @__PURE__ */ import_react420.default.createElement(AppView, null));
446447
446440
  };
446448
446441
 
@@ -446815,19 +446808,19 @@ var LOCAL_PROVIDERS = [
446815
446808
  ];
446816
446809
  var Provider = compose2(PROVIDERS);
446817
446810
  var LocalProvider = compose2(LOCAL_PROVIDERS);
446818
- function AppLayout({ app: app2 }) {
446819
- const board = app2.getBoard();
446811
+ function AppLayout({ app }) {
446812
+ const board = app.getBoard();
446820
446813
  return /* @__PURE__ */ import_react427.default.createElement(AppContext2.Provider, {
446821
- value: { app: app2, board }
446814
+ value: { app, board }
446822
446815
  }, /* @__PURE__ */ import_react427.default.createElement(Provider, null, /* @__PURE__ */ import_react427.default.createElement(Outlet, null), /* @__PURE__ */ import_react427.default.createElement(ToastProvider, null)));
446823
446816
  }
446824
446817
  function LocalAppLayout({
446825
- app: app2,
446818
+ app,
446826
446819
  children
446827
446820
  }) {
446828
- const board = app2.getBoard();
446821
+ const board = app.getBoard();
446829
446822
  return /* @__PURE__ */ import_react427.default.createElement(AppContext2.Provider, {
446830
- value: { app: app2, board }
446823
+ value: { app, board }
446831
446824
  }, /* @__PURE__ */ import_react427.default.createElement(LocalProvider, null, children, /* @__PURE__ */ import_react427.default.createElement(Outlet, null)));
446832
446825
  }
446833
446826
 
@@ -446836,8 +446829,8 @@ var import_react428 = __toESM(require_react(), 1);
446836
446829
  var QuickAddButtonsClear = ({
446837
446830
  children
446838
446831
  }) => {
446839
- const { app: app2 } = useAppContext();
446840
- app2.getBoard()?.selection.quickAddButtons.clear();
446832
+ const { app } = useAppContext();
446833
+ app.getBoard()?.selection.quickAddButtons.clear();
446841
446834
  return /* @__PURE__ */ import_react428.default.createElement(import_react428.default.Fragment, null, children);
446842
446835
  };
446843
446836
  var QuickAddButtonsClear_default = QuickAddButtonsClear;
@@ -447171,7 +447164,7 @@ var SelectBoardPage_module_default = {
447171
447164
  // src/pages/SelectBoardPage/SelectBoardPage.tsx
447172
447165
  var getName = (i18t, name3) => name3 || i18t("board.untitled");
447173
447166
  var SelectBoardPage = () => {
447174
- const { app: app2 } = useAppContext();
447167
+ const { app } = useAppContext();
447175
447168
  const { t: t11 } = useTranslation();
447176
447169
  const navigate = useNavigate();
447177
447170
  const forceUpdate = useForceUpdate2();
@@ -447220,7 +447213,7 @@ var SelectBoardPage = () => {
447220
447213
  }, [selected]);
447221
447214
  import_react433.useEffect(() => {
447222
447215
  const fetchBoards = async () => {
447223
- await app2.boardsList.loadBoards();
447216
+ await app.boardsList.loadBoards();
447224
447217
  };
447225
447218
  fetchBoards();
447226
447219
  }, []);
@@ -447228,7 +447221,7 @@ var SelectBoardPage = () => {
447228
447221
  try {
447229
447222
  if (selected === "addNew") {
447230
447223
  const createdId = await boardsList.createBoard(newBoardRef.current?.value, true);
447231
- const unauthedData = app2.storage.getCreatedBoard(createdId);
447224
+ const unauthedData = app.storage.getCreatedBoard(createdId);
447232
447225
  if (unauthedData) {
447233
447226
  handleSuccess(unauthedData.id, unauthedData.title, unauthedData.authorKey ?? undefined);
447234
447227
  } else {
@@ -448143,8 +448136,8 @@ var WheelLogger_module_default = {
448143
448136
 
448144
448137
  // src/pages/WheelLogger/WheelLogger.tsx
448145
448138
  var WheelEventLoggerPage = () => {
448146
- const { app: app2 } = useAppContext();
448147
- const board = app2.getBoard();
448139
+ const { app } = useAppContext();
448140
+ const board = app.getBoard();
448148
448141
  const boardsList = useBoardsList();
448149
448142
  const [events4, setEvents] = import_react439.useState([]);
448150
448143
  const [mousePosition, setMousePosition] = import_react439.useState({ x: 0, y: 0 });
@@ -448154,8 +448147,8 @@ var WheelEventLoggerPage = () => {
448154
448147
  try {
448155
448148
  await boardsList.loadBoards();
448156
448149
  const boardId = await boardsList.createBoard();
448157
- await app2.openBoard(boardId);
448158
- app2.render();
448150
+ await app.openBoard(boardId);
448151
+ app.render();
448159
448152
  loggerRef.current = new WheelEventLogger(setEvents, setMousePosition);
448160
448153
  console.log("Logger initialized successfully");
448161
448154
  } catch (error3) {
@@ -448183,7 +448176,7 @@ var WheelEventLoggerPage = () => {
448183
448176
  return /* @__PURE__ */ import_react439.default.createElement("div", null);
448184
448177
  }
448185
448178
  return /* @__PURE__ */ import_react439.default.createElement(import_react439.default.Fragment, null, /* @__PURE__ */ import_react439.default.createElement(AppContext2.Provider, {
448186
- value: { app: app2, board }
448179
+ value: { app, board }
448187
448180
  }, /* @__PURE__ */ import_react439.default.createElement(AppView, null)), /* @__PURE__ */ import_react439.default.createElement("div", {
448188
448181
  className: WheelLogger_module_default.loggerContainer
448189
448182
  }, /* @__PURE__ */ import_react439.default.createElement("div", {
@@ -448205,11 +448198,11 @@ var WheelEventLoggerPage = () => {
448205
448198
  // src/App/router.tsx
448206
448199
  var import_react440 = __toESM(require_react(), 1);
448207
448200
  var import_react_dom19 = __toESM(require_react_dom(), 1);
448208
- function getRender(app2) {
448201
+ function getRender(app) {
448209
448202
  const router = createBrowserRouter([
448210
448203
  {
448211
448204
  element: /* @__PURE__ */ import_react440.default.createElement(AppLayout, {
448212
- app: app2
448205
+ app
448213
448206
  }),
448214
448207
  children: [
448215
448208
  {
@@ -448297,10 +448290,10 @@ function getRender(app2) {
448297
448290
  router
448298
448291
  };
448299
448292
  }
448300
- function getLocalRender(app2, customId) {
448293
+ function getLocalRender(app, customId) {
448301
448294
  return () => {
448302
448295
  import_react_dom19.default.render(/* @__PURE__ */ import_react440.default.createElement(LocalAppLayout, {
448303
- app: app2
448296
+ app
448304
448297
  }, /* @__PURE__ */ import_react440.default.createElement(LocalSidePanelContextProvider, null, /* @__PURE__ */ import_react440.default.createElement(LocalAppView, null))), document.getElementById(customId));
448305
448298
  };
448306
448299
  }
@@ -448729,7 +448722,7 @@ function createApp(isHistory = true) {
448729
448722
  await connectBoard(board);
448730
448723
  return;
448731
448724
  }
448732
- const appBoard = app2.getBoard();
448725
+ const appBoard = app.getBoard();
448733
448726
  if (id3 === "boards" || appBoard?.getBoardId() === id3) {
448734
448727
  return;
448735
448728
  }
@@ -448761,7 +448754,7 @@ function createApp(isHistory = true) {
448761
448754
  board.setName(boardsList.getBoardInfo(id3)?.title);
448762
448755
  }
448763
448756
  appBoard?.setIsOpen(false);
448764
- const newBoard = app2.getBoard();
448757
+ const newBoard = app.getBoard();
448765
448758
  if (!newBoard.camera.useSavedSnapshot(newBoard.getCameraSnapshot())) {
448766
448759
  if (newBoard.items.listAll().length > 0) {
448767
448760
  const itemsMbr = newBoard.items.getMbr();
@@ -448801,9 +448794,9 @@ function createApp(isHistory = true) {
448801
448794
  }, 1000);
448802
448795
  }
448803
448796
  async function openBoardFromFile() {
448804
- app2.getBoard()?.cleanup();
448797
+ app.getBoard()?.cleanup();
448805
448798
  const id3 = "local";
448806
- const currentBoard = new Board(id3, undefined, saveEditingFile.bind(app2));
448799
+ const currentBoard = new Board(id3, undefined, saveEditingFile.bind(app));
448807
448800
  connectBoard(currentBoard);
448808
448801
  subscriptions.setBoard(currentBoard);
448809
448802
  boardSubject.publish(currentBoard);
@@ -448864,13 +448857,13 @@ function createApp(isHistory = true) {
448864
448857
  const snapshotId = window.parent.location.href.split("/snapshots/")[1];
448865
448858
  const snapshot2 = document.documentElement.outerHTML;
448866
448859
  const boardId = await boardsList.createBoard(snapshotId.split("?")[0] + " copy", !account.isLoggedIn);
448867
- await app2.connection.connect();
448860
+ await app.connection.connect();
448868
448861
  window.parent.history.pushState({}, "", `/boards/${boardId}`);
448869
- await app2.openBoard(boardId);
448870
- const addedIds = app2.getBoard().deserializeHTMLAndEmit(snapshot2);
448862
+ await app.openBoard(boardId);
448863
+ const addedIds = app.getBoard().deserializeHTMLAndEmit(snapshot2);
448871
448864
  const promise = new Promise((resolve2) => {
448872
448865
  const reloadInterval = setInterval(() => {
448873
- const confirmedEvents = app2.getBoard().events?.getRaw().confirmedEvents;
448866
+ const confirmedEvents = app.getBoard().events?.getRaw().confirmedEvents;
448874
448867
  const flatOperations = confirmedEvents?.flatMap((ev) => ("operations" in ev.body) ? ev.body.operations : ev.body.operation) || [];
448875
448868
  const confirmedAddedIds = flatOperations.filter((op2) => op2.method === "add").flatMap((op2) => op2.item);
448876
448869
  if (confirmedAddedIds.length >= addedIds.length) {
@@ -448926,7 +448919,7 @@ function createApp(isHistory = true) {
448926
448919
  await writable.write(data);
448927
448920
  await writable.close();
448928
448921
  }
448929
- const app2 = {
448922
+ const app = {
448930
448923
  connection,
448931
448924
  clipboard,
448932
448925
  location: location3,
@@ -448961,7 +448954,7 @@ function createApp(isHistory = true) {
448961
448954
  storage2.softClean();
448962
448955
  });
448963
448956
  function render2() {
448964
- const { render: render3, router } = getRender(app2);
448957
+ const { render: render3, router } = getRender(app);
448965
448958
  boardSubject.subscribe(() => {
448966
448959
  boardsList.subject.publish();
448967
448960
  });
@@ -448992,10 +448985,10 @@ function createApp(isHistory = true) {
448992
448985
  render3();
448993
448986
  }
448994
448987
  function localRender(id3) {
448995
- const render3 = getLocalRender(app2, id3);
448988
+ const render3 = getLocalRender(app, id3);
448996
448989
  render3();
448997
448990
  }
448998
- return app2;
448991
+ return app;
448999
448992
  }
449000
448993
  // src/features/Cursors/pencil.svg
449001
448994
  var pencil_default = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -1,3 +1,2 @@
1
1
  import { Subscription } from "./getSubscriptions";
2
2
  export declare function useAppSubscription(subscription: Subscription): void;
3
- export declare function useTools(): import("microboard-temp").Tools;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-ui-temp",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "type": "module",