rimecms 1.0.0 → 1.0.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/adapter-sqlite/generate-schema/templates.server.d.ts +9 -9
- package/dist/adapter-sqlite/generate-schema/templates.server.js +9 -9
- package/dist/adapter-sqlite/paths.server.js +24 -15
- package/dist/adapter-sqlite/rows.server.d.ts +1 -1
- package/dist/core/adapter.d.ts +8 -4
- package/dist/core/boot.server.d.ts +2 -2
- package/dist/core/config/context.server.d.ts +2 -2
- package/dist/core/dev/codegen/routes/common.server.d.ts +2 -0
- package/dist/core/dev/codegen/routes/common.server.js +7 -3
- package/dist/core/dev/codegen/routes/util.server.d.ts +2 -1
- package/dist/core/dev/codegen/routes/util.server.js +4 -1
- package/dist/core/dev/config-memo.server.js +4 -0
- package/dist/core/prototype/collection/operations/duplicate.js +1 -1
- package/dist/core/prototype/collection/thumbnail/hooks/set-document-thumbnail.server.js +1 -1
- package/dist/core/prototype/shared/title/hooks/set-document-title.server.js +1 -1
- package/dist/core/prototype/shared/url/addresses.server.d.ts +10 -0
- package/dist/core/prototype/shared/url/addresses.server.js +17 -17
- package/dist/core/prototype/shared/url/hooks/detach-paths.server.d.ts +3 -2
- package/dist/core/prototype/shared/url/hooks/detach-paths.server.js +9 -8
- package/dist/core/prototype/shared/url/hooks/sync-paths.server.d.ts +3 -2
- package/dist/core/prototype/shared/url/hooks/sync-paths.server.js +5 -4
- package/dist/fields/blocks/component/focus/BlocksFocus.svelte +1 -1
- package/dist/fields/link/index.d.ts +1 -1
- package/dist/fields/relation/component/RelationInline.svelte +1 -1
- package/dist/fields/relation/index.d.ts +1 -41
- package/dist/fields/relation/index.js +0 -67
- package/dist/fields/relation/util.d.ts +69 -0
- package/dist/fields/relation/util.js +103 -0
- package/dist/fields/rich-text/client.d.ts +2 -5
- package/dist/fields/rich-text/client.js +1 -3
- package/dist/fields/rich-text/component/Cell.svelte +1 -1
- package/dist/fields/rich-text/core/features/resource/resource-extension.js +3 -3
- package/dist/fields/rich-text/core/features/resource/resource.svelte +1 -1
- package/dist/fields/rich-text/core/features/upload/upload-extension.js +3 -4
- package/dist/fields/rich-text/core/features/upload/upload.svelte +1 -1
- package/dist/fields/rich-text/index.d.ts +0 -17
- package/dist/fields/rich-text/index.js +0 -44
- package/dist/fields/rich-text/json.d.ts +18 -0
- package/dist/fields/rich-text/json.js +44 -0
- package/dist/index.d.ts +2 -9
- package/dist/index.js +3 -8
- package/dist/{panel/components/sections/live → live}/Consumer.svelte +2 -2
- package/dist/{panel/components/sections/live → live}/Consumer.svelte.d.ts +1 -1
- package/dist/{panel/components/sections/live → live}/LiveEdit.svelte +2 -2
- package/dist/{panel/components/sections/live → live}/Provider.svelte +1 -1
- package/dist/{panel/context/live.svelte.d.ts → live/context.svelte.d.ts} +1 -1
- package/dist/{panel/context/live.svelte.js → live/context.svelte.js} +3 -3
- package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte.d.ts +1 -1
- package/dist/panel/components/ui/calendar/calendar.svelte.d.ts +1 -1
- package/dist/panel/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +1 -1
- package/dist/panel/components/ui/switch/switch.svelte.d.ts +1 -1
- package/dist/panel/context/collection.svelte.d.ts +2 -2
- package/dist/panel/context/config.svelte.d.ts +2 -2
- package/dist/panel/context/documentForm.svelte.js +1 -1
- package/dist/panel/index.d.ts +2 -5
- package/dist/panel/index.js +3 -6
- package/dist/panel/public.d.ts +4 -0
- package/dist/panel/public.js +6 -0
- package/dist/public.d.ts +13 -0
- package/dist/public.js +12 -0
- package/package.json +12 -6
- package/dist/fields/relation/client.d.ts +0 -28
- package/dist/fields/relation/client.js +0 -37
- /package/dist/{panel/util → fields/relation}/populate.d.ts +0 -0
- /package/dist/{panel/util → fields/relation}/populate.js +0 -0
- /package/dist/{panel/components/sections/live → live}/LiveEdit.svelte.d.ts +0 -0
- /package/dist/{panel/components/sections/live → live}/Provider.svelte.d.ts +0 -0
|
@@ -48,7 +48,7 @@ export declare function setCollectionContext(args: Args): {
|
|
|
48
48
|
/** A filter change drops the selection, so no hidden document stays picked. */
|
|
49
49
|
statusFilter: StatusFilter;
|
|
50
50
|
kindFilter: KindFilter;
|
|
51
|
-
readonly kinds: ("
|
|
51
|
+
readonly kinds: ("image" | "document" | "audio" | "video" | "other")[];
|
|
52
52
|
readonly draftsCount: number;
|
|
53
53
|
readonly totalSize: number;
|
|
54
54
|
/** Every document of the collection, whatever the search. */
|
|
@@ -110,7 +110,7 @@ export declare function getCollectionContext(): {
|
|
|
110
110
|
/** A filter change drops the selection, so no hidden document stays picked. */
|
|
111
111
|
statusFilter: StatusFilter;
|
|
112
112
|
kindFilter: KindFilter;
|
|
113
|
-
readonly kinds: ("
|
|
113
|
+
readonly kinds: ("image" | "document" | "audio" | "video" | "other")[];
|
|
114
114
|
readonly draftsCount: number;
|
|
115
115
|
readonly totalSize: number;
|
|
116
116
|
/** Every document of the collection, whatever the search. */
|
|
@@ -8,7 +8,7 @@ export declare function setConfigContext(initial: BuiltConfigClient): {
|
|
|
8
8
|
getDocumentConfig: (args: {
|
|
9
9
|
prototype: Prototype;
|
|
10
10
|
slug: PrototypeSlug;
|
|
11
|
-
}) => import("../../core/config/types.js").
|
|
11
|
+
}) => import("../../core/config/types.js").BuiltArea | import("../../core/config/types.js").BuiltCollection;
|
|
12
12
|
};
|
|
13
13
|
export declare function getConfigContext(): {
|
|
14
14
|
readonly raw: BuiltConfigClient;
|
|
@@ -17,5 +17,5 @@ export declare function getConfigContext(): {
|
|
|
17
17
|
getDocumentConfig: (args: {
|
|
18
18
|
prototype: Prototype;
|
|
19
19
|
slug: PrototypeSlug;
|
|
20
|
-
}) => import("../../core/config/types.js").
|
|
20
|
+
}) => import("../../core/config/types.js").BuiltArea | import("../../core/config/types.js").BuiltCollection;
|
|
21
21
|
};
|
|
@@ -7,7 +7,7 @@ import { getFieldAtPath } from '../../core/fields/util.js';
|
|
|
7
7
|
import { buildConfigMap } from '../../core/pipeline/config-map/index.js';
|
|
8
8
|
import { AUTO_SAVE_DELAY_MS, VERSIONS_STATUS } from '../../core/prototype/shared/versions/constant.js';
|
|
9
9
|
import { apiUrl, panelUrl } from '../../core/routes/util.js';
|
|
10
|
-
import { isJSONContent, richTextJSONToText } from '../../fields/rich-text/
|
|
10
|
+
import { isJSONContent, richTextJSONToText } from '../../fields/rich-text/json.js';
|
|
11
11
|
import { isObjectLiteral, omit } from '../../util/object.js';
|
|
12
12
|
import { normalizeFieldPath } from '../../util/string.js';
|
|
13
13
|
import { randomId } from '../../util/random.js';
|
package/dist/panel/index.d.ts
CHANGED
|
@@ -12,17 +12,14 @@ import Button from './components/ui/button/button.svelte';
|
|
|
12
12
|
import Input from './components/ui/input/input.svelte';
|
|
13
13
|
import SpinLoader from './components/ui/spin-loader/SpinLoader.svelte';
|
|
14
14
|
import Area from './pages/area/Area.svelte';
|
|
15
|
-
import ForgotPassword from './pages/auth/forgot-password/ForgotPassword.svelte';
|
|
16
|
-
import ResetPassword from './pages/auth/reset-password/ResetPassword.svelte';
|
|
17
|
-
import SignIn from './pages/auth/sign-in/SignIn.svelte';
|
|
18
15
|
import CollectionDoc from './pages/collection-document/CollectionDocument.svelte';
|
|
19
16
|
import Collection from './pages/collection/Collection.svelte';
|
|
20
17
|
import Dashboard from './pages/dashboard/Dashboard.svelte';
|
|
21
18
|
import Live from './pages/live/Live.svelte';
|
|
22
19
|
import type { Route } from './types.js';
|
|
23
|
-
import { populate } from '
|
|
20
|
+
import { populate } from '../fields/relation/populate.js';
|
|
24
21
|
import { useCommands } from './context/commands.svelte.js';
|
|
25
|
-
export { Area, Button, Collection, CollectionDoc, Dashboard, Doc, Field,
|
|
22
|
+
export { Area, Button, Collection, CollectionDoc, Dashboard, Doc, Field, Input, Live, Panel, RelationInline, RenderFields, RichTextInline, SpinLoader, populate, useCommands };
|
|
26
23
|
export declare const CONTEXT: {
|
|
27
24
|
COLLECTION: symbol;
|
|
28
25
|
LIVE: symbol;
|
package/dist/panel/index.js
CHANGED
|
@@ -9,23 +9,20 @@ import Input from './components/ui/input/input.svelte';
|
|
|
9
9
|
import SpinLoader from './components/ui/spin-loader/SpinLoader.svelte';
|
|
10
10
|
import { API_PROXY } from './context/api-proxy.svelte.js';
|
|
11
11
|
import { COLLECTION_CTX } from './context/collection.svelte.js';
|
|
12
|
-
import { LIVE_KEY } from '
|
|
12
|
+
import { LIVE_KEY } from '../live/context.svelte.js';
|
|
13
13
|
import { LOCALE_CTX } from './context/locale.svelte.js';
|
|
14
14
|
import { USER_CTX } from './context/user.svelte.js';
|
|
15
15
|
import { TITLE_CTX } from './context/title.js';
|
|
16
16
|
import Area from './pages/area/Area.svelte';
|
|
17
|
-
import ForgotPassword from './pages/auth/forgot-password/ForgotPassword.svelte';
|
|
18
|
-
import ResetPassword from './pages/auth/reset-password/ResetPassword.svelte';
|
|
19
|
-
import SignIn from './pages/auth/sign-in/SignIn.svelte';
|
|
20
17
|
import CollectionDoc from './pages/collection-document/CollectionDocument.svelte';
|
|
21
18
|
import Collection from './pages/collection/Collection.svelte';
|
|
22
19
|
import Dashboard from './pages/dashboard/Dashboard.svelte';
|
|
23
20
|
import Live from './pages/live/Live.svelte';
|
|
24
|
-
import { populate } from '
|
|
21
|
+
import { populate } from '../fields/relation/populate.js';
|
|
25
22
|
import { useCommands } from './context/commands.svelte.js';
|
|
26
23
|
export {
|
|
27
24
|
// Components
|
|
28
|
-
Area, Button, Collection, CollectionDoc, Dashboard, Doc, Field,
|
|
25
|
+
Area, Button, Collection, CollectionDoc, Dashboard, Doc, Field, Input, Live, Panel, RelationInline, RenderFields, RichTextInline, SpinLoader,
|
|
29
26
|
// A block render's relations, resolved as the API answers them
|
|
30
27
|
populate,
|
|
31
28
|
// The commands a component offers while mounted: palette lines, keys
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// rimecms/panel/public: the panel's pages a visitor opens before signing in. Nothing they import is
|
|
2
|
+
// the rest of the panel or the config, which `public-entries.spec.ts` checks.
|
|
3
|
+
import ForgotPassword from './pages/auth/forgot-password/ForgotPassword.svelte';
|
|
4
|
+
import ResetPassword from './pages/auth/reset-password/ResetPassword.svelte';
|
|
5
|
+
import SignIn from './pages/auth/sign-in/SignIn.svelte';
|
|
6
|
+
export { ForgotPassword, ResetPassword, SignIn };
|
package/dist/public.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getI18nContext, setI18nContext } from './core/i18n/context.js';
|
|
2
|
+
import { createI18n } from './core/i18n/index.js';
|
|
3
|
+
import { openSse } from './core/plugins/sse/index.js';
|
|
4
|
+
import { isRelationPopulated, isRelationResolved, isRelationUnresolved, resolveRelation } from './fields/relation/util.js';
|
|
5
|
+
import RenderRichText from './fields/rich-text/core/render-rich-text.svelte';
|
|
6
|
+
import { richTextJSONToText } from './fields/rich-text/json.js';
|
|
7
|
+
import LiveConsumer from './live/Consumer.svelte';
|
|
8
|
+
import LiveEdit from './live/LiveEdit.svelte';
|
|
9
|
+
import LiveProvider from './live/Provider.svelte';
|
|
10
|
+
export type { SSEEvent, SSEHandler } from './core/plugins/sse/index.js';
|
|
11
|
+
export type { RichTextNodeRenderer, RichTextNodeRendererProps } from './fields/rich-text/core/types.js';
|
|
12
|
+
export type { JSONContent } from '@tiptap/core';
|
|
13
|
+
export { createI18n, getI18nContext, isRelationPopulated, isRelationResolved, isRelationUnresolved, LiveConsumer, LiveEdit, LiveProvider, openSse, RenderRichText, resolveRelation, richTextJSONToText, setI18nContext };
|
package/dist/public.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// rimecms/public: what a site page imports from rime, and only that. Nothing it reaches is the
|
|
2
|
+
// panel or the config, which `public-entries.spec.ts` checks.
|
|
3
|
+
import { getI18nContext, setI18nContext } from './core/i18n/context.js';
|
|
4
|
+
import { createI18n } from './core/i18n/index.js';
|
|
5
|
+
import { openSse } from './core/plugins/sse/index.js';
|
|
6
|
+
import { isRelationPopulated, isRelationResolved, isRelationUnresolved, resolveRelation } from './fields/relation/util.js';
|
|
7
|
+
import RenderRichText from './fields/rich-text/core/render-rich-text.svelte';
|
|
8
|
+
import { richTextJSONToText } from './fields/rich-text/json.js';
|
|
9
|
+
import LiveConsumer from './live/Consumer.svelte';
|
|
10
|
+
import LiveEdit from './live/LiveEdit.svelte';
|
|
11
|
+
import LiveProvider from './live/Provider.svelte';
|
|
12
|
+
export { createI18n, getI18nContext, isRelationPopulated, isRelationResolved, isRelationUnresolved, LiveConsumer, LiveEdit, LiveProvider, openSse, RenderRichText, resolveRelation, richTextJSONToText, setI18nContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rimecms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"homepage": "https://github.com/bienbiendev/rime",
|
|
5
5
|
"packageManager": "bun@1.3.0",
|
|
6
6
|
"scripts": {
|
|
@@ -39,6 +39,12 @@
|
|
|
39
39
|
"import": "./dist/index.js",
|
|
40
40
|
"default": "./dist/index.js"
|
|
41
41
|
},
|
|
42
|
+
"./public": {
|
|
43
|
+
"types": "./dist/public.d.ts",
|
|
44
|
+
"svelte": "./dist/public.js",
|
|
45
|
+
"import": "./dist/public.js",
|
|
46
|
+
"default": "./dist/public.js"
|
|
47
|
+
},
|
|
42
48
|
"./server": {
|
|
43
49
|
"types": "./dist/server.d.ts",
|
|
44
50
|
"import": "./dist/server.js",
|
|
@@ -69,16 +75,16 @@
|
|
|
69
75
|
"import": "./dist/fields/rich-text/client.js",
|
|
70
76
|
"default": "./dist/fields/rich-text/client.js"
|
|
71
77
|
},
|
|
72
|
-
"./fields/relation": {
|
|
73
|
-
"types": "./dist/fields/relation/client.d.ts",
|
|
74
|
-
"import": "./dist/fields/relation/client.js",
|
|
75
|
-
"default": "./dist/fields/relation/client.js"
|
|
76
|
-
},
|
|
77
78
|
"./panel": {
|
|
78
79
|
"types": "./dist/panel/index.d.ts",
|
|
79
80
|
"import": "./dist/panel/index.js",
|
|
80
81
|
"default": "./dist/panel/index.js"
|
|
81
82
|
},
|
|
83
|
+
"./panel/public": {
|
|
84
|
+
"types": "./dist/panel/public.d.ts",
|
|
85
|
+
"import": "./dist/panel/public.js",
|
|
86
|
+
"default": "./dist/panel/public.js"
|
|
87
|
+
},
|
|
82
88
|
"./panel/style/index.css": {
|
|
83
89
|
"import": "./dist/panel/style/index.css",
|
|
84
90
|
"default": "./dist/panel/style/index.css"
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { RelationValue } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if a relation field's value is populated with full documents.
|
|
4
|
-
*
|
|
5
|
-
* A relation is considered populated if it is an array of objects that do not
|
|
6
|
-
* contain only the relation identifiers (`id`, `relationTo`, `documentId`).
|
|
7
|
-
* If the value is a string or an array of relation identifier objects,
|
|
8
|
-
* it is considered not populated.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* // Returns: false
|
|
12
|
-
* isRelationPopulated('7674e91b-598a-4a72-a5cd-9594736a34dd');
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* // Returns: false
|
|
16
|
-
* isRelationPopulated([]);
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Returns: false
|
|
20
|
-
* isRelationPopulated([
|
|
21
|
-
* {
|
|
22
|
-
* id: '7674e91b-598a-4a72-a5cd-9594736a34dd',
|
|
23
|
-
* relationTo: 'articles',
|
|
24
|
-
* documentId: 'b674e91b-598a-4a72-a5cd-9594736a34dd'
|
|
25
|
-
* }
|
|
26
|
-
* ]);
|
|
27
|
-
*/
|
|
28
|
-
export declare const isRelationPopulated: <T>(value: RelationValue<T>) => value is T[];
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { hasProps, isObjectLiteral } from '../../util/object.js';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if a relation field's value is populated with full documents.
|
|
4
|
-
*
|
|
5
|
-
* A relation is considered populated if it is an array of objects that do not
|
|
6
|
-
* contain only the relation identifiers (`id`, `relationTo`, `documentId`).
|
|
7
|
-
* If the value is a string or an array of relation identifier objects,
|
|
8
|
-
* it is considered not populated.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* // Returns: false
|
|
12
|
-
* isRelationPopulated('7674e91b-598a-4a72-a5cd-9594736a34dd');
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* // Returns: false
|
|
16
|
-
* isRelationPopulated([]);
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Returns: false
|
|
20
|
-
* isRelationPopulated([
|
|
21
|
-
* {
|
|
22
|
-
* id: '7674e91b-598a-4a72-a5cd-9594736a34dd',
|
|
23
|
-
* relationTo: 'articles',
|
|
24
|
-
* documentId: 'b674e91b-598a-4a72-a5cd-9594736a34dd'
|
|
25
|
-
* }
|
|
26
|
-
* ]);
|
|
27
|
-
*/
|
|
28
|
-
export const isRelationPopulated = (value) => {
|
|
29
|
-
if (Array.isArray(value)) {
|
|
30
|
-
if (value.length === 0)
|
|
31
|
-
return false;
|
|
32
|
-
return value.every((v) => {
|
|
33
|
-
return isObjectLiteral(v) && !hasProps(['id', 'relationTo', 'documentId'], v);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return typeof value !== 'string';
|
|
37
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|