@cmssy/core 14.0.0 → 14.1.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.
@@ -13,6 +13,9 @@ type RegionSettingsOf<Region> = [Region] extends [
13
13
  type CmssyRegionSettings<L extends CmssyLayout, R extends CmssyRegion<L>> = string extends CmssyRegion<L> ? Record<string, never> : RegionSettingsOf<Extract<L["regions"][number], {
14
14
  id: R;
15
15
  }>>;
16
+ type CmssyRegionSettingsOf<C extends {
17
+ layout?: CmssyLayout;
18
+ }, R extends string> = string extends CmssyRegion<NonNullable<C["layout"]>> ? Record<string, unknown> : R extends CmssyRegion<NonNullable<C["layout"]>> ? CmssyRegionSettings<NonNullable<C["layout"]>, R> : Record<string, never>;
16
19
  declare function defineCmssyLayout<const R extends readonly LayoutRegion[]>(layout: CmssyLayout<R>): CmssyLayout<R>;
17
20
  declare function layoutRegionIds(layout: CmssyLayout | undefined): string[];
18
21
 
@@ -191,4 +194,4 @@ declare function toCspOrigin(origin: string): string;
191
194
  declare function cmssyCspHeaders(options: CmssyCspOptions): Record<string, string>;
192
195
  declare function applyCmssyCsp<T extends MutableHeaders>(response: T, options: CmssyCspOptions): T;
193
196
 
194
- export { type AppToEditorMessage as A, type BoundsMessage as B, type ClickMessage as C, DEFAULT_CMSSY_EDITOR_ORIGINS as D, type EditorToAppMessage as E, isDevelopment as F, layoutRegionIds as G, resolveInitialTarget as H, type InvisibleBlock as I, toCspOrigin as J, PROTOCOL_VERSION as P, type QueryScopedOptions as Q, type ReadyMessage as R, SHORTCUT_ACTIONS as S, type ViewportMessage as V, type CmssyClient as a, type CmssyConfig as b, type CmssyCspOptions as c, type CmssyEnvConfig as d, type CmssyLayout as e, type CmssyRegion as f, type CmssyRegionOf as g, type CmssyRegionSettings as h, type CmssyTypedDocument as i, type InvisibleBlocksMessage as j, type ParentReadyMessage as k, type PatchMessage as l, type PostTarget as m, type SelectMessage as n, type ShortcutAction as o, type ShortcutMessage as p, applyCmssyCsp as q, createCmssyClient as r, defineCmssyConfig as s, defineCmssyLayout as t, isProtocolCompatible as u, normalizeOrigin as v, parseEditorMessage as w, postToEditor as x, resolveEditorOrigin as y, cmssyCspHeaders as z };
197
+ export { type AppToEditorMessage as A, type BoundsMessage as B, type ClickMessage as C, DEFAULT_CMSSY_EDITOR_ORIGINS as D, type EditorToAppMessage as E, cmssyCspHeaders as F, isDevelopment as G, layoutRegionIds as H, type InvisibleBlock as I, resolveInitialTarget as J, toCspOrigin as K, PROTOCOL_VERSION as P, type QueryScopedOptions as Q, type ReadyMessage as R, SHORTCUT_ACTIONS as S, type ViewportMessage as V, type CmssyClient as a, type CmssyConfig as b, type CmssyCspOptions as c, type CmssyEnvConfig as d, type CmssyLayout as e, type CmssyRegion as f, type CmssyRegionOf as g, type CmssyRegionSettings as h, type CmssyRegionSettingsOf as i, type CmssyTypedDocument as j, type InvisibleBlocksMessage as k, type ParentReadyMessage as l, type PatchMessage as m, type PostTarget as n, type SelectMessage as o, type ShortcutAction as p, type ShortcutMessage as q, applyCmssyCsp as r, createCmssyClient as s, defineCmssyConfig as t, defineCmssyLayout as u, isProtocolCompatible as v, normalizeOrigin as w, parseEditorMessage as x, postToEditor as y, resolveEditorOrigin as z };
@@ -13,6 +13,9 @@ type RegionSettingsOf<Region> = [Region] extends [
13
13
  type CmssyRegionSettings<L extends CmssyLayout, R extends CmssyRegion<L>> = string extends CmssyRegion<L> ? Record<string, never> : RegionSettingsOf<Extract<L["regions"][number], {
14
14
  id: R;
15
15
  }>>;
16
+ type CmssyRegionSettingsOf<C extends {
17
+ layout?: CmssyLayout;
18
+ }, R extends string> = string extends CmssyRegion<NonNullable<C["layout"]>> ? Record<string, unknown> : R extends CmssyRegion<NonNullable<C["layout"]>> ? CmssyRegionSettings<NonNullable<C["layout"]>, R> : Record<string, never>;
16
19
  declare function defineCmssyLayout<const R extends readonly LayoutRegion[]>(layout: CmssyLayout<R>): CmssyLayout<R>;
17
20
  declare function layoutRegionIds(layout: CmssyLayout | undefined): string[];
18
21
 
@@ -191,4 +194,4 @@ declare function toCspOrigin(origin: string): string;
191
194
  declare function cmssyCspHeaders(options: CmssyCspOptions): Record<string, string>;
192
195
  declare function applyCmssyCsp<T extends MutableHeaders>(response: T, options: CmssyCspOptions): T;
193
196
 
194
- export { type AppToEditorMessage as A, type BoundsMessage as B, type ClickMessage as C, DEFAULT_CMSSY_EDITOR_ORIGINS as D, type EditorToAppMessage as E, isDevelopment as F, layoutRegionIds as G, resolveInitialTarget as H, type InvisibleBlock as I, toCspOrigin as J, PROTOCOL_VERSION as P, type QueryScopedOptions as Q, type ReadyMessage as R, SHORTCUT_ACTIONS as S, type ViewportMessage as V, type CmssyClient as a, type CmssyConfig as b, type CmssyCspOptions as c, type CmssyEnvConfig as d, type CmssyLayout as e, type CmssyRegion as f, type CmssyRegionOf as g, type CmssyRegionSettings as h, type CmssyTypedDocument as i, type InvisibleBlocksMessage as j, type ParentReadyMessage as k, type PatchMessage as l, type PostTarget as m, type SelectMessage as n, type ShortcutAction as o, type ShortcutMessage as p, applyCmssyCsp as q, createCmssyClient as r, defineCmssyConfig as s, defineCmssyLayout as t, isProtocolCompatible as u, normalizeOrigin as v, parseEditorMessage as w, postToEditor as x, resolveEditorOrigin as y, cmssyCspHeaders as z };
197
+ export { type AppToEditorMessage as A, type BoundsMessage as B, type ClickMessage as C, DEFAULT_CMSSY_EDITOR_ORIGINS as D, type EditorToAppMessage as E, cmssyCspHeaders as F, isDevelopment as G, layoutRegionIds as H, type InvisibleBlock as I, resolveInitialTarget as J, toCspOrigin as K, PROTOCOL_VERSION as P, type QueryScopedOptions as Q, type ReadyMessage as R, SHORTCUT_ACTIONS as S, type ViewportMessage as V, type CmssyClient as a, type CmssyConfig as b, type CmssyCspOptions as c, type CmssyEnvConfig as d, type CmssyLayout as e, type CmssyRegion as f, type CmssyRegionOf as g, type CmssyRegionSettings as h, type CmssyRegionSettingsOf as i, type CmssyTypedDocument as j, type InvisibleBlocksMessage as k, type ParentReadyMessage as l, type PatchMessage as m, type PostTarget as n, type SelectMessage as o, type ShortcutAction as p, type ShortcutMessage as q, applyCmssyCsp as r, createCmssyClient as s, defineCmssyConfig as t, defineCmssyLayout as u, isProtocolCompatible as v, normalizeOrigin as w, parseEditorMessage as x, postToEditor as y, resolveEditorOrigin as z };
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as CmssyClient, b as CmssyConfig, c as CmssyCspOptions, d as CmssyEnvConfig, e as CmssyLayout, f as CmssyRegion, g as CmssyRegionOf, h as CmssyRegionSettings, i as CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, I as InvisibleBlock, j as InvisibleBlocksMessage, P as PROTOCOL_VERSION, k as ParentReadyMessage, l as PatchMessage, m as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, n as SelectMessage, o as ShortcutAction, p as ShortcutMessage, V as ViewportMessage, q as applyCmssyCsp, r as createCmssyClient, s as defineCmssyConfig, t as defineCmssyLayout, u as isProtocolCompatible, v as normalizeOrigin, w as parseEditorMessage, x as postToEditor, y as resolveEditorOrigin } from './csp-BSWMb5Du.cjs';
1
+ export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as CmssyClient, b as CmssyConfig, c as CmssyCspOptions, d as CmssyEnvConfig, e as CmssyLayout, f as CmssyRegion, g as CmssyRegionOf, h as CmssyRegionSettings, i as CmssyRegionSettingsOf, j as CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, I as InvisibleBlock, k as InvisibleBlocksMessage, P as PROTOCOL_VERSION, l as ParentReadyMessage, m as PatchMessage, n as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, o as SelectMessage, p as ShortcutAction, q as ShortcutMessage, V as ViewportMessage, r as applyCmssyCsp, s as createCmssyClient, t as defineCmssyConfig, u as defineCmssyLayout, v as isProtocolCompatible, w as normalizeOrigin, x as parseEditorMessage, y as postToEditor, z as resolveEditorOrigin } from './csp-CY7ssZsh.cjs';
2
2
  export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-JyBHqpAQ.cjs';
