@mieweb/ui 0.9.0-dev.5 → 0.9.0-dev.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/MIGRATION.md +112 -0
- package/dist/{chunk-QWJGEDHV.js → chunk-22CYDCXA.js} +13 -1183
- package/dist/chunk-22CYDCXA.js.map +1 -0
- package/dist/chunk-IIFQ6BSJ.js +1888 -0
- package/dist/chunk-IIFQ6BSJ.js.map +1 -0
- package/dist/{chunk-ZXRVVNT5.cjs → chunk-OFUKTVBN.cjs} +367 -798
- package/dist/chunk-OFUKTVBN.cjs.map +1 -0
- package/dist/chunk-OYQ7GYAA.cjs +1921 -0
- package/dist/chunk-OYQ7GYAA.cjs.map +1 -0
- package/dist/{chunk-PL6TFCYR.js → chunk-VSVGMMNO.js} +365 -793
- package/dist/chunk-VSVGMMNO.js.map +1 -0
- package/dist/{chunk-XJUIZA4G.cjs → chunk-WIAQQNFU.cjs} +12 -1184
- package/dist/chunk-WIAQQNFU.cjs.map +1 -0
- package/dist/components/SuperChat/index.cjs +11 -8
- package/dist/components/SuperChat/index.cjs.map +1 -1
- package/dist/components/SuperChat/index.js +5 -2
- package/dist/components/SuperChat/index.js.map +1 -1
- package/dist/components/SuperChat/plugins/index.cjs +10 -3
- package/dist/components/SuperChat/plugins/index.cjs.map +1 -1
- package/dist/components/SuperChat/plugins/index.js +9 -2
- package/dist/components/SuperChat/plugins/index.js.map +1 -1
- package/dist/index.cjs +91 -132
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -98
- package/dist/index.d.ts +38 -98
- package/dist/index.js +20 -48
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/dist/chunk-H3GRO43Z.cjs +0 -735
- package/dist/chunk-H3GRO43Z.cjs.map +0 -1
- package/dist/chunk-MD3ZY4UO.js +0 -705
- package/dist/chunk-MD3ZY4UO.js.map +0 -1
- package/dist/chunk-PL6TFCYR.js.map +0 -1
- package/dist/chunk-QWJGEDHV.js.map +0 -1
- package/dist/chunk-XJUIZA4G.cjs.map +0 -1
- package/dist/chunk-ZXRVVNT5.cjs.map +0 -1
package/MIGRATION.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Migration guide
|
|
2
|
+
|
|
3
|
+
Breaking-change recipes for `@mieweb/ui` consumers. Each section is anchored
|
|
4
|
+
so release notes and dev-console notices can deep-link to it.
|
|
5
|
+
|
|
6
|
+
## Chat composer
|
|
7
|
+
|
|
8
|
+
**`MessageComposer` was retired in 0.10.0.** The shared **`ChatComposer`** is
|
|
9
|
+
the single composer across the library — `SuperChat`, `AIChat`, and
|
|
10
|
+
`MessageThread` all mount it internally. If you only used those surfaces, no
|
|
11
|
+
code changes are required (their public props are unchanged); the notes below
|
|
12
|
+
about DOM/selector changes still apply to any CSS or tests that reached into
|
|
13
|
+
the composer.
|
|
14
|
+
|
|
15
|
+
### Removed exports
|
|
16
|
+
|
|
17
|
+
| Removed in 0.10.0 | Replacement |
|
|
18
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
19
|
+
| `MessageComposer` | `ChatComposer` |
|
|
20
|
+
| `MessageComposerProps` | `ChatComposerProps` |
|
|
21
|
+
| `CharacterCounter`, `CharacterCounterProps` | none — internal to the retired component (ChatComposer renders its own counter) |
|
|
22
|
+
| `SendButton`, `SendButtonProps`, `sendButtonVariants` | none — internal to the retired component |
|
|
23
|
+
|
|
24
|
+
Still exported and unchanged: `MentionOption`, `NewMessage`,
|
|
25
|
+
`AttachmentPicker`, `DragDropZone`, `CameraButton`, and the Messaging hooks.
|
|
26
|
+
|
|
27
|
+
### Prop mapping
|
|
28
|
+
|
|
29
|
+
Most props transfer 1:1 — `onSend(NewMessage)`, `value` / `onValueChange`,
|
|
30
|
+
`placeholder`, `disabled`, `isSending`, `autoFocus`, `maxLength`,
|
|
31
|
+
`showCharacterCount`, `acceptedFileTypes`, `maxFileSize`, `maxAttachments`,
|
|
32
|
+
`replyTo` / `onCancelReply`, `mentionOptions`, `className`.
|
|
33
|
+
|
|
34
|
+
| MessageComposer | ChatComposer |
|
|
35
|
+
| -------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
36
|
+
| `showAttachmentPicker` (default `true`) | `allowAttachments` (default `true`) |
|
|
37
|
+
| `showCameraButton` | none built in — pass `micSlot={<CameraButton onCapture={(f) => ref.current?.addFiles([f])} />}` (MessageThread's pattern; `addFiles` works even with `allowAttachments={false}`) |
|
|
38
|
+
| `onTypingStart` / `onTypingStop` | none built in — drive them from `useTypingEmulation({ value, onTypingStart, onTypingStop })` (exported from the Messaging module; same 2s-idle state machine) |
|
|
39
|
+
| `inputTrailing` slot | `micSlot` (rendered in the icon row; `micBehavior` controls visibility) |
|
|
40
|
+
| `variant="minimal"` | none — ChatComposer has a single card presentation |
|
|
41
|
+
| `onError(message: string)` | `onError(message, context?)` — `context.reason` is a stable machine key: `'file-type' \| 'file-size' \| 'attachment-limit' \| 'send-failed'` |
|
|
42
|
+
| `maxLength` default `1600` | no default cap — pass `maxLength={1600}` to keep the old limit |
|
|
43
|
+
|
|
44
|
+
### Failed-send restore semantics (behavior change)
|
|
45
|
+
|
|
46
|
+
`MessageComposer` restored the typed text itself when `onSend` threw or
|
|
47
|
+
rejected. **`ChatComposer` clears the draft optimistically and delegates
|
|
48
|
+
restore to the host**: a rejection is reported through
|
|
49
|
+
`onError(sendFailedLabel, { reason: 'send-failed' })` and the host restores
|
|
50
|
+
the draft via controlled `value` / `onValueChange`. See `MessageThread.tsx`
|
|
51
|
+
for the reference implementation (epoch-guarded so a stale failure never
|
|
52
|
+
overwrites newer typed input). In both old and new worlds, attachments are
|
|
53
|
+
**not** restaged after a failure.
|
|
54
|
+
|
|
55
|
+
### Attach flow: paperclip → `+` menu
|
|
56
|
+
|
|
57
|
+
The inline paperclip button is gone; attaching is behind the `+` menu.
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
// Before — one click on the paperclip:
|
|
61
|
+
page.getByRole('button', { name: 'Attach files' }).click();
|
|
62
|
+
|
|
63
|
+
// After — open the + menu, then pick the item:
|
|
64
|
+
page.getByRole('button', { name: 'Add to message' }).click(); // + button
|
|
65
|
+
page.getByRole('menuitem', { name: 'Attach files' }).click();
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Paste-to-attach still works, and drag-and-drop is now **built in**: the whole
|
|
69
|
+
composer card is a drop target (overlay text "Drop files here"). Hosts no
|
|
70
|
+
longer need their own `DragDropZone` around the composer — page-level drop
|
|
71
|
+
zones can forward files through `ChatComposerHandle.addFiles()`.
|
|
72
|
+
|
|
73
|
+
### DOM / selector anchors
|
|
74
|
+
|
|
75
|
+
`data-slot` renames (old rows without a counterpart were internal wrappers
|
|
76
|
+
with no replacement):
|
|
77
|
+
|
|
78
|
+
| MessageComposer slot | ChatComposer slot |
|
|
79
|
+
| --------------------------- | ------------------------------ |
|
|
80
|
+
| `message-composer` (root) | `chat-composer` (root) |
|
|
81
|
+
| `composer-input` | `chat-composer-input` |
|
|
82
|
+
| `composer-send-button` | `chat-composer-send-button` |
|
|
83
|
+
| `composer-attachments` | `chat-composer-attachments` |
|
|
84
|
+
| `composer-reply-preview` | `chat-composer-reply-preview` |
|
|
85
|
+
| `composer-char-count` | `chat-composer-char-count` |
|
|
86
|
+
| `composer-input-trailing` | `chat-composer-mic-slot` |
|
|
87
|
+
| `composer-input-area`, `composer-input-wrapper` | — (card layout: `chat-composer-card`) |
|
|
88
|
+
|
|
89
|
+
New slots without an old counterpart: `chat-composer-add-button`,
|
|
90
|
+
`chat-composer-cancel-reply`, `chat-composer-mic-button`,
|
|
91
|
+
`chat-composer-stop-button`, `chat-composer-readonly`,
|
|
92
|
+
`chat-composer-selectors`, `chat-composer-agent-trigger`.
|
|
93
|
+
|
|
94
|
+
The shared @mention listbox keeps its `composer-mention-list` default slot in
|
|
95
|
+
standalone use; ChatComposer renders it as `chat-composer-mention-list`.
|
|
96
|
+
|
|
97
|
+
Accessible-name changes (all overridable via label props):
|
|
98
|
+
|
|
99
|
+
| Element | Before | After (default) |
|
|
100
|
+
| -------------- | -------------------- | ---------------------------------------- |
|
|
101
|
+
| Textarea | `Message` | `Message input` (`inputLabel`) |
|
|
102
|
+
| Send button | `Send message` / `Sending message` | `Send message` / `Sending message…` (`sendLabel` / `sendingLabel`) |
|
|
103
|
+
| Attach control | `Attach files` (paperclip) | `Add to message` (+ menu) → `Attach files` (menu item) |
|
|
104
|
+
|
|
105
|
+
### `composerProps` on AIChat
|
|
106
|
+
|
|
107
|
+
`AIChat`'s `composerProps` is now `Partial<ChatComposerProps>` (it forwards to
|
|
108
|
+
the internal `ChatComposer`). Legacy `MessageComposerProps`-era keys —
|
|
109
|
+
`showAttachmentPicker`, `showCameraButton`, `onTypingStart` / `onTypingStop`,
|
|
110
|
+
`inputTrailing`, `onSend`, controlled `value` / `onValueChange` — are still
|
|
111
|
+
accepted and mapped for compatibility, but new code should use the
|
|
112
|
+
`ChatComposerProps` names directly.
|