@syntrologie/runtime-sdk 2.8.0-canary.9 → 2.9.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.
package/CAPABILITIES.md CHANGED
@@ -233,6 +233,7 @@ Inserts HTML content relative to an element.
233
233
  | `anchorId` | string | Yes | Element selector |
234
234
  | `html` | string | Yes | HTML content (sanitized) |
235
235
  | `position` | string | Yes | `"before"`, `"after"`, `"prepend"`, `"append"`, `"replace"` |
236
+ | `deepLink` | object | No | Makes the entire inserted element clickable to open the canvas panel and navigate to a specific tile |
236
237
 
237
238
  **Positions:**
238
239
 
@@ -251,6 +252,27 @@ Inserts HTML content relative to an element.
251
252
  }
252
253
  ```
253
254
 
255
+ **Deep-linking to canvas tiles:**
256
+
257
+ Use `deepLink` to make inserted content open the canvas panel and navigate to a specific tile when clicked. This is the correct way to connect inserted buttons/links to canvas tiles — do NOT use `onclick` handlers with `window.SynOS`.
258
+
259
+ | Property | Type | Required | Description |
260
+ | ---------------- | ------ | -------- | ---------------------------------- |
261
+ | `deepLink.tileId` | string | Yes | ID of the tile to open |
262
+ | `deepLink.itemId` | string | No | Specific item within the tile |
263
+
264
+ ```json
265
+ {
266
+ "kind": "insert_html",
267
+ "anchorId": "[data-id='pricing-heading']",
268
+ "html": "<button style='background: #4a90e2; color: white; border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer;'>Help Me Choose</button>",
269
+ "position": "after",
270
+ "deepLink": { "tileId": "plan_selector_faq" }
271
+ }
272
+ ```
273
+
274
+ The SDK automatically handles opening the canvas, setting the cursor to pointer, and publishing a `notification.deep_link` event. The click handler is wired up and cleaned up by the SDK — no JavaScript in the HTML is needed.
275
+
254
276
  ### add_class
255
277
 
256
278
  Adds a CSS class to an element.
@@ -1285,24 +1307,24 @@ Control when adaptives activate using `DecisionStrategy`:
1285
1307
  - Track `action.applied` for analytics
1286
1308
  - Use EventBus for cross-adaptive coordination
1287
1309
 
1288
- ### 6. JavaScript API (window.SynOS)
1289
-
1290
- When generating `content:insertHtml` with interactive elements (buttons, links) that need to control the SDK canvas panel, use the `window.SynOS.handle` API:
1291
-
1292
- | Method | Description |
1293
- |--------|-------------|
1294
- | `window.SynOS.handle.open()` | Open the canvas panel |
1295
- | `window.SynOS.handle.close()` | Close the canvas panel |
1310
+ ### 6. Opening the Canvas from Inserted Content
1296
1311
 
1297
- Example button that opens the canvas:
1312
+ When `content:insertHtml` needs to open the canvas panel (e.g., a "Help Me Choose" button that opens an FAQ tile), use the `deepLink` property — **never write `onclick` handlers or reference `window.SynOS` in HTML**.
1298
1313
 
1299
1314
  ```json
1300
1315
  {
1301
1316
  "kind": "insert_html",
1302
- "anchorId": ".pricing-heading",
1303
- "html": "<button onclick='window.SynOS?.handle?.open()'>Help Me Choose</button>",
1304
- "position": "after"
1317
+ "anchorId": "[data-id='pricing-heading']",
1318
+ "html": "<button style='background: #4a90e2; color: white; border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer;'>Help Me Choose</button>",
1319
+ "position": "after",
1320
+ "deepLink": { "tileId": "plan_selector_faq" }
1305
1321
  }
1306
1322
  ```
1307
1323
 
1308
- **WARNING:** There is NO `window.SynOS.canvas` property. Always use `window.SynOS.handle`.
1324
+ The `deepLink` object:
1325
+ - `tileId` (required) — ID of the canvas tile to navigate to
1326
+ - `itemId` (optional) — specific item within the tile (e.g., a FAQ question ID)
1327
+
1328
+ The SDK automatically opens the canvas, navigates to the tile, sets cursor to pointer, and wires up click/cleanup handlers.
1329
+
1330
+ **NEVER use `onclick`, `window.SynOS`, or any JavaScript in `insert_html` HTML strings.** The HTML is sanitized and event handlers are stripped. Use `deepLink` instead.