rimecms 0.26.9 → 0.27.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/README.md +26 -24
- package/dist/core/collections/auth/fields.d.ts +40 -40
- package/dist/core/fields/builders/select.js +1 -0
- package/dist/core/i18n/en/fields.d.ts +1 -0
- package/dist/core/i18n/en/fields.js +2 -1
- package/dist/core/i18n/fr/fields.d.ts +1 -0
- package/dist/core/i18n/fr/fields.js +2 -1
- package/dist/core/operations/hooks/before-read/set-document-thumbnail.server.js +2 -2
- package/dist/core/operations/hooks/before-read/sort-document-props.server.js +3 -1
- package/dist/fields/group/component/Group.svelte +1 -0
- package/dist/fields/group/index.d.ts +12 -8
- package/dist/fields/group/index.js +4 -0
- package/dist/fields/link/component/RessourceInput.svelte +2 -2
- package/dist/fields/relation/component/Cell.svelte +2 -2
- package/dist/fields/relation/component/Relation.svelte +18 -11
- package/dist/fields/relation/component/Relation.svelte.d.ts +2 -1
- package/dist/fields/relation/component/upload/Browse.svelte +2 -2
- package/dist/fields/relation/index.d.ts +1 -1
- package/dist/fields/rich-text/client.d.ts +9 -9
- package/dist/fields/rich-text/client.js +1 -1
- package/dist/fields/rich-text/component/RichText.svelte +1 -1
- package/dist/fields/rich-text/core/{config-builders.js → build-editor-config.js} +9 -2
- package/dist/fields/rich-text/core/features/fields/extension.d.ts +10 -3
- package/dist/fields/rich-text/core/features/fields/extension.js +3 -8
- package/dist/fields/rich-text/core/features/fields/fields.css +4 -0
- package/dist/fields/rich-text/core/features/fields/fields.svelte +13 -6
- package/dist/fields/rich-text/core/features/fields/fields.svelte.d.ts +4 -1
- package/dist/fields/rich-text/core/features/fields/index.d.ts +7 -5
- package/dist/fields/rich-text/core/features/fields/index.js +4 -3
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +9 -13
- package/dist/fields/rich-text/core/features/link/index.d.ts +1 -4
- package/dist/fields/rich-text/core/features/resource/index.d.ts +2 -5
- package/dist/fields/rich-text/core/features/resource/index.js +17 -12
- package/dist/fields/rich-text/core/features/resource/resource-extension.d.ts +7 -2
- package/dist/fields/rich-text/core/features/resource/resource-extension.js +6 -10
- package/dist/fields/rich-text/core/features/resource/resource.svelte +19 -21
- package/dist/fields/rich-text/core/features/upload/index.d.ts +2 -5
- package/dist/fields/rich-text/core/features/upload/index.js +15 -12
- package/dist/fields/rich-text/core/features/upload/upload-extension.d.ts +13 -1
- package/dist/fields/rich-text/core/features/upload/upload-extension.js +6 -11
- package/dist/fields/rich-text/core/features/upload/upload.svelte +15 -10
- package/dist/fields/rich-text/core/svelte/node-view-renderer.svelte.js +10 -5
- package/dist/fields/rich-text/core/svelte/node-view-wrapper.svelte +1 -0
- package/dist/fields/rich-text/core/svelte/renderer.d.ts +1 -1
- package/dist/fields/types.d.ts +13 -0
- package/dist/panel/components/Root.svelte +4 -4
- package/dist/panel/components/fields/FieldsPreview.svelte +34 -27
- package/dist/panel/components/fields/FieldsPreview.svelte.d.ts +5 -6
- package/dist/panel/components/fields/FieldsPreviewTrigger.svelte +1 -1
- package/dist/panel/components/fields/index.d.ts +2 -2
- package/dist/panel/components/sections/collection/folder/FolderEdit.svelte +0 -2
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +2 -2
- package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte +0 -2
- package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +3 -2
- package/dist/panel/components/sections/document/Header.svelte +1 -0
- package/dist/panel/components/sections/document/Settings.svelte +3 -2
- package/dist/panel/components/sections/document/Settings.svelte.d.ts +2 -1
- package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +2 -7
- package/dist/panel/components/sections/live/SidePanel.svelte +7 -9
- package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +12 -6
- package/dist/panel/components/ui/card-document/card-document.svelte +2 -2
- package/dist/panel/components/ui/command/command-dialog.svelte +3 -1
- package/dist/panel/components/ui/command/command-dialog.svelte.d.ts +1 -0
- package/dist/panel/context/api-proxy.svelte.d.ts +2 -1
- package/dist/panel/context/api-proxy.svelte.js +9 -3
- package/dist/panel/context/documentForm.svelte.d.ts +2 -2
- package/dist/panel/context/documentForm.svelte.js +7 -6
- package/dist/panel/context/form.svelte.js +0 -1
- package/dist/panel/context/locale.svelte.d.ts +1 -0
- package/dist/panel/context/locale.svelte.js +3 -3
- package/dist/panel/context/title.d.ts +7 -0
- package/dist/panel/context/title.js +9 -0
- package/dist/panel/pages/area/Area.svelte +1 -4
- package/dist/panel/pages/area/AreaVersionsDoc.svelte +0 -3
- package/dist/panel/pages/collection/Collection.svelte +2 -2
- package/dist/panel/pages/collection-document/CollectionDocVersions.svelte +0 -5
- package/dist/panel/pages/collection-document/CollectionDocument.svelte +0 -3
- package/dist/panel/pages/live/Live.svelte +3 -8
- package/dist/types.d.ts +1 -1
- package/package.json +4 -4
- /package/dist/fields/rich-text/core/{config-builders.d.ts → build-editor-config.d.ts} +0 -0
|
@@ -18,10 +18,11 @@ import { t__ } from '../../core/i18n/index.js';
|
|
|
18
18
|
import { moveItem } from '../../util/array.js';
|
|
19
19
|
import { getValueAtPath, setValueAtPath } from '../../util/object.js';
|
|
20
20
|
import { snapshot } from '../../util/state.js';
|
|
21
|
-
import {
|
|
21
|
+
import { getAPIProxyContext } from './api-proxy.svelte.js';
|
|
22
22
|
import { getCollectionContext } from './collection.svelte.js';
|
|
23
23
|
import { setErrorsContext } from './errors.svelte.js';
|
|
24
24
|
import { getLocaleContext } from './locale.svelte.js';
|
|
25
|
+
import { getTitleContext } from './title.js';
|
|
25
26
|
import { getUserContext } from './user.svelte.js';
|
|
26
27
|
function createDocumentFormState({ initial, config, readOnly, key, onNestedDocumentCreated, afterSuccess, onDataChange, beforeSubmit, beforeRedirect, onFieldFocus }) {
|
|
27
28
|
//
|
|
@@ -42,10 +43,10 @@ function createDocumentFormState({ initial, config, readOnly, key, onNestedDocum
|
|
|
42
43
|
const nestedLevel = initLevel();
|
|
43
44
|
const isLiveEdit = !!onDataChange;
|
|
44
45
|
const locale = getLocaleContext();
|
|
45
|
-
const titleContext =
|
|
46
|
+
const titleContext = getTitleContext();
|
|
46
47
|
const initialTitle = initTitle();
|
|
47
48
|
let title = $state(initialTitle);
|
|
48
|
-
const apiProxy = getAPIProxyContext(
|
|
49
|
+
const apiProxy = getAPIProxyContext();
|
|
49
50
|
function initLevel() {
|
|
50
51
|
const last = key.split('_').pop();
|
|
51
52
|
const isDigit = /[\d]+/.test(last);
|
|
@@ -497,6 +498,8 @@ function createDocumentFormState({ initial, config, readOnly, key, onNestedDocum
|
|
|
497
498
|
async function handleSuccess(data) {
|
|
498
499
|
const redirect = data?.redirectUrl || false;
|
|
499
500
|
const message = data?.message || t__('common.generic_success');
|
|
501
|
+
// Invalidate all queries to ensure data consistency across the app
|
|
502
|
+
apiProxy.invalidate(documentConfig.slug);
|
|
500
503
|
if (redirect) {
|
|
501
504
|
if (beforeRedirect) {
|
|
502
505
|
const shouldRedirect = await beforeRedirect(data);
|
|
@@ -509,8 +512,6 @@ function createDocumentFormState({ initial, config, readOnly, key, onNestedDocum
|
|
|
509
512
|
// Assign documents returned from the server to the form state
|
|
510
513
|
doc = (data?.document || doc);
|
|
511
514
|
initialDoc = doc;
|
|
512
|
-
// Invalidate all queries to ensure data consistency across the app
|
|
513
|
-
apiProxy.invalidateAll();
|
|
514
515
|
toast.success(message);
|
|
515
516
|
// Callbacks
|
|
516
517
|
if (nestedLevel !== 0) {
|
|
@@ -594,7 +595,7 @@ function createDocumentFormState({ initial, config, readOnly, key, onNestedDocum
|
|
|
594
595
|
actionSuffix = '?/update';
|
|
595
596
|
}
|
|
596
597
|
// Add a redirect parameter if we're in a nested form ex: relation creation
|
|
597
|
-
// to prevent
|
|
598
|
+
// to prevent redirect after creation
|
|
598
599
|
const redirectParam = nestedLevel > 0 ? `&${PARAMS.REDIRECT}=false` : '';
|
|
599
600
|
// Combine all parts to form the final action URL
|
|
600
601
|
return `${panelUri}${actionSuffix}${redirectParam}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getContext, setContext } from 'svelte';
|
|
2
2
|
import { getConfigContext } from './config.svelte.js';
|
|
3
|
-
const
|
|
3
|
+
export const LOCALE_CTX = Symbol('rime.locale');
|
|
4
4
|
function createStore(initial) {
|
|
5
5
|
let code = $state();
|
|
6
6
|
let label = $state();
|
|
@@ -56,8 +56,8 @@ function createStore(initial) {
|
|
|
56
56
|
}
|
|
57
57
|
export function setLocaleContext(initial) {
|
|
58
58
|
const store = createStore(initial);
|
|
59
|
-
return setContext(
|
|
59
|
+
return setContext(LOCALE_CTX, store);
|
|
60
60
|
}
|
|
61
61
|
export function getLocaleContext() {
|
|
62
|
-
return getContext(
|
|
62
|
+
return getContext(LOCALE_CTX);
|
|
63
63
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getContext } from 'svelte';
|
|
2
|
+
import createContext from './createContext.svelte';
|
|
3
|
+
export const TITLE_CTX = 'rime.document.title';
|
|
4
|
+
export function getTitleContext() {
|
|
5
|
+
return getContext(TITLE_CTX);
|
|
6
|
+
}
|
|
7
|
+
export function setTitleContext(title) {
|
|
8
|
+
return createContext(TITLE_CTX, title);
|
|
9
|
+
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Document from '../../components/sections/document/Document.svelte';
|
|
3
|
-
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
4
|
-
import { API_PROXY, setAPIProxyContext } from '../../context/api-proxy.svelte.js';
|
|
5
3
|
import Page from '../../components/sections/page-layout/Page.svelte';
|
|
4
|
+
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
6
5
|
import type { AreaDocData } from '../../index.js';
|
|
7
6
|
|
|
8
7
|
const { data }: { data: AreaDocData<false> } = $props();
|
|
9
|
-
|
|
10
|
-
setAPIProxyContext(API_PROXY.DOCUMENT);
|
|
11
8
|
</script>
|
|
12
9
|
|
|
13
10
|
{#if data.status === 200}
|
|
@@ -3,12 +3,9 @@
|
|
|
3
3
|
import Versions from '../../components/sections/document/Versions.svelte';
|
|
4
4
|
import Page from '../../components/sections/page-layout/Page.svelte';
|
|
5
5
|
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
6
|
-
import { API_PROXY, setAPIProxyContext } from '../../context/api-proxy.svelte.js';
|
|
7
6
|
import type { AreaDocData } from '../../index.js';
|
|
8
7
|
|
|
9
8
|
const { data }: { data: AreaDocData<true> } = $props();
|
|
10
|
-
|
|
11
|
-
setAPIProxyContext(API_PROXY.DOCUMENT);
|
|
12
9
|
</script>
|
|
13
10
|
|
|
14
11
|
{#if data.status === 200}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
import PageHeader from '../../components/ui/page-header/PageHeader.svelte';
|
|
18
18
|
import { setCollectionContext } from '../../context/collection.svelte.js';
|
|
19
19
|
import { getConfigContext } from '../../context/config.svelte.js';
|
|
20
|
+
import { getTitleContext } from '../../context/title';
|
|
20
21
|
import { CopyPlus } from '@lucide/svelte';
|
|
21
|
-
import { getContext } from 'svelte';
|
|
22
22
|
|
|
23
23
|
type Props = {
|
|
24
24
|
slug: string;
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
collection.docs = data.docs;
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
const titleContext =
|
|
63
|
+
const titleContext = getTitleContext();
|
|
64
64
|
|
|
65
65
|
$effect(() => {
|
|
66
66
|
titleContext.value = collection.config.label.plural;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { VersionsStatus } from '../../../core/constant.js';
|
|
3
|
-
import type { VersionDoc } from '../../../core/types/doc.js';
|
|
4
2
|
import Document from '../../components/sections/document/Document.svelte';
|
|
5
3
|
import Versions from '../../components/sections/document/Versions.svelte';
|
|
6
4
|
import Page from '../../components/sections/page-layout/Page.svelte';
|
|
7
5
|
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
8
|
-
import { API_PROXY, setAPIProxyContext } from '../../context/api-proxy.svelte.js';
|
|
9
6
|
import type { CollectionDocData } from '../../index.js';
|
|
10
7
|
|
|
11
8
|
const { data }: { data: CollectionDocData<true> } = $props();
|
|
12
|
-
|
|
13
|
-
setAPIProxyContext(API_PROXY.DOCUMENT);
|
|
14
9
|
</script>
|
|
15
10
|
|
|
16
11
|
{#if data.status === 200}
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
import Document from '../../components/sections/document/Document.svelte';
|
|
3
3
|
import Page from '../../components/sections/page-layout/Page.svelte';
|
|
4
4
|
import Unauthorized from '../../components/sections/unauthorized/Unauthorized.svelte';
|
|
5
|
-
import { API_PROXY, setAPIProxyContext } from '../../context/api-proxy.svelte.js';
|
|
6
5
|
import type { CollectionDocData } from '../../index.js';
|
|
7
6
|
|
|
8
7
|
const { data }: { data: CollectionDocData<false> } = $props();
|
|
9
|
-
|
|
10
|
-
setAPIProxyContext(API_PROXY.DOCUMENT);
|
|
11
8
|
</script>
|
|
12
9
|
|
|
13
10
|
{#if data.status === 200}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import Button from '../../components/ui/button/button.svelte';
|
|
8
8
|
import { Pane, PaneGroup, PaneResizer } from '../../components/ui/pane/index.js';
|
|
9
9
|
import SpinLoader from '../../components/ui/spin-loader/SpinLoader.svelte';
|
|
10
|
+
import { snapshot } from '../../../util/state';
|
|
10
11
|
import { Laptop, Smartphone } from '@lucide/svelte';
|
|
11
12
|
import { onMount } from 'svelte';
|
|
12
13
|
import { fade } from 'svelte/transition';
|
|
@@ -30,7 +31,8 @@
|
|
|
30
31
|
const onDataChange = (args: Partial<GenericDoc>) => {
|
|
31
32
|
/** Send message to iframe */
|
|
32
33
|
if (iframe?.contentWindow) {
|
|
33
|
-
|
|
34
|
+
// Use snapshot to ensure we're sending a plain object without reactive proxies
|
|
35
|
+
iframe.contentWindow.postMessage(snapshot(args));
|
|
34
36
|
}
|
|
35
37
|
};
|
|
36
38
|
|
|
@@ -89,12 +91,7 @@
|
|
|
89
91
|
}
|
|
90
92
|
});
|
|
91
93
|
|
|
92
|
-
const ZOOMS = [0.5, 0.66, 1] as const;
|
|
93
|
-
|
|
94
|
-
let currentZoom = $state(1);
|
|
95
94
|
let currentDevice = $state<'mobile' | 'desktop'>('mobile');
|
|
96
|
-
|
|
97
|
-
const iframeScale = $derived(ZOOMS[currentZoom]);
|
|
98
95
|
</script>
|
|
99
96
|
|
|
100
97
|
<div class="rz-live-container">
|
|
@@ -169,8 +166,6 @@
|
|
|
169
166
|
|
|
170
167
|
.rz-live-container iframe.mobile {
|
|
171
168
|
width: 320px;
|
|
172
|
-
/*transform: translateX(-50%);
|
|
173
|
-
margin-left: 50%;*/
|
|
174
169
|
aspect-ratio: 2 / 3.3;
|
|
175
170
|
scale: 1.25;
|
|
176
171
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { User } from './core/collections/auth/types.js';
|
|
2
2
|
export type { AdditionalStaffConfig, Area, AreaHooks, BuiltArea, BuiltCollection, BuiltConfig, BuiltConfigClient, Collection, CollectionHooks, Config, CustomPanelRoute, ImageSizesConfig, LocaleConfig, LocalizationConfig, RouteConfig } from './core/config/types.js';
|
|
3
3
|
export type { AreaSlug, BaseDoc, CollectionSlug, GenericBlock, GenericDoc, Prototype, PrototypeSlug, UploadDoc } from './core/types/doc.js';
|
|
4
|
-
export type
|
|
4
|
+
export type * from './fields/types.js';
|
|
5
5
|
export type { CollectionProps, FieldPanelTableConfig, FormErrors, Navigation, Route } from './panel/types.js';
|
|
6
6
|
export type { DocumentFormContext } from './panel/context/documentForm.svelte.js';
|
|
7
7
|
export type { JsonFile } from './core/collections/upload/upload.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rimecms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"homepage": "https://github.com/bienbiendev/rime",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
@@ -161,16 +161,16 @@
|
|
|
161
161
|
"globals": "^15.15.0",
|
|
162
162
|
"postcss": "^8.5.3",
|
|
163
163
|
"postcss-cli": "^11.0.1",
|
|
164
|
-
"postcss-mixins": "^
|
|
164
|
+
"postcss-mixins": "^12.1.2",
|
|
165
165
|
"prettier": "^3.5.3",
|
|
166
166
|
"prettier-plugin-svelte": "^3.3.3",
|
|
167
167
|
"publint": "^0.2.12",
|
|
168
168
|
"svelte": "^5.55.2",
|
|
169
169
|
"svelte-check": "^4.4.6",
|
|
170
170
|
"typescript": "^5.8.3",
|
|
171
|
-
"typescript-eslint": "^8.
|
|
171
|
+
"typescript-eslint": "^8.59.0",
|
|
172
172
|
"vite": "^8.0.8",
|
|
173
|
-
"vitest": "^4.
|
|
173
|
+
"vitest": "^4.1.4"
|
|
174
174
|
},
|
|
175
175
|
"dependencies": {
|
|
176
176
|
"@babel/generator": "^7.28.3",
|
|
File without changes
|