@embeddables/cli 0.7.4 → 0.7.6

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.
@@ -307,8 +307,10 @@ Note: If you need to use any breakpoints other than 720px and 520px, you must ad
307
307
 
308
308
  Whenever you need to insert an image or icon (e.g. a logo, an icon, a larger image) you have the following options:
309
309
 
310
- 1. `emojiIcon` with an emoji when there is an appropriate emoji that you can use. This can be used in `imageUrl` in CustomButton, or `imageUrl` inside OptionSelector buttons
311
- 2. Image URL. This can be used in `src` in MediaImage, `imageUrl` in CustomButton, or `imageUrl` inside OptionSelector buttons.
310
+ 1. `emojiIcon` with an emoji when there is an appropriate emoji that you can use. This can be used in CustomButton, or inside OptionSelector buttons.
311
+ 2. Image URL. Use **`imageUrl`** (not `imgSrc` or `imageSrc`) for button images: `imageUrl` in CustomButton, or `imageUrl` on each button in OptionSelector. For standalone images use `src` in MediaImage.
312
+
313
+ Using the wrong property name (e.g. `imgSrc`) will cause save/validation errors; the schema only accepts `imageUrl` for buttons.
312
314
 
313
315
  For placeholder images, the recommended service is placehold.co:
314
316
 
@@ -358,7 +360,7 @@ Note: button icons and checkboxes are before text in the button, unless you set
358
360
  | `ButtonText` | `<div>` | `text` set | |
359
361
  | `ButtonDescription` | `<div>` | `description` set | |
360
362
  | `ButtonIcon` | `<svg>`/`<span>` | `icon` or `emojiIcon` set | If `icon`, must be font-awesome icon name; if `emojiIcon` must be an emoji in text format like 😀 |
361
- | `ButtonIconImage` | `<span>` | `imageUrl` set | |
363
+ | `ButtonIconImage` | `<span>` | `imageUrl` set | Use **`imageUrl`** only (not `imgSrc`). SVG URLs are valid. |
362
364
 
363
365
  ### InputBox
364
366
 
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAoCA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;;GAwTA"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAoCA,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;;GA0UA"}
@@ -151,10 +151,24 @@ export async function startProxyServer(opts) {
151
151
  const generatedJson = JSON.parse(raw);
152
152
  generatedJson.id = opts.embeddableId;
153
153
  stdout.print(`[/init] Loaded local JSON, pages: ${generatedJson.pages?.length ?? 0}`);
154
+ // When the flow has content_sources (CMS), the remote engine needs flow metadata
155
+ // (project_id) to load them. Without an engine that supports dev + CMS, the request
156
+ // fails. So we omit content_sources so the page loads; CMS-backed content will be
157
+ // empty in dev.
158
+ const hasContentSources = Array.isArray(generatedJson.content_sources) && generatedJson.content_sources.length > 0;
159
+ const flowToSend = hasContentSources
160
+ ? (() => {
161
+ const { content_sources: _, ...rest } = generatedJson;
162
+ return rest;
163
+ })()
164
+ : generatedJson;
165
+ if (hasContentSources) {
166
+ stdout.print(`[/init] Omitting content_sources so dev loads (CMS content will be empty in preview).`);
167
+ }
154
168
  // Create POST request body with the JSON
155
169
  const postBody = {
156
170
  json: {
157
- flow: generatedJson,
171
+ flow: flowToSend,
158
172
  flowId: generatedJson.id,
159
173
  groupId: 'group_test',
160
174
  },
@@ -45,7 +45,7 @@ export function PageNavigator({ embeddableId }) {
45
45
  window.addEventListener(USERDATA_UPDATED_EVENT, handler);
46
46
  return () => window.removeEventListener(USERDATA_UPDATED_EVENT, handler);
47
47
  }, [embeddableId, refresh]);
48
- // Close dropdown when clicking outside
48
+ // Close dropdown when clicking outside (use 'click' so selecting a page item fires its onClick before we consider closing)
49
49
  useEffect(() => {
50
50
  const handleClickOutside = (event) => {
51
51
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
@@ -53,8 +53,8 @@ export function PageNavigator({ embeddableId }) {
53
53
  }
54
54
  };
55
55
  if (isDropdownOpen) {
56
- document.addEventListener('mousedown', handleClickOutside);
57
- return () => document.removeEventListener('mousedown', handleClickOutside);
56
+ document.addEventListener('click', handleClickOutside);
57
+ return () => document.removeEventListener('click', handleClickOutside);
58
58
  }
59
59
  }, [isDropdownOpen]);
60
60
  // Scroll to current page when dropdown opens
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddables/cli",
3
- "version": "0.7.4",
3
+ "version": "0.7.6",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "embeddables": "./bin/embeddables.mjs"