@duskmoon-dev/components 0.6.0 → 0.6.1
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 +27 -3
- package/dist/{chunk-b1jnq16e.js → chunk-rd10x4gc.js} +6 -0
- package/dist/components/chat/Chat.types.d.ts +7 -0
- package/dist/components/chat/ChatSessionComposer.types.d.ts +4 -0
- package/dist/components/chat/ComposerProvider.types.d.ts +4 -0
- package/dist/components/chat/composer/CompletionList.d.ts +6 -1
- package/dist/components/chat/composer/ComposerShell.d.ts +4 -0
- package/dist/components/chat/composer/DraftLifecycle.d.ts +3 -1
- package/dist/components/chat/index.js +826 -659
- package/dist/components/chat/rich/index.js +644 -603
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.js +1939 -1540
- package/dist/infrastructure.js +1 -1
- package/dist/styles.css +180 -2
- package/package.json +3 -3
package/dist/infrastructure.js
CHANGED
package/dist/styles.css
CHANGED
|
@@ -7000,7 +7000,7 @@ html {
|
|
|
7000
7000
|
display: block;
|
|
7001
7001
|
inline-size: 100%;
|
|
7002
7002
|
min-inline-size: 0;
|
|
7003
|
-
min-block-size:
|
|
7003
|
+
min-block-size: 1lh;
|
|
7004
7004
|
max-block-size: 16rem;
|
|
7005
7005
|
overflow: auto;
|
|
7006
7006
|
box-sizing: border-box;
|
|
@@ -7015,7 +7015,8 @@ html {
|
|
|
7015
7015
|
font-size: 0.9375rem;
|
|
7016
7016
|
line-height: 1.5;
|
|
7017
7017
|
overflow-wrap: anywhere;
|
|
7018
|
-
|
|
7018
|
+
field-sizing: content;
|
|
7019
|
+
resize: none;
|
|
7019
7020
|
}
|
|
7020
7021
|
|
|
7021
7022
|
.chat-composer-input::placeholder,
|
|
@@ -7222,6 +7223,116 @@ html {
|
|
|
7222
7223
|
max-inline-size: 100%;
|
|
7223
7224
|
}
|
|
7224
7225
|
|
|
7226
|
+
/* Opt into one compact control row without changing wrapping toolbars. */
|
|
7227
|
+
.chat-composer-toolbar-compact {
|
|
7228
|
+
flex-wrap: nowrap;
|
|
7229
|
+
gap: 0.25rem;
|
|
7230
|
+
}
|
|
7231
|
+
|
|
7232
|
+
.chat-composer-toolbar-compact > .btn {
|
|
7233
|
+
flex-shrink: 0;
|
|
7234
|
+
}
|
|
7235
|
+
|
|
7236
|
+
.chat-composer-toolbar-compact > .chat-composer-actions {
|
|
7237
|
+
flex: 1 1 auto;
|
|
7238
|
+
flex-wrap: nowrap;
|
|
7239
|
+
min-inline-size: 0;
|
|
7240
|
+
gap: 0.25rem;
|
|
7241
|
+
}
|
|
7242
|
+
|
|
7243
|
+
.chat-composer-actions > .btn.chat-composer-config {
|
|
7244
|
+
flex: 0 1 auto;
|
|
7245
|
+
min-inline-size: 0;
|
|
7246
|
+
padding-inline: 0.5rem;
|
|
7247
|
+
}
|
|
7248
|
+
|
|
7249
|
+
.chat-composer-config > svg {
|
|
7250
|
+
flex-shrink: 0;
|
|
7251
|
+
}
|
|
7252
|
+
|
|
7253
|
+
/* Selected media stays above the editor in a bounded, horizontal strip. */
|
|
7254
|
+
.chat-composer-thumbnails {
|
|
7255
|
+
display: flex;
|
|
7256
|
+
flex-wrap: nowrap;
|
|
7257
|
+
max-block-size: 7rem;
|
|
7258
|
+
}
|
|
7259
|
+
|
|
7260
|
+
.chat-composer-attachment-tile {
|
|
7261
|
+
position: relative;
|
|
7262
|
+
flex: 0 0 5.5rem;
|
|
7263
|
+
inline-size: 5.5rem;
|
|
7264
|
+
block-size: 5.5rem;
|
|
7265
|
+
box-sizing: border-box;
|
|
7266
|
+
padding: 0;
|
|
7267
|
+
overflow: hidden;
|
|
7268
|
+
border-radius: var(--radius-md);
|
|
7269
|
+
}
|
|
7270
|
+
|
|
7271
|
+
.chat-composer-attachment-tile > .chat-composer-preview {
|
|
7272
|
+
inline-size: 100%;
|
|
7273
|
+
block-size: 100%;
|
|
7274
|
+
border-radius: inherit;
|
|
7275
|
+
}
|
|
7276
|
+
|
|
7277
|
+
.chat-composer-attachment-tile > .chat-composer-attachment-remove {
|
|
7278
|
+
position: absolute;
|
|
7279
|
+
inset-block-start: 0.125rem;
|
|
7280
|
+
inset-inline-end: 0.125rem;
|
|
7281
|
+
background-color: var(--color-surface-container);
|
|
7282
|
+
color: var(--color-on-surface);
|
|
7283
|
+
}
|
|
7284
|
+
|
|
7285
|
+
/* Compose configuration menus with the native .popover and its menu items. */
|
|
7286
|
+
.popover.chat-composer-menu[popover] {
|
|
7287
|
+
position: fixed;
|
|
7288
|
+
inset: auto;
|
|
7289
|
+
inline-size: min(22rem, calc(100dvi - 2rem));
|
|
7290
|
+
min-inline-size: 0;
|
|
7291
|
+
max-inline-size: calc(100dvi - 2rem);
|
|
7292
|
+
max-block-size: min(24rem, calc(100dvb - 2rem));
|
|
7293
|
+
box-sizing: border-box;
|
|
7294
|
+
overflow: auto;
|
|
7295
|
+
overscroll-behavior: contain;
|
|
7296
|
+
margin: 0.5rem;
|
|
7297
|
+
position-area: block-start span-inline-end;
|
|
7298
|
+
position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
|
|
7299
|
+
}
|
|
7300
|
+
|
|
7301
|
+
.popover.chat-composer-menu-end[popover] {
|
|
7302
|
+
position-area: block-start span-inline-start;
|
|
7303
|
+
}
|
|
7304
|
+
|
|
7305
|
+
.popover.chat-composer-menu[popover]:popover-open::backdrop {
|
|
7306
|
+
background-color: transparent;
|
|
7307
|
+
}
|
|
7308
|
+
|
|
7309
|
+
.chat-composer-menu-option[aria-pressed="true"] {
|
|
7310
|
+
background-color: var(--color-surface-container-high);
|
|
7311
|
+
}
|
|
7312
|
+
|
|
7313
|
+
.chat-composer-menu .chat-composer-menu-option-warning {
|
|
7314
|
+
color: var(--color-on-warning-container);
|
|
7315
|
+
}
|
|
7316
|
+
|
|
7317
|
+
.chat-composer-menu .chat-composer-description {
|
|
7318
|
+
white-space: normal;
|
|
7319
|
+
}
|
|
7320
|
+
|
|
7321
|
+
.chat-composer-menu-row {
|
|
7322
|
+
display: flex;
|
|
7323
|
+
align-items: center;
|
|
7324
|
+
justify-content: space-between;
|
|
7325
|
+
gap: 0.75rem;
|
|
7326
|
+
padding: 0.5rem 0.75rem;
|
|
7327
|
+
font-size: 0.875rem;
|
|
7328
|
+
}
|
|
7329
|
+
|
|
7330
|
+
.chat-composer-menu-field {
|
|
7331
|
+
display: grid;
|
|
7332
|
+
gap: 0.75rem;
|
|
7333
|
+
padding: 0.5rem 0.75rem;
|
|
7334
|
+
}
|
|
7335
|
+
|
|
7225
7336
|
.chat-composer-reference > .btn,
|
|
7226
7337
|
.chat-composer-attachment > .btn,
|
|
7227
7338
|
.chat-composer-actions > .btn {
|
|
@@ -23670,6 +23781,14 @@ html {
|
|
|
23670
23781
|
display: none;
|
|
23671
23782
|
}
|
|
23672
23783
|
|
|
23784
|
+
/* React's content span must not give a circular icon a text baseline. */
|
|
23785
|
+
.btn-circle > .btn-content {
|
|
23786
|
+
display: inline-flex;
|
|
23787
|
+
align-items: center;
|
|
23788
|
+
justify-content: center;
|
|
23789
|
+
flex-shrink: 0;
|
|
23790
|
+
}
|
|
23791
|
+
|
|
23673
23792
|
.card {
|
|
23674
23793
|
box-sizing: border-box;
|
|
23675
23794
|
max-width: 100%;
|
|
@@ -30111,3 +30230,62 @@ html {
|
|
|
30111
30230
|
resize: none;
|
|
30112
30231
|
line-height: 1.5rem;
|
|
30113
30232
|
}
|
|
30233
|
+
|
|
30234
|
+
/* Lexical paragraph blocks represent editor lines, without prose margins. */
|
|
30235
|
+
.chat-composer-editor[data-lexical-editor] > p {
|
|
30236
|
+
margin: 0;
|
|
30237
|
+
}
|
|
30238
|
+
|
|
30239
|
+
@layer components {
|
|
30240
|
+
/* Keep the shared composer inset at half Core's default 1rem. */
|
|
30241
|
+
.chat-composer {
|
|
30242
|
+
padding: 0.5rem;
|
|
30243
|
+
}
|
|
30244
|
+
|
|
30245
|
+
/* The compact composition uses equal, smaller corner actions. */
|
|
30246
|
+
.chat-composer-toolbar-compact > .btn-circle,
|
|
30247
|
+
.chat-composer-toolbar-compact > .chat-composer-actions > .btn-circle {
|
|
30248
|
+
inline-size: 1.75rem;
|
|
30249
|
+
block-size: 1.75rem;
|
|
30250
|
+
padding: 0;
|
|
30251
|
+
}
|
|
30252
|
+
|
|
30253
|
+
/* Native anchoring keeps completion outside the scrolling editor. */
|
|
30254
|
+
.chat-composer-completions-compact[popover] {
|
|
30255
|
+
inline-size: anchor-size(inline);
|
|
30256
|
+
margin-inline: 0;
|
|
30257
|
+
}
|
|
30258
|
+
|
|
30259
|
+
.chat-composer-completion-list {
|
|
30260
|
+
margin: 0;
|
|
30261
|
+
padding: 0;
|
|
30262
|
+
list-style: none;
|
|
30263
|
+
}
|
|
30264
|
+
|
|
30265
|
+
.chat-composer-option-compact {
|
|
30266
|
+
flex-direction: row;
|
|
30267
|
+
align-items: center;
|
|
30268
|
+
gap: 0.5rem;
|
|
30269
|
+
}
|
|
30270
|
+
|
|
30271
|
+
.chat-composer-option-icon {
|
|
30272
|
+
display: inline-flex;
|
|
30273
|
+
flex: 0 0 auto;
|
|
30274
|
+
}
|
|
30275
|
+
|
|
30276
|
+
.chat-composer-option-icon > svg {
|
|
30277
|
+
flex-shrink: 0;
|
|
30278
|
+
}
|
|
30279
|
+
|
|
30280
|
+
.chat-composer-option-compact > .chat-composer-option-description {
|
|
30281
|
+
flex: 1 1 40%;
|
|
30282
|
+
min-inline-size: 0;
|
|
30283
|
+
overflow: hidden;
|
|
30284
|
+
text-overflow: ellipsis;
|
|
30285
|
+
white-space: nowrap;
|
|
30286
|
+
}
|
|
30287
|
+
|
|
30288
|
+
.chat-composer-option-source {
|
|
30289
|
+
flex-shrink: 0;
|
|
30290
|
+
}
|
|
30291
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duskmoon-dev/components",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -477,7 +477,7 @@
|
|
|
477
477
|
}
|
|
478
478
|
],
|
|
479
479
|
"peerDependencies": {
|
|
480
|
-
"@duskmoon-dev/core": ">=1.21.
|
|
480
|
+
"@duskmoon-dev/core": ">=1.21.1",
|
|
481
481
|
"react": ">=19.0.0",
|
|
482
482
|
"react-dom": ">=19.0.0",
|
|
483
483
|
"lexical": "0.53.0",
|
|
@@ -493,7 +493,7 @@
|
|
|
493
493
|
"ajv-formats": "^3.0.1"
|
|
494
494
|
},
|
|
495
495
|
"devDependencies": {
|
|
496
|
-
"@duskmoon-dev/core": "1.21.
|
|
496
|
+
"@duskmoon-dev/core": "1.21.1",
|
|
497
497
|
"@lexical/history": "0.53.0",
|
|
498
498
|
"@lexical/plain-text": "0.53.0",
|
|
499
499
|
"@testing-library/react": "16.3.2",
|