rimecms 0.25.0 → 0.25.1
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/core/operations/hooks/before-read/set-document-title.server.js +1 -1
- package/dist/fields/blocks/component/Block.svelte +1 -1
- package/dist/fields/blocks/component/Block.svelte.d.ts +1 -1
- package/dist/fields/blocks/component/props.d.ts +1 -1
- package/dist/fields/combobox/component/props.d.ts +1 -1
- package/dist/fields/date/component/Date.svelte +8 -4
- package/dist/fields/date/component/Date.svelte.d.ts +1 -1
- package/dist/fields/email/component/props.d.ts +1 -1
- package/dist/fields/group/component/Group.svelte +1 -1
- package/dist/fields/link/component/RessourceInput.svelte +1 -1
- package/dist/fields/relation/component/Relation.svelte +1 -1
- package/dist/fields/relation/component/upload/Browse.svelte +1 -1
- package/dist/fields/rich-text/component/props.d.ts +1 -1
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +23 -5
- package/dist/fields/rich-text/core/features/resource/resource.svelte +1 -1
- package/dist/fields/rich-text/core/features/upload/upload.svelte +10 -3
- package/dist/fields/rich-text/core/render-rich-text.svelte +1 -1
- package/dist/fields/rich-text/core/render-rich-text.svelte.d.ts +1 -1
- package/dist/fields/select/component/props.d.ts +1 -1
- package/dist/fields/text/component/props.d.ts +1 -1
- package/dist/fields/textarea/component/props.d.ts +2 -2
- package/dist/fields/time/component/props.d.ts +1 -1
- package/dist/panel/components/fields/RenderFields.svelte +2 -2
- package/dist/panel/components/fields/RenderFields.svelte.d.ts +1 -1
- package/dist/panel/components/sections/collection/grid/grid-item/FolderEdit.svelte +7 -7
- package/dist/panel/components/sections/collection/header/create-folder/CreateFolder.svelte +5 -5
- package/dist/panel/components/sections/document/AuthFooter.svelte +2 -2
- package/dist/panel/components/sections/document/AuthFooter.svelte.d.ts +1 -1
- package/dist/panel/components/sections/document/ButtonStatus.svelte +1 -1
- package/dist/panel/components/sections/document/ButtonStatus.svelte.d.ts +1 -1
- package/dist/panel/components/sections/document/Document.svelte +4 -4
- package/dist/panel/components/sections/document/FloatingUI.svelte +4 -2
- package/dist/panel/components/sections/document/FloatingUI.svelte.d.ts +1 -1
- package/dist/panel/components/sections/document/Header.svelte +1 -1
- package/dist/panel/components/sections/document/Header.svelte.d.ts +1 -1
- package/dist/panel/components/sections/document/Settings.svelte +1 -1
- package/dist/panel/components/sections/document/Settings.svelte.d.ts +1 -1
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +1 -1
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte.d.ts +1 -1
- package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte +39 -34
- package/dist/panel/components/ui/nav/Nav.svelte +7 -2
- package/dist/panel/components/ui/nav/NavItem.svelte +3 -2
- package/dist/panel/components/ui/nav/UserButton.svelte +4 -4
- package/dist/panel/context/documentForm.svelte.js +1 -1
- package/dist/panel/context/locale.svelte.js +1 -1
- package/dist/panel/pages/collection/Collection.svelte +1 -1
- package/dist/panel/pages/collection-document/CollectionDocument.svelte +2 -2
- package/dist/panel/pages/dashboard/Dashboard.svelte +8 -8
- package/dist/panel/pages/dashboard/Dashboard.svelte.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { richTextJSONToText } from '../../../../fields/rich-text/index.js';
|
|
1
2
|
import { getValueAtPath, isObjectLiteral } from '../../../../util/object.js';
|
|
2
|
-
import { richTextJSONToText } from '../../../../fields/rich-text/client.js';
|
|
3
3
|
import { Hooks } from '../index.server.js';
|
|
4
4
|
export const setDocumentTitle = Hooks.beforeRead(async (args) => {
|
|
5
5
|
const config = args.config;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { GenericBlock } from '../../../core/types/doc.js';
|
|
3
3
|
import type { BlocksFieldBlock } from '../../types';
|
|
4
4
|
import RenderFields from '../../../panel/components/fields/RenderFields.svelte';
|
|
5
|
-
import { type DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
5
|
+
import { type DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
6
6
|
import { useOnce } from '../../../panel/util/once.svelte.js';
|
|
7
7
|
import { capitalize } from '../../../util/string.js';
|
|
8
8
|
import { GripVertical, ToyBrick } from '@lucide/svelte';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlocksFieldBlock } from '../../types';
|
|
2
|
-
import { type DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
2
|
+
import { type DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
3
3
|
type Props = {
|
|
4
4
|
config: BlocksFieldBlock;
|
|
5
5
|
path: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
1
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
2
2
|
import type { BlocksField } from '../index.js';
|
|
3
3
|
export type BlocksProps = {
|
|
4
4
|
path: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
1
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
2
2
|
import type { ComboBoxField } from '../index.js';
|
|
3
3
|
export type ComboBoxProps = {
|
|
4
4
|
path: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Button } from '../../../panel/components/ui/button/index.js';
|
|
5
5
|
import { Calendar } from '../../../panel/components/ui/calendar/index.js';
|
|
6
6
|
import * as Dialog from '../../../panel/components/ui/dialog/index.js';
|
|
7
|
-
import { type DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
7
|
+
import { type DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
8
8
|
import { getLocaleContext } from '../../../panel/context/locale.svelte';
|
|
9
9
|
import { CalendarDate, getLocalTimeZone, type DateValue } from '@internationalized/date';
|
|
10
10
|
import { Calendar as CalendarIcon } from '@lucide/svelte';
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
</script>
|
|
49
49
|
|
|
50
50
|
<fieldset class="rz-date-field {config.className || ''}" use:root={field}>
|
|
51
|
-
<Field.Label {config} for={path ||
|
|
51
|
+
<Field.Label {config} for={path || config.name} />
|
|
52
52
|
|
|
53
53
|
<Button
|
|
54
54
|
id="foo"
|
|
@@ -65,7 +65,12 @@
|
|
|
65
65
|
|
|
66
66
|
<Dialog.Root bind:open={dialogOpen}>
|
|
67
67
|
<Dialog.Content size="sm" class="rz-date__dialog-content">
|
|
68
|
-
<Calendar
|
|
68
|
+
<Calendar
|
|
69
|
+
type="single"
|
|
70
|
+
value={calendarDate}
|
|
71
|
+
onValueChange={handleCalendarChange}
|
|
72
|
+
initialFocus
|
|
73
|
+
/>
|
|
69
74
|
</Dialog.Content>
|
|
70
75
|
</Dialog.Root>
|
|
71
76
|
<Field.Hint {config} />
|
|
@@ -77,7 +82,6 @@
|
|
|
77
82
|
.rz-dialog-content.rz-date__dialog-content {
|
|
78
83
|
width: 100px;
|
|
79
84
|
padding: 12rem;
|
|
80
|
-
|
|
81
85
|
}
|
|
82
86
|
.rz-date__button.rz-button {
|
|
83
87
|
width: 200px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SimplerField } from '../../types.js';
|
|
2
|
-
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
2
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
3
3
|
import type { FormContext } from '../../../panel/context/form.svelte.js';
|
|
4
4
|
import type { EmailField } from '../index.js';
|
|
5
5
|
export interface EmailFieldProps {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import FieldsPreviewTrigger from '../../../panel/components/fields/FieldsPreviewTrigger.svelte';
|
|
9
9
|
import RenderFields from '../../../panel/components/fields/RenderFields.svelte';
|
|
10
10
|
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
11
|
-
import { getUserContext } from '../../../panel/context/user.svelte';
|
|
11
|
+
import { getUserContext } from '../../../panel/context/user.svelte.js';
|
|
12
12
|
import { ChevronDown, FolderClosed, FolderOpen } from '@lucide/svelte';
|
|
13
13
|
import { onMount } from 'svelte';
|
|
14
14
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { GenericDoc } from '../../../core/types/doc.js';
|
|
5
5
|
import * as Command from '../../../panel/components/ui/command/index.js';
|
|
6
6
|
import Tag from '../../../panel/components/ui/tag/tag.svelte';
|
|
7
|
-
import { API_PROXY, getAPIProxyContext } from '../../../panel/context/api-proxy.svelte';
|
|
7
|
+
import { API_PROXY, getAPIProxyContext } from '../../../panel/context/api-proxy.svelte.js';
|
|
8
8
|
import type { PrototypeSlug } from '../../../types';
|
|
9
9
|
import { toKebabCase } from '../../../util/string';
|
|
10
10
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Field } from '../../../panel/components/fields/index.js';
|
|
6
6
|
import { root } from '../../../panel/components/fields/root.svelte.js';
|
|
7
7
|
import { getCollectionContext } from '../../../panel/context/collection.svelte.js';
|
|
8
|
-
import { getConfigContext } from '../../../panel/context/config.svelte';
|
|
8
|
+
import { getConfigContext } from '../../../panel/context/config.svelte.js';
|
|
9
9
|
import { type DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
10
10
|
import { getLocaleContext } from '../../../panel/context/locale.svelte';
|
|
11
11
|
import { panelUrl } from '../../../panel/util/url.js';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import Folder from '../../../../panel/components/sections/collection/grid/grid-item/Folder.svelte';
|
|
6
6
|
import CardDocument from '../../../../panel/components/ui/card-document/card-document.svelte';
|
|
7
7
|
import * as Sheet from '../../../../panel/components/ui/sheet/index.js';
|
|
8
|
-
import { API_PROXY, getAPIProxyContext } from '../../../../panel/context/api-proxy.svelte';
|
|
8
|
+
import { API_PROXY, getAPIProxyContext } from '../../../../panel/context/api-proxy.svelte.js';
|
|
9
9
|
import type { BuiltCollection, UploadDoc } from '../../../../types';
|
|
10
10
|
|
|
11
11
|
type Props = { open: boolean; addValue: (item: string) => void; config: BuiltCollection };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
1
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
2
2
|
import type { RichTextField } from '../index.js';
|
|
3
3
|
export type RichTextFieldProps = {
|
|
4
4
|
class?: string;
|
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
import Button from '../../../../../../panel/components/ui/button/button.svelte';
|
|
7
7
|
import * as Command from '../../../../../../panel/components/ui/command/index.js';
|
|
8
8
|
import Input from '../../../../../../panel/components/ui/input/input.svelte';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
API_PROXY,
|
|
11
|
+
getAPIProxyContext,
|
|
12
|
+
type Resource
|
|
13
|
+
} from '../../../../../../panel/context/api-proxy.svelte.js';
|
|
10
14
|
import { getLocaleContext } from '../../../../../../panel/context/locale.svelte';
|
|
11
15
|
import validate from '../../../../../../util/validate.js';
|
|
12
16
|
import { CornerDownLeft, ExternalLink, Link2, Newspaper, Trash } from '@lucide/svelte';
|
|
@@ -16,7 +20,12 @@
|
|
|
16
20
|
import type { RichTextContext } from '../../../types';
|
|
17
21
|
import './link-selector.css';
|
|
18
22
|
|
|
19
|
-
type Props = {
|
|
23
|
+
type Props = {
|
|
24
|
+
options?: LinkFeatureOptions;
|
|
25
|
+
editor: Editor;
|
|
26
|
+
context: RichTextContext;
|
|
27
|
+
active: boolean;
|
|
28
|
+
};
|
|
20
29
|
type LinkResource = { title: string; url: string };
|
|
21
30
|
let { options, editor, context, active }: Props = $props();
|
|
22
31
|
|
|
@@ -36,7 +45,9 @@
|
|
|
36
45
|
$effect(() => {
|
|
37
46
|
if (Array.isArray(options?.resources) && !resources.length) {
|
|
38
47
|
resources = options.resources.map((resourceOption) => {
|
|
39
|
-
let params = resourceOption.query
|
|
48
|
+
let params = resourceOption.query
|
|
49
|
+
? `?${resourceOption.query}&select=title,url`
|
|
50
|
+
: '?select=title,url';
|
|
40
51
|
params = locale.code ? `${params}&locale=${locale.code}` : params;
|
|
41
52
|
const url = `${apiUrl(resourceOption.slug)}${params}`;
|
|
42
53
|
return APIProxy.getRessource<LinkResource[]>(url, {
|
|
@@ -189,7 +200,9 @@
|
|
|
189
200
|
<div class="rz-link-selector__button">
|
|
190
201
|
{#if editor.getAttributes('link').href}
|
|
191
202
|
<Button
|
|
192
|
-
--rz-button-ghost-fg={isTargetBlank
|
|
203
|
+
--rz-button-ghost-fg={isTargetBlank
|
|
204
|
+
? 'hsl(var(--rz-color-spot))'
|
|
205
|
+
: 'hsl(var(--rz-color-fg))'}
|
|
193
206
|
onclick={() => (isTargetBlank = !isTargetBlank)}
|
|
194
207
|
variant="ghost"
|
|
195
208
|
size="icon-sm"
|
|
@@ -198,7 +211,12 @@
|
|
|
198
211
|
<Button size="icon-sm" variant="ghost" icon={Trash} onclick={onDelete} />
|
|
199
212
|
{:else}
|
|
200
213
|
{#if options?.resources?.length}
|
|
201
|
-
<Button
|
|
214
|
+
<Button
|
|
215
|
+
onclick={() => (resourceDialogOpen = true)}
|
|
216
|
+
size="icon-sm"
|
|
217
|
+
icon={Newspaper}
|
|
218
|
+
variant="ghost"
|
|
219
|
+
/>
|
|
202
220
|
{/if}
|
|
203
221
|
<Button type="submit" variant="ghost" size="icon-sm" icon={CornerDownLeft}></Button>
|
|
204
222
|
{/if}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import Button from '../../../../../panel/components/ui/button/button.svelte';
|
|
5
5
|
import CardResource from '../../../../../panel/components/ui/card-resource/card-resource.svelte';
|
|
6
6
|
import * as Command from '../../../../../panel/components/ui/command/index.js';
|
|
7
|
-
import { API_PROXY, setAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte';
|
|
7
|
+
import { API_PROXY, setAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte.js';
|
|
8
8
|
import type { NodeViewProps } from '@tiptap/core';
|
|
9
9
|
import { onMount } from 'svelte';
|
|
10
10
|
import NodeViewWrapper from '../../svelte/node-view-wrapper.svelte';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import * as Command from '../../../../../panel/components/ui/command/index.js';
|
|
7
7
|
import * as Dialog from '../../../../../panel/components/ui/dialog/index.js';
|
|
8
8
|
import Input from '../../../../../panel/components/ui/input/input.svelte';
|
|
9
|
-
import { API_PROXY, setAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte';
|
|
9
|
+
import { API_PROXY, setAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte.js';
|
|
10
10
|
import { X } from '@lucide/svelte';
|
|
11
11
|
import type { NodeViewProps } from '@tiptap/core';
|
|
12
12
|
import { onMount } from 'svelte';
|
|
@@ -125,10 +125,17 @@
|
|
|
125
125
|
<NodeViewWrapper>
|
|
126
126
|
<div data-drag-handle class="rz-richtext-media" class:rz-richtext-media--selected={!!selected}>
|
|
127
127
|
{#if !selected}
|
|
128
|
-
<Button class="rz-richtext-media__add" variant="outline" onclick={handleClick}
|
|
128
|
+
<Button class="rz-richtext-media__add" variant="outline" onclick={handleClick}
|
|
129
|
+
>Add a media</Button
|
|
130
|
+
>
|
|
129
131
|
{:else}
|
|
130
132
|
<div class="rz-richtext-media__actions">
|
|
131
|
-
<Button
|
|
133
|
+
<Button
|
|
134
|
+
size="xs"
|
|
135
|
+
class="rz-richtext-media__button"
|
|
136
|
+
type="button"
|
|
137
|
+
onclick={() => (dialogLegendOpen = true)}
|
|
138
|
+
>
|
|
132
139
|
{legend || 'set legend'}
|
|
133
140
|
</Button>
|
|
134
141
|
<Button
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { JSONContent } from '@tiptap/core';
|
|
3
|
-
import type { RichTextNodeRenderer } from '../client.js';
|
|
4
3
|
import RenderRichText from './render-rich-text.svelte';
|
|
4
|
+
import type { RichTextNodeRenderer } from './types';
|
|
5
5
|
|
|
6
6
|
type Props = {
|
|
7
7
|
json?: JSONContent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JSONContent } from '@tiptap/core';
|
|
2
|
-
import type { RichTextNodeRenderer } from '../client.js';
|
|
3
2
|
import RenderRichText from './render-rich-text.svelte';
|
|
3
|
+
import type { RichTextNodeRenderer } from './types';
|
|
4
4
|
type Props = {
|
|
5
5
|
json?: JSONContent;
|
|
6
6
|
components?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
1
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
2
2
|
import type { SelectField } from '../index.js';
|
|
3
3
|
export type SelectFieldProps = {
|
|
4
4
|
path: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SimplerField } from '../../types.js';
|
|
2
|
-
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
2
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
3
3
|
import type { FormContext } from '../../../panel/context/form.svelte.js';
|
|
4
4
|
import type { IconProps } from '@lucide/svelte';
|
|
5
5
|
import type { Component } from 'svelte';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
2
|
-
import type { TextAreaField } from '../index.js';
|
|
1
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
3
2
|
import type { FormContext } from '../../../panel/context/form.svelte.js';
|
|
3
|
+
import type { TextAreaField } from '../index.js';
|
|
4
4
|
export type TextAreaFieldProps = {
|
|
5
5
|
path?: string;
|
|
6
6
|
config: TextAreaField;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte';
|
|
1
|
+
import type { DocumentFormContext } from '../../../panel/context/documentForm.svelte.js';
|
|
2
2
|
import type { TimeField } from '../index.js';
|
|
3
3
|
export type TimeFieldProps = {
|
|
4
4
|
path?: string;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import { ComponentFieldBuilder } from '../../../fields/component';
|
|
5
5
|
import { isTabsField } from '../../../fields/tabs';
|
|
6
6
|
import type { FormField } from '../../../fields/types.js';
|
|
7
|
-
import { type DocumentFormContext } from '../../context/documentForm.svelte';
|
|
8
|
-
import { getUserContext } from '../../context/user.svelte';
|
|
7
|
+
import { type DocumentFormContext } from '../../context/documentForm.svelte.js';
|
|
8
|
+
import { getUserContext } from '../../context/user.svelte.js';
|
|
9
9
|
import type { GenericDoc } from '../../../types';
|
|
10
10
|
import type { WithOptional } from '../../../util/types';
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FieldBuilder } from '../../../core/fields/builders';
|
|
2
|
-
import { type DocumentFormContext } from '../../context/documentForm.svelte';
|
|
2
|
+
import { type DocumentFormContext } from '../../context/documentForm.svelte.js';
|
|
3
3
|
import type { GenericDoc } from '../../../types';
|
|
4
4
|
import type { WithOptional } from '../../../util/types';
|
|
5
5
|
type Props = {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Directory } from '../../../../../../core/collections/upload/upload';
|
|
3
3
|
import type { BuiltCollectionClient } from '../../../../../../core/config/types';
|
|
4
|
+
import { t__ } from '../../../../../../core/i18n/index.js';
|
|
4
5
|
import { withDirectoriesSuffix } from '../../../../../../core/naming';
|
|
6
|
+
import RenderFields from '../../../../fields/RenderFields.svelte';
|
|
7
|
+
import Button from '../../../../ui/button/button.svelte';
|
|
5
8
|
import * as Dialog from '../../../../ui/dialog/index.js';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import Button from '../../../../../index.server.js/components/ui/button/button.svelte';
|
|
9
|
-
import { API_PROXY, setAPIProxyContext } from '../../../../../index.server.js/context/api-proxy.svelte';
|
|
10
|
-
import { getConfigContext } from '../../../../../index.server.js/context/config.svelte';
|
|
9
|
+
import { API_PROXY, setAPIProxyContext } from '../../../../../context/api-proxy.svelte.js';
|
|
10
|
+
import { getConfigContext } from '../../../../../context/config.svelte.js';
|
|
11
11
|
import {
|
|
12
12
|
setDocumentFormContext,
|
|
13
13
|
type FormSuccessData
|
|
14
|
-
} from '../../../../../
|
|
15
|
-
import { getUserContext } from '../../../../../
|
|
14
|
+
} from '../../../../../context/documentForm.svelte.js';
|
|
15
|
+
import { getUserContext } from '../../../../../context/user.svelte.js';
|
|
16
16
|
|
|
17
17
|
type Props = {
|
|
18
18
|
open: boolean;
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import { invalidateAll } from '$app/navigation';
|
|
3
3
|
import { t__ } from '../../../../../../core/i18n/index.js';
|
|
4
4
|
import { withDirectoriesSuffix } from '../../../../../../core/naming';
|
|
5
|
+
import RenderFields from '../../../../fields/RenderFields.svelte';
|
|
5
6
|
import Button from '../../../../ui/button/button.svelte';
|
|
6
7
|
import * as Dialog from '../../../../ui/dialog/index.js';
|
|
8
|
+
import { API_PROXY, setAPIProxyContext } from '../../../../../context/api-proxy.svelte.js';
|
|
7
9
|
import type { CollectionContext } from '../../../../../context/collection.svelte.js';
|
|
8
|
-
import {
|
|
9
|
-
import RenderFields from '../../../../../index.server.js/components/fields/RenderFields.svelte';
|
|
10
|
-
import { API_PROXY, setAPIProxyContext } from '../../../../../index.server.js/context/api-proxy.svelte';
|
|
11
|
-
import { getConfigContext } from '../../../../../index.server.js/context/config.svelte';
|
|
10
|
+
import { getConfigContext } from '../../../../../context/config.svelte.js';
|
|
12
11
|
import {
|
|
13
12
|
setDocumentFormContext,
|
|
14
13
|
type FormSuccessData
|
|
15
|
-
} from '../../../../../
|
|
14
|
+
} from '../../../../../context/documentForm.svelte.js';
|
|
15
|
+
import { FolderPlus } from '@lucide/svelte';
|
|
16
16
|
|
|
17
17
|
type Props = { collection: CollectionContext };
|
|
18
18
|
const { collection }: Props = $props();
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import type { BuiltCollection } from '../../../../core/config/types.js';
|
|
5
5
|
import { t__ } from '../../../../core/i18n';
|
|
6
6
|
import { text } from '../../../../fields';
|
|
7
|
-
import type { DocumentFormContext } from '../../../context/documentForm.svelte';
|
|
8
|
-
import { getUserContext } from '../../../context/user.svelte';
|
|
7
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
8
|
+
import { getUserContext } from '../../../context/user.svelte.js';
|
|
9
9
|
import { authClient } from '../../../util/auth';
|
|
10
10
|
import validate from '../../../../util/validate';
|
|
11
11
|
import { toast } from 'svelte-sonner';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BuiltCollection } from '../../../../core/config/types.js';
|
|
2
|
-
import type { DocumentFormContext } from '../../../context/documentForm.svelte';
|
|
2
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
3
3
|
type Props = {
|
|
4
4
|
operation: string;
|
|
5
5
|
form: DocumentFormContext;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { PARAMS, VERSIONS_STATUS } from '../../../../core/constant.js';
|
|
5
5
|
import * as Dialog from '../../ui/dialog/index.js';
|
|
6
6
|
import * as Radio from '../../ui/radio-group/index.js';
|
|
7
|
-
import type { DocumentFormContext } from '../../../context/documentForm.svelte';
|
|
7
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
8
8
|
import { toKebabCase } from '../../../../util/string';
|
|
9
9
|
import { toast } from 'svelte-sonner';
|
|
10
10
|
import { t__ } from '../../../../core/i18n/index.js';
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
import { t__ } from '../../../../core/i18n/index.js';
|
|
6
6
|
import type { GenericDoc } from '../../../../core/types/doc';
|
|
7
7
|
import * as Dialog from '../../ui/dialog/index.js';
|
|
8
|
-
import { getConfigContext } from '../../../context/config.svelte';
|
|
8
|
+
import { getConfigContext } from '../../../context/config.svelte.js';
|
|
9
9
|
import {
|
|
10
10
|
setDocumentFormContext,
|
|
11
11
|
type FormSuccessData
|
|
12
|
-
} from '../../../context/documentForm.svelte';
|
|
13
|
-
import { getLocaleContext } from '../../../context/locale.svelte';
|
|
14
|
-
import { getUserContext } from '../../../context/user.svelte';
|
|
12
|
+
} from '../../../context/documentForm.svelte.js';
|
|
13
|
+
import { getLocaleContext } from '../../../context/locale.svelte.js';
|
|
14
|
+
import { getUserContext } from '../../../context/user.svelte.js';
|
|
15
15
|
import RenderFields from '../../fields/RenderFields.svelte';
|
|
16
16
|
import Button from '../../ui/button/button.svelte';
|
|
17
17
|
import AuthApiKeyDialog from './AuthAPIKeyDialog.svelte';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { apiUrl } from '../../../../core/api/index.js';
|
|
3
3
|
import type { GenericDoc } from '../../../../core/types/doc.js';
|
|
4
|
-
import type { DocumentFormContext } from '../../../context/documentForm.svelte';
|
|
4
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
5
5
|
import { ChevronLeft } from '@lucide/svelte';
|
|
6
6
|
import { toast } from 'svelte-sonner';
|
|
7
7
|
import { t__ } from '../../../../core/i18n/index.js';
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
const { form, onClose }: Props = $props();
|
|
14
14
|
|
|
15
15
|
function onLocaleClick(code: string) {
|
|
16
|
-
fetch(
|
|
16
|
+
fetch(
|
|
17
|
+
`${apiUrl(form.config.kebab)}?where[id][equals]=${form.values.id}&select=url&locale=${code}`
|
|
18
|
+
)
|
|
17
19
|
.then((response) => response.json())
|
|
18
20
|
.then((data: { docs: GenericDoc[] }) => {
|
|
19
21
|
if (Array.isArray(data.docs) && data.docs.length) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { BuiltArea, BuiltCollection } from '../../../../core/config/types';
|
|
4
4
|
import { PARAMS } from '../../../../core/constant';
|
|
5
5
|
import { t__ } from '../../../../core/i18n/index.js';
|
|
6
|
-
import type { DocumentFormContext } from '../../../context/documentForm.svelte';
|
|
6
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
7
7
|
import { ExternalLink, PencilRuler, X } from '@lucide/svelte';
|
|
8
8
|
import { Button } from '../../ui/button';
|
|
9
9
|
import LanguageSwitcher from '../../ui/language-switcher/LanguageSwitcher.svelte';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BuiltArea, BuiltCollection } from '../../../../core/config/types';
|
|
2
|
-
import type { DocumentFormContext } from '../../../context/documentForm.svelte';
|
|
2
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
3
3
|
type Props = {
|
|
4
4
|
onClose?: any;
|
|
5
5
|
form: DocumentFormContext;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { PARAMS, VERSIONS_STATUS } from '../../../../core/constant.js';
|
|
6
6
|
import * as Dialog from '../../ui/dialog/index.js';
|
|
7
7
|
import * as DropdownMenu from '../../ui/dropdown-menu/index.js';
|
|
8
|
-
import type { DocumentFormContext } from '../../../context/documentForm.svelte';
|
|
8
|
+
import type { DocumentFormContext } from '../../../context/documentForm.svelte.js';
|
|
9
9
|
import { getLocaleContext } from '../../../context/locale.svelte.js';
|
|
10
10
|
import { panelUrl } from '../../../util/url.js';
|
|
11
11
|
import { trycatchFetch } from '../../../../util/function.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { WithUpload } from '../../../../../core/collections/upload/util/config';
|
|
3
3
|
import type { BuiltCollection } from '../../../../../core/config/types';
|
|
4
4
|
import Button from '../../../ui/button/button.svelte';
|
|
5
|
-
import { type DocumentFormContext } from '../../../../context/documentForm.svelte';
|
|
5
|
+
import { type DocumentFormContext } from '../../../../context/documentForm.svelte.js';
|
|
6
6
|
import { mimeTypeToIcon } from '../../../../util/upload.js';
|
|
7
7
|
import * as util from '../../../../../util/file.js';
|
|
8
8
|
import { capitalize } from '../../../../../util/string.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WithUpload } from '../../../../../core/collections/upload/util/config';
|
|
2
2
|
import type { BuiltCollection } from '../../../../../core/config/types';
|
|
3
|
-
import { type DocumentFormContext } from '../../../../context/documentForm.svelte';
|
|
3
|
+
import { type DocumentFormContext } from '../../../../context/documentForm.svelte.js';
|
|
4
4
|
type Props = {
|
|
5
5
|
form: DocumentFormContext;
|
|
6
6
|
create: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { dev } from '$app/environment';
|
|
2
3
|
import Button from '../button/button.svelte';
|
|
3
|
-
import { getLocaleContext } from '../../../context/locale.svelte';
|
|
4
|
-
import { getConfigContext } from '../../../context/config.svelte';
|
|
5
|
-
import Cookies from 'js-cookie';
|
|
6
4
|
import * as DropdownMenu from '../dropdown-menu/index.js';
|
|
5
|
+
import { getConfigContext } from '../../../context/config.svelte.js';
|
|
6
|
+
import { getLocaleContext } from '../../../context/locale.svelte.js';
|
|
7
7
|
import { Languages } from '@lucide/svelte';
|
|
8
|
-
import
|
|
8
|
+
import Cookies from 'js-cookie';
|
|
9
9
|
|
|
10
10
|
type Props = { onLocalClick: (code: string) => void };
|
|
11
11
|
const { onLocalClick }: Props = $props();
|
|
@@ -13,40 +13,45 @@
|
|
|
13
13
|
const locale = getLocaleContext();
|
|
14
14
|
const config = getConfigContext();
|
|
15
15
|
const locales = $state(config.raw.localization?.locales || []);
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
function isActive(code: string) {
|
|
18
18
|
return code === locale.code;
|
|
19
19
|
}
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
{#if config.raw.localization?.locales.length}
|
|
23
|
-
<DropdownMenu.Root>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<DropdownMenu.Portal>
|
|
33
|
-
<DropdownMenu.Content align="end">
|
|
34
|
-
{#each locales as item, index (index)}
|
|
35
|
-
<DropdownMenu.Item
|
|
36
|
-
disabled={isActive(item.code)}
|
|
37
|
-
data-active={isActive(item.code) ? '' : null}
|
|
38
|
-
onclick={() => {
|
|
39
|
-
Cookies.set('Locale', item.code, {
|
|
40
|
-
sameSite: 'strict',
|
|
41
|
-
secure: !dev
|
|
42
|
-
});
|
|
43
|
-
onLocalClick(item.code);
|
|
44
|
-
}}
|
|
23
|
+
<DropdownMenu.Root>
|
|
24
|
+
<DropdownMenu.Trigger>
|
|
25
|
+
{#snippet child({ props })}
|
|
26
|
+
<Button
|
|
27
|
+
icon={Languages}
|
|
28
|
+
size="sm"
|
|
29
|
+
variant={props['data-state'] === 'open' ? 'secondary' : 'ghost'}
|
|
30
|
+
{...props}
|
|
45
31
|
>
|
|
46
|
-
|
|
47
|
-
</
|
|
48
|
-
{/
|
|
49
|
-
</DropdownMenu.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
32
|
+
{locale.label}
|
|
33
|
+
</Button>
|
|
34
|
+
{/snippet}
|
|
35
|
+
</DropdownMenu.Trigger>
|
|
36
|
+
|
|
37
|
+
<DropdownMenu.Portal>
|
|
38
|
+
<DropdownMenu.Content align="end">
|
|
39
|
+
{#each locales as item, index (index)}
|
|
40
|
+
<DropdownMenu.Item
|
|
41
|
+
disabled={isActive(item.code)}
|
|
42
|
+
data-active={isActive(item.code) ? '' : null}
|
|
43
|
+
onclick={() => {
|
|
44
|
+
Cookies.set('Locale', item.code, {
|
|
45
|
+
sameSite: 'strict',
|
|
46
|
+
secure: !dev
|
|
47
|
+
});
|
|
48
|
+
onLocalClick(item.code);
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<span>{item.label}</span>
|
|
52
|
+
</DropdownMenu.Item>
|
|
53
|
+
{/each}
|
|
54
|
+
</DropdownMenu.Content>
|
|
55
|
+
</DropdownMenu.Portal>
|
|
56
|
+
</DropdownMenu.Root>
|
|
57
|
+
{/if}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { page } from '$app/state';
|
|
3
|
-
import { getConfigContext } from '../../../context/config.svelte';
|
|
3
|
+
import { getConfigContext } from '../../../context/config.svelte.js';
|
|
4
4
|
import type { Route } from '../../../types';
|
|
5
5
|
import { panelUrl } from '../../../util/url.js';
|
|
6
6
|
import { PanelsTopLeft } from '@lucide/svelte';
|
|
@@ -70,7 +70,12 @@
|
|
|
70
70
|
</div>
|
|
71
71
|
</div>
|
|
72
72
|
|
|
73
|
-
<button
|
|
73
|
+
<button
|
|
74
|
+
class="rz-nav__toggle"
|
|
75
|
+
onclick={() => setCollapsed(!isCollapsed)}
|
|
76
|
+
aria-label="Toggle navigation"
|
|
77
|
+
>
|
|
78
|
+
</button>
|
|
74
79
|
</div>
|
|
75
80
|
|
|
76
81
|
<style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { page } from '$app/state';
|
|
3
3
|
import * as Tooltip from '../tooltip';
|
|
4
|
-
import { getConfigContext } from '../../../context/config.svelte';
|
|
4
|
+
import { getConfigContext } from '../../../context/config.svelte.js';
|
|
5
5
|
import type { Route } from '../../../types';
|
|
6
6
|
import { File } from '@lucide/svelte';
|
|
7
7
|
import NavItemButton from './NavItemButton.svelte';
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
const config = getConfigContext();
|
|
17
17
|
|
|
18
|
-
const RouteIcon =
|
|
18
|
+
const RouteIcon =
|
|
19
|
+
typeof route.icon === 'function' ? route.icon : config.raw.icons[route.icon] || File;
|
|
19
20
|
|
|
20
21
|
let pathname = page.url.pathname;
|
|
21
22
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import Button from '../button/button.svelte';
|
|
4
|
-
import { LogOut } from '@lucide/svelte';
|
|
2
|
+
import { env } from '$env/dynamic/public';
|
|
5
3
|
import * as Tooltip from '../tooltip';
|
|
4
|
+
import { getUserContext } from '../../../context/user.svelte.js';
|
|
6
5
|
import { authClient } from '../../../util/auth.js';
|
|
7
|
-
import {
|
|
6
|
+
import { LogOut } from '@lucide/svelte';
|
|
8
7
|
import { toast } from 'svelte-sonner';
|
|
8
|
+
import Button from '../button/button.svelte';
|
|
9
9
|
|
|
10
10
|
type Props = { navCollapsed: boolean };
|
|
11
11
|
const { navCollapsed }: Props = $props();
|
|
@@ -6,13 +6,13 @@ import { compileDocumentConfig } from '../../core/config/shared/compile.js';
|
|
|
6
6
|
import { PARAMS, VERSIONS_STATUS } from '../../core/constant.js';
|
|
7
7
|
import { getFieldConfigByPath } from '../../core/fields/util.js';
|
|
8
8
|
import { buildConfigMap } from '../../core/operations/configMap/index.js';
|
|
9
|
+
import { richTextJSONToText } from '../../fields/rich-text/index.js';
|
|
9
10
|
import { normalizeFieldPath } from '../../util/doc.js';
|
|
10
11
|
import { random } from '../../util/index.js';
|
|
11
12
|
import { isObjectLiteral, omit } from '../../util/object.js';
|
|
12
13
|
import cloneDeep from 'clone-deep';
|
|
13
14
|
import { diff } from 'deep-object-diff';
|
|
14
15
|
import { flatten } from 'flat';
|
|
15
|
-
import { richTextJSONToText } from '../../fields/rich-text/client.js';
|
|
16
16
|
import { getContext, setContext } from 'svelte';
|
|
17
17
|
import { toast } from 'svelte-sonner';
|
|
18
18
|
import { t__ } from '../../core/i18n/index.js';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import LanguageSwitcher from '../../components/ui/language-switcher/LanguageSwitcher.svelte';
|
|
17
17
|
import PageHeader from '../../components/ui/page-header/PageHeader.svelte';
|
|
18
18
|
import { setCollectionContext } from '../../context/collection.svelte.js';
|
|
19
|
-
import { getConfigContext } from '../../context/config.svelte';
|
|
19
|
+
import { getConfigContext } from '../../context/config.svelte.js';
|
|
20
20
|
import { CopyPlus } from '@lucide/svelte';
|
|
21
21
|
import { getContext, setContext } from 'svelte';
|
|
22
22
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
3
2
|
import Document from '../../components/sections/document/Document.svelte';
|
|
4
|
-
import { API_PROXY, setAPIProxyContext } from '../../context/api-proxy.svelte';
|
|
5
3
|
import Page from '../../components/sections/page-layout/Page.svelte';
|
|
4
|
+
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
5
|
+
import { API_PROXY, setAPIProxyContext } from '../../context/api-proxy.svelte.js';
|
|
6
6
|
import type { CollectionDocData } from '../../index.js';
|
|
7
7
|
|
|
8
8
|
const { data }: { data: CollectionDocData<false> } = $props();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Eye } from '@lucide/svelte';
|
|
3
|
-
import Button from '../../components/ui/button/button.svelte';
|
|
4
|
-
import PageHeader from '../../components/ui/page-header/PageHeader.svelte';
|
|
5
|
-
import { getConfigContext } from '../../context/config.svelte';
|
|
6
|
-
import LanguageSwitcher from '../../components/ui/language-switcher/LanguageSwitcher.svelte';
|
|
7
|
-
import { t__ } from '../../../core/i18n/index.js';
|
|
8
|
-
import type { DashboardEntry } from './types.js';
|
|
9
2
|
import { invalidateAll } from '$app/navigation';
|
|
10
3
|
import type { User } from '../../../core/collections/auth/types.js';
|
|
4
|
+
import { t__ } from '../../../core/i18n/index.js';
|
|
11
5
|
import Page from '../../components/sections/page-layout/Page.svelte';
|
|
6
|
+
import Button from '../../components/ui/button/button.svelte';
|
|
7
|
+
import LanguageSwitcher from '../../components/ui/language-switcher/LanguageSwitcher.svelte';
|
|
8
|
+
import PageHeader from '../../components/ui/page-header/PageHeader.svelte';
|
|
9
|
+
import { getConfigContext } from '../../context/config.svelte.js';
|
|
10
|
+
import { Eye } from '@lucide/svelte';
|
|
11
|
+
import type { DashboardEntry } from './types.js';
|
|
12
12
|
|
|
13
13
|
type Props = { entries: DashboardEntry[]; user?: User };
|
|
14
14
|
const { entries, user }: Props = $props();
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
flex-direction: column;
|
|
88
88
|
gap: var(--rz-size-4);
|
|
89
89
|
transition: background-color 0.3s ease-out;
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
&:hover {
|
|
92
92
|
background-color: light-dark(hsl(var(--rz-gray-15)), hsl(var(--rz-gray-4)));
|
|
93
93
|
}
|