@runtypelabs/persona 3.0.0 → 3.1.0
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 +2 -2
- package/dist/index.cjs +29 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +68 -68
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +29 -29
- package/dist/index.js.map +1 -1
- package/dist/widget.css +83 -83
- package/package.json +1 -3
- package/src/components/artifact-pane.ts +3 -3
- package/src/components/header-builder.ts +1 -1
- package/src/runtime/host-layout.test.ts +137 -0
- package/src/runtime/host-layout.ts +81 -0
- package/src/runtime/init.test.ts +36 -1
- package/src/runtime/init.ts +1 -1
- package/src/styles/widget.css +83 -83
- package/src/ui.ts +6 -4
- package/src/utils/artifact-gate.ts +1 -1
- package/src/styles/tailwind.css +0 -20
package/dist/widget.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
[data-persona-root] {
|
|
2
2
|
all: initial;
|
|
3
3
|
font-family: var(--persona-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif);
|
|
4
4
|
font-size: var(--persona-font-size, 1rem);
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
--persona-md-blockquote-text-color: var(--persona-muted, #6b7280);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
[data-persona-root] * {
|
|
21
21
|
box-sizing: border-box;
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/* Widget CSS Variables - scoped to widget root to avoid polluting global namespace */
|
|
97
|
-
|
|
97
|
+
[data-persona-root] {
|
|
98
98
|
--persona-radius-sm: 0.125rem;
|
|
99
99
|
--persona-radius-md: 0.375rem;
|
|
100
100
|
--persona-radius-lg: 0.5rem;
|
|
@@ -1165,37 +1165,37 @@
|
|
|
1165
1165
|
border-color: var(--persona-message-assistant-border, var(--persona-border, #e5e7eb));
|
|
1166
1166
|
}
|
|
1167
1167
|
|
|
1168
|
-
|
|
1168
|
+
[data-persona-root] .vanilla-message-assistant-bubble.persona-shadow-sm {
|
|
1169
1169
|
box-shadow: var(--persona-message-assistant-shadow, 0 1px 2px 0 rgb(0 0 0 / 0.05));
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
|
-
|
|
1172
|
+
[data-persona-root] .vanilla-message-user-bubble.persona-shadow-sm {
|
|
1173
1173
|
box-shadow: var(--persona-message-user-shadow, 0 5px 15px rgba(15, 23, 42, 0.08));
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
|
-
|
|
1176
|
+
[data-persona-root] .vanilla-tool-bubble.persona-shadow-sm {
|
|
1177
1177
|
box-shadow: var(--persona-tool-bubble-shadow, 0 5px 15px rgba(15, 23, 42, 0.08));
|
|
1178
1178
|
}
|
|
1179
1179
|
|
|
1180
|
-
|
|
1180
|
+
[data-persona-root] .vanilla-reasoning-bubble.persona-shadow-sm {
|
|
1181
1181
|
box-shadow: var(--persona-reasoning-bubble-shadow, 0 5px 15px rgba(15, 23, 42, 0.08));
|
|
1182
1182
|
}
|
|
1183
1183
|
|
|
1184
1184
|
/* Artifact markdown (no .vanilla-message-bubble wrapper) */
|
|
1185
|
-
|
|
1185
|
+
[data-persona-root] .persona-markdown-bubble {
|
|
1186
1186
|
color: var(--persona-text, #111827);
|
|
1187
1187
|
font-family: var(--persona-md-prose-font-family, inherit);
|
|
1188
1188
|
}
|
|
1189
1189
|
|
|
1190
|
-
|
|
1190
|
+
[data-persona-root] .persona-markdown-bubble p {
|
|
1191
1191
|
margin: 0 0 1.5em;
|
|
1192
1192
|
}
|
|
1193
1193
|
|
|
1194
|
-
|
|
1194
|
+
[data-persona-root] .persona-markdown-bubble p:last-child {
|
|
1195
1195
|
margin-bottom: 0;
|
|
1196
1196
|
}
|
|
1197
1197
|
|
|
1198
|
-
|
|
1198
|
+
[data-persona-root] .persona-markdown-bubble code:not(pre code) {
|
|
1199
1199
|
background-color: var(--persona-md-inline-code-bg);
|
|
1200
1200
|
color: var(--persona-md-inline-code-color, inherit);
|
|
1201
1201
|
padding: var(--persona-md-inline-code-padding);
|
|
@@ -1203,12 +1203,12 @@
|
|
|
1203
1203
|
font-size: var(--persona-md-inline-code-font-size);
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
|
-
|
|
1206
|
+
[data-persona-root] .persona-markdown-bubble a {
|
|
1207
1207
|
color: var(--persona-md-link-color, var(--persona-accent, #3b82f6));
|
|
1208
1208
|
text-decoration: underline;
|
|
1209
1209
|
}
|
|
1210
1210
|
|
|
1211
|
-
|
|
1211
|
+
[data-persona-root] .persona-markdown-bubble pre {
|
|
1212
1212
|
background-color: var(--persona-md-code-block-bg);
|
|
1213
1213
|
border: 1px solid var(--persona-md-code-block-border-color);
|
|
1214
1214
|
border-radius: var(--persona-radius-md, 0.375rem);
|
|
@@ -1243,7 +1243,7 @@
|
|
|
1243
1243
|
text-decoration: underline;
|
|
1244
1244
|
}
|
|
1245
1245
|
|
|
1246
|
-
|
|
1246
|
+
[data-persona-root] .vanilla-message-assistant-bubble a {
|
|
1247
1247
|
color: var(--persona-md-link-color, var(--persona-accent, #3b82f6));
|
|
1248
1248
|
}
|
|
1249
1249
|
|
|
@@ -1328,7 +1328,7 @@
|
|
|
1328
1328
|
Markdown Header Styles
|
|
1329
1329
|
============================================ */
|
|
1330
1330
|
.vanilla-message-bubble h1,
|
|
1331
|
-
|
|
1331
|
+
[data-persona-root] .persona-markdown-bubble h1 {
|
|
1332
1332
|
font-size: var(--persona-md-h1-size);
|
|
1333
1333
|
font-weight: var(--persona-md-h1-weight);
|
|
1334
1334
|
margin: var(--persona-md-h1-margin);
|
|
@@ -1337,7 +1337,7 @@
|
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
1339
|
.vanilla-message-bubble h2,
|
|
1340
|
-
|
|
1340
|
+
[data-persona-root] .persona-markdown-bubble h2 {
|
|
1341
1341
|
font-size: var(--persona-md-h2-size);
|
|
1342
1342
|
font-weight: var(--persona-md-h2-weight);
|
|
1343
1343
|
margin: var(--persona-md-h2-margin);
|
|
@@ -1346,7 +1346,7 @@
|
|
|
1346
1346
|
}
|
|
1347
1347
|
|
|
1348
1348
|
.vanilla-message-bubble h3,
|
|
1349
|
-
|
|
1349
|
+
[data-persona-root] .persona-markdown-bubble h3 {
|
|
1350
1350
|
font-size: var(--persona-md-h3-size);
|
|
1351
1351
|
font-weight: var(--persona-md-h3-weight);
|
|
1352
1352
|
margin: var(--persona-md-h3-margin);
|
|
@@ -1355,7 +1355,7 @@
|
|
|
1355
1355
|
}
|
|
1356
1356
|
|
|
1357
1357
|
.vanilla-message-bubble h4,
|
|
1358
|
-
|
|
1358
|
+
[data-persona-root] .persona-markdown-bubble h4 {
|
|
1359
1359
|
font-size: var(--persona-md-h4-size);
|
|
1360
1360
|
font-weight: var(--persona-md-h4-weight);
|
|
1361
1361
|
margin: var(--persona-md-h4-margin);
|
|
@@ -1364,7 +1364,7 @@
|
|
|
1364
1364
|
}
|
|
1365
1365
|
|
|
1366
1366
|
.vanilla-message-bubble h5,
|
|
1367
|
-
|
|
1367
|
+
[data-persona-root] .persona-markdown-bubble h5 {
|
|
1368
1368
|
font-size: var(--persona-md-h5-size);
|
|
1369
1369
|
font-weight: var(--persona-md-h5-weight);
|
|
1370
1370
|
margin: var(--persona-md-h5-margin);
|
|
@@ -1373,7 +1373,7 @@
|
|
|
1373
1373
|
}
|
|
1374
1374
|
|
|
1375
1375
|
.vanilla-message-bubble h6,
|
|
1376
|
-
|
|
1376
|
+
[data-persona-root] .persona-markdown-bubble h6 {
|
|
1377
1377
|
font-size: var(--persona-md-h6-size);
|
|
1378
1378
|
font-weight: var(--persona-md-h6-weight);
|
|
1379
1379
|
margin: var(--persona-md-h6-margin);
|
|
@@ -2040,12 +2040,12 @@
|
|
|
2040
2040
|
Visibility (Tailwind parity — prefix persona-)
|
|
2041
2041
|
Shipped widget.css is hand-maintained; these utilities are used in TS but not generated by Tailwind at build time.
|
|
2042
2042
|
============================================ */
|
|
2043
|
-
|
|
2043
|
+
[data-persona-root] .persona-hidden {
|
|
2044
2044
|
display: none !important;
|
|
2045
2045
|
}
|
|
2046
2046
|
|
|
2047
2047
|
@media (min-width: 768px) {
|
|
2048
|
-
|
|
2048
|
+
[data-persona-root] .md\:persona-hidden {
|
|
2049
2049
|
display: none !important;
|
|
2050
2050
|
}
|
|
2051
2051
|
}
|
|
@@ -2055,12 +2055,12 @@
|
|
|
2055
2055
|
Vars set from TS: --persona-artifact-split-gap, --persona-artifact-pane-width,
|
|
2056
2056
|
--persona-artifact-pane-max-width, --persona-artifact-pane-min-width
|
|
2057
2057
|
============================================ */
|
|
2058
|
-
|
|
2058
|
+
[data-persona-root] .persona-artifact-split-root {
|
|
2059
2059
|
gap: var(--persona-artifact-split-gap, 0.5rem);
|
|
2060
2060
|
}
|
|
2061
2061
|
|
|
2062
2062
|
/* Document toolbar preset — optional layout vars: --persona-artifact-doc-toolbar-icon-color, etc. */
|
|
2063
|
-
|
|
2063
|
+
[data-persona-root] .persona-artifact-toolbar-document .persona-artifact-doc-icon-btn {
|
|
2064
2064
|
display: inline-flex;
|
|
2065
2065
|
align-items: center;
|
|
2066
2066
|
justify-content: center;
|
|
@@ -2073,17 +2073,17 @@
|
|
|
2073
2073
|
line-height: 1;
|
|
2074
2074
|
}
|
|
2075
2075
|
|
|
2076
|
-
|
|
2076
|
+
[data-persona-root] .persona-artifact-toolbar-document .persona-artifact-doc-icon-btn:hover {
|
|
2077
2077
|
color: var(--persona-artifact-toolbar-icon-hover-color, inherit);
|
|
2078
2078
|
background: var(--persona-artifact-toolbar-icon-hover-bg, var(--persona-container, #f3f4f6));
|
|
2079
2079
|
}
|
|
2080
2080
|
|
|
2081
|
-
|
|
2081
|
+
[data-persona-root] .persona-artifact-toolbar-document .persona-artifact-doc-icon-btn[aria-pressed="true"] {
|
|
2082
2082
|
background: var(--persona-artifact-doc-toggle-active-bg, var(--persona-container, #f3f4f6));
|
|
2083
2083
|
border-color: var(--persona-artifact-doc-toggle-active-border, var(--persona-border, #e5e7eb));
|
|
2084
2084
|
}
|
|
2085
2085
|
|
|
2086
|
-
|
|
2086
|
+
[data-persona-root] .persona-artifact-toolbar-document .persona-artifact-doc-copy-btn {
|
|
2087
2087
|
display: inline-flex;
|
|
2088
2088
|
align-items: center;
|
|
2089
2089
|
gap: 0.35rem;
|
|
@@ -2097,63 +2097,63 @@
|
|
|
2097
2097
|
line-height: 1.25;
|
|
2098
2098
|
}
|
|
2099
2099
|
|
|
2100
|
-
|
|
2100
|
+
[data-persona-root] .persona-artifact-toolbar-document .persona-artifact-doc-copy-btn:hover {
|
|
2101
2101
|
background: var(--persona-artifact-toolbar-icon-hover-bg, var(--persona-container, #f3f4f6));
|
|
2102
2102
|
}
|
|
2103
2103
|
|
|
2104
|
-
|
|
2104
|
+
[data-persona-root] .persona-artifact-toolbar-document .persona-artifact-doc-copy-label {
|
|
2105
2105
|
font-weight: 500;
|
|
2106
2106
|
}
|
|
2107
2107
|
|
|
2108
2108
|
/* Artifact tab theming */
|
|
2109
|
-
|
|
2109
|
+
[data-persona-root] .persona-artifact-tab {
|
|
2110
2110
|
background: var(--persona-artifact-tab-bg, transparent);
|
|
2111
2111
|
border-radius: var(--persona-artifact-tab-radius, 0.5rem);
|
|
2112
2112
|
color: var(--persona-artifact-tab-color, inherit);
|
|
2113
2113
|
}
|
|
2114
2114
|
|
|
2115
|
-
|
|
2115
|
+
[data-persona-root] .persona-artifact-tab.persona-bg-persona-container {
|
|
2116
2116
|
background: var(--persona-artifact-tab-active-bg, var(--persona-container, #f3f4f6));
|
|
2117
2117
|
border-color: var(--persona-artifact-tab-active-border, var(--persona-border, #e5e7eb));
|
|
2118
2118
|
}
|
|
2119
2119
|
|
|
2120
2120
|
/* Artifact toolbar background theming */
|
|
2121
|
-
|
|
2121
|
+
[data-persona-root] .persona-artifact-toolbar {
|
|
2122
2122
|
background: var(--persona-artifact-toolbar-bg, var(--persona-surface, #fff));
|
|
2123
2123
|
}
|
|
2124
2124
|
|
|
2125
2125
|
/* Toggle group gap */
|
|
2126
|
-
|
|
2126
|
+
[data-persona-root] .persona-artifact-toggle-group {
|
|
2127
2127
|
gap: var(--persona-artifact-toolbar-toggle-group-gap, 0.25rem);
|
|
2128
2128
|
}
|
|
2129
2129
|
|
|
2130
2130
|
/* Toggle button border-radius (view/code buttons) */
|
|
2131
|
-
|
|
2132
|
-
|
|
2131
|
+
[data-persona-root] .persona-artifact-toolbar-document .persona-artifact-view-btn,
|
|
2132
|
+
[data-persona-root] .persona-artifact-toolbar-document .persona-artifact-code-btn {
|
|
2133
2133
|
border-radius: var(--persona-artifact-toolbar-toggle-radius, var(--persona-artifact-toolbar-icon-radius, var(--persona-radius-md, 0.375rem)));
|
|
2134
2134
|
}
|
|
2135
2135
|
|
|
2136
2136
|
/* Tab hover */
|
|
2137
|
-
|
|
2137
|
+
[data-persona-root] .persona-artifact-tab:hover {
|
|
2138
2138
|
background: var(--persona-artifact-tab-hover-bg, var(--persona-container, #f3f4f6));
|
|
2139
2139
|
}
|
|
2140
2140
|
|
|
2141
2141
|
/* Tab list container */
|
|
2142
|
-
|
|
2142
|
+
[data-persona-root] .persona-artifact-list {
|
|
2143
2143
|
background: var(--persona-artifact-tab-list-bg, transparent);
|
|
2144
2144
|
border-bottom-color: var(--persona-artifact-tab-list-border-color, var(--persona-border, #e5e7eb));
|
|
2145
2145
|
padding: var(--persona-artifact-tab-list-padding, 0.5rem);
|
|
2146
2146
|
}
|
|
2147
2147
|
|
|
2148
2148
|
/* Toolbar border override */
|
|
2149
|
-
|
|
2149
|
+
[data-persona-root] .persona-artifact-toolbar-document {
|
|
2150
2150
|
border-bottom: var(--persona-artifact-toolbar-border, 1px solid var(--persona-border, #e5e7eb));
|
|
2151
2151
|
}
|
|
2152
2152
|
|
|
2153
2153
|
/* ── Composable button utilities ── */
|
|
2154
2154
|
|
|
2155
2155
|
/* Icon button — base for all icon-only buttons created by createIconButton() */
|
|
2156
|
-
|
|
2156
|
+
[data-persona-root] .persona-icon-btn {
|
|
2157
2157
|
display: inline-flex;
|
|
2158
2158
|
align-items: center;
|
|
2159
2159
|
justify-content: center;
|
|
@@ -2167,23 +2167,23 @@
|
|
|
2167
2167
|
transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
|
|
2168
2168
|
}
|
|
2169
2169
|
|
|
2170
|
-
|
|
2170
|
+
[data-persona-root] .persona-icon-btn:hover {
|
|
2171
2171
|
background: var(--persona-icon-btn-hover-bg, var(--persona-container, #f3f4f6));
|
|
2172
2172
|
color: var(--persona-icon-btn-hover-color, inherit);
|
|
2173
2173
|
}
|
|
2174
2174
|
|
|
2175
|
-
|
|
2175
|
+
[data-persona-root] .persona-icon-btn:focus-visible {
|
|
2176
2176
|
outline: 2px solid var(--persona-accent, #3b82f6);
|
|
2177
2177
|
outline-offset: 2px;
|
|
2178
2178
|
}
|
|
2179
2179
|
|
|
2180
|
-
|
|
2180
|
+
[data-persona-root] .persona-icon-btn[aria-pressed="true"] {
|
|
2181
2181
|
background: var(--persona-icon-btn-active-bg, var(--persona-container, #f3f4f6));
|
|
2182
2182
|
border-color: var(--persona-icon-btn-active-border, var(--persona-border, #e5e7eb));
|
|
2183
2183
|
}
|
|
2184
2184
|
|
|
2185
2185
|
/* Label button — icon + text button created by createLabelButton() */
|
|
2186
|
-
|
|
2186
|
+
[data-persona-root] .persona-label-btn {
|
|
2187
2187
|
display: inline-flex;
|
|
2188
2188
|
align-items: center;
|
|
2189
2189
|
gap: var(--persona-label-btn-gap, 0.35rem);
|
|
@@ -2200,84 +2200,84 @@
|
|
|
2200
2200
|
transition: background-color 0.15s ease, color 0.15s ease;
|
|
2201
2201
|
}
|
|
2202
2202
|
|
|
2203
|
-
|
|
2203
|
+
[data-persona-root] .persona-label-btn:hover {
|
|
2204
2204
|
background: var(--persona-label-btn-hover-bg, var(--persona-container, #f3f4f6));
|
|
2205
2205
|
}
|
|
2206
2206
|
|
|
2207
|
-
|
|
2207
|
+
[data-persona-root] .persona-label-btn:focus-visible {
|
|
2208
2208
|
outline: 2px solid var(--persona-accent, #3b82f6);
|
|
2209
2209
|
outline-offset: 2px;
|
|
2210
2210
|
}
|
|
2211
2211
|
|
|
2212
|
-
|
|
2212
|
+
[data-persona-root] .persona-label-btn--sm {
|
|
2213
2213
|
padding: var(--persona-label-btn-padding, 0.25rem 0.5rem);
|
|
2214
2214
|
font-size: var(--persona-label-btn-font-size, 0.75rem);
|
|
2215
2215
|
}
|
|
2216
2216
|
|
|
2217
|
-
|
|
2217
|
+
[data-persona-root] .persona-label-btn--md {
|
|
2218
2218
|
padding: 0.375rem 0.75rem;
|
|
2219
2219
|
font-size: 0.8125rem;
|
|
2220
2220
|
}
|
|
2221
2221
|
|
|
2222
|
-
|
|
2222
|
+
[data-persona-root] .persona-label-btn--primary {
|
|
2223
2223
|
background: var(--persona-primary, #3b82f6);
|
|
2224
2224
|
color: var(--persona-text-inverse, #ffffff);
|
|
2225
2225
|
border-color: transparent;
|
|
2226
2226
|
}
|
|
2227
2227
|
|
|
2228
|
-
|
|
2228
|
+
[data-persona-root] .persona-label-btn--primary:hover {
|
|
2229
2229
|
opacity: 0.9;
|
|
2230
2230
|
}
|
|
2231
2231
|
|
|
2232
|
-
|
|
2232
|
+
[data-persona-root] .persona-label-btn--destructive {
|
|
2233
2233
|
color: var(--persona-label-btn-destructive-color, #ef4444);
|
|
2234
2234
|
}
|
|
2235
2235
|
|
|
2236
|
-
|
|
2236
|
+
[data-persona-root] .persona-label-btn--ghost {
|
|
2237
2237
|
border: none;
|
|
2238
2238
|
background: transparent;
|
|
2239
2239
|
}
|
|
2240
2240
|
|
|
2241
|
-
|
|
2241
|
+
[data-persona-root] .persona-label-btn--ghost:hover {
|
|
2242
2242
|
background: var(--persona-label-btn-hover-bg, var(--persona-container, #f3f4f6));
|
|
2243
2243
|
}
|
|
2244
2244
|
|
|
2245
2245
|
/* Toggle group — mutually exclusive button set created by createToggleGroup() */
|
|
2246
|
-
|
|
2246
|
+
[data-persona-root] .persona-toggle-group {
|
|
2247
2247
|
display: inline-flex;
|
|
2248
2248
|
gap: var(--persona-toggle-group-gap, 0);
|
|
2249
2249
|
}
|
|
2250
2250
|
|
|
2251
|
-
|
|
2251
|
+
[data-persona-root] .persona-toggle-group > .persona-icon-btn {
|
|
2252
2252
|
border-radius: 0;
|
|
2253
2253
|
}
|
|
2254
2254
|
|
|
2255
|
-
|
|
2255
|
+
[data-persona-root] .persona-toggle-group > .persona-icon-btn:first-child {
|
|
2256
2256
|
border-top-left-radius: var(--persona-toggle-group-radius, var(--persona-icon-btn-radius, var(--persona-radius-md, 0.375rem)));
|
|
2257
2257
|
border-bottom-left-radius: var(--persona-toggle-group-radius, var(--persona-icon-btn-radius, var(--persona-radius-md, 0.375rem)));
|
|
2258
2258
|
}
|
|
2259
2259
|
|
|
2260
|
-
|
|
2260
|
+
[data-persona-root] .persona-toggle-group > .persona-icon-btn:last-child {
|
|
2261
2261
|
border-top-right-radius: var(--persona-toggle-group-radius, var(--persona-icon-btn-radius, var(--persona-radius-md, 0.375rem)));
|
|
2262
2262
|
border-bottom-right-radius: var(--persona-toggle-group-radius, var(--persona-icon-btn-radius, var(--persona-radius-md, 0.375rem)));
|
|
2263
2263
|
}
|
|
2264
2264
|
|
|
2265
2265
|
/* Combo button — label + chevron with dropdown */
|
|
2266
|
-
|
|
2266
|
+
[data-persona-root] .persona-combo-btn {
|
|
2267
2267
|
font-size: var(--persona-combo-btn-font-size, 0.8125rem);
|
|
2268
2268
|
font-weight: var(--persona-combo-btn-font-weight, 600);
|
|
2269
2269
|
color: var(--persona-combo-btn-color, var(--persona-text, #111827));
|
|
2270
2270
|
user-select: none;
|
|
2271
2271
|
}
|
|
2272
2272
|
|
|
2273
|
-
|
|
2273
|
+
[data-persona-root] .persona-combo-btn-label {
|
|
2274
2274
|
white-space: nowrap;
|
|
2275
2275
|
overflow: hidden;
|
|
2276
2276
|
text-overflow: ellipsis;
|
|
2277
2277
|
}
|
|
2278
2278
|
|
|
2279
2279
|
/* Dropdown menu utility */
|
|
2280
|
-
|
|
2280
|
+
[data-persona-root] .persona-dropdown-menu {
|
|
2281
2281
|
z-index: 100;
|
|
2282
2282
|
min-width: 160px;
|
|
2283
2283
|
background: var(--persona-dropdown-bg, var(--persona-surface, #fff));
|
|
@@ -2287,7 +2287,7 @@
|
|
|
2287
2287
|
box-shadow: var(--persona-dropdown-shadow, 0 4px 16px rgba(0,0,0,0.12));
|
|
2288
2288
|
}
|
|
2289
2289
|
|
|
2290
|
-
|
|
2290
|
+
[data-persona-root] .persona-dropdown-menu button {
|
|
2291
2291
|
display: flex;
|
|
2292
2292
|
align-items: center;
|
|
2293
2293
|
gap: 0.625rem;
|
|
@@ -2302,22 +2302,22 @@
|
|
|
2302
2302
|
white-space: nowrap;
|
|
2303
2303
|
}
|
|
2304
2304
|
|
|
2305
|
-
|
|
2305
|
+
[data-persona-root] .persona-dropdown-menu button:hover {
|
|
2306
2306
|
background: var(--persona-dropdown-item-hover-bg, var(--persona-container, #f3f4f6));
|
|
2307
2307
|
}
|
|
2308
2308
|
|
|
2309
|
-
|
|
2309
|
+
[data-persona-root] .persona-dropdown-menu button[data-destructive] {
|
|
2310
2310
|
color: var(--persona-dropdown-destructive-color, #ef4444);
|
|
2311
2311
|
}
|
|
2312
2312
|
|
|
2313
|
-
|
|
2313
|
+
[data-persona-root] .persona-dropdown-menu hr {
|
|
2314
2314
|
border: none;
|
|
2315
2315
|
border-top: 1px solid var(--persona-dropdown-hr, var(--persona-border, #e5e7eb));
|
|
2316
2316
|
margin: 0.25rem 0;
|
|
2317
2317
|
}
|
|
2318
2318
|
|
|
2319
2319
|
/* Draggable split handle (desktop split only; hidden in drawer / narrow host / small viewport) */
|
|
2320
|
-
|
|
2320
|
+
[data-persona-root] .persona-artifact-split-handle {
|
|
2321
2321
|
width: 6px;
|
|
2322
2322
|
flex-shrink: 0;
|
|
2323
2323
|
cursor: col-resize;
|
|
@@ -2330,24 +2330,24 @@
|
|
|
2330
2330
|
box-sizing: border-box;
|
|
2331
2331
|
}
|
|
2332
2332
|
|
|
2333
|
-
|
|
2334
|
-
|
|
2333
|
+
[data-persona-root] .persona-artifact-split-handle:hover,
|
|
2334
|
+
[data-persona-root] .persona-artifact-split-handle:focus-visible {
|
|
2335
2335
|
background: color-mix(in srgb, var(--persona-border, #e5e7eb) 55%, transparent);
|
|
2336
2336
|
outline: none;
|
|
2337
2337
|
}
|
|
2338
2338
|
|
|
2339
|
-
|
|
2339
|
+
[data-persona-root].persona-artifact-narrow-host .persona-artifact-split-handle {
|
|
2340
2340
|
display: none !important;
|
|
2341
2341
|
}
|
|
2342
2342
|
|
|
2343
2343
|
@media (max-width: 640px) {
|
|
2344
|
-
|
|
2344
|
+
[data-persona-root] .persona-artifact-split-handle {
|
|
2345
2345
|
display: none !important;
|
|
2346
2346
|
}
|
|
2347
2347
|
}
|
|
2348
2348
|
|
|
2349
2349
|
@media (min-width: 641px) {
|
|
2350
|
-
|
|
2350
|
+
[data-persona-root] .persona-artifact-pane {
|
|
2351
2351
|
width: var(--persona-artifact-pane-width, 40%);
|
|
2352
2352
|
max-width: var(--persona-artifact-pane-max-width, 28rem);
|
|
2353
2353
|
min-width: var(--persona-artifact-pane-min-width, 0);
|
|
@@ -2357,7 +2357,7 @@
|
|
|
2357
2357
|
}
|
|
2358
2358
|
|
|
2359
2359
|
/* paneBorderRadius — works on any paneAppearance; overflow clips content to rounded shape */
|
|
2360
|
-
|
|
2360
|
+
[data-persona-root] .persona-artifact-pane {
|
|
2361
2361
|
border-radius: var(--persona-artifact-pane-radius, 0);
|
|
2362
2362
|
overflow: hidden;
|
|
2363
2363
|
/* Layout paneBackground → theme components.artifact.pane.background → semantic surface */
|
|
@@ -2369,12 +2369,12 @@
|
|
|
2369
2369
|
|
|
2370
2370
|
/* paneAppearance: 'seamless' — flush with chat, no border/shadow/gap */
|
|
2371
2371
|
/* `position: relative` for resizer overlay; gap 0; positioning is applied in ui.ts */
|
|
2372
|
-
|
|
2372
|
+
[data-persona-root].persona-artifact-appearance-seamless .persona-artifact-split-root {
|
|
2373
2373
|
position: relative;
|
|
2374
2374
|
gap: 0 !important;
|
|
2375
2375
|
}
|
|
2376
2376
|
|
|
2377
|
-
|
|
2377
|
+
[data-persona-root].persona-artifact-appearance-seamless .persona-artifact-pane {
|
|
2378
2378
|
border-left-width: 0 !important;
|
|
2379
2379
|
border-left-color: transparent !important;
|
|
2380
2380
|
box-shadow: none !important;
|
|
@@ -2386,22 +2386,22 @@
|
|
|
2386
2386
|
}
|
|
2387
2387
|
|
|
2388
2388
|
/* layout.paneBorder / paneBorderLeft — theme overrides (after appearance defaults) */
|
|
2389
|
-
|
|
2389
|
+
[data-persona-root].persona-artifact-border-full .persona-artifact-pane {
|
|
2390
2390
|
border: var(--persona-artifact-pane-border) !important;
|
|
2391
2391
|
}
|
|
2392
2392
|
|
|
2393
|
-
|
|
2393
|
+
[data-persona-root].persona-artifact-border-left .persona-artifact-pane {
|
|
2394
2394
|
border-top: none !important;
|
|
2395
2395
|
border-right: none !important;
|
|
2396
2396
|
border-bottom: none !important;
|
|
2397
2397
|
border-left: var(--persona-artifact-pane-border-left) !important;
|
|
2398
2398
|
}
|
|
2399
2399
|
|
|
2400
|
-
|
|
2400
|
+
[data-persona-root].persona-artifact-appearance-seamless.persona-artifact-border-left .persona-artifact-pane {
|
|
2401
2401
|
border-left: var(--persona-artifact-pane-border-left) !important;
|
|
2402
2402
|
}
|
|
2403
2403
|
|
|
2404
|
-
|
|
2404
|
+
[data-persona-root].persona-artifact-appearance-seamless.persona-artifact-border-full .persona-artifact-pane {
|
|
2405
2405
|
border: var(--persona-artifact-pane-border) !important;
|
|
2406
2406
|
}
|
|
2407
2407
|
|
|
@@ -2410,12 +2410,12 @@
|
|
|
2410
2410
|
* Main chat card (.persona-widget-container) loses inner-right rounding; artifact gains matching outer-right.
|
|
2411
2411
|
*/
|
|
2412
2412
|
@media (min-width: 641px) {
|
|
2413
|
-
|
|
2413
|
+
[data-persona-root]:not(.persona-artifact-narrow-host).persona-artifact-unified-split .persona-widget-container {
|
|
2414
2414
|
border-top-right-radius: 0 !important;
|
|
2415
2415
|
border-bottom-right-radius: 0 !important;
|
|
2416
2416
|
}
|
|
2417
2417
|
|
|
2418
|
-
|
|
2418
|
+
[data-persona-root]:not(.persona-artifact-narrow-host).persona-artifact-unified-split .persona-artifact-pane {
|
|
2419
2419
|
border-top-left-radius: 0 !important;
|
|
2420
2420
|
border-bottom-left-radius: 0 !important;
|
|
2421
2421
|
border-top-right-radius: var(--persona-artifact-unified-outer-radius, var(--persona-radius-lg, 1rem)) !important;
|
|
@@ -2425,14 +2425,14 @@
|
|
|
2425
2425
|
}
|
|
2426
2426
|
|
|
2427
2427
|
/* Narrow floating panel: drawer inside panel (class toggled by JS from panel width) */
|
|
2428
|
-
|
|
2428
|
+
[data-persona-root].persona-artifact-narrow-host .persona-artifact-backdrop {
|
|
2429
2429
|
position: absolute !important;
|
|
2430
2430
|
inset: 0 !important;
|
|
2431
2431
|
z-index: 55 !important;
|
|
2432
2432
|
}
|
|
2433
2433
|
|
|
2434
2434
|
@media (min-width: 641px) {
|
|
2435
|
-
|
|
2435
|
+
[data-persona-root].persona-artifact-narrow-host .persona-artifact-pane {
|
|
2436
2436
|
position: absolute;
|
|
2437
2437
|
top: 0;
|
|
2438
2438
|
right: 0;
|
|
@@ -2444,13 +2444,13 @@
|
|
|
2444
2444
|
transition: transform 0.2s ease;
|
|
2445
2445
|
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
|
|
2446
2446
|
}
|
|
2447
|
-
|
|
2447
|
+
[data-persona-root].persona-artifact-narrow-host .persona-artifact-pane.persona-artifact-drawer-open {
|
|
2448
2448
|
transform: translateX(0);
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
2451
|
|
|
2452
2452
|
@media (max-width: 640px) {
|
|
2453
|
-
|
|
2453
|
+
[data-persona-root] .persona-artifact-pane {
|
|
2454
2454
|
position: fixed;
|
|
2455
2455
|
top: 0;
|
|
2456
2456
|
right: 0;
|
|
@@ -2461,7 +2461,7 @@
|
|
|
2461
2461
|
transition: transform 0.2s ease;
|
|
2462
2462
|
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
|
|
2463
2463
|
}
|
|
2464
|
-
|
|
2464
|
+
[data-persona-root] .persona-artifact-pane.persona-artifact-drawer-open {
|
|
2465
2465
|
transform: translateX(0);
|
|
2466
2466
|
}
|
|
2467
2467
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtypelabs/persona",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Themeable, pluggable streaming agent widget for websites, in plain JS with support for voice input and reasoning / tool output.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -38,9 +38,7 @@
|
|
|
38
38
|
"eslint": "^8.57.0",
|
|
39
39
|
"eslint-config-prettier": "^9.1.0",
|
|
40
40
|
"fake-indexeddb": "^6.2.5",
|
|
41
|
-
"postcss": "^8.4.38",
|
|
42
41
|
"rimraf": "^5.0.5",
|
|
43
|
-
"tailwindcss": "^3.4.10",
|
|
44
42
|
"tsup": "^8.0.1",
|
|
45
43
|
"typescript": "^5.4.5",
|
|
46
44
|
"vitest": "^4.0.9"
|
|
@@ -203,8 +203,8 @@ export function createArtifactPane(
|
|
|
203
203
|
});
|
|
204
204
|
|
|
205
205
|
if (copyMenuChevronBtn && copyMenuItems?.length) {
|
|
206
|
-
// Resolve the portal target —
|
|
207
|
-
const resolvePortal = (): HTMLElement => shell.closest("
|
|
206
|
+
// Resolve the portal target — widget root for CSS var inheritance, escaping overflow: hidden
|
|
207
|
+
const resolvePortal = (): HTMLElement => shell.closest("[data-persona-root]") as HTMLElement ?? document.body;
|
|
208
208
|
|
|
209
209
|
const initDropdown = () => {
|
|
210
210
|
copyMenuDropdown = createDropdownMenu({
|
|
@@ -402,7 +402,7 @@ export function createArtifactPane(
|
|
|
402
402
|
shell.classList.toggle("persona-hidden", !has);
|
|
403
403
|
if (backdrop) {
|
|
404
404
|
const root =
|
|
405
|
-
typeof shell.closest === "function" ? shell.closest("
|
|
405
|
+
typeof shell.closest === "function" ? shell.closest("[data-persona-root]") : null;
|
|
406
406
|
const narrowHost = root?.classList.contains("persona-artifact-narrow-host") ?? false;
|
|
407
407
|
const isMobile =
|
|
408
408
|
narrowHost ||
|
|
@@ -2,7 +2,7 @@ import { createElement, createElementInDocument } from "../utils/dom";
|
|
|
2
2
|
import { renderLucideIcon } from "../utils/icons";
|
|
3
3
|
import { AgentWidgetConfig } from "../types";
|
|
4
4
|
|
|
5
|
-
/** CSS `color` values; variables are set on
|
|
5
|
+
/** CSS `color` values; variables are set on `[data-persona-root]` from `theme.components.header`. */
|
|
6
6
|
export const HEADER_THEME_CSS = {
|
|
7
7
|
titleColor:
|
|
8
8
|
"var(--persona-header-title-fg, var(--persona-primary, #2563eb))",
|