composeai 0.1.5 → 0.1.7

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/README.md CHANGED
@@ -79,6 +79,30 @@ the raw markdown. The submit payload still carries reconstructed markdown.
79
79
  />
80
80
  ```
81
81
 
82
+ #### Multiple trigger symbols
83
+
84
+ `slashCommands` also accepts an **array** of configs, so you can bind several
85
+ trigger symbols at once — each with its own menu and per-command action. Give
86
+ each a distinct `trigger`.
87
+
88
+ ```tsx
89
+ <Composer
90
+ features={{
91
+ slashCommands: [
92
+ // "/" → commands that run an action (open a dialog, toggle a mode, …)
93
+ { trigger: "/", items: [
94
+ { id: "announce", label: "Announcement", onSelect: () => openAnnouncement() },
95
+ ] },
96
+ // "#" → issues that insert a link
97
+ { trigger: "#", items: (q) => searchIssues(q).then((rows) =>
98
+ rows.map((i) => ({ id: i.id, label: i.title, onSelect: (ctx) => ctx.insertMarkdown(`[#${i.number}](/issues/${i.number})`) })),
99
+ ) },
100
+ ],
101
+ mentions: { items: members }, // "@" stays its own separate menu
102
+ }}
103
+ />
104
+ ```
105
+
82
106
  ### Attachments — with upload pipeline
83
107
 
84
108
  ```tsx
@@ -205,7 +229,7 @@ const ref = useRef<ComposerHandle>(null);
205
229
  | `markdown` | `boolean \| MarkdownConfig` | `true` | `{ mode: "hybrid" \| "live" }` — `live` hides markers Notion-style. |
206
230
  | `attachments` | `boolean \| AttachmentsConfig`| `false` | `{ file, image, accept, types, maxSize, maxCount }`. |
207
231
  | `mentions` | `false \| MentionConfig` | `false` | `{ items, trigger, maxItems }`. `items` may be async — UI shows a skeleton. |
208
- | `slashCommands` | `false \| SlashConfig` | `false` | `{ items, trigger, maxItems }`. |
232
+ | `slashCommands` | `false \| SlashConfig \| SlashConfig[]` | `false` | `{ items, trigger, maxItems }`. Pass an **array** to register multiple trigger symbols at once (e.g. `/` commands + `#` issues), each with its own action menu. |
209
233
  | `voice` | `boolean` | `false` | Web Speech + MediaRecorder fallback. Requires HTTPS or localhost. |
210
234
  | `mermaid` | `boolean \| MermaidConfig` | `false` | `{ keepSource }`. Optional peer dep — lazy import or pass `renderDiagram`. |
211
235
  | `web` | `boolean` | `false` | Adds a "Web" toggle pill — flags a turn as web-grounded for downstream routing. |