@cmssy/core 12.3.0 → 12.4.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.
@@ -40,6 +40,8 @@ declare function createCmssyClient(input: CmssyClientConfig): CmssyClient;
40
40
 
41
41
  declare const PROTOCOL_VERSION = 2;
42
42
 
43
+ declare const SHORTCUT_ACTIONS: readonly ["undo", "redo", "save", "duplicate", "delete", "escape"];
44
+ type ShortcutAction = (typeof SHORTCUT_ACTIONS)[number];
43
45
  interface ReadyMessage {
44
46
  type: "cmssy:ready";
45
47
  protocolVersion: number;
@@ -51,6 +53,7 @@ interface ReadyMessage {
51
53
  }>;
52
54
  schemas: Record<string, BlockSchema>;
53
55
  blockMeta?: Record<string, BlockMeta>;
56
+ capabilities?: string[];
54
57
  }
55
58
  interface BoundsMessage {
56
59
  type: "cmssy:bounds";
@@ -77,7 +80,12 @@ interface DragIndexMessage {
77
80
  protocolVersion: number;
78
81
  index: number;
79
82
  }
80
- type AppToEditorMessage = ReadyMessage | BoundsMessage | ClickMessage | DeselectMessage | MoveMessage | DragIndexMessage;
83
+ interface ShortcutMessage {
84
+ type: "cmssy:shortcut";
85
+ protocolVersion: number;
86
+ action: ShortcutAction;
87
+ }
88
+ type AppToEditorMessage = ReadyMessage | BoundsMessage | ClickMessage | DeselectMessage | MoveMessage | DragIndexMessage | ShortcutMessage;
81
89
  interface SelectMessage {
82
90
  type: "cmssy:select";
83
91
  protocolVersion: number;
@@ -150,4 +158,4 @@ declare function toCspOrigin(origin: string): string;
150
158
  declare function cmssyCspHeaders(options: CmssyCspOptions): Record<string, string>;
151
159
  declare function applyCmssyCsp<T extends MutableHeaders>(response: T, options: CmssyCspOptions): T;
152
160
 
153
- export { type AppToEditorMessage as A, type BoundsMessage as B, type ClickMessage as C, DEFAULT_CMSSY_EDITOR_ORIGINS as D, type EditorToAppMessage as E, PROTOCOL_VERSION as P, type QueryScopedOptions as Q, type ReadyMessage as R, type SelectMessage as S, type CmssyClient as a, type CmssyConfig as b, type CmssyCspOptions as c, type CmssyEnvConfig as d, type CmssyTypedDocument as e, type ParentReadyMessage as f, type PatchMessage as g, type PostTarget as h, applyCmssyCsp as i, createCmssyClient as j, defineCmssyConfig as k, isProtocolCompatible as l, postToEditor as m, normalizeOrigin as n, cmssyCspHeaders as o, parseEditorMessage as p, isDevelopment as q, resolveEditorOrigin as r, resolveInitialTarget as s, toCspOrigin as t };
161
+ export { type AppToEditorMessage as A, type BoundsMessage as B, type ClickMessage as C, DEFAULT_CMSSY_EDITOR_ORIGINS as D, type EditorToAppMessage as E, PROTOCOL_VERSION as P, type QueryScopedOptions as Q, type ReadyMessage as R, SHORTCUT_ACTIONS as S, type CmssyClient as a, type CmssyConfig as b, type CmssyCspOptions as c, type CmssyEnvConfig as d, type CmssyTypedDocument as e, type ParentReadyMessage as f, type PatchMessage as g, type PostTarget as h, type SelectMessage as i, type ShortcutAction as j, type ShortcutMessage as k, applyCmssyCsp as l, createCmssyClient as m, defineCmssyConfig as n, isProtocolCompatible as o, normalizeOrigin as p, parseEditorMessage as q, postToEditor as r, resolveEditorOrigin as s, cmssyCspHeaders as t, isDevelopment as u, resolveInitialTarget as v, toCspOrigin as w };
@@ -40,6 +40,8 @@ declare function createCmssyClient(input: CmssyClientConfig): CmssyClient;
40
40
 
41
41
  declare const PROTOCOL_VERSION = 2;
42
42
 
43
+ declare const SHORTCUT_ACTIONS: readonly ["undo", "redo", "save", "duplicate", "delete", "escape"];
44
+ type ShortcutAction = (typeof SHORTCUT_ACTIONS)[number];
43
45
  interface ReadyMessage {
44
46
  type: "cmssy:ready";
45
47
  protocolVersion: number;
@@ -51,6 +53,7 @@ interface ReadyMessage {
51
53
  }>;
52
54
  schemas: Record<string, BlockSchema>;
53
55
  blockMeta?: Record<string, BlockMeta>;
56
+ capabilities?: string[];
54
57
  }
55
58
  interface BoundsMessage {
56
59
  type: "cmssy:bounds";
@@ -77,7 +80,12 @@ interface DragIndexMessage {
77
80
  protocolVersion: number;
78
81
  index: number;
79
82
  }
80
- type AppToEditorMessage = ReadyMessage | BoundsMessage | ClickMessage | DeselectMessage | MoveMessage | DragIndexMessage;
83
+ interface ShortcutMessage {
84
+ type: "cmssy:shortcut";
85
+ protocolVersion: number;
86
+ action: ShortcutAction;
87
+ }
88
+ type AppToEditorMessage = ReadyMessage | BoundsMessage | ClickMessage | DeselectMessage | MoveMessage | DragIndexMessage | ShortcutMessage;
81
89
  interface SelectMessage {
82
90
  type: "cmssy:select";
83
91
  protocolVersion: number;
@@ -150,4 +158,4 @@ declare function toCspOrigin(origin: string): string;
150
158
  declare function cmssyCspHeaders(options: CmssyCspOptions): Record<string, string>;
151
159
  declare function applyCmssyCsp<T extends MutableHeaders>(response: T, options: CmssyCspOptions): T;
152
160
 
153
- export { type AppToEditorMessage as A, type BoundsMessage as B, type ClickMessage as C, DEFAULT_CMSSY_EDITOR_ORIGINS as D, type EditorToAppMessage as E, PROTOCOL_VERSION as P, type QueryScopedOptions as Q, type ReadyMessage as R, type SelectMessage as S, type CmssyClient as a, type CmssyConfig as b, type CmssyCspOptions as c, type CmssyEnvConfig as d, type CmssyTypedDocument as e, type ParentReadyMessage as f, type PatchMessage as g, type PostTarget as h, applyCmssyCsp as i, createCmssyClient as j, defineCmssyConfig as k, isProtocolCompatible as l, postToEditor as m, normalizeOrigin as n, cmssyCspHeaders as o, parseEditorMessage as p, isDevelopment as q, resolveEditorOrigin as r, resolveInitialTarget as s, toCspOrigin as t };
161
+ export { type AppToEditorMessage as A, type BoundsMessage as B, type ClickMessage as C, DEFAULT_CMSSY_EDITOR_ORIGINS as D, type EditorToAppMessage as E, PROTOCOL_VERSION as P, type QueryScopedOptions as Q, type ReadyMessage as R, SHORTCUT_ACTIONS as S, type CmssyClient as a, type CmssyConfig as b, type CmssyCspOptions as c, type CmssyEnvConfig as d, type CmssyTypedDocument as e, type ParentReadyMessage as f, type PatchMessage as g, type PostTarget as h, type SelectMessage as i, type ShortcutAction as j, type ShortcutMessage as k, applyCmssyCsp as l, createCmssyClient as m, defineCmssyConfig as n, isProtocolCompatible as o, normalizeOrigin as p, parseEditorMessage as q, postToEditor as r, resolveEditorOrigin as s, cmssyCspHeaders as t, isDevelopment as u, resolveInitialTarget as v, toCspOrigin as w };
package/dist/index.cjs CHANGED
@@ -606,6 +606,14 @@ var CMSSY_LOCALE_HEADER = "x-cmssy-locale";
606
606
 
607
607
  // src/bridge/protocol.ts
608
608
  var PROTOCOL_VERSION = 2;
609
+ var SHORTCUT_ACTIONS = [
610
+ "undo",
611
+ "redo",
612
+ "save",
613
+ "duplicate",
614
+ "delete",
615
+ "escape"
616
+ ];
609
617
  function isProtocolCompatible(version) {
610
618
  return version === PROTOCOL_VERSION;
611
619
  }
@@ -888,6 +896,7 @@ exports.CmssyWebhookError = CmssyWebhookError;
888
896
  exports.DEFAULT_CMSSY_API_URL = DEFAULT_CMSSY_API_URL;
889
897
  exports.DEFAULT_CMSSY_EDITOR_ORIGINS = DEFAULT_CMSSY_EDITOR_ORIGINS;
890
898
  exports.PROTOCOL_VERSION = PROTOCOL_VERSION;
899
+ exports.SHORTCUT_ACTIONS = SHORTCUT_ACTIONS;
891
900
  exports.applyCmssyCsp = applyCmssyCsp;
892
901
  exports.createCmssyClient = createCmssyClient;
893
902
  exports.defineCmssyConfig = defineCmssyConfig;
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 CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, P as PROTOCOL_VERSION, f as ParentReadyMessage, g as PatchMessage, h as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SelectMessage, i as applyCmssyCsp, j as createCmssyClient, k as defineCmssyConfig, l as isProtocolCompatible, n as normalizeOrigin, p as parseEditorMessage, m as postToEditor, r as resolveEditorOrigin } from './csp-CcMsQrrS.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 CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, P as PROTOCOL_VERSION, f as ParentReadyMessage, g as PatchMessage, h as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, i as SelectMessage, j as ShortcutAction, k as ShortcutMessage, l as applyCmssyCsp, m as createCmssyClient, n as defineCmssyConfig, o as isProtocolCompatible, p as normalizeOrigin, q as parseEditorMessage, r as postToEditor, s as resolveEditorOrigin } from './csp-Dhzj8NrW.cjs';
2
2
  export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-BS61R-fF.cjs';
3
3
  export { C as CmssyRequestError, D as DEFAULT_CMSSY_API_URL, F as FetchLike, a as FetchLikeResponse, b as FetchPageOptions, R as RetryPolicy } from './content-client-BPpRfq0h.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 CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, P as PROTOCOL_VERSION, f as ParentReadyMessage, g as PatchMessage, h as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SelectMessage, i as applyCmssyCsp, j as createCmssyClient, k as defineCmssyConfig, l as isProtocolCompatible, n as normalizeOrigin, p as parseEditorMessage, m as postToEditor, r as resolveEditorOrigin } from './csp-Bstf0ycQ.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 CmssyTypedDocument, D as DEFAULT_CMSSY_EDITOR_ORIGINS, E as EditorToAppMessage, P as PROTOCOL_VERSION, f as ParentReadyMessage, g as PatchMessage, h as PostTarget, Q as QueryScopedOptions, R as ReadyMessage, S as SHORTCUT_ACTIONS, i as SelectMessage, j as ShortcutAction, k as ShortcutMessage, l as applyCmssyCsp, m as createCmssyClient, n as defineCmssyConfig, o as isProtocolCompatible, p as normalizeOrigin, q as parseEditorMessage, r as postToEditor, s as resolveEditorOrigin } from './csp-bnRXSElG.js';
2
2
  export { C as CMSSY_LOCALE_HEADER, G as GraphqlRequestOptions, g as graphqlRequest, l as localizeHref, r as resolveCmssyLocale } from './locale-DQZ80cew.js';
3
3
  export { C as CmssyRequestError, D as DEFAULT_CMSSY_API_URL, F as FetchLike, a as FetchLikeResponse, b as FetchPageOptions, R as RetryPolicy } from './content-client-BPpRfq0h.js';
4
4
  import * as _cmssy_types from '@cmssy/types';
package/dist/index.js CHANGED
@@ -604,6 +604,14 @@ var CMSSY_LOCALE_HEADER = "x-cmssy-locale";
604
604
 
605
605
  // src/bridge/protocol.ts
606
606
  var PROTOCOL_VERSION = 2;
607
+ var SHORTCUT_ACTIONS = [
608
+ "undo",
609
+ "redo",
610
+ "save",
611
+ "duplicate",
612
+ "delete",
613
+ "escape"
614
+ ];
607
615
  function isProtocolCompatible(version) {
608
616
  return version === PROTOCOL_VERSION;
609
617
  }
@@ -869,4 +877,4 @@ async function verifyCmssyWebhook(options) {
869
877
  return parsed;
870
878
  }
871
879
 
872
- export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyRequestError, CmssyWebhookError, DEFAULT_CMSSY_API_URL, DEFAULT_CMSSY_EDITOR_ORIGINS, PROTOCOL_VERSION, applyCmssyCsp, createCmssyClient, defineCmssyConfig, fields, graphqlRequest, isProtocolCompatible, isVerifiedEditUrl, localizeHref, mediaAlt, mediaUrl, mediaUrls, normalizeOrigin, parseEditorMessage, postToEditor, resolveCmssyLocale, resolveEditorOrigin, verifyCmssyWebhook };
880
+ export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyRequestError, CmssyWebhookError, DEFAULT_CMSSY_API_URL, DEFAULT_CMSSY_EDITOR_ORIGINS, PROTOCOL_VERSION, SHORTCUT_ACTIONS, applyCmssyCsp, createCmssyClient, defineCmssyConfig, fields, graphqlRequest, isProtocolCompatible, isVerifiedEditUrl, localizeHref, mediaAlt, mediaUrl, mediaUrls, normalizeOrigin, parseEditorMessage, postToEditor, resolveCmssyLocale, resolveEditorOrigin, verifyCmssyWebhook };
@@ -3,8 +3,8 @@ import { CmssyFormDefinition, BuildBlockContextExtra, CmssyBlockContext, CmssyCl
3
3
  export { CmssySiteLocales } from '@cmssy/types';
4
4
  import { G as GraphqlRequestOptions } from './locale-BS61R-fF.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-BS61R-fF.cjs';
6
- import { Q as QueryScopedOptions } from './csp-CcMsQrrS.cjs';
7
- export { o as cmssyCspHeaders, q as isDevelopment, s as resolveInitialTarget, t as toCspOrigin } from './csp-CcMsQrrS.cjs';
6
+ import { Q as QueryScopedOptions } from './csp-Dhzj8NrW.cjs';
7
+ export { t as cmssyCspHeaders, u as isDevelopment, v as resolveInitialTarget, w as toCspOrigin } from './csp-Dhzj8NrW.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-DQZ80cew.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-DQZ80cew.js';
6
- import { Q as QueryScopedOptions } from './csp-Bstf0ycQ.js';
7
- export { o as cmssyCspHeaders, q as isDevelopment, s as resolveInitialTarget, t as toCspOrigin } from './csp-Bstf0ycQ.js';
6
+ import { Q as QueryScopedOptions } from './csp-bnRXSElG.js';
7
+ export { t as cmssyCspHeaders, u as isDevelopment, v as resolveInitialTarget, w as toCspOrigin } from './csp-bnRXSElG.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmssy/core",
3
- "version": "12.3.0",
3
+ "version": "12.4.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",