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
|
@@ -27,12 +27,16 @@ export const buildWhereParam = ({ query, slug, db, locale, tables, configCtx })
|
|
|
27
27
|
const buildCondition = (conditionObject) => {
|
|
28
28
|
// Handle nested AND conditions
|
|
29
29
|
if ('and' in conditionObject && Array.isArray(conditionObject.and)) {
|
|
30
|
-
const subConditions = conditionObject.and
|
|
30
|
+
const subConditions = conditionObject.and
|
|
31
|
+
.map((condition) => buildCondition(condition))
|
|
32
|
+
.filter(Boolean);
|
|
31
33
|
return subConditions.length ? and(...subConditions) : false;
|
|
32
34
|
}
|
|
33
35
|
// Handle nested OR conditions
|
|
34
36
|
if ('or' in conditionObject && Array.isArray(conditionObject.or)) {
|
|
35
|
-
const subConditions = conditionObject.or
|
|
37
|
+
const subConditions = conditionObject.or
|
|
38
|
+
.map((condition) => buildCondition(condition))
|
|
39
|
+
.filter(Boolean);
|
|
36
40
|
return subConditions.length ? or(...subConditions) : false;
|
|
37
41
|
}
|
|
38
42
|
conditionObject = normalizedForVersion(conditionObject, slug);
|
|
@@ -130,7 +134,10 @@ export const buildWhereParam = ({ query, slug, db, locale, tables, configCtx })
|
|
|
130
134
|
return eq(table.id, '-1');
|
|
131
135
|
}
|
|
132
136
|
// Subquery of related document ids that match the property condition
|
|
133
|
-
const matchingRelatedIds = db
|
|
137
|
+
const matchingRelatedIds = db
|
|
138
|
+
.select({ id: relatedTable.id })
|
|
139
|
+
.from(relatedTable)
|
|
140
|
+
.where(relatedCondition);
|
|
134
141
|
const relsTable = getTable(`${slug}Rels`);
|
|
135
142
|
// Join relation rows to documents by matching the related id and the relation path
|
|
136
143
|
const ownersWithMatching = db
|
|
@@ -295,7 +302,8 @@ function getConditionMembers(obj) {
|
|
|
295
302
|
}
|
|
296
303
|
// Determine if we should handle versioned hierarchy fields
|
|
297
304
|
function shouldHandleVersionedHierarchyFields(slug, sqlColumn) {
|
|
298
|
-
return hasVersionsSuffix(slug) &&
|
|
305
|
+
return (hasVersionsSuffix(slug) &&
|
|
306
|
+
(sqlColumn === '_parent' || sqlColumn === '_position' || sqlColumn === '_path'));
|
|
299
307
|
}
|
|
300
308
|
// Normalize condition object for versioned collections
|
|
301
309
|
function normalizedForVersion(conditionObject, slug) {
|
|
@@ -14,8 +14,12 @@ export default function (slug) {
|
|
|
14
14
|
.toArray().length;
|
|
15
15
|
const collectionAPI = rime.collection(slug);
|
|
16
16
|
function buildSelect(params) {
|
|
17
|
-
const paramSelect = params.get(PARAMS.SELECT)
|
|
18
|
-
|
|
17
|
+
const paramSelect = params.get(PARAMS.SELECT)
|
|
18
|
+
? params.get(PARAMS.SELECT).split(',')
|
|
19
|
+
: undefined;
|
|
20
|
+
if (paramSelect &&
|
|
21
|
+
paramSelect.includes('title') &&
|
|
22
|
+
!paramSelect.includes(collectionAPI.config.asTitle)) {
|
|
19
23
|
paramSelect.push(collectionAPI.config.asTitle);
|
|
20
24
|
}
|
|
21
25
|
return paramSelect;
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
leave_confirm_text: 'Change that you made will be lost',
|
|
36
36
|
live_in_sync: 'Establishing connection with container',
|
|
37
37
|
newPassword: 'New password',
|
|
38
|
-
no_document: 'No $1
|
|
38
|
+
no_document: 'No $1 found',
|
|
39
39
|
or: 'or',
|
|
40
40
|
passwordResetLinkSent: 'An email has been sent to $1 with instructions to reset the password',
|
|
41
41
|
publish: 'publish',
|
|
@@ -7,5 +7,7 @@ export default {
|
|
|
7
7
|
delete_block: 'Supprimer le bloc',
|
|
8
8
|
create_one: 'Créer {un|une} $1',
|
|
9
9
|
generate_from: 'Générer à partir du champs $1',
|
|
10
|
-
get_data_from: 'Importer les données'
|
|
10
|
+
get_data_from: 'Importer les données',
|
|
11
|
+
filter_by_type: 'Filtrer par type',
|
|
12
|
+
all_types: 'Tous les types'
|
|
11
13
|
};
|
|
@@ -105,7 +105,10 @@
|
|
|
105
105
|
<Field.Label {config} for={path || config.name} />
|
|
106
106
|
|
|
107
107
|
<div class="rz-link-field__wrap">
|
|
108
|
-
<div
|
|
108
|
+
<div
|
|
109
|
+
class="rz-link-field__row"
|
|
110
|
+
style="--rz-corner-radius:{hasTarget ? 0 : 'var(--rz-radius-md)'}"
|
|
111
|
+
>
|
|
109
112
|
<!-- Type -->
|
|
110
113
|
{#if linkTypes.length === 1}
|
|
111
114
|
<Button class="rz-link__type-single" variant="secondary">
|
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { apiUrl } from '../../../../core/api/index.js';
|
|
3
3
|
import type { Directory } from '../../../../core/collections/upload/upload';
|
|
4
|
+
import { t__ } from '../../../../core/i18n/index.js';
|
|
4
5
|
import { withDirectoriesSuffix } from '../../../../core/naming.js';
|
|
5
|
-
import Folder from '../../../../panel/components/sections/collection/
|
|
6
|
+
import Folder from '../../../../panel/components/sections/collection/folder/Folder.svelte';
|
|
7
|
+
import Button from '../../../../panel/components/ui/button/button.svelte';
|
|
6
8
|
import CardDocument from '../../../../panel/components/ui/card-document/card-document.svelte';
|
|
7
|
-
import * as
|
|
9
|
+
import * as Dialog from '../../../../panel/components/ui/dialog/index.js';
|
|
10
|
+
import * as DropdownMenu from '../../../../panel/components/ui/dropdown-menu/index.js';
|
|
11
|
+
import Input from '../../../../panel/components/ui/input/input.svelte';
|
|
8
12
|
import { API_PROXY, getAPIProxyContext } from '../../../../panel/context/api-proxy.svelte.js';
|
|
9
13
|
import type { BuiltCollection, UploadDoc } from '../../../../types';
|
|
14
|
+
import { ListFilter, Search } from '@lucide/svelte';
|
|
10
15
|
|
|
11
16
|
type Props = { open: boolean; addValue: (item: string) => void; config: BuiltCollection };
|
|
12
17
|
let { open = $bindable(), addValue, config }: Props = $props();
|
|
13
18
|
|
|
14
19
|
let path = $state('root');
|
|
20
|
+
let searchValue = $state('');
|
|
21
|
+
let typeFilterValue = $state('');
|
|
22
|
+
let initialDocs = $state<UploadDoc[]>([]);
|
|
23
|
+
|
|
24
|
+
const isFiltered = $derived.by(() => {
|
|
25
|
+
return searchValue.trim() !== '' || typeFilterValue !== '';
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const encodedMime = $derived.by(() => {
|
|
29
|
+
if (typeFilterValue) {
|
|
30
|
+
return encodeURIComponent(typeFilterValue);
|
|
31
|
+
}
|
|
32
|
+
return '';
|
|
33
|
+
});
|
|
15
34
|
|
|
16
35
|
const parentPath = $derived.by(() => {
|
|
17
36
|
if (path.includes(':')) {
|
|
@@ -23,8 +42,21 @@
|
|
|
23
42
|
});
|
|
24
43
|
|
|
25
44
|
const filesURL = $derived.by(() => {
|
|
26
|
-
|
|
45
|
+
if (!isFiltered) {
|
|
46
|
+
return `${apiUrl(config.kebab)}?where[_path][equals]=${path}`;
|
|
47
|
+
} else {
|
|
48
|
+
if (typeFilterValue && searchValue.trim()) {
|
|
49
|
+
return `${apiUrl(config.kebab)}?where[and][0][mimeType][equals]=${encodedMime}&where[and][1][filename][like]=%${searchValue.trim()}%`;
|
|
50
|
+
} else if (typeFilterValue) {
|
|
51
|
+
return `${apiUrl(config.kebab)}?where[mimeType][equals]=${encodedMime}`;
|
|
52
|
+
} else if (searchValue.trim()) {
|
|
53
|
+
return `${apiUrl(config.kebab)}?where[filename][like]=%${searchValue.trim()}%`;
|
|
54
|
+
} else {
|
|
55
|
+
return `${apiUrl(config.kebab)}?where[_path][equals]=${path}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
27
58
|
});
|
|
59
|
+
|
|
28
60
|
const foldersURL = $derived.by(() => {
|
|
29
61
|
return `${apiUrl(withDirectoriesSuffix(config.kebab))}?where[parent][equals]=${path}`;
|
|
30
62
|
});
|
|
@@ -32,42 +64,115 @@
|
|
|
32
64
|
const APIProxy = getAPIProxyContext(API_PROXY.DOCUMENT);
|
|
33
65
|
let files = $derived(APIProxy.getRessource<{ docs: UploadDoc[] }>(filesURL));
|
|
34
66
|
let folders = $derived(APIProxy.getRessource<{ docs: Directory[] }>(foldersURL));
|
|
67
|
+
|
|
68
|
+
$effect(() => {
|
|
69
|
+
if (!initialDocs.length && files.data?.docs.length) {
|
|
70
|
+
initialDocs = files.data.docs;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const fileTypes = $derived.by(() => {
|
|
75
|
+
if (initialDocs.length) {
|
|
76
|
+
const types = new Set(initialDocs.map((doc) => doc.mimeType));
|
|
77
|
+
return Array.from(types);
|
|
78
|
+
}
|
|
79
|
+
return [];
|
|
80
|
+
});
|
|
35
81
|
</script>
|
|
36
82
|
|
|
37
|
-
<
|
|
38
|
-
<
|
|
83
|
+
<Dialog.Root bind:open>
|
|
84
|
+
<Dialog.Content size="xl">
|
|
39
85
|
<div class="rz-relation-browse">
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</button>
|
|
51
|
-
{/each}
|
|
52
|
-
{/if}
|
|
86
|
+
<!-- Header -->
|
|
87
|
+
<div class="rz-relation-browse__header">
|
|
88
|
+
<!-- -->
|
|
89
|
+
<Input
|
|
90
|
+
icon={Search}
|
|
91
|
+
class="rz-header-search-input__input"
|
|
92
|
+
placeholder={t__('common.search', `${initialDocs.length || 0} document(s)`)}
|
|
93
|
+
type="text"
|
|
94
|
+
bind:value={searchValue}
|
|
95
|
+
/>
|
|
53
96
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
97
|
+
<DropdownMenu.Root>
|
|
98
|
+
<DropdownMenu.Trigger disabled={fileTypes.length <= 1}>
|
|
99
|
+
{#snippet child({ props })}
|
|
100
|
+
<Button variant="secondary" icon={ListFilter} {...props}>
|
|
101
|
+
{typeFilterValue || t__('fields.all_types')}
|
|
102
|
+
</Button>
|
|
103
|
+
{/snippet}
|
|
104
|
+
</DropdownMenu.Trigger>
|
|
105
|
+
|
|
106
|
+
<!-- <DropdownMenu.Portal> -->
|
|
107
|
+
<DropdownMenu.Content class="rz-link__type-content" align="start">
|
|
108
|
+
<DropdownMenu.Item onclick={() => (typeFilterValue = '')}>
|
|
109
|
+
{t__('fields.all_types')}
|
|
110
|
+
</DropdownMenu.Item>
|
|
111
|
+
{#each fileTypes as type, index (index)}
|
|
112
|
+
<DropdownMenu.Item onclick={() => (typeFilterValue = type)}>
|
|
113
|
+
{type}
|
|
114
|
+
</DropdownMenu.Item>
|
|
115
|
+
{/each}
|
|
116
|
+
</DropdownMenu.Content>
|
|
117
|
+
<!-- </DropdownMenu.Portal> -->
|
|
118
|
+
</DropdownMenu.Root>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- Grid -->
|
|
122
|
+
<div class="rz-relation-browse__grid">
|
|
123
|
+
{#if parentPath}
|
|
124
|
+
<button class="rz-browse__folder" onclick={() => (path = parentPath)}>
|
|
125
|
+
<Folder>...</Folder>
|
|
58
126
|
</button>
|
|
59
|
-
{/
|
|
60
|
-
|
|
127
|
+
{/if}
|
|
128
|
+
|
|
129
|
+
{#if !isFiltered}
|
|
130
|
+
{#if folders.data}
|
|
131
|
+
{#each folders.data.docs as doc (doc.id)}
|
|
132
|
+
<button class="rz-browse__folder" onclick={() => (path = doc.id)}>
|
|
133
|
+
<Folder>{doc.name}</Folder>
|
|
134
|
+
</button>
|
|
135
|
+
{/each}
|
|
136
|
+
{/if}
|
|
137
|
+
{/if}
|
|
138
|
+
|
|
139
|
+
{#if files.data}
|
|
140
|
+
{#each files.data.docs as doc (doc.id)}
|
|
141
|
+
<button onclick={() => addValue(doc.id)}>
|
|
142
|
+
<CardDocument {doc} />
|
|
143
|
+
</button>
|
|
144
|
+
{/each}
|
|
145
|
+
{/if}
|
|
146
|
+
</div>
|
|
61
147
|
</div>
|
|
62
|
-
</
|
|
63
|
-
</
|
|
148
|
+
</Dialog.Content>
|
|
149
|
+
</Dialog.Root>
|
|
64
150
|
|
|
65
151
|
<style>
|
|
66
|
-
.rz-relation-
|
|
152
|
+
.rz-relation-browse__header {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: var(--rz-size-4);
|
|
156
|
+
padding-bottom: var(--rz-size-4);
|
|
157
|
+
border-bottom: var(--rz-border);
|
|
158
|
+
margin-bottom: var(--rz-size-4);
|
|
159
|
+
|
|
160
|
+
:global {
|
|
161
|
+
.rz-dropdown-item {
|
|
162
|
+
padding: var(--rz-size-3) var(--rz-size-3);
|
|
163
|
+
}
|
|
164
|
+
.rz-input {
|
|
165
|
+
height: var(--rz-size-9);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.rz-relation-browse__grid {
|
|
67
171
|
display: grid;
|
|
172
|
+
align-self: start;
|
|
68
173
|
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
174
|
+
grid-auto-rows: auto;
|
|
69
175
|
gap: var(--rz-size-4);
|
|
70
|
-
padding: var(--rz-size-4);
|
|
71
176
|
}
|
|
72
177
|
|
|
73
178
|
.rz-browse__folder {
|
|
@@ -153,8 +153,13 @@
|
|
|
153
153
|
<Field.Hint {config} />
|
|
154
154
|
</fieldset>
|
|
155
155
|
|
|
156
|
-
<style
|
|
157
|
-
|
|
156
|
+
<style>/**************************************/
|
|
157
|
+
|
|
158
|
+
/* Font */
|
|
159
|
+
|
|
160
|
+
/**************************************/
|
|
161
|
+
|
|
162
|
+
.rz-select {
|
|
158
163
|
margin-bottom: var(--rz-size-2);
|
|
159
164
|
position: relative;
|
|
160
165
|
|
|
@@ -184,7 +189,7 @@
|
|
|
184
189
|
}
|
|
185
190
|
}
|
|
186
191
|
|
|
187
|
-
|
|
192
|
+
.rz-select__list {
|
|
188
193
|
background-color: hsl(var(--rz-input-bg));
|
|
189
194
|
border: var(--rz-border);
|
|
190
195
|
border-radius: var(--rz-radius-md);
|
|
@@ -195,19 +200,19 @@
|
|
|
195
200
|
padding: var(--rz-size-2) var(--rz-size-3);
|
|
196
201
|
}
|
|
197
202
|
|
|
198
|
-
|
|
203
|
+
.rz-select__list[data-focused] {
|
|
199
204
|
box-shadow:
|
|
200
205
|
0 0 0 var(--rz-ring-offset, 0px) hsl(var(--rz-ring-offset-bg, var(--rz-gray-6)) / 1),
|
|
201
206
|
0 0 0 calc(var(--rz-ring-offset, 0px) + 1px) hsl(var(--rz-color-ring) / var(--rz-ring-opacity, 1));
|
|
202
207
|
}
|
|
203
208
|
|
|
204
|
-
|
|
209
|
+
.rz-select__list[data-error] {
|
|
205
210
|
box-shadow:
|
|
206
211
|
0 0 0 var(--rz-ring-offset, 0px) hsl(var(--rz-ring-offset-bg, var(--rz-gray-6)) / 1),
|
|
207
212
|
0 0 0 calc(var(--rz-ring-offset, 0px) + 1px) hsl(var(--rz-color-alert) / var(--rz-ring-opacity, 1));
|
|
208
213
|
}
|
|
209
214
|
|
|
210
|
-
|
|
215
|
+
.rz-select__list--readonly {
|
|
211
216
|
cursor: no-drop;
|
|
212
217
|
}
|
|
213
218
|
</style>
|
|
@@ -60,20 +60,25 @@
|
|
|
60
60
|
<Field.Label {config} for={path || config.name} />
|
|
61
61
|
|
|
62
62
|
<div class="rz-slug">
|
|
63
|
-
<Hash class="rz-slug__icon" size="14" />
|
|
64
|
-
|
|
65
63
|
<Input
|
|
66
64
|
id={path || config.name}
|
|
67
65
|
placeholder={config.placeholder}
|
|
68
66
|
data-error={field.error ? '' : null}
|
|
69
67
|
type="text"
|
|
68
|
+
icon={Hash}
|
|
70
69
|
value={field.value}
|
|
71
70
|
name={path || config.name}
|
|
72
71
|
oninput={onInput}
|
|
73
72
|
/>
|
|
74
73
|
|
|
75
74
|
{#if config.slugify}
|
|
76
|
-
<Button
|
|
75
|
+
<Button
|
|
76
|
+
disabled={!field.editable}
|
|
77
|
+
onclick={generateFromField}
|
|
78
|
+
type="button"
|
|
79
|
+
size="sm"
|
|
80
|
+
variant="secondary"
|
|
81
|
+
>
|
|
77
82
|
{t__('fields.generate_from', config.slugify)}
|
|
78
83
|
</Button>
|
|
79
84
|
{/if}
|
|
@@ -88,7 +93,6 @@
|
|
|
88
93
|
|
|
89
94
|
:global(.rz-input) {
|
|
90
95
|
font-family: var(--rz-font-mono);
|
|
91
|
-
padding: 0 0 0 2rem;
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
:global(.rz-button) {
|
|
@@ -28,8 +28,13 @@
|
|
|
28
28
|
<Field.Hint {config} />
|
|
29
29
|
</fieldset>
|
|
30
30
|
|
|
31
|
-
<style
|
|
32
|
-
|
|
31
|
+
<style>/**************************************/
|
|
32
|
+
|
|
33
|
+
/* Font */
|
|
34
|
+
|
|
35
|
+
/**************************************/
|
|
36
|
+
|
|
37
|
+
textarea {
|
|
33
38
|
field-sizing: content;
|
|
34
39
|
border: 1px solid var(--rz-input-border-color);
|
|
35
40
|
background-color: hsl(var(--rz-input-bg));
|
|
@@ -38,10 +43,8 @@
|
|
|
38
43
|
border-radius: var(--rz-radius-md);
|
|
39
44
|
line-height: 1.5em;
|
|
40
45
|
min-height: var(--rz-size-20);
|
|
41
|
-
padding-
|
|
42
|
-
padding-
|
|
43
|
-
padding-top: var(--rz-size-2);
|
|
44
|
-
padding-bottom: var(--rz-size-2);
|
|
46
|
+
padding-inline: var(--rz-size-3);
|
|
47
|
+
padding-block: var(--rz-size-2);
|
|
45
48
|
|
|
46
49
|
&:global([data-error]) {
|
|
47
50
|
outline: none;
|
|
@@ -51,18 +54,20 @@
|
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
textarea:disabled {
|
|
55
58
|
opacity: 0.5;
|
|
56
59
|
cursor: not-allowed;
|
|
57
60
|
}
|
|
58
|
-
|
|
61
|
+
|
|
62
|
+
textarea::-moz-placeholder {
|
|
59
63
|
color: hsl(var(--rz-color-fg) / 0.5);
|
|
60
64
|
}
|
|
61
|
-
|
|
65
|
+
|
|
66
|
+
textarea::placeholder {
|
|
62
67
|
color: hsl(var(--rz-color-fg) / 0.5);
|
|
63
68
|
}
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
textarea:focus-visible {
|
|
66
71
|
outline: none;
|
|
67
72
|
/* --rz-ring-offset: 1px; */
|
|
68
73
|
box-shadow:
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import type { ToggleProps } from './props';
|
|
7
7
|
|
|
8
8
|
const { path, config, form }: ToggleProps = $props();
|
|
9
|
-
|
|
10
9
|
const field = $derived(form.useField<boolean>(path, config));
|
|
11
10
|
const inputId = slugify(`${form.key}-${path}`);
|
|
12
11
|
|
|
@@ -17,7 +16,12 @@
|
|
|
17
16
|
|
|
18
17
|
<fieldset class="rz-toggle-field {config.className || ''}" use:root={field}>
|
|
19
18
|
<div class="rz-toggle-field-wrap">
|
|
20
|
-
<Switch
|
|
19
|
+
<Switch
|
|
20
|
+
data-error={field.error ? '' : null}
|
|
21
|
+
checked={field.value}
|
|
22
|
+
{onCheckedChange}
|
|
23
|
+
id={inputId}
|
|
24
|
+
/>
|
|
21
25
|
<Field.LabelFor {config} for={inputId} />
|
|
22
26
|
</div>
|
|
23
27
|
<Field.Hint {config} />
|
|
@@ -28,13 +32,13 @@
|
|
|
28
32
|
display: flex;
|
|
29
33
|
align-items: center;
|
|
30
34
|
}
|
|
35
|
+
|
|
31
36
|
.rz-toggle-field-wrap > :global(* + *) {
|
|
32
37
|
margin-left: var(--rz-size-2);
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
.rz-toggle-field {
|
|
36
|
-
margin-
|
|
37
|
-
margin-bottom: var(--rz-size-3);
|
|
41
|
+
margin-block: var(--rz-size-3);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
.rz-toggle-field :global {
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
// subfield::error
|
|
11
11
|
const cleanError = error.split('::').at(-1) ?? '';
|
|
12
12
|
// If it's a predefined error from RimeError or RimeFormError
|
|
13
|
-
if (
|
|
13
|
+
if (
|
|
14
|
+
Object.values(RimeError).includes(cleanError) ||
|
|
15
|
+
Object.values(RimeFormError).includes(cleanError)
|
|
16
|
+
) {
|
|
14
17
|
return t__(`errors.${cleanError}`);
|
|
15
18
|
}
|
|
16
19
|
// Otherwise return as-is (user defined message)
|
|
@@ -24,8 +27,13 @@
|
|
|
24
27
|
</div>
|
|
25
28
|
{/if}
|
|
26
29
|
|
|
27
|
-
<style
|
|
28
|
-
|
|
30
|
+
<style>/**************************************/
|
|
31
|
+
|
|
32
|
+
/* Font */
|
|
33
|
+
|
|
34
|
+
/**************************************/
|
|
35
|
+
|
|
36
|
+
.rz-field-error {
|
|
29
37
|
color: hsl(var(--rz-ground-6) / 1);
|
|
30
38
|
background-color: hsl(var(--rz-color-alert));
|
|
31
39
|
position: absolute;
|
|
@@ -33,10 +41,8 @@
|
|
|
33
41
|
top: 0;
|
|
34
42
|
border-radius: var(--rz-radius-sm);
|
|
35
43
|
font-size: var(--rz-text-xs);
|
|
36
|
-
padding-
|
|
37
|
-
padding-
|
|
38
|
-
padding-top: var(--rz-size-0-5);
|
|
39
|
-
padding-bottom: var(--rz-size-0-5);
|
|
44
|
+
padding-inline: var(--rz-size-1);
|
|
45
|
+
padding-block: var(--rz-size-0-5);
|
|
40
46
|
font-variation-settings: 'wght' 500;
|
|
41
47
|
font-weight: 500;
|
|
42
48
|
}
|
|
@@ -29,13 +29,18 @@
|
|
|
29
29
|
{@render children()}
|
|
30
30
|
</h3>
|
|
31
31
|
|
|
32
|
-
<style
|
|
33
|
-
|
|
32
|
+
<style>/**************************************/
|
|
33
|
+
|
|
34
|
+
/* Font */
|
|
35
|
+
|
|
36
|
+
/**************************************/
|
|
37
|
+
|
|
38
|
+
:root {
|
|
34
39
|
--rz-folder-light: light-dark(hsl(var(--rz-gray-12)), hsl(var(--rz-gray-6)));
|
|
35
40
|
--rz-folder-dark: light-dark(hsl(var(--rz-gray-10)), hsl(var(--rz-gray-4)));
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
h3 {
|
|
39
44
|
font-variation-settings: 'wght' 600;
|
|
40
45
|
font-weight: 600;
|
|
41
46
|
overflow: hidden;
|
|
@@ -46,14 +51,17 @@
|
|
|
46
51
|
text-align: center;
|
|
47
52
|
margin-block: var(--rz-size-3);
|
|
48
53
|
}
|
|
49
|
-
|
|
54
|
+
|
|
55
|
+
.rz-folder-svg {
|
|
50
56
|
aspect-ratio: 5 / 4;
|
|
51
57
|
width: 100%;
|
|
52
58
|
}
|
|
53
|
-
|
|
59
|
+
|
|
60
|
+
.rz-folder-svg path:first-child {
|
|
54
61
|
fill: var(--rz-folder-dark);
|
|
55
62
|
}
|
|
56
|
-
|
|
63
|
+
|
|
64
|
+
.rz-folder-svg path:last-child {
|
|
57
65
|
fill: var(--rz-folder-light);
|
|
58
66
|
}
|
|
59
67
|
</style>
|
package/dist/panel/components/sections/collection/{grid/grid-item → folder}/FolderEdit.svelte
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { Directory } from '
|
|
3
|
-
import type { BuiltCollectionClient } from '
|
|
4
|
-
import { t__ } from '
|
|
5
|
-
import { withDirectoriesSuffix } from '
|
|
6
|
-
import RenderFields from '
|
|
7
|
-
import Button from '
|
|
8
|
-
import * as Dialog from '
|
|
9
|
-
import { API_PROXY, setAPIProxyContext } from '
|
|
10
|
-
import { getConfigContext } from '
|
|
11
|
-
import { setDocumentFormContext } from '
|
|
12
|
-
import { getUserContext } from '
|
|
2
|
+
import type { Directory } from '../../../../../core/collections/upload/upload';
|
|
3
|
+
import type { BuiltCollectionClient } from '../../../../../core/config/types';
|
|
4
|
+
import { t__ } from '../../../../../core/i18n/index.js';
|
|
5
|
+
import { withDirectoriesSuffix } from '../../../../../core/naming';
|
|
6
|
+
import RenderFields from '../../../fields/RenderFields.svelte';
|
|
7
|
+
import Button from '../../../ui/button/button.svelte';
|
|
8
|
+
import * as Dialog from '../../../ui/dialog/index.js';
|
|
9
|
+
import { API_PROXY, setAPIProxyContext } from '../../../../context/api-proxy.svelte.js';
|
|
10
|
+
import { getConfigContext } from '../../../../context/config.svelte.js';
|
|
11
|
+
import { setDocumentFormContext } from '../../../../context/documentForm.svelte.js';
|
|
12
|
+
import { getUserContext } from '../../../../context/user.svelte.js';
|
|
13
13
|
|
|
14
14
|
type Props = {
|
|
15
15
|
open: boolean;
|
package/dist/panel/components/sections/collection/{grid/grid-item → folder}/FolderEdit.svelte.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Directory } from '
|
|
2
|
-
import type { BuiltCollectionClient } from '
|
|
1
|
+
import type { Directory } from '../../../../../core/collections/upload/upload';
|
|
2
|
+
import type { BuiltCollectionClient } from '../../../../../core/config/types';
|
|
3
3
|
type Props = {
|
|
4
4
|
open: boolean;
|
|
5
5
|
folder: Directory;
|