includio-cms 0.7.2 → 0.13.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/CHANGELOG.md +128 -0
- package/ROADMAP.md +54 -2
- package/dist/admin/api/generate-styles.d.ts +2 -0
- package/dist/admin/api/generate-styles.js +32 -0
- package/dist/admin/api/handler.js +33 -0
- package/dist/admin/api/media-gc.js +10 -4
- package/dist/admin/api/rest/handler.js +17 -0
- package/dist/admin/api/rest/routes/collections.js +25 -13
- package/dist/admin/api/rest/routes/entries.d.ts +1 -1
- package/dist/admin/api/rest/routes/entries.js +10 -10
- package/dist/admin/api/rest/routes/media.d.ts +2 -0
- package/dist/admin/api/rest/routes/media.js +9 -0
- package/dist/admin/api/rest/routes/schema.d.ts +5 -0
- package/dist/admin/api/rest/routes/schema.js +152 -0
- package/dist/admin/api/rest/routes/singletons.d.ts +1 -1
- package/dist/admin/api/rest/routes/singletons.js +8 -7
- package/dist/admin/api/rest/routes/upload.d.ts +2 -0
- package/dist/admin/api/rest/routes/upload.js +28 -0
- package/dist/admin/api/upload.js +13 -0
- package/dist/admin/client/collection/collection-entries.svelte +35 -13
- package/dist/admin/client/entry/entry.svelte +21 -23
- package/dist/admin/client/entry/header/a11y-validator.js +2 -2
- package/dist/admin/client/entry/header/publish-panel.svelte +33 -85
- package/dist/admin/client/entry/header/status-badge.svelte +2 -2
- package/dist/admin/client/entry/header/version-history-sheet.svelte +9 -9
- package/dist/admin/client/entry/header/visibility.svelte +16 -10
- package/dist/admin/client/entry/utils.d.ts +3 -0
- package/dist/admin/client/entry/utils.js +22 -4
- package/dist/admin/client/form/form-submission/form-submission-page.svelte +4 -1
- package/dist/admin/client/form/form-submission/submission-field.svelte +10 -0
- package/dist/admin/client/index.d.ts +1 -0
- package/dist/admin/client/index.js +1 -0
- package/dist/admin/client/maintenance/maintenance-page.svelte +146 -2
- package/dist/admin/client/users/users-page.svelte +5 -6
- package/dist/admin/client/users/users-page.svelte.d.ts +1 -4
- package/dist/admin/components/fields/block-picker-modal.svelte +13 -4
- package/dist/admin/components/fields/blocks-field.svelte +40 -19
- package/dist/admin/components/fields/field-renderer.svelte +4 -8
- package/dist/admin/components/fields/object-field.svelte +7 -12
- package/dist/admin/components/fields/select-field.svelte +8 -2
- package/dist/admin/components/fields/seo-field.svelte +40 -93
- package/dist/admin/components/fields/simple-array-field.svelte +27 -16
- package/dist/admin/components/fields/text-field-wrapper.svelte +52 -197
- package/dist/admin/components/fields/text-field-wrapper.svelte.d.ts +2 -2
- package/dist/admin/components/fields/url-field-wrapper.svelte +15 -25
- package/dist/admin/components/fields/url-field.svelte +61 -72
- package/dist/admin/components/layout/layout-renderer.svelte +10 -4
- package/dist/admin/components/media/file-preview.svelte +10 -1
- package/dist/admin/components/media/file-upload.svelte +5 -1
- package/dist/admin/components/media/file-upload.svelte.d.ts +1 -0
- package/dist/admin/components/media/files-list.svelte +12 -3
- package/dist/admin/components/media/media-library.svelte +109 -37
- package/dist/admin/components/media/media-selector.svelte +90 -16
- package/dist/admin/components/media/tag-sidebar.svelte +10 -6
- package/dist/admin/components/media/tag-sidebar.svelte.d.ts +7 -2
- package/dist/admin/components/tiptap/FigureNodeView.svelte +15 -10
- package/dist/admin/components/tiptap/InlineBlockNodeView.svelte +53 -94
- package/dist/admin/components/tiptap/SlashCommandPopup.svelte +8 -3
- package/dist/admin/components/tiptap/editor-toolbar.svelte +28 -23
- package/dist/admin/components/tiptap/image-dialog.svelte +12 -7
- package/dist/admin/components/tiptap/inline-block-node.js +6 -5
- package/dist/admin/components/tiptap/lang.d.ts +77 -0
- package/dist/admin/components/tiptap/lang.js +170 -0
- package/dist/admin/components/tiptap/link-dialog.svelte +31 -28
- package/dist/admin/components/tiptap/slash-command.js +27 -23
- package/dist/admin/components/tiptap/table-dialog.svelte +9 -4
- package/dist/admin/components/tiptap/video-dialog.svelte +6 -1
- package/dist/admin/remote/email.remote.d.ts +1 -0
- package/dist/admin/remote/email.remote.js +5 -0
- package/dist/admin/remote/entry.remote.d.ts +2 -5
- package/dist/admin/remote/entry.remote.js +23 -28
- package/dist/admin/remote/index.d.ts +1 -0
- package/dist/admin/remote/index.js +1 -0
- package/dist/admin/remote/media.remote.d.ts +15 -0
- package/dist/admin/remote/media.remote.js +18 -2
- package/dist/admin/remote/preview.remote.js +3 -1
- package/dist/admin/utils/entryLabel.js +9 -6
- package/dist/admin/utils/translationStatus.js +1 -2
- package/dist/cli/scaffold/admin.js +34 -2
- package/dist/cms/runtime/api.d.ts +16 -12
- package/dist/cms/runtime/api.js +7 -6
- package/dist/cms/runtime/remote.js +2 -2
- package/dist/cms/runtime/schemas.d.ts +1 -1
- package/dist/cms/runtime/schemas.js +1 -1
- package/dist/cms/runtime/types.d.ts +118 -112
- package/dist/cms/runtime/types.js +0 -12
- package/dist/core/cms.d.ts +3 -1
- package/dist/core/cms.js +30 -0
- package/dist/core/fields/fieldSchemaToTs.js +9 -15
- package/dist/core/fields/formFieldSchemaToTs.js +7 -0
- package/dist/core/server/entries/operations/create.js +10 -4
- package/dist/core/server/entries/operations/get.d.ts +1 -0
- package/dist/core/server/entries/operations/get.js +186 -191
- package/dist/core/server/entries/operations/update.d.ts +6 -7
- package/dist/core/server/entries/operations/update.js +20 -38
- package/dist/core/server/fields/populateEntry.js +16 -52
- package/dist/core/server/fields/resolveImageFields.js +69 -120
- package/dist/core/server/fields/resolveRelationFields.js +30 -51
- package/dist/core/server/fields/resolveRichtextLinks.js +46 -100
- package/dist/core/server/fields/resolveTypographyOrphans.bench.d.ts +1 -0
- package/dist/core/server/fields/resolveTypographyOrphans.bench.js +87 -0
- package/dist/core/server/fields/resolveTypographyOrphans.d.ts +3 -0
- package/dist/core/server/fields/resolveTypographyOrphans.js +128 -0
- package/dist/core/server/fields/resolveUrlFields.js +47 -56
- package/dist/core/server/fields/utils/fixOrphans.d.ts +5 -0
- package/dist/core/server/fields/utils/fixOrphans.js +12 -0
- package/dist/core/server/fields/utils/imageStyles.d.ts +4 -2
- package/dist/core/server/fields/utils/imageStyles.js +41 -25
- package/dist/core/server/fields/utils/resolveMedia.js +1 -6
- package/dist/core/server/forms/submissions/operations/delete.js +26 -2
- package/dist/core/server/forms/submissions/utils/parseMultipart.d.ts +2 -0
- package/dist/core/server/forms/submissions/utils/parseMultipart.js +75 -0
- package/dist/core/server/generator/fields.d.ts +6 -0
- package/dist/core/server/generator/fields.js +43 -5
- package/dist/core/server/generator/formFieldSchemaToString.js +10 -0
- package/dist/core/server/generator/formFields.js +1 -0
- package/dist/core/server/generator/generator.js +98 -30
- package/dist/core/server/media/operations/getFiles.d.ts +5 -0
- package/dist/core/server/media/operations/getFiles.js +6 -0
- package/dist/core/server/media/operations/uploadPrivateFile.d.ts +4 -0
- package/dist/core/server/media/operations/uploadPrivateFile.js +8 -0
- package/dist/core/server/media/styles/operations/batchGenerateStyles.d.ts +16 -0
- package/dist/core/server/media/styles/operations/batchGenerateStyles.js +144 -0
- package/dist/db-postgres/index.js +303 -37
- package/dist/db-postgres/schema/entry.d.ts +0 -94
- package/dist/db-postgres/schema/entry.js +0 -6
- package/dist/db-postgres/schema/entryVersion.d.ts +17 -0
- package/dist/db-postgres/schema/entryVersion.js +1 -0
- package/dist/entity/index.d.ts +9 -4
- package/dist/entity/index.js +24 -24
- package/dist/files-local/index.js +43 -0
- 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/components/preview.svelte +2 -326
- package/dist/sveltekit/components/preview.svelte.d.ts +5 -16
- package/dist/sveltekit/server/index.d.ts +2 -1
- package/dist/sveltekit/server/index.js +2 -1
- package/dist/sveltekit/server/preview.js +4 -7
- package/dist/types/adapters/db.d.ts +15 -1
- package/dist/types/adapters/files.d.ts +6 -0
- package/dist/types/cms.d.ts +5 -0
- package/dist/types/entries.d.ts +54 -18
- package/dist/types/fields.d.ts +14 -24
- package/dist/types/formFields.d.ts +7 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/layout.d.ts +0 -1
- package/dist/types/structured-content.d.ts +5 -0
- package/dist/updates/0.10.0/index.d.ts +2 -0
- package/dist/updates/0.10.0/index.js +15 -0
- package/dist/updates/0.11.0/index.d.ts +2 -0
- package/dist/updates/0.11.0/index.js +12 -0
- package/dist/updates/0.12.0/index.d.ts +2 -0
- package/dist/updates/0.12.0/index.js +12 -0
- package/dist/updates/0.13.0/index.d.ts +2 -0
- package/dist/updates/0.13.0/index.js +10 -0
- package/dist/updates/0.13.1/index.d.ts +2 -0
- package/dist/updates/0.13.1/index.js +20 -0
- package/dist/updates/0.7.3/index.d.ts +2 -0
- package/dist/updates/0.7.3/index.js +10 -0
- package/dist/updates/0.8.0/index.d.ts +2 -0
- package/dist/updates/0.8.0/index.js +18 -0
- package/dist/updates/0.8.0/migrate.d.ts +2 -0
- package/dist/updates/0.8.0/migrate.js +101 -0
- package/dist/updates/0.9.0/index.d.ts +2 -0
- package/dist/updates/0.9.0/index.js +38 -0
- package/dist/updates/index.js +9 -1
- package/package.json +7 -6
- package/dist/admin/components/fields/image-field.svelte +0 -198
- package/dist/admin/components/fields/image-field.svelte.d.ts +0 -8
- package/dist/admin/components/fields/richtext-field.svelte +0 -13
- package/dist/admin/components/fields/richtext-field.svelte.d.ts +0 -8
- package/dist/admin/components/tiptap.svelte +0 -11
- package/dist/admin/components/tiptap.svelte.d.ts +0 -6
- package/dist/core/server/entries/utils/getEntryTranslation.d.ts +0 -1
- package/dist/core/server/entries/utils/getEntryTranslation.js +0 -18
- 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
|
@@ -6,6 +6,7 @@ export const entryVersionsTable = pgTable('entry_version', {
|
|
|
6
6
|
entryId: uuid('entry_id')
|
|
7
7
|
.notNull()
|
|
8
8
|
.references(() => entriesTable.id, { onDelete: 'cascade' }),
|
|
9
|
+
lang: text('lang').notNull(),
|
|
9
10
|
versionNumber: integer('version_number').notNull(),
|
|
10
11
|
data: jsonb('data').notNull().$type(),
|
|
11
12
|
createdAt: timestamp('created_at').defaultNow().notNull(),
|
package/dist/entity/index.d.ts
CHANGED
|
@@ -8,12 +8,15 @@ interface CreateOptions {
|
|
|
8
8
|
sortOrder?: number;
|
|
9
9
|
}
|
|
10
10
|
export declare function createEntityAPI(cms: CMS, opts?: EntityAPIOptions): {
|
|
11
|
-
create(slug: string, data?: EntryData, options?: CreateOptions
|
|
11
|
+
create(slug: string, data?: EntryData, options?: CreateOptions & {
|
|
12
|
+
lang?: string;
|
|
13
|
+
}): Promise<DbEntry>;
|
|
12
14
|
update(entryId: string, data: EntryData, options?: {
|
|
13
15
|
skipValidation?: boolean;
|
|
16
|
+
lang?: string;
|
|
14
17
|
}): Promise<DbEntryVersion>;
|
|
15
|
-
publish(entryId: string): Promise<void>;
|
|
16
|
-
unpublish(entryId: string): Promise<void>;
|
|
18
|
+
publish(entryId: string, lang?: string): Promise<void>;
|
|
19
|
+
unpublish(entryId: string, lang?: string): Promise<void>;
|
|
17
20
|
archive(entryId: string): Promise<void>;
|
|
18
21
|
unarchive(entryId: string): Promise<void>;
|
|
19
22
|
delete(entryId: string): Promise<void>;
|
|
@@ -21,6 +24,8 @@ export declare function createEntityAPI(cms: CMS, opts?: EntityAPIOptions): {
|
|
|
21
24
|
includeArchived?: boolean;
|
|
22
25
|
onlyArchived?: boolean;
|
|
23
26
|
}): Promise<import("../types/entries.js").RawEntry[]>;
|
|
24
|
-
createAndPublish(slug: string, data: EntryData, options?: CreateOptions
|
|
27
|
+
createAndPublish(slug: string, data: EntryData, options?: CreateOptions & {
|
|
28
|
+
lang?: string;
|
|
29
|
+
}): Promise<DbEntry>;
|
|
25
30
|
};
|
|
26
31
|
export {};
|
package/dist/entity/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { getRawEntries } from '../core/server/entries/operations/get.js';
|
|
|
4
4
|
export function createEntityAPI(cms, opts) {
|
|
5
5
|
const db = cms.databaseAdapter;
|
|
6
6
|
const userId = opts?.userId ?? 'system';
|
|
7
|
+
const defaultLang = cms.languages[0];
|
|
7
8
|
function validate(slug, data) {
|
|
8
9
|
const config = cms.getBySlug(slug);
|
|
9
10
|
const schema = generateZodSchemaFromFields(getFieldsFromConfig(config), cms.languages);
|
|
@@ -22,24 +23,27 @@ export function createEntityAPI(cms, opts) {
|
|
|
22
23
|
type,
|
|
23
24
|
sortOrder: options?.sortOrder ?? null
|
|
24
25
|
});
|
|
26
|
+
const lang = options?.lang ?? defaultLang;
|
|
25
27
|
const entryData = data ?? {};
|
|
26
28
|
const validatedData = data && !options?.skipValidation ? validate(slug, entryData) : entryData;
|
|
27
29
|
await db.createEntryVersion({
|
|
28
30
|
entryId: entry.id,
|
|
31
|
+
lang,
|
|
29
32
|
data: validatedData,
|
|
30
33
|
createdBy: userId
|
|
31
34
|
});
|
|
32
35
|
return entry;
|
|
33
36
|
},
|
|
34
37
|
async update(entryId, data, options) {
|
|
38
|
+
const lang = options?.lang ?? defaultLang;
|
|
35
39
|
const entries = await db.getEntries({ ids: [entryId] });
|
|
36
40
|
const entry = entries[0];
|
|
37
41
|
if (!entry)
|
|
38
42
|
throw Error('Entry not found');
|
|
39
43
|
const validatedData = !options?.skipValidation ? validate(entry.slug, data) : data;
|
|
40
|
-
const versions = await db.getEntryVersions({ entryIds: [entryId] });
|
|
44
|
+
const versions = await db.getEntryVersions({ entryIds: [entryId], lang });
|
|
41
45
|
const sorted = versions.sort((a, b) => b.versionNumber - a.versionNumber);
|
|
42
|
-
const latestDraft = sorted.find((v) => v.
|
|
46
|
+
const latestDraft = sorted.find((v) => v.publishedAt == null);
|
|
43
47
|
if (latestDraft) {
|
|
44
48
|
if (JSON.stringify(latestDraft.data) === JSON.stringify(validatedData)) {
|
|
45
49
|
return latestDraft;
|
|
@@ -51,40 +55,36 @@ export function createEntityAPI(cms, opts) {
|
|
|
51
55
|
}
|
|
52
56
|
return db.createEntryVersion({
|
|
53
57
|
entryId,
|
|
58
|
+
lang,
|
|
54
59
|
data: validatedData,
|
|
55
60
|
createdBy: userId
|
|
56
61
|
});
|
|
57
62
|
},
|
|
58
|
-
async publish(entryId) {
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const entry = entries[0];
|
|
62
|
-
if (!entry)
|
|
63
|
-
throw Error('Entry not found');
|
|
63
|
+
async publish(entryId, lang) {
|
|
64
|
+
const targetLang = lang ?? defaultLang;
|
|
65
|
+
const versions = await db.getEntryVersions({ entryIds: [entryId], lang: targetLang });
|
|
64
66
|
const draft = versions
|
|
65
|
-
.filter((v) => v.
|
|
67
|
+
.filter((v) => v.publishedAt == null)
|
|
66
68
|
.sort((a, b) => b.versionNumber - a.versionNumber)[0];
|
|
67
69
|
if (!draft)
|
|
68
70
|
throw Error('No draft to publish');
|
|
69
|
-
await db.
|
|
70
|
-
id:
|
|
71
|
+
await db.updateEntryVersion({
|
|
72
|
+
id: draft.id,
|
|
71
73
|
data: {
|
|
72
|
-
publishedVersionId: draft.id,
|
|
73
74
|
publishedAt: new Date(),
|
|
74
|
-
publishedBy: userId
|
|
75
|
-
archivedAt: null
|
|
75
|
+
publishedBy: userId
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
},
|
|
79
|
-
async unpublish(entryId) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
});
|
|
79
|
+
async unpublish(entryId, lang) {
|
|
80
|
+
const targetLang = lang ?? defaultLang;
|
|
81
|
+
const versions = await db.getEntryVersions({ entryIds: [entryId], lang: targetLang });
|
|
82
|
+
await Promise.all(versions
|
|
83
|
+
.filter((v) => v.publishedAt !== null)
|
|
84
|
+
.map((v) => db.updateEntryVersion({
|
|
85
|
+
id: v.id,
|
|
86
|
+
data: { publishedAt: null, publishedBy: null }
|
|
87
|
+
})));
|
|
88
88
|
},
|
|
89
89
|
async archive(entryId) {
|
|
90
90
|
await db.updateEntry({
|
|
@@ -106,7 +106,7 @@ export function createEntityAPI(cms, opts) {
|
|
|
106
106
|
},
|
|
107
107
|
async createAndPublish(slug, data, options) {
|
|
108
108
|
const entry = await this.create(slug, data, options);
|
|
109
|
-
await this.publish(entry.id);
|
|
109
|
+
await this.publish(entry.id, options?.lang);
|
|
110
110
|
return entry;
|
|
111
111
|
}
|
|
112
112
|
};
|
|
@@ -10,6 +10,7 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
10
10
|
const __dirname = dirname(__filename);
|
|
11
11
|
global.__dirname = __dirname ?? '';
|
|
12
12
|
const fullDir = process.env.NODE_ENV === 'production' ? `/data/uploads` : `./static/uploads`;
|
|
13
|
+
const privateDir = process.env.NODE_ENV === 'production' ? `/data/private-uploads` : `./data/private-uploads`;
|
|
13
14
|
// Ustawienie ścieżek do ffmpeg
|
|
14
15
|
const ffmpegPath = process.env.FFMPEG_PATH || '/usr/bin/ffmpeg';
|
|
15
16
|
const ffprobePath = process.env.FFPROBE_PATH || '/usr/bin/ffprobe';
|
|
@@ -311,6 +312,48 @@ export function local() {
|
|
|
311
312
|
catch {
|
|
312
313
|
return [];
|
|
313
314
|
}
|
|
315
|
+
},
|
|
316
|
+
uploadPrivateFile: async (file) => {
|
|
317
|
+
await ensureDir(privateDir);
|
|
318
|
+
const ext = extname(file.name);
|
|
319
|
+
const rawName = basename(file.name, ext);
|
|
320
|
+
const safeName = sanitizeFilename(rawName);
|
|
321
|
+
const filename = `${randomUUID().slice(0, 8)}-${safeName}${ext}`;
|
|
322
|
+
const filepath = resolve(privateDir, filename);
|
|
323
|
+
if (!filepath.startsWith(resolve(privateDir))) {
|
|
324
|
+
throw new Error('Invalid filename');
|
|
325
|
+
}
|
|
326
|
+
const arrayBuffer = await file.arrayBuffer();
|
|
327
|
+
await writeFile(filepath, Buffer.from(arrayBuffer));
|
|
328
|
+
return {
|
|
329
|
+
filename,
|
|
330
|
+
url: `/admin/api/media/private/${filename}`
|
|
331
|
+
};
|
|
332
|
+
},
|
|
333
|
+
downloadPrivateFile: async (filename) => {
|
|
334
|
+
const filepath = resolve(privateDir, filename);
|
|
335
|
+
if (!filepath.startsWith(resolve(privateDir))) {
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
338
|
+
try {
|
|
339
|
+
const data = await readFile(filepath);
|
|
340
|
+
return new File([data], filename);
|
|
341
|
+
}
|
|
342
|
+
catch {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
deletePrivateFile: async (filename) => {
|
|
347
|
+
const filepath = resolve(privateDir, filename);
|
|
348
|
+
if (!filepath.startsWith(resolve(privateDir))) {
|
|
349
|
+
throw new Error('Invalid filename');
|
|
350
|
+
}
|
|
351
|
+
try {
|
|
352
|
+
await unlink(filepath);
|
|
353
|
+
}
|
|
354
|
+
catch {
|
|
355
|
+
// File may already be deleted
|
|
356
|
+
}
|
|
314
357
|
}
|
|
315
358
|
};
|
|
316
359
|
}
|
|
@@ -1,3 +1,36 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export function hello_world(inputs: {
|
|
2
|
+
name: NonNullable<unknown>;
|
|
3
|
+
}, options?: {
|
|
4
|
+
locale?: "en" | "pl";
|
|
5
|
+
}): string;
|
|
6
|
+
/**
|
|
7
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
8
|
+
*
|
|
9
|
+
* - Changing this function will be over-written by the next build.
|
|
10
|
+
*
|
|
11
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
12
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
13
|
+
*
|
|
14
|
+
* @param {{}} inputs
|
|
15
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
16
|
+
* @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
declare function login_hello(inputs?: {}, options?: {
|
|
19
|
+
locale?: "en" | "pl";
|
|
20
|
+
}): string;
|
|
21
|
+
/**
|
|
22
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
23
|
+
*
|
|
24
|
+
* - Changing this function will be over-written by the next build.
|
|
25
|
+
*
|
|
26
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
27
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
28
|
+
*
|
|
29
|
+
* @param {{}} inputs
|
|
30
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
31
|
+
* @returns {string}
|
|
32
|
+
*/
|
|
33
|
+
declare function login_please_login(inputs?: {}, options?: {
|
|
34
|
+
locale?: "en" | "pl";
|
|
35
|
+
}): string;
|
|
36
|
+
export { login_hello as login.hello, login_please_login as login.please_login };
|
|
@@ -1,4 +1,72 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from "../runtime.js"
|
|
3
|
+
import * as en from "./en.js"
|
|
4
|
+
import * as pl from "./pl.js"
|
|
5
|
+
/**
|
|
6
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
7
|
+
*
|
|
8
|
+
* - Changing this function will be over-written by the next build.
|
|
9
|
+
*
|
|
10
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
11
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
12
|
+
*
|
|
13
|
+
* @param {{ name: NonNullable<unknown> }} inputs
|
|
14
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
+
export const hello_world = (inputs, options = {}) => {
|
|
19
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
20
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.hello_world(inputs)
|
|
21
|
+
}
|
|
22
|
+
const locale = options.locale ?? getLocale()
|
|
23
|
+
trackMessageCall("hello_world", locale)
|
|
24
|
+
if (locale === "en") return en.hello_world(inputs)
|
|
25
|
+
return pl.hello_world(inputs)
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
29
|
+
*
|
|
30
|
+
* - Changing this function will be over-written by the next build.
|
|
31
|
+
*
|
|
32
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
33
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
34
|
+
*
|
|
35
|
+
* @param {{}} inputs
|
|
36
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
40
|
+
const login_hello = (inputs = {}, options = {}) => {
|
|
41
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
42
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.login_hello(inputs)
|
|
43
|
+
}
|
|
44
|
+
const locale = options.locale ?? getLocale()
|
|
45
|
+
trackMessageCall("login_hello", locale)
|
|
46
|
+
if (locale === "en") return en.login_hello(inputs)
|
|
47
|
+
return pl.login_hello(inputs)
|
|
48
|
+
};
|
|
49
|
+
export { login_hello as "login.hello" }
|
|
50
|
+
/**
|
|
51
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
52
|
+
*
|
|
53
|
+
* - Changing this function will be over-written by the next build.
|
|
54
|
+
*
|
|
55
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
56
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
57
|
+
*
|
|
58
|
+
* @param {{}} inputs
|
|
59
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
60
|
+
* @returns {string}
|
|
61
|
+
*/
|
|
62
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
63
|
+
const login_please_login = (inputs = {}, options = {}) => {
|
|
64
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
65
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.login_please_login(inputs)
|
|
66
|
+
}
|
|
67
|
+
const locale = options.locale ?? getLocale()
|
|
68
|
+
trackMessageCall("login_please_login", locale)
|
|
69
|
+
if (locale === "en") return en.login_please_login(inputs)
|
|
70
|
+
return pl.login_please_login(inputs)
|
|
71
|
+
};
|
|
72
|
+
export { login_please_login as "login.please_login" }
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
+
return `Hello, ${i.name} from en!`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const login_hello = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
+
return `Welcome back`
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const login_please_login = /** @type {(inputs: {}) => string} */ () => {
|
|
13
|
+
return `Login to your account`
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
+
return `Hello, ${i.name} from pl!`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const login_hello = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
+
return `Witaj ponownie`
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const login_please_login = /** @type {(inputs: {}) => string} */ () => {
|
|
13
|
+
return `Zaloguj się na swoje konto`
|
|
14
|
+
};
|