@mgamadeus/ddd-agents 0.1.0-alpha.22 → 0.1.0-alpha.23
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 +3 -2
- package/dist/chat.js +22 -72
- package/dist/chat.js.map +1 -1
- package/dist/chunks/{ConversationMarkdown-W7NHglmL.js → ConversationMarkdown-CJhAnuVa.js} +110 -8
- package/dist/chunks/ConversationMarkdown-CJhAnuVa.js.map +1 -0
- package/dist/chunks/{WebSearchResultsConversationWidget-BvnLWHyi.js → WebSearchResultsConversationWidget-DRBQvycE.js} +140 -1125
- package/dist/chunks/WebSearchResultsConversationWidget-DRBQvycE.js.map +1 -0
- package/dist/chunks/{canvasBodies-9SuF6NAB.js → canvasBodies-DLjDkviP.js} +9 -6
- package/dist/chunks/canvasBodies-DLjDkviP.js.map +1 -0
- package/dist/chunks/{canvas-behaviours-BRFR1ALE.js → decide-canvas-open-DBWoWtAC.js} +18 -2
- package/dist/chunks/decide-canvas-open-DBWoWtAC.js.map +1 -0
- package/dist/chunks/entity-detail-name-3A82gDAp.js +15 -0
- package/dist/chunks/entity-detail-name-3A82gDAp.js.map +1 -0
- package/dist/chunks/icon-names-Di6c4zLo.js +86 -0
- package/dist/chunks/icon-names-Di6c4zLo.js.map +1 -0
- package/dist/chunks/index-7Qc_3GbG.js +1046 -0
- package/dist/chunks/index-7Qc_3GbG.js.map +1 -0
- package/dist/chunks/{widget-image-readiness-signal-DeOuL89j.js → widget-image-readiness-signal-D3ci53xr.js} +2 -2
- package/dist/chunks/{widget-image-readiness-signal-DeOuL89j.js.map → widget-image-readiness-signal-D3ci53xr.js.map} +1 -1
- package/dist/chunks/{widget-name-resolver-DyIY6Zu4.js → widget-name-resolver-C8SfpiR5.js} +48 -116
- package/dist/chunks/widget-name-resolver-C8SfpiR5.js.map +1 -0
- package/dist/client-testing.js +68 -1
- package/dist/client-testing.js.map +1 -1
- package/dist/files/chat/Conversation.module.scss +268 -0
- package/dist/files/chat/ConversationViewBody/ConversationViewBody.module.scss +336 -0
- package/dist/files/chat/_conversation-tokens.scss +37 -0
- package/dist/files/image-render/WidgetImageRender.module.scss +22 -0
- package/dist/files/kit/ComposedViewConversationWidget.md +59 -0
- package/dist/files/kit/components/data/data.preview-fixtures.json +3298 -0
- package/dist/files/kit/components/embedding/widget.preview-fixtures.json +147 -0
- package/dist/files/kit/components/entity/entity-link.preview-fixtures.json +340 -0
- package/dist/files/kit/components/form/form.preview-fixtures.json +319 -0
- package/dist/files/kit/components/inputs/button.preview-fixtures.json +301 -0
- package/dist/files/kit/components/inputs/checkbox.preview-fixtures.json +35 -0
- package/dist/files/kit/components/inputs/date-picker.preview-fixtures.json +36 -0
- package/dist/files/kit/components/inputs/input.preview-fixtures.json +55 -0
- package/dist/files/kit/components/inputs/radio-group.preview-fixtures.json +76 -0
- package/dist/files/kit/components/inputs/select.preview-fixtures.json +314 -0
- package/dist/files/kit/components/inputs/slider.preview-fixtures.json +178 -0
- package/dist/files/kit/components/inputs/tabs.preview-fixtures.json +304 -0
- package/dist/files/kit/components/inputs/textarea.preview-fixtures.json +37 -0
- package/dist/files/kit/components/layout/layout.preview-fixtures.json +892 -0
- package/dist/files/kit/components/map/map.preview-fixtures.json +339 -0
- package/dist/files/kit/components/media/image-group.preview-fixtures.json +228 -0
- package/dist/files/kit/components/media/image.preview-fixtures.json +61 -0
- package/dist/files/kit/components/media/video-card/video-card.preview-fixtures.json +121 -0
- package/dist/files/kit/components/media/video.preview-fixtures.json +68 -0
- package/dist/files/kit/components/rich/code.preview-fixtures.json +105 -0
- package/dist/files/kit/components/rich/diagram.preview-fixtures.json +89 -0
- package/dist/files/kit/components/rich/math.preview-fixtures.json +152 -0
- package/dist/files/kit/components/rich/svg.preview-fixtures.json +243 -0
- package/dist/files/kit/components/text/badge.preview-fixtures.json +44 -0
- package/dist/files/kit/components/text/caption.preview-fixtures.json +31 -0
- package/dist/files/kit/components/text/favicon.preview-fixtures.json +69 -0
- package/dist/files/kit/components/text/label.preview-fixtures.json +48 -0
- package/dist/files/kit/components/text/link.preview-fixtures.json +103 -0
- package/dist/files/kit/components/text/markdown.preview-fixtures.json +29 -0
- package/dist/files/kit/components/text/source-ref.preview-fixtures.json +51 -0
- package/dist/files/kit/components/text/text.preview-fixtures.json +106 -0
- package/dist/files/kit/components/text/title.preview-fixtures.json +172 -0
- package/dist/files/kit/composed-view-widget-contract.json +88 -0
- package/dist/files/kit/composed-view.preview-fixtures.json +376 -0
- package/dist/files/renderer/conversation-widget-layout.module.scss +47 -0
- package/dist/files/renderer/widget-tree/composed-node-schema.json +3428 -0
- package/dist/files/styles/_conversation-widget-container.scss +6 -0
- package/dist/files/styles/_media.scss +50 -0
- package/dist/files/styles/_spacings.scss +23 -0
- package/dist/files/styles/_surfaces.scss +28 -0
- package/dist/files/widgets/ClockConversationWidget/ClockConversationWidget.md +53 -0
- package/dist/files/widgets/ClockConversationWidget/clock.preview-fixtures.json +76 -0
- package/dist/files/widgets/ConceptExplainerConversationWidget/ConceptExplainerConversationWidget.md +86 -0
- package/dist/files/widgets/ConceptExplainerConversationWidget/concept-explainer.preview-fixtures.json +23 -0
- package/dist/files/widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsConversationWidget.md +59 -0
- package/dist/files/widgets/ConversationSearchResultsConversationWidget/conversation-search-results.preview-fixtures.json +85 -0
- package/dist/files/widgets/CurrencyConverterConversationWidget/CurrencyConverterConversationWidget.md +51 -0
- package/dist/files/widgets/CurrencyConverterConversationWidget/currency-converter.preview-fixtures.json +73 -0
- package/dist/files/widgets/CustomVisualizationConversationWidget/CustomVisualizationConversationWidget.md +83 -0
- package/dist/files/widgets/CustomVisualizationConversationWidget/custom-visualization.preview-fixtures.json +227 -0
- package/dist/files/widgets/CustomVisualizationConversationWidget/sandbox-frame/custom-visualization-frame.html +188 -0
- package/dist/files/widgets/EntityMentionConversationWidget/EntityMentionConversationWidget.md +55 -0
- package/dist/files/widgets/EntityMentionConversationWidget/entity-mention.preview-fixtures.json +55 -0
- package/dist/files/widgets/MultiChoiceConversationWidget/MultiChoiceConversationWidget.md +61 -0
- package/dist/files/widgets/MultiChoiceConversationWidget/multi-choice-widget-contract.json +43 -0
- package/dist/files/widgets/MultiChoiceConversationWidget/multi-choice.preview-fixtures.json +103 -0
- package/dist/files/widgets/QuickRepliesConversationWidget/QuickRepliesConversationWidget.md +65 -0
- package/dist/files/widgets/QuickRepliesConversationWidget/quick-replies-widget-contract.json +43 -0
- package/dist/files/widgets/QuickRepliesConversationWidget/quick-replies.preview-fixtures.json +45 -0
- package/dist/files/widgets/SuggestedActions/SuggestedActions.md +60 -0
- package/dist/files/widgets/SuggestedActions/suggested-actions.preview-fixtures.json +19 -0
- package/dist/files/widgets/ToolTraceConversationWidget/ToolTraceConversationWidget.md +48 -0
- package/dist/files/widgets/ToolTraceConversationWidget/tool-trace.preview-fixtures.json +32 -0
- package/dist/files/widgets/WebSearchResultsConversationWidget/WebSearchResultsConversationWidget.md +49 -0
- package/dist/files/widgets/WebSearchResultsConversationWidget/web-search-results.preview-fixtures.json +57 -0
- package/dist/files/widgets/WritingDraftConversationWidget/WritingDraftConversationWidget.md +66 -0
- package/dist/files/widgets/WritingDraftConversationWidget/writing-draft.preview-fixtures.json +129 -0
- package/dist/image-render.js +11 -10
- package/dist/image-render.js.map +1 -1
- package/dist/index.js +32 -28
- package/dist/index.js.map +1 -1
- package/dist/kit.js +11 -2
- package/dist/kit.js.map +1 -1
- package/dist/preview.js +7 -6
- package/dist/provider.js +71 -0
- package/dist/provider.js.map +1 -0
- package/dist/renderer.js +138 -63
- package/dist/renderer.js.map +1 -1
- package/dist/styles.css +32 -17
- package/dist/types/client/testing/test-conversation-widgets.d.ts +25 -0
- package/dist/types/client/testing/widget-hydration-stand-ins.d.ts +33 -0
- package/dist/types/entries/chat.d.ts +10 -0
- package/dist/types/entries/client-testing.d.ts +2 -0
- package/dist/types/entries/index.d.ts +4 -3
- package/dist/types/entries/kit.d.ts +7 -0
- package/dist/types/entries/preview.d.ts +1 -0
- package/dist/types/entries/provider.d.ts +1 -0
- package/dist/types/entries/renderer.d.ts +16 -0
- package/dist/types/entries/widgets.d.ts +13 -0
- package/dist/types/kit/components/data/apex-chart-component.d.ts +3 -0
- package/dist/types/kit/components/data/chart-model.d.ts +164 -0
- package/dist/types/kit/components/data/data-value-format.d.ts +44 -0
- package/dist/types/kit/components/data/use-chart-palette.d.ts +9 -0
- package/dist/types/kit/components/data/use-number-locale.d.ts +5 -0
- package/dist/types/provider/index.d.ts +1 -0
- package/dist/types/renderer/_access/ConversationWidgetGateSkeleton.d.ts +6 -0
- package/dist/types/renderer/_agent-space/use-conversation-widget-agent-space-fallback.d.ts +16 -0
- package/dist/types/renderer/canvas/use-anchor-widget-agent-space-key.d.ts +17 -0
- package/dist/types/renderer/conversationWidgetRegistry.d.ts +6 -0
- package/dist/types/renderer/read-conversation-widget-variant.d.ts +22 -0
- package/dist/types/widgets/_shared/CardFooter.d.ts +6 -0
- package/dist/types/widgets/_shared/WidgetLabel.d.ts +8 -0
- package/dist/types/widgets/_shared/entity-update-channel.d.ts +17 -0
- package/dist/types/widgets/_shared/use-element-visible.d.ts +6 -0
- package/dist/widgets.js +120 -27
- package/dist/widgets.js.map +1 -1
- package/package.json +74 -1
- package/public-api.json +761 -0
- package/dist/chunks/ConversationMarkdown-W7NHglmL.js.map +0 -1
- package/dist/chunks/WebSearchResultsConversationWidget-BvnLWHyi.js.map +0 -1
- package/dist/chunks/canvas-behaviours-BRFR1ALE.js.map +0 -1
- package/dist/chunks/canvasBodies-9SuF6NAB.js.map +0 -1
- package/dist/chunks/decide-canvas-open-Ct-wnNEJ.js +0 -20
- package/dist/chunks/decide-canvas-open-Ct-wnNEJ.js.map +0 -1
- package/dist/chunks/widget-name-resolver-DyIY6Zu4.js.map +0 -1
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
@import "../../styles/spacings";
|
|
2
|
+
@import "../../styles/media";
|
|
3
|
+
@import "../conversation-tokens";
|
|
4
|
+
@import "../../styles/conversation-widget-container";
|
|
5
|
+
|
|
6
|
+
.chat {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
background: linear-gradient(180deg, var(--agents-assistant-100) 0%, white 100%);
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.genericChat {
|
|
17
|
+
background: $chat-generic-bg;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// When the caller supplies a custom background via the `background` prop, the
|
|
21
|
+
// default gradient is suppressed — the caller (and any solid color from a
|
|
22
|
+
// parent surface) paints the chat background entirely.
|
|
23
|
+
.customBg {
|
|
24
|
+
background: var(--agents-chat-background);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// The host paints an EQUIVALENT solid fill at its own root (behind the side panels too) — this pane must be fully
|
|
28
|
+
// transparent so that layer shows through instead of being occluded by this one.
|
|
29
|
+
.customBg.backgroundPaintedByHost {
|
|
30
|
+
background: transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Absolutely-positioned slot for the caller's background node. Lives BEHIND
|
|
34
|
+
// the chat content via z-index: 0 + content layered at z-index: 1.
|
|
35
|
+
.backgroundLayer {
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0;
|
|
38
|
+
z-index: 0;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Agent full-screen ONLY (custom shader background, not the compact side-panel): the chat owns the whole viewport, so
|
|
44
|
+
// the background layer and the top blur band stretch edge-to-edge across it instead of being confined to the pane.
|
|
45
|
+
.customBg:not(.chatCompact) {
|
|
46
|
+
.backgroundLayer {
|
|
47
|
+
width: 100vw;
|
|
48
|
+
background-color: var(--agents-chat-background);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Fixed (out of the flex flow) + full viewport width: the blur band pins to the top of the viewport across its
|
|
52
|
+
// whole width, rather than tracking the content column as the in-pane sticky version does.
|
|
53
|
+
.contentWrapper::before {
|
|
54
|
+
position: fixed;
|
|
55
|
+
width: 100vw;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Opt-in override (agent host, docked side panel only): confine the band to the chat pane so it compresses with
|
|
60
|
+
// the chat when a sibling panel pushes it aside. Back to the base rule's `sticky` (NOT `absolute` — .contentWrapper
|
|
61
|
+
// IS the scroll container, an absolute band scrolls away with the messages); `width: 100%` undoes the 100vw.
|
|
62
|
+
.customBg.confineTopBlurBandToChatPane:not(.chatCompact) .contentWrapper::before {
|
|
63
|
+
position: sticky;
|
|
64
|
+
width: 100%;
|
|
65
|
+
// Two mask layers INTERSECTED: the base bottom fade-out plus a $x2 left/right edge fade, so the confined band
|
|
66
|
+
// doesn't end in a hard vertical line beside the docked side panel.
|
|
67
|
+
-webkit-mask-image:
|
|
68
|
+
linear-gradient(to bottom, black 0%, black 80%, transparent 100%),
|
|
69
|
+
linear-gradient(to right, transparent 0, black $x2, black calc(100% - #{$x2}), transparent 100%);
|
|
70
|
+
-webkit-mask-composite: source-in;
|
|
71
|
+
mask-image:
|
|
72
|
+
linear-gradient(to bottom, black 0%, black 80%, transparent 100%),
|
|
73
|
+
linear-gradient(to right, transparent 0, black $x2, black calc(100% - #{$x2}), transparent 100%);
|
|
74
|
+
mask-composite: intersect;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.contentWrapper {
|
|
78
|
+
position: relative;
|
|
79
|
+
z-index: 1;
|
|
80
|
+
display: flex;
|
|
81
|
+
// The blur (::before) and fade (::after) pseudos are full-width flex items; wrapping drops each onto its own
|
|
82
|
+
// line, so with a single content child there are three lines: blur, message column, fade.
|
|
83
|
+
flex-wrap: wrap;
|
|
84
|
+
// Pins the blur line to the top and the fade line to the viewport bottom when the conversation is too short to
|
|
85
|
+
// scroll (the message column sits centered between them); on overflow there's no free space, so `position: sticky`
|
|
86
|
+
// takes over and keeps both pinned to the top/bottom edges while scrolling.
|
|
87
|
+
align-content: space-between;
|
|
88
|
+
align-items: flex-start;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
overflow-x: hidden;
|
|
93
|
+
overflow-y: auto;
|
|
94
|
+
@include conversation-widget-container;
|
|
95
|
+
|
|
96
|
+
// Top frosted-glass band that blurs the messages scrolling up under the floating top bar. Hosted here (not in
|
|
97
|
+
// the top bar) so it tracks the chat content column, and because this wrapper's container-type makes it the
|
|
98
|
+
// backdrop root the blur samples its own messages. Mirrors the
|
|
99
|
+
// bottom ::after: a full-width sticky flex line whose negative margin cancels its height so it adds nothing to
|
|
100
|
+
// the scrollable area. Masks out over its bottom 20% so the blur has no hard edge.
|
|
101
|
+
&::before {
|
|
102
|
+
content: "";
|
|
103
|
+
position: sticky;
|
|
104
|
+
top: 0;
|
|
105
|
+
left: 0;
|
|
106
|
+
flex: 0 0 100%;
|
|
107
|
+
height: $x9;
|
|
108
|
+
margin-bottom: -1 * $x9;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
z-index: 3;
|
|
111
|
+
-webkit-backdrop-filter: blur($x2);
|
|
112
|
+
backdrop-filter: blur($x2);
|
|
113
|
+
-webkit-mask-image: linear-gradient(to bottom, black 0%, black 80%, transparent 100%);
|
|
114
|
+
mask-image: linear-gradient(to bottom, black 0%, black 80%, transparent 100%);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Bottom fade-out that keeps the last messages dissolving into the chat
|
|
118
|
+
// background as they scroll towards the bottom. Anchored to the scroll
|
|
119
|
+
// viewport (not the message list) so it stays at the bottom edge regardless
|
|
120
|
+
// of how tall the conversation is. Negative margin cancels its own height so
|
|
121
|
+
// it never adds to the scrollable area. Fades to the agent conversation tint
|
|
122
|
+
// when present (set on an ancestor), else the neutral page background.
|
|
123
|
+
&::after {
|
|
124
|
+
content: "";
|
|
125
|
+
position: sticky;
|
|
126
|
+
bottom: 0;
|
|
127
|
+
flex: 0 0 100%;
|
|
128
|
+
height: $x4;
|
|
129
|
+
margin-top: -$x4;
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
background: linear-gradient(180deg, transparent 0%, var(--agents-chat-background) 75%);
|
|
132
|
+
z-index: 2;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// An active agent thread fills the scroll pane even before its first visible reply. A task CTA starts with a hidden
|
|
137
|
+
// signal, so there is no user row for question-pinning to reserve this room. Filling the pane keeps the activity
|
|
138
|
+
// at the top and the sticky fade at the bottom, instead of distributing spare space around a short message list.
|
|
139
|
+
.topAlignedMessages {
|
|
140
|
+
min-height: 100%;
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Over an animated backdrop (`data-agent-shader-backdrop` on an ancestor of the chat): the backdrop has no flat colour
|
|
145
|
+
// to fade into, so the bottom band blurs the last messages into it (a mirror of the top ::before) instead of tinting
|
|
146
|
+
// them. Deliberately NOT a mask on .contentWrapper: a masked scroll container becomes the backdrop root and the top
|
|
147
|
+
// band's backdrop-filter stops sampling the messages.
|
|
148
|
+
[data-agent-shader-backdrop] .contentWrapper::after {
|
|
149
|
+
height: $x6;
|
|
150
|
+
margin-top: -$x6;
|
|
151
|
+
background: none;
|
|
152
|
+
-webkit-backdrop-filter: blur($x2);
|
|
153
|
+
backdrop-filter: blur($x2);
|
|
154
|
+
-webkit-mask-image: linear-gradient(to top, black 0%, black 40%, transparent 100%);
|
|
155
|
+
mask-image: linear-gradient(to top, black 0%, black 40%, transparent 100%);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Zero-height positioning row for the scroll-to-latest button: a flex sibling directly above the
|
|
159
|
+
// input, so the button floats just over it regardless of the input's (multiline) height. z-index
|
|
160
|
+
// above the sticky bottom fade (z 2) and level with the input (z 10).
|
|
161
|
+
.scrollToLatestAnchor {
|
|
162
|
+
position: relative;
|
|
163
|
+
width: 100%;
|
|
164
|
+
height: 0;
|
|
165
|
+
z-index: 10;
|
|
166
|
+
|
|
167
|
+
>* {
|
|
168
|
+
position: absolute;
|
|
169
|
+
bottom: $x2;
|
|
170
|
+
left: 50%;
|
|
171
|
+
transform: translateX(-50%);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// The bottom slot of the pane: the chat input, and any caller-supplied node standing IN PLACE of it
|
|
176
|
+
// (`inputReplacementSlot` — the agent closed-conversation status bar). Same width, same stacking: positioned above
|
|
177
|
+
// the background layer (z-index 0) and the sticky bottom fade.
|
|
178
|
+
// Hosts can tighten the inset from the pane's edges (the agent compact panel sets --agents-chat-input-side-inset and
|
|
179
|
+
// --agents-chat-input-bottom-inset); the defaults keep $x3 at each side and $x2 below.
|
|
180
|
+
// The message column with a host layer over it (`contentOverlaySlot`, the voice chat's focus mode). Switching, both go
|
|
181
|
+
// by an ellipse growing up from the input: the column clears inside it (--agents-content-hide) as it rises, fades and blurs,
|
|
182
|
+
// a little quicker so it stays just ahead of the layer's ellipse (--agents-overlay-reveal) that reveals it. Back, the other
|
|
183
|
+
// way. The motion starts slow and drives hard into the end.
|
|
184
|
+
@property --agents-content-hide {
|
|
185
|
+
syntax: "<percentage>";
|
|
186
|
+
inherits: false;
|
|
187
|
+
initial-value: 0%;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@property --agents-overlay-reveal {
|
|
191
|
+
syntax: "<percentage>";
|
|
192
|
+
inherits: false;
|
|
193
|
+
initial-value: 0%;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.contentLayers {
|
|
197
|
+
--agents-layers-punch: cubic-bezier(0.7, 0, 0.84, 0.25);
|
|
198
|
+
--agents-layers-swap: 720ms var(--agents-layers-punch);
|
|
199
|
+
position: relative;
|
|
200
|
+
z-index: 1;
|
|
201
|
+
display: grid;
|
|
202
|
+
flex: 1 1 0;
|
|
203
|
+
min-height: 0;
|
|
204
|
+
width: 100%;
|
|
205
|
+
|
|
206
|
+
> .contentWrapper,
|
|
207
|
+
> .contentOverlay {
|
|
208
|
+
grid-area: 1 / 1;
|
|
209
|
+
min-height: 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
> .contentWrapper {
|
|
213
|
+
-webkit-mask-image: radial-gradient(
|
|
214
|
+
calc(var(--agents-content-hide) * 4.8) calc(var(--agents-content-hide) * 3.9) at 50% 100%,
|
|
215
|
+
transparent 40%,
|
|
216
|
+
black 100%
|
|
217
|
+
);
|
|
218
|
+
mask-image: radial-gradient(
|
|
219
|
+
calc(var(--agents-content-hide) * 4.8) calc(var(--agents-content-hide) * 3.9) at 50% 100%,
|
|
220
|
+
transparent 40%,
|
|
221
|
+
black 100%
|
|
222
|
+
);
|
|
223
|
+
transition:
|
|
224
|
+
opacity var(--agents-layers-swap),
|
|
225
|
+
transform var(--agents-layers-swap),
|
|
226
|
+
filter var(--agents-layers-swap),
|
|
227
|
+
--agents-content-hide 600ms var(--agents-layers-punch) 120ms,
|
|
228
|
+
visibility 0s;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&[data-overlay-shown] > .contentWrapper {
|
|
232
|
+
--agents-content-hide: 100%;
|
|
233
|
+
visibility: hidden;
|
|
234
|
+
opacity: 0;
|
|
235
|
+
transform: translateY(-$x8);
|
|
236
|
+
filter: blur($x1);
|
|
237
|
+
transition:
|
|
238
|
+
opacity var(--agents-layers-swap),
|
|
239
|
+
transform var(--agents-layers-swap),
|
|
240
|
+
filter var(--agents-layers-swap),
|
|
241
|
+
--agents-content-hide 600ms var(--agents-layers-punch),
|
|
242
|
+
visibility 0s 720ms;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.contentOverlay {
|
|
247
|
+
position: relative;
|
|
248
|
+
z-index: 2;
|
|
249
|
+
display: flex;
|
|
250
|
+
flex-direction: column;
|
|
251
|
+
visibility: hidden;
|
|
252
|
+
pointer-events: none;
|
|
253
|
+
-webkit-mask-image: radial-gradient(
|
|
254
|
+
calc(var(--agents-overlay-reveal) * 4.4) calc(var(--agents-overlay-reveal) * 3.6) at 50% 100%,
|
|
255
|
+
black 35%,
|
|
256
|
+
transparent 100%
|
|
257
|
+
);
|
|
258
|
+
mask-image: radial-gradient(
|
|
259
|
+
calc(var(--agents-overlay-reveal) * 4.4) calc(var(--agents-overlay-reveal) * 3.6) at 50% 100%,
|
|
260
|
+
black 35%,
|
|
261
|
+
transparent 100%
|
|
262
|
+
);
|
|
263
|
+
transform: translateY($x8);
|
|
264
|
+
transition:
|
|
265
|
+
transform var(--agents-layers-swap),
|
|
266
|
+
--agents-overlay-reveal var(--agents-layers-swap),
|
|
267
|
+
visibility 0s 720ms;
|
|
268
|
+
|
|
269
|
+
.contentLayers[data-overlay-shown] > & {
|
|
270
|
+
--agents-overlay-reveal: 100%;
|
|
271
|
+
visibility: visible;
|
|
272
|
+
pointer-events: auto;
|
|
273
|
+
transform: none;
|
|
274
|
+
transition:
|
|
275
|
+
transform 0s,
|
|
276
|
+
--agents-overlay-reveal var(--agents-layers-swap),
|
|
277
|
+
visibility 0s;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@media (prefers-reduced-motion: reduce) {
|
|
282
|
+
.contentLayers > .contentWrapper,
|
|
283
|
+
.contentLayers[data-overlay-shown] > .contentWrapper,
|
|
284
|
+
.contentOverlay,
|
|
285
|
+
.contentLayers[data-overlay-shown] > .contentOverlay {
|
|
286
|
+
-webkit-mask-image: none;
|
|
287
|
+
mask-image: none;
|
|
288
|
+
transform: none;
|
|
289
|
+
filter: none;
|
|
290
|
+
transition:
|
|
291
|
+
opacity 200ms ease,
|
|
292
|
+
visibility 0s 200ms;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.contentOverlay {
|
|
296
|
+
opacity: 0;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.contentLayers[data-overlay-shown] > .contentOverlay {
|
|
300
|
+
opacity: 1;
|
|
301
|
+
transition:
|
|
302
|
+
opacity 200ms ease,
|
|
303
|
+
visibility 0s;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.input,
|
|
308
|
+
.inputReplacement {
|
|
309
|
+
width: calc(100% - 2 * var(--agents-chat-input-side-inset, #{$x3}));
|
|
310
|
+
max-width: $chat-content-max-width;
|
|
311
|
+
margin-bottom: var(--agents-chat-input-bottom-inset, #{$x2});
|
|
312
|
+
position: relative;
|
|
313
|
+
z-index: 10;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// AI-extension category conversation: the input's glow and send button take the category colour (`--agents-assistant-500`
|
|
317
|
+
// from the palette class on `.chat`; the theme's CTA colour where the category has none). Without a category they keep
|
|
318
|
+
// the inherited `--ai-base-color` — the agent's own colour inside the agent.
|
|
319
|
+
.inputInCategory {
|
|
320
|
+
--ai-base-color: var(--agents-assistant-500, var(--agents-bg-cta));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Scroll-up pagination "loading older messages" hint — floats at the top-center of the scroll pane so it doesn't
|
|
324
|
+
// disturb the centered message column.
|
|
325
|
+
.olderLoading {
|
|
326
|
+
position: absolute;
|
|
327
|
+
top: $x2;
|
|
328
|
+
left: 50%;
|
|
329
|
+
transform: translateX(-50%);
|
|
330
|
+
z-index: 5;
|
|
331
|
+
padding: $x1 $x3;
|
|
332
|
+
border-radius: 999px;
|
|
333
|
+
background: var(--agents-bg-var);
|
|
334
|
+
color: var(--agents-fg-light);
|
|
335
|
+
pointer-events: none;
|
|
336
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Central design tokens for the Conversation module.
|
|
2
|
+
// Use these instead of inlining hex literals in component scss.
|
|
3
|
+
// If a value belongs to the global design system, promote it to a package variable
|
|
4
|
+
// (`--agents-…`, styles/_ai-variables.scss) instead of adding it here.
|
|
5
|
+
|
|
6
|
+
// Generic-chat (unbranded) background gradient — used when no product brand color is present.
|
|
7
|
+
$chat-generic-bg:
|
|
8
|
+
linear-gradient(236deg, #fff -0.85%, #eaf5fe 16.3%, #e9f3fd 22.63%, #e8f2fd 28.95%, #fde2ef 85.17%),
|
|
9
|
+
linear-gradient(165deg, #fff 13.02%, #e8f2fd 47.07%);
|
|
10
|
+
|
|
11
|
+
@import "../styles/surfaces";
|
|
12
|
+
// Alias of the card shadow; new code imports $card-shadow from styles/_surfaces.scss directly.
|
|
13
|
+
$chat-card-shadow: $card-shadow;
|
|
14
|
+
|
|
15
|
+
// Popup/menu shadow (MockCommandMenu).
|
|
16
|
+
$chat-popup-shadow: 0 $x0_5 $x2 0 rgba(0, 0, 0, 0.12);
|
|
17
|
+
|
|
18
|
+
// Translucent-white overlay for the selection pill inside a user bubble. Deliberately white
|
|
19
|
+
// (NOT a theme background token): it lightens whatever bubble colour sits under it — product
|
|
20
|
+
// colour, white, or dark — so the pill reads on every bubble theme. Flipping it to the
|
|
21
|
+
// background colour would darken it on the dark bubble, so it stays white.
|
|
22
|
+
$chat-selection-pill-overlay: rgba(255, 255, 255, 0.18);
|
|
23
|
+
|
|
24
|
+
// Container-query breakpoint for compact chat pane.
|
|
25
|
+
$chat-pane-narrow-breakpoint: 40rem;
|
|
26
|
+
|
|
27
|
+
// Layout widths shared across Conversation subcomponents.
|
|
28
|
+
// All expressed as multiples of $x1 (0.5rem / 8px) so they stay on the spacing grid.
|
|
29
|
+
$chat-content-max-width: 100 * $x1; // 800px
|
|
30
|
+
$chat-messages-max-width: 150 * $x1; // 1200px
|
|
31
|
+
$chat-user-message-max-width: 75 * $x1; // 600px
|
|
32
|
+
$chat-suggestion-card-max-width: 40 * $x1; // 320px
|
|
33
|
+
$chat-suggestion-card-min-height: 19 * $x1; // 152px (was 150px — rounded onto grid)
|
|
34
|
+
$chat-drawer-width: 45 * $x1; // 360px
|
|
35
|
+
|
|
36
|
+
// Top padding under the floating header (used by the intro + message list).
|
|
37
|
+
$chat-top-padding: 21 * $x1; // 168px
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@import "../styles/conversation-widget-container";
|
|
2
|
+
|
|
3
|
+
:global(html), :global(body) {
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.root {
|
|
9
|
+
@include conversation-widget-container;
|
|
10
|
+
width: var(--agents-widget-image-width);
|
|
11
|
+
display: flow-root;
|
|
12
|
+
overflow: visible;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
color: var(--agents-fg);
|
|
15
|
+
background: var(--agents-bg);
|
|
16
|
+
|
|
17
|
+
&, * {
|
|
18
|
+
animation: none !important;
|
|
19
|
+
transition: none !important;
|
|
20
|
+
caret-color: transparent !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ComposedView
|
|
3
|
+
emitter: agent
|
|
4
|
+
canvas: entityDetail, mapFullScreen
|
|
5
|
+
summary: The composable widget kit — a tree of layout, text, data, media and input components (KPI tiles, charts, tables, maps, tabs) with local state, computed values and bound data. The model composes it for any data shape no domain widget covers — a dashboard or overview of headline numbers, a comparison table, a chart over time, places on a map.
|
|
6
|
+
description: One widget fence of type ComposedView carries a component TREE — `view` (the root node with its children and named slots), `state` (local state, changed by the tree's inputs only), `data` (named datasets — inline rows with a source, a `$from` tool-result binding, a `$source` data source), `computed` (expressions over state, data and each other in a closed language) and `actions` (copy, resetState, openEntity, openUrl). The node types, their props and slots are the generated schema `conversation-markdown/widget-tree/composed-node-schema.json`; the frontend and the backend drop what does not fit it and report it.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# ComposedViewConversationWidget
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
The agent's display language: instead of one bespoke widget per domain question, the model composes a tree
|
|
13
|
+
of kit components — a KPI row over a line chart over a table, a comparison table, a map with a carousel — and binds
|
|
14
|
+
the values to tool results or writes researched values inline with their source. Inputs (tabs, sliders, selects)
|
|
15
|
+
change local state only; every chart, KPI and table is re-computed from that state without a chat turn.
|
|
16
|
+
|
|
17
|
+
## Data structure
|
|
18
|
+
```ts
|
|
19
|
+
interface ComposedViewPayload {
|
|
20
|
+
title?: string; // business content, the owner's language
|
|
21
|
+
state?: Record<string, string | number | boolean | null>;
|
|
22
|
+
data?: Record<string, unknown[] | { $from: { toolCall: string; path: string } } | { $source: { name: string; params?: object } }>;
|
|
23
|
+
computed?: Record<string, string>; // closed expression language
|
|
24
|
+
view: { type: string; children?: Node[]; slots?: Record<string, Node[]>; [prop: string]: unknown };
|
|
25
|
+
actions?: Record<string, { type: "copy" | "resetState" | "openEntity" | "openUrl"; [field: string]: unknown }>;
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
Bindings are objects, never string templates: `{"$state":"period"}`, `{"$computed":"total"}`, `{"$data":"rows"}`,
|
|
29
|
+
`{"$item":"x"}` (inside a node that repeats its children), `{"$from":{"toolCall":"call_7","path":"$.rows[*]"}}`,
|
|
30
|
+
`{"$source":{"name":"rankings","params":{"days":30}}}`. An event prop takes `{"set":"<state name>"}` or
|
|
31
|
+
`{"action":"<action name>"}`.
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"type": "ComposedView",
|
|
36
|
+
"title": "Visits",
|
|
37
|
+
"state": { "period": "7d" },
|
|
38
|
+
"data": { "rows": [{ "x": "Mo", "visits": 980 }, { "x": "Di", "visits": 1120 }] },
|
|
39
|
+
"computed": { "total": "sum(rows, r => r.visits)" },
|
|
40
|
+
"view": {
|
|
41
|
+
"type": "Stack",
|
|
42
|
+
"children": [
|
|
43
|
+
{ "type": "KpiTile", "label": "Visits this week", "value": { "$computed": "total" } },
|
|
44
|
+
{ "type": "Chart", "kind": "line", "rows": { "$data": "rows" }, "x": "x", "y": "visits" }
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
(`Stack`, `KpiTile` and `Chart` are node types of the kit.) A `Widget` node embeds a domain widget only
|
|
50
|
+
when its class declares itself embeddable — none does yet, so a `Widget` node is dropped today, at the root as well.
|
|
51
|
+
|
|
52
|
+
## When to use
|
|
53
|
+
- The answer has a data shape (a comparison, a development over time, shares, a few headline numbers, places) and no
|
|
54
|
+
loaded skill offers a domain widget for it.
|
|
55
|
+
- Not for a single number, a yes or no, advice or small talk; never on the phone surface.
|
|
56
|
+
|
|
57
|
+
## Components
|
|
58
|
+
Registered by folder: `components/<group>/<Name>.composed.tsx` exporting `composedViewComponent`. The core `Widget` node
|
|
59
|
+
(an embeddable domain widget) is built in; the other kit components are separate node types.
|