@powerhousedao/design-system 5.0.0-staging.19 → 5.0.0-staging.20

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.
@@ -1,2 +1,3 @@
1
1
  export { DropZone, type DropZoneProps } from "./drop-zone.js";
2
+ export { withDropZone } from "./withDropZone.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/connect/components/drop-zone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/connect/components/drop-zone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { DropZone } from "./drop-zone.js";
2
+ export { withDropZone } from "./withDropZone.js";
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/connect/components/drop-zone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/connect/components/drop-zone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { DriveEditorProps } from "@powerhousedao/reactor-browser";
2
+ import type { ComponentType } from "react";
3
+ export declare function withDropZone<T extends DriveEditorProps>(WrappedComponent: ComponentType<T>): ComponentType<T>;
4
+ //# sourceMappingURL=withDropZone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withDropZone.d.ts","sourceRoot":"","sources":["../../../../../src/connect/components/drop-zone/withDropZone.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAER,gBAAgB,EAEnB,MAAM,gCAAgC,CAAC;AAMxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,wBAAgB,YAAY,CAAC,CAAC,SAAS,gBAAgB,EACrD,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC,GACjC,aAAa,CAAC,CAAC,CAAC,CAoClB"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { DropZone } from "@powerhousedao/design-system";
3
+ import { setSelectedNode, useOnDropFile, useSelectedDriveId, } from "@powerhousedao/reactor-browser";
4
+ export function withDropZone(WrappedComponent) {
5
+ const WithDropZoneComponent = (props) => {
6
+ const driveId = useSelectedDriveId();
7
+ const onDropFile = useOnDropFile(props.editorConfig?.documentTypes);
8
+ const onAddFile = async (file, parent, onProgress, resolveConflict) => {
9
+ return await onDropFile(file, onProgress, resolveConflict);
10
+ };
11
+ if (props.editorConfig?.dragAndDrop?.enabled) {
12
+ return (_jsx(DropZone, { driveId: driveId, onAddFile: onAddFile, setSelectedNode: setSelectedNode, useLocalStorage: true, style: { height: "100%" }, children: _jsx(WrappedComponent, { ...props }) }));
13
+ }
14
+ return _jsx(WrappedComponent, { ...props });
15
+ };
16
+ WithDropZoneComponent.displayName = `withDropZone(${WrappedComponent.displayName || WrappedComponent.name || "Component"})`;
17
+ return WithDropZoneComponent;
18
+ }
19
+ //# sourceMappingURL=withDropZone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withDropZone.js","sourceRoot":"","sources":["../../../../../src/connect/components/drop-zone/withDropZone.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAMxD,OAAO,EACH,eAAe,EACf,aAAa,EACb,kBAAkB,GACrB,MAAM,gCAAgC,CAAC;AAGxC,MAAM,UAAU,YAAY,CAC1B,gBAAkC;IAElC,MAAM,qBAAqB,GAAG,CAAC,KAAQ,EAAE,EAAE;QACzC,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;QACrC,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;QAEpE,MAAM,SAAS,GAAG,KAAK,EACrB,IAAU,EACV,MAAW,EACX,UAAuC,EACvC,eAAoC,EACpC,EAAE;YACF,OAAO,MAAM,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;QAC7D,CAAC,CAAC;QAEF,IAAI,KAAK,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;YAC7C,OAAO,CACL,KAAC,QAAQ,IACP,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,IAAI,EACrB,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAEzB,KAAC,gBAAgB,OAAK,KAAK,GAAI,GACtB,CACZ,CAAC;QACJ,CAAC;QAED,OAAO,KAAC,gBAAgB,OAAK,KAAK,GAAI,CAAC;IACzC,CAAC,CAAC;IAEF,qBAAqB,CAAC,WAAW,GAAG,gBAClC,gBAAgB,CAAC,WAAW,IAAI,gBAAgB,CAAC,IAAI,IAAI,WAC3D,GAAG,CAAC;IAEJ,OAAO,qBAAqB,CAAC;AAC/B,CAAC"}
@@ -1,6 +1,5 @@
1
1
  type HomeScreenAddDriveItemProps = {
2
2
  readonly containerClassName?: string;
3
- readonly onClick?: () => void;
4
3
  };
5
4
  export declare const HomeScreenAddDriveItem: (props: HomeScreenAddDriveItemProps) => import("react/jsx-runtime").JSX.Element;
6
5
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"home-screen-add-drive-item.d.ts","sourceRoot":"","sources":["../../../../../../src/connect/components/home-screen/home-screen-add-drive-item/home-screen-add-drive-item.tsx"],"names":[],"mappings":"AAGA,KAAK,2BAA2B,GAAG;IACjC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AACF,eAAO,MAAM,sBAAsB,GACjC,OAAO,2BAA2B,4CAWnC,CAAC"}
1
+ {"version":3,"file":"home-screen-add-drive-item.d.ts","sourceRoot":"","sources":["../../../../../../src/connect/components/home-screen/home-screen-add-drive-item/home-screen-add-drive-item.tsx"],"names":[],"mappings":"AAIA,KAAK,2BAA2B,GAAG;IACjC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC,CAAC;AACF,eAAO,MAAM,sBAAsB,GACjC,OAAO,2BAA2B,4CAWnC,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Icon } from "#powerhouse";
3
+ import { showPHModal } from "@powerhousedao/reactor-browser";
3
4
  import { HomeScreenItem } from "../home-screen-item/index.js";
4
5
  export const HomeScreenAddDriveItem = function HomeScreenAddDriveItem(props) {
5
- const { containerClassName, onClick } = props;
6
- return (_jsx(HomeScreenItem, { title: "Create New Drive", icon: _jsx(Icon, { name: "PlusSquare", size: 32 }), onClick: onClick, containerClassName: containerClassName }));
6
+ const { containerClassName } = props;
7
+ return (_jsx(HomeScreenItem, { title: "Create New Drive", icon: _jsx(Icon, { name: "PlusSquare", size: 32 }), onClick: () => showPHModal({ type: "addDrive" }), containerClassName: containerClassName }));
7
8
  };
8
9
  //# sourceMappingURL=home-screen-add-drive-item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"home-screen-add-drive-item.js","sourceRoot":"","sources":["../../../../../../src/connect/components/home-screen/home-screen-add-drive-item/home-screen-add-drive-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAM9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,sBAAsB,CACnE,KAAkC;IAElC,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC9C,OAAO,CACL,KAAC,cAAc,IACb,KAAK,EAAC,kBAAkB,EACxB,IAAI,EAAE,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,EAAC,IAAI,EAAE,EAAE,GAAI,EAC1C,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"home-screen-add-drive-item.js","sourceRoot":"","sources":["../../../../../../src/connect/components/home-screen/home-screen-add-drive-item/home-screen-add-drive-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,sBAAsB,CACnE,KAAkC;IAElC,MAAM,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IACrC,OAAO,CACL,KAAC,cAAc,IACb,KAAK,EAAC,kBAAkB,EACxB,IAAI,EAAE,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,EAAC,IAAI,EAAE,EAAE,GAAI,EAC1C,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAChD,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC;AACJ,CAAC,CAAC"}