@astryxdesign/core 0.1.8-canary.3cbbe66 → 0.1.8-canary.433a57e
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/dist/Chat/useChatStreamScroll.d.ts +1 -2
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +8 -22
- package/dist/Icon/Icon.d.ts +2 -7
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Stack/stack.stylex.d.ts +9 -9
- package/dist/astryx.umd.js +11 -11
- package/dist/astryx.umd.js.map +3 -3
- package/dist/docs-types.d.ts +0 -8
- package/dist/docs-types.d.ts.map +1 -1
- package/locales/fr-FR.json +0 -4
- package/package.json +1 -1
- package/src/Carousel/Carousel.doc.mjs +0 -1
- package/src/Chat/useChatStreamScroll.test.tsx +0 -49
- package/src/Chat/useChatStreamScroll.ts +10 -27
- package/src/Icon/Icon.doc.mjs +2 -3
- package/src/Icon/Icon.tsx +2 -7
- package/src/PowerSearch/PowerSearch.doc.mjs +0 -14
- package/src/PowerSearch/PowerSearch.test.tsx +0 -20
- package/src/Tokenizer/Tokenizer.doc.mjs +0 -14
- package/src/Tokenizer/Tokenizer.test.tsx +0 -46
- package/src/docs-types.ts +0 -5
- package/src/i18n/InternationalizationProvider.doc.mjs +2 -77
|
@@ -4,8 +4,7 @@ export interface ChatScrollToBottomOptions {
|
|
|
4
4
|
* the spring animation. Use for programmatic positioning (opening a
|
|
5
5
|
* conversation, restoring a session) — keep the default `'spring'` for
|
|
6
6
|
* user-initiated scrolls like the scroll-to-bottom button. Mirrors the
|
|
7
|
-
* DOM's `scrollTo({behavior})`.
|
|
8
|
-
* `'spring'` also jumps instantly.
|
|
7
|
+
* DOM's `scrollTo({behavior})`.
|
|
9
8
|
* @default 'spring'
|
|
10
9
|
*/
|
|
11
10
|
behavior?: 'instant' | 'spring';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useChatStreamScroll.d.ts","sourceRoot":"","sources":["../../src/Chat/useChatStreamScroll.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useChatStreamScroll.d.ts","sourceRoot":"","sources":["../../src/Chat/useChatStreamScroll.ts"],"names":[],"mappings":"AAiCA,MAAM,WAAW,yBAAyB;IACxC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CACjC;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAE/C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,yBAAyB;IACxC,6DAA6D;IAC7D,YAAY,EAAE,OAAO,CAAC;IAEtB,yDAAyD;IACzD,QAAQ,EAAE,OAAO,CAAC;IAElB,yDAAyD;IACzD,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAE9D,sFAAsF;IACtF,eAAe,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,CAAC;IAE3C,6CAA6C;IAC7C,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB,0BAA0B;IAC1B,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB,oEAAoE;IACpE,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B,mDAAmD;IACnD,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACjC;AAQD,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,OAAc,EACd,aAAkB,EAClB,eAAqB,EACrB,OAAa,EACb,SAAgB,EAChB,IAAW,GACZ,EAAE,0BAA0B,GAAG,yBAAyB,CA4QxD"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useChatStreamScroll.ts
|
|
7
|
-
* @input Uses React refs, state, callbacks
|
|
7
|
+
* @input Uses React refs, state, callbacks
|
|
8
8
|
* @output Exports useChatStreamScroll hook for AI chat scroll behavior
|
|
9
9
|
* @position Utility hook — used by ChatLayout, also usable standalone
|
|
10
10
|
*
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
* - The first fill positions instantly (whether content is present at
|
|
16
16
|
* mount or arrives async); only subsequent growth springs
|
|
17
17
|
* - `scrollToBottom({behavior: 'instant'})` jumps in one frame, no animation
|
|
18
|
-
* - Under `prefers-reduced-motion`, every spring path falls back to the
|
|
19
|
-
* same instant jump — following still works, it just doesn't animate
|
|
20
18
|
*
|
|
21
19
|
* Uses scroll direction (lastScrollTop comparison) to detect user
|
|
22
20
|
* intent — works for wheel, touch, scrollbar drag, keyboard, everything.
|
|
@@ -27,7 +25,6 @@
|
|
|
27
25
|
* - /packages/core/src/Chat/index.ts (exports)
|
|
28
26
|
*/
|
|
29
27
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
30
|
-
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
31
28
|
|
|
32
29
|
// =============================================================================
|
|
33
30
|
// Types
|
|
@@ -96,6 +93,13 @@ export function useChatStreamScroll({
|
|
|
96
93
|
el.scrollTop += velocityRef.current * tickDelta;
|
|
97
94
|
requestAnimationFrame(animate);
|
|
98
95
|
}, [scrollRef, damping, stiffness, mass]);
|
|
96
|
+
const startAnimation = useCallback(() => {
|
|
97
|
+
if (!animatingRef.current && lockedRef.current) {
|
|
98
|
+
animatingRef.current = true;
|
|
99
|
+
lastTickRef.current = undefined;
|
|
100
|
+
requestAnimationFrame(animate);
|
|
101
|
+
}
|
|
102
|
+
}, [animate]);
|
|
99
103
|
|
|
100
104
|
// Jump to the bottom in a single frame — cancels any in-flight spring so
|
|
101
105
|
// a later animation tick can't fight the assignment.
|
|
@@ -110,24 +114,6 @@ export function useChatStreamScroll({
|
|
|
110
114
|
el.scrollTop = el.scrollHeight - el.clientHeight;
|
|
111
115
|
lastScrollTopRef.current = el.scrollTop;
|
|
112
116
|
}, [scrollRef]);
|
|
113
|
-
const prefersReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');
|
|
114
|
-
|
|
115
|
-
// Every spring entry point (scrollToBottom, lock, scrollIfLocked growth
|
|
116
|
-
// follow) funnels through here, so this one branch covers them all.
|
|
117
|
-
const startAnimation = useCallback(() => {
|
|
118
|
-
if (!lockedRef.current) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (prefersReducedMotion) {
|
|
122
|
-
jumpToBottom();
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (!animatingRef.current) {
|
|
126
|
-
animatingRef.current = true;
|
|
127
|
-
lastTickRef.current = undefined;
|
|
128
|
-
requestAnimationFrame(animate);
|
|
129
|
-
}
|
|
130
|
-
}, [animate, jumpToBottom, prefersReducedMotion]);
|
|
131
117
|
|
|
132
118
|
// --- Public API ---
|
|
133
119
|
|
package/dist/Icon/Icon.d.ts
CHANGED
|
@@ -155,17 +155,12 @@ export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'color'
|
|
|
155
155
|
* Don't set `label` when an interactive parent (Button, IconButton, link)
|
|
156
156
|
* already names the control — that produces a duplicate announcement.
|
|
157
157
|
*
|
|
158
|
-
* Meaningful, standalone icon: give it a label.
|
|
159
|
-
*
|
|
160
158
|
* @example
|
|
161
159
|
* ```
|
|
160
|
+
* // Meaningful, standalone icon
|
|
162
161
|
* <Icon icon="success" label="Completed" />
|
|
163
|
-
* ```
|
|
164
|
-
*
|
|
165
|
-
* Decorative icon (the default): omit label.
|
|
166
162
|
*
|
|
167
|
-
*
|
|
168
|
-
* ```
|
|
163
|
+
* // Decorative icon (default) — omit label
|
|
169
164
|
* <Icon icon="search" />
|
|
170
165
|
* ```
|
|
171
166
|
*/
|
package/dist/Icon/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAqBnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2Df,CAAC;AAEH;;;;;;;;GAQG;AACH,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;EAiBd,CAAC;AAyCH,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AACjD,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI,CACrC,QAAQ,CAAC,aAAa,CAAC,EACvB,KAAK,GAAG,OAAO,CAChB;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B;;;;OAIG;IACH,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB
|
|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GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,qBAkCX;yBAzCe,IAAI;;;AA4FpB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,QAAQ,EAChC,KAAK,CAAC,EAAE;IAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAC,GAC3C,KAAK,CAAC,SAAS,CAYjB"}
|
|
@@ -158,6 +158,15 @@ export declare function stack({ crossAlign, direction, gap, mainAlign, wrap, }:
|
|
|
158
158
|
}> | Readonly<{
|
|
159
159
|
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "8px">;
|
|
160
160
|
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "8px">;
|
|
161
|
+
}> | Readonly<{
|
|
162
|
+
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "2px">;
|
|
163
|
+
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "2px">;
|
|
164
|
+
}> | Readonly<{
|
|
165
|
+
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "4px">;
|
|
166
|
+
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "4px">;
|
|
167
|
+
}> | Readonly<{
|
|
168
|
+
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "6px">;
|
|
169
|
+
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "6px">;
|
|
161
170
|
}> | Readonly<{
|
|
162
171
|
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "12px">;
|
|
163
172
|
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "12px">;
|
|
@@ -170,15 +179,6 @@ export declare function stack({ crossAlign, direction, gap, mainAlign, wrap, }:
|
|
|
170
179
|
}> | Readonly<{
|
|
171
180
|
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "24px">;
|
|
172
181
|
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "24px">;
|
|
173
|
-
}> | Readonly<{
|
|
174
|
-
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "2px">;
|
|
175
|
-
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "2px">;
|
|
176
|
-
}> | Readonly<{
|
|
177
|
-
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "4px">;
|
|
178
|
-
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "4px">;
|
|
179
|
-
}> | Readonly<{
|
|
180
|
-
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "6px">;
|
|
181
|
-
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "6px">;
|
|
182
182
|
}> | Readonly<{
|
|
183
183
|
readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "32px">;
|
|
184
184
|
readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "32px">;
|