@runtypelabs/persona 3.18.0 → 3.20.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 +45 -2
- package/dist/index.cjs +47 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +383 -6
- package/dist/index.d.ts +383 -6
- package/dist/index.global.js +102 -1636
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +47 -47
- package/dist/index.js.map +1 -1
- package/dist/theme-editor.cjs +1514 -626
- package/dist/theme-editor.d.cts +192 -1
- package/dist/theme-editor.d.ts +192 -1
- package/dist/theme-editor.js +1628 -626
- package/dist/widget.css +348 -0
- package/package.json +1 -1
- package/src/components/composer-builder.test.ts +52 -0
- package/src/components/composer-builder.ts +67 -490
- package/src/components/composer-parts.test.ts +152 -0
- package/src/components/composer-parts.ts +452 -0
- package/src/components/header-builder.ts +22 -299
- package/src/components/header-parts.ts +360 -0
- package/src/components/panel.test.ts +61 -0
- package/src/components/panel.ts +262 -5
- package/src/components/pill-composer-builder.test.ts +85 -0
- package/src/components/pill-composer-builder.ts +183 -0
- package/src/index.ts +5 -0
- package/src/runtime/init.ts +4 -2
- package/src/runtime/persist-state.test.ts +152 -0
- package/src/session.test.ts +123 -0
- package/src/session.ts +58 -4
- package/src/styles/widget.css +348 -0
- package/src/types.ts +196 -1
- package/src/ui.component-directive.test.ts +183 -0
- package/src/ui.composer-bar.test.ts +1009 -0
- package/src/ui.ts +827 -72
- package/src/utils/attachment-manager.ts +1 -1
- package/src/utils/component-middleware.test.ts +134 -0
- package/src/utils/component-middleware.ts +44 -13
- package/src/utils/dock.test.ts +45 -0
- package/src/utils/dock.ts +3 -0
- package/src/utils/icons.ts +314 -58
- package/src/utils/stream-animation.ts +7 -2
|
@@ -275,7 +275,7 @@ export const wrapStreamAnimation = (
|
|
|
275
275
|
html: string,
|
|
276
276
|
mode: "char" | "word",
|
|
277
277
|
messageId: string,
|
|
278
|
-
options?: { skipTags?: string[] }
|
|
278
|
+
options?: { skipTags?: string[]; startIndex?: number }
|
|
279
279
|
): string => {
|
|
280
280
|
if (!html) return html;
|
|
281
281
|
if (typeof document === "undefined") return html;
|
|
@@ -294,7 +294,12 @@ export const wrapStreamAnimation = (
|
|
|
294
294
|
node = walker.nextNode();
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
|
|
297
|
+
// `startIndex` lets callers number spans by their absolute position in a
|
|
298
|
+
// larger string, even when only a slice is being wrapped. The peek banner
|
|
299
|
+
// uses this so per-char span IDs stay stable as the trailing-100-char
|
|
300
|
+
// window shifts each chunk — idiomorph then preserves animations on
|
|
301
|
+
// already-revealed chars instead of restarting them.
|
|
302
|
+
const counterRef = { value: options?.startIndex ?? 0 };
|
|
298
303
|
const wrap = mode === "char" ? wrapTextNodeChars : wrapTextNodeWords;
|
|
299
304
|
for (const textNode of textNodes) {
|
|
300
305
|
wrap(textNode, messageId, counterRef);
|