@askrjs/askr 0.2.4 → 0.3.1
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/CHANGELOG.md +30 -0
- package/dist/access-CEA2pOry.js +1046 -0
- package/dist/actions/index.d.ts +16 -2
- package/dist/actions/index.js +5 -5
- package/dist/{activity-FirwPXA_.js → activity-oy2YFTFF.js} +10 -16
- package/dist/benchmark.js +8 -9
- package/dist/boot/index.d.ts +19 -9
- package/dist/boot/index.js +1 -1
- package/dist/{boot-tWyF6121.js → boot-DLplW9h4.js} +700 -441
- package/dist/capabilities-Bbf0mlp9.js +42 -0
- package/dist/components/index.d.ts +11 -8
- package/dist/components/index.js +1 -1
- package/dist/{compose-ref-Bfaf4kUC.js → compose-ref-v0qGlHoN.js} +7 -1
- package/dist/control/index.d.ts +20 -2
- package/dist/control/index.js +1 -1
- package/dist/{control-C-wSaq9V.js → control-BR_mrX__.js} +4 -4
- package/dist/core.d.ts +163 -0
- package/dist/csp-nonce-BfFWcd0w.js +173 -0
- package/dist/data/index.d.ts +74 -2
- package/dist/data/index.js +3 -3
- package/dist/{data-ghKopAbp.js → data-2edW0jhF.js} +108 -122
- package/dist/{data-runtime-7t_Y0iv3.js → data-runtime-CxoY98lX.js} +22 -15
- package/dist/{deferred-CxjWCkIn.js → deferred-CbgNhf67.js} +5 -5
- package/dist/dom-renderer.d.ts +77 -0
- package/dist/domains/actions.d.ts +70 -0
- package/dist/domains/component.d.ts +119 -0
- package/dist/domains/context.d.ts +73 -0
- package/dist/domains/control.d.ts +328 -0
- package/dist/domains/data.d.ts +461 -0
- package/dist/domains/diagnostics.d.ts +21 -0
- package/dist/domains/lifecycle.d.ts +112 -0
- package/dist/domains/refs.d.ts +18 -0
- package/dist/domains/renderer.d.ts +127 -0
- package/dist/domains/routing.d.ts +501 -0
- package/dist/domains/scheduler.d.ts +79 -0
- package/dist/domains/server.d.ts +112 -0
- package/dist/domains/state.d.ts +129 -0
- package/dist/domains/telemetry.d.ts +29 -0
- package/dist/eager-control.d.ts +8 -0
- package/dist/{effect-CNwstBBD.js → effect-C3Zsc1k6.js} +14 -41
- package/dist/{types-DWVrKn9N.d.ts → elements.d.ts} +79 -42
- package/dist/{for-internal-DyBHfKJA.js → for-state-BDykeOJL.js} +598 -494
- package/dist/foundations/icon/index.d.ts +67 -16
- package/dist/foundations/icon/index.js +1 -1
- package/dist/foundations/index.d.ts +26 -3
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/index.d.ts +73 -34
- package/dist/foundations/interactions/index.js +1 -1
- package/dist/foundations/state/index.d.ts +12 -5
- package/dist/foundations/state/index.js +1 -1
- package/dist/foundations/structures/index.d.ts +44 -3
- package/dist/foundations/structures/index.js +1 -1
- package/dist/foundations/utilities/index.d.ts +34 -3
- package/dist/foundations/utilities/index.js +1 -1
- package/dist/fx/index.d.ts +72 -25
- package/dist/fx/index.js +8 -8
- package/dist/index.d.ts +121 -4
- package/dist/index.js +316 -47
- package/dist/{component-internal-C4hKKQBF.js → instance-VAFYVJOa.js} +495 -283
- package/dist/{interactions-D102JxBR.js → interactions-CTeACdT_.js} +1 -1
- package/dist/jsx-dev-runtime.d.ts +51 -11
- package/dist/jsx-globals.d.ts +2 -0
- package/dist/jsx-runtime-CPJXAOBF.js +43 -0
- package/dist/jsx-runtime.d.ts +17 -3
- package/dist/jsx-runtime.js +2 -42
- package/dist/jsx.d.ts +108 -0
- package/dist/{manifest-D6rfj_jC.js → manifest-D1P3UNWV.js} +4 -9
- package/dist/{navigate-ZZu1IV0B.js → navigate-prC5V8XV.js} +125 -472
- package/dist/{navigate-F4sHgWbw.d.ts → navigation.d.ts} +8 -8
- package/dist/{readable-Di1fzSwm.js → notify-DxxuDPeY.js} +96 -34
- package/dist/{query-registry-Bua3cDyb.js → query-registry-LrYpQsDJ.js} +1 -1
- package/dist/{compose-ref-DOJHoW5X.d.ts → refs.d.ts} +11 -7
- package/dist/{ssr-Doog-AfJ.js → render-resolved-BC0W7_5b.js} +165 -558
- package/dist/{renderer-Cl23O0hV.js → renderer-CT0HeY58.js} +6825 -5692
- package/dist/{resolution-ClD-K7Lz.js → resolution-3DskUkjG.js} +189 -180
- package/dist/{resource-operation-Vz1S5h2k.js → resource-18-sFRl9.js} +98 -58
- package/dist/resources/index.d.ts +64 -12
- package/dist/resources/index.js +214 -8
- package/dist/route-activity.d.ts +21 -0
- package/dist/{route-matching-Bo6UqG-5.js → route-matching-CUzZ31gT.js} +68 -82
- package/dist/router/index.d.ts +378 -79
- package/dist/router/index.js +9 -9
- package/dist/router-internal-7nuNEHfG.js +36 -0
- package/dist/scope-Cq_iYbTR.js +403 -0
- package/dist/{selector-CsKuomw0.js → selector-BSPVkjKP.js} +26 -27
- package/dist/{shared-CYBH3F8I.js → shared-kU8yvryp.js} +3 -6
- package/dist/{snapshot-source-BB42xgwb.js → snapshot-source-An4iKajG.js} +1 -1
- package/dist/ssg/index.d.ts +51 -15
- package/dist/ssg/index.js +269 -209
- package/dist/ssr/index.d.ts +121 -68
- package/dist/ssr/index.js +2 -1
- package/dist/ssr-CiNm6Vzl.js +393 -0
- package/dist/{ssr-DSHd_Q9K.js → ssr-EPjwJH5R.js} +5 -1
- package/dist/{state-BGJgYSyQ.js → state-BXJfudq1.js} +10 -15
- package/dist/{structures-DFyK5AdQ.js → structures-CjEzfj4h.js} +37 -57
- package/dist/{index-CTpMmzgN.d.ts → structures.d.ts} +57 -36
- package/dist/testing/index.d.ts +123 -24
- package/dist/testing/index.js +24 -61
- package/dist/timer-C7uqnJVt.js +85 -0
- package/dist/{index-B1gu0_m0.d.ts → utilities.d.ts} +24 -13
- package/dist/{verify-hydration-BZPJ_kYa.js → verify-hydration-ikaxotf7.js} +8 -5
- package/package.json +12 -14
- package/dist/access-BucjYZcX.js +0 -509
- package/dist/activity-DooIuxQO.d.ts +0 -14
- package/dist/benchmark.d.ts +0 -26
- package/dist/cleanup-TXSsApEl.js +0 -535
- package/dist/component-cleanup-jdbgjkT1.js +0 -143
- package/dist/component-scope-4I3yEMkb.js +0 -195
- package/dist/control-Cxag1yqV.d.ts +0 -8
- package/dist/csp-nonce-9NFUb7hJ.js +0 -72
- package/dist/css-BuPaTOfe.js +0 -70
- package/dist/fastlane-BKZduiBQ.js +0 -166
- package/dist/index-Dgjbo2gU.d.ts +0 -1456
- package/dist/jsx-runtime-Cg7GqY1S.d.ts +0 -2
- package/dist/jsx-runtime-gVIaTPw0.d.ts +0 -38
- package/dist/lifecycle-batch-63aXFf2S.js +0 -253
- package/dist/lifecycle-operations-Q0k3EFnG.js +0 -287
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/foundations/icon/icon.types.d.ts
|
|
1
|
+
import { JSXElement, Props } from '../../elements.js';
|
|
2
|
+
import { Ref } from '../../refs.js';
|
|
4
3
|
/** Named icon size presets, mapped to CSS variables at render time. */
|
|
5
4
|
type IconSizeToken = 'sm' | 'md' | 'lg' | 'xl';
|
|
6
5
|
/** Camel-cased CSS style object accepted by icon `style` props. */
|
|
@@ -16,12 +15,24 @@ type IconOwnProps = {
|
|
|
16
15
|
iconName?: string;
|
|
17
16
|
};
|
|
18
17
|
/** Full prop set accepted by {@link IconBase} and generated icon components. */
|
|
19
|
-
type IconProps = Omit<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
type IconProps = Omit<
|
|
19
|
+
Props,
|
|
20
|
+
| 'children'
|
|
21
|
+
| 'class'
|
|
22
|
+
| 'color'
|
|
23
|
+
| 'height'
|
|
24
|
+
| 'ref'
|
|
25
|
+
| 'role'
|
|
26
|
+
| 'stroke'
|
|
27
|
+
| 'stroke-width'
|
|
28
|
+
| 'style'
|
|
29
|
+
| 'title'
|
|
30
|
+
| 'width'
|
|
31
|
+
> &
|
|
32
|
+
IconOwnProps & {
|
|
33
|
+
children?: unknown;
|
|
34
|
+
ref?: Ref<SVGSVGElement>;
|
|
35
|
+
};
|
|
25
36
|
/** Check whether `value` is one of the named icon size tokens ('sm'|'md'|'lg'|'xl'). */
|
|
26
37
|
declare function isIconSizeToken(value: unknown): value is IconSizeToken;
|
|
27
38
|
/** Normalize a numeric icon size to a `px` string; strings pass through unchanged. */
|
|
@@ -29,13 +40,30 @@ declare function normalizeIconSizeValue(size: number | string): string;
|
|
|
29
40
|
/** Resolve a size (token or literal) to a CSS `var(--ak-icon-size-*, ...)` expression or literal value. */
|
|
30
41
|
declare function resolveIconSizeVariable(size: number | string): string;
|
|
31
42
|
/** Resolve a stroke width to a CSS `var(--ak-icon-stroke-width-*, ...)` expression, scoped to `sizeToken` when given. */
|
|
32
|
-
declare function resolveIconStrokeWidthVariable(
|
|
43
|
+
declare function resolveIconStrokeWidthVariable(
|
|
44
|
+
strokeWidth: number,
|
|
45
|
+
sizeToken: IconSizeToken | undefined
|
|
46
|
+
): string;
|
|
33
47
|
/** Serialize an inline style object (or pass through a string) to a CSS declaration string. */
|
|
34
|
-
declare function serializeIconStyle(
|
|
48
|
+
declare function serializeIconStyle(
|
|
49
|
+
style: string | IconStyleObject | undefined
|
|
50
|
+
): string;
|
|
35
51
|
/** Join non-empty CSS declaration fragments with `;`, dropping any that are blank. */
|
|
36
|
-
declare function joinIconStyle(
|
|
52
|
+
declare function joinIconStyle(
|
|
53
|
+
...styles: Array<string | undefined>
|
|
54
|
+
): string | undefined;
|
|
37
55
|
/** Compute the shared SVG attributes and inline style implementing the icon size/stroke/color contract. */
|
|
38
|
-
declare function getIconContractProps({
|
|
56
|
+
declare function getIconContractProps({
|
|
57
|
+
size,
|
|
58
|
+
strokeWidth,
|
|
59
|
+
color,
|
|
60
|
+
title,
|
|
61
|
+
style,
|
|
62
|
+
iconName,
|
|
63
|
+
}: Pick<
|
|
64
|
+
IconProps,
|
|
65
|
+
'color' | 'iconName' | 'size' | 'strokeWidth' | 'style' | 'title'
|
|
66
|
+
>): {
|
|
39
67
|
sizeToken: IconSizeToken | undefined;
|
|
40
68
|
decorative: string | undefined;
|
|
41
69
|
iconStyle: string | undefined;
|
|
@@ -57,6 +85,29 @@ declare function getIconContractProps({ size, strokeWidth, color, title, style,
|
|
|
57
85
|
};
|
|
58
86
|
};
|
|
59
87
|
/** Base `<svg>` wrapper implementing the icon contract; generated icon components render into it. */
|
|
60
|
-
declare function IconBase({
|
|
61
|
-
|
|
62
|
-
|
|
88
|
+
declare function IconBase({
|
|
89
|
+
size,
|
|
90
|
+
strokeWidth,
|
|
91
|
+
color,
|
|
92
|
+
title,
|
|
93
|
+
class: className,
|
|
94
|
+
style,
|
|
95
|
+
iconName,
|
|
96
|
+
children,
|
|
97
|
+
ref,
|
|
98
|
+
...rest
|
|
99
|
+
}: IconProps): JSXElement;
|
|
100
|
+
export {
|
|
101
|
+
IconBase,
|
|
102
|
+
type IconOwnProps,
|
|
103
|
+
type IconProps,
|
|
104
|
+
type IconSizeToken,
|
|
105
|
+
type IconStyleObject,
|
|
106
|
+
getIconContractProps,
|
|
107
|
+
isIconSizeToken,
|
|
108
|
+
joinIconStyle,
|
|
109
|
+
normalizeIconSizeValue,
|
|
110
|
+
resolveIconSizeVariable,
|
|
111
|
+
resolveIconStrokeWidthVariable,
|
|
112
|
+
serializeIconStyle,
|
|
113
|
+
};
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { JSXElement } from '../elements.js';
|
|
2
|
+
import {
|
|
3
|
+
DefaultPortal,
|
|
4
|
+
definePortal,
|
|
5
|
+
Presence,
|
|
6
|
+
SlotProps,
|
|
7
|
+
Portal,
|
|
8
|
+
Slot,
|
|
9
|
+
PresenceProps,
|
|
10
|
+
PortalProps,
|
|
11
|
+
LayoutComponent,
|
|
12
|
+
layout,
|
|
13
|
+
} from '../structures.js';
|
|
14
|
+
export {
|
|
15
|
+
DefaultPortal,
|
|
16
|
+
type JSXElement,
|
|
17
|
+
type LayoutComponent,
|
|
18
|
+
Portal,
|
|
19
|
+
type PortalProps,
|
|
20
|
+
Presence,
|
|
21
|
+
type PresenceProps,
|
|
22
|
+
Slot,
|
|
23
|
+
type SlotProps,
|
|
24
|
+
definePortal,
|
|
25
|
+
layout,
|
|
26
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as definePortal, c as layout, i as Portal, o as Presence, r as DefaultPortal, s as Slot } from "../structures-
|
|
1
|
+
import { a as definePortal, c as layout, i as Portal, o as Presence, r as DefaultPortal, s as Slot } from "../structures-CjEzfj4h.js";
|
|
2
2
|
export { DefaultPortal, Portal, Presence, Slot, definePortal, layout };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { Ref } from '../../refs.js';
|
|
2
|
+
import {
|
|
3
|
+
KeyboardLikeEvent,
|
|
4
|
+
PointerLikeEvent,
|
|
5
|
+
DefaultPreventable,
|
|
6
|
+
PropagationStoppable,
|
|
7
|
+
} from '../../utilities.js';
|
|
4
8
|
/**
|
|
5
9
|
* pressable
|
|
6
10
|
*
|
|
@@ -54,9 +58,11 @@ interface PressableResult {
|
|
|
54
58
|
'aria-disabled'?: 'true';
|
|
55
59
|
}
|
|
56
60
|
/** Produce click/keyboard props implementing 'press' semantics for an element. */
|
|
57
|
-
declare function pressable({
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
declare function pressable({
|
|
62
|
+
disabled,
|
|
63
|
+
onPress,
|
|
64
|
+
isNativeButton,
|
|
65
|
+
}: PressableOptions): PressableResult;
|
|
60
66
|
/**
|
|
61
67
|
* dismissable
|
|
62
68
|
*
|
|
@@ -124,12 +130,15 @@ interface DismissableOptions {
|
|
|
124
130
|
onDismiss?: (trigger: 'escape' | 'outside') => void;
|
|
125
131
|
}
|
|
126
132
|
/** Produce keydown/outside-click props that invoke `onDismiss` on Escape or an outside click. */
|
|
127
|
-
declare function dismissable({
|
|
133
|
+
declare function dismissable({
|
|
134
|
+
node,
|
|
135
|
+
additionalInsideNodes,
|
|
136
|
+
disabled,
|
|
137
|
+
onDismiss,
|
|
138
|
+
}: DismissableOptions): {
|
|
128
139
|
onKeyDown: (e: KeyboardLikeEvent) => void;
|
|
129
140
|
onPointerDownCapture: (e: PointerLikeEvent) => void;
|
|
130
141
|
};
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/foundations/interactions/focusable.d.ts
|
|
133
142
|
/**
|
|
134
143
|
* focusable
|
|
135
144
|
*
|
|
@@ -147,9 +156,10 @@ interface FocusableResult {
|
|
|
147
156
|
'aria-disabled'?: 'true';
|
|
148
157
|
}
|
|
149
158
|
/** Normalize `tabIndex`/`aria-disabled` props for a focusable host. */
|
|
150
|
-
declare function focusable({
|
|
151
|
-
|
|
152
|
-
|
|
159
|
+
declare function focusable({
|
|
160
|
+
disabled,
|
|
161
|
+
tabIndex,
|
|
162
|
+
}: FocusableOptions): FocusableResult;
|
|
153
163
|
/**
|
|
154
164
|
* hoverable
|
|
155
165
|
*
|
|
@@ -168,9 +178,11 @@ interface HoverableResult {
|
|
|
168
178
|
onPointerLeave?: (e: HoverEvent) => void;
|
|
169
179
|
}
|
|
170
180
|
/** Produce pointer enter/leave props that call `onEnter`/`onLeave` unless disabled. */
|
|
171
|
-
declare function hoverable({
|
|
172
|
-
|
|
173
|
-
|
|
181
|
+
declare function hoverable({
|
|
182
|
+
disabled,
|
|
183
|
+
onEnter,
|
|
184
|
+
onLeave,
|
|
185
|
+
}: HoverableOptions): HoverableResult;
|
|
174
186
|
/** Arrow-key axis for {@link rovingFocus}. */
|
|
175
187
|
type Orientation = 'horizontal' | 'vertical' | 'both';
|
|
176
188
|
/** Options for {@link rovingFocus}. */
|
|
@@ -247,8 +259,6 @@ declare function rovingFocus(options: RovingFocusOptions): RovingFocusResult;
|
|
|
247
259
|
* );
|
|
248
260
|
* }
|
|
249
261
|
*/
|
|
250
|
-
//#endregion
|
|
251
|
-
//#region src/foundations/interactions/interaction-policy.d.ts
|
|
252
262
|
/** Input to {@link applyInteractionPolicy}. */
|
|
253
263
|
interface InteractionPolicyInput {
|
|
254
264
|
/** Whether the host element is a native interactive element (button, a, etc) */
|
|
@@ -264,20 +274,27 @@ interface InteractionPolicyInput {
|
|
|
264
274
|
* THE interaction policy. Components MUST use this, NEVER implement
|
|
265
275
|
* interaction logic directly.
|
|
266
276
|
*/
|
|
267
|
-
declare function applyInteractionPolicy({
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
277
|
+
declare function applyInteractionPolicy({
|
|
278
|
+
isNative,
|
|
279
|
+
disabled,
|
|
280
|
+
onPress,
|
|
281
|
+
ref,
|
|
282
|
+
}: InteractionPolicyInput):
|
|
283
|
+
| {
|
|
284
|
+
disabled: true | undefined;
|
|
285
|
+
onClick: (e: Event) => void;
|
|
286
|
+
ref: Ref<unknown>;
|
|
287
|
+
}
|
|
288
|
+
| {
|
|
289
|
+
tabIndex: number;
|
|
290
|
+
ref: Ref<unknown>;
|
|
291
|
+
'aria-disabled'?: 'true';
|
|
292
|
+
onClick: (e: DefaultPreventable & PropagationStoppable) => void;
|
|
293
|
+
disabled?: true;
|
|
294
|
+
role?: 'button';
|
|
295
|
+
onKeyDown?: (e: KeyboardLikeEvent) => void;
|
|
296
|
+
onKeyUp?: (e: KeyboardLikeEvent) => void;
|
|
297
|
+
};
|
|
281
298
|
/**
|
|
282
299
|
* Merge rule for Slot / asChild
|
|
283
300
|
*
|
|
@@ -288,6 +305,28 @@ declare function applyInteractionPolicy({ isNative, disabled, onPress, ref }: In
|
|
|
288
305
|
* Refs are always composed.
|
|
289
306
|
* Policy props MUST take precedence to enforce invariants.
|
|
290
307
|
*/
|
|
291
|
-
declare function mergeInteractionProps(
|
|
292
|
-
|
|
293
|
-
|
|
308
|
+
declare function mergeInteractionProps(
|
|
309
|
+
childProps: Record<string, unknown>,
|
|
310
|
+
policyProps: Record<string, unknown>,
|
|
311
|
+
userProps?: Record<string, unknown>
|
|
312
|
+
): Record<string, unknown>;
|
|
313
|
+
export {
|
|
314
|
+
type DismissableOptions,
|
|
315
|
+
type FocusableOptions,
|
|
316
|
+
type FocusableResult,
|
|
317
|
+
type HoverableOptions,
|
|
318
|
+
type HoverableResult,
|
|
319
|
+
type InteractionPolicyInput,
|
|
320
|
+
type Orientation,
|
|
321
|
+
type PressableOptions,
|
|
322
|
+
type PressableResult,
|
|
323
|
+
type RovingFocusOptions,
|
|
324
|
+
type RovingFocusResult,
|
|
325
|
+
applyInteractionPolicy,
|
|
326
|
+
dismissable,
|
|
327
|
+
focusable,
|
|
328
|
+
hoverable,
|
|
329
|
+
mergeInteractionProps,
|
|
330
|
+
pressable,
|
|
331
|
+
rovingFocus,
|
|
332
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as focusable, i as hoverable, n as mergeInteractionProps, o as dismissable, r as rovingFocus, s as pressable, t as applyInteractionPolicy } from "../../interactions-
|
|
1
|
+
import { a as focusable, i as hoverable, n as mergeInteractionProps, o as dismissable, r as rovingFocus, s as pressable, t as applyInteractionPolicy } from "../../interactions-CTeACdT_.js";
|
|
2
2
|
export { applyInteractionPolicy, dismissable, focusable, hoverable, mergeInteractionProps, pressable, rovingFocus };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/foundations/state/controllable.d.ts
|
|
1
|
+
import { State } from '../../core.js';
|
|
3
2
|
/** Whether `value` represents controlled mode (not `undefined`). */
|
|
4
3
|
declare function isControlled<T>(value: T | undefined): value is T;
|
|
5
4
|
/** Resolve the effective value and controlled-ness for a controllable prop. */
|
|
6
|
-
declare function resolveControllable<T>(
|
|
5
|
+
declare function resolveControllable<T>(
|
|
6
|
+
value: T | undefined,
|
|
7
|
+
defaultValue: T
|
|
8
|
+
): {
|
|
7
9
|
value: T;
|
|
8
10
|
isControlled: boolean;
|
|
9
11
|
};
|
|
@@ -35,5 +37,10 @@ declare function controllableState<T>(options: {
|
|
|
35
37
|
defaultValue: T;
|
|
36
38
|
onChange?: (next: T) => void;
|
|
37
39
|
}): ControllableState<T>;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
export {
|
|
41
|
+
type ControllableState,
|
|
42
|
+
controllableState,
|
|
43
|
+
isControlled,
|
|
44
|
+
makeControllable,
|
|
45
|
+
resolveControllable,
|
|
46
|
+
};
|
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { JSXElement } from '../../elements.js';
|
|
2
|
+
import {
|
|
3
|
+
isElement,
|
|
4
|
+
Collection,
|
|
5
|
+
DefaultPortal,
|
|
6
|
+
definePortal,
|
|
7
|
+
Presence,
|
|
8
|
+
cloneElement,
|
|
9
|
+
SlotProps,
|
|
10
|
+
createLayer,
|
|
11
|
+
Portal,
|
|
12
|
+
Slot,
|
|
13
|
+
LayerManager,
|
|
14
|
+
CollectionItem,
|
|
15
|
+
PresenceProps,
|
|
16
|
+
LayerOptions,
|
|
17
|
+
createCollection,
|
|
18
|
+
Layer,
|
|
19
|
+
PortalProps,
|
|
20
|
+
LayoutComponent,
|
|
21
|
+
layout,
|
|
22
|
+
} from '../../structures.js';
|
|
23
|
+
export {
|
|
24
|
+
type Collection,
|
|
25
|
+
type CollectionItem,
|
|
26
|
+
DefaultPortal,
|
|
27
|
+
type JSXElement,
|
|
28
|
+
type Layer,
|
|
29
|
+
type LayerManager,
|
|
30
|
+
type LayerOptions,
|
|
31
|
+
type LayoutComponent,
|
|
32
|
+
Portal,
|
|
33
|
+
type PortalProps,
|
|
34
|
+
Presence,
|
|
35
|
+
type PresenceProps,
|
|
36
|
+
Slot,
|
|
37
|
+
type SlotProps,
|
|
38
|
+
cloneElement,
|
|
39
|
+
createCollection,
|
|
40
|
+
createLayer,
|
|
41
|
+
definePortal,
|
|
42
|
+
isElement,
|
|
43
|
+
layout,
|
|
44
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as definePortal, c as layout, i as Portal, l as cloneElement, n as createCollection, o as Presence, r as DefaultPortal, s as Slot, t as createLayer, u as isElement } from "../../structures-
|
|
1
|
+
import { a as definePortal, c as layout, i as Portal, l as cloneElement, n as createCollection, o as Presence, r as DefaultPortal, s as Slot, t as createLayer, u as isElement } from "../../structures-CjEzfj4h.js";
|
|
2
2
|
export { DefaultPortal, Portal, Presence, Slot, cloneElement, createCollection, createLayer, definePortal, isElement, layout };
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { composeRefs, setRef, Ref } from '../../refs.js';
|
|
2
|
+
import {
|
|
3
|
+
ariaSelected,
|
|
4
|
+
composeHandlers,
|
|
5
|
+
KeyboardLikeEvent,
|
|
6
|
+
PointerLikeEvent,
|
|
7
|
+
ariaExpanded,
|
|
8
|
+
DefaultPreventable,
|
|
9
|
+
formatId,
|
|
10
|
+
mergeProps,
|
|
11
|
+
PropagationStoppable,
|
|
12
|
+
ariaDisabled,
|
|
13
|
+
ComposeHandlersOptions,
|
|
14
|
+
FormatIdOptions,
|
|
15
|
+
FocusLikeEvent,
|
|
16
|
+
} from '../../utilities.js';
|
|
17
|
+
export {
|
|
18
|
+
type ComposeHandlersOptions,
|
|
19
|
+
type DefaultPreventable,
|
|
20
|
+
type FocusLikeEvent,
|
|
21
|
+
type FormatIdOptions,
|
|
22
|
+
type KeyboardLikeEvent,
|
|
23
|
+
type PointerLikeEvent,
|
|
24
|
+
type PropagationStoppable,
|
|
25
|
+
type Ref,
|
|
26
|
+
ariaDisabled,
|
|
27
|
+
ariaExpanded,
|
|
28
|
+
ariaSelected,
|
|
29
|
+
composeHandlers,
|
|
30
|
+
composeRefs,
|
|
31
|
+
formatId,
|
|
32
|
+
mergeProps,
|
|
33
|
+
setRef,
|
|
34
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as setRef, t as composeRefs } from "../../compose-ref-
|
|
1
|
+
import { n as setRef, t as composeRefs } from "../../compose-ref-v0qGlHoN.js";
|
|
2
2
|
import { a as composeHandlers, i as mergeProps, n as ariaExpanded, r as ariaSelected, t as ariaDisabled } from "../../aria-hKjThHcp.js";
|
|
3
3
|
import { t as formatId } from "../../utilities-C_CGX4Dz.js";
|
|
4
4
|
export { ariaDisabled, ariaExpanded, ariaSelected, composeHandlers, composeRefs, formatId, mergeProps, setRef };
|
package/dist/fx/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/fx/timing.d.ts
|
|
1
|
+
import { scheduleEventHandler } from '../core.js';
|
|
3
2
|
/**
|
|
4
3
|
* Timing utilities — pure helpers for common async patterns
|
|
5
4
|
* No framework coupling. No lifecycle awareness.
|
|
@@ -21,6 +20,10 @@ interface RetryOptions {
|
|
|
21
20
|
backoff?: (attemptIndex: number) => number;
|
|
22
21
|
}
|
|
23
22
|
type AnyFn = (...args: never[]) => unknown;
|
|
23
|
+
type Scheduled<T extends AnyFn> = (
|
|
24
|
+
this: ThisParameterType<T>,
|
|
25
|
+
...args: Parameters<T>
|
|
26
|
+
) => void;
|
|
24
27
|
/**
|
|
25
28
|
* Debounce — delay execution, coalesce rapid calls
|
|
26
29
|
*
|
|
@@ -38,7 +41,11 @@ type AnyFn = (...args: never[]) => unknown;
|
|
|
38
41
|
* save.cancel(); // stop any pending execution
|
|
39
42
|
* ```
|
|
40
43
|
*/
|
|
41
|
-
declare function debounce<T extends AnyFn>(
|
|
44
|
+
declare function debounce<T extends AnyFn>(
|
|
45
|
+
fn: T,
|
|
46
|
+
ms: number,
|
|
47
|
+
options?: DebounceOptions
|
|
48
|
+
): Scheduled<T> & {
|
|
42
49
|
cancel(): void;
|
|
43
50
|
};
|
|
44
51
|
/**
|
|
@@ -58,7 +65,11 @@ declare function debounce<T extends AnyFn>(fn: T, ms: number, options?: Debounce
|
|
|
58
65
|
* handleScroll.cancel();
|
|
59
66
|
* ```
|
|
60
67
|
*/
|
|
61
|
-
declare function throttle<T extends AnyFn>(
|
|
68
|
+
declare function throttle<T extends AnyFn>(
|
|
69
|
+
fn: T,
|
|
70
|
+
ms: number,
|
|
71
|
+
options?: ThrottleOptions
|
|
72
|
+
): Scheduled<T> & {
|
|
62
73
|
cancel(): void;
|
|
63
74
|
};
|
|
64
75
|
/**
|
|
@@ -107,7 +118,7 @@ declare function defer(fn: () => void): void;
|
|
|
107
118
|
* update(); // same frame, no duplicate
|
|
108
119
|
* ```
|
|
109
120
|
*/
|
|
110
|
-
declare function raf<T extends AnyFn>(fn: T): T
|
|
121
|
+
declare function raf<T extends AnyFn>(fn: T): Scheduled<T>;
|
|
111
122
|
/**
|
|
112
123
|
* Idle — schedule low-priority work
|
|
113
124
|
*
|
|
@@ -122,9 +133,12 @@ declare function raf<T extends AnyFn>(fn: T): T;
|
|
|
122
133
|
* idle(() => prefetchData());
|
|
123
134
|
* ```
|
|
124
135
|
*/
|
|
125
|
-
declare function idle(
|
|
126
|
-
|
|
127
|
-
|
|
136
|
+
declare function idle(
|
|
137
|
+
fn: () => void,
|
|
138
|
+
options?: {
|
|
139
|
+
timeout?: number;
|
|
140
|
+
}
|
|
141
|
+
): void;
|
|
128
142
|
/**
|
|
129
143
|
* Timeout — Promise-based delay
|
|
130
144
|
*
|
|
@@ -157,23 +171,32 @@ declare function timeout(ms: number): Promise<void>;
|
|
|
157
171
|
* });
|
|
158
172
|
* ```
|
|
159
173
|
*/
|
|
160
|
-
declare function retry<T>(
|
|
161
|
-
|
|
162
|
-
|
|
174
|
+
declare function retry<T>(
|
|
175
|
+
fn: () => Promise<T>,
|
|
176
|
+
options?: RetryOptions
|
|
177
|
+
): Promise<T>;
|
|
163
178
|
type CancelFn = () => void;
|
|
164
179
|
/** Wrap an event handler so rapid events are coalesced and delayed by `ms`. */
|
|
165
|
-
declare function debounceEvent(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
180
|
+
declare function debounceEvent(
|
|
181
|
+
ms: number,
|
|
182
|
+
handler: EventListener,
|
|
183
|
+
options?: {
|
|
184
|
+
leading?: boolean;
|
|
185
|
+
trailing?: boolean;
|
|
186
|
+
}
|
|
187
|
+
): EventListener & {
|
|
169
188
|
cancel(): void;
|
|
170
189
|
flush(): void;
|
|
171
190
|
};
|
|
172
191
|
/** Wrap an event handler so it runs at most once per `ms` interval. */
|
|
173
|
-
declare function throttleEvent(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
192
|
+
declare function throttleEvent(
|
|
193
|
+
ms: number,
|
|
194
|
+
handler: EventListener,
|
|
195
|
+
options?: {
|
|
196
|
+
leading?: boolean;
|
|
197
|
+
trailing?: boolean;
|
|
198
|
+
}
|
|
199
|
+
): EventListener & {
|
|
177
200
|
cancel(): void;
|
|
178
201
|
};
|
|
179
202
|
/** Wrap an event handler so it runs at most once per animation frame, using the latest event. */
|
|
@@ -183,17 +206,41 @@ declare function rafEvent(handler: EventListener): EventListener & {
|
|
|
183
206
|
/** Schedule `fn` after `ms`, auto-cancelling on component cleanup; returns a cancel function. */
|
|
184
207
|
declare function scheduleTimeout(ms: number, fn: () => void): CancelFn;
|
|
185
208
|
/** Schedule `fn` during browser idle time, auto-cancelling on component cleanup. */
|
|
186
|
-
declare function scheduleIdle(
|
|
187
|
-
|
|
188
|
-
|
|
209
|
+
declare function scheduleIdle(
|
|
210
|
+
fn: () => void,
|
|
211
|
+
options?: {
|
|
212
|
+
timeout?: number;
|
|
213
|
+
}
|
|
214
|
+
): CancelFn;
|
|
189
215
|
interface RetryOptions$1 {
|
|
190
216
|
maxAttempts?: number;
|
|
191
217
|
delayMs?: number;
|
|
192
218
|
backoff?: (attemptIndex: number) => number;
|
|
193
219
|
}
|
|
194
220
|
/** Run `fn`, retrying with backoff on failure, auto-cancelling on component cleanup. */
|
|
195
|
-
declare function scheduleRetry<T>(
|
|
221
|
+
declare function scheduleRetry<T>(
|
|
222
|
+
fn: () => Promise<T>,
|
|
223
|
+
options?: RetryOptions$1
|
|
224
|
+
): {
|
|
196
225
|
cancel(): void;
|
|
197
226
|
};
|
|
198
|
-
|
|
199
|
-
|
|
227
|
+
export {
|
|
228
|
+
type DebounceOptions,
|
|
229
|
+
type RetryOptions,
|
|
230
|
+
type ThrottleOptions,
|
|
231
|
+
debounce,
|
|
232
|
+
debounceEvent,
|
|
233
|
+
defer,
|
|
234
|
+
idle,
|
|
235
|
+
once,
|
|
236
|
+
raf,
|
|
237
|
+
rafEvent,
|
|
238
|
+
retry,
|
|
239
|
+
scheduleEventHandler,
|
|
240
|
+
scheduleIdle,
|
|
241
|
+
scheduleRetry,
|
|
242
|
+
scheduleTimeout,
|
|
243
|
+
throttle,
|
|
244
|
+
throttleEvent,
|
|
245
|
+
timeout,
|
|
246
|
+
};
|
package/dist/fx/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as getCurrentComponentInstance } from "../
|
|
1
|
+
import { h as scheduleEventHandler, n as enqueueRuntimeTask, v as logger } from "../access-CEA2pOry.js";
|
|
2
|
+
import { O as ownCleanup, f as getCurrentComponentInstance } from "../scope-Cq_iYbTR.js";
|
|
3
3
|
//#region src/fx/timing.ts
|
|
4
4
|
/**
|
|
5
5
|
* Debounce — delay execution, coalesce rapid calls
|
|
@@ -306,7 +306,7 @@ function debounceEvent(ms, handler, options) {
|
|
|
306
306
|
if (ev) enqueueUserCallback(() => handler.call(null, ev));
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
|
-
if (inst) (inst.
|
|
309
|
+
if (inst) ownCleanup(inst.owner, () => {
|
|
310
310
|
debounced.cancel();
|
|
311
311
|
});
|
|
312
312
|
return debounced;
|
|
@@ -347,7 +347,7 @@ function throttleEvent(ms, handler, options) {
|
|
|
347
347
|
}
|
|
348
348
|
lastEvent = null;
|
|
349
349
|
};
|
|
350
|
-
if (inst) (inst.
|
|
350
|
+
if (inst) ownCleanup(inst.owner, () => throttled.cancel());
|
|
351
351
|
return throttled;
|
|
352
352
|
}
|
|
353
353
|
/** Wrap an event handler so it runs at most once per animation frame, using the latest event. */
|
|
@@ -379,7 +379,7 @@ function rafEvent(handler) {
|
|
|
379
379
|
}
|
|
380
380
|
lastEvent = null;
|
|
381
381
|
};
|
|
382
|
-
if (inst) (inst.
|
|
382
|
+
if (inst) ownCleanup(inst.owner, () => fn.cancel());
|
|
383
383
|
return fn;
|
|
384
384
|
}
|
|
385
385
|
/** Schedule `fn` after `ms`, auto-cancelling on component cleanup; returns a cancel function. */
|
|
@@ -397,7 +397,7 @@ function scheduleTimeout(ms, fn) {
|
|
|
397
397
|
id = null;
|
|
398
398
|
}
|
|
399
399
|
};
|
|
400
|
-
if (inst) (inst.
|
|
400
|
+
if (inst) ownCleanup(inst.owner, cancel);
|
|
401
401
|
return cancel;
|
|
402
402
|
}
|
|
403
403
|
/** Schedule `fn` during browser idle time, auto-cancelling on component cleanup. */
|
|
@@ -424,7 +424,7 @@ function scheduleIdle(fn, options) {
|
|
|
424
424
|
id = null;
|
|
425
425
|
}
|
|
426
426
|
};
|
|
427
|
-
if (inst) (inst.
|
|
427
|
+
if (inst) ownCleanup(inst.owner, cancel);
|
|
428
428
|
return cancel;
|
|
429
429
|
}
|
|
430
430
|
/** Run `fn`, retrying with backoff on failure, auto-cancelling on component cleanup. */
|
|
@@ -455,7 +455,7 @@ function scheduleRetry(fn, options) {
|
|
|
455
455
|
const cancel = () => {
|
|
456
456
|
cancelled = true;
|
|
457
457
|
};
|
|
458
|
-
if (inst) (inst.
|
|
458
|
+
if (inst) ownCleanup(inst.owner, cancel);
|
|
459
459
|
return { cancel };
|
|
460
460
|
}
|
|
461
461
|
//#endregion
|