@foldkit/ui 0.155.0 → 0.156.0-canary.0053b7691fcd
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/anchor/anchor.d.ts +18 -18
- package/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/anchor/anchor.js +16 -16
- package/dist/animation/index.js +6 -6
- package/dist/animation/schema.d.ts +6 -6
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +5 -5
- package/dist/animation/update.d.ts +2 -2
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +9 -9
- package/dist/calendar/index.d.ts +56 -56
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +49 -37
- package/dist/checkbox/index.js +2 -2
- package/dist/combobox/multi.d.ts +19 -19
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/multi.js +2 -2
- package/dist/combobox/shared.d.ts +61 -61
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +51 -51
- package/dist/combobox/single.d.ts +19 -19
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/combobox/single.js +2 -2
- package/dist/datePicker/index.d.ts +72 -72
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +9 -9
- package/dist/dialog/index.d.ts +14 -14
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +14 -14
- package/dist/disclosure/index.js +2 -2
- package/dist/dragAndDrop/index.d.ts +61 -61
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +85 -85
- package/dist/fileDrop/index.d.ts +6 -6
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/fileDrop/index.js +6 -6
- package/dist/hoverIntent/hoverIntent.d.ts +19 -16
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.js +49 -46
- package/dist/hoverIntent/message.d.ts +4 -4
- package/dist/hoverIntent/message.d.ts.map +1 -1
- package/dist/hoverIntent/message.js +4 -4
- package/dist/hoverIntent/public.d.ts +1 -1
- package/dist/hoverIntent/public.d.ts.map +1 -1
- package/dist/hoverIntent/public.js +1 -1
- package/dist/keyboard.js +2 -2
- package/dist/listbox/multi.d.ts +19 -19
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/multi.js +2 -2
- package/dist/listbox/shared.d.ts +58 -58
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +52 -52
- package/dist/listbox/single.d.ts +19 -19
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/listbox/single.js +2 -2
- package/dist/menu/index.d.ts +67 -67
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +60 -57
- package/dist/popover/index.d.ts +34 -34
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +27 -27
- package/dist/radioGroup/index.d.ts +12 -12
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/radioGroup/index.js +16 -16
- package/dist/slider/index.d.ts +14 -14
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +31 -31
- package/dist/switch/index.js +2 -2
- package/dist/tabs/index.d.ts +14 -14
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +18 -18
- package/dist/test/apps/disabledButton.d.ts +12 -12
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +4 -4
- package/dist/toast/index.d.ts +63 -63
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +19 -19
- package/dist/toast/schema.d.ts +55 -55
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +25 -25
- package/dist/toast/update.d.ts +61 -61
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +5 -5
- package/dist/tooltip/message.d.ts +3 -3
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/message.js +3 -3
- package/dist/tooltip/tooltip.d.ts +24 -24
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +13 -13
- package/dist/typeahead.d.ts.map +1 -1
- package/dist/typeahead.js +3 -3
- package/dist/virtualList/index.d.ts +15 -15
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +13 -13
- package/package.json +4 -4
package/dist/dialog/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Effect, Option, Schema
|
|
1
|
+
import { Effect, Option, Schema } from 'effect';
|
|
2
2
|
import * as Command from 'foldkit/command';
|
|
3
3
|
import { type ChildAttribute, type Html } from 'foldkit/html';
|
|
4
4
|
import * as Update from 'foldkit/update';
|
|
5
5
|
/** Schema for the dialog component's state, tracking its unique ID, open/closed status, animation support, and animation lifecycle phase. */
|
|
6
|
-
export declare const Model:
|
|
7
|
-
readonly id:
|
|
8
|
-
readonly isOpen:
|
|
9
|
-
readonly isAnimated:
|
|
10
|
-
readonly animation:
|
|
11
|
-
readonly id:
|
|
12
|
-
readonly isShowing:
|
|
13
|
-
readonly transitionState:
|
|
6
|
+
export declare const Model: Schema.Struct<{
|
|
7
|
+
readonly id: Schema.String;
|
|
8
|
+
readonly isOpen: Schema.Boolean;
|
|
9
|
+
readonly isAnimated: Schema.Boolean;
|
|
10
|
+
readonly animation: Schema.Struct<{
|
|
11
|
+
readonly id: Schema.String;
|
|
12
|
+
readonly isShowing: Schema.Boolean;
|
|
13
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
14
14
|
}>;
|
|
15
|
-
readonly maybeFocusSelector:
|
|
15
|
+
readonly maybeFocusSelector: Schema.Option<Schema.String>;
|
|
16
16
|
}>;
|
|
17
17
|
export type Model = typeof Model.Type;
|
|
18
18
|
/** Union of all messages the dialog component can produce. */
|
|
@@ -89,8 +89,8 @@ type UpdateReturn = Update.ReturnWithOutMessage<Model, Message, OutMessage>;
|
|
|
89
89
|
* this close, the dialog would render open with no lock and no focus trap.
|
|
90
90
|
* The lock is also released if the Command is interrupted while it waits. */
|
|
91
91
|
export declare const ShowDialog: Command.CommandDefinitionWithArgs<"ShowDialog", {
|
|
92
|
-
id:
|
|
93
|
-
focusSelector:
|
|
92
|
+
id: Schema.String;
|
|
93
|
+
focusSelector: Schema.String;
|
|
94
94
|
}, Effect.Effect<{
|
|
95
95
|
readonly _tag: "SucceededShowDialog";
|
|
96
96
|
} | {
|
|
@@ -105,7 +105,7 @@ export declare const ShowDialog: Command.CommandDefinitionWithArgs<"ShowDialog",
|
|
|
105
105
|
* releases the scroll lock, focus trap, return focus, and stack entry if the
|
|
106
106
|
* dialog still holds them. */
|
|
107
107
|
export declare const CloseDialog: Command.CommandDefinitionWithArgs<"CloseDialog", {
|
|
108
|
-
id:
|
|
108
|
+
id: Schema.String;
|
|
109
109
|
}, Effect.Effect<{
|
|
110
110
|
readonly _tag: "CompletedCloseDialog";
|
|
111
111
|
}, never, never>>;
|
|
@@ -114,7 +114,7 @@ export declare const CloseDialog: Command.CommandDefinitionWithArgs<"CloseDialog
|
|
|
114
114
|
* purposeful close. Idempotent: a no-op if the dialog already released its
|
|
115
115
|
* resources through `CloseDialog`. */
|
|
116
116
|
export declare const ReleaseDialogResources: Command.CommandDefinitionWithArgs<"ReleaseDialogResources", {
|
|
117
|
-
id:
|
|
117
|
+
id: Schema.String;
|
|
118
118
|
}, Effect.Effect<{
|
|
119
119
|
readonly _tag: "CompletedReleaseDialogResources";
|
|
120
120
|
}, never, never>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,EAAQ,M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AG,QAAQ,CAAC;IAChC,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACrC,QAAQ,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACvC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACpC,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACpC,WAAW,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC1C,YAAY,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC3C,WAAW,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC1C,SAAS,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAA;CACrC,CAAC,CAAA;AAEF;;;2EAG2E;AAC3E,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAPP,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI;GA6FrC,CAAA"}
|
package/dist/dialog/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Effect, Match
|
|
2
|
+
import { Effect, Match, Option, Schema, pipe } from 'effect';
|
|
3
3
|
import * as Command from 'foldkit/command';
|
|
4
4
|
import * as Dom from 'foldkit/dom';
|
|
5
5
|
import { childAttributes } from 'foldkit/html';
|
|
@@ -15,12 +15,12 @@ import { defaultLeaveCommand as animationDefaultLeaveCommand, update as animatio
|
|
|
15
15
|
import { idSelector } from '../internal/selectors.js';
|
|
16
16
|
// MODEL
|
|
17
17
|
/** Schema for the dialog component's state, tracking its unique ID, open/closed status, animation support, and animation lifecycle phase. */
|
|
18
|
-
export const Model =
|
|
19
|
-
id:
|
|
20
|
-
isOpen:
|
|
21
|
-
isAnimated:
|
|
18
|
+
export const Model = Schema.Struct({
|
|
19
|
+
id: Schema.String,
|
|
20
|
+
isOpen: Schema.Boolean,
|
|
21
|
+
isAnimated: Schema.Boolean,
|
|
22
22
|
animation: AnimationModel,
|
|
23
|
-
maybeFocusSelector:
|
|
23
|
+
maybeFocusSelector: Schema.Option(Schema.String),
|
|
24
24
|
});
|
|
25
25
|
// MESSAGE
|
|
26
26
|
/** Union of all messages the dialog component can produce. */
|
|
@@ -70,7 +70,7 @@ export const initialFocusMarkerSelector = `[data-${initialFocusMarkerAttribute}]
|
|
|
70
70
|
* this close, the dialog would render open with no lock and no focus trap.
|
|
71
71
|
* The lock is also released if the Command is interrupted while it waits. */
|
|
72
72
|
export const ShowDialog = Command.define('ShowDialog', {
|
|
73
|
-
args: { id:
|
|
73
|
+
args: { id: Schema.String, focusSelector: Schema.String },
|
|
74
74
|
messages: [Message.SucceededShowDialog, Message.FailedShowDialog],
|
|
75
75
|
execute: ({ id, focusSelector }) => __foldkitBrandViewResult((Dom.lockScroll.pipe(Effect.andThen(() => __foldkitBrandViewResult((Dom.showDialog(dialogSelector(id), { focusSelector }).pipe(Effect.onError(() => __foldkitBrandViewResult((Dom.unlockScroll), "@foldkit/ui/dialog/index.js#anonymous~2")), Effect.as(Message.SucceededShowDialog()), Effect.catch(() => __foldkitBrandViewResult((Effect.succeed(Message.FailedShowDialog())), "@foldkit/ui/dialog/index.js#anonymous~3")))), "@foldkit/ui/dialog/index.js#anonymous")))), "@foldkit/ui/dialog/index.js#execute"),
|
|
76
76
|
});
|
|
@@ -83,7 +83,7 @@ export const ShowDialog = Command.define('ShowDialog', {
|
|
|
83
83
|
* releases the scroll lock, focus trap, return focus, and stack entry if the
|
|
84
84
|
* dialog still holds them. */
|
|
85
85
|
export const CloseDialog = Command.define('CloseDialog', {
|
|
86
|
-
args: { id:
|
|
86
|
+
args: { id: Schema.String },
|
|
87
87
|
messages: [Message.CompletedCloseDialog],
|
|
88
88
|
execute: ({ id }) => __foldkitBrandViewResult((Dom.closeDialog(dialogSelector(id)).pipe(Effect.andThen(isReleased => __foldkitBrandViewResult((isReleased ? Dom.unlockScroll : Effect.void), "@foldkit/ui/dialog/index.js#anonymous~4")), Effect.catch(() => __foldkitBrandViewResult((Dom.releaseDialogResources(id)), "@foldkit/ui/dialog/index.js#anonymous~5")), Effect.as(Message.CompletedCloseDialog()))), "@foldkit/ui/dialog/index.js#execute~2"),
|
|
89
89
|
});
|
|
@@ -92,7 +92,7 @@ export const CloseDialog = Command.define('CloseDialog', {
|
|
|
92
92
|
* purposeful close. Idempotent: a no-op if the dialog already released its
|
|
93
93
|
* resources through `CloseDialog`. */
|
|
94
94
|
export const ReleaseDialogResources = Command.define('ReleaseDialogResources', {
|
|
95
|
-
args: { id:
|
|
95
|
+
args: { id: Schema.String },
|
|
96
96
|
messages: [Message.CompletedReleaseDialogResources],
|
|
97
97
|
execute: ({ id }) => __foldkitBrandViewResult((Dom.releaseDialogResources(id).pipe(Effect.ignore, Effect.as(Message.CompletedReleaseDialogResources()))), "@foldkit/ui/dialog/index.js#execute~3"),
|
|
98
98
|
});
|
|
@@ -231,21 +231,21 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
231
231
|
const { id, isOpen, animation: { transitionState }, } = model;
|
|
232
232
|
const { toView } = viewInputs;
|
|
233
233
|
const isVisible = isOpen || isLeaving(model);
|
|
234
|
-
const animationAttributes =
|
|
234
|
+
const animationAttributes = Match.value(transitionState).pipe(Match.when('EnterStart', () => __foldkitBrandViewResult(([
|
|
235
235
|
h.DataAttribute('closed', ''),
|
|
236
236
|
h.DataAttribute('enter', ''),
|
|
237
237
|
h.DataAttribute('transition', ''),
|
|
238
|
-
]), "@foldkit/ui/dialog/index.js#anonymous~15")),
|
|
238
|
+
]), "@foldkit/ui/dialog/index.js#anonymous~15")), Match.when('EnterAnimating', () => __foldkitBrandViewResult(([
|
|
239
239
|
h.DataAttribute('enter', ''),
|
|
240
240
|
h.DataAttribute('transition', ''),
|
|
241
|
-
]), "@foldkit/ui/dialog/index.js#anonymous~16")),
|
|
241
|
+
]), "@foldkit/ui/dialog/index.js#anonymous~16")), Match.when('LeaveStart', () => __foldkitBrandViewResult(([
|
|
242
242
|
h.DataAttribute('leave', ''),
|
|
243
243
|
h.DataAttribute('transition', ''),
|
|
244
|
-
]), "@foldkit/ui/dialog/index.js#anonymous~17")),
|
|
244
|
+
]), "@foldkit/ui/dialog/index.js#anonymous~17")), Match.when('LeaveAnimating', () => __foldkitBrandViewResult(([
|
|
245
245
|
h.DataAttribute('closed', ''),
|
|
246
246
|
h.DataAttribute('leave', ''),
|
|
247
247
|
h.DataAttribute('transition', ''),
|
|
248
|
-
]), "@foldkit/ui/dialog/index.js#anonymous~18")),
|
|
248
|
+
]), "@foldkit/ui/dialog/index.js#anonymous~18")), Match.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/dialog/index.js#anonymous~19")));
|
|
249
249
|
const dialogAttributes = [
|
|
250
250
|
h.Id(id),
|
|
251
251
|
h.AriaLabelledBy(titleId(model)),
|
package/dist/disclosure/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Match
|
|
2
|
+
import { Match, Option, Predicate } from 'effect';
|
|
3
3
|
// VIEW
|
|
4
4
|
/** Returns the bare DOM id of the disclosure toggle button, derived from the
|
|
5
5
|
* disclosure's base id. Use this to associate an external label with the
|
|
@@ -34,7 +34,7 @@ const panelSizeTransition = 'grid-template-rows 200ms ease-out';
|
|
|
34
34
|
export const view = (config, h) => {
|
|
35
35
|
const { id, isOpen, onToggle, toView, isDisabled = false, ariaLabel, ariaLabelledBy, } = config;
|
|
36
36
|
const nextOpen = !isOpen;
|
|
37
|
-
const handleKeyDown = (key) => __foldkitBrandViewResult((
|
|
37
|
+
const handleKeyDown = (key) => __foldkitBrandViewResult((Match.value(key).pipe(Match.whenOr('Enter', ' ', () => __foldkitBrandViewResult((Option.some(onToggle(nextOpen))), "@foldkit/ui/disclosure/index.js#anonymous")), Match.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/disclosure/index.js#anonymous~2")))), "@foldkit/ui/disclosure/index.js#handleKeyDown");
|
|
38
38
|
const disabledAttributes = isDisabled
|
|
39
39
|
? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]
|
|
40
40
|
: [];
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { Effect, Equivalence, Option, Schema
|
|
1
|
+
import { Effect, Equivalence, Option, Schema, Stream } from 'effect';
|
|
2
2
|
import * as Command from 'foldkit/command';
|
|
3
3
|
import { type Attribute, type HtmlBuilder } from 'foldkit/html';
|
|
4
4
|
import * as Subscription from 'foldkit/subscription';
|
|
5
5
|
import * as Update from 'foldkit/update';
|
|
6
|
-
declare const DropTarget:
|
|
7
|
-
readonly containerId:
|
|
8
|
-
readonly index:
|
|
6
|
+
declare const DropTarget: Schema.Struct<{
|
|
7
|
+
readonly containerId: Schema.String;
|
|
8
|
+
readonly index: Schema.Number;
|
|
9
9
|
}>;
|
|
10
10
|
/** Schema for the drag-and-drop component's state, tracking its unique ID, orientation, and current drag phase. */
|
|
11
|
-
export declare const Model:
|
|
12
|
-
readonly id:
|
|
13
|
-
readonly orientation:
|
|
14
|
-
readonly activationThreshold:
|
|
11
|
+
export declare const Model: Schema.Struct<{
|
|
12
|
+
readonly id: Schema.String;
|
|
13
|
+
readonly orientation: Schema.Literals<readonly ["Horizontal", "Vertical"]>;
|
|
14
|
+
readonly activationThreshold: Schema.Number;
|
|
15
15
|
readonly dragState: import("foldkit/schema").TaggedUnion<{
|
|
16
16
|
readonly Idle: {};
|
|
17
17
|
readonly Pending: {
|
|
18
|
-
itemId:
|
|
19
|
-
containerId:
|
|
20
|
-
index:
|
|
21
|
-
origin:
|
|
22
|
-
readonly screenX:
|
|
23
|
-
readonly screenY:
|
|
18
|
+
itemId: Schema.String;
|
|
19
|
+
containerId: Schema.String;
|
|
20
|
+
index: Schema.Number;
|
|
21
|
+
origin: Schema.Struct<{
|
|
22
|
+
readonly screenX: Schema.Number;
|
|
23
|
+
readonly screenY: Schema.Number;
|
|
24
24
|
}>;
|
|
25
25
|
};
|
|
26
26
|
readonly Dragging: {
|
|
27
|
-
itemId:
|
|
28
|
-
sourceContainerId:
|
|
29
|
-
sourceIndex:
|
|
30
|
-
origin:
|
|
31
|
-
readonly screenX:
|
|
32
|
-
readonly screenY:
|
|
27
|
+
itemId: Schema.String;
|
|
28
|
+
sourceContainerId: Schema.String;
|
|
29
|
+
sourceIndex: Schema.Number;
|
|
30
|
+
origin: Schema.Struct<{
|
|
31
|
+
readonly screenX: Schema.Number;
|
|
32
|
+
readonly screenY: Schema.Number;
|
|
33
33
|
}>;
|
|
34
|
-
current:
|
|
35
|
-
readonly clientX:
|
|
36
|
-
readonly clientY:
|
|
34
|
+
current: Schema.Struct<{
|
|
35
|
+
readonly clientX: Schema.Number;
|
|
36
|
+
readonly clientY: Schema.Number;
|
|
37
37
|
}>;
|
|
38
|
-
maybeDropTarget:
|
|
39
|
-
readonly containerId:
|
|
40
|
-
readonly index:
|
|
38
|
+
maybeDropTarget: Schema.Option<Schema.Struct<{
|
|
39
|
+
readonly containerId: Schema.String;
|
|
40
|
+
readonly index: Schema.Number;
|
|
41
41
|
}>>;
|
|
42
42
|
};
|
|
43
43
|
readonly KeyboardDragging: {
|
|
44
|
-
itemId:
|
|
45
|
-
sourceContainerId:
|
|
46
|
-
sourceIndex:
|
|
47
|
-
targetContainerId:
|
|
48
|
-
targetIndex:
|
|
44
|
+
itemId: Schema.String;
|
|
45
|
+
sourceContainerId: Schema.String;
|
|
46
|
+
sourceIndex: Schema.Number;
|
|
47
|
+
targetContainerId: Schema.String;
|
|
48
|
+
targetIndex: Schema.Number;
|
|
49
49
|
};
|
|
50
50
|
}>;
|
|
51
51
|
}>;
|
|
@@ -53,36 +53,36 @@ export type Model = typeof Model.Type;
|
|
|
53
53
|
/** Union of all messages the drag-and-drop component can produce. */
|
|
54
54
|
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
55
55
|
readonly PressedDraggable: {
|
|
56
|
-
itemId:
|
|
57
|
-
containerId:
|
|
58
|
-
index:
|
|
59
|
-
screenX:
|
|
60
|
-
screenY:
|
|
56
|
+
itemId: Schema.String;
|
|
57
|
+
containerId: Schema.String;
|
|
58
|
+
index: Schema.Number;
|
|
59
|
+
screenX: Schema.Number;
|
|
60
|
+
screenY: Schema.Number;
|
|
61
61
|
};
|
|
62
62
|
readonly MovedPointer: {
|
|
63
|
-
screenX:
|
|
64
|
-
screenY:
|
|
65
|
-
clientX:
|
|
66
|
-
clientY:
|
|
67
|
-
maybeDropTarget:
|
|
68
|
-
readonly containerId:
|
|
69
|
-
readonly index:
|
|
63
|
+
screenX: Schema.Number;
|
|
64
|
+
screenY: Schema.Number;
|
|
65
|
+
clientX: Schema.Number;
|
|
66
|
+
clientY: Schema.Number;
|
|
67
|
+
maybeDropTarget: Schema.Option<Schema.Struct<{
|
|
68
|
+
readonly containerId: Schema.String;
|
|
69
|
+
readonly index: Schema.Number;
|
|
70
70
|
}>>;
|
|
71
71
|
};
|
|
72
72
|
readonly ReleasedPointer: {};
|
|
73
73
|
readonly CancelledDrag: {};
|
|
74
74
|
readonly ActivatedKeyboardDrag: {
|
|
75
|
-
itemId:
|
|
76
|
-
containerId:
|
|
77
|
-
index:
|
|
75
|
+
itemId: Schema.String;
|
|
76
|
+
containerId: Schema.String;
|
|
77
|
+
index: Schema.Number;
|
|
78
78
|
};
|
|
79
79
|
readonly CompletedResolveKeyboardMove: {
|
|
80
|
-
targetContainerId:
|
|
81
|
-
targetIndex:
|
|
80
|
+
targetContainerId: Schema.String;
|
|
81
|
+
targetIndex: Schema.Number;
|
|
82
82
|
};
|
|
83
83
|
readonly ConfirmedKeyboardDrop: {};
|
|
84
84
|
readonly PressedArrowKey: {
|
|
85
|
-
direction:
|
|
85
|
+
direction: Schema.Literals<readonly ["Up", "Down", "Left", "Right", "NextContainer", "PreviousContainer"]>;
|
|
86
86
|
};
|
|
87
87
|
readonly AdvancedAutoScrollFrame: {};
|
|
88
88
|
readonly CompletedFocusItem: {};
|
|
@@ -91,11 +91,11 @@ export type Message = typeof Message.Type;
|
|
|
91
91
|
/** Union of all out-messages the drag-and-drop component can emit to its parent. */
|
|
92
92
|
export declare const OutMessage: import("foldkit/message").MessageUnion<{
|
|
93
93
|
readonly Reordered: {
|
|
94
|
-
itemId:
|
|
95
|
-
fromContainerId:
|
|
96
|
-
fromIndex:
|
|
97
|
-
toContainerId:
|
|
98
|
-
toIndex:
|
|
94
|
+
itemId: Schema.String;
|
|
95
|
+
fromContainerId: Schema.String;
|
|
96
|
+
fromIndex: Schema.Number;
|
|
97
|
+
toContainerId: Schema.String;
|
|
98
|
+
toIndex: Schema.Number;
|
|
99
99
|
};
|
|
100
100
|
readonly Cancelled: {};
|
|
101
101
|
}>;
|
|
@@ -109,16 +109,16 @@ export type InitConfig = Readonly<{
|
|
|
109
109
|
export declare const init: (config: InitConfig) => Model;
|
|
110
110
|
/** Focuses a draggable item by ID after a keyboard move, drop, or cancel. */
|
|
111
111
|
export declare const FocusItem: Command.CommandDefinitionWithArgs<"FocusItem", {
|
|
112
|
-
itemId:
|
|
112
|
+
itemId: Schema.String;
|
|
113
113
|
}, Effect.Effect<{
|
|
114
114
|
readonly _tag: "CompletedFocusItem";
|
|
115
115
|
}, never, never>>;
|
|
116
116
|
/** Resolves the next keyboard drag position by querying the DOM for adjacent sortable items and containers. */
|
|
117
117
|
export declare const ResolveKeyboardMove: Command.CommandDefinitionWithArgs<"ResolveKeyboardMove", {
|
|
118
|
-
itemId:
|
|
119
|
-
currentContainerId:
|
|
120
|
-
currentIndex:
|
|
121
|
-
direction:
|
|
118
|
+
itemId: Schema.String;
|
|
119
|
+
currentContainerId: Schema.String;
|
|
120
|
+
currentIndex: Schema.Number;
|
|
121
|
+
direction: Schema.Literals<readonly ["Up", "Down", "Left", "Right", "NextContainer", "PreviousContainer"]>;
|
|
122
122
|
}, Effect.Effect<{
|
|
123
123
|
readonly _tag: "CompletedResolveKeyboardMove";
|
|
124
124
|
readonly targetContainerId: string;
|
|
@@ -475,11 +475,11 @@ export declare const subscriptions: {
|
|
|
475
475
|
readonly __subscription: never;
|
|
476
476
|
};
|
|
477
477
|
readonly autoScroll: {
|
|
478
|
-
readonly dependenciesSchema:
|
|
478
|
+
readonly dependenciesSchema: Schema.Schema<{
|
|
479
479
|
readonly isDragging: boolean;
|
|
480
480
|
readonly clientY: number;
|
|
481
481
|
}> & {
|
|
482
|
-
readonly fields:
|
|
482
|
+
readonly fields: Schema.Struct.Fields;
|
|
483
483
|
};
|
|
484
484
|
readonly modelToDependencies: (model: {
|
|
485
485
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dragAndDrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,WAAW,EAEX,MAAM,EAEN,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dragAndDrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,WAAW,EAEX,MAAM,EAEN,MAAM,EACN,MAAM,EAEP,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAmB,MAAM,cAAc,CAAA;AAIhF,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAkBxC,QAAA,MAAM,UAAU;;;EAGd,CAAA;AA2BF,mHAAmH;AACnH,eAAO,MAAM,KAAK;;;;;;;YAvBd,MAAM;YACN,WAAW;YACX,KAAK;YACL,MAAM;;;;;;YAGN,MAAM;YACN,iBAAiB;YACjB,WAAW;YACX,MAAM;;;;YACN,OAAO;;;;YACP,eAAe;;;;;;YAGf,MAAM;YACN,iB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