includio-cms 0.15.4 → 0.16.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/CHANGELOG.md +27 -0
- package/DOCS.md +1 -1
- package/ROADMAP.md +22 -8
- package/dist/admin/components/fields/media-field.svelte +54 -2
- package/dist/admin/components/media/file/file-details.svelte +65 -0
- package/dist/admin/remote/media.remote.d.ts +1 -0
- package/dist/admin/remote/media.remote.js +5 -0
- package/dist/cmp/types.d.ts +25 -0
- package/dist/cmp/types.js +1 -0
- package/dist/core/cms.d.ts +2 -0
- package/dist/core/cms.js +2 -0
- package/dist/core/server/cmp/getCountryFromHeaders.d.ts +10 -0
- package/dist/core/server/cmp/getCountryFromHeaders.js +30 -0
- package/dist/core/server/cmp/operations/create.d.ts +17 -0
- package/dist/core/server/cmp/operations/create.js +38 -0
- package/dist/core/server/cmp/operations/get.d.ts +2 -0
- package/dist/core/server/cmp/operations/get.js +8 -0
- package/dist/core/server/cmp/operations/list.d.ts +3 -0
- package/dist/core/server/cmp/operations/list.js +15 -0
- package/dist/core/server/cmp/truncateIpAddress.d.ts +7 -0
- package/dist/core/server/cmp/truncateIpAddress.js +57 -0
- package/dist/core/server/fields/resolveImageFields.d.ts +5 -0
- package/dist/core/server/fields/resolveImageFields.js +9 -1
- package/dist/core/server/generator/generator.js +22 -6
- package/dist/core/server/media/operations/backgroundMaintenance.js +51 -20
- package/dist/core/server/media/operations/findMediaReferences.d.ts +16 -0
- package/dist/core/server/media/operations/findMediaReferences.js +60 -0
- package/dist/db-postgres/index.js +46 -1
- package/dist/db-postgres/schema/consentLog.d.ts +17 -0
- package/dist/db-postgres/schema/consentLog.js +4 -1
- package/dist/paraglide/messages/_index.d.ts +36 -3
- package/dist/paraglide/messages/_index.js +71 -3
- package/dist/paraglide/messages/en.d.ts +5 -0
- package/dist/paraglide/messages/en.js +14 -0
- package/dist/paraglide/messages/pl.d.ts +5 -0
- package/dist/paraglide/messages/pl.js +14 -0
- package/dist/sveltekit/server/handle.js +1 -1
- package/dist/types/adapters/db.d.ts +7 -1
- package/dist/types/cms.d.ts +3 -0
- package/dist/types/consent.d.ts +11 -0
- package/dist/updates/0.15.5/index.d.ts +2 -0
- package/dist/updates/0.15.5/index.js +15 -0
- package/dist/updates/0.16.0/index.d.ts +2 -0
- package/dist/updates/0.16.0/index.js +14 -0
- package/dist/updates/index.js +3 -1
- package/package.json +1 -1
- package/dist/demo/seed.d.ts +0 -1
- package/dist/demo/seed.js +0 -117
- package/dist/inline-edit-proto/ModeToggle.svelte +0 -36
- package/dist/inline-edit-proto/ModeToggle.svelte.d.ts +0 -18
- package/dist/inline-edit-proto/blocks/AddBlockButton.svelte +0 -47
- package/dist/inline-edit-proto/blocks/AddBlockButton.svelte.d.ts +0 -8
- package/dist/inline-edit-proto/blocks/BlockToolbar.svelte +0 -80
- package/dist/inline-edit-proto/blocks/BlockToolbar.svelte.d.ts +0 -13
- package/dist/inline-edit-proto/blocks/BlockWrapper.svelte +0 -83
- package/dist/inline-edit-proto/blocks/BlockWrapper.svelte.d.ts +0 -11
- package/dist/inline-edit-proto/context.svelte.d.ts +0 -65
- package/dist/inline-edit-proto/context.svelte.js +0 -194
- package/dist/inline-edit-proto/hybrid/EditableHybrid.svelte +0 -70
- package/dist/inline-edit-proto/hybrid/EditableHybrid.svelte.d.ts +0 -11
- package/dist/inline-edit-proto/hybrid/FieldRenderer.svelte +0 -94
- package/dist/inline-edit-proto/hybrid/FieldRenderer.svelte.d.ts +0 -11
- package/dist/inline-edit-proto/hybrid/HybridEditor.svelte +0 -107
- package/dist/inline-edit-proto/hybrid/HybridEditor.svelte.d.ts +0 -7
- package/dist/inline-edit-proto/hybrid/SyncPanel.svelte +0 -181
- package/dist/inline-edit-proto/hybrid/SyncPanel.svelte.d.ts +0 -3
- package/dist/inline-edit-proto/inline/EditableInline.svelte +0 -120
- package/dist/inline-edit-proto/inline/EditableInline.svelte.d.ts +0 -11
- package/dist/inline-edit-proto/inline/InlineToolbar.svelte +0 -71
- package/dist/inline-edit-proto/inline/InlineToolbar.svelte.d.ts +0 -6
- package/dist/inline-edit-proto/panel/EditSheet.svelte +0 -130
- package/dist/inline-edit-proto/panel/EditSheet.svelte.d.ts +0 -3
- package/dist/inline-edit-proto/panel/EditablePanel.svelte +0 -44
- package/dist/inline-edit-proto/panel/EditablePanel.svelte.d.ts +0 -9
- package/dist/paraglide/messages/hello_world.d.ts +0 -5
- package/dist/paraglide/messages/hello_world.js +0 -33
- package/dist/paraglide/messages/login_hello.d.ts +0 -16
- package/dist/paraglide/messages/login_hello.js +0 -34
- package/dist/paraglide/messages/login_please_login.d.ts +0 -16
- package/dist/paraglide/messages/login_please_login.js +0 -34
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import * as Sheet from '../../components/ui/sheet/index.js';
|
|
3
|
-
import Button from '../../components/ui/button/button.svelte';
|
|
4
|
-
import Input from '../../components/ui/input/input.svelte';
|
|
5
|
-
import Textarea from '../../components/ui/textarea/textarea.svelte';
|
|
6
|
-
import Label from '../../components/ui/label/label.svelte';
|
|
7
|
-
import { getEditContext } from '../context.svelte.js';
|
|
8
|
-
|
|
9
|
-
const ctx = getEditContext();
|
|
10
|
-
|
|
11
|
-
// Field definitions for each path
|
|
12
|
-
const fieldConfigs: Record<
|
|
13
|
-
string,
|
|
14
|
-
{ label: string; fields: Array<{ key: string; label: string; type: 'text' | 'textarea' }> }
|
|
15
|
-
> = {
|
|
16
|
-
hero: {
|
|
17
|
-
label: 'Hero Section',
|
|
18
|
-
fields: [
|
|
19
|
-
{ key: 'title', label: 'Title', type: 'text' },
|
|
20
|
-
{ key: 'subtitle', label: 'Subtitle', type: 'textarea' },
|
|
21
|
-
{ key: 'cta', label: 'CTA Button', type: 'text' }
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
content: {
|
|
25
|
-
label: 'Content Section',
|
|
26
|
-
fields: [
|
|
27
|
-
{ key: 'title', label: 'Title', type: 'text' },
|
|
28
|
-
{ key: 'body', label: 'Body', type: 'textarea' }
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
image: {
|
|
32
|
-
label: 'Image',
|
|
33
|
-
fields: [
|
|
34
|
-
{ key: 'src', label: 'Image URL', type: 'text' },
|
|
35
|
-
{ key: 'alt', label: 'Alt Text', type: 'text' },
|
|
36
|
-
{ key: 'caption', label: 'Caption', type: 'text' }
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// For array items like features.0
|
|
42
|
-
function getFeatureConfig(index: number) {
|
|
43
|
-
return {
|
|
44
|
-
label: `Feature ${index + 1}`,
|
|
45
|
-
fields: [
|
|
46
|
-
{ key: 'title', label: 'Title', type: 'text' as const },
|
|
47
|
-
{ key: 'description', label: 'Description', type: 'textarea' as const },
|
|
48
|
-
{ key: 'icon', label: 'Icon', type: 'text' as const }
|
|
49
|
-
]
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
let config = $derived.by(() => {
|
|
54
|
-
if (!ctx.editingPath) return null;
|
|
55
|
-
|
|
56
|
-
// Check for feature item (features.0, features.1, etc.)
|
|
57
|
-
const featureMatch = ctx.editingPath.match(/^features\.(\d+)$/);
|
|
58
|
-
if (featureMatch) {
|
|
59
|
-
return getFeatureConfig(parseInt(featureMatch[1]));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return fieldConfigs[ctx.editingPath] || null;
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
let formData = $derived.by(() => {
|
|
66
|
-
if (!ctx.editingPath) return {};
|
|
67
|
-
const data = ctx.getData(ctx.editingPath);
|
|
68
|
-
return (data as Record<string, string>) || {};
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
function handleClose() {
|
|
72
|
-
ctx.editingPath = null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function handleSave() {
|
|
76
|
-
// Data is already bound, just close
|
|
77
|
-
handleClose();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function updateField(key: string, value: string) {
|
|
81
|
-
if (ctx.editingPath) {
|
|
82
|
-
ctx.updateData(`${ctx.editingPath}.${key}`, value);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
let isOpen = $derived(ctx.editingPath !== null && ctx.mode === 'panel');
|
|
87
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<Sheet.Root
|
|
90
|
-
open={isOpen}
|
|
91
|
-
onOpenChange={(open) => {
|
|
92
|
-
if (!open) handleClose();
|
|
93
|
-
}}
|
|
94
|
-
>
|
|
95
|
-
<Sheet.Content side="right" class="w-[400px] sm:max-w-[400px]">
|
|
96
|
-
<Sheet.Header>
|
|
97
|
-
<Sheet.Title>{config?.label || 'Edit'}</Sheet.Title>
|
|
98
|
-
<Sheet.Description>Make changes and click save when done.</Sheet.Description>
|
|
99
|
-
</Sheet.Header>
|
|
100
|
-
|
|
101
|
-
{#if config}
|
|
102
|
-
<div class="mt-6 flex flex-col gap-4">
|
|
103
|
-
{#each config.fields as field}
|
|
104
|
-
<div class="flex flex-col gap-2">
|
|
105
|
-
<Label for={field.key}>{field.label}</Label>
|
|
106
|
-
{#if field.type === 'textarea'}
|
|
107
|
-
<Textarea
|
|
108
|
-
id={field.key}
|
|
109
|
-
value={formData[field.key] || ''}
|
|
110
|
-
oninput={(e) => updateField(field.key, e.currentTarget.value)}
|
|
111
|
-
rows={4}
|
|
112
|
-
/>
|
|
113
|
-
{:else}
|
|
114
|
-
<Input
|
|
115
|
-
id={field.key}
|
|
116
|
-
value={formData[field.key] || ''}
|
|
117
|
-
oninput={(e) => updateField(field.key, e.currentTarget.value)}
|
|
118
|
-
/>
|
|
119
|
-
{/if}
|
|
120
|
-
</div>
|
|
121
|
-
{/each}
|
|
122
|
-
</div>
|
|
123
|
-
{/if}
|
|
124
|
-
|
|
125
|
-
<Sheet.Footer class="mt-6">
|
|
126
|
-
<Button variant="outline" onclick={handleClose}>Cancel</Button>
|
|
127
|
-
<Button onclick={handleSave}>Save Changes</Button>
|
|
128
|
-
</Sheet.Footer>
|
|
129
|
-
</Sheet.Content>
|
|
130
|
-
</Sheet.Root>
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import { getEditContext } from '../context.svelte.js';
|
|
4
|
-
import Pencil from '@tabler/icons-svelte/icons/pencil';
|
|
5
|
-
|
|
6
|
-
type Props = {
|
|
7
|
-
path: string;
|
|
8
|
-
label?: string;
|
|
9
|
-
children: Snippet;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
let { path, label, children }: Props = $props();
|
|
13
|
-
|
|
14
|
-
const ctx = getEditContext();
|
|
15
|
-
let isHovered = $state(false);
|
|
16
|
-
|
|
17
|
-
function openEdit() {
|
|
18
|
-
ctx.editingPath = path;
|
|
19
|
-
}
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
{#if ctx.mode === 'panel'}
|
|
23
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
24
|
-
<div
|
|
25
|
-
class="editable-panel relative"
|
|
26
|
-
onmouseenter={() => (isHovered = true)}
|
|
27
|
-
onmouseleave={() => (isHovered = false)}
|
|
28
|
-
>
|
|
29
|
-
{@render children()}
|
|
30
|
-
|
|
31
|
-
{#if isHovered}
|
|
32
|
-
<button
|
|
33
|
-
onclick={openEdit}
|
|
34
|
-
class="absolute -right-2 -top-2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-[#1e3a5f] text-white shadow-lg transition-transform hover:scale-110"
|
|
35
|
-
title={label ? `Edit ${label}` : 'Edit'}
|
|
36
|
-
>
|
|
37
|
-
<Pencil class="h-4 w-4" />
|
|
38
|
-
</button>
|
|
39
|
-
<div class="pointer-events-none absolute inset-0 rounded-lg ring-2 ring-[#1e3a5f]/50"></div>
|
|
40
|
-
{/if}
|
|
41
|
-
</div>
|
|
42
|
-
{:else}
|
|
43
|
-
{@render children()}
|
|
44
|
-
{/if}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
type Props = {
|
|
3
|
-
path: string;
|
|
4
|
-
label?: string;
|
|
5
|
-
children: Snippet;
|
|
6
|
-
};
|
|
7
|
-
declare const EditablePanel: import("svelte").Component<Props, {}, "">;
|
|
8
|
-
type EditablePanel = ReturnType<typeof EditablePanel>;
|
|
9
|
-
export default EditablePanel;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
-
|
|
4
|
-
const en_hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
-
return `Hello, ${i.name} from en!`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const pl_hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
|
|
9
|
-
return `Hello, ${i.name} from pl!`
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
-
*
|
|
15
|
-
* - Changing this function will be over-written by the next build.
|
|
16
|
-
*
|
|
17
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
-
*
|
|
20
|
-
* @param {{ name: NonNullable<unknown> }} inputs
|
|
21
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
22
|
-
* @returns {string}
|
|
23
|
-
*/
|
|
24
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
-
export const hello_world = (inputs, options = {}) => {
|
|
26
|
-
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
-
return /** @type {any} */ (globalThis).__paraglide_ssr.hello_world(inputs)
|
|
28
|
-
}
|
|
29
|
-
const locale = options.locale ?? getLocale()
|
|
30
|
-
trackMessageCall("hello_world", locale)
|
|
31
|
-
if (locale === "en") return en_hello_world(inputs)
|
|
32
|
-
return pl_hello_world(inputs)
|
|
33
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { login_hello as login.hello };
|
|
2
|
-
/**
|
|
3
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
4
|
-
*
|
|
5
|
-
* - Changing this function will be over-written by the next build.
|
|
6
|
-
*
|
|
7
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
8
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
9
|
-
*
|
|
10
|
-
* @param {{}} inputs
|
|
11
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
12
|
-
* @returns {string}
|
|
13
|
-
*/
|
|
14
|
-
declare function login_hello(inputs?: {}, options?: {
|
|
15
|
-
locale?: "en" | "pl";
|
|
16
|
-
}): string;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
-
|
|
4
|
-
const en_login_hello = /** @type {(inputs: {}) => string} */ () => {
|
|
5
|
-
return `Welcome back`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const pl_login_hello = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
-
return `Witaj ponownie`
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
-
*
|
|
15
|
-
* - Changing this function will be over-written by the next build.
|
|
16
|
-
*
|
|
17
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
-
*
|
|
20
|
-
* @param {{}} inputs
|
|
21
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
22
|
-
* @returns {string}
|
|
23
|
-
*/
|
|
24
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
-
const login_hello = (inputs = {}, options = {}) => {
|
|
26
|
-
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
-
return /** @type {any} */ (globalThis).__paraglide_ssr.login_hello(inputs)
|
|
28
|
-
}
|
|
29
|
-
const locale = options.locale ?? getLocale()
|
|
30
|
-
trackMessageCall("login_hello", locale)
|
|
31
|
-
if (locale === "en") return en_login_hello(inputs)
|
|
32
|
-
return pl_login_hello(inputs)
|
|
33
|
-
};
|
|
34
|
-
export { login_hello as "login.hello" }
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { login_please_login as login.please_login };
|
|
2
|
-
/**
|
|
3
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
4
|
-
*
|
|
5
|
-
* - Changing this function will be over-written by the next build.
|
|
6
|
-
*
|
|
7
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
8
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
9
|
-
*
|
|
10
|
-
* @param {{}} inputs
|
|
11
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
12
|
-
* @returns {string}
|
|
13
|
-
*/
|
|
14
|
-
declare function login_please_login(inputs?: {}, options?: {
|
|
15
|
-
locale?: "en" | "pl";
|
|
16
|
-
}): string;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
-
|
|
4
|
-
const en_login_please_login = /** @type {(inputs: {}) => string} */ () => {
|
|
5
|
-
return `Login to your account`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const pl_login_please_login = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
-
return `Zaloguj się na swoje konto`
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
-
*
|
|
15
|
-
* - Changing this function will be over-written by the next build.
|
|
16
|
-
*
|
|
17
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
-
*
|
|
20
|
-
* @param {{}} inputs
|
|
21
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
22
|
-
* @returns {string}
|
|
23
|
-
*/
|
|
24
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
-
const login_please_login = (inputs = {}, options = {}) => {
|
|
26
|
-
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
-
return /** @type {any} */ (globalThis).__paraglide_ssr.login_please_login(inputs)
|
|
28
|
-
}
|
|
29
|
-
const locale = options.locale ?? getLocale()
|
|
30
|
-
trackMessageCall("login_please_login", locale)
|
|
31
|
-
if (locale === "en") return en_login_please_login(inputs)
|
|
32
|
-
return pl_login_please_login(inputs)
|
|
33
|
-
};
|
|
34
|
-
export { login_please_login as "login.please_login" }
|