@tulip-systems/drive 0.9.0 → 0.10.0
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/client.d.mts +2 -1
- package/dist/client.mjs +2 -1
- package/dist/components/grid-card.client.d.mts +2 -2
- package/dist/lib/dto.d.mts +2 -2
- package/dist/lib/validators.d.mts +9 -9
- package/dist/lib/view-config.client.d.mts +57 -0
- package/dist/lib/view-config.client.mjs +46 -0
- package/dist/providers/google/components/view.client.d.mts +2 -2
- package/dist/providers/google/components/view.client.mjs +8 -8
- package/dist/providers/google/config/columns-data.mjs +1 -1
- package/dist/providers/google/config/filters.d.mts +1 -1
- package/dist/providers/google/lib/router.server.d.mts +20 -20
- package/dist/providers/google/lib/search-params.d.mts +1 -1
- package/dist/providers/google/lib/validators.d.mts +12 -12
- package/dist/providers/local/components/view.client.d.mts +2 -2
- package/dist/providers/local/components/view.client.mjs +8 -8
- package/dist/providers/local/config/columns-data.mjs +1 -1
- package/dist/providers/local/config/filters.d.mts +1 -1
- package/dist/providers/local/lib/router.server.d.mts +119 -119
- package/dist/providers/local/lib/schema.d.mts +2 -2
- package/dist/providers/local/lib/search-params.d.mts +1 -1
- package/dist/providers/local/lib/service.server.d.mts +20 -20
- package/dist/providers/local/lib/validators.d.mts +18 -18
- package/package.json +2 -2
- package/src/components/grid-card.client.tsx +2 -2
- package/src/entry.client.ts +5 -0
- package/src/lib/view-config.client.tsx +116 -0
- package/src/providers/google/components/view.client.tsx +15 -19
- package/src/providers/local/components/view.client.tsx +15 -15
|
@@ -4,6 +4,7 @@ import { useDriveSelectionContext } from "../../../components/selection.client.m
|
|
|
4
4
|
import { DriveGridCard, DriveGridCardSkeleton } from "../../../components/grid-card.client.mjs";
|
|
5
5
|
import { DriveGrid, DriveGridBottombar, DriveGridEmpty, DriveGridLoading } from "../../../components/grid.client.mjs";
|
|
6
6
|
import { useDriveViewContext } from "../../../components/view.client.mjs";
|
|
7
|
+
import { DriveViewConfigProvider, createDriveViewConfig, useDriveViewConfig } from "../../../lib/view-config.client.mjs";
|
|
7
8
|
import { localDriveColumns } from "../config/columns-data.mjs";
|
|
8
9
|
import { localDriveImageLoader } from "../lib/helpers.mjs";
|
|
9
10
|
import { useLocalDriveUploadZone } from "./upload-zone-context.client.mjs";
|
|
@@ -12,16 +13,15 @@ import { TableLayout, TableSkeleton } from "@tulip-systems/core/data-tables";
|
|
|
12
13
|
import { useMemo } from "react";
|
|
13
14
|
import { FloatingCommandMenu } from "@tulip-systems/core/commands/client";
|
|
14
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
import { DataTable
|
|
16
|
+
import { DataTable } from "@tulip-systems/core/data-tables/client";
|
|
16
17
|
|
|
17
18
|
//#region src/providers/local/components/view.client.tsx
|
|
18
19
|
function LocalDriveViewProvider({ queryData, columns = localDriveColumns, strategy, commands, columnVisibility, children, ...props }) {
|
|
19
20
|
const { meta } = useLocalDriveContext();
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
config:
|
|
21
|
+
return /* @__PURE__ */ jsx(DriveViewConfigProvider, {
|
|
22
|
+
config: createDriveViewConfig({
|
|
22
23
|
queryData,
|
|
23
24
|
columns,
|
|
24
|
-
getRowId: (row) => row.id,
|
|
25
25
|
strategy,
|
|
26
26
|
commands,
|
|
27
27
|
meta,
|
|
@@ -41,7 +41,7 @@ function LocalDriveView() {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
function LocalDriveGrid(props) {
|
|
44
|
-
const { queryData, strategy, commands, selection, meta } =
|
|
44
|
+
const { queryData, strategy, commands, selection, meta } = useDriveViewConfig();
|
|
45
45
|
const { optimistic } = useLocalDriveUploadZone();
|
|
46
46
|
const { rowCount, paginationState } = strategy;
|
|
47
47
|
const { isFetching, isFetchingNextPage, fetchNextPage } = strategy.meta;
|
|
@@ -52,7 +52,7 @@ function LocalDriveGrid(props) {
|
|
|
52
52
|
children: [
|
|
53
53
|
queryData.length > 0 ? queryData.filter((node) => !node.hidden).map((node) => /* @__PURE__ */ jsx(DriveGridCard, {
|
|
54
54
|
node,
|
|
55
|
-
commands,
|
|
55
|
+
commands: commands?.node,
|
|
56
56
|
imageLoader: localDriveImageLoader
|
|
57
57
|
}, node.id)) : /* @__PURE__ */ jsx(DriveGridEmpty, { title: "Geen resultaten gevonden" }),
|
|
58
58
|
isFetchingNextPage && Array.from({ length: paginationState?.pageSize ?? 0 }).map((_, index) => /* @__PURE__ */ jsx(DriveGridCardSkeleton, {}, index)),
|
|
@@ -62,9 +62,9 @@ function LocalDriveGrid(props) {
|
|
|
62
62
|
isFetching,
|
|
63
63
|
isFetchingNextPage
|
|
64
64
|
}),
|
|
65
|
-
commands && commands.length > 0 && /* @__PURE__ */ jsx(FloatingCommandMenu, {
|
|
65
|
+
commands?.selectedNodes && commands?.selectedNodes.length > 0 && /* @__PURE__ */ jsx(FloatingCommandMenu, {
|
|
66
66
|
data: selectedData,
|
|
67
|
-
commands,
|
|
67
|
+
commands: commands.selectedNodes,
|
|
68
68
|
meta,
|
|
69
69
|
state: selectedData.length > 0 ? "open" : "closed",
|
|
70
70
|
onSuccess: () => {
|
|
@@ -6,8 +6,8 @@ import { TableColumnHeader } from "@tulip-systems/core/data-tables";
|
|
|
6
6
|
import { findStatus } from "@tulip-systems/core/components";
|
|
7
7
|
import { FolderIcon } from "lucide-react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from "@tulip-systems/core/components/client";
|
|
10
9
|
import { TableTextCell, createTableSelectCell } from "@tulip-systems/core/data-tables/client";
|
|
10
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "@tulip-systems/core/components/client";
|
|
11
11
|
import Link from "next/link";
|
|
12
12
|
import { createSerializer, useQueryStates } from "nuqs";
|
|
13
13
|
|
|
@@ -14,8 +14,8 @@ declare const localDriveFilters: {
|
|
|
14
14
|
}>>>;
|
|
15
15
|
hidden: _tulip_systems_core_data_tables0.ParseFilter<z$1.ZodBoolean>;
|
|
16
16
|
types: _tulip_systems_core_data_tables0.ParseFilter<z$1.ZodArray<z$1.ZodEnum<{
|
|
17
|
-
folder: "folder";
|
|
18
17
|
file: "file";
|
|
18
|
+
folder: "folder";
|
|
19
19
|
}>>>;
|
|
20
20
|
contentTypes: _tulip_systems_core_data_tables0.ParseFilter<z$1.ZodArray<z$1.ZodString>>;
|
|
21
21
|
nodeIds: _tulip_systems_core_data_tables0.ParseFilter<z$1.ZodArray<z$1.ZodString>>;
|