@powerhousedao/connect 1.0.0-dev.247 → 1.0.0-dev.248
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/LICENSE +661 -0
- package/dist/assets/{app-Bjaniq_f.js → app-BgY4XbK3.js} +1483 -1001
- package/dist/assets/{app-D9QJBr8i.css → app-CYjeY4R-.css} +113 -50
- package/dist/assets/{app-loader-CnDRDKWw.js → app-loader-Be1urgPw.js} +4 -4
- package/dist/assets/{app-loader-Bnp0H-wa.css → app-loader-DC8DXqh9.css} +129 -18
- package/dist/assets/{ccip-BIN6bp0k.js → ccip-KX_YlO62.js} +3 -3
- package/dist/assets/{content-CT8IEBqv.js → content-CrBPsYmC.js} +36 -6
- package/dist/assets/{index-CWxXMTAJ.js → index-Ca8tBMzh.js} +3 -3
- package/dist/assets/{index-BeBd0Q5I.js → index-CrpTq7W6.js} +670 -519
- package/dist/assets/{index-BaBnabbX.js → index-DG5cID7M.js} +4 -4
- package/dist/assets/{main.DonDJ7tf.js → main.BvYgkrO6.js} +1 -1
- package/dist/assets/{style-D4JhTt_m.css → style-D7CwmVZf.css} +52 -36
- package/dist/index.html +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-G6LMXRY5.js → chunk-2ONJ2PX4.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-FW7N6EJH.js → chunk-C7QRY43M.js} +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-45DCPCA7.js → chunk-CO2RVWYY.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-F3RCGUF6.js → chunk-NHD6VUCD.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-M2UUQ5LH.js → chunk-U34SEKEB.js} +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +5 -5
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +5 -5
- package/dist/modules/@powerhousedao/reactor-browser/index.js +5 -5
- package/dist/vite-envs.sh +1 -1
- package/package.json +9 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
|
-
import { t as twMerge, B as Button, m as mergeClassNameProps, E as ERROR, M as MISSING, C as CONFLICT, S as SUCCESS, h as SYNCING, I as INITIAL_SYNC, i as ConnectDropdownMenu, u as useOnClickOutside, j as useEventListener, k as useCopyToClipboard, l as Select, n as ENSAvatar, P as Provider, o as Root3, T as Trigger, p as Portal, q as Content2, v as validateInitialState, w as validateStateSchemaName, x as validateModules, y as useUnwrappedReactor, z as useConnectDid, A as useConnectCrypto, D as useTranslation, F as useModal, G as useAtomValue, H as themeAtom, J as useUser, K as useUserPermissions, L as useUiNodes, N as exportFile, O as useGetDocumentModelModule, Q as addActionContext, U as signOperation, V as useDocumentDriveServer, W as useHotkeys, X as useGetEditor, Y as isSameDocument, Z as useNavigate, _ as ErrorBoundary, $ as DriveLayout, a0 as SearchBar, a1 as useAsyncReactor, a2 as useFilteredDocumentModels, a3 as useDriveEditor, a4 as useDocumentDriveById } from "./app-
|
|
2
|
+
import { t as twMerge, B as Button, m as mergeClassNameProps, E as ERROR, M as MISSING, C as CONFLICT, S as SUCCESS, h as SYNCING, I as INITIAL_SYNC, i as ConnectDropdownMenu, u as useOnClickOutside, j as useEventListener, k as useCopyToClipboard, l as Select, n as ENSAvatar, P as Provider, o as Root3, T as Trigger, p as Portal, q as Content2, v as validateInitialState, w as validateStateSchemaName, x as validateModules, y as useUnwrappedReactor, z as useConnectDid, A as useConnectCrypto, D as useTranslation, F as useModal, G as useAtomValue, H as themeAtom, J as useUser, K as useUserPermissions, L as useUiNodes, N as exportFile, O as useGetDocumentModelModule, Q as addActionContext, U as signOperation, V as useDocumentDriveServer, W as useHotkeys, X as useGetEditor, Y as isSameDocument, Z as useNavigate, _ as ErrorBoundary, $ as DriveLayout, a0 as SearchBar, a1 as useAsyncReactor, a2 as useFilteredDocumentModels, a3 as useDriveEditor, a4 as useDocumentDriveById } from "./app-BgY4XbK3.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import React__default, { useState, useCallback, useMemo, useEffect, Fragment, useRef, useLayoutEffect, memo as memo$1, createElement, useSyncExternalStore, Suspense } from "react";
|
|
5
|
-
import { _ as Icon, aX as getDimensions, aY as READ, aZ as nodeOptionsMap, a_ as defaultFileOptions, a$ as DELETE, b0 as RENAME, b1 as WRITE, b2 as DUPLICATE, b3 as defaultFolderOptions, b4 as garbageCollect, b5 as sortOperations, b6 as UI_NODE, aO as DRIVE, ay as FILE, b7 as undo, b8 as redo, ac as logger, b9 as useDocumentDispatch, aP as FOLDER, ak as driveDocumentModelModule } from "./app-loader-
|
|
5
|
+
import { _ as Icon, aX as getDimensions, aY as READ, aZ as nodeOptionsMap, a_ as defaultFileOptions, a$ as DELETE, b0 as RENAME, b1 as WRITE, b2 as DUPLICATE, b3 as defaultFolderOptions, b4 as garbageCollect, b5 as sortOperations, b6 as UI_NODE, aO as DRIVE, ay as FILE, b7 as undo, b8 as redo, ac as logger, b9 as useDocumentDispatch, aP as FOLDER, ak as driveDocumentModelModule } from "./app-loader-Be1urgPw.js";
|
|
6
6
|
import { useDocument, useDocumentEditorProps } from "@powerhousedao/reactor-browser";
|
|
7
7
|
import { useUiNodesContext, FILE as FILE$1 } from "@powerhousedao/reactor-browser/hooks/useUiNodesContext";
|
|
8
8
|
import { useDriveActionsWithUiNodes } from "@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes";
|
|
@@ -10,7 +10,7 @@ import { useDriveContext, DriveContextProvider } from "@powerhousedao/reactor-br
|
|
|
10
10
|
import "@powerhousedao/reactor-browser/uiNodes/constants";
|
|
11
11
|
import { makeDriveDocumentStateHook } from "@powerhousedao/reactor-browser/hooks/document-state";
|
|
12
12
|
import { flushSync } from "react-dom";
|
|
13
|
-
import "./main.
|
|
13
|
+
import "./main.BvYgkrO6.js";
|
|
14
14
|
const PaginationButton = ({ active = false, ...props }) => {
|
|
15
15
|
const className = twMerge("h-8 min-w-8 border border-solid border-gray-300 bg-white px-3 py-1 text-xs text-gray-900 hover:bg-gray-100", !active && "border-0");
|
|
16
16
|
return jsx(Button, { color: "light", size: "small", ...mergeClassNameProps(props, className), children: props.children });
|
|
@@ -238,7 +238,7 @@ function FolderItem(props) {
|
|
|
238
238
|
const { uiNode, isAllowedToCreateDocuments, className, onRenameNode, onDuplicateNode, onDeleteNode, onSelectNode, onAddFile, onCopyNode, onMoveNode } = props;
|
|
239
239
|
const [mode, setMode] = useState(READ);
|
|
240
240
|
const [isDropdownMenuOpen, setIsDropdownMenuOpen] = useState(false);
|
|
241
|
-
const { dragProps } = useDrag(props);
|
|
241
|
+
const { dragProps } = useDrag({ ...props, uiNode });
|
|
242
242
|
const { isDropTarget, dropProps } = useDrop({
|
|
243
243
|
uiNode,
|
|
244
244
|
onAddFile,
|
|
@@ -251,6 +251,7 @@ function FolderItem(props) {
|
|
|
251
251
|
}
|
|
252
252
|
function onSubmit(name) {
|
|
253
253
|
onRenameNode(name, uiNode);
|
|
254
|
+
setMode(READ);
|
|
254
255
|
}
|
|
255
256
|
function onClick() {
|
|
256
257
|
onSelectNode(uiNode);
|
|
@@ -2577,6 +2578,12 @@ function calculateRange({
|
|
|
2577
2578
|
}) {
|
|
2578
2579
|
const lastIndex = measurements.length - 1;
|
|
2579
2580
|
const getOffset = (index) => measurements[index].start;
|
|
2581
|
+
if (measurements.length <= lanes) {
|
|
2582
|
+
return {
|
|
2583
|
+
startIndex: 0,
|
|
2584
|
+
endIndex: lastIndex
|
|
2585
|
+
};
|
|
2586
|
+
}
|
|
2580
2587
|
let startIndex = findNearestBinarySearch(
|
|
2581
2588
|
0,
|
|
2582
2589
|
lastIndex,
|
|
@@ -3710,13 +3717,36 @@ function FolderView(props) {
|
|
|
3710
3717
|
const { t } = useTranslation();
|
|
3711
3718
|
const folderNodes = node.children.filter((node2) => node2.kind === FOLDER).sort(sortUiNodesByName);
|
|
3712
3719
|
const fileNodes = node.children.filter((node2) => node2.kind === FILE).sort(sortUiNodesByName);
|
|
3720
|
+
const folderCallbacks = {
|
|
3721
|
+
onSelectNode: (node2) => nodeProps.onSelectNode(node2),
|
|
3722
|
+
onRenameNode: (name, node2) => nodeProps.onRenameNode(name, node2),
|
|
3723
|
+
onDuplicateNode: (node2) => nodeProps.onDuplicateNode(node2),
|
|
3724
|
+
onDeleteNode: (node2) => nodeProps.onDeleteNode(node2)
|
|
3725
|
+
};
|
|
3726
|
+
const fileCallbacks = {
|
|
3727
|
+
onSelectNode: (node2) => nodeProps.onSelectNode(node2),
|
|
3728
|
+
onRenameNode: (name, node2) => nodeProps.onRenameNode(name, node2),
|
|
3729
|
+
onDuplicateNode: (node2) => nodeProps.onDuplicateNode(node2),
|
|
3730
|
+
onDeleteNode: (node2) => nodeProps.onDeleteNode(node2)
|
|
3731
|
+
};
|
|
3732
|
+
const baseNodeCallbacks = {
|
|
3733
|
+
onAddFile: async (file, parentNode) => {
|
|
3734
|
+
await nodeProps.onAddFile(file, parentNode);
|
|
3735
|
+
},
|
|
3736
|
+
onCopyNode: async (uiNode, targetNode) => {
|
|
3737
|
+
await nodeProps.onCopyNode(uiNode, targetNode);
|
|
3738
|
+
},
|
|
3739
|
+
onMoveNode: async (uiNode, targetNode) => {
|
|
3740
|
+
await nodeProps.onMoveNode(uiNode, targetNode);
|
|
3741
|
+
}
|
|
3742
|
+
};
|
|
3713
3743
|
return jsxs("div", { className: twMerge("rounded-md border-2 border-transparent p-2", isDropTarget && "border-dashed border-blue-100", className), ...containerProps, children: [jsx(DriveLayout.ContentSection, { title: t("folderView.sections.folders.title", {
|
|
3714
3744
|
defaultValue: "Folders"
|
|
3715
|
-
}), className: "mb-4", children: folderNodes.length > 0 ? folderNodes.map((folderNode) => jsx(FolderItem, { uiNode: folderNode,
|
|
3745
|
+
}), className: "mb-4", children: folderNodes.length > 0 ? folderNodes.map((folderNode) => jsx(FolderItem, { uiNode: folderNode, ...baseNodeCallbacks, ...folderCallbacks, isAllowedToCreateDocuments: nodeProps.isAllowedToCreateDocuments }, folderNode.id)) : jsx("div", { className: "mb-8 text-sm text-gray-400", children: t("folderView.sections.folders.empty", {
|
|
3716
3746
|
defaultValue: "No documents or files 📄"
|
|
3717
3747
|
}) }) }), jsx(DriveLayout.ContentSection, { title: t("folderView.sections.documents.title", {
|
|
3718
3748
|
defaultValue: "Documents and files"
|
|
3719
|
-
}), children: jsx("div", { className: twMerge("w-full", fileNodes.length > 0 ? "min-h-[400px]" : "min-h-14"), children: jsx(FileContentView, { fileNodes,
|
|
3749
|
+
}), children: jsx("div", { className: twMerge("w-full", fileNodes.length > 0 ? "min-h-[400px]" : "min-h-14"), children: jsx(FileContentView, { fileNodes, ...fileCallbacks, isAllowedToCreateDocuments: nodeProps.isAllowedToCreateDocuments }) }) })] });
|
|
3720
3750
|
}
|
|
3721
3751
|
function Editor(props) {
|
|
3722
3752
|
const { document: document2, dispatch, className, children } = props;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-loader-
|
|
2
|
-
import { _ as __vitePreload } from "./main.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-loader-Be1urgPw.js","assets/main.BvYgkrO6.js","assets/app-loader-DC8DXqh9.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { _ as __vitePreload } from "./main.BvYgkrO6.js";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
async function renderApp(element) {
|
|
5
|
-
const AppLoader = await __vitePreload(() => import("./app-loader-
|
|
5
|
+
const AppLoader = await __vitePreload(() => import("./app-loader-Be1urgPw.js").then((n) => n.c9), true ? __vite__mapDeps([0,1,2]) : void 0);
|
|
6
6
|
createRoot(element).render(AppLoader.default);
|
|
7
7
|
}
|
|
8
8
|
const AppElement = document.getElementById("app");
|