@runtypelabs/persona 4.7.0 → 4.9.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 +1 -0
- package/dist/animations/glyph-cycle.cjs +2 -2
- package/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/glyph-cycle.js +2 -2
- package/dist/animations/{types-CSmiKRVa.d.cts → types-4ROVJ1gA.d.cts} +85 -3
- package/dist/animations/{types-CSmiKRVa.d.ts → types-4ROVJ1gA.d.ts} +85 -3
- package/dist/animations/wipe.cjs +2 -2
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/chunk-5EIIHQLQ.js +1 -0
- package/dist/chunk-IO5VVUKP.js +3 -0
- package/dist/chunk-IPVK3KOM.js +1 -0
- package/dist/chunk-UPO4GUFC.js +1 -0
- package/dist/codegen.cjs +13 -13
- package/dist/codegen.js +14 -14
- package/dist/context-mentions-7S5KVUTG.js +169 -0
- package/dist/context-mentions-inline-TTCN7ZM2.js +4 -0
- package/dist/context-mentions-inline.cjs +4 -0
- package/dist/context-mentions-inline.d.cts +203 -0
- package/dist/context-mentions-inline.d.ts +203 -0
- package/dist/context-mentions-inline.js +4 -0
- package/dist/context-mentions.cjs +295 -0
- package/dist/context-mentions.d.cts +7025 -0
- package/dist/context-mentions.d.ts +7025 -0
- package/dist/context-mentions.js +295 -0
- package/dist/index.cjs +99 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1507 -182
- package/dist/index.d.ts +1507 -182
- package/dist/index.global.js +88 -56
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +99 -68
- package/dist/index.js.map +1 -1
- package/dist/install.global.js +1 -1
- package/dist/install.global.js.map +1 -1
- package/dist/launcher.global.js +3 -2
- package/dist/launcher.global.js.map +1 -1
- package/dist/markdown-parsers.js +24 -24
- package/dist/plugin-kit.cjs +1 -1
- package/dist/plugin-kit.d.cts +17 -0
- package/dist/plugin-kit.d.ts +17 -0
- package/dist/plugin-kit.js +1 -1
- package/dist/runtype-tts-entry-UJAEF7NZ.js +1 -0
- package/dist/runtype-tts.js +1 -1
- package/dist/session-reconnect-JKIJBHS5.js +1 -0
- package/dist/smart-dom-reader.cjs +18 -17
- package/dist/smart-dom-reader.d.cts +1260 -16
- package/dist/smart-dom-reader.d.ts +1260 -16
- package/dist/smart-dom-reader.js +18 -17
- package/dist/testing.cjs +3 -3
- package/dist/testing.js +3 -3
- package/dist/theme-editor-preview.cjs +260 -58
- package/dist/theme-editor-preview.d.cts +1234 -15
- package/dist/theme-editor-preview.d.ts +1234 -15
- package/dist/theme-editor-preview.js +87 -58
- package/dist/theme-editor.cjs +10 -10
- package/dist/theme-editor.d.cts +1226 -15
- package/dist/theme-editor.d.ts +1226 -15
- package/dist/theme-editor.js +10 -10
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +76 -0
- package/dist/theme-reference.d.ts +76 -0
- package/dist/theme-reference.js +1 -1
- package/dist/voice-worklet-player.cjs +2 -2
- package/dist/voice-worklet-player.js +2 -2
- package/dist/webmcp-polyfill.js +2 -2
- package/dist/widget.css +1 -1
- package/package.json +16 -5
- package/src/artifacts-session.test.ts +178 -0
- package/src/client.test.ts +255 -1
- package/src/client.ts +157 -60
- package/src/components/artifact-card.test.ts +333 -0
- package/src/components/artifact-card.ts +75 -28
- package/src/components/artifact-inline.test.ts +1328 -0
- package/src/components/artifact-inline.ts +920 -0
- package/src/components/artifact-pane.test.ts +1042 -0
- package/src/components/artifact-pane.ts +440 -131
- package/src/components/artifact-preview.test.ts +1155 -0
- package/src/components/artifact-preview.ts +994 -0
- package/src/components/composer-parts.ts +3 -12
- package/src/components/context-mention-button.test.ts +70 -0
- package/src/components/context-mention-button.ts +82 -0
- package/src/components/context-mention-chip.ts +134 -0
- package/src/components/context-mention-menu.test.ts +508 -0
- package/src/components/context-mention-menu.ts +0 -0
- package/src/components/message-bubble.test.ts +175 -0
- package/src/components/message-bubble.ts +177 -19
- package/src/components/panel.ts +7 -10
- package/src/components/pill-composer-builder.test.ts +6 -2
- package/src/components/pill-composer-builder.ts +6 -6
- package/src/components/reasoning-bubble.ts +1 -13
- package/src/components/registry.ts +38 -3
- package/src/components/tool-bubble.ts +1 -13
- package/src/context-mentions-bundle.test.ts +163 -0
- package/src/context-mentions-entry.ts +185 -0
- package/src/context-mentions-inline-entry.test.ts +136 -0
- package/src/context-mentions-inline-entry.ts +226 -0
- package/src/context-mentions-inline-loader.test.ts +30 -0
- package/src/context-mentions-inline-loader.ts +36 -0
- package/src/context-mentions-inline.ts +15 -0
- package/src/context-mentions-loader.ts +32 -0
- package/src/context-mentions.ts +16 -0
- package/src/defaults.ts +1 -0
- package/src/generated/runtype-openapi-contract.ts +55 -3
- package/src/index-core.ts +46 -1
- package/src/index-global.ts +51 -0
- package/src/index.ts +8 -0
- package/src/markdown-parsers-loader.test.ts +158 -0
- package/src/markdown-parsers-loader.ts +83 -27
- package/src/plugin-kit.test.ts +40 -0
- package/src/plugin-kit.ts +39 -5
- package/src/runtime/host-layout.test.ts +163 -0
- package/src/runtime/host-layout.ts +110 -7
- package/src/runtime/init.ts +18 -61
- package/src/session.mentions.test.ts +175 -0
- package/src/session.test.ts +52 -4
- package/src/session.ts +197 -27
- package/src/smart-dom-reader.test.ts +129 -2
- package/src/smart-dom-reader.ts +127 -1
- package/src/styles/context-mention-menu-css.ts +176 -0
- package/src/styles/widget.css +1002 -152
- package/src/theme-editor/preview.ts +2 -0
- package/src/theme-editor/sections.test.ts +26 -1
- package/src/theme-editor/sections.ts +13 -5
- package/src/theme-reference.ts +2 -2
- package/src/tool-call-display-defaults.test.ts +1 -0
- package/src/types/theme.ts +79 -0
- package/src/types.ts +1041 -17
- package/src/ui.artifact-pane-gating.test.ts +636 -0
- package/src/ui.component-directive.test.ts +104 -0
- package/src/ui.composer-bar.test.ts +60 -2
- package/src/ui.detached-panel.test.ts +1049 -0
- package/src/ui.mention-submit.test.ts +235 -0
- package/src/ui.tool-display.test.ts +51 -0
- package/src/ui.ts +998 -159
- package/src/utils/artifact-custom-actions.ts +128 -0
- package/src/utils/artifact-display.test.ts +42 -0
- package/src/utils/artifact-display.ts +84 -0
- package/src/utils/artifact-file.test.ts +116 -0
- package/src/utils/artifact-file.ts +117 -0
- package/src/utils/artifact-gate.test.ts +112 -5
- package/src/utils/artifact-gate.ts +39 -14
- package/src/utils/artifact-loading-status.ts +55 -0
- package/src/utils/artifact-status-label.ts +190 -0
- package/src/utils/buttons.ts +7 -1
- package/src/utils/chunk-loader.test.ts +97 -0
- package/src/utils/chunk-loader.ts +88 -0
- package/src/utils/code-highlight.test.ts +186 -0
- package/src/utils/code-highlight.ts +400 -0
- package/src/utils/composer-contenteditable.test.ts +507 -0
- package/src/utils/composer-contenteditable.ts +626 -0
- package/src/utils/composer-document.test.ts +280 -0
- package/src/utils/composer-document.ts +293 -0
- package/src/utils/composer-history.test.ts +35 -7
- package/src/utils/composer-history.ts +30 -20
- package/src/utils/composer-input.ts +159 -0
- package/src/utils/context-mention-controller.test.ts +1215 -0
- package/src/utils/context-mention-controller.ts +1186 -0
- package/src/utils/context-mention-manager.test.ts +422 -0
- package/src/utils/context-mention-manager.ts +410 -0
- package/src/utils/context-mention-orchestrator.test.ts +538 -0
- package/src/utils/context-mention-orchestrator.ts +348 -0
- package/src/utils/icons.ts +2 -0
- package/src/utils/live-region.test.ts +108 -0
- package/src/utils/live-region.ts +94 -0
- package/src/utils/mention-channels.ts +63 -0
- package/src/utils/mention-llm-format.test.ts +91 -0
- package/src/utils/mention-llm-format.ts +79 -0
- package/src/utils/mention-matcher.test.ts +86 -0
- package/src/utils/mention-matcher.ts +221 -0
- package/src/utils/mention-token.ts +72 -0
- package/src/utils/mention-trigger.test.ts +155 -0
- package/src/utils/mention-trigger.ts +156 -0
- package/src/utils/roving-tablist.test.ts +152 -0
- package/src/utils/roving-tablist.ts +111 -0
- package/src/utils/spinner.ts +45 -0
- package/src/utils/theme.test.ts +76 -4
- package/src/utils/theme.ts +7 -0
- package/src/utils/tokens.ts +118 -11
- package/src/utils/tool-loading-animation.test.ts +32 -0
- package/src/utils/tool-loading-animation.ts +24 -0
- package/dist/chunk-DFBSCFYN.js +0 -1
- package/dist/runtype-tts-entry-HFUV2UF7.js +0 -1
- package/dist/session-reconnect-U77QFUR7.js +0 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS for the context-mention MENU (floating popover): search field, grouped
|
|
3
|
+
* result list, options, status/empty/error rows, retry button, and the
|
|
4
|
+
* coarse-pointer touch sizing for its rows.
|
|
5
|
+
*
|
|
6
|
+
* This lives in the lazy `context-mentions` chunk (not `widget.css`) and is
|
|
7
|
+
* injected on first menu open via `injectStyles`. Two reasons:
|
|
8
|
+
* 1. it keeps ~1 kB of menu-only CSS out of the eager core stylesheet;
|
|
9
|
+
* 2. the menu mounts into the popover container (document.body by default),
|
|
10
|
+
* which is OUTSIDE a `useShadowDom` widget's shadow root — where the
|
|
11
|
+
* shadow-scoped `widget.css` never reached it. Injecting at mount time puts
|
|
12
|
+
* the rules in whichever root the menu actually lives in.
|
|
13
|
+
*
|
|
14
|
+
* The chip / context-row / affordance-button rules stay in `widget.css`: they
|
|
15
|
+
* render eagerly (restored-message chips, the always-visible add-context button)
|
|
16
|
+
* before this chunk loads.
|
|
17
|
+
*/
|
|
18
|
+
export const MENTION_MENU_CSS = `
|
|
19
|
+
.persona-mention-menu {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
max-height: var(--persona-mention-menu-max-height, 280px);
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
background: var(--persona-mention-menu-bg, var(--persona-surface, #ffffff));
|
|
26
|
+
border: 1px solid var(--persona-mention-menu-border, var(--persona-border, #e5e7eb));
|
|
27
|
+
border-radius: var(--persona-mention-menu-radius, 10px);
|
|
28
|
+
box-shadow: var(--persona-mention-menu-shadow, 0 8px 28px rgba(0, 0, 0, 0.12));
|
|
29
|
+
font-family: var(--persona-font-family, inherit);
|
|
30
|
+
}
|
|
31
|
+
.persona-mention-list {
|
|
32
|
+
min-height: 0;
|
|
33
|
+
overflow-y: auto;
|
|
34
|
+
padding: 4px;
|
|
35
|
+
}
|
|
36
|
+
.persona-mention-search {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 6px;
|
|
40
|
+
padding: 8px 10px;
|
|
41
|
+
border-bottom: 1px solid var(--persona-mention-menu-border, var(--persona-border, #e5e7eb));
|
|
42
|
+
}
|
|
43
|
+
.persona-mention-search-icon {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
flex: 0 0 auto;
|
|
47
|
+
color: var(--persona-mention-group-fg, var(--persona-muted, #6b7280));
|
|
48
|
+
}
|
|
49
|
+
.persona-mention-search-input {
|
|
50
|
+
flex: 1 1 auto;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
padding: 0;
|
|
53
|
+
border: none;
|
|
54
|
+
outline: none;
|
|
55
|
+
background: transparent;
|
|
56
|
+
font-family: inherit;
|
|
57
|
+
/* 16px, not 14px: iOS Safari zooms the page when focusing an input under 16px. */
|
|
58
|
+
font-size: 16px;
|
|
59
|
+
line-height: 1.4;
|
|
60
|
+
color: var(--persona-text, #111827);
|
|
61
|
+
}
|
|
62
|
+
.persona-mention-search-input::placeholder {
|
|
63
|
+
color: var(--persona-mention-group-fg, var(--persona-muted, #6b7280));
|
|
64
|
+
}
|
|
65
|
+
.persona-mention-group + .persona-mention-group {
|
|
66
|
+
margin-top: 2px;
|
|
67
|
+
border-top: 1px solid var(--persona-mention-menu-border, var(--persona-border, #f1f1f1));
|
|
68
|
+
padding-top: 2px;
|
|
69
|
+
}
|
|
70
|
+
.persona-mention-group-header {
|
|
71
|
+
padding: 6px 8px 4px;
|
|
72
|
+
font-size: 11px;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
text-transform: uppercase;
|
|
75
|
+
letter-spacing: 0.04em;
|
|
76
|
+
color: var(--persona-mention-group-fg, var(--persona-muted, #6b7280));
|
|
77
|
+
}
|
|
78
|
+
.persona-mention-option {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: 8px;
|
|
82
|
+
padding: 7px 8px;
|
|
83
|
+
border-radius: 6px;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
color: var(--persona-text, #111827);
|
|
86
|
+
}
|
|
87
|
+
.persona-mention-option[data-active="true"] {
|
|
88
|
+
background: var(--persona-mention-option-active-bg, var(--persona-container, #f1f5f9));
|
|
89
|
+
}
|
|
90
|
+
.persona-mention-option-icon {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
flex: 0 0 auto;
|
|
94
|
+
opacity: 0.7;
|
|
95
|
+
}
|
|
96
|
+
.persona-mention-option-text {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
min-width: 0;
|
|
100
|
+
}
|
|
101
|
+
.persona-mention-option-labelline {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: baseline;
|
|
104
|
+
gap: 6px;
|
|
105
|
+
min-width: 0;
|
|
106
|
+
}
|
|
107
|
+
.persona-mention-option-label {
|
|
108
|
+
font-size: 13px;
|
|
109
|
+
line-height: 1.3;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
text-overflow: ellipsis;
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
}
|
|
114
|
+
.persona-mention-option-arghint {
|
|
115
|
+
flex: 0 0 auto;
|
|
116
|
+
font-size: 12px;
|
|
117
|
+
line-height: 1.3;
|
|
118
|
+
color: var(--persona-muted, #6b7280);
|
|
119
|
+
opacity: 0.85;
|
|
120
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
121
|
+
}
|
|
122
|
+
.persona-mention-option-desc {
|
|
123
|
+
font-size: 11px;
|
|
124
|
+
line-height: 1.3;
|
|
125
|
+
color: var(--persona-muted, #6b7280);
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
}
|
|
130
|
+
.persona-mention-status,
|
|
131
|
+
.persona-mention-empty,
|
|
132
|
+
.persona-mention-hint {
|
|
133
|
+
padding: 7px 8px;
|
|
134
|
+
font-size: 12px;
|
|
135
|
+
color: var(--persona-muted, #6b7280);
|
|
136
|
+
}
|
|
137
|
+
.persona-mention-error {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: space-between;
|
|
141
|
+
gap: 8px;
|
|
142
|
+
color: var(--persona-mention-error, #dc2626);
|
|
143
|
+
}
|
|
144
|
+
.persona-mention-error-text {
|
|
145
|
+
min-width: 0;
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
text-overflow: ellipsis;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
}
|
|
150
|
+
.persona-mention-retry {
|
|
151
|
+
flex: 0 0 auto;
|
|
152
|
+
padding: 4px 8px;
|
|
153
|
+
border: 1px solid var(--persona-mention-error, #dc2626);
|
|
154
|
+
border-radius: 6px;
|
|
155
|
+
background: transparent;
|
|
156
|
+
color: var(--persona-mention-error, #dc2626);
|
|
157
|
+
font: inherit;
|
|
158
|
+
font-size: 12px;
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
}
|
|
161
|
+
.persona-mention-retry:hover {
|
|
162
|
+
background: var(--persona-palette-colors-black-alpha-50, rgba(0, 0, 0, 0.06));
|
|
163
|
+
}
|
|
164
|
+
.persona-mention-hint {
|
|
165
|
+
font-style: italic;
|
|
166
|
+
opacity: 0.8;
|
|
167
|
+
}
|
|
168
|
+
@media (pointer: coarse) {
|
|
169
|
+
.persona-mention-option {
|
|
170
|
+
min-height: 44px;
|
|
171
|
+
}
|
|
172
|
+
.persona-mention-retry {
|
|
173
|
+
min-height: 36px;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
`;
|