@estation/create-cms-site 1.4.1 → 1.4.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.
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import { listCollections, getCollection, createCollection, updateCollection, del
12
12
  import { searchContent } from "./tools/search.js";
13
13
  const server = new McpServer({
14
14
  name: "estation-cms",
15
- version: "1.4.1",
15
+ version: "1.4.2",
16
16
  }, {
17
17
  instructions: `You are connected to the eSTATION CMS — a headless content management system at cms-gateway.estation.io.
18
18
 
@@ -214,7 +214,7 @@ Tags is an array: \`block.tags.includes("hero")\`, NOT \`block.tag.split(",").in
214
214
  When creating a preview listener component, it MUST:
215
215
  1. Check \`msg.type === "cms-preview-update"\` before processing (other postMessages exist)
216
216
  2. Handle \`cms-preview-highlight\` messages for field focus/blur visual feedback
217
- 3. Handle click-to-edit: when inside an iframe, delegate clicks on \`[data-cms-field]\` elements and send \`cms-preview-element-click\` messages to \`window.parent\` with \`{ blockTag, fieldName }\`
217
+ 3. Handle click-to-edit: when inside an iframe, delegate clicks on \`[data-cms-field]\` elements, call \`preventDefault()\` + \`stopPropagation()\` to block link navigation, and send \`cms-preview-element-click\` messages to \`window.parent\` with \`{ blockTag, fieldName }\`
218
218
  4. Add hover styles (\`outline: 1px dashed\`) on \`[data-cms-field]\` elements — only when inside an iframe
219
219
  5. Use \`msg.value\` (not \`msg.fieldValue\`) for the updated value — matches the protocol
220
220
  6. The complete listener code is in the template at \`template/src/components/cms-preview-listener.tsx\` — prefer copying it verbatim rather than rewriting it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estation/create-cms-site",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "MCP server to scaffold Next.js sites powered by eSTATION CMS",
5
5
  "type": "module",
6
6
  "bin": {
@@ -125,6 +125,10 @@ function handleClick(event: MouseEvent) {
125
125
  const blockEl = fieldEl.closest("[data-cms-block]");
126
126
  if (!blockEl) return;
127
127
 
128
+ // Prevent navigation when clicking links inside CMS fields
129
+ event.preventDefault();
130
+ event.stopPropagation();
131
+
128
132
  const fieldName = fieldEl.getAttribute("data-cms-field");
129
133
  const blockTag = blockEl.getAttribute("data-cms-block");
130
134
  if (!fieldName || !blockTag) return;
@@ -85,6 +85,12 @@ export interface CMSPreviewHighlightMessage {
85
85
  active: boolean;
86
86
  }
87
87
 
88
+ export interface CMSPreviewElementClickMessage {
89
+ type: "cms-preview-element-click";
90
+ blockTag: string;
91
+ fieldName: string;
92
+ }
93
+
88
94
  export interface PaginatedResponse<T> {
89
95
  page: number;
90
96
  size: number;