3
3
  export { C as CMSSY_RATE_LIMIT_WINDOW_MS, a as CMSSY_RETRY_MODES, b as CmssyRequestError, c as CmssyRetryMode, D as DEFAULT_CMSSY_API_URL, F as FetchLike, d as FetchLikeResponse, e as FetchPageOptions, R as RetryOption, f as RetryPolicy } from './content-client-65N8ZRq9.cjs';
4
4
  import * as _cmssy_types from '@cmssy/types';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as CmssyClient, b as CmssyConfig, c as CmssyCspOptions, d as CmssyEnvConfig, e as CmssyLayout, f as CmssyRegion, g as CmssyRegionOf, h as CmssyRegionSettings, i as CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, I as InvisibleBlock, j as InvisibleBlocksMessage, P as PROTOCOL_VERSION, k as ParentReadyMessage, l as PatchMessage, m as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, n as SelectMessage, o as ShortcutAction, p as ShortcutMessage, V as ViewportMessage, q as applyCmssyCsp, r as createCmssyClient, s as defineCmssyConfig, t as defineCmssyLayout, u as isProtocolCompatible, v as normalizeOrigin, w as parseEditorMessage, x as postToEditor, y as resolveEditorOrigin } from './csp-P-acJQaJ.js';
1
+ export { A as AppToEditorMessage, B as BoundsMessage, C as ClickMessage, a as CmssyClient, b as CmssyConfig, c as CmssyCspOptions, d as CmssyEnvConfig, e as CmssyLayout, f as CmssyRegion, g as CmssyRegionOf, h as CmssyRegionSettings, i as CmssyRegionSettingsOf, j as CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, I as InvisibleBlock, k as InvisibleBlocksMessage, P as PROTOCOL_VERSION, l as ParentReadyMessage, m as PatchMessage, n as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, o as SelectMessage, p as ShortcutAction, q as ShortcutMessage, V as ViewportMessage, r as applyCmssyCsp, s as createCmssyClient, t as defineCmssyConfig, u as defineCmssyLayout, v as isProtocolCompatible, w as normalizeOrigin, x as parseEditorMessage, y as postToEditor, z as resolveEditorOrigin } from './csp-DLCKZAyi.js';
2
2
  export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-D9KI4bND.js';
3
3
  export { C as CMSSY_RATE_LIMIT_WINDOW_MS, a as CMSSY_RETRY_MODES, b as CmssyRequestError, c as CmssyRetryMode, D as DEFAULT_CMSSY_API_URL, F as FetchLike, d as FetchLikeResponse, e as FetchPageOptions, R as RetryOption, f as RetryPolicy } from './content-client-65N8ZRq9.js';
4
4
  import * as _cmssy_types from '@cmssy/types';
package/dist/internal.cjs CHANGED
@@ -1142,8 +1142,9 @@ function buildBlockContext(locale, defaultLocale, enabledLocales, isPreview, for
1142
1142
  ...extra?.workspace ? { workspace: extra.workspace } : {},
1143
1143
  ...extra?.page?.slug ? {
1144
1144
  page: {
1145
- id: extra.page.id,
1145
+ ...extra.page.id !== void 0 ? { id: extra.page.id } : {},
1146
1146
  slug: extra.page.slug,
1147
+ path: extra.page.slug.split("/").filter(Boolean),
1147
1148
  pageType: extra.page.pageType ?? null
1148
1149
  }
1149
1150
  } : {},
@@ -3,8 +3,8 @@ import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyCl
3
3
  export { CmssySiteLocales } from '@cmssy/types';
4
4
  import { G as GraphqlRequestOptions } from './locale-JyBHqpAQ.cjs';
5
5
  export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from './locale-JyBHqpAQ.cjs';
6
- import { Q as QueryScopedOptions } from './csp-BSWMb5Du.cjs';
7
- export { z as cmssyCspHeaders, F as isDevelopment, G as layoutRegionIds, H as resolveInitialTarget, J as toCspOrigin } from './csp-BSWMb5Du.cjs';
6
+ import { Q as QueryScopedOptions } from './csp-CY7ssZsh.cjs';
7
+ export { F as cmssyCspHeaders, G as isDevelopment, H as layoutRegionIds, J as resolveInitialTarget, K as toCspOrigin } from './csp-CY7ssZsh.cjs';
8
8
  export { localizedPath } from './internal/locale.cjs';
9
9
 
10
10
  declare const SITE_CONFIG_QUERY = "query PublicSiteConfig($workspaceSlug: String!) {\n public {\n siteConfig(workspaceSlug: $workspaceSlug) {\n id\n workspaceId\n siteName\n defaultLanguage\n enabledLanguages\n enabledFeatures\n notFoundPageId\n previewUrl\n branding {\n brandName\n logoUrl\n logoDarkUrl\n faviconUrl\n ogImageUrl\n }\n }\n }\n}";
@@ -3,8 +3,8 @@ import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyCl
3
3
  export { CmssySiteLocales } from '@cmssy/types';
4
4
  import { G as GraphqlRequestOptions } from './locale-D9KI4bND.js';
5
5
  export { C as CMSSY_LOCALE_HEADER, a as localeForPath, b as localeForPathname, l as localizeHref, c as resolveSiteLocales, s as splitCmssyLocale, d as splitLocaleFromPath } from './locale-D9KI4bND.js';
6
- import { Q as QueryScopedOptions } from './csp-P-acJQaJ.js';
7
- export { z as cmssyCspHeaders, F as isDevelopment, G as layoutRegionIds, H as resolveInitialTarget, J as toCspOrigin } from './csp-P-acJQaJ.js';
6
+ import { Q as QueryScopedOptions } from './csp-DLCKZAyi.js';
7
+ export { F as cmssyCspHeaders, G as isDevelopment, H as layoutRegionIds, J as resolveInitialTarget, K as toCspOrigin } from './csp-DLCKZAyi.js';
8
8
  export { localizedPath } from './internal/locale.js';
9
9
 
10
10
  declare const SITE_CONFIG_QUERY = "query PublicSiteConfig($workspaceSlug: String!) {\n public {\n siteConfig(workspaceSlug: $workspaceSlug) {\n id\n workspaceId\n siteName\n defaultLanguage\n enabledLanguages\n enabledFeatures\n notFoundPageId\n previewUrl\n branding {\n brandName\n logoUrl\n logoDarkUrl\n faviconUrl\n ogImageUrl\n }\n }\n }\n}";
package/dist/internal.js CHANGED
@@ -1140,8 +1140,9 @@ function buildBlockContext(locale, defaultLocale, enabledLocales, isPreview, for
1140
1140
  ...extra?.workspace ? { workspace: extra.workspace } : {},
1141
1141
  ...extra?.page?.slug ? {
1142
1142
  page: {
1143
- id: extra.page.id,
1143
+ ...extra.page.id !== void 0 ? { id: extra.page.id } : {},
1144
1144
  slug: extra.page.slug,
1145
+ path: extra.page.slug.split("/").filter(Boolean),
1145
1146
  pageType: extra.page.pageType ?? null
1146
1147
  }
1147
1148
  } : {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/core",
3
- "version": "14.0.0",
3
+ "version": "14.1.0",
4
4
  "description": "Framework-agnostic cmssy gateway: GraphQL client, block/field system, editor protocol. No React, no Next.",
5
5
  "keywords": [
6
6
  "cmssy",
@@ -87,7 +87,7 @@
87
87
  "vitest": "^2.1.0"
88
88
  },
89
89
  "dependencies": {
90
- "@cmssy/types": "0.38.0",
90
+ "@cmssy/types": "0.39.0",
91
91
  "jose": "^6.2.3"
92
92
  },
93
93
  "scripts": {