@duskmoon-dev/components 0.5.7 → 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 +111 -4
- package/dist/chunk-kg46s2vk.js +238 -0
- package/dist/chunk-rd10x4gc.js +733 -0
- package/dist/components/chat/Chat.types.d.ts +15 -0
- package/dist/components/chat/ChatAuthoritativeQueue.d.ts +4 -0
- package/dist/components/chat/ChatSessionComposer.d.ts +4 -0
- package/dist/components/chat/ChatSessionComposer.types.d.ts +46 -0
- package/dist/components/chat/ComposerAttachment.types.d.ts +80 -0
- package/dist/components/chat/ComposerDraft.types.d.ts +89 -0
- package/dist/components/chat/ComposerProvider.types.d.ts +70 -0
- package/dist/components/chat/ComposerQueue.types.d.ts +64 -0
- package/dist/components/chat/ComposerSession.types.d.ts +78 -0
- package/dist/components/chat/ComposerSettings.d.ts +4 -0
- package/dist/components/chat/composer/CompletionList.d.ts +15 -0
- package/dist/components/chat/composer/ComposerShell.d.ts +23 -4
- package/dist/components/chat/composer/DraftLifecycle.d.ts +19 -0
- package/dist/components/chat/composer/EditorAdapter.types.d.ts +36 -0
- package/dist/components/chat/composer/PlainEditor.d.ts +2 -0
- package/dist/components/chat/composer/PlainSemanticEditor.d.ts +6 -0
- package/dist/components/chat/composer/PreservedDraft.d.ts +7 -0
- package/dist/components/chat/composer/SemanticComposer.d.ts +10 -0
- package/dist/components/chat/composer/attachments.d.ts +4 -0
- package/dist/components/chat/composer/document.d.ts +3 -1
- package/dist/components/chat/composer/drafts.d.ts +2 -0
- package/dist/components/chat/composer/providers.d.ts +40 -0
- package/dist/components/chat/composer/session.d.ts +30 -0
- package/dist/components/chat/composer/useComposerAttachments.d.ts +3 -0
- package/dist/components/chat/composer/useComposerDraft.d.ts +3 -0
- package/dist/components/chat/composer/useComposerProviders.d.ts +7 -0
- package/dist/components/chat/composer/useComposerSession.d.ts +16 -0
- package/dist/components/chat/index.d.ts +17 -0
- package/dist/components/chat/index.js +4765 -1286
- package/dist/components/chat/rich/LexicalEditor.d.ts +10 -0
- package/dist/components/chat/rich/RichChatComposer.d.ts +4 -0
- package/dist/components/chat/rich/index.d.ts +2 -0
- package/dist/components/chat/rich/index.js +3478 -0
- package/dist/components/chat/rich/nodes.d.ts +49 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.js +11994 -8740
- package/dist/infrastructure.js +1 -1
- package/dist/styles.css +180 -2
- package/package.json +27 -6
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.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -424,7 +424,11 @@
|
|
|
424
424
|
"import": "./dist/components/json-schema-form/index.js",
|
|
425
425
|
"types": "./dist/components/json-schema-form/index.d.ts"
|
|
426
426
|
},
|
|
427
|
-
"./chat/contracts.v1.json": "./dist/components/chat/composer/contracts.v1.json"
|
|
427
|
+
"./chat/contracts.v1.json": "./dist/components/chat/composer/contracts.v1.json",
|
|
428
|
+
"./chat/rich": {
|
|
429
|
+
"import": "./dist/components/chat/rich/index.js",
|
|
430
|
+
"types": "./dist/components/chat/rich/index.d.ts"
|
|
431
|
+
}
|
|
428
432
|
},
|
|
429
433
|
"files": [
|
|
430
434
|
"dist",
|
|
@@ -473,9 +477,12 @@
|
|
|
473
477
|
}
|
|
474
478
|
],
|
|
475
479
|
"peerDependencies": {
|
|
476
|
-
"@duskmoon-dev/core": ">=1.21.
|
|
480
|
+
"@duskmoon-dev/core": ">=1.21.1",
|
|
477
481
|
"react": ">=19.0.0",
|
|
478
|
-
"react-dom": ">=19.0.0"
|
|
482
|
+
"react-dom": ">=19.0.0",
|
|
483
|
+
"lexical": "0.53.0",
|
|
484
|
+
"@lexical/history": "0.53.0",
|
|
485
|
+
"@lexical/plain-text": "0.53.0"
|
|
479
486
|
},
|
|
480
487
|
"dependencies": {
|
|
481
488
|
"clsx": "^2.1.1",
|
|
@@ -486,11 +493,14 @@
|
|
|
486
493
|
"ajv-formats": "^3.0.1"
|
|
487
494
|
},
|
|
488
495
|
"devDependencies": {
|
|
489
|
-
"@duskmoon-dev/core": "1.21.
|
|
496
|
+
"@duskmoon-dev/core": "1.21.1",
|
|
497
|
+
"@lexical/history": "0.53.0",
|
|
498
|
+
"@lexical/plain-text": "0.53.0",
|
|
490
499
|
"@testing-library/react": "16.3.2",
|
|
491
500
|
"@types/react": "19.2.18",
|
|
492
501
|
"@types/react-dom": "19.2.4",
|
|
493
|
-
"happy-dom": "20.11.1"
|
|
502
|
+
"happy-dom": "20.11.1",
|
|
503
|
+
"lexical": "0.53.0"
|
|
494
504
|
},
|
|
495
505
|
"repository": {
|
|
496
506
|
"type": "git",
|
|
@@ -499,5 +509,16 @@
|
|
|
499
509
|
},
|
|
500
510
|
"publishConfig": {
|
|
501
511
|
"access": "public"
|
|
512
|
+
},
|
|
513
|
+
"peerDependenciesMeta": {
|
|
514
|
+
"lexical": {
|
|
515
|
+
"optional": true
|
|
516
|
+
},
|
|
517
|
+
"@lexical/history": {
|
|
518
|
+
"optional": true
|
|
519
|
+
},
|
|
520
|
+
"@lexical/plain-text": {
|
|
521
|
+
"optional": true
|
|
522
|
+
}
|
|
502
523
|
}
|
|
503
524
|
}
|