@foldkit/ui 0.154.0 → 0.155.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 -1
- package/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/animation/index.d.ts +5 -5
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/button/index.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +44 -44
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/combobox/multi.d.ts +47 -47
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/shared.d.ts +44 -44
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +91 -78
- package/dist/combobox/single.d.ts +50 -50
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/datePicker/index.d.ts +102 -102
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/dialog/index.d.ts +38 -18
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +66 -39
- package/dist/dialog/public.d.ts +1 -1
- package/dist/dialog/public.d.ts.map +1 -1
- package/dist/disclosure/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.d.ts +191 -191
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/fieldset/index.d.ts.map +1 -1
- package/dist/fileDrop/index.d.ts +10 -10
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/group.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.d.ts +103 -0
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -0
- package/dist/hoverIntent/hoverIntent.js +210 -0
- package/dist/hoverIntent/index.d.ts +4 -0
- package/dist/hoverIntent/index.d.ts.map +1 -0
- package/dist/hoverIntent/index.js +2 -0
- package/dist/hoverIntent/message.d.ts +42 -0
- package/dist/hoverIntent/message.d.ts.map +1 -0
- package/dist/hoverIntent/message.js +23 -0
- package/dist/hoverIntent/public.d.ts +3 -0
- package/dist/hoverIntent/public.d.ts.map +1 -0
- package/dist/hoverIntent/public.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/input/index.d.ts.map +1 -1
- package/dist/internal/optionExtensions.d.ts.map +1 -1
- package/dist/internal/selectors.d.ts.map +1 -1
- package/dist/keyboard.d.ts.map +1 -1
- package/dist/listbox/multi.d.ts +43 -43
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/shared.d.ts +38 -38
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +46 -39
- package/dist/listbox/single.d.ts +45 -45
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/menu/index.d.ts +70 -70
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +39 -32
- package/dist/nav/index.d.ts.map +1 -1
- package/dist/popover/index.d.ts +33 -33
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +36 -29
- package/dist/radioGroup/index.d.ts +6 -6
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/select/index.d.ts.map +1 -1
- package/dist/slider/index.d.ts +72 -72
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/switch/index.d.ts.map +1 -1
- package/dist/tabs/index.d.ts +6 -6
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.d.ts +18 -15
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/toast/index.d.ts +224 -224
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/schema.d.ts +16 -16
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/update.d.ts +151 -151
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/tooltip/message.d.ts +2 -2
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/tooltip.d.ts +7 -7
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +15 -11
- package/dist/typeahead.d.ts.map +1 -1
- package/dist/virtualList/index.d.ts +10 -10
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +5 -5
- package/package.json +12 -10
package/dist/fileDrop/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
17
17
|
readonly EnteredDragZone: {};
|
|
18
18
|
readonly LeftDragZone: {};
|
|
19
19
|
readonly DroppedFiles: {
|
|
20
|
-
|
|
20
|
+
files: S.NonEmptyArray<S.Schema<File>>;
|
|
21
21
|
};
|
|
22
22
|
readonly DroppedNonFiles: {};
|
|
23
23
|
}>;
|
|
@@ -26,7 +26,7 @@ export type Message = typeof Message.Type;
|
|
|
26
26
|
* path and `RejectedNonFiles` when a drop event fires without files. */
|
|
27
27
|
export declare const OutMessage: import("foldkit/message").MessageUnion<{
|
|
28
28
|
readonly ReceivedFiles: {
|
|
29
|
-
|
|
29
|
+
files: S.NonEmptyArray<S.Schema<File>>;
|
|
30
30
|
};
|
|
31
31
|
readonly RejectedNonFiles: {};
|
|
32
32
|
}>;
|
|
@@ -45,14 +45,14 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
45
45
|
readonly isDragOver: boolean;
|
|
46
46
|
};
|
|
47
47
|
commands?: Update.Commands<{
|
|
48
|
-
readonly _tag: "EnteredDragZone";
|
|
49
|
-
} | {
|
|
50
|
-
readonly _tag: "LeftDragZone";
|
|
51
|
-
} | {
|
|
52
48
|
readonly _tag: "DroppedFiles";
|
|
53
49
|
readonly files: readonly [File, ...File[]];
|
|
54
50
|
} | {
|
|
55
51
|
readonly _tag: "DroppedNonFiles";
|
|
52
|
+
} | {
|
|
53
|
+
readonly _tag: "EnteredDragZone";
|
|
54
|
+
} | {
|
|
55
|
+
readonly _tag: "LeftDragZone";
|
|
56
56
|
}, never>;
|
|
57
57
|
outMessage?: {
|
|
58
58
|
readonly _tag: "ReceivedFiles";
|
|
@@ -86,14 +86,14 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
86
86
|
readonly id: string;
|
|
87
87
|
readonly isDragOver: boolean;
|
|
88
88
|
}, {
|
|
89
|
-
readonly _tag: "EnteredDragZone";
|
|
90
|
-
} | {
|
|
91
|
-
readonly _tag: "LeftDragZone";
|
|
92
|
-
} | {
|
|
93
89
|
readonly _tag: "DroppedFiles";
|
|
94
90
|
readonly files: readonly [File, ...File[]];
|
|
95
91
|
} | {
|
|
96
92
|
readonly _tag: "DroppedNonFiles";
|
|
93
|
+
} | {
|
|
94
|
+
readonly _tag: "EnteredDragZone";
|
|
95
|
+
} | {
|
|
96
|
+
readonly _tag: "LeftDragZone";
|
|
97
97
|
}, Readonly<{
|
|
98
98
|
toView: (attributes: FileDropAttributes) => Html;
|
|
99
99
|
accept?: ReadonlyArray<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fileDrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAO9E;;;;;iEAKiE;AACjE,eAAO,MAAM,KAAK;;;EAGhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,iEAAiE;AACjE,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fileDrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO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;;YAfP,CAAC,UAAU,EAAE,kBAAkB,KAAK,IAAI;aACvC,aAAa,CAAC,MAAM,CAAC;eACnB,OAAO;iBACL,OAAO;GAkDrB,CAAA"}
|
package/dist/group.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,QAAQ,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAAA;AAE3E,qIAAqI;AACrI,eAAO,MAAM,eAAe,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,QAAQ,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,CAAA;AAE3E,qIAAqI;AACrI,eAAO,MAAM,eAAe,GAAI,CAAC,SACxB,aAAa,CAAC,CAAC,CAAC,SAChB,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,KACxC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAW1B,CAAA"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Duration, Effect, Option, Schema as S } from 'effect';
|
|
2
|
+
import * as Command from 'foldkit/command';
|
|
3
|
+
import { type ChildAttribute, type Html } from 'foldkit/html';
|
|
4
|
+
import * as Update from 'foldkit/update';
|
|
5
|
+
import { Message, OutMessage } from './message.js';
|
|
6
|
+
/** Schema for HoverIntent state. It tracks pointer and focus engagement over a trigger and its panel, visibility, delay timers, and Escape dismissal. */
|
|
7
|
+
export declare const Model: S.Struct<{
|
|
8
|
+
readonly isOpen: S.Boolean;
|
|
9
|
+
readonly isTriggerHovered: S.Boolean;
|
|
10
|
+
readonly isPanelHovered: S.Boolean;
|
|
11
|
+
readonly maybeFocusLocation: S.Option<S.Literals<readonly ["Trigger", "Panel"]>>;
|
|
12
|
+
readonly isDismissed: S.Boolean;
|
|
13
|
+
readonly openDelay: S.DurationFromMillis;
|
|
14
|
+
readonly closeDelay: S.DurationFromMillis;
|
|
15
|
+
readonly pendingOpenVersion: S.Number;
|
|
16
|
+
readonly pendingCloseVersion: S.Number;
|
|
17
|
+
}>;
|
|
18
|
+
export type Model = typeof Model.Type;
|
|
19
|
+
/** Configuration for creating a HoverIntent Model. */
|
|
20
|
+
export type InitConfig = Readonly<{
|
|
21
|
+
openDelay?: Duration.Input;
|
|
22
|
+
closeDelay?: Duration.Input;
|
|
23
|
+
}>;
|
|
24
|
+
/** Creates a HoverIntent Model. Pointer entry opens after 200 milliseconds and full disengagement closes after 300 milliseconds by default. */
|
|
25
|
+
export declare const init: (config?: InitConfig) => Model;
|
|
26
|
+
/** Waits before opening, then emits the version that scheduled the wait. */
|
|
27
|
+
export declare const WaitBeforeOpening: Command.CommandDefinitionWithArgs<"WaitBeforeOpening", {
|
|
28
|
+
delay: S.DurationFromMillis;
|
|
29
|
+
version: S.Number;
|
|
30
|
+
}, Effect.Effect<{
|
|
31
|
+
readonly _tag: "CompletedWaitBeforeOpening";
|
|
32
|
+
readonly version: number;
|
|
33
|
+
}, never, never>>;
|
|
34
|
+
/** Waits before closing, then emits the version that scheduled the wait. */
|
|
35
|
+
export declare const WaitBeforeClosing: Command.CommandDefinitionWithArgs<"WaitBeforeClosing", {
|
|
36
|
+
delay: S.DurationFromMillis;
|
|
37
|
+
version: S.Number;
|
|
38
|
+
}, Effect.Effect<{
|
|
39
|
+
readonly _tag: "CompletedWaitBeforeClosing";
|
|
40
|
+
readonly version: number;
|
|
41
|
+
}, never, never>>;
|
|
42
|
+
type UpdateReturn = Update.ReturnWithOutMessage<Model, Message, OutMessage>;
|
|
43
|
+
/** Processes a HoverIntent Message and returns the next Model, optional Commands, and an optional OutMessage. */
|
|
44
|
+
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
45
|
+
/** Render-time payload published to the consumer's `toView`.
|
|
46
|
+
*
|
|
47
|
+
* - `trigger`: event attributes for the element that starts intent.
|
|
48
|
+
* - `panel`: event attributes for the element that remains open while hovered or focused.
|
|
49
|
+
* - `isVisible`: whether the consumer should render its panel. */
|
|
50
|
+
export type RenderInfo = Readonly<{
|
|
51
|
+
trigger: ReadonlyArray<ChildAttribute>;
|
|
52
|
+
panel: ReadonlyArray<ChildAttribute>;
|
|
53
|
+
isVisible: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
/** Per-render view inputs passed to `view` via `h.submodel`'s `viewInputs` field. */
|
|
56
|
+
export type ViewInputs = Readonly<{
|
|
57
|
+
/** Selector for the trigger to focus before Escape removes panel content. If it does not resolve to a focusable element, HoverIntent leaves fallback focus behavior to the browser. */
|
|
58
|
+
focusTriggerSelector?: string;
|
|
59
|
+
toView: (render: RenderInfo) => Html;
|
|
60
|
+
}>;
|
|
61
|
+
/** Renders headless HoverIntent event bundles. It owns no markup, ARIA semantics, positioning, or styling. */
|
|
62
|
+
export declare const view: import("foldkit/submodel").View<{
|
|
63
|
+
readonly isOpen: boolean;
|
|
64
|
+
readonly isTriggerHovered: boolean;
|
|
65
|
+
readonly isPanelHovered: boolean;
|
|
66
|
+
readonly maybeFocusLocation: Option.Option<"Panel" | "Trigger">;
|
|
67
|
+
readonly isDismissed: boolean;
|
|
68
|
+
readonly openDelay: Duration.Duration;
|
|
69
|
+
readonly closeDelay: Duration.Duration;
|
|
70
|
+
readonly pendingOpenVersion: number;
|
|
71
|
+
readonly pendingCloseVersion: number;
|
|
72
|
+
}, {
|
|
73
|
+
readonly _tag: "CompletedWaitBeforeOpening";
|
|
74
|
+
readonly version: number;
|
|
75
|
+
} | {
|
|
76
|
+
readonly _tag: "CompletedWaitBeforeClosing";
|
|
77
|
+
readonly version: number;
|
|
78
|
+
} | {
|
|
79
|
+
readonly _tag: "BlurredPanel";
|
|
80
|
+
} | {
|
|
81
|
+
readonly _tag: "BlurredTrigger";
|
|
82
|
+
} | {
|
|
83
|
+
readonly _tag: "EnteredPanel";
|
|
84
|
+
} | {
|
|
85
|
+
readonly _tag: "EnteredTrigger";
|
|
86
|
+
} | {
|
|
87
|
+
readonly _tag: "FocusedPanel";
|
|
88
|
+
} | {
|
|
89
|
+
readonly _tag: "FocusedTrigger";
|
|
90
|
+
} | {
|
|
91
|
+
readonly _tag: "LeftPanel";
|
|
92
|
+
} | {
|
|
93
|
+
readonly _tag: "LeftTrigger";
|
|
94
|
+
} | {
|
|
95
|
+
readonly _tag: "PressedEscape";
|
|
96
|
+
readonly source: "Panel" | "Trigger";
|
|
97
|
+
}, Readonly<{
|
|
98
|
+
/** Selector for the trigger to focus before Escape removes panel content. If it does not resolve to a focusable element, HoverIntent leaves fallback focus behavior to the browser. */
|
|
99
|
+
focusTriggerSelector?: string;
|
|
100
|
+
toView: (render: RenderInfo) => Html;
|
|
101
|
+
}>>;
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=hoverIntent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hoverIntent.d.ts","sourceRoot":"","sources":["../../src/hoverIntent/hoverIntent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,MAAM,EAGN,MAAM,EACN,MAAM,IAAI,CAAC,EACZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,IAAI,EAAmB,MAAM,cAAc,CAAA;AAG9E,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAOlD,yJAAyJ;AACzJ,eAAO,MAAM,KAAK;;;;;;;;;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{ brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { Duration, Effect, Match as M, Number, Option, Schema as S, } from 'effect';
|
|
3
|
+
import * as Command from 'foldkit/command';
|
|
4
|
+
import { childAttributes } from 'foldkit/html';
|
|
5
|
+
import { evo } from 'foldkit/struct';
|
|
6
|
+
import { defineView } from 'foldkit/submodel';
|
|
7
|
+
import { Message, OutMessage } from './message.js';
|
|
8
|
+
// MODEL
|
|
9
|
+
const FocusLocation = S.Literals(['Trigger', 'Panel']);
|
|
10
|
+
/** Schema for HoverIntent state. It tracks pointer and focus engagement over a trigger and its panel, visibility, delay timers, and Escape dismissal. */
|
|
11
|
+
export const Model = S.Struct({
|
|
12
|
+
isOpen: S.Boolean,
|
|
13
|
+
isTriggerHovered: S.Boolean,
|
|
14
|
+
isPanelHovered: S.Boolean,
|
|
15
|
+
maybeFocusLocation: S.Option(FocusLocation),
|
|
16
|
+
isDismissed: S.Boolean,
|
|
17
|
+
openDelay: S.DurationFromMillis,
|
|
18
|
+
closeDelay: S.DurationFromMillis,
|
|
19
|
+
pendingOpenVersion: S.Number,
|
|
20
|
+
pendingCloseVersion: S.Number,
|
|
21
|
+
});
|
|
22
|
+
const DEFAULT_OPEN_DELAY = Duration.millis(200);
|
|
23
|
+
const DEFAULT_CLOSE_DELAY = Duration.millis(300);
|
|
24
|
+
/** Creates a HoverIntent Model. Pointer entry opens after 200 milliseconds and full disengagement closes after 300 milliseconds by default. */
|
|
25
|
+
export const init = (config = {}) => (__foldkitBrandViewResult(({
|
|
26
|
+
isOpen: false,
|
|
27
|
+
isTriggerHovered: false,
|
|
28
|
+
isPanelHovered: false,
|
|
29
|
+
maybeFocusLocation: Option.none(),
|
|
30
|
+
isDismissed: false,
|
|
31
|
+
openDelay: config.openDelay === undefined
|
|
32
|
+
? DEFAULT_OPEN_DELAY
|
|
33
|
+
: Duration.fromInputUnsafe(config.openDelay),
|
|
34
|
+
closeDelay: config.closeDelay === undefined
|
|
35
|
+
? DEFAULT_CLOSE_DELAY
|
|
36
|
+
: Duration.fromInputUnsafe(config.closeDelay),
|
|
37
|
+
pendingOpenVersion: 0,
|
|
38
|
+
pendingCloseVersion: 0,
|
|
39
|
+
}), "@foldkit/ui/hoverIntent/hoverIntent.js#init"));
|
|
40
|
+
// COMMAND
|
|
41
|
+
/** Waits before opening, then emits the version that scheduled the wait. */
|
|
42
|
+
export const WaitBeforeOpening = Command.define('WaitBeforeOpening', {
|
|
43
|
+
args: { delay: S.DurationFromMillis, version: S.Number },
|
|
44
|
+
messages: [Message.CompletedWaitBeforeOpening],
|
|
45
|
+
execute: ({ delay, version }) => __foldkitBrandViewResult((Effect.sleep(delay).pipe(Effect.as(Message.CompletedWaitBeforeOpening({ version })))), "@foldkit/ui/hoverIntent/hoverIntent.js#execute"),
|
|
46
|
+
});
|
|
47
|
+
/** Waits before closing, then emits the version that scheduled the wait. */
|
|
48
|
+
export const WaitBeforeClosing = Command.define('WaitBeforeClosing', {
|
|
49
|
+
args: { delay: S.DurationFromMillis, version: S.Number },
|
|
50
|
+
messages: [Message.CompletedWaitBeforeClosing],
|
|
51
|
+
execute: ({ delay, version }) => __foldkitBrandViewResult((Effect.sleep(delay).pipe(Effect.as(Message.CompletedWaitBeforeClosing({ version })))), "@foldkit/ui/hoverIntent/hoverIntent.js#execute~2"),
|
|
52
|
+
});
|
|
53
|
+
const isPointerOver = (model) => __foldkitBrandViewResult((model.isTriggerHovered || model.isPanelHovered), "@foldkit/ui/hoverIntent/hoverIntent.js#isPointerOver");
|
|
54
|
+
const isEngaged = (model) => __foldkitBrandViewResult((isPointerOver(model) || Option.isSome(model.maybeFocusLocation)), "@foldkit/ui/hoverIntent/hoverIntent.js#isEngaged");
|
|
55
|
+
const open = (model) => {
|
|
56
|
+
if (model.isOpen) {
|
|
57
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/hoverIntent/hoverIntent.js#open");
|
|
58
|
+
}
|
|
59
|
+
return __foldkitBrandViewResult(({
|
|
60
|
+
model: evo(model, { isOpen: () => __foldkitBrandViewResult((true), "@foldkit/ui/hoverIntent/hoverIntent.js#isOpen") }),
|
|
61
|
+
outMessage: OutMessage.Opened(),
|
|
62
|
+
}), "@foldkit/ui/hoverIntent/hoverIntent.js#open");
|
|
63
|
+
};
|
|
64
|
+
const close = (model) => {
|
|
65
|
+
if (!model.isOpen) {
|
|
66
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/hoverIntent/hoverIntent.js#close");
|
|
67
|
+
}
|
|
68
|
+
return __foldkitBrandViewResult(({
|
|
69
|
+
model: evo(model, { isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/hoverIntent/hoverIntent.js#isOpen~2") }),
|
|
70
|
+
outMessage: OutMessage.Closed(),
|
|
71
|
+
}), "@foldkit/ui/hoverIntent/hoverIntent.js#close");
|
|
72
|
+
};
|
|
73
|
+
const scheduleOpen = (model) => {
|
|
74
|
+
const version = Number.increment(model.pendingOpenVersion);
|
|
75
|
+
return __foldkitBrandViewResult(({
|
|
76
|
+
model: evo(model, { pendingOpenVersion: () => __foldkitBrandViewResult((version), "@foldkit/ui/hoverIntent/hoverIntent.js#pendingOpenVersion") }),
|
|
77
|
+
commands: [WaitBeforeOpening({ delay: model.openDelay, version })],
|
|
78
|
+
}), "@foldkit/ui/hoverIntent/hoverIntent.js#scheduleOpen");
|
|
79
|
+
};
|
|
80
|
+
const scheduleClose = (model) => {
|
|
81
|
+
const version = Number.increment(model.pendingCloseVersion);
|
|
82
|
+
return __foldkitBrandViewResult(({
|
|
83
|
+
model: evo(model, { pendingCloseVersion: () => __foldkitBrandViewResult((version), "@foldkit/ui/hoverIntent/hoverIntent.js#pendingCloseVersion") }),
|
|
84
|
+
commands: [WaitBeforeClosing({ delay: model.closeDelay, version })],
|
|
85
|
+
}), "@foldkit/ui/hoverIntent/hoverIntent.js#scheduleClose");
|
|
86
|
+
};
|
|
87
|
+
const entered = (model) => {
|
|
88
|
+
const enteredModel = evo(model, {
|
|
89
|
+
pendingCloseVersion: Number.increment,
|
|
90
|
+
});
|
|
91
|
+
if (enteredModel.isOpen || enteredModel.isDismissed) {
|
|
92
|
+
return __foldkitBrandViewResult(({ model: enteredModel }), "@foldkit/ui/hoverIntent/hoverIntent.js#entered");
|
|
93
|
+
}
|
|
94
|
+
return __foldkitBrandViewResult((scheduleOpen(enteredModel)), "@foldkit/ui/hoverIntent/hoverIntent.js#entered");
|
|
95
|
+
};
|
|
96
|
+
const left = (model) => {
|
|
97
|
+
const leftModel = evo(model, {
|
|
98
|
+
pendingOpenVersion: Number.increment,
|
|
99
|
+
});
|
|
100
|
+
if (isEngaged(leftModel)) {
|
|
101
|
+
return __foldkitBrandViewResult(({ model: leftModel }), "@foldkit/ui/hoverIntent/hoverIntent.js#left");
|
|
102
|
+
}
|
|
103
|
+
if (leftModel.isDismissed) {
|
|
104
|
+
return __foldkitBrandViewResult(({ model: evo(leftModel, { isDismissed: () => __foldkitBrandViewResult((false), "@foldkit/ui/hoverIntent/hoverIntent.js#isDismissed") }) }), "@foldkit/ui/hoverIntent/hoverIntent.js#left");
|
|
105
|
+
}
|
|
106
|
+
if (!leftModel.isOpen) {
|
|
107
|
+
return __foldkitBrandViewResult(({ model: leftModel }), "@foldkit/ui/hoverIntent/hoverIntent.js#left");
|
|
108
|
+
}
|
|
109
|
+
return __foldkitBrandViewResult((scheduleClose(leftModel)), "@foldkit/ui/hoverIntent/hoverIntent.js#left");
|
|
110
|
+
};
|
|
111
|
+
const focused = (model, focusLocation) => {
|
|
112
|
+
const focusedModel = evo(model, {
|
|
113
|
+
maybeFocusLocation: () => __foldkitBrandViewResult((Option.some(focusLocation)), "@foldkit/ui/hoverIntent/hoverIntent.js#maybeFocusLocation"),
|
|
114
|
+
pendingOpenVersion: Number.increment,
|
|
115
|
+
pendingCloseVersion: Number.increment,
|
|
116
|
+
});
|
|
117
|
+
if (focusedModel.isDismissed) {
|
|
118
|
+
return __foldkitBrandViewResult(({ model: focusedModel }), "@foldkit/ui/hoverIntent/hoverIntent.js#focused");
|
|
119
|
+
}
|
|
120
|
+
return __foldkitBrandViewResult((open(focusedModel)), "@foldkit/ui/hoverIntent/hoverIntent.js#focused");
|
|
121
|
+
};
|
|
122
|
+
const blurred = (model) => {
|
|
123
|
+
const blurredModel = evo(model, {
|
|
124
|
+
maybeFocusLocation: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/hoverIntent/hoverIntent.js#maybeFocusLocation~2"),
|
|
125
|
+
pendingOpenVersion: Number.increment,
|
|
126
|
+
});
|
|
127
|
+
if (isEngaged(blurredModel)) {
|
|
128
|
+
return __foldkitBrandViewResult(({ model: blurredModel }), "@foldkit/ui/hoverIntent/hoverIntent.js#blurred");
|
|
129
|
+
}
|
|
130
|
+
if (blurredModel.isDismissed) {
|
|
131
|
+
return __foldkitBrandViewResult(({ model: evo(blurredModel, { isDismissed: () => __foldkitBrandViewResult((false), "@foldkit/ui/hoverIntent/hoverIntent.js#isDismissed~2") }) }), "@foldkit/ui/hoverIntent/hoverIntent.js#blurred");
|
|
132
|
+
}
|
|
133
|
+
if (!blurredModel.isOpen) {
|
|
134
|
+
return __foldkitBrandViewResult(({ model: blurredModel }), "@foldkit/ui/hoverIntent/hoverIntent.js#blurred");
|
|
135
|
+
}
|
|
136
|
+
return __foldkitBrandViewResult((scheduleClose(blurredModel)), "@foldkit/ui/hoverIntent/hoverIntent.js#blurred");
|
|
137
|
+
};
|
|
138
|
+
/** Processes a HoverIntent Message and returns the next Model, optional Commands, and an optional OutMessage. */
|
|
139
|
+
export const update = (model, message) => __foldkitBrandViewResult((Message.match(message, {
|
|
140
|
+
EnteredTrigger: () => __foldkitBrandViewResult((entered(evo(model, { isTriggerHovered: () => __foldkitBrandViewResult((true), "@foldkit/ui/hoverIntent/hoverIntent.js#isTriggerHovered") }))), "@foldkit/ui/hoverIntent/hoverIntent.js#EnteredTrigger"),
|
|
141
|
+
LeftTrigger: () => __foldkitBrandViewResult((left(evo(model, { isTriggerHovered: () => __foldkitBrandViewResult((false), "@foldkit/ui/hoverIntent/hoverIntent.js#isTriggerHovered~2") }))), "@foldkit/ui/hoverIntent/hoverIntent.js#LeftTrigger"),
|
|
142
|
+
EnteredPanel: () => __foldkitBrandViewResult((entered(evo(model, { isPanelHovered: () => __foldkitBrandViewResult((true), "@foldkit/ui/hoverIntent/hoverIntent.js#isPanelHovered") }))), "@foldkit/ui/hoverIntent/hoverIntent.js#EnteredPanel"),
|
|
143
|
+
LeftPanel: () => __foldkitBrandViewResult((left(evo(model, { isPanelHovered: () => __foldkitBrandViewResult((false), "@foldkit/ui/hoverIntent/hoverIntent.js#isPanelHovered~2") }))), "@foldkit/ui/hoverIntent/hoverIntent.js#LeftPanel"),
|
|
144
|
+
FocusedTrigger: () => __foldkitBrandViewResult((focused(model, 'Trigger')), "@foldkit/ui/hoverIntent/hoverIntent.js#FocusedTrigger"),
|
|
145
|
+
BlurredTrigger: () => __foldkitBrandViewResult((blurred(model)), "@foldkit/ui/hoverIntent/hoverIntent.js#BlurredTrigger"),
|
|
146
|
+
FocusedPanel: () => __foldkitBrandViewResult((focused(model, 'Panel')), "@foldkit/ui/hoverIntent/hoverIntent.js#FocusedPanel"),
|
|
147
|
+
BlurredPanel: () => __foldkitBrandViewResult((blurred(model)), "@foldkit/ui/hoverIntent/hoverIntent.js#BlurredPanel"),
|
|
148
|
+
PressedEscape: ({ source }) => {
|
|
149
|
+
const isTriggerFocused = source === 'Trigger' ||
|
|
150
|
+
Option.exists(model.maybeFocusLocation, focusLocation => __foldkitBrandViewResult((focusLocation === 'Trigger'), "@foldkit/ui/hoverIntent/hoverIntent.js#anonymous"));
|
|
151
|
+
const maybeFocusLocation = isTriggerFocused
|
|
152
|
+
? Option.some('Trigger')
|
|
153
|
+
: Option.none();
|
|
154
|
+
const isDismissed = model.isTriggerHovered || isTriggerFocused;
|
|
155
|
+
const dismissedModel = evo(model, {
|
|
156
|
+
isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/hoverIntent/hoverIntent.js#isOpen~3"),
|
|
157
|
+
isPanelHovered: () => __foldkitBrandViewResult((false), "@foldkit/ui/hoverIntent/hoverIntent.js#isPanelHovered~3"),
|
|
158
|
+
maybeFocusLocation: () => __foldkitBrandViewResult((maybeFocusLocation), "@foldkit/ui/hoverIntent/hoverIntent.js#maybeFocusLocation~3"),
|
|
159
|
+
isDismissed: () => __foldkitBrandViewResult((isDismissed), "@foldkit/ui/hoverIntent/hoverIntent.js#isDismissed~3"),
|
|
160
|
+
pendingOpenVersion: Number.increment,
|
|
161
|
+
pendingCloseVersion: Number.increment,
|
|
162
|
+
});
|
|
163
|
+
if (model.isOpen) {
|
|
164
|
+
return __foldkitBrandViewResult(({ model: dismissedModel, outMessage: OutMessage.Closed() }), "@foldkit/ui/hoverIntent/hoverIntent.js#PressedEscape");
|
|
165
|
+
}
|
|
166
|
+
return __foldkitBrandViewResult(({ model: dismissedModel }), "@foldkit/ui/hoverIntent/hoverIntent.js#PressedEscape");
|
|
167
|
+
},
|
|
168
|
+
CompletedWaitBeforeOpening: ({ version }) => {
|
|
169
|
+
if (version !== model.pendingOpenVersion) {
|
|
170
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/hoverIntent/hoverIntent.js#CompletedWaitBeforeOpening");
|
|
171
|
+
}
|
|
172
|
+
if (model.isDismissed || !isEngaged(model)) {
|
|
173
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/hoverIntent/hoverIntent.js#CompletedWaitBeforeOpening");
|
|
174
|
+
}
|
|
175
|
+
return __foldkitBrandViewResult((open(model)), "@foldkit/ui/hoverIntent/hoverIntent.js#CompletedWaitBeforeOpening");
|
|
176
|
+
},
|
|
177
|
+
CompletedWaitBeforeClosing: ({ version }) => {
|
|
178
|
+
if (version !== model.pendingCloseVersion || isEngaged(model)) {
|
|
179
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/hoverIntent/hoverIntent.js#CompletedWaitBeforeClosing");
|
|
180
|
+
}
|
|
181
|
+
return __foldkitBrandViewResult((close(model)), "@foldkit/ui/hoverIntent/hoverIntent.js#CompletedWaitBeforeClosing");
|
|
182
|
+
},
|
|
183
|
+
})), "@foldkit/ui/hoverIntent/hoverIntent.js#update");
|
|
184
|
+
/** Renders headless HoverIntent event bundles. It owns no markup, ARIA semantics, positioning, or styling. */
|
|
185
|
+
export const view = defineView((model, { focusTriggerSelector, toView }, h) => {
|
|
186
|
+
const toPressedEscape = (source) => __foldkitBrandViewResult(((key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some(Message.PressedEscape({ source }))), "@foldkit/ui/hoverIntent/hoverIntent.js#anonymous~4")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/hoverIntent/hoverIntent.js#anonymous~5")))), "@foldkit/ui/hoverIntent/hoverIntent.js#anonymous~3")), "@foldkit/ui/hoverIntent/hoverIntent.js#toPressedEscape");
|
|
187
|
+
const panelEscapeHandler = focusTriggerSelector === undefined
|
|
188
|
+
? h.OnKeyDownPreventDefault(toPressedEscape('Panel'))
|
|
189
|
+
: h.OnKeyDownFocus(key => __foldkitBrandViewResult((M.value(key).pipe(M.when('Escape', () => __foldkitBrandViewResult((Option.some({
|
|
190
|
+
focusSelector: focusTriggerSelector,
|
|
191
|
+
message: Message.PressedEscape({ source: 'Panel' }),
|
|
192
|
+
})), "@foldkit/ui/hoverIntent/hoverIntent.js#anonymous~7")), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/hoverIntent/hoverIntent.js#anonymous~8")))), "@foldkit/ui/hoverIntent/hoverIntent.js#anonymous~6"));
|
|
193
|
+
return __foldkitBrandViewResult((toView({
|
|
194
|
+
trigger: childAttributes([
|
|
195
|
+
h.OnMouseEnter(Message.EnteredTrigger()),
|
|
196
|
+
h.OnMouseLeave(Message.LeftTrigger()),
|
|
197
|
+
h.OnFocus(Message.FocusedTrigger()),
|
|
198
|
+
h.OnBlur(Message.BlurredTrigger()),
|
|
199
|
+
h.OnKeyDownPreventDefault(toPressedEscape('Trigger')),
|
|
200
|
+
]),
|
|
201
|
+
panel: childAttributes([
|
|
202
|
+
h.OnMouseEnter(Message.EnteredPanel()),
|
|
203
|
+
h.OnMouseLeave(Message.LeftPanel()),
|
|
204
|
+
h.OnFocusEnter(Message.FocusedPanel()),
|
|
205
|
+
h.OnFocusLeave(Message.BlurredPanel()),
|
|
206
|
+
panelEscapeHandler,
|
|
207
|
+
]),
|
|
208
|
+
isVisible: model.isOpen,
|
|
209
|
+
})), "@foldkit/ui/hoverIntent/hoverIntent.js#anonymous~2");
|
|
210
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Message, OutMessage } from './message.js';
|
|
2
|
+
export type { BlurredPanel, BlurredTrigger, Closed, CompletedWaitBeforeClosing, CompletedWaitBeforeOpening, EnteredPanel, EnteredTrigger, FocusedPanel, FocusedTrigger, LeftPanel, LeftTrigger, Opened, PressedEscape, } from './message.js';
|
|
3
|
+
export * from './hoverIntent.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hoverIntent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAClD,YAAY,EACV,YAAY,EACZ,cAAc,EACd,MAAM,EACN,0BAA0B,EAC1B,0BAA0B,EAC1B,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,cAAc,EACd,SAAS,EACT,WAAW,EACX,MAAM,EACN,aAAa,GACd,MAAM,cAAc,CAAA;AACrB,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Schema as S } from 'effect';
|
|
2
|
+
/** Union of all Messages the HoverIntent component can produce. */
|
|
3
|
+
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
4
|
+
readonly EnteredTrigger: {};
|
|
5
|
+
readonly LeftTrigger: {};
|
|
6
|
+
readonly EnteredPanel: {};
|
|
7
|
+
readonly LeftPanel: {};
|
|
8
|
+
readonly FocusedTrigger: {};
|
|
9
|
+
readonly BlurredTrigger: {};
|
|
10
|
+
readonly FocusedPanel: {};
|
|
11
|
+
readonly BlurredPanel: {};
|
|
12
|
+
readonly PressedEscape: {
|
|
13
|
+
source: S.Literals<readonly ["Trigger", "Panel"]>;
|
|
14
|
+
};
|
|
15
|
+
readonly CompletedWaitBeforeOpening: {
|
|
16
|
+
version: S.Number;
|
|
17
|
+
};
|
|
18
|
+
readonly CompletedWaitBeforeClosing: {
|
|
19
|
+
version: S.Number;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
export type Message = typeof Message.Type;
|
|
23
|
+
export type EnteredTrigger = typeof Message.EnteredTrigger.Type;
|
|
24
|
+
export type LeftTrigger = typeof Message.LeftTrigger.Type;
|
|
25
|
+
export type EnteredPanel = typeof Message.EnteredPanel.Type;
|
|
26
|
+
export type LeftPanel = typeof Message.LeftPanel.Type;
|
|
27
|
+
export type FocusedTrigger = typeof Message.FocusedTrigger.Type;
|
|
28
|
+
export type BlurredTrigger = typeof Message.BlurredTrigger.Type;
|
|
29
|
+
export type FocusedPanel = typeof Message.FocusedPanel.Type;
|
|
30
|
+
export type BlurredPanel = typeof Message.BlurredPanel.Type;
|
|
31
|
+
export type PressedEscape = typeof Message.PressedEscape.Type;
|
|
32
|
+
export type CompletedWaitBeforeOpening = typeof Message.CompletedWaitBeforeOpening.Type;
|
|
33
|
+
export type CompletedWaitBeforeClosing = typeof Message.CompletedWaitBeforeClosing.Type;
|
|
34
|
+
/** Union of visibility-transition OutMessages emitted by HoverIntent. */
|
|
35
|
+
export declare const OutMessage: import("foldkit/message").MessageUnion<{
|
|
36
|
+
readonly Opened: {};
|
|
37
|
+
readonly Closed: {};
|
|
38
|
+
}>;
|
|
39
|
+
export type OutMessage = typeof OutMessage.Type;
|
|
40
|
+
export type Opened = typeof OutMessage.Opened.Type;
|
|
41
|
+
export type Closed = typeof OutMessage.Closed.Type;
|
|
42
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/hoverIntent/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAKpC,mEAAmE;AACnE,eAAO,MAAM,OAAO;;;;;;;;;;QASD,MAAM;;;QACO,OAAO;;;QACP,OAAO;;EACrC,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,WAAW,GAAG,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAA;AACzD,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAA;AAC3D,MAAM,MAAM,SAAS,GAAG,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,CAAA;AACrD,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,cAAc,CAAC,IAAI,CAAA;AAC/D,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAA;AAC3D,MAAM,MAAM,YAAY,GAAG,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAAA;AAC3D,MAAM,MAAM,aAAa,GAAG,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,CAAA;AAC7D,MAAM,MAAM,0BAA0B,GACpC,OAAO,OAAO,CAAC,0BAA0B,CAAC,IAAI,CAAA;AAChD,MAAM,MAAM,0BAA0B,GACpC,OAAO,OAAO,CAAC,0BAA0B,CAAC,IAAI,CAAA;AAIhD,yEAAyE;AACzE,eAAO,MAAM,UAAU;;;EAGrB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAE/C,MAAM,MAAM,MAAM,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA;AAClD,MAAM,MAAM,MAAM,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Schema as S } from 'effect';
|
|
2
|
+
import { defineMessageUnion } from 'foldkit/message';
|
|
3
|
+
// MESSAGE
|
|
4
|
+
/** Union of all Messages the HoverIntent component can produce. */
|
|
5
|
+
export const Message = defineMessageUnion({
|
|
6
|
+
EnteredTrigger: {},
|
|
7
|
+
LeftTrigger: {},
|
|
8
|
+
EnteredPanel: {},
|
|
9
|
+
LeftPanel: {},
|
|
10
|
+
FocusedTrigger: {},
|
|
11
|
+
BlurredTrigger: {},
|
|
12
|
+
FocusedPanel: {},
|
|
13
|
+
BlurredPanel: {},
|
|
14
|
+
PressedEscape: { source: S.Literals(['Trigger', 'Panel']) },
|
|
15
|
+
CompletedWaitBeforeOpening: { version: S.Number },
|
|
16
|
+
CompletedWaitBeforeClosing: { version: S.Number },
|
|
17
|
+
});
|
|
18
|
+
// OUT MESSAGE
|
|
19
|
+
/** Union of visibility-transition OutMessages emitted by HoverIntent. */
|
|
20
|
+
export const OutMessage = defineMessageUnion({
|
|
21
|
+
Opened: {},
|
|
22
|
+
Closed: {},
|
|
23
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { init, update, view, Model, Message, OutMessage, type BlurredPanel, type BlurredTrigger, type Closed, type CompletedWaitBeforeClosing, type CompletedWaitBeforeOpening, type EnteredPanel, type EnteredTrigger, type FocusedPanel, type FocusedTrigger, type LeftPanel, type LeftTrigger, type Opened, type PressedEscape, WaitBeforeClosing, WaitBeforeOpening, } from './index.js';
|
|
2
|
+
export type { InitConfig, RenderInfo, ViewInputs } from './index.js';
|
|
3
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/hoverIntent/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,OAAO,EACP,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { init, update, view, Model, Message, OutMessage, WaitBeforeClosing, WaitBeforeOpening, } from './index.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * as DragAndDrop from './dragAndDrop/public.js';
|
|
|
10
10
|
export * as Disclosure from './disclosure/public.js';
|
|
11
11
|
export * as Fieldset from './fieldset/public.js';
|
|
12
12
|
export * as FileDrop from './fileDrop/public.js';
|
|
13
|
+
export * as HoverIntent from './hoverIntent/public.js';
|
|
13
14
|
export * as Input from './input/public.js';
|
|
14
15
|
export * as Listbox from './listbox/public.js';
|
|
15
16
|
export * as Menu from './menu/public.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAA;AAC5C,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK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osure from './disclosure/public.js';
|
|
11
11
|
export * as Fieldset from './fieldset/public.js';
|
|
12
12
|
export * as FileDrop from './fileDrop/public.js';
|
|
13
|
+
export * as HoverIntent from './hoverIntent/public.js';
|
|
13
14
|
export * as Input from './input/public.js';
|
|
14
15
|
export * as Listbox from './listbox/public.js';
|
|
15
16
|
export * as Menu from './menu/public.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/input/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAIhE,yFAAyF;AACzF,MAAM,MAAM,eAAe,CAAC,OAAO,IAAI,QAAQ,CAAC;IAC9C,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACxC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACxC,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC/C,CAAC,CAAA;AAEF,wDAAwD;AACxD,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC,CAA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AA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optionExtensions.d.ts","sourceRoot":"","sources":["../../src/internal/optionExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEzC,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACvD,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"optionExtensions.d.ts","sourceRoot":"","sources":["../../src/internal/optionExtensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEzC,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACvD,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;CAGpD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/internal/selectors.ts"],"names":[],"mappings":"AAsDA;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/internal/selectors.ts"],"names":[],"mappings":"AAsDA;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,OAAQ,MAAM,KAAG,MAAuC,CAAA;AAE/E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,cAAe,MAAM,SAAS,MAAM,KAAG,MACnB,CAAA"}
|
package/dist/keyboard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../src/keyboard.ts"],"names":[],"mappings":"AAEA,kHAAkH;AAClH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../src/keyboard.ts"],"names":[],"mappings":"AAEA,kHAAkH;AAClH,eAAO,MAAM,cAAc,QAAS,MAAM,KAAG,OAA2B,CAAA;AAExE,eAAO,MAAM,SAAS,UAAW,MAAM,UAAU,MAAM,KAAG,MACpB,CAAA;AAEtC,eAAO,MAAM,qBAAqB,cAEnB,MAAM,gBACH,MAAM,cACR,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,kBAE3B,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC,KAAG,MAMtC,CAAA;AAEL,eAAO,MAAM,UAAU,YACZ,MAAM,eACF,MAAM,aACR,MAAM,gBACH,MAAM,cACR,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,KACrC,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAW1B,CAAA"}
|