@chatsystem/client 2.0.0 → 2.0.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/README.md +62 -0
- package/dist/index.cjs +185 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6687 -6398
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -103,6 +103,13 @@ the client itself; it must never be reimplemented in a host-specific adapter.
|
|
|
103
103
|
|
|
104
104
|
## Browser regression tests
|
|
105
105
|
|
|
106
|
+
Local-preview feedback is translated through `react-intl`: completing or closing
|
|
107
|
+
the form explicitly says that this was a demo and no answers were transmitted.
|
|
108
|
+
The generic renderer does not promise storage, support handling or Slack delivery.
|
|
109
|
+
The server-owned Tool presentation explains its own production journey (for
|
|
110
|
+
example, the support-request inbox and optional Slack channel). This copy remains
|
|
111
|
+
visible after completion without adding a Tool-name switch or browser protocol.
|
|
112
|
+
|
|
106
113
|
The package has a Playwright suite under `e2e/identity-gate`. It builds this
|
|
107
114
|
library, mounts it inside a fictional customer website, and drives a real
|
|
108
115
|
headless Chromium through identity delegation, redirect/resume, shared-runtime
|
|
@@ -159,6 +166,61 @@ programmatic browser API so the provider functions remain JavaScript values:
|
|
|
159
166
|
This passes the provider to the same internal `App` and identity session used
|
|
160
167
|
by the npm package. Do not place callbacks or secrets in `data-*` attributes.
|
|
161
168
|
|
|
169
|
+
## Custom CSS and layout
|
|
170
|
+
|
|
171
|
+
Put custom rules in the Agent's `CSSRules`, which are inserted after the default
|
|
172
|
+
widget styles inside its Shadow DOM. Host-page styles cannot select elements
|
|
173
|
+
inside that boundary. A custom `cssHref` can also provide the widget stylesheet.
|
|
174
|
+
|
|
175
|
+
| Selector | Layout contract |
|
|
176
|
+
| --- | --- |
|
|
177
|
+
| `.chatBox` | Chat surface; in launcher mode, the actual floating window |
|
|
178
|
+
| `.chatsystem-widget-window` | Launcher window only; owns viewport positioning |
|
|
179
|
+
| `.chatsystem-widget-surface` | Clips window contents and inherits its background and corners |
|
|
180
|
+
| `.launcher` | Floating launcher button |
|
|
181
|
+
| `.chatsystem-header` | Launcher header; contains the existing `.chatSystem-widgetLogo` and action group |
|
|
182
|
+
| `.chatsystem-header__actions` | Menu and close buttons in a shared flex row; customize spacing with `gap` |
|
|
183
|
+
| `.chatsystem-header__menu` | Discussion menu wrapper inside the header |
|
|
184
|
+
| `.chatsystem-close-button` | Header close button |
|
|
185
|
+
| `.chatbox-input-wrapper` | Existing conversation input area |
|
|
186
|
+
| `.chatsystem-composer` | Text input and actions in a shared flex row |
|
|
187
|
+
| `.chatsystem-composer__input` | Textarea; customize padding, border and maximum height |
|
|
188
|
+
| `.chatsystem-composer__actions` | Mic, Send or Stop action group; customize its `gap` and padding |
|
|
189
|
+
| `.chatsystem-mic-button`, `.chatsystem-paperplane-button`, `.chatsystem-stop-button` | Existing action button selectors |
|
|
190
|
+
| `.chatsystem-powered-by-inline`, `.chatsystem-powered-by-mobile`, `.chatsystem-powered-by-widget-badge` | Existing branding placement selectors; presentation defaults can be overridden |
|
|
191
|
+
| `.chatsystem-powered-by__link` | Branding link |
|
|
192
|
+
| `.chatsystem-scroll-to-bottom` | Recent-messages button, positioned relative to the messages' lower edge |
|
|
193
|
+
| `.chatsystem-interactive-widget` | Form panel inside the scrolling conversation |
|
|
194
|
+
|
|
195
|
+
For example, these Agent rules move the launcher and its window to the left:
|
|
196
|
+
|
|
197
|
+
```css
|
|
198
|
+
.chatsystem-widget-window, .launcher { left: 18px; right: auto; }
|
|
199
|
+
.chatsystem-interactive-widget { border-radius: 6px; }
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Legacy `.chatBox` positioning rules remain supported. Inline chat stays in normal
|
|
203
|
+
document flow. Interactive forms stay in the message flow and scroll with it;
|
|
204
|
+
they do not create a floating overlay. Defaults remain overridable in both the
|
|
205
|
+
constructable stylesheet and style-tag fallback paths.
|
|
206
|
+
|
|
207
|
+
Header actions share normal flex layout, so their hit targets remain separated
|
|
208
|
+
when the host document changes its root font size. The default action gap is
|
|
209
|
+
8px and can be overridden, for example `.chatsystem-header__actions { gap: 12px; }`.
|
|
210
|
+
The widget does not change the host page's root font size.
|
|
211
|
+
|
|
212
|
+
The composer also uses normal flow, so its buttons cannot cover the text area
|
|
213
|
+
when the host changes rem sizing. Long drafts scroll within a default maximum
|
|
214
|
+
height of `min(160px, 25dvh)`; customize `max-height` on
|
|
215
|
+
`.chatsystem-composer__input` when needed. Only its measured auto-grow height is
|
|
216
|
+
set dynamically; borders, padding and width remain CSS-overridable.
|
|
217
|
+
|
|
218
|
+
On desktop, the window height is bounded by the available viewport. Set
|
|
219
|
+
`--chatsystem-widget-bottom` on `.chatsystem-widget-window` to customize its
|
|
220
|
+
bottom offset together with that bound. Existing `.chatBox` positioning rules
|
|
221
|
+
still apply. A custom `cssHref` replaces the bundled base stylesheet: keep that
|
|
222
|
+
stylesheet compatible with the client version you deploy.
|
|
223
|
+
|
|
162
224
|
## Completed AI answers per discussion
|
|
163
225
|
|
|
164
226
|
The API controls the discussion allowance through
|