@nevuto/novi 0.0.0-stage → 0.3.48
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/COMPONENTS.md +579 -0
- package/LICENSE +21 -0
- package/NOTICE +32 -0
- package/README.md +181 -2
- package/dist/AiAssistant/AiAssistantActionCard.d.ts +39 -0
- package/dist/AiAssistant/AiAssistantActionCard.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantAnswer.d.ts +54 -0
- package/dist/AiAssistant/AiAssistantAnswer.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantBottom.d.ts +22 -0
- package/dist/AiAssistant/AiAssistantBottom.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantHeader.d.ts +34 -0
- package/dist/AiAssistant/AiAssistantHeader.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantImageGroup.d.ts +21 -0
- package/dist/AiAssistant/AiAssistantImageGroup.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantInput.d.ts +70 -0
- package/dist/AiAssistant/AiAssistantInput.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantLauncher.d.ts +41 -0
- package/dist/AiAssistant/AiAssistantLauncher.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantLink.d.ts +27 -0
- package/dist/AiAssistant/AiAssistantLink.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantMenu.d.ts +13 -0
- package/dist/AiAssistant/AiAssistantMenu.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantModal.d.ts +39 -0
- package/dist/AiAssistant/AiAssistantModal.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantQuestion.d.ts +34 -0
- package/dist/AiAssistant/AiAssistantQuestion.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantQuestionCard.d.ts +46 -0
- package/dist/AiAssistant/AiAssistantQuestionCard.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantReasoning.d.ts +34 -0
- package/dist/AiAssistant/AiAssistantReasoning.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantRecommendation.d.ts +26 -0
- package/dist/AiAssistant/AiAssistantRecommendation.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantReference.d.ts +42 -0
- package/dist/AiAssistant/AiAssistantReference.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantReferencePanel.d.ts +28 -0
- package/dist/AiAssistant/AiAssistantReferencePanel.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantSecretField.d.ts +21 -0
- package/dist/AiAssistant/AiAssistantSecretField.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantSuggestions.d.ts +21 -0
- package/dist/AiAssistant/AiAssistantSuggestions.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantTask.d.ts +21 -0
- package/dist/AiAssistant/AiAssistantTask.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantThinking.d.ts +22 -0
- package/dist/AiAssistant/AiAssistantThinking.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantTitle.d.ts +13 -0
- package/dist/AiAssistant/AiAssistantTitle.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantToolCall.d.ts +30 -0
- package/dist/AiAssistant/AiAssistantToolCall.d.ts.map +1 -0
- package/dist/AiAssistant/AiAssistantToolCallGroup.d.ts +22 -0
- package/dist/AiAssistant/AiAssistantToolCallGroup.d.ts.map +1 -0
- package/dist/AiAssistant/index.d.ts +46 -0
- package/dist/AiAssistant/index.d.ts.map +1 -0
- package/dist/AiAssistant/useControlled.d.ts +14 -0
- package/dist/AiAssistant/useControlled.d.ts.map +1 -0
- package/dist/AiAssistant/usePaper.d.ts +9 -0
- package/dist/AiAssistant/usePaper.d.ts.map +1 -0
- package/dist/Novi/Novi.d.ts +55 -0
- package/dist/Novi/Novi.d.ts.map +1 -0
- package/dist/Novi/useResolvedColor.d.ts +3 -0
- package/dist/Novi/useResolvedColor.d.ts.map +1 -0
- package/dist/NoviTile/NoviTile.d.ts +22 -0
- package/dist/NoviTile/NoviTile.d.ts.map +1 -0
- package/dist/engine/decor.d.ts +115 -0
- package/dist/engine/decor.d.ts.map +1 -0
- package/dist/engine/engine.d.ts +210 -0
- package/dist/engine/engine.d.ts.map +1 -0
- package/dist/engine/expressions.d.ts +26 -0
- package/dist/engine/expressions.d.ts.map +1 -0
- package/dist/engine/eyefit.d.ts +35 -0
- package/dist/engine/eyefit.d.ts.map +1 -0
- package/dist/engine/face.d.ts +63 -0
- package/dist/engine/face.d.ts.map +1 -0
- package/dist/engine/frame.d.ts +26 -0
- package/dist/engine/frame.d.ts.map +1 -0
- package/dist/engine/gaze.d.ts +108 -0
- package/dist/engine/gaze.d.ts.map +1 -0
- package/dist/engine/math.d.ts +21 -0
- package/dist/engine/math.d.ts.map +1 -0
- package/dist/engine/profiles.d.ts +8 -0
- package/dist/engine/profiles.d.ts.map +1 -0
- package/dist/engine/shape.d.ts +79 -0
- package/dist/engine/shape.d.ts.map +1 -0
- package/dist/engine/skins.d.ts +44 -0
- package/dist/engine/skins.d.ts.map +1 -0
- package/dist/engine/states.d.ts +85 -0
- package/dist/engine/states.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +2940 -0
- package/package.json +48 -3
package/README.md
CHANGED
|
@@ -1,3 +1,182 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @nevuto/novi
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Novi, Nevuto'nun maskotu. Tek bir dolu şekil, durumlar arasında morph ederek
|
|
4
|
+
hareket eder; gözler o şeklin içine açılmış **gerçek deliklerdir**, üstüne konmuş
|
|
5
|
+
beyaz şekiller değil — kenara kaydıklarında kendiliğinden kırpılmalarının sebebi bu.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Novi } from '@nevuto/novi'
|
|
9
|
+
|
|
10
|
+
<Novi size={320} shape="circle" expression="neutral" color="ink" paper="#f7f7f8" follow />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Parçaların tam listesi, prop tabloları ve uçtan uca örnek için:
|
|
14
|
+
[COMPONENTS.md](./COMPONENTS.md) — proje tarafına verilecek katalog.
|
|
15
|
+
|
|
16
|
+
## Ne içerir
|
|
17
|
+
|
|
18
|
+
| | |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `<Novi />` | Tamamen prop ile kontrol edilen avatar. Neye benzemesi gerektiği hakkında bir fikri yoktur. |
|
|
21
|
+
| `<NoviTile />` | Donmuş küçük önizleme — seçici ızgaraları için. Animasyon döngüsü açmaz. |
|
|
22
|
+
| `AiAssistant*` | AI asistan modalının parçaları: `Header`, `Title`, `Link`, `Question`, `Answer`, `Recommendation`, `Suggestions`, `Reasoning`, `QuestionCard`, `ActionCard`, `SecretField`, `ToolCall`, `ToolCallGroup`, `Task`, `Thinking`, `Input`, `Reference`, `ReferencePanel`, `ImageGroup`, `Bottom`. Her biri tek başına durur. |
|
|
23
|
+
| `<AiAssistantModal />` | Parçaları dizen kabuk: başlık + kayan thread + composer + alt şerit. Dialog değil, panel. |
|
|
24
|
+
| `SHAPES`, `EXPRESSIONS`, `COLORS`, `STATES` | Katalog verisi. Etiket taşımaz: onlar tüketicinin çeviri katmanına ait. |
|
|
25
|
+
| `NoviEngine` | Motorun kendisi. React ağacı dışında sürmek için. |
|
|
26
|
+
| `lookTarget`, `spinLook` | Bakış kuralları — DOM'suz, saf. |
|
|
27
|
+
|
|
28
|
+
8 gövde şekli, 16 ifade, 12 renk, 14 animasyon durumu.
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { AiAssistantHeader, AiAssistantAnswer, AiAssistantThinking } from '@nevuto/novi'
|
|
32
|
+
import '@nevuto/novi/styles.css' // AiAssistant parçaları CSS taşır; <Novi /> taşımaz
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Sınır
|
|
36
|
+
|
|
37
|
+
Bu paket **Novi'nin nasıl göründüğünü ve nasıl kıpırdadığını** bilir. **Hangi
|
|
38
|
+
Novi'nin gösterileceğini bilmez**: şekil, ifade ve renk dışarıdan prop olarak gelir.
|
|
39
|
+
Kalıcılık, yetki, i18n ve sayfa düzeni tüketicinin işidir.
|
|
40
|
+
|
|
41
|
+
`AiAssistant*` parçaları da aynı sınırı taşır: her biri tek başına durur, birbirini
|
|
42
|
+
tanımaz, sohbet durumunu tutmaz. Onları dizen modal, kaydıran kap ve besleyen
|
|
43
|
+
composer tüketicinin — bu paket yalnızca parçaların nasıl göründüğünü bilir. Metinler
|
|
44
|
+
(başlık, ipucu, kısayol adı, "Thinking…") prop'tur: çeviri katmanı tüketicidedir.
|
|
45
|
+
|
|
46
|
+
## Değiştirmeden önce bilinmesi gerekenler
|
|
47
|
+
|
|
48
|
+
- **`src/engine/` içindeki sayılar ölçümdür, ayar değil.** Referans görüntüden kare
|
|
49
|
+
kare çıkarılmışlardır. Yuvarlamak veya "daha derli toplu" değerlerle değiştirmek
|
|
50
|
+
benzerliği bozar — ki bu kodun tek başarı ölçütü odur.
|
|
51
|
+
- **`src/engine/` çerçevesizdir ve saatsizdir.** `engine.sample(t)` zamanın saf
|
|
52
|
+
fonksiyonudur: `Date.now()` yok, React importu yok, gerçek zamanlı durum yok. Bu
|
|
53
|
+
sayede `frozenAt`, donmuş önizlemeler ve DOM'suz testler mümkün. `sample()`
|
|
54
|
+
**mutasyon yapmamalıdır** — oynatma sırasında bayat önceki durumu temizlemek motoru
|
|
55
|
+
yeniden oynatılamaz hale getirir.
|
|
56
|
+
- **Tüm siluetler aynı açısal örneklemeyi paylaşır** (`PROFILE_SAMPLES`). Morphing'in
|
|
57
|
+
yarıçapların doğrusal interpolasyonuna indirgenmesinin sebebi budur. Yeni bir şekil
|
|
58
|
+
ya bir radyal profilden ya da `profileFromPolygon`'dan geçmek zorundadır.
|
|
59
|
+
- **`eyefit.ts` bir tablodur, render döngüsünde bir çözücü değil** — ve fark tam da
|
|
60
|
+
düzeltmenin kendisidir. Kare başına çözen yedi sürüm yazıldı, hepsi titredi. Motor
|
|
61
|
+
tabloyu her morph'un **sınırlarında** okur, o morph'un kendi eğrisiyle interpole
|
|
62
|
+
eder; asla kimliği olmayan ve hiçbir tabloda bulunmayan ara değer üzerinde okumaz.
|
|
63
|
+
- **Geçişler üstel ease-out'tur ve gövde asla aşmaz.** Tek yay bildirim
|
|
64
|
+
baloncuğunun pop'udur (`NOTIF_POP`). Kasıtlı olarak bir yay motoru yoktur.
|
|
65
|
+
- **İki ayrı şekil kaynağı vardır, karıştırılmaz.** `profiles.ts` referanstan
|
|
66
|
+
üretilmiştir ve animasyonlu durumları sürer; `skins.ts` özelleştiricinin
|
|
67
|
+
şekillerini tutar ve analitik olarak kurulmuştur. Kullanıcının şekli gövdeyi
|
|
68
|
+
yalnızca `baseBody` durumlarında değiştirir; başka yerlerde siluetin kendisi
|
|
69
|
+
animasyonun ta kendisidir.
|
|
70
|
+
- **`AiAssistantThinking` gerçek `<Novi />` çizer, spinner değil.** `paper` prop'u
|
|
71
|
+
verilmezse `usePaper` sayfanın `--backgrounds-bg-base` token'ını okur ve tema
|
|
72
|
+
değişince yeniden okur — gözler delik olduğu için sabit beyaz, koyu temada iki
|
|
73
|
+
parlak yarık bırakır.
|
|
74
|
+
- **Görünen her metin prop'tur.** Paket içinde JSX'e gömülü tek bir dize yoktur;
|
|
75
|
+
`'Thinking…'`, `'Previous'`, `'Stop'` gibi değerlerin hepsi varsayılandır ve
|
|
76
|
+
uygulamanın çeviri katmanından ezilir. Varsayılanların İngilizce olması
|
|
77
|
+
`@nevuto/components` ile aynı tercihtir (`Spinner` → `'Loading…'`).
|
|
78
|
+
- **Composer'ın sağı da bir slottur.** `leading` sol sıra, `trailing` gönder
|
|
79
|
+
düğmesinin *yanı*, `submit` ise gönder düğmesinin *yerine* geçer — böylece artı
|
|
80
|
+
düğmesi eklemek için gönder düğmesini feda etmek gerekmez. `onStop` verildiğinde
|
|
81
|
+
aynı düğme, cevap akarken durdurma düğmesine döner: dönen ama iptal edilemeyen bir
|
|
82
|
+
düğme yalan söyler. Durdurma nötr gri renktedir ve içinde dolu bir kare vardır.
|
|
83
|
+
- **`AiAssistantAnswer` yarım kalmış cevabı silmez.** `error` metni gelen metnin
|
|
84
|
+
*altında* durur, `onRetry` yeniden sormanın yolunu çizer; yarım bir cevap da
|
|
85
|
+
okunmaya değerdir ve okuyucunun nerede durduğunu görmesi gerekir.
|
|
86
|
+
- **Prop isimlendirmesi rastgele değildir.** `icon` bir şeyin *kimlik işaretidir*
|
|
87
|
+
(Reference, ToolCall, QuestionCard, ActionCard, ReferencePanel). `leftIcon` /
|
|
88
|
+
`rightIcon` düğme biçimli bir satırın süsüdür ve kütüphanenin geri kalanıyla
|
|
89
|
+
(Button, Input) aynı adı taşır — bu yüzden `AiAssistantLink`'tedir. `trailing`
|
|
90
|
+
ise ikon olmak zorunda olmayan bir uç slotudur (rozet, fiyat, chevron).
|
|
91
|
+
- **`children` her zaman bileşenin *içeriğidir*, yan slot değildir.** İçerik
|
|
92
|
+
taşımayan bileşenler (`Header`, `Thinking`, `ImageGroup`, `Bottom`,
|
|
93
|
+
`Recommendation`) `children`'ı tip düzeyinde reddeder; `Bottom`'ın sol slotunun
|
|
94
|
+
adı bu yüzden `leading`'dir.
|
|
95
|
+
- **Controlled/uncontrolled tek yerde çözülür** (`useControlled`): `Answer`'ın oyu,
|
|
96
|
+
`Reasoning` / `ReferencePanel` / `ToolCallGroup`'un katlaması ve `Input`'un metni
|
|
97
|
+
aynı kuralı paylaşır — `undefined` olmayan prop kazanır, mod ilk render'da
|
|
98
|
+
sabitlenir.
|
|
99
|
+
- **`AiAssistantAnswer.sources`, `AiAssistantReference` değildir.** İlki cevabın
|
|
100
|
+
*nereden geldiği*, ikincisi sorunun *neye işaret ettiğidir*; ikisine de "reference"
|
|
101
|
+
demek bakımı zorlaştırdığı için ayrıldı.
|
|
102
|
+
- **Parçalar iskelettir.** Ne render edecekleri tüketiciden gelir: her slot düz bir
|
|
103
|
+
`ReactNode`'dur (`Header.actions`, `Input.actions`, `Input.trailing`,
|
|
104
|
+
`Bottom.children`, `Title.action`, `Answer.actions`). Paket sabit bir düğme seti
|
|
105
|
+
dayatmaz; uygulama ekler, çıkarır, sırasını değiştirir.
|
|
106
|
+
- **Yatay padding'i thread parçaları taşımaz.** `Title`, `Question`, `Answer`,
|
|
107
|
+
`Thinking` yalnızca içeriktir; modalın içeriden boşluğu, onları saran scroll
|
|
108
|
+
kabına aittir. `Header`, `Input` ve `Bottom` istisnadır — onlar bar'dır, zemini
|
|
109
|
+
modalın kenarına dayanır, padding'i kendilerinindir.
|
|
110
|
+
- **`AiAssistantModal` bir panel, dialog değil.** Overlay, portal, focus trap içermez;
|
|
111
|
+
onu uygulamanın kendi `Modal`'ının, drawer'ının ya da sayfa köşesinin içine koymak
|
|
112
|
+
tüketicinin kararıdır. Modal yalnızca yüzeyi, scroll'u ve iç boşluğu ekler.
|
|
113
|
+
- **`AiAssistantToolCall` araçları tanımaz.** Paket ne bir araç kataloğu, ne
|
|
114
|
+
id→ikon eşlemesi, ne de zaman kipi tablosu taşır: işaret, metin ve çip
|
|
115
|
+
uygulamadan gelir ("Reading"/"Read" aynı satırın iki kipidir ve kip çeviri
|
|
116
|
+
meselesidir). Pakete ait olan yalnızca mekanik olan: hata durumu satırı
|
|
117
|
+
kızartıp işareti değiştirir, biten görev üstü çizilir. Backend'e yeni bir araç
|
|
118
|
+
eklemek burada sürüm gerektirmez.
|
|
119
|
+
- **Gövde metni her yerde `paragraph/txt-small`'dur** (13/20). Bir zamanlar 14px
|
|
120
|
+
olan her yer buraya çekildi; kalan tek istisna başlıktır (`headers/docs/h3`,
|
|
121
|
+
16/160%) ve mono çiplerdir (12px).
|
|
122
|
+
- **`AiAssistantActionCard` soru kartıyla aynı kabuğu paylaşır** (`card.module.css`):
|
|
123
|
+
bir eylem de sorudur, cevabı bir değer değil bir karardır. Bu kartlardaki tek dolu
|
|
124
|
+
düğme onun onay düğmesidir — soru kartının düğmeleri bir dizide gezinir ve eşit
|
|
125
|
+
ağırlıktadır, bu ise bir şeye söz verir. Karar verilmiş kart için durum prop'u
|
|
126
|
+
yoktur: handler'ları kaldır, düğmeler de gider; ne olduğunu başlıktaki `status`
|
|
127
|
+
söyler.
|
|
128
|
+
- **`AiAssistantQuestionCard` bir sırrı da sorar.** Sır, cevabı maskelenmiş bir
|
|
129
|
+
sorudur: kart aynı karttır, değişen gövdedir — tanınan bir entegrasyon kendi marka
|
|
130
|
+
işaretini ve linklerini getirir, adı yeni duyulmuş olan her değer için bir alan.
|
|
131
|
+
Çıkış düğmesi (`onSkip`) kart bir dizinin parçasıysa satırın öbür ucuna geçer:
|
|
132
|
+
ayrılmak ile devam etmek zıt niyetlerdir.
|
|
133
|
+
- **`AiAssistantQuestionCard`'da `step` prop'u yoktur.** İlk, orta ve son soru
|
|
134
|
+
arasındaki tek fark hangi düğmelerin var olduğudur: kartın bulunduğu yere uyan
|
|
135
|
+
handler'ları ver, satır kendini kurar. `progress` de iki sayı değil bir node'dur —
|
|
136
|
+
"1 of 3" bir cümledir ve cümleler çeviri katmanına aittir. `AiAssistantQuestion`
|
|
137
|
+
ile karıştırma: o kullanıcının sorusu (baloncuk), bu asistanın geri sorduğu karttır.
|
|
138
|
+
- **`AiAssistantToolCallGroup`'un özeti uygulamanın cümlesidir.** "4 edits made"i
|
|
139
|
+
paket sayamaz: neyin gruplandığını ve hangi dilde söylendiğini bilen odur. Katlı
|
|
140
|
+
hâlde bile içerideki hatalı çağrı kırmızıdır — açmanın sebebi zaten odur.
|
|
141
|
+
- **`AiAssistantReference` iki biçimdedir**: `chip` composer'daki çerçeveli hap —
|
|
142
|
+
hâlâ kurulan bir şey; `plain` ise gönderildikten sonraki dolu hap — kaldırılacak
|
|
143
|
+
bir şey kalmamıştır. İkisi de aynı bileşendir: bir turun işaret edebildiği her
|
|
144
|
+
şey (eleman, dosya, commit, entegrasyon, hata, resim) tek satırda aynı hapı giyer.
|
|
145
|
+
- **`AiAssistantReferencePanel` kapalıyken diğer referanslardan ayırt edilemez.**
|
|
146
|
+
Mesele budur: bir konsol dökümü ile bir hedef eleman, okuyucu birini açmak
|
|
147
|
+
isteyene kadar thread'de tek satırdır. Gövdeye ne konacağı uygulamanındır; panel
|
|
148
|
+
yalnızca zemini, başlığı ve katlamayı verir.
|
|
149
|
+
- **`AiAssistantReasoning` akarken kırpılır, kaydırılmaz.** `working` iken metin
|
|
150
|
+
`peekHeight` kadarlık bir pencerede son satırına sabitlenir: akış sırasında
|
|
151
|
+
okunmaya değen tek cümle en yenisidir ve blok tam boyuna büyürse cevap daha
|
|
152
|
+
doğmadan ekrandan taşar. Geriye dönmek katlamayı açmakla olur.
|
|
153
|
+
- **`AiAssistantQuestion`'ın görselleri baloncuğun içinde değil üstündedir**, kendi
|
|
154
|
+
grubunda ama aynı zeminde: tek satırlık bir soru, görsel eklenince de tek satır
|
|
155
|
+
olarak okunmaya devam etsin diye. `onImageClick` her görseli düğmeye çevirip
|
|
156
|
+
indeksini bildirir; lightbox isteyen uygulamanın kendi lightbox'ıdır.
|
|
157
|
+
- **`AiAssistantReference` tek bir çiptir**: mention, target, resim ve dosya eki —
|
|
158
|
+
hepsi aynı çip. Üzerine gelince ikon aynı kareyi paylaşan bir ✕'e döner; ayrı bir
|
|
159
|
+
kaldır düğmesi eklenmez, çünkü kısalan etiketin ihtiyacı olan yeri o alır.
|
|
160
|
+
`onRemove` verilmezse çip cansız metindir.
|
|
161
|
+
- **Sürükle-bırak yalnızca `onFilesDrop` verilince dinlenir** — ve bu önemlidir:
|
|
162
|
+
sayfanın ele almadığı bir drop, tarayıcıyı bırakılan dosyaya götürür. Aynı handler
|
|
163
|
+
panodan yapıştırmayı da karşılar. Dosya tipi süzülmez: `File[]` olduğu gibi
|
|
164
|
+
uygulamaya geçer; neyin eklenebilir olduğu, nasıl yükleneceği ve hangi çipe
|
|
165
|
+
dönüşeceği onun kararıdır, sonuç `references` slotundan geri gelir.
|
|
166
|
+
- **`AiAssistantInput` kendi scroll'unu yazmaz**: metin `maxHeight`'e kadar büyür,
|
|
167
|
+
taşmayı `@nevuto/components`'in `Scrollable`'ı (`size="thin"`) devralır.
|
|
168
|
+
- **Bir kontrol, ancak handler'ı verildiğinde render edilir.** `onClose` yoksa kapatma
|
|
169
|
+
düğmesi de yoktur; `onFeedbackChange` yoksa başparmaklar da. Hiçbir parça ölü
|
|
170
|
+
kontrol çizmez.
|
|
171
|
+
- **`Recommendation`'ın gradyanı `--gradient-ai-*` token'larından gelir**
|
|
172
|
+
(`@nevuto/tokens`), component içinde sabit değildir; iki tema de taşır.
|
|
173
|
+
- **Katalog durumları arasında yalnızca `idle` `baseFace: true` taşır.** Diğer yüzlü
|
|
174
|
+
durumların ifadesi ölçülmüştür — mesele de zaten budur.
|
|
175
|
+
|
|
176
|
+
## Köken ve lisans
|
|
177
|
+
|
|
178
|
+
Motor, Jérémy Perret'in MIT lisanslı [bloub](https://github.com/jeremy-prt/bloub)
|
|
179
|
+
projesinden uyarlanmıştır. Geometri, ölçülmüş sabitler ve morph mantığı oradan gelir;
|
|
180
|
+
React bileşeni, katalog kimlikleri ve paket API'si Nevuto'ya aittir.
|
|
181
|
+
|
|
182
|
+
Telif hakkı bildirimi için [NOTICE](./NOTICE) dosyasına bakın.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface AiAssistantActionCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
3
|
+
/** What the assistant is about to do, or is offering to do. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Why, or what it will touch. Sits above whatever `children` adds. */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
/** The detail: a command, a diff, a list of files. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** `null` drops the mark. */
|
|
10
|
+
icon?: ReactNode | null;
|
|
11
|
+
/**
|
|
12
|
+
* The right of the header: a `Badge`, a count, a timestamp. Once a decision has
|
|
13
|
+
* been made, this is where it goes — and dropping the handlers takes the buttons
|
|
14
|
+
* away, so a settled card needs no state prop to look settled.
|
|
15
|
+
*/
|
|
16
|
+
status?: ReactNode;
|
|
17
|
+
/** Renders the go-ahead. */
|
|
18
|
+
onConfirm?: () => void;
|
|
19
|
+
/** Renders the way out. */
|
|
20
|
+
onCancel?: () => void;
|
|
21
|
+
/** Replaces the whole button row. */
|
|
22
|
+
footer?: ReactNode;
|
|
23
|
+
confirmLabel?: string;
|
|
24
|
+
cancelLabel?: string;
|
|
25
|
+
/** Blocks the go-ahead — nothing to run yet, or no permission to run it. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Spins the go-ahead while the action is in flight. */
|
|
28
|
+
running?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An action the assistant proposes, in the same frame as a question — because it
|
|
32
|
+
* is one: the answer is a decision rather than a value.
|
|
33
|
+
*
|
|
34
|
+
* The go-ahead is the only filled button anywhere in these cards. A question's
|
|
35
|
+
* buttons move through a run and weigh the same; this one commits to something, and
|
|
36
|
+
* the difference is worth a shade.
|
|
37
|
+
*/
|
|
38
|
+
export declare function AiAssistantActionCard({ title, description, children, icon, status, onConfirm, onCancel, footer, confirmLabel, cancelLabel, disabled, running, className, ...props }: AiAssistantActionCardProps): import("react").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=AiAssistantActionCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantActionCard.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantActionCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC/F,+DAA+D;IAC/D,KAAK,EAAE,SAAS,CAAA;IAChB,uEAAuE;IACvE,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,qCAAqC;IACrC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wDAAwD;IACxD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,EACR,MAAM,EACN,YAAoB,EACpB,WAAsB,EACtB,QAAgB,EAChB,OAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,0BAA0B,+BAgD5B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type AiAssistantFeedback = 'like' | 'dislike';
|
|
3
|
+
/**
|
|
4
|
+
* Not to be confused with `AiAssistantReference`: that is what the *question* was
|
|
5
|
+
* pointed at, a chip the person put there. This is where the answer came *from*.
|
|
6
|
+
*/
|
|
7
|
+
export interface AiAssistantSource {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
/** Renders the chip as a link. Without it the chip is a button, or plain text if it has no handler either. */
|
|
11
|
+
href?: string;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export interface AiAssistantAnswerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onCopy'> {
|
|
15
|
+
/** The answer. Optional, because an answer that failed before writing anything is still a turn. */
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
/** What the copy button writes to the clipboard when `children` is not plain text. */
|
|
18
|
+
textValue?: string;
|
|
19
|
+
/** The sources the answer was drawn from, rendered as chips beneath it. */
|
|
20
|
+
sources?: AiAssistantSource[];
|
|
21
|
+
/**
|
|
22
|
+
* Renders the copy button. It writes to the clipboard itself and then calls this
|
|
23
|
+
* with the copied text — the handler is for logging, not for doing the copy.
|
|
24
|
+
*/
|
|
25
|
+
onCopy?: (text: string) => void;
|
|
26
|
+
/** Renders the two feedback buttons. Called with `null` when the person un-votes. */
|
|
27
|
+
onFeedbackChange?: (value: AiAssistantFeedback | null) => void;
|
|
28
|
+
/** Controlled vote. Leave it out and the component remembers the vote itself. */
|
|
29
|
+
feedback?: AiAssistantFeedback | null;
|
|
30
|
+
defaultFeedback?: AiAssistantFeedback | null;
|
|
31
|
+
/**
|
|
32
|
+
* What went wrong. Shown under whatever text did arrive — a half-written answer
|
|
33
|
+
* is worth keeping on screen, and the reader needs to see where it stopped.
|
|
34
|
+
*/
|
|
35
|
+
error?: ReactNode;
|
|
36
|
+
/** Renders the way to ask again. */
|
|
37
|
+
onRetry?: () => void;
|
|
38
|
+
retryLabel?: string;
|
|
39
|
+
/** Extra controls, placed after the built-in ones. */
|
|
40
|
+
actions?: ReactNode;
|
|
41
|
+
/** Keeps the action row visible instead of revealing it on hover. */
|
|
42
|
+
actionsVisible?: boolean;
|
|
43
|
+
copyLabel?: string;
|
|
44
|
+
copiedLabel?: string;
|
|
45
|
+
likeLabel?: string;
|
|
46
|
+
dislikeLabel?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The assistant's answer: plain text on the page rather than a bubble, its sources
|
|
50
|
+
* beneath it, and the actions that only matter once the answer has been read —
|
|
51
|
+
* which is why they stay hidden until the answer is hovered or focused.
|
|
52
|
+
*/
|
|
53
|
+
export declare function AiAssistantAnswer({ children, textValue, sources, error, onRetry, retryLabel, onCopy, onFeedbackChange, feedback, defaultFeedback, actions, actionsVisible, copyLabel, copiedLabel, likeLabel, dislikeLabel, className, ...props }: AiAssistantAnswerProps): import("react").JSX.Element;
|
|
54
|
+
//# sourceMappingURL=AiAssistantAnswer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantAnswer.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAMxF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAAA;AAEpD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,8GAA8G;IAC9G,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC5F,mGAAmG;IACnG,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9D,iFAAiF;IACjF,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACrC,eAAe,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAC5C;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sDAAsD;IACtD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,qEAAqE;IACrE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAKD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,SAAS,EACT,OAAY,EACZ,KAAK,EACL,OAAO,EACP,UAAwB,EACxB,MAAM,EACN,gBAAgB,EAChB,QAAQ,EACR,eAAsB,EACtB,OAAO,EACP,cAAsB,EACtB,SAAkB,EAClB,WAAsB,EACtB,SAAyB,EACzB,YAA2B,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,+BAwHxB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface AiAssistantBottomProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
|
+
/** What happens to the conversation — e.g. "Chat is cleared on exit". */
|
|
4
|
+
hint?: ReactNode;
|
|
5
|
+
/** The shortcut's name. Omit both this and `shortcutKeys` to drop the shortcut. */
|
|
6
|
+
shortcutLabel?: ReactNode;
|
|
7
|
+
/** One node per key. Strings and icons both render inside a `Kbd`. */
|
|
8
|
+
shortcutKeys?: ReactNode[];
|
|
9
|
+
/**
|
|
10
|
+
* Left slot: a model picker, a disclaimer, whatever the app puts under its
|
|
11
|
+
* composer. Not `children`: the hints are this strip's content, and a slot that
|
|
12
|
+
* pretends to be the content is the kind of API you have to look up twice.
|
|
13
|
+
*/
|
|
14
|
+
leading?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The strip under the composer. It states the two things a first-time user cannot
|
|
18
|
+
* guess: what happens to the chat when the modal closes, and how to type a newline
|
|
19
|
+
* in a field where Enter sends.
|
|
20
|
+
*/
|
|
21
|
+
export declare function AiAssistantBottom({ hint, shortcutLabel, shortcutKeys, leading, className, ...props }: AiAssistantBottomProps): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=AiAssistantBottom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantBottom.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantBottom.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9F,yEAAyE;IACzE,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,mFAAmF;IACnF,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,sEAAsE;IACtE,YAAY,CAAC,EAAE,SAAS,EAAE,CAAA;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB;AAQD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,aAAa,EACb,YAA8B,EAC9B,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,+BAyBxB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface AiAssistantHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'children'> {
|
|
3
|
+
/** The assistant's name, or whatever the modal is currently about. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* The element the title is rendered as. A modal opened over a page is an `h2`;
|
|
7
|
+
* one embedded in a panel that already has a heading may need `p` instead, and
|
|
8
|
+
* only the page around it knows which.
|
|
9
|
+
*/
|
|
10
|
+
titleAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'p';
|
|
11
|
+
/** Optional icon or avatar node rendered before the title. */
|
|
12
|
+
avatar?: ReactNode;
|
|
13
|
+
/** Renders the expand control. Omit it and no expand button appears at all. */
|
|
14
|
+
onExpandToggle?: () => void;
|
|
15
|
+
/** Flips the expand control to its collapse form. */
|
|
16
|
+
expanded?: boolean;
|
|
17
|
+
/** Renders the close control. Omit it and no close button appears at all. */
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Extra controls, placed before the expand and close buttons. The row is a flex
|
|
21
|
+
* line and nothing more — add as many `IconButton`s as the app needs.
|
|
22
|
+
*/
|
|
23
|
+
actions?: ReactNode;
|
|
24
|
+
expandLabel?: string;
|
|
25
|
+
collapseLabel?: string;
|
|
26
|
+
closeLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The modal's top bar: who is answering, and the two controls that change the
|
|
30
|
+
* window itself. It owns no state — `expanded` only decides which glyph the toggle
|
|
31
|
+
* shows, because the modal above it is what actually resizes.
|
|
32
|
+
*/
|
|
33
|
+
export declare function AiAssistantHeader({ title, titleAs: Title, avatar, onExpandToggle, expanded, onClose, actions, expandLabel, collapseLabel, closeLabel, className, ...props }: AiAssistantHeaderProps): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=AiAssistantHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantHeader.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtD,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,cAAc,CAAC,WAAW,CAAC,EAC3B,OAAO,GAAG,UAAU,CACrB;IACC,sEAAsE;IACtE,KAAK,EAAE,SAAS,CAAA;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAA;IACzC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EAAE,KAAY,EACrB,MAAM,EACN,cAAc,EACd,QAAgB,EAChB,OAAO,EACP,OAAO,EACP,WAAsB,EACtB,aAA0B,EAC1B,UAAoB,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,+BAgCxB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface AiAssistantImage {
|
|
3
|
+
src: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AiAssistantImageGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
7
|
+
images: AiAssistantImage[];
|
|
8
|
+
/**
|
|
9
|
+
* Renders each image as a button and reports which one was pressed. Without it
|
|
10
|
+
* the images are inert: the lightbox — if the app wants one — is the app's.
|
|
11
|
+
*/
|
|
12
|
+
onImageClick?: (index: number) => void;
|
|
13
|
+
/** `small` is the reference row's size; `base` is what a sent message shows. */
|
|
14
|
+
size?: 'small' | 'base';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Images carried by a turn, on the same neutral ground a question bubble uses, so
|
|
18
|
+
* they read as part of the message rather than as a gallery dropped beside it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function AiAssistantImageGroup({ images, onImageClick, size, className, ...props }: AiAssistantImageGroupProps): import("react").JSX.Element | null;
|
|
21
|
+
//# sourceMappingURL=AiAssistantImageGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantImageGroup.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantImageGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,cAAc,CAAC,cAAc,CAAC,EAC9B,UAAU,CACX;IACC,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,gFAAgF;IAChF,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CACxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,YAAY,EACZ,IAAa,EACb,SAAS,EACT,GAAG,KAAK,EACT,EAAE,0BAA0B,sCA2B5B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export interface AiAssistantInputProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'defaultValue' | 'onChange' | 'onSubmit' | 'children'> {
|
|
3
|
+
/** Controlled text. Leave it out and the field keeps its own. */
|
|
4
|
+
value?: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onValueChange?: (value: string) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Called with the trimmed text. The field then clears: uncontrolled it empties
|
|
9
|
+
* itself, controlled it asks to be emptied through `onValueChange('')`.
|
|
10
|
+
*/
|
|
11
|
+
onSubmit?: (value: string) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/**
|
|
14
|
+
* What the composer is currently pointed at: mentions, targets, attached images
|
|
15
|
+
* and files, as `AiAssistantReference` chips. A wrapping row above the field.
|
|
16
|
+
*/
|
|
17
|
+
references?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* The left slot. It is a flex row and nothing more — the app puts whatever
|
|
20
|
+
* controls it has there, in whatever order, and can have none at all.
|
|
21
|
+
*/
|
|
22
|
+
leading?: ReactNode;
|
|
23
|
+
/** Inline picker above the composer; its items and navigation belong to the app. */
|
|
24
|
+
menu?: ReactNode;
|
|
25
|
+
menuLabel?: string;
|
|
26
|
+
menuMaxHeight?: CSSProperties['maxHeight'];
|
|
27
|
+
onMenuClose?: () => void;
|
|
28
|
+
/** Adds a plus control immediately before the submit/stop control. */
|
|
29
|
+
onAdd?: () => void;
|
|
30
|
+
addLabel?: string;
|
|
31
|
+
/** Controls that sit beside the send button, before it. Same freedom as `leading`. */
|
|
32
|
+
trailing?: ReactNode;
|
|
33
|
+
/** Replaces the send button itself. */
|
|
34
|
+
submit?: ReactNode;
|
|
35
|
+
submitIcon?: ReactNode;
|
|
36
|
+
submitLabel?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Turns the send button into a stop button while `loading`. Without it a running
|
|
39
|
+
* answer cannot be called off, and the button just spins.
|
|
40
|
+
*/
|
|
41
|
+
onStop?: () => void;
|
|
42
|
+
stopIcon?: ReactNode;
|
|
43
|
+
stopLabel?: string;
|
|
44
|
+
loading?: boolean;
|
|
45
|
+
/** Enter sends and Shift+Enter breaks the line. Turn off where Enter must break. */
|
|
46
|
+
submitOnEnter?: boolean;
|
|
47
|
+
/** Where the field stops growing and starts scrolling. */
|
|
48
|
+
maxHeight?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Accepts files dropped on the composer, and images pasted into it. Without this
|
|
51
|
+
* prop nothing is listened for at all — and that matters: a drop the page does
|
|
52
|
+
* not handle navigates the browser away to the dropped file.
|
|
53
|
+
*
|
|
54
|
+
* Every type is handed over: what counts as attachable, how it uploads and what
|
|
55
|
+
* chip it becomes are the app's, and the result comes back through `references`.
|
|
56
|
+
*/
|
|
57
|
+
onFilesDrop?: (files: File[]) => void;
|
|
58
|
+
/** Announced while a drag hovers the composer. */
|
|
59
|
+
dropLabel?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The modal's composer. It grows with the text up to `maxHeight` and hands the
|
|
63
|
+
* overflow to `Scrollable`, so the thin scrollbar here is the same one the rest of
|
|
64
|
+
* the product uses.
|
|
65
|
+
*
|
|
66
|
+
* Its three states are read off the content, never set: empty, focused, and filled
|
|
67
|
+
* — the send button only wakes up once there is something to send.
|
|
68
|
+
*/
|
|
69
|
+
export declare const AiAssistantInput: import('react').ForwardRefExoticComponent<AiAssistantInputProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
70
|
+
//# sourceMappingURL=AiAssistantInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantInput.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,aAAa,EAIlB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAA;AAOd,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAChE;IACC,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,oFAAoF;IACpF,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IAC1C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,uCAAuC;IACvC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,oFAAoF;IACpF,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAA;IACrC,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,uHAsO5B,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CSSProperties, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { NoviProps } from '../Novi/Novi';
|
|
3
|
+
export interface AiAssistantLauncherProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'children' | 'defaultValue' | 'onChange' | 'onSubmit' | 'size' | 'type' | 'value'> {
|
|
4
|
+
/** Controlled text. Leave it out and the launcher keeps its own. */
|
|
5
|
+
open?: boolean;
|
|
6
|
+
value?: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onValueChange?: (value: string) => void;
|
|
9
|
+
/** Called with the trimmed text when the user presses Enter. */
|
|
10
|
+
onSubmit?: (value: string) => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** Replaces the default Novi mark. */
|
|
13
|
+
avatar?: ReactNode;
|
|
14
|
+
/** Customises the built-in Novi. Ignored when `avatar` is provided. */
|
|
15
|
+
noviProps?: NoviProps;
|
|
16
|
+
/** Reference chips displayed above the prompt row. */
|
|
17
|
+
references?: ReactNode;
|
|
18
|
+
/** Inline picker content above references. Omit it to collapse the surface. */
|
|
19
|
+
menu?: ReactNode;
|
|
20
|
+
menuLabel?: string;
|
|
21
|
+
/** Picker grows with content up to this height, then scrolls. Defaults to 240px. */
|
|
22
|
+
menuMaxHeight?: CSSProperties['maxHeight'];
|
|
23
|
+
/** Requests dismissal when Escape is pressed inside the launcher. */
|
|
24
|
+
onMenuClose?: () => void;
|
|
25
|
+
/** Extra controls placed before the built-in actions. */
|
|
26
|
+
actions?: ReactNode;
|
|
27
|
+
/** Each handler opts its control in. Controls without an action are not rendered. */
|
|
28
|
+
onAdd?: () => void;
|
|
29
|
+
onVoice?: () => void;
|
|
30
|
+
onOpen?: () => void;
|
|
31
|
+
addLabel?: string;
|
|
32
|
+
voiceLabel?: string;
|
|
33
|
+
openLabel?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A compact, single-line assistant entry point for a page or persistent bottom rail.
|
|
37
|
+
* Positioning is deliberately left to the consumer so the same bar can be fixed,
|
|
38
|
+
* sticky, or placed inline without fighting its surrounding layout.
|
|
39
|
+
*/
|
|
40
|
+
export declare const AiAssistantLauncher: import('react').ForwardRefExoticComponent<AiAssistantLauncherProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
41
|
+
//# sourceMappingURL=AiAssistantLauncher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantLauncher.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantLauncher.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAKnD,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,UAAU,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAClF;IACC,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sCAAsC;IACtC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,uEAAuE;IACvE,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,sDAAsD;IACtD,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oFAAoF;IACpF,aAAa,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IAC1C,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,yDAAyD;IACzD,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,uHA8M/B,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
type AiAssistantLinkBaseProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
leftIcon?: ReactNode;
|
|
5
|
+
rightIcon?: ReactNode;
|
|
6
|
+
/** Marks the row as the one currently open in the modal. */
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
type AiAssistantLinkAsAnchor = AiAssistantLinkBaseProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof AiAssistantLinkBaseProps> & {
|
|
11
|
+
href: string;
|
|
12
|
+
};
|
|
13
|
+
type AiAssistantLinkAsButton = AiAssistantLinkBaseProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof AiAssistantLinkBaseProps> & {
|
|
14
|
+
href?: undefined;
|
|
15
|
+
};
|
|
16
|
+
export type AiAssistantLinkProps = AiAssistantLinkAsAnchor | AiAssistantLinkAsButton;
|
|
17
|
+
/**
|
|
18
|
+
* A row in the list the assistant offers before — or instead of — an answer:
|
|
19
|
+
* a suggested question, a doc page, a recent thread.
|
|
20
|
+
*
|
|
21
|
+
* It renders an `<a>` when given an `href` and a `<button>` otherwise, because a
|
|
22
|
+
* suggestion that fills the composer is not a navigation and must not be
|
|
23
|
+
* middle-clickable into a new tab.
|
|
24
|
+
*/
|
|
25
|
+
export declare function AiAssistantLink({ children, leftIcon, rightIcon, selected, className, ...props }: AiAssistantLinkProps): import("react").JSX.Element;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=AiAssistantLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantLink.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGlF,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,uBAAuB,GAAG,wBAAwB,GACrD,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,wBAAwB,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAElG,KAAK,uBAAuB,GAAG,wBAAwB,GACrD,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,wBAAwB,CAAC,GAAG;IAC9E,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB,CAAA;AAEH,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,GAAG,uBAAuB,CAAA;AAEpF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAgB,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,+BA0BtB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode, RefObject } from 'react';
|
|
2
|
+
interface AiAssistantMenuProps {
|
|
3
|
+
menu?: ReactNode;
|
|
4
|
+
id: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
restoreFocusRef: RefObject<HTMLElement>;
|
|
9
|
+
}
|
|
10
|
+
/** Shared inline surface; menu items and navigation belong to the consumer. */
|
|
11
|
+
export declare const AiAssistantMenu: import('react').ForwardRefExoticComponent<AiAssistantMenuProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=AiAssistantMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantMenu.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAKd,UAAU,oBAAoB;IAC5B,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,EAAE,SAAS,CAAC,WAAW,CAAC,CAAA;CACxC;AAED,+EAA+E;AAC/E,eAAO,MAAM,eAAe,iHA6F3B,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface AiAssistantModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
3
|
+
/** The thread: questions, answers, recommendations, the thinking row. */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
/** The element the header's title renders as. */
|
|
7
|
+
titleAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'p';
|
|
8
|
+
/** Replaces the whole header. The title and control props are ignored when given. */
|
|
9
|
+
header?: ReactNode;
|
|
10
|
+
/** Optional icon or avatar for the header. */
|
|
11
|
+
avatar?: ReactNode;
|
|
12
|
+
expanded?: boolean;
|
|
13
|
+
onExpandToggle?: () => void;
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/** Extra header controls. */
|
|
16
|
+
headerActions?: ReactNode;
|
|
17
|
+
/** The composer. Usually an `AiAssistantInput`. */
|
|
18
|
+
input?: ReactNode;
|
|
19
|
+
/** The strip under the composer. Usually an `AiAssistantBottom`. */
|
|
20
|
+
bottom?: ReactNode;
|
|
21
|
+
/** The panel's height. The thread is what stretches; header and composer are fixed. */
|
|
22
|
+
height?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Keeps the newest message in view as the thread grows — but only when the reader
|
|
25
|
+
* was already at the bottom, so scrolling up to re-read is never yanked away.
|
|
26
|
+
*/
|
|
27
|
+
autoScroll?: boolean;
|
|
28
|
+
/** Accessible name for the control that returns to the newest message. */
|
|
29
|
+
scrollToBottomLabel?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The assembled panel: a header, a scrolling thread, a composer, a footer strip.
|
|
33
|
+
*
|
|
34
|
+
* It is a panel, not a dialog — no overlay, no portal, no focus trap. Put it inside
|
|
35
|
+
* the app's own `Modal`, a drawer or a page corner; which of those it is belongs to
|
|
36
|
+
* the app, and the pieces above are the same either way.
|
|
37
|
+
*/
|
|
38
|
+
export declare function AiAssistantModal({ children, title, titleAs, header, avatar, expanded, onExpandToggle, onClose, headerActions, input, bottom, height, autoScroll, scrollToBottomLabel, className, style, ...props }: AiAssistantModalProps): import("react").JSX.Element;
|
|
39
|
+
//# sourceMappingURL=AiAssistantModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAssistantModal.d.ts","sourceRoot":"","sources":["../../src/AiAssistant/AiAssistantModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAMxF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC1F,yEAAyE;IACzE,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAA;IACzC,qFAAqF;IACrF,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,6BAA6B;IAC7B,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,mDAAmD;IACnD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,oEAAoE;IACpE,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,0EAA0E;IAC1E,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAKD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,KAAsB,EACtB,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAgB,EAChB,cAAc,EACd,OAAO,EACP,aAAa,EACb,KAAK,EACL,MAAM,EACN,MAAgB,EAChB,UAAiB,EACjB,mBAAkD,EAClD,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,qBAAqB,+BA0EvB"}
|