includio-cms 0.14.0 → 0.14.2

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/DOCS.md +4540 -0
  3. package/README.md +37 -42
  4. package/ROADMAP.md +13 -0
  5. package/dist/admin/client/account/preferences-section.svelte +1 -0
  6. package/dist/admin/client/account/profile-section.svelte +4 -1
  7. package/dist/admin/client/account/security-section.svelte +2 -2
  8. package/dist/admin/client/entry/entry-form.svelte +1 -1
  9. package/dist/admin/client/users/users-page.svelte +9 -9
  10. package/dist/admin/components/fields/blocks-field.svelte +1 -1
  11. package/dist/admin/components/fields/media-field.svelte +1 -0
  12. package/dist/admin/components/layout/layout-renderer.svelte +2 -1
  13. package/dist/admin/components/layout/layout-renderer.svelte.d.ts +1 -0
  14. package/dist/admin/components/media/bulk-action-bar.svelte +2 -0
  15. package/dist/admin/components/media/file/file-details.svelte +1 -0
  16. package/dist/admin/components/media/focal-point-input.svelte +3 -2
  17. package/dist/admin/components/media/tag-sidebar.svelte +1 -0
  18. package/dist/admin/components/tiptap/InlineBlockNodeView.svelte +2 -1
  19. package/dist/components/ui/dropdown-menu/index.d.ts +17 -0
  20. package/dist/components/ui/spinner/spinner.svelte +2 -2
  21. package/dist/components/ui/spinner/spinner.svelte.d.ts +4 -0
  22. package/dist/core/server/fields/utils/imageStyles.js +5 -4
  23. package/dist/core/server/media/styles/sharp/generateImageStyle.js +27 -0
  24. package/dist/db-postgres/index.js +4 -4
  25. package/dist/db-postgres/schema/imageStyle.d.ts +17 -0
  26. package/dist/db-postgres/schema/imageStyle.js +3 -2
  27. package/dist/demo/seed.js +0 -1
  28. package/dist/sveltekit/components/cms-provider.svelte +17 -0
  29. package/dist/sveltekit/components/cms-provider.svelte.d.ts +12 -0
  30. package/dist/sveltekit/components/structured-content.svelte +1 -0
  31. package/dist/sveltekit/components/video-context.d.ts +2 -0
  32. package/dist/sveltekit/components/video-context.js +8 -0
  33. package/dist/sveltekit/components/video.svelte +12 -4
  34. package/dist/sveltekit/index.d.ts +2 -0
  35. package/dist/sveltekit/index.js +2 -0
  36. package/dist/sveltekit/server/handle.js +9 -0
  37. package/dist/sveltekit/server/index.d.ts +1 -0
  38. package/dist/sveltekit/server/index.js +1 -0
  39. package/dist/sveltekit/server/layout.d.ts +4 -0
  40. package/dist/sveltekit/server/layout.js +5 -0
  41. package/dist/types/cms-context.d.ts +3 -0
  42. package/dist/types/cms-context.js +1 -0
  43. package/dist/types/fields.d.ts +1 -0
  44. package/dist/types/index.d.ts +1 -0
  45. package/dist/types/index.js +1 -0
  46. package/dist/updates/0.14.1/index.d.ts +2 -0
  47. package/dist/updates/0.14.1/index.js +15 -0
  48. package/dist/updates/0.14.2/index.d.ts +2 -0
  49. package/dist/updates/0.14.2/index.js +18 -0
  50. package/dist/updates/index.js +3 -1
  51. package/package.json +8 -2
@@ -57,10 +57,19 @@ const handleAuth = async ({ event, resolve }) => {
57
57
  }
58
58
  return svelteKitHandler({ event, resolve, auth, building });
59
59
  };
60
+ const detectBrowserContext = async ({ event, resolve }) => {
61
+ const ua = event.request.headers.get('user-agent') ?? '';
62
+ const isSafari = /Safari/i.test(ua) && !/(?:Chrome|Chromium|Edg)/i.test(ua);
63
+ event.locals.cmsContext = {
64
+ preferMp4: isSafari
65
+ };
66
+ return resolve(event);
67
+ };
60
68
  export function includioCMS(cmsConfig) {
61
69
  generateRuntime(cmsConfig); // Generate runtime code based on the CMS config
62
70
  initCMS(cmsConfig);
63
71
  const handles = [];
72
+ handles.push(detectBrowserContext);
64
73
  if (cmsConfig.auth) {
65
74
  handles.push(handleAuth);
66
75
  }
@@ -1,4 +1,5 @@
1
1
  export { includioCMS } from './handle.js';
2
+ export { cmsLayoutLoad } from './layout.js';
2
3
  export { getEntry, getEntries, countEntries } from '../../core/server/entries/operations/get.js';
3
4
  export { createFormSubmission } from '../../core/server/forms/submissions/operations/create.js';
4
5
  export { parseFormDataForSubmission } from '../../core/server/forms/submissions/utils/parseMultipart.js';
@@ -1,4 +1,5 @@
1
1
  export { includioCMS } from './handle.js';
2
+ export { cmsLayoutLoad } from './layout.js';
2
3
  export { getEntry, getEntries, countEntries } from '../../core/server/entries/operations/get.js';
3
4
  export { createFormSubmission } from '../../core/server/forms/submissions/operations/create.js';
4
5
  export { parseFormDataForSubmission } from '../../core/server/forms/submissions/utils/parseMultipart.js';
@@ -0,0 +1,4 @@
1
+ import type { RequestEvent } from '@sveltejs/kit';
2
+ export declare function cmsLayoutLoad(event: RequestEvent): {
3
+ cmsContext: any;
4
+ };
@@ -0,0 +1,5 @@
1
+ export function cmsLayoutLoad(event) {
2
+ return {
3
+ cmsContext: event.locals.cmsContext ?? {}
4
+ };
5
+ }
@@ -0,0 +1,3 @@
1
+ export interface CmsContext {
2
+ preferMp4: boolean;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -68,6 +68,7 @@ export interface ImageFieldStyle {
68
68
  format?: keyof FormatEnum;
69
69
  media?: string;
70
70
  crop?: boolean;
71
+ aspectRatio?: number;
71
72
  quality?: number;
72
73
  srcset?: number[];
73
74
  sizes?: string;
@@ -13,3 +13,4 @@ export { type CMSConfig, type ApiKeyConfig, type AuthConfig, type TypographyConf
13
13
  export { type PluginConfig, type CustomFieldDefinition } from './plugins.js';
14
14
  export { type Language, type Localized } from './languages.js';
15
15
  export { type Layout, type LayoutNode, type LayoutPreset, type LayoutNodeType, type ColumnRatio, type SectionNode, type ColumnsNode, type CardNode, type AccordionNode, type StackNode } from './layout.js';
16
+ export { type CmsContext } from './cms-context.js';
@@ -13,3 +13,4 @@ export {} from './cms.js';
13
13
  export {} from './plugins.js';
14
14
  export {} from './languages.js';
15
15
  export {} from './layout.js';
16
+ export {} from './cms-context.js';
@@ -0,0 +1,2 @@
1
+ import type { CmsUpdate } from '../index.js';
2
+ export declare const update: CmsUpdate;
@@ -0,0 +1,15 @@
1
+ export const update = {
2
+ version: '0.14.1',
3
+ date: '2026-03-27',
4
+ description: 'CMS context provider, Svelte 5 compat, docs overhaul',
5
+ features: [
6
+ 'CmsProvider component — sets CMS context (Safari mp4 preference) for child components',
7
+ 'Video context API: getPreferMp4() / setPreferMp4() for Safari hardware-accelerated playback',
8
+ 'CmsContext type + cmsLayoutLoad server helper for layout-level context injection',
9
+ 'docs:compile script — compiles all .svx doc pages into single DOCS.md'
10
+ ],
11
+ fixes: [
12
+ 'Svelte 5 compatibility: migrated event handlers, a11y annotations, warning suppression across ~15 admin components'
13
+ ],
14
+ breakingChanges: []
15
+ };
@@ -0,0 +1,2 @@
1
+ import type { CmsUpdate } from '../index.js';
2
+ export declare const update: CmsUpdate;
@@ -0,0 +1,18 @@
1
+ export const update = {
2
+ version: '0.14.2',
3
+ date: '2026-03-27',
4
+ description: 'Image styles: aspectRatio support, lazy generation, skip defaults when custom styles defined',
5
+ features: [
6
+ 'aspectRatio option for image styles — crop to ratio without fixed dimensions',
7
+ 'Lazy generation of custom field styles on first read',
8
+ 'Skip default styles when field defines custom styles (prevents <source> conflicts in <picture>)'
9
+ ],
10
+ fixes: [],
11
+ breakingChanges: [],
12
+ sql: `ALTER TABLE image_styles ADD COLUMN IF NOT EXISTS aspect_ratio REAL;
13
+
14
+ -- Drop old unique index and recreate with aspect_ratio
15
+ DROP INDEX IF EXISTS image_styles_unique_key;
16
+ CREATE UNIQUE INDEX image_styles_unique_key
17
+ ON image_styles (media_file_id, name, COALESCE(width, 0), COALESCE(height, 0), COALESCE(quality, 0), COALESCE(aspect_ratio, 0));`
18
+ };
@@ -38,7 +38,9 @@ import { update as update0132 } from './0.13.2/index.js';
38
38
  import { update as update0133 } from './0.13.3/index.js';
39
39
  import { update as update0134 } from './0.13.4/index.js';
40
40
  import { update as update0140 } from './0.14.0/index.js';
41
- export const updates = [update0065, update0066, update0067, update0068, update0069, update010, update011, update012, update013, update014, update015, update020, update022, update050, update051, update052, update053, update054, update055, update056, update057, update058, update060, update061, update062, update070, update071, update072, update073, update080, update090, update0100, update0110, update0120, update0130, update0131, update0132, update0133, update0134, update0140];
41
+ import { update as update0141 } from './0.14.1/index.js';
42
+ import { update as update0142 } from './0.14.2/index.js';
43
+ export const updates = [update0065, update0066, update0067, update0068, update0069, update010, update011, update012, update013, update014, update015, update020, update022, update050, update051, update052, update053, update054, update055, update056, update057, update058, update060, update061, update062, update070, update071, update072, update073, update080, update090, update0100, update0110, update0120, update0130, update0131, update0132, update0133, update0134, update0140, update0141, update0142];
42
44
  export const getUpdatesFrom = (fromVersion) => {
43
45
  const fromParts = fromVersion.split('.').map(Number);
44
46
  return updates.filter((update) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "includio-cms",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -24,7 +24,8 @@
24
24
  "cli": "tsx cli/init/index.ts",
25
25
  "build:cli": "tsc cli/init/index.ts --outDir dist/cli/init --module commonjs --esModuleInterop",
26
26
  "changelog": "tsx scripts/generate-changelog.ts",
27
- "prepublishOnly": "tsx scripts/generate-changelog.ts"
27
+ "docs:compile": "tsx scripts/compile-docs.ts",
28
+ "prepublishOnly": "tsx scripts/generate-changelog.ts && tsx scripts/compile-docs.ts"
28
29
  },
29
30
  "bin": {
30
31
  "includio": "./dist/cli/index.js"
@@ -36,6 +37,7 @@
36
37
  "README.md",
37
38
  "CHANGELOG.md",
38
39
  "ROADMAP.md",
40
+ "DOCS.md",
39
41
  "LICENSE"
40
42
  ],
41
43
  "sideEffects": [
@@ -45,6 +47,10 @@
45
47
  "svelte": "./dist/index.js",
46
48
  "type": "module",
47
49
  "exports": {
50
+ ".": {
51
+ "types": "./dist/index.d.ts",
52
+ "svelte": "./dist/index.js"
53
+ },
48
54
  "./core": {
49
55
  "types": "./dist/core/index.d.ts",
50
56
  "svelte": "./dist/core/index.js",