rimecms 0.28.10 → 0.29.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/README.md +3 -3
- package/dist/adapter-sqlite/generate-schema/{util.d.ts → util.server.d.ts} +2 -2
- package/dist/adapter-sqlite/generate-schema/{util.js → util.server.js} +2 -2
- package/dist/adapter-sqlite/generate-schema/write.server.js +1 -1
- package/dist/adapter-sqlite/index.server.d.ts +2 -1
- package/dist/adapter-sqlite/index.server.js +2 -0
- package/dist/adapter-sqlite/transform.server.js +1 -1
- package/dist/adapter-sqlite/with.server.js +1 -1
- package/dist/core/areas/{api → rest}/get.server.d.ts +4 -2
- package/dist/core/areas/rest/get.server.js +45 -0
- package/dist/core/areas/rest/index.server.d.ts +6 -0
- package/dist/core/areas/rest/index.server.js +3 -0
- package/dist/core/areas/{api → rest}/update.server.d.ts +4 -2
- package/dist/core/areas/rest/update.server.js +43 -0
- package/dist/core/collections/auth/hooks/before-upsert/augment-fields-password.server.d.ts +1 -1
- package/dist/core/collections/config/augment-panel.d.ts +1 -1
- package/dist/core/collections/operations/duplicate.js +2 -2
- package/dist/core/collections/{api → rest}/create.server.d.ts +4 -2
- package/dist/core/collections/rest/create.server.js +37 -0
- package/dist/core/collections/{api → rest}/delete.server.d.ts +4 -2
- package/dist/core/collections/rest/delete.server.js +37 -0
- package/dist/core/collections/{api → rest}/deleteById.server.d.ts +4 -2
- package/dist/core/collections/rest/deleteById.server.js +21 -0
- package/dist/core/collections/{api → rest}/duplicate.server.d.ts +1 -1
- package/dist/core/collections/rest/duplicate.server.js +16 -0
- package/dist/core/collections/{api → rest}/get.server.d.ts +4 -2
- package/dist/core/collections/rest/get.server.js +50 -0
- package/dist/core/collections/{api → rest}/getById.server.d.ts +4 -2
- package/dist/core/collections/rest/getById.server.js +35 -0
- package/dist/core/collections/rest/index.server.d.ts +16 -0
- package/dist/core/collections/rest/index.server.js +16 -0
- package/dist/core/collections/{api → rest}/updateById.server.d.ts +4 -2
- package/dist/core/collections/rest/updateById.server.js +44 -0
- package/dist/core/collections/upload/hooks/convert-base64.server.d.ts +1 -1
- package/dist/core/collections/upload/hooks/extract-path.server.d.ts +1 -1
- package/dist/core/collections/upload/hooks/handle-path-creation.server.d.ts +1 -1
- package/dist/core/collections/upload/hooks/process-file-upload.server.d.ts +1 -1
- package/dist/core/config/auth/better-auth.server.d.ts +2 -2
- package/dist/core/config/client/augment-directories.js +1 -1
- package/dist/core/config/config-context.server.d.ts +3 -3
- package/dist/core/config/server/augment-directories.server.js +1 -1
- package/dist/core/config/server/augment-panel-access.server.d.ts +1 -1
- package/dist/core/config/server/build-config.server.d.ts +11 -11
- package/dist/core/config/server/validate.server.js +3 -3
- package/dist/core/config/shared/find-thumbnail.js +1 -1
- package/dist/core/constant.d.ts +1 -1
- package/dist/core/constant.js +1 -1
- package/dist/core/dev/cli/build/index.d.ts +1 -0
- package/dist/core/dev/cli/build/index.js +39 -10
- package/dist/core/dev/cli/build/templates.d.ts +1 -0
- package/dist/core/dev/cli/build/templates.js +24 -0
- package/dist/core/dev/cli/clear/index.server.js +1 -1
- package/dist/core/dev/cli/index.js +20 -0
- package/dist/core/dev/cli/init/index.server.js +3 -3
- package/dist/core/dev/cli/init/templates.d.ts +1 -1
- package/dist/core/dev/cli/init/templates.js +2 -2
- package/dist/core/dev/cli/util/log.server.d.ts +1 -0
- package/dist/core/dev/cli/util/log.server.js +4 -0
- package/dist/core/dev/cli/util/package-manager.server.d.ts +9 -0
- package/dist/core/dev/cli/{init/package-manager-util.server.js → util/package-manager.server.js} +15 -0
- package/dist/core/dev/cli/util/package.server.d.ts +9 -0
- package/dist/core/dev/cli/{init/get-package-info.server.js → util/package.server.js} +10 -0
- package/dist/core/dev/generate/routes/common.server.d.ts +10 -1
- package/dist/core/dev/generate/routes/common.server.js +248 -29
- package/dist/core/dev/generate/routes/index.server.d.ts +7 -1
- package/dist/core/dev/generate/routes/index.server.js +16 -55
- package/dist/core/dev/generate/routes/util.server.d.ts +6 -16
- package/dist/core/dev/generate/routes/util.server.js +8 -21
- package/dist/core/dev/generate/types/index.server.js +5 -3
- package/dist/core/dev/vite/index.server.js +1 -1
- package/dist/core/errors/handler.server.d.ts +22 -1
- package/dist/core/errors/handler.server.js +25 -2
- package/dist/core/errors/index.d.ts +0 -1
- package/dist/core/errors/index.js +0 -1
- package/dist/core/fields/util.d.ts +1 -1
- package/dist/core/handlers/routes.server.d.ts +70 -1
- package/dist/core/handlers/routes.server.js +55 -1
- package/dist/core/operations/hooks/before-upsert/data-config-map.server.d.ts +1 -1
- package/dist/core/operations/hooks/before-upsert/handle-new-version.server.d.ts +1 -1
- package/dist/core/operations/hooks/before-upsert/original-config-map.server.d.ts +1 -1
- package/dist/core/operations/hooks/before-upsert/set-default-values.server.d.ts +1 -1
- package/dist/core/operations/hooks/before-upsert/validate-fields.server.d.ts +1 -1
- package/dist/core/plugins/api-init/index.server.js +10 -5
- package/dist/core/plugins/cache/cache.server.js +1 -1
- package/dist/core/rime.server.d.ts +10 -10
- package/dist/core/rime.server.js +5 -1
- package/dist/fields/checkbox/index.server.js +1 -1
- package/dist/fields/combobox/index.server.js +1 -1
- package/dist/fields/date/index.server.js +1 -1
- package/dist/fields/email/index.js +1 -1
- package/dist/fields/email/index.server.js +1 -1
- package/dist/fields/link/component/RessourceInput.svelte +1 -1
- package/dist/fields/link/index.d.ts +1 -1
- package/dist/fields/link/index.js +1 -1
- package/dist/fields/link/index.server.js +1 -1
- package/dist/fields/number/index.server.js +1 -1
- package/dist/fields/radio/index.server.js +1 -1
- package/dist/fields/relation/client.d.ts +1 -1
- package/dist/fields/relation/client.js +1 -1
- package/dist/fields/relation/component/Cell.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/relation/index.d.ts +1 -1
- package/dist/fields/relation/index.js +2 -2
- package/dist/fields/relation/index.server.js +1 -1
- package/dist/fields/rich-text/core/features/fields/extension.d.ts +2 -2
- package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +1 -1
- package/dist/fields/rich-text/core/features/resource/resource-extension.d.ts +1 -1
- package/dist/fields/rich-text/core/features/resource/resource.svelte +1 -1
- package/dist/fields/rich-text/core/features/upload/upload-extension.d.ts +1 -1
- package/dist/fields/rich-text/core/features/upload/upload.svelte +1 -1
- package/dist/fields/rich-text/index.js +4 -2
- package/dist/fields/rich-text/index.server.js +1 -1
- package/dist/fields/select/index.server.js +1 -1
- package/dist/fields/slug/index.server.js +1 -1
- package/dist/fields/text/index.server.js +1 -1
- package/dist/fields/textarea/index.server.js +1 -1
- package/dist/fields/time/index.server.js +1 -1
- package/dist/fields/toggle/index.server.js +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +7 -3
- package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +1 -1
- package/dist/panel/components/sections/document/ButtonStatus.svelte +1 -1
- package/dist/panel/components/sections/document/CurrentlyEdited.svelte +1 -1
- package/dist/panel/components/sections/document/Settings.svelte +1 -1
- package/dist/panel/context/collection.svelte.js +1 -1
- package/dist/panel/context/documentForm.svelte.js +1 -2
- package/dist/panel/context/form.svelte.d.ts +2 -0
- package/dist/panel/context/form.svelte.js +8 -2
- package/dist/panel/context/live.svelte.js +1 -1
- package/dist/panel/index.d.ts +9 -1
- package/dist/panel/index.js +7 -1
- package/dist/panel/pages/area/actions.server.d.ts +2 -21
- package/dist/panel/pages/area/actions.server.js +28 -27
- package/dist/panel/pages/area/load.server.d.ts +2 -17
- package/dist/panel/pages/area/load.server.js +37 -46
- package/dist/panel/pages/auth/sign-in/SignIn.svelte +7 -1
- package/dist/panel/pages/collection/load.server.d.ts +6 -6
- package/dist/panel/pages/collection/load.server.js +70 -72
- package/dist/panel/pages/collection-document/actions.server.d.ts +1 -1
- package/dist/panel/pages/collection-document/actions.server.js +78 -70
- package/dist/panel/pages/collection-document/load.server.d.ts +5 -20
- package/dist/panel/pages/collection-document/load.server.js +80 -82
- package/dist/server.d.ts +7 -0
- package/dist/server.js +7 -0
- package/dist/types.d.ts +1 -0
- package/dist/util/index.d.ts +9 -1
- package/dist/util/index.js +12 -1
- package/package.json +6 -49
- package/dist/core/api/index.d.ts +0 -7
- package/dist/core/api/index.js +0 -10
- package/dist/core/api/index.server.d.ts +0 -3
- package/dist/core/api/index.server.js +0 -3
- package/dist/core/areas/api/get.server.js +0 -36
- package/dist/core/areas/api/index.server.d.ts +0 -7
- package/dist/core/areas/api/index.server.js +0 -4
- package/dist/core/areas/api/update.server.js +0 -33
- package/dist/core/collections/api/create.server.js +0 -29
- package/dist/core/collections/api/delete.server.js +0 -32
- package/dist/core/collections/api/deleteById.server.js +0 -16
- package/dist/core/collections/api/duplicate.server.js +0 -18
- package/dist/core/collections/api/get.server.js +0 -45
- package/dist/core/collections/api/getById.server.js +0 -30
- package/dist/core/collections/api/index.server.d.ts +0 -17
- package/dist/core/collections/api/index.server.js +0 -9
- package/dist/core/collections/api/updateById.server.js +0 -38
- package/dist/core/dev/cli/init/get-package-info.server.d.ts +0 -1
- package/dist/core/dev/cli/init/package-manager-util.server.d.ts +0 -3
- package/dist/core/dev/generate/routes/area.server.d.ts +0 -7
- package/dist/core/dev/generate/routes/area.server.js +0 -69
- package/dist/core/dev/generate/routes/collection.server.d.ts +0 -14
- package/dist/core/dev/generate/routes/collection.server.js +0 -129
- package/dist/live.d.ts +0 -4
- package/dist/live.js +0 -4
- package/dist/panel/index.server.d.ts +0 -4
- package/dist/panel/index.server.js +0 -4
- package/dist/panel/pages/auth/index.d.ts +0 -4
- package/dist/panel/pages/auth/index.js +0 -4
- package/dist/panel/pages/auth/index.server.d.ts +0 -18
- package/dist/panel/pages/auth/index.server.js +0 -12
- package/dist/panel/pages/index.actions.server.d.ts +0 -13
- package/dist/panel/pages/index.actions.server.js +0 -10
- package/dist/panel/pages/index.load.server.d.ts +0 -23
- package/dist/panel/pages/index.load.server.js +0 -16
- package/dist/panel/ui.d.ts +0 -4
- package/dist/panel/ui.js +0 -5
- /package/dist/core/dev/cli/{util.server.d.ts → util/prompt.server.d.ts} +0 -0
- /package/dist/core/dev/cli/{util.server.js → util/prompt.server.js} +0 -0
|
@@ -6,9 +6,30 @@ import { RimeError, RimeFormError } from './index.js';
|
|
|
6
6
|
export const ERROR_CONTEXT = {
|
|
7
7
|
ACTION: 'action',
|
|
8
8
|
API: 'api',
|
|
9
|
-
LOAD: 'load'
|
|
10
|
-
HANDLER: 'handler'
|
|
9
|
+
LOAD: 'load'
|
|
11
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Only called at the route boundary: +server.ts handlers, load functions,
|
|
13
|
+
* form actions. Everywhere else, just `throw new RimeError(...)` (centralizes
|
|
14
|
+
* error codes/messages) — it bubbles up and gets caught here, where `context`
|
|
15
|
+
* tells this function which SvelteKit primitive to translate it into:
|
|
16
|
+
* `error()` (api/load), `redirect()`, or `fail()` (action form errors).
|
|
17
|
+
*
|
|
18
|
+
* Always call it as `return handleError(...)`. Most branches throw internally
|
|
19
|
+
* (`error`/`redirect`), so `return` never runs — but the `fail()` branch (form
|
|
20
|
+
* errors in actions) is a real return value, so `return` is required there.
|
|
21
|
+
*
|
|
22
|
+
* @example +server.ts endpoint
|
|
23
|
+
* if (!id) return handleError(new RimeError(RimeError.NOT_FOUND), { context: ERROR_CONTEXT.API });
|
|
24
|
+
*
|
|
25
|
+
* @example load function
|
|
26
|
+
* const [err, doc] = await trycatch(() => getDoc(id));
|
|
27
|
+
* if (err) return handleError(err, { context: ERROR_CONTEXT.LOAD });
|
|
28
|
+
*
|
|
29
|
+
* @example form action
|
|
30
|
+
* const [err] = await trycatch(() => save(data));
|
|
31
|
+
* if (err) return handleError(err, { context: ERROR_CONTEXT.ACTION, formData: data });
|
|
32
|
+
*/
|
|
12
33
|
export function handleError(err, options) {
|
|
13
34
|
const { context, formData } = options;
|
|
14
35
|
/****************************************************/
|
|
@@ -17,6 +38,8 @@ export function handleError(err, options) {
|
|
|
17
38
|
if (err instanceof RimeFormError) {
|
|
18
39
|
switch (context) {
|
|
19
40
|
case ERROR_CONTEXT.ACTION:
|
|
41
|
+
// fail() returns an ActionFailure — lets SvelteKit re-render the form
|
|
42
|
+
// with `errors`/`form` instead of navigating to the error boundary.
|
|
20
43
|
return fail(400, {
|
|
21
44
|
form: formData || {},
|
|
22
45
|
errors: err.errors
|
|
@@ -20,7 +20,6 @@ declare class RimeError extends Error {
|
|
|
20
20
|
constructor(code: string, message?: string, ...args: any);
|
|
21
21
|
}
|
|
22
22
|
declare class RimeFormError extends RimeError {
|
|
23
|
-
static INVALID_DATA: string;
|
|
24
23
|
static INVALID_EMAIL: string;
|
|
25
24
|
static INVALID_FIELD: string;
|
|
26
25
|
static INVALID_PHONE: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Field, FormField, SeparatorField } from '../../fields/types.js';
|
|
2
2
|
import type { Dic } from '../../util/types.js';
|
|
3
|
-
import type { FieldBuilder } from './builders';
|
|
3
|
+
import type { FieldBuilder } from './builders/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Checks if a field is a presentative field (currently only separator fields).
|
|
6
6
|
* Presentative fields are used for UI organization and don't store data.
|
|
@@ -1,2 +1,71 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { areaLoad } from '../../panel/pages/area/load.server.js';
|
|
2
|
+
import { documentLoad } from '../../panel/pages/collection-document/load.server.js';
|
|
3
|
+
import { collectionLoad } from '../../panel/pages/collection/load.server.js';
|
|
4
|
+
import { liveLoad } from '../../panel/pages/live/load.server.js';
|
|
5
|
+
import { checkLiveRedirect } from '../../panel/util/live.server.js';
|
|
6
|
+
import { type Handle, type RequestEvent, type ServerLoadEvent } from '@sveltejs/kit';
|
|
7
|
+
/**
|
|
8
|
+
* Backs the fixed set of generated /panel/[slug=collection|area]/... and
|
|
9
|
+
* /api/[slug=collection|area]/... routes — each of these reads slug/id off
|
|
10
|
+
* event.params itself (a real dynamic route param), so the generated file
|
|
11
|
+
* just passes event straight through, no import needed. The param matchers
|
|
12
|
+
* (src/params/collection.ts, area.ts) already disambiguate collection vs
|
|
13
|
+
* area at the router level, so rest.collection/rest.area need no runtime
|
|
14
|
+
* isArea/id branching — each generated route calls the one method that
|
|
15
|
+
* matches its own folder. Deliberately lives outside rime.server.ts: app
|
|
16
|
+
* authors never touch this, and importing these panel/api wrappers there
|
|
17
|
+
* would make RimeContext's inferred type depend on functions that read
|
|
18
|
+
* event.locals.rime — i.e. on itself.
|
|
19
|
+
*/
|
|
20
|
+
export declare const routeHandlers: {
|
|
21
|
+
checkLiveRedirect: typeof checkLiveRedirect;
|
|
22
|
+
panel: {
|
|
23
|
+
load: {
|
|
24
|
+
collection: typeof collectionLoad;
|
|
25
|
+
document: typeof documentLoad;
|
|
26
|
+
documentVersions: (event: ServerLoadEvent) => Promise<import("../../panel/index.js").CollectionDocData<true>>;
|
|
27
|
+
area: typeof areaLoad;
|
|
28
|
+
areaVersions: (event: ServerLoadEvent) => Promise<import("../../panel/index.js").AreaDocData<true>>;
|
|
29
|
+
dashboard: (event: ServerLoadEvent) => Promise<{
|
|
30
|
+
entries: import("../../panel/pages/dashboard/types.js").DashboardEntry[];
|
|
31
|
+
aria: import("../../types.js").Route[];
|
|
32
|
+
}>;
|
|
33
|
+
live: typeof liveLoad;
|
|
34
|
+
signIn: ({ locals }: ServerLoadEvent) => Promise<{
|
|
35
|
+
forgotPasswordEnabled: boolean;
|
|
36
|
+
image: string | null;
|
|
37
|
+
form: {};
|
|
38
|
+
}>;
|
|
39
|
+
forgotPassword: ({ locals }: ServerLoadEvent) => Promise<{
|
|
40
|
+
form: {};
|
|
41
|
+
image: string | null;
|
|
42
|
+
}>;
|
|
43
|
+
resetPassword: ({ locals, url }: ServerLoadEvent) => Promise<{
|
|
44
|
+
image: string | null;
|
|
45
|
+
token: string;
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
actions: {
|
|
49
|
+
document: import("@sveltejs/kit").Actions;
|
|
50
|
+
area: import("@sveltejs/kit").Actions;
|
|
51
|
+
signIn: (event: RequestEvent) => any;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
rest: {
|
|
55
|
+
collection: {
|
|
56
|
+
get: typeof import("../collections/rest/get.server.js").restGet;
|
|
57
|
+
getById: typeof import("../collections/rest/getById.server.js").restGetById;
|
|
58
|
+
deleteById: typeof import("../collections/rest/deleteById.server.js").restDeleteById;
|
|
59
|
+
delete: typeof import("../collections/rest/delete.server.js").restDelete;
|
|
60
|
+
create: typeof import("../collections/rest/create.server.js").restCreate;
|
|
61
|
+
updateById: typeof import("../collections/rest/updateById.server.js").restUpdateById;
|
|
62
|
+
duplicate: typeof import("../collections/rest/duplicate.server.js").restDuplicate;
|
|
63
|
+
};
|
|
64
|
+
area: {
|
|
65
|
+
get: typeof import("../areas/rest/get.server.js").restGet;
|
|
66
|
+
update: typeof import("../areas/rest/update.server.js").restUpdate;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
2
70
|
export declare const handleRoutes: Handle;
|
|
71
|
+
export type RouteHandlers = typeof routeHandlers;
|
|
@@ -1,13 +1,67 @@
|
|
|
1
1
|
import buildNavigation from '../../panel/navigation.js';
|
|
2
|
+
import { areaFormActions } from '../../panel/pages/area/actions.server.js';
|
|
3
|
+
import { areaLoad } from '../../panel/pages/area/load.server.js';
|
|
4
|
+
import { forgotPasswordLoad } from '../../panel/pages/auth/forgot-password/load.server.js';
|
|
5
|
+
import { resetPasswordLoad } from '../../panel/pages/auth/reset-password/load.server.js';
|
|
6
|
+
import { signInActions } from '../../panel/pages/auth/sign-in/actions.server.js';
|
|
7
|
+
import { signInLoad } from '../../panel/pages/auth/sign-in/load.server.js';
|
|
8
|
+
import { collectionFormActions } from '../../panel/pages/collection-document/actions.server.js';
|
|
9
|
+
import { documentLoad } from '../../panel/pages/collection-document/load.server.js';
|
|
10
|
+
import { collectionLoad } from '../../panel/pages/collection/load.server.js';
|
|
11
|
+
import { dashboardLoad } from '../../panel/pages/dashboard/load.server.js';
|
|
12
|
+
import { liveLoad } from '../../panel/pages/live/load.server.js';
|
|
13
|
+
import { checkLiveRedirect } from '../../panel/util/live.server.js';
|
|
2
14
|
import {} from '@sveltejs/kit';
|
|
15
|
+
import { rest as areaRest } from '../areas/rest/index.server.js';
|
|
16
|
+
import { rest as collectionRest } from '../collections/rest/index.server.js';
|
|
17
|
+
/**
|
|
18
|
+
* Backs the fixed set of generated /panel/[slug=collection|area]/... and
|
|
19
|
+
* /api/[slug=collection|area]/... routes — each of these reads slug/id off
|
|
20
|
+
* event.params itself (a real dynamic route param), so the generated file
|
|
21
|
+
* just passes event straight through, no import needed. The param matchers
|
|
22
|
+
* (src/params/collection.ts, area.ts) already disambiguate collection vs
|
|
23
|
+
* area at the router level, so rest.collection/rest.area need no runtime
|
|
24
|
+
* isArea/id branching — each generated route calls the one method that
|
|
25
|
+
* matches its own folder. Deliberately lives outside rime.server.ts: app
|
|
26
|
+
* authors never touch this, and importing these panel/api wrappers there
|
|
27
|
+
* would make RimeContext's inferred type depend on functions that read
|
|
28
|
+
* event.locals.rime — i.e. on itself.
|
|
29
|
+
*/
|
|
30
|
+
export const routeHandlers = {
|
|
31
|
+
checkLiveRedirect,
|
|
32
|
+
panel: {
|
|
33
|
+
load: {
|
|
34
|
+
collection: collectionLoad,
|
|
35
|
+
document: documentLoad,
|
|
36
|
+
documentVersions: (event) => documentLoad(event, true),
|
|
37
|
+
area: areaLoad,
|
|
38
|
+
areaVersions: (event) => areaLoad(event, true),
|
|
39
|
+
dashboard: dashboardLoad,
|
|
40
|
+
live: liveLoad,
|
|
41
|
+
signIn: signInLoad,
|
|
42
|
+
forgotPassword: forgotPasswordLoad,
|
|
43
|
+
resetPassword: resetPasswordLoad
|
|
44
|
+
},
|
|
45
|
+
actions: {
|
|
46
|
+
document: collectionFormActions,
|
|
47
|
+
area: areaFormActions,
|
|
48
|
+
signIn: signInActions.default
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
rest: {
|
|
52
|
+
collection: collectionRest,
|
|
53
|
+
area: areaRest
|
|
54
|
+
}
|
|
55
|
+
};
|
|
3
56
|
export const handleRoutes = async ({ event, resolve }) => {
|
|
4
57
|
const { rime, user } = event.locals;
|
|
5
58
|
const isSignInRoute = event.url.pathname === '/panel/sign-in';
|
|
6
59
|
const isPanelRoute = event.url.pathname.startsWith('/panel') && !isSignInRoute;
|
|
7
60
|
// build panel navigation
|
|
8
61
|
if (isPanelRoute && event.request.method === 'GET') {
|
|
9
|
-
event.locals.
|
|
62
|
+
event.locals.navigation = buildNavigation(rime.config.raw, user);
|
|
10
63
|
}
|
|
64
|
+
event.locals.routes = routeHandlers;
|
|
11
65
|
// Handle custom routes from config and plugins
|
|
12
66
|
const routes = '$routes' in rime.config.raw ? rime.config.raw.$routes : null;
|
|
13
67
|
if (routes && event.url.pathname in routes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const buildDataConfigMap: import("../index.server.js").Hook<"raw", "
|
|
1
|
+
export declare const buildDataConfigMap: import("../index.server.js").Hook<"raw", "update" | "create", "before">;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Handles version-related operations for document updates
|
|
3
3
|
* Manages specific version updates and new version creation
|
|
4
4
|
*/
|
|
5
|
-
export declare const handleNewVersion: import("../index.server.js").Hook<"raw", "
|
|
5
|
+
export declare const handleNewVersion: import("../index.server.js").Hook<"raw", "update" | "create", "before">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const buildOriginalDocConfigMap: import("../index.server.js").Hook<"raw", "
|
|
1
|
+
export declare const buildOriginalDocConfigMap: import("../index.server.js").Hook<"raw", "update" | "create", "before">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Adapter } from '../../../../adapter-sqlite/index.server.js';
|
|
2
2
|
import type { FormField } from '../../../../fields/types.js';
|
|
3
|
-
export declare const setDefaultValues: import("../index.server.js").Hook<"raw", "
|
|
3
|
+
export declare const setDefaultValues: import("../index.server.js").Hook<"raw", "update" | "create", "before">;
|
|
4
4
|
type GetDefaultValue = (args: {
|
|
5
5
|
key: string;
|
|
6
6
|
config: FormField & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const validateFields: import("../index.server.js").Hook<"raw", "
|
|
1
|
+
export declare const validateFields: import("../index.server.js").Hook<"raw", "update" | "create", "before">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { dev } from '$app/environment';
|
|
2
|
-
import { handleError } from '../../errors/handler.server.js';
|
|
2
|
+
import { ERROR_CONTEXT, handleError } from '../../errors/handler.server.js';
|
|
3
3
|
import { RimeError, RimeFormError } from '../../errors/index.js';
|
|
4
4
|
import { extractData } from '../../operations/extract-data.server.js';
|
|
5
5
|
import { trycatch, trycatchSync } from '../../../util/function.js';
|
|
@@ -12,13 +12,18 @@ export const apiInit = definePlugin(() => {
|
|
|
12
12
|
throw new RimeError(RimeError.NOT_FOUND);
|
|
13
13
|
const hasAuthUser = await event.locals.rime.adapter.auth.hasAuthUser();
|
|
14
14
|
if (hasAuthUser || (!hasAuthUser && !dev)) {
|
|
15
|
-
throw handleError(new RimeError(RimeError.NOT_FOUND), { context:
|
|
15
|
+
throw handleError(new RimeError(RimeError.NOT_FOUND), { context: ERROR_CONTEXT.API });
|
|
16
|
+
}
|
|
17
|
+
const [extractError, data] = await trycatch(() => extractData(event.request));
|
|
18
|
+
if (extractError) {
|
|
19
|
+
throw handleError(new RimeError(RimeError.INVALID_DATA, extractError.message), {
|
|
20
|
+
context: ERROR_CONTEXT.API
|
|
21
|
+
});
|
|
16
22
|
}
|
|
17
|
-
const data = await extractData(event.request);
|
|
18
23
|
const [error] = trycatchSync(() => validateForm(data));
|
|
19
24
|
if (error) {
|
|
20
|
-
throw handleError(error, {
|
|
21
|
-
context:
|
|
25
|
+
throw handleError(new RimeError(RimeError.INVALID_DATA, error.message), {
|
|
26
|
+
context: ERROR_CONTEXT.ACTION,
|
|
22
27
|
formData: { email: data.email }
|
|
23
28
|
});
|
|
24
29
|
}
|
|
@@ -1761,13 +1761,13 @@ export declare function createRime<const C extends Config>(config: BuildConfig<C
|
|
|
1761
1761
|
$Infer: {
|
|
1762
1762
|
body: ({
|
|
1763
1763
|
permission: {
|
|
1764
|
-
readonly user?: ("
|
|
1764
|
+
readonly user?: ("update" | "create" | "delete" | "list" | "get" | "set-role" | "ban" | "impersonate" | "set-password")[] | undefined;
|
|
1765
1765
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
1766
1766
|
};
|
|
1767
1767
|
permissions?: never | undefined;
|
|
1768
1768
|
} | {
|
|
1769
1769
|
permissions: {
|
|
1770
|
-
readonly user?: ("
|
|
1770
|
+
readonly user?: ("update" | "create" | "delete" | "list" | "get" | "set-role" | "ban" | "impersonate" | "set-password")[] | undefined;
|
|
1771
1771
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
1772
1772
|
};
|
|
1773
1773
|
permission?: never | undefined;
|
|
@@ -1982,9 +1982,9 @@ export declare function createRime<const C extends Config>(config: BuildConfig<C
|
|
|
1982
1982
|
isValidLocale: (locale: string) => boolean;
|
|
1983
1983
|
getArea: (slug: string) => import("./config/types.js").BuiltArea;
|
|
1984
1984
|
getCollection: (slug: string) => import("./config/types.js").BuiltCollection;
|
|
1985
|
-
getBySlug: (slug: string) => import("./config/types.js").
|
|
1986
|
-
isCollection: (slug
|
|
1987
|
-
isArea: (slug
|
|
1985
|
+
getBySlug: (slug: string) => import("./config/types.js").BuiltArea | import("./config/types.js").BuiltCollection;
|
|
1986
|
+
isCollection: (slug?: string) => slug is import("./types/doc.js").CollectionSlug;
|
|
1987
|
+
isArea: (slug?: string) => slug is import("./types/doc.js").AreaSlug;
|
|
1988
1988
|
getDocumentPrototype(slug: import("./types/doc.js").PrototypeSlug): "area" | "collection";
|
|
1989
1989
|
};
|
|
1990
1990
|
readonly plugins: {
|
|
@@ -3767,13 +3767,13 @@ export declare function createRime<const C extends Config>(config: BuildConfig<C
|
|
|
3767
3767
|
$Infer: {
|
|
3768
3768
|
body: ({
|
|
3769
3769
|
permission: {
|
|
3770
|
-
readonly user?: ("
|
|
3770
|
+
readonly user?: ("update" | "create" | "delete" | "list" | "get" | "set-role" | "ban" | "impersonate" | "set-password")[] | undefined;
|
|
3771
3771
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
3772
3772
|
};
|
|
3773
3773
|
permissions?: never | undefined;
|
|
3774
3774
|
} | {
|
|
3775
3775
|
permissions: {
|
|
3776
|
-
readonly user?: ("
|
|
3776
|
+
readonly user?: ("update" | "create" | "delete" | "list" | "get" | "set-role" | "ban" | "impersonate" | "set-password")[] | undefined;
|
|
3777
3777
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
3778
3778
|
};
|
|
3779
3779
|
permission?: never | undefined;
|
|
@@ -4004,9 +4004,9 @@ export declare function createRime<const C extends Config>(config: BuildConfig<C
|
|
|
4004
4004
|
isValidLocale: (locale: string) => boolean;
|
|
4005
4005
|
getArea: (slug: string) => import("./config/types.js").BuiltArea;
|
|
4006
4006
|
getCollection: (slug: string) => import("./config/types.js").BuiltCollection;
|
|
4007
|
-
getBySlug: (slug: string) => import("./config/types.js").
|
|
4008
|
-
isCollection: (slug
|
|
4009
|
-
isArea: (slug
|
|
4007
|
+
getBySlug: (slug: string) => import("./config/types.js").BuiltArea | import("./config/types.js").BuiltCollection;
|
|
4008
|
+
isCollection: (slug?: string) => slug is import("./types/doc.js").CollectionSlug;
|
|
4009
|
+
isArea: (slug?: string) => slug is import("./types/doc.js").AreaSlug;
|
|
4010
4010
|
getDocumentPrototype(slug: import("./types/doc.js").PrototypeSlug): "area" | "collection";
|
|
4011
4011
|
};
|
|
4012
4012
|
/**
|
package/dist/core/rime.server.js
CHANGED
|
@@ -79,7 +79,11 @@ export async function createRime(config) {
|
|
|
79
79
|
function defineLocale(event) {
|
|
80
80
|
// locale present inside the url params ex : /en/foo
|
|
81
81
|
const params = event.params;
|
|
82
|
-
const paramLocale = 'locale' in params &&
|
|
82
|
+
const paramLocale = 'locale' in params &&
|
|
83
|
+
typeof params.locale === 'string' &&
|
|
84
|
+
configCtx.getLocalesCodes().includes(params.locale)
|
|
85
|
+
? params.locale
|
|
86
|
+
: null;
|
|
83
87
|
// locale present as a search param ex : ?locale=en
|
|
84
88
|
const searchParams = event.url.searchParams;
|
|
85
89
|
const hasParams = searchParams.toString();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { templateUniqueRequired } from '../../adapter-sqlite/generate-schema/templates.server.js';
|
|
2
|
-
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.js';
|
|
2
|
+
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.server.js';
|
|
3
3
|
export const toSchema = (field, parentPath) => {
|
|
4
4
|
const { camel, snake } = getSchemaColumnNames({ name: field.raw.name, parentPath });
|
|
5
5
|
const suffix = templateUniqueRequired(field.raw, field.raw.defaultValue ?? false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { templateUniqueRequired } from '../../adapter-sqlite/generate-schema/templates.server.js';
|
|
2
|
-
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.js';
|
|
2
|
+
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.server.js';
|
|
3
3
|
export const toSchema = (field, parentPath) => {
|
|
4
4
|
const { camel, snake } = getSchemaColumnNames({ name: field.raw.name, parentPath });
|
|
5
5
|
const suffix = templateUniqueRequired({ ...field.raw }, typeof field.raw.defaultValue === 'string' ? field.raw.defaultValue : '');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { templateUniqueRequired } from '../../adapter-sqlite/generate-schema/templates.server.js';
|
|
2
|
-
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.js';
|
|
2
|
+
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.server.js';
|
|
3
3
|
export const toSchema = (field, parentPath) => {
|
|
4
4
|
const { camel, snake } = getSchemaColumnNames({ name: field.raw.name, parentPath });
|
|
5
5
|
const suffix = templateUniqueRequired({ ...field.raw }, field.raw.defaultValue instanceof Date ? field.raw.defaultValue.getTime() : 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormFieldBuilder } from '../../core/fields/builders/form-field-builder.js';
|
|
2
|
-
import { sanitize } from '../../util/string';
|
|
2
|
+
import { sanitize } from '../../util/string.js';
|
|
3
3
|
import validate from '../../util/validate.js';
|
|
4
4
|
import EmailComp from './component/Email.svelte';
|
|
5
5
|
class EmailFieldBuilder extends FormFieldBuilder {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { templateUniqueRequired } from '../../adapter-sqlite/generate-schema/templates.server.js';
|
|
2
|
-
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.js';
|
|
2
|
+
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.server.js';
|
|
3
3
|
export function toSchema(field, parentPath) {
|
|
4
4
|
const { camel, snake } = getSchemaColumnNames({ name: field.name, parentPath });
|
|
5
5
|
const suffix = templateUniqueRequired({ unique: field.raw.unique, required: field.raw.required }, typeof field.raw.defaultValue === 'string' ? field.raw.defaultValue : '');
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { apiUrl } from '../../../core/api/index.js';
|
|
3
2
|
import { t__ } from '../../../core/i18n/index.js';
|
|
4
3
|
import type { GenericDoc } from '../../../core/types/doc.js';
|
|
5
4
|
import * as Command from '../../../panel/components/ui/command/index.js';
|
|
6
5
|
import Tag from '../../../panel/components/ui/tag/tag.svelte';
|
|
7
6
|
import { getAPIProxyContext } from '../../../panel/context/api-proxy.svelte.js';
|
|
8
7
|
import type { PrototypeSlug } from '../../../types';
|
|
8
|
+
import { apiUrl } from '../../../util/index.js';
|
|
9
9
|
import { toKebabCase } from '../../../util/string';
|
|
10
10
|
|
|
11
11
|
type Ressource = {
|
|
@@ -53,7 +53,7 @@ export declare class LinkFieldBuilder extends FormFieldBuilder<LinkField> {
|
|
|
53
53
|
} | undefined;
|
|
54
54
|
isEmpty: (value: unknown) => boolean;
|
|
55
55
|
layout: "compact" | "default";
|
|
56
|
-
types: "tel"[] | "
|
|
56
|
+
types: "tel"[] | "email"[] | "url"[] | "anchor"[];
|
|
57
57
|
} & {
|
|
58
58
|
component: import("svelte").Component<any>;
|
|
59
59
|
cell?: import("svelte").Component<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormFieldBuilder } from '../../core/fields/builders/form-field-builder.js';
|
|
2
|
-
import { sanitize } from '../../util/string';
|
|
2
|
+
import { sanitize } from '../../util/string.js';
|
|
3
3
|
import validate from '../../util/validate.js';
|
|
4
4
|
import Cell from './component/Cell.svelte';
|
|
5
5
|
import LinkComp from './component/Link.svelte';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { templateUniqueRequired } from '../../adapter-sqlite/generate-schema/templates.server.js';
|
|
2
|
-
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.js';
|
|
2
|
+
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.server.js';
|
|
3
3
|
import { RimeError } from '../../core/errors/index.js';
|
|
4
4
|
import { logger } from '../../core/logger/index.server.js';
|
|
5
5
|
import { trycatch } from '../../util/function.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { templateUniqueRequired } from '../../adapter-sqlite/generate-schema/templates.server.js';
|
|
2
|
-
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.js';
|
|
2
|
+
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.server.js';
|
|
3
3
|
export const toSchema = (field, parentPath) => {
|
|
4
4
|
const { camel, snake } = getSchemaColumnNames({ name: field.name, parentPath });
|
|
5
5
|
const suffix = templateUniqueRequired(field.raw, typeof field.raw.defaultValue === 'number' ? field.raw.defaultValue : 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { templateUniqueRequired } from '../../adapter-sqlite/generate-schema/templates.server.js';
|
|
2
|
-
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.js';
|
|
2
|
+
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.server.js';
|
|
3
3
|
export const toSchema = (field, parentPath) => {
|
|
4
4
|
const { camel, snake } = getSchemaColumnNames({ name: field.raw.name, parentPath });
|
|
5
5
|
const suffix = templateUniqueRequired(field.raw, typeof field.raw.defaultValue === 'string' ? field.raw.defaultValue : '');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { env } from '$env/dynamic/public';
|
|
3
|
-
import { apiUrl } from '../../../core/api/index.js';
|
|
4
3
|
import type { GenericDoc } from '../../../core/types/doc.js';
|
|
5
4
|
import UploadThumbCell from '../../../panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte';
|
|
6
5
|
import { getAPIProxyContext } from '../../../panel/context/api-proxy.svelte.js';
|
|
6
|
+
import { apiUrl } from '../../../util/index.js';
|
|
7
7
|
import { toKebabCase } from '../../../util/string';
|
|
8
8
|
|
|
9
9
|
type Props = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { apiUrl } from '../../../core/api/index.js';
|
|
3
2
|
import { isUploadConfig } from '../../../core/collections/upload/util/config.js';
|
|
4
3
|
import type { GenericDoc } from '../../../core/types/doc.js';
|
|
5
4
|
import { Field } from '../../../panel/components/fields/index.js';
|
|
@@ -11,6 +10,7 @@
|
|
|
11
10
|
import { getLocaleContext } from '../../../panel/context/locale.svelte';
|
|
12
11
|
import { panelUrl } from '../../../panel/util/url.js';
|
|
13
12
|
import { moveItem } from '../../../util/array.js';
|
|
13
|
+
import { apiUrl } from '../../../util/index.js';
|
|
14
14
|
import { snapshot } from '../../../util/state.js';
|
|
15
15
|
import { getAPIProxyContext } from '../../../panel/context/api-proxy.svelte.js';
|
|
16
16
|
import type { Relation, RelationField } from '../index.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { apiUrl } from '../../../../core/api/index.js';
|
|
3
2
|
import type { Directory } from '../../../../core/collections/upload/upload';
|
|
4
3
|
import { t__ } from '../../../../core/i18n/index.js';
|
|
5
4
|
import { withDirectoriesSuffix } from '../../../../core/naming.js';
|
|
@@ -12,6 +11,7 @@
|
|
|
12
11
|
import Input from '../../../../panel/components/ui/input/input.svelte';
|
|
13
12
|
import { getAPIProxyContext } from '../../../../panel/context/api-proxy.svelte.js';
|
|
14
13
|
import type { BuiltCollection, UploadDoc } from '../../../../types';
|
|
14
|
+
import { apiUrl } from '../../../../util/index.js';
|
|
15
15
|
import { ListFilter, Search } from '@lucide/svelte';
|
|
16
16
|
|
|
17
17
|
type Props = { open: boolean; addValue: (item: string) => void; config: BuiltCollection };
|
|
@@ -2,7 +2,7 @@ import { FormFieldBuilder } from '../../core/fields/builders/form-field-builder.
|
|
|
2
2
|
import type { CollectionSlug, GenericDoc } from '../../core/types/doc.js';
|
|
3
3
|
import type { DefaultValueFn, Field, FieldHookShared, FormField, RelationRef, RelationValue } from '../types.js';
|
|
4
4
|
import type { RegisterCollection } from '../../index.js';
|
|
5
|
-
import type { WithOptional } from '../../util/types';
|
|
5
|
+
import type { WithOptional } from '../../util/types.js';
|
|
6
6
|
export declare const ensureRelationExists: FieldHookShared;
|
|
7
7
|
export declare class RelationFieldBuilder<Doc extends GenericDoc> extends FormFieldBuilder<RelationField<Doc>> {
|
|
8
8
|
_metaUrl: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { browser } from '$app/environment';
|
|
2
2
|
import { env } from '$env/dynamic/public';
|
|
3
|
-
import { PARAMS } from '../../core/constant';
|
|
3
|
+
import { PARAMS } from '../../core/constant.js';
|
|
4
4
|
import { FormFieldBuilder } from '../../core/fields/builders/form-field-builder.js';
|
|
5
|
-
import { trycatchFetch } from '../../util/function';
|
|
5
|
+
import { trycatchFetch } from '../../util/function.js';
|
|
6
6
|
import { hasProps, isObjectLiteral } from '../../util/object.js';
|
|
7
7
|
import { toKebabCase } from '../../util/string.js';
|
|
8
8
|
import Cell from './component/Cell.svelte';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { templateUniqueRequired } from '../../adapter-sqlite/generate-schema/templates.server.js';
|
|
2
|
-
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.js';
|
|
2
|
+
import { getSchemaColumnNames } from '../../adapter-sqlite/generate-schema/util.server.js';
|
|
3
3
|
import { capitalize } from '../../util/string.js';
|
|
4
4
|
export const toSchema = (field, parentPath) => {
|
|
5
5
|
const { camel, snake } = getSchemaColumnNames({ name: field.name, parentPath });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FieldBuilder } from '../../../../../core/fields/builders';
|
|
2
|
-
import type { FieldsPreviewProps } from '../../../../types';
|
|
1
|
+
import type { FieldBuilder } from '../../../../../core/fields/builders/index.js';
|
|
2
|
+
import type { FieldsPreviewProps } from '../../../../types.js';
|
|
3
3
|
import type { Dic } from '../../../../../util/types.js';
|
|
4
4
|
import { Node } from '@tiptap/core';
|
|
5
5
|
import type { Component } from 'svelte';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { env } from '$env/dynamic/public';
|
|
3
|
-
import { apiUrl } from '../../../../../../core/api';
|
|
4
3
|
import { t__ } from '../../../../../../core/i18n/index.js';
|
|
5
4
|
import IconButton from '../../../../component/bubble-menu/icon-button/icon-button.svelte';
|
|
6
5
|
import Button from '../../../../../../panel/components/ui/button/button.svelte';
|
|
@@ -8,6 +7,7 @@
|
|
|
8
7
|
import Input from '../../../../../../panel/components/ui/input/input.svelte';
|
|
9
8
|
import { getAPIProxyContext, type Resource } from '../../../../../../panel/context/api-proxy.svelte.js';
|
|
10
9
|
import { getLocaleContext } from '../../../../../../panel/context/locale.svelte';
|
|
10
|
+
import { apiUrl } from '../../../../../../util/index.js';
|
|
11
11
|
import validate from '../../../../../../util/validate.js';
|
|
12
12
|
import { CornerDownLeft, ExternalLink, Link2, Newspaper, Trash } from '@lucide/svelte';
|
|
13
13
|
import type { Editor } from '@tiptap/core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PrototypeSlug } from '../../../../../core/types/doc';
|
|
1
|
+
import type { PrototypeSlug } from '../../../../../core/types/doc.js';
|
|
2
2
|
import type { Dic } from '../../../../../util/types.js';
|
|
3
3
|
import { Node } from '@tiptap/core';
|
|
4
4
|
declare module '@tiptap/core' {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { apiUrl } from '../../../../../core/api';
|
|
3
2
|
import type { GenericDoc } from '../../../../../core/types/doc.js';
|
|
4
3
|
import Button from '../../../../../panel/components/ui/button/button.svelte';
|
|
5
4
|
import CardResource from '../../../../../panel/components/ui/card-resource/card-resource.svelte';
|
|
6
5
|
import * as Command from '../../../../../panel/components/ui/command/index.js';
|
|
7
6
|
import { getAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte.js';
|
|
7
|
+
import { apiUrl } from '../../../../../util/index.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';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CollectionSlug } from '../../../../../types';
|
|
1
|
+
import type { CollectionSlug } from '../../../../../types.js';
|
|
2
2
|
import type { Dic } from '../../../../../util/types.js';
|
|
3
3
|
import { Node } from '@tiptap/core';
|
|
4
4
|
export interface UploadFeatureExtensionOptions {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { apiUrl } from '../../../../../core/api';
|
|
3
2
|
import type { UploadDoc } from '../../../../../core/types/doc.js';
|
|
4
3
|
import UploadThumbCell from '../../../../../panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte';
|
|
5
4
|
import Button from '../../../../../panel/components/ui/button/button.svelte';
|
|
@@ -7,6 +6,7 @@
|
|
|
7
6
|
import * as Dialog from '../../../../../panel/components/ui/dialog/index.js';
|
|
8
7
|
import Input from '../../../../../panel/components/ui/input/input.svelte';
|
|
9
8
|
import { getAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte.js';
|
|
9
|
+
import { apiUrl } from '../../../../../util/index.js';
|
|
10
10
|
import { X } from '@lucide/svelte';
|
|
11
11
|
import type { NodeViewProps } from '@tiptap/core';
|
|
12
12
|
import { onMount } from 'svelte';
|