@8wave/ai-elements 0.121.0-beta.51 → 0.121.0-beta.52
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 +30 -0
- package/dist/ai-elements.es.js +1034 -835
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +7 -0
- package/dist-vue/apps/web-component/src/composables/usePageModal.d.ts +18 -0
- package/dist-vue/apps/web-component/src/lib.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -295,6 +295,7 @@ Same attributes as the floating widget except `floating-button-position`, plus:
|
|
|
295
295
|
| `display-mode` | `'widget' \| 'fullscreen' \| 'panel'` | `'widget'` | `widget`: a contained chat with its header. `fullscreen`: the full-page layout of the app. `panel`: compact chrome for a docked side panel, where your page owns background, border and open/close. |
|
|
296
296
|
| `forwarded-slots` | `string` | none | Comma-separated slot names forwarded to the inner chat (for example `"tool-showArtifact,subagent"`). |
|
|
297
297
|
| `theme` | `'light' \| 'dark'` | none | The color scheme, over the agent's own setting too, where `system-theme` only applies to an agent set to automatic. For a page that switches theme around a `panel`, which shows the page's background through it. Reactive. |
|
|
298
|
+
| `follow-page-dialogs` | `boolean` | `false` | While your page has a modal `<dialog>` open, the chat moves into it and stays usable. See [Your modal dialogs](#your-modal-dialogs). Reactive. |
|
|
298
299
|
|
|
299
300
|
## JavaScript API
|
|
300
301
|
|
|
@@ -1003,6 +1004,8 @@ At **Page control**, a card in the chat asks the user before:
|
|
|
1003
1004
|
A link to another page of your site does not ask: moving around your app is how the agent gets
|
|
1004
1005
|
anywhere.
|
|
1005
1006
|
|
|
1007
|
+
### Your modal dialogs
|
|
1008
|
+
|
|
1006
1009
|
When your page has a modal `<dialog>` open (`showModal()`), the rest of the page is inert,
|
|
1007
1010
|
the chat included. The card then opens in a modal dialog of the widget, above yours, right over
|
|
1008
1011
|
the card the chat shows, and closes once answered. While the agent acts with your dialog open,
|
|
@@ -1011,6 +1014,33 @@ own shadow root, and removed when the dialog closes or the action ends. It sits
|
|
|
1011
1014
|
when your dialog starts lower down, else just above or below your dialog, and over its top edge
|
|
1012
1015
|
only when there is no room outside.
|
|
1013
1016
|
|
|
1017
|
+
With `follow-page-dialogs` on `<embedded-chat-widget>`, the chat stays usable instead: once
|
|
1018
|
+
your dialog has come in (its entrance transitions ended), the element moves into it, fixed where
|
|
1019
|
+
it was on screen, and a placeholder
|
|
1020
|
+
`<div data-agent-studio-placeholder>` with the element's classes and inline style keeps its place
|
|
1021
|
+
in your layout. The user reads and writes in the chat, answers the card there, and stops the
|
|
1022
|
+
agent from the bar. The element goes back when the dialog closes, fades out (an opacity animation
|
|
1023
|
+
or transition to 0) or leaves the page, and when its place goes out of sight. A dialog that
|
|
1024
|
+
covers the window, drawing its own backdrop, takes the element in its largest child that does
|
|
1025
|
+
not cover it too, taken for its panel: a page that closes the dialog on a click outside the
|
|
1026
|
+
panel then sees a click in the chat as inside it. The guess can miss: a panel that is not the
|
|
1027
|
+
largest child, or a dialog that closes on clicks elsewhere. Any other dialog takes the element
|
|
1028
|
+
as its last child. What to know:
|
|
1029
|
+
|
|
1030
|
+
- The element is moved with `moveBefore`, which keeps its state. In a browser without it the
|
|
1031
|
+
chat stays where it is, with the card and the Stop described above.
|
|
1032
|
+
- The chat leaves the dialog where it would not take clicks: a dialog that scales, clips or
|
|
1033
|
+
hides it, or puts something over it, checked when it goes in and on every change seen while
|
|
1034
|
+
it stays. The card and the Stop then work as above.
|
|
1035
|
+
- Esc in the chat does not close your dialog.
|
|
1036
|
+
- Do not insert elements before the widget element in its parent while a dialog is open: it is
|
|
1037
|
+
not there, and the insert fails. Removing the element, or the part of the page that holds
|
|
1038
|
+
it, works as usual: it is not put back. Moving it elsewhere keeps it there, out of that
|
|
1039
|
+
dialog until it closes.
|
|
1040
|
+
- Key and pointer events from the chat reach your dialog and its panel, retargeted to the
|
|
1041
|
+
element, as they reach the element's parents anywhere else.
|
|
1042
|
+
- Dialogs in your page's shadow roots are found within a second; the document's at once.
|
|
1043
|
+
|
|
1014
1044
|
### How actions are performed
|
|
1015
1045
|
|
|
1016
1046
|
- A write sets the value through the element's native setter, then dispatches `input` and
|