rimecms 0.25.14 → 0.26.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/adapter-sqlite/where.js +12 -4
- package/dist/core/collections/api/get.server.js +6 -2
- package/dist/core/i18n/en/common.js +1 -1
- package/dist/core/i18n/en/fields.d.ts +2 -0
- package/dist/core/i18n/en/fields.js +3 -1
- package/dist/core/i18n/fr/fields.d.ts +2 -0
- package/dist/core/i18n/fr/fields.js +3 -1
- package/dist/fields/link/component/Link.svelte +4 -1
- package/dist/fields/relation/component/upload/Browse.svelte +133 -28
- package/dist/fields/select/component/Select.svelte +11 -6
- package/dist/fields/slug/component/Slug.svelte +8 -4
- package/dist/fields/textarea/component/TextArea.svelte +15 -10
- package/dist/fields/toggle/component/Toggle.svelte +8 -4
- package/dist/panel/components/fields/Error.svelte +13 -7
- package/dist/panel/components/sections/collection/{grid/grid-item → folder}/Folder.svelte +14 -6
- package/dist/panel/components/sections/collection/{grid/grid-item → folder}/FolderEdit.svelte +11 -11
- package/dist/panel/components/sections/collection/{grid/grid-item → folder}/FolderEdit.svelte.d.ts +2 -2
- package/dist/panel/components/sections/collection/{grid/grid-item → folder}/FolderWithActions.svelte +64 -23
- package/dist/panel/components/sections/collection/{grid/grid-item → folder}/FolderWithActions.svelte.d.ts +3 -2
- package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +71 -29
- package/dist/panel/components/sections/collection/{header/create-folder/CreateFolder.svelte → grid/create-directory-dialog/CreateDirectoryDialog.svelte} +3 -17
- package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte.d.ts +8 -0
- package/dist/panel/components/sections/collection/header/Header.svelte +0 -6
- package/dist/panel/components/sections/collection/header/SearchInput.svelte +23 -22
- package/dist/panel/components/sections/collection/header/SelectUI.svelte +16 -3
- package/dist/panel/components/sections/collection/list/CollectionList.svelte +35 -2
- package/dist/panel/components/sections/document/Document.svelte +17 -10
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +24 -18
- package/dist/panel/components/ui/button/button.svelte +75 -51
- package/dist/panel/components/ui/command/command-input.svelte +2 -4
- package/dist/panel/components/ui/command/command-item.css +2 -4
- package/dist/panel/components/ui/context-menu/ContextMenuItem.svelte +10 -13
- package/dist/panel/components/ui/context-menu/ContextMenuItem.svelte.d.ts +2 -2
- package/dist/panel/components/ui/context-menu/context-menu-item.css +2 -4
- package/dist/panel/components/ui/dialog/dialog-content.css +12 -3
- package/dist/panel/components/ui/dialog/dialog-content.svelte +5 -1
- package/dist/panel/components/ui/dialog/dialog-content.svelte.d.ts +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +9 -5
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.css +2 -4
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-radio-item.css +1 -2
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-separator.css +1 -2
- package/dist/panel/components/ui/input/input.svelte +55 -14
- package/dist/panel/components/ui/input/input.svelte.d.ts +8 -2
- package/dist/panel/components/ui/page-header/PageHeader.svelte +14 -9
- package/dist/panel/context/collection.svelte.d.ts +2 -0
- package/dist/panel/context/collection.svelte.js +9 -4
- package/dist/panel/style/mixins/index.css +0 -4
- package/package.json +1 -1
- package/dist/panel/components/sections/collection/header/create-folder/CreateFolder.svelte.d.ts +0 -7
- /package/dist/panel/components/sections/collection/{grid/grid-item → folder}/Folder.svelte.d.ts +0 -0
package/dist/panel/components/sections/collection/{grid/grid-item → folder}/FolderWithActions.svelte
RENAMED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { goto, invalidateAll } from '$app/navigation';
|
|
3
|
-
import { apiUrl } from '
|
|
4
|
-
import type { Directory } from '
|
|
5
|
-
import type { BuiltCollectionClient } from '
|
|
6
|
-
import { PARAMS } from '
|
|
7
|
-
import { withDirectoriesSuffix } from '
|
|
8
|
-
import type { GenericDoc } from '
|
|
9
|
-
import Button from '
|
|
10
|
-
import ContextMenu from '
|
|
11
|
-
import ContextMenuItem from '
|
|
12
|
-
import * as Dialog from '
|
|
13
|
-
import { API_PROXY, getAPIProxyContext } from '
|
|
14
|
-
import { panelUrl } from '
|
|
15
|
-
import { trycatchFetch } from '
|
|
3
|
+
import { apiUrl } from '../../../../../core/api/index.js';
|
|
4
|
+
import type { Directory } from '../../../../../core/collections/upload/upload.js';
|
|
5
|
+
import type { BuiltCollectionClient } from '../../../../../core/config/types.js';
|
|
6
|
+
import { PARAMS } from '../../../../../core/constant.js';
|
|
7
|
+
import { withDirectoriesSuffix } from '../../../../../core/naming.js';
|
|
8
|
+
import type { GenericDoc } from '../../../../../core/types/doc.js';
|
|
9
|
+
import Button from '../../../ui/button/button.svelte';
|
|
10
|
+
import ContextMenu from '../../../ui/context-menu/ContextMenu.svelte';
|
|
11
|
+
import ContextMenuItem from '../../../ui/context-menu/ContextMenuItem.svelte';
|
|
12
|
+
import * as Dialog from '../../../ui/dialog/index.js';
|
|
13
|
+
import { API_PROXY, getAPIProxyContext } from '../../../../context/api-proxy.svelte.js';
|
|
14
|
+
import { panelUrl } from '../../../../util/url.js';
|
|
15
|
+
import { trycatchFetch } from '../../../../../util/function.js';
|
|
16
|
+
import { Pencil, Trash2 } from '@lucide/svelte';
|
|
16
17
|
import { toast } from 'svelte-sonner';
|
|
17
|
-
import { t__ } from '
|
|
18
|
+
import { t__ } from '../../../../../core/i18n/index.js';
|
|
18
19
|
import Folder from './Folder.svelte';
|
|
19
20
|
import FolderEdit from './FolderEdit.svelte';
|
|
20
21
|
|
|
@@ -24,15 +25,23 @@
|
|
|
24
25
|
onDelete?: (path: string) => void;
|
|
25
26
|
onDocumentDrop: (args: { documentId: string; path: string }) => void;
|
|
26
27
|
draggable?: 'true';
|
|
28
|
+
display?: 'grid' | 'list';
|
|
27
29
|
};
|
|
28
|
-
const {
|
|
30
|
+
const {
|
|
31
|
+
folder,
|
|
32
|
+
collection,
|
|
33
|
+
onDelete,
|
|
34
|
+
onDocumentDrop,
|
|
35
|
+
draggable,
|
|
36
|
+
display = 'grid'
|
|
37
|
+
}: Props = $props();
|
|
29
38
|
|
|
30
39
|
let deleteConfirmOpen = $state(false);
|
|
31
40
|
let editFolderDialogOpen = $state(false);
|
|
32
41
|
let message = $state('');
|
|
33
42
|
let rootElement = $state<HTMLButtonElement>();
|
|
34
43
|
let isDragging = $state(false);
|
|
35
|
-
const
|
|
44
|
+
const isFolderUpperPath = $derived(folder.name === '...');
|
|
36
45
|
const APIProxy = getAPIProxyContext(API_PROXY.ROOT);
|
|
37
46
|
const childFilesURL = $derived(
|
|
38
47
|
`${apiUrl(collection.kebab)}?where[_path][equals]=${folder.id}&select=id`
|
|
@@ -144,7 +153,7 @@
|
|
|
144
153
|
<button
|
|
145
154
|
bind:this={rootElement}
|
|
146
155
|
onclick={handleGoToFolder}
|
|
147
|
-
class="rz-folder"
|
|
156
|
+
class="rz-folder rz-folder--{display}"
|
|
148
157
|
class:rz-folder--dragging={isDragging}
|
|
149
158
|
ondragleave={handleDragLeave}
|
|
150
159
|
ondragover={!isDragging ? handleDragEnter : null}
|
|
@@ -153,7 +162,7 @@
|
|
|
153
162
|
draggable={draggable === 'true' ? 'true' : null}
|
|
154
163
|
ondragstart={draggable === 'true' ? handleDragStart : null}
|
|
155
164
|
>
|
|
156
|
-
{#if !
|
|
165
|
+
{#if !isFolderUpperPath}
|
|
157
166
|
<ContextMenu>
|
|
158
167
|
<!-- -->
|
|
159
168
|
{#snippet trigger()}
|
|
@@ -161,13 +170,19 @@
|
|
|
161
170
|
{/snippet}
|
|
162
171
|
<!-- -->
|
|
163
172
|
{#snippet content()}
|
|
164
|
-
<ContextMenuItem onclick={handleGetDeleteInfos}>
|
|
165
|
-
|
|
173
|
+
<ContextMenuItem onclick={handleGetDeleteInfos}>
|
|
174
|
+
<Trash2 size="12" /> Delete
|
|
175
|
+
</ContextMenuItem>
|
|
176
|
+
<ContextMenuItem onclick={() => (editFolderDialogOpen = true)}>
|
|
177
|
+
<Pencil size="12" /> Edit
|
|
178
|
+
</ContextMenuItem>
|
|
166
179
|
{/snippet}
|
|
167
180
|
<!-- -->
|
|
168
181
|
</ContextMenu>
|
|
169
182
|
{:else}
|
|
170
|
-
<
|
|
183
|
+
<div>
|
|
184
|
+
<Folder>{folder.name}</Folder>
|
|
185
|
+
</div>
|
|
171
186
|
{/if}
|
|
172
187
|
|
|
173
188
|
<span></span>
|
|
@@ -200,7 +215,6 @@
|
|
|
200
215
|
|
|
201
216
|
.rz-folder {
|
|
202
217
|
width: 100%;
|
|
203
|
-
aspect-ratio: 4 / 5;
|
|
204
218
|
padding: var(--rz-size-5);
|
|
205
219
|
border-radius: var(--rz-radius-lg);
|
|
206
220
|
|
|
@@ -211,7 +225,34 @@
|
|
|
211
225
|
}
|
|
212
226
|
}
|
|
213
227
|
|
|
214
|
-
.rz-folder
|
|
228
|
+
.rz-folder.rz-folder--grid {
|
|
229
|
+
aspect-ratio: 4 / 5;
|
|
230
|
+
}
|
|
231
|
+
.rz-folder.rz-folder--list {
|
|
232
|
+
height: var(--rz-row-height);
|
|
233
|
+
padding: var(--rz-size-1-5);
|
|
234
|
+
|
|
235
|
+
:global {
|
|
236
|
+
> div {
|
|
237
|
+
padding: 0;
|
|
238
|
+
display: flex;
|
|
239
|
+
gap: var(--rz-size-4);
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: flex-start;
|
|
242
|
+
h3 {
|
|
243
|
+
font-size: var(--rz-text-md);
|
|
244
|
+
}
|
|
245
|
+
svg {
|
|
246
|
+
display: block;
|
|
247
|
+
height: auto;
|
|
248
|
+
width: 2rem;
|
|
249
|
+
transform: translateY(-0.12em);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.rz-folder.rz-folder--grid:hover {
|
|
215
256
|
background-color: var(--rz-folder-hover-bg);
|
|
216
257
|
}
|
|
217
258
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Directory } from '
|
|
2
|
-
import type { BuiltCollectionClient } from '
|
|
1
|
+
import type { Directory } from '../../../../../core/collections/upload/upload.js';
|
|
2
|
+
import type { BuiltCollectionClient } from '../../../../../core/config/types.js';
|
|
3
3
|
type Props = {
|
|
4
4
|
folder: Directory;
|
|
5
5
|
collection: BuiltCollectionClient;
|
|
@@ -9,6 +9,7 @@ type Props = {
|
|
|
9
9
|
path: string;
|
|
10
10
|
}) => void;
|
|
11
11
|
draggable?: 'true';
|
|
12
|
+
display?: 'grid' | 'list';
|
|
12
13
|
};
|
|
13
14
|
declare const FolderWithActions: import("svelte").Component<Props, {}, "">;
|
|
14
15
|
type FolderWithActions = ReturnType<typeof FolderWithActions>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { t__ } from '../../../../../core/i18n/index.js';
|
|
3
|
+
import ContextMenu from '../../../ui/context-menu/ContextMenu.svelte';
|
|
4
|
+
import ContextMenuItem from '../../../ui/context-menu/ContextMenuItem.svelte';
|
|
2
5
|
import type { CollectionContext } from '../../../../context/collection.svelte.js';
|
|
6
|
+
import { FolderPlus } from '@lucide/svelte';
|
|
3
7
|
import Empty from '../Empty.svelte';
|
|
4
|
-
import Folder from '
|
|
8
|
+
import Folder from '../folder/FolderWithActions.svelte';
|
|
9
|
+
import CreateDirectoryDialog from './create-directory-dialog/CreateDirectoryDialog.svelte';
|
|
5
10
|
import GridItem from './grid-item/GridItem.svelte';
|
|
6
11
|
|
|
7
12
|
type Props = { collection: CollectionContext };
|
|
8
13
|
const { collection }: Props = $props();
|
|
14
|
+
let createDirectoryDialogOpen = $state(false);
|
|
9
15
|
|
|
10
16
|
const currentPathDocuments = $derived(
|
|
11
17
|
collection.docs.filter((doc) => doc._path === collection.upload.currentPath)
|
|
@@ -15,6 +21,14 @@
|
|
|
15
21
|
collection.upload.directories = collection.upload.directories.filter((dir) => dir.id !== path);
|
|
16
22
|
}
|
|
17
23
|
|
|
24
|
+
const hasContentUnfiltered = $derived(
|
|
25
|
+
!collection.isFiltered &&
|
|
26
|
+
(collection.docs.length ||
|
|
27
|
+
collection.upload.directories.length ||
|
|
28
|
+
collection.upload.parentDirectory)
|
|
29
|
+
);
|
|
30
|
+
const hasDocsFiltered = $derived(collection.isFiltered && collection.docs.length);
|
|
31
|
+
|
|
18
32
|
/**
|
|
19
33
|
* When a document is moved into a folder
|
|
20
34
|
* change the document path inside collection.docs
|
|
@@ -34,37 +48,55 @@
|
|
|
34
48
|
);
|
|
35
49
|
</script>
|
|
36
50
|
|
|
37
|
-
{#if
|
|
51
|
+
{#if hasContentUnfiltered || hasDocsFiltered}
|
|
38
52
|
<div class="rz-page-collection__grid">
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
<!-- All children directories -->
|
|
49
|
-
{#each collection.upload.directories as folder (folder.id)}
|
|
50
|
-
<Folder
|
|
51
|
-
draggable="true"
|
|
52
|
-
{onDocumentDrop}
|
|
53
|
-
{folder}
|
|
54
|
-
collection={collection.config}
|
|
55
|
-
onDelete={onDeleteFolder}
|
|
56
|
-
/>
|
|
57
|
-
{/each}
|
|
53
|
+
<div class="rz-page-collection__grid-inner">
|
|
54
|
+
<!-- Parent directory -->
|
|
55
|
+
{#if collection.upload.parentDirectory && !collection.isFiltered}
|
|
56
|
+
<Folder
|
|
57
|
+
{onDocumentDrop}
|
|
58
|
+
folder={{ ...collection.upload.parentDirectory, name: '...' }}
|
|
59
|
+
collection={collection.config}
|
|
60
|
+
/>
|
|
61
|
+
{/if}
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
<!-- All children directories -->
|
|
64
|
+
{#if !collection.isFiltered}
|
|
65
|
+
{#each collection.upload.directories as folder (folder.id)}
|
|
66
|
+
<Folder
|
|
67
|
+
draggable="true"
|
|
68
|
+
{onDocumentDrop}
|
|
69
|
+
{folder}
|
|
70
|
+
collection={collection.config}
|
|
71
|
+
onDelete={onDeleteFolder}
|
|
72
|
+
/>
|
|
73
|
+
{/each}
|
|
66
74
|
{/if}
|
|
67
|
-
|
|
75
|
+
|
|
76
|
+
<!-- All children docs -->
|
|
77
|
+
{#each currentPathDocuments as doc (doc.id)}
|
|
78
|
+
{@const checked = collection.selected.includes(doc.id)}
|
|
79
|
+
{#if dragEnabled}
|
|
80
|
+
<GridItem draggable="true" {doc} {checked} />
|
|
81
|
+
{:else}
|
|
82
|
+
<GridItem {doc} {checked} />
|
|
83
|
+
{/if}
|
|
84
|
+
{/each}
|
|
85
|
+
|
|
86
|
+
<ContextMenu>
|
|
87
|
+
{#snippet trigger()}
|
|
88
|
+
<div class="rz-collection-grid__context-menu-trigger"></div>
|
|
89
|
+
{/snippet}
|
|
90
|
+
{#snippet content()}
|
|
91
|
+
<ContextMenuItem onclick={() => (createDirectoryDialogOpen = true)}>
|
|
92
|
+
<FolderPlus size="14" />
|
|
93
|
+
{t__('common.create_folder')}
|
|
94
|
+
</ContextMenuItem>
|
|
95
|
+
{/snippet}
|
|
96
|
+
</ContextMenu>
|
|
97
|
+
|
|
98
|
+
<CreateDirectoryDialog {collection} bind:open={createDirectoryDialogOpen} />
|
|
99
|
+
</div>
|
|
68
100
|
</div>
|
|
69
101
|
{:else}
|
|
70
102
|
<Empty {collection} />
|
|
@@ -72,8 +104,18 @@
|
|
|
72
104
|
|
|
73
105
|
<style>
|
|
74
106
|
.rz-page-collection__grid {
|
|
107
|
+
position: relative;
|
|
108
|
+
min-height: calc(100vh - 16rem);
|
|
109
|
+
z-index: 0;
|
|
110
|
+
}
|
|
111
|
+
.rz-page-collection__grid-inner {
|
|
75
112
|
display: grid;
|
|
76
113
|
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
77
114
|
gap: var(--rz-size-4);
|
|
78
115
|
}
|
|
116
|
+
.rz-collection-grid__context-menu-trigger {
|
|
117
|
+
position: absolute;
|
|
118
|
+
inset: 0;
|
|
119
|
+
z-index: -1;
|
|
120
|
+
}
|
|
79
121
|
</style>
|
|
@@ -12,14 +12,13 @@
|
|
|
12
12
|
setDocumentFormContext,
|
|
13
13
|
type FormSuccessData
|
|
14
14
|
} from '../../../../../context/documentForm.svelte.js';
|
|
15
|
-
import { FolderPlus } from '@lucide/svelte';
|
|
16
15
|
|
|
17
|
-
type Props = { collection: CollectionContext };
|
|
18
|
-
|
|
16
|
+
type Props = { collection: CollectionContext; open: boolean };
|
|
17
|
+
let { collection, open = $bindable() }: Props = $props();
|
|
19
18
|
|
|
20
19
|
const configCtx = getConfigContext();
|
|
21
20
|
const directoriesConfig = configCtx.getCollection(withDirectoriesSuffix(collection.config.slug));
|
|
22
|
-
|
|
21
|
+
|
|
23
22
|
setAPIProxyContext(API_PROXY.DOCUMENT);
|
|
24
23
|
let formElement = $state<HTMLFormElement>();
|
|
25
24
|
|
|
@@ -60,19 +59,6 @@
|
|
|
60
59
|
<svelte:window onkeydown={handleKeyDown} />
|
|
61
60
|
|
|
62
61
|
<Dialog.Root bind:open>
|
|
63
|
-
<Dialog.Trigger>
|
|
64
|
-
{#snippet child(props)}
|
|
65
|
-
<Button
|
|
66
|
-
disabled={collection.selectMode}
|
|
67
|
-
onclick={() => (open = true)}
|
|
68
|
-
size="icon-sm"
|
|
69
|
-
variant="ghost"
|
|
70
|
-
{...props}
|
|
71
|
-
>
|
|
72
|
-
<FolderPlus size={17} />
|
|
73
|
-
</Button>
|
|
74
|
-
{/snippet}
|
|
75
|
-
</Dialog.Trigger>
|
|
76
62
|
<Dialog.Content class="rz-status-dialog">
|
|
77
63
|
{#snippet child({ props })}
|
|
78
64
|
<form use:form.enhance action={form.buildPanelActionUrl()} bind:this={formElement} {...props}>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CollectionContext } from '../../../../../context/collection.svelte.js';
|
|
2
|
+
type Props = {
|
|
3
|
+
collection: CollectionContext;
|
|
4
|
+
open: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const CreateDirectoryDialog: import("svelte").Component<Props, {}, "open">;
|
|
7
|
+
type CreateDirectoryDialog = ReturnType<typeof CreateDirectoryDialog>;
|
|
8
|
+
export default CreateDirectoryDialog;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { type CollectionContext } from '../../../../context/collection.svelte.js';
|
|
3
3
|
import { getContext } from 'svelte';
|
|
4
|
-
import CreateUploadFolder from './create-folder/CreateFolder.svelte';
|
|
5
4
|
import DisplayMode from './DisplayMode.svelte';
|
|
6
5
|
import SelectUI from './SelectUI.svelte';
|
|
7
6
|
import Separator from './Separator.svelte';
|
|
@@ -17,11 +16,6 @@
|
|
|
17
16
|
<DisplayMode />
|
|
18
17
|
{/if}
|
|
19
18
|
|
|
20
|
-
{#if collection.config.upload && collection.isGrid()}
|
|
21
|
-
<Separator />
|
|
22
|
-
<CreateUploadFolder {collection} />
|
|
23
|
-
{/if}
|
|
24
|
-
|
|
25
19
|
{#if showSelectUI}
|
|
26
20
|
<Separator />
|
|
27
21
|
<SelectUI />
|
|
@@ -6,54 +6,55 @@
|
|
|
6
6
|
import { getContext } from 'svelte';
|
|
7
7
|
|
|
8
8
|
const collection = getContext<CollectionContext>('rime.collectionList');
|
|
9
|
-
let
|
|
9
|
+
let searchValue = $state('');
|
|
10
10
|
|
|
11
11
|
$effect(() => {
|
|
12
|
-
collection.filterBy(
|
|
12
|
+
collection.filterBy(searchValue);
|
|
13
13
|
});
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
16
|
<div class="rz-header-search-input">
|
|
17
|
-
<div class="rz-header-search-input__icon">
|
|
18
|
-
<Search size={16} />
|
|
19
|
-
</div>
|
|
20
17
|
<Input
|
|
21
|
-
|
|
18
|
+
name="search"
|
|
19
|
+
icon={Search}
|
|
22
20
|
placeholder={t__('common.search', `${collection.length} document(s)`)}
|
|
23
21
|
type="text"
|
|
24
|
-
bind:value={
|
|
22
|
+
bind:value={searchValue}
|
|
25
23
|
/>
|
|
26
24
|
</div>
|
|
27
25
|
|
|
28
|
-
<style
|
|
29
|
-
|
|
26
|
+
<style>/**************************************/
|
|
27
|
+
|
|
28
|
+
/* Font */
|
|
29
|
+
|
|
30
|
+
/**************************************/
|
|
31
|
+
|
|
32
|
+
.rz-header-search-input {
|
|
30
33
|
position: relative;
|
|
31
34
|
display: none;
|
|
32
35
|
height: var(--rz-size-11);
|
|
33
36
|
align-items: center;
|
|
34
37
|
width: var(--rz-size-80);
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
:global {
|
|
40
|
+
.rz-input {
|
|
41
|
+
height: var(--rz-size-9);
|
|
42
|
+
font-size: var(--rz-text-sm);
|
|
43
|
+
}
|
|
44
|
+
.rz-input-wrapper {
|
|
45
|
+
width: 100%;
|
|
46
|
+
&:focus-visible {
|
|
47
|
+
box-shadow:
|
|
43
48
|
0 0 0 var(--rz-ring-offset, 0px) hsl(var(--rz-ring-offset-bg, var(--rz-gray-6)) / 1),
|
|
44
49
|
0 0 0 calc(var(--rz-ring-offset, 0px) + 1px) hsl(var(--rz-color-ring) / var(--rz-ring-opacity, 1));
|
|
50
|
+
}
|
|
45
51
|
}
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
@container (min-width: 720px) {
|
|
50
56
|
.rz-header-search-input {
|
|
51
57
|
display: flex;
|
|
52
58
|
}
|
|
53
59
|
}
|
|
54
|
-
|
|
55
|
-
.rz-header-search-input__icon {
|
|
56
|
-
position: absolute;
|
|
57
|
-
left: var(--rz-size-3);
|
|
58
|
-
}
|
|
59
60
|
</style>
|
|
@@ -24,13 +24,26 @@
|
|
|
24
24
|
|
|
25
25
|
{#if collection.selectMode}
|
|
26
26
|
{#if collection.isAllSelected}
|
|
27
|
-
<Button
|
|
27
|
+
<Button
|
|
28
|
+
variant="text"
|
|
29
|
+
size="sm"
|
|
30
|
+
icon={SquareMinus}
|
|
31
|
+
onclick={() => (collection.selected = [])}
|
|
32
|
+
>
|
|
33
|
+
Deselect All
|
|
34
|
+
</Button>
|
|
28
35
|
{:else}
|
|
29
|
-
<Button variant="text" icon={SquareCheck} onclick={collection.selectAll}>
|
|
36
|
+
<Button variant="text" size="sm" icon={SquareCheck} onclick={collection.selectAll}>
|
|
30
37
|
{t__('common.select_all')}
|
|
31
38
|
</Button>
|
|
32
39
|
{/if}
|
|
33
|
-
<Button
|
|
40
|
+
<Button
|
|
41
|
+
disabled={selectedCount === 0}
|
|
42
|
+
size="sm"
|
|
43
|
+
icon={Trash}
|
|
44
|
+
variant="text"
|
|
45
|
+
onclick={collection.deleteSelection}
|
|
46
|
+
>
|
|
34
47
|
{t__('common.delete', `${selectedCount} doc${pluralSuffix}`)}
|
|
35
48
|
</Button>
|
|
36
49
|
{/if}
|
|
@@ -1,15 +1,48 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { CollectionContext } from '../../../../context/collection.svelte.js';
|
|
3
3
|
import Empty from '../Empty.svelte';
|
|
4
|
+
import Folder from '../folder/FolderWithActions.svelte';
|
|
4
5
|
import Row from './row/Row.svelte';
|
|
5
|
-
|
|
6
6
|
type Props = { collection: CollectionContext };
|
|
7
7
|
const { collection }: Props = $props();
|
|
8
|
+
|
|
9
|
+
const documents = $derived.by(() => {
|
|
10
|
+
return collection.isUpload
|
|
11
|
+
? collection.docs.filter((doc) => doc._path === collection.upload.currentPath)
|
|
12
|
+
: collection.docs;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
function onDeleteFolder(path: string) {
|
|
16
|
+
collection.upload.directories = collection.upload.directories.filter((dir) => dir.id !== path);
|
|
17
|
+
}
|
|
8
18
|
</script>
|
|
9
19
|
|
|
10
20
|
{#if collection.docs.length}
|
|
11
21
|
<div class="rz-page-collection__list">
|
|
12
|
-
|
|
22
|
+
<!-- Parent directory -->
|
|
23
|
+
{#if collection.isUpload && collection.upload.parentDirectory && !collection.isFiltered}
|
|
24
|
+
<Folder
|
|
25
|
+
onDocumentDrop={() => {}}
|
|
26
|
+
folder={{ ...collection.upload.parentDirectory, name: '...' }}
|
|
27
|
+
display="list"
|
|
28
|
+
collection={collection.config}
|
|
29
|
+
/>
|
|
30
|
+
{/if}
|
|
31
|
+
|
|
32
|
+
{#if !collection.isFiltered && collection.isUpload}
|
|
33
|
+
{#each collection.upload.directories as folder (folder.id)}
|
|
34
|
+
<Folder
|
|
35
|
+
draggable="true"
|
|
36
|
+
onDocumentDrop={() => {}}
|
|
37
|
+
{folder}
|
|
38
|
+
collection={collection.config}
|
|
39
|
+
display="list"
|
|
40
|
+
onDelete={onDeleteFolder}
|
|
41
|
+
/>
|
|
42
|
+
{/each}
|
|
43
|
+
{/if}
|
|
44
|
+
|
|
45
|
+
{#each documents as doc, index (index)}
|
|
13
46
|
{@const checked = collection.selected.includes(doc.id)}
|
|
14
47
|
<Row {doc} {checked} />
|
|
15
48
|
{/each}
|
|
@@ -204,13 +204,19 @@
|
|
|
204
204
|
</Dialog.Root>
|
|
205
205
|
</form>
|
|
206
206
|
|
|
207
|
-
<style
|
|
208
|
-
|
|
207
|
+
<style>/**************************************/
|
|
208
|
+
|
|
209
|
+
/* Font */
|
|
210
|
+
|
|
211
|
+
/**************************************/
|
|
212
|
+
|
|
213
|
+
.rz-document {
|
|
209
214
|
container: rz-document / inline-size;
|
|
210
215
|
min-height: 100vh;
|
|
211
216
|
position: relative;
|
|
212
217
|
}
|
|
213
|
-
|
|
218
|
+
|
|
219
|
+
.rz-document__fields {
|
|
214
220
|
display: grid;
|
|
215
221
|
gap: var(--rz-size-4);
|
|
216
222
|
min-height: calc(100vh - var(--rz-size-14));
|
|
@@ -220,17 +226,18 @@
|
|
|
220
226
|
padding: var(--rz-size-5) var(--rz-page-gutter);
|
|
221
227
|
padding-bottom: var(--rz-size-24);
|
|
222
228
|
}
|
|
223
|
-
|
|
229
|
+
|
|
230
|
+
.rz-document__infos {
|
|
224
231
|
border-top: var(--rz-border);
|
|
225
|
-
padding-
|
|
226
|
-
padding-
|
|
227
|
-
padding-top: var(--rz-size-6);
|
|
228
|
-
padding-bottom: var(--rz-size-6);
|
|
232
|
+
padding-inline: var(--rz-page-gutter);
|
|
233
|
+
padding-block: var(--rz-size-6);
|
|
229
234
|
}
|
|
230
|
-
|
|
235
|
+
|
|
236
|
+
.rz-document__metas {
|
|
231
237
|
font-size: var(--rz-text-xs);
|
|
232
238
|
}
|
|
233
|
-
|
|
239
|
+
|
|
240
|
+
.rz-document__metas span {
|
|
234
241
|
font-variation-settings: 'wght' 600;
|
|
235
242
|
font-weight: 600;
|
|
236
243
|
}
|
|
@@ -105,20 +105,25 @@
|
|
|
105
105
|
{/if}
|
|
106
106
|
</div>
|
|
107
107
|
|
|
108
|
-
<style
|
|
109
|
-
|
|
108
|
+
<style>/**************************************/
|
|
109
|
+
|
|
110
|
+
/* Font */
|
|
111
|
+
|
|
112
|
+
/**************************************/
|
|
113
|
+
|
|
114
|
+
.rz-doc-upload-header {
|
|
110
115
|
container: inline-size;
|
|
111
116
|
padding: 0 var(--rz-fields-padding);
|
|
112
117
|
}
|
|
113
118
|
|
|
114
|
-
|
|
119
|
+
.rz-doc-upload-header__file {
|
|
115
120
|
min-height: 250px;
|
|
116
121
|
border: var(--rz-border);
|
|
117
122
|
overflow: hidden;
|
|
118
123
|
border-radius: var(--radius-md);
|
|
119
124
|
}
|
|
120
125
|
|
|
121
|
-
|
|
126
|
+
.rz-doc-upload-header__preview {
|
|
122
127
|
width: 100%;
|
|
123
128
|
display: flex;
|
|
124
129
|
align-items: center;
|
|
@@ -131,7 +136,7 @@
|
|
|
131
136
|
border-top-left-radius: var(--rz-radius-md);
|
|
132
137
|
}
|
|
133
138
|
|
|
134
|
-
|
|
139
|
+
@container (min-width:28rem) {
|
|
135
140
|
.rz-doc-upload-header__file {
|
|
136
141
|
display: flex;
|
|
137
142
|
}
|
|
@@ -142,12 +147,11 @@
|
|
|
142
147
|
border-bottom-left-radius: var(--rz-radius-md);
|
|
143
148
|
}
|
|
144
149
|
.rz-doc-upload-header__info {
|
|
145
|
-
padding-
|
|
146
|
-
padding-right: var(--rz-size-8);
|
|
150
|
+
padding-inline: var(--rz-size-8);
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
153
|
|
|
150
|
-
|
|
154
|
+
.rz-doc-upload-header__prewiew-grid {
|
|
151
155
|
width: 100%;
|
|
152
156
|
height: 100%;
|
|
153
157
|
--dark: hsl(var(--rz-gray-11) / 1);
|
|
@@ -195,35 +199,37 @@
|
|
|
195
199
|
0 var(--half-size);
|
|
196
200
|
}
|
|
197
201
|
|
|
198
|
-
|
|
202
|
+
.rz-doc-upload-header__prewiew-grid img {
|
|
199
203
|
height: 100%;
|
|
200
204
|
width: 100%;
|
|
201
205
|
-o-object-fit: contain;
|
|
202
206
|
object-fit: contain;
|
|
203
207
|
}
|
|
204
208
|
|
|
205
|
-
|
|
209
|
+
.rz-doc-upload-header__info {
|
|
206
210
|
flex: 1;
|
|
207
211
|
font-size: var(--rz-text-sm);
|
|
208
|
-
padding-
|
|
209
|
-
padding-
|
|
210
|
-
padding-top: var(--rz-size-4);
|
|
211
|
-
padding-bottom: var(--rz-size-4);
|
|
212
|
+
padding-inline: var(--rz-size-4);
|
|
213
|
+
padding-block: var(--rz-size-4);
|
|
212
214
|
}
|
|
213
|
-
|
|
215
|
+
|
|
216
|
+
.rz-doc-upload-header__info h4 {
|
|
214
217
|
opacity: 0.4;
|
|
215
218
|
margin-bottom: var(--rz-size-1);
|
|
216
219
|
font-size: var(--rz-text-xs);
|
|
217
220
|
}
|
|
218
|
-
|
|
221
|
+
|
|
222
|
+
.rz-doc-upload-header__info a {
|
|
219
223
|
margin-bottom: var(--rz-size-3);
|
|
220
224
|
display: block;
|
|
221
225
|
text-decoration: underline;
|
|
222
226
|
}
|
|
223
|
-
|
|
227
|
+
|
|
228
|
+
.rz-doc-upload-header__info p {
|
|
224
229
|
margin-bottom: var(--rz-size-3);
|
|
225
230
|
}
|
|
226
|
-
|
|
231
|
+
|
|
232
|
+
.rz-doc-upload-header__prewiew-file {
|
|
227
233
|
display: flex;
|
|
228
234
|
flex-direction: column;
|
|
229
235
|
align-items: center;
|