@foldkit/ui 0.162.0 → 0.163.0-canary.4187988d5940
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.map +1 -1
- package/dist/anchor/anchor.js +10 -1
- package/dist/animation/index.d.ts +3 -0
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/schema.d.ts +13 -4
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +8 -4
- package/dist/animation/update.d.ts +15 -5
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +59 -27
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +27 -19
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/combobox/multi.d.ts +5 -0
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/multi.js +2 -2
- package/dist/combobox/shared.d.ts +12 -2
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +21 -21
- package/dist/combobox/single.d.ts +5 -0
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/combobox/single.js +4 -4
- package/dist/datePicker/index.d.ts +13 -2
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +10 -10
- package/dist/dialog/index.d.ts +13 -2
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +28 -14
- package/dist/disclosure/index.d.ts +2 -2
- package/dist/disclosure/index.js +1 -1
- package/dist/dragAndDrop/index.js +14 -14
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/fileDrop/index.js +7 -5
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.js +16 -16
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/internal/accessibleName.d.ts +9 -0
- package/dist/internal/accessibleName.d.ts.map +1 -0
- package/dist/internal/accessibleName.js +12 -0
- package/dist/internal/range.d.ts +7 -0
- package/dist/internal/range.d.ts.map +1 -0
- package/dist/internal/range.js +12 -0
- package/dist/listbox/multi.d.ts +5 -0
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/shared.d.ts +12 -2
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +26 -24
- package/dist/listbox/single.d.ts +5 -0
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/menu/index.d.ts +13 -2
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +29 -23
- package/dist/meter/index.d.ts +26 -0
- package/dist/meter/index.d.ts.map +1 -0
- package/dist/meter/index.js +67 -0
- package/dist/meter/public.d.ts +3 -0
- package/dist/meter/public.d.ts.map +1 -0
- package/dist/meter/public.js +1 -0
- package/dist/popover/index.d.ts +16 -2
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +18 -16
- package/dist/progress/index.d.ts +24 -0
- package/dist/progress/index.d.ts.map +1 -0
- package/dist/progress/index.js +85 -0
- package/dist/progress/public.d.ts +3 -0
- package/dist/progress/public.d.ts.map +1 -0
- package/dist/progress/public.js +1 -0
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/radioGroup/index.js +5 -3
- package/dist/slider/index.d.ts +61 -28
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +163 -87
- package/dist/slider/public.d.ts +1 -1
- package/dist/slider/public.d.ts.map +1 -1
- package/dist/slider/public.js +1 -1
- package/dist/switch/index.d.ts +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +5 -3
- package/dist/test/apps/disabledButton.d.ts +12 -4
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +3 -3
- package/dist/toast/index.d.ts +869 -45
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +77 -17
- package/dist/toast/public.d.ts +2 -2
- package/dist/toast/public.d.ts.map +1 -1
- package/dist/toast/public.js +1 -1
- package/dist/toast/schema.d.ts +160 -6
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +69 -2
- package/dist/toast/swipeTarget.d.ts +5 -0
- package/dist/toast/swipeTarget.d.ts.map +1 -0
- package/dist/toast/swipeTarget.js +18 -0
- package/dist/toast/test.d.ts +7 -1
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/test.js +37 -3
- package/dist/toast/update.d.ts +768 -7
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +283 -68
- package/dist/tooltip/tooltip.d.ts +7 -7
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +14 -12
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +8 -6
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/anchor/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAgB,MAAM,QAAQ,CAAA;AAatE;mFACmF;AACnF,eAAO,MAAM,SAAS,0KAapB,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C;+DAC+D;AAC/D,eAAO,MAAM,OAAO;;;;;IAQlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,oGAAoG;AACpG,eAAO,MAAM,YAAY;;;;;;;;;;;;EAOvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAkCnD;;;;;;0DAM0D;AAC1D,eAAO,MAAM,sBAAsB,YAAa,OAAO,KAAG,CAAC,MAAM,IAAI,CAWpE,CAAA;AAUD;;;;;;;;;;;;;;;;;;;;;0BAqB0B;AAC1B,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACj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O,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC,CAAA;AAsBF;;;;;;;;;;;;;;;;;;;;;;;gFAuBgF;AAChF,eAAO,MAAM,WAAW,YACb,OAAO,UACR,WAAW,KAClB,CAAC,MAAM,IAAI,CAkQb,CAAA"}
|
package/dist/anchor/anchor.js
CHANGED
|
@@ -136,8 +136,17 @@ export const anchorSetup = (element, config) => {
|
|
|
136
136
|
const root = element.getRootNode();
|
|
137
137
|
const inShadow = root instanceof ShadowRoot;
|
|
138
138
|
const owner = inShadow ? root : document;
|
|
139
|
+
if (!(element instanceof HTMLElement)) {
|
|
140
|
+
console.error('[@foldkit/ui] anchorSetup requires an HTML panel. The panel will not be positioned.');
|
|
141
|
+
return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
|
|
142
|
+
}
|
|
139
143
|
const button = owner.getElementById(config.buttonId);
|
|
140
|
-
if (
|
|
144
|
+
if (button === null) {
|
|
145
|
+
console.error(`[@foldkit/ui] anchorSetup could not find a trigger with id "${config.buttonId}". The panel will not be positioned.`);
|
|
146
|
+
return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
|
|
147
|
+
}
|
|
148
|
+
if (!(button instanceof HTMLElement)) {
|
|
149
|
+
console.error(`[@foldkit/ui] anchorSetup requires an HTML trigger with id "${config.buttonId}". The panel will not be positioned.`);
|
|
141
150
|
return __foldkitBrandViewResult((Function.constVoid), "@foldkit/ui/anchor/anchor.js#anchorSetup");
|
|
142
151
|
}
|
|
143
152
|
const isPortal = config.anchor.portal ?? true;
|
|
@@ -28,10 +28,13 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
28
28
|
readonly id: string;
|
|
29
29
|
readonly isShowing: boolean;
|
|
30
30
|
readonly transitionState: "EnterAnimating" | "EnterStart" | "Idle" | "LeaveAnimating" | "LeaveStart";
|
|
31
|
+
readonly transitionGeneration: number;
|
|
31
32
|
}, {
|
|
32
33
|
readonly _tag: "CompletedWaitForPaint";
|
|
34
|
+
readonly generation: number;
|
|
33
35
|
} | {
|
|
34
36
|
readonly _tag: "EndedAnimation";
|
|
37
|
+
readonly generation: number;
|
|
35
38
|
} | {
|
|
36
39
|
readonly _tag: "Hid";
|
|
37
40
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGjE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,EACP,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA;AAE5D,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,GACP,CAAA;AAID,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,IAAI,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IACtC;;2EAEuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC,CAAA;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGjE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC/E,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,EACP,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA;AAE5D,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,MAAM,GACP,CAAA;AAID,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,IAAI,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IACtC;;2EAEuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC,CAAA;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;aAnBN,IAAI;gBACD,MAAM;iBACL,aAAa,CAAC,cAAc,CAAC;cAChC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC;IACtC;;2EAEuE;kBACzD,OAAO;GA2GtB,CAAA"}
|
|
@@ -2,25 +2,34 @@ import { Schema } from 'effect';
|
|
|
2
2
|
/** Schema for the animation lifecycle state, tracking enter/leave phases. */
|
|
3
3
|
export declare const TransitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
4
4
|
export type TransitionState = typeof TransitionState.Type;
|
|
5
|
-
/** Schema for
|
|
5
|
+
/** Schema for Animation state, including the transition generation used to reject
|
|
6
|
+
* stale Command results. */
|
|
6
7
|
export declare const Model: Schema.Struct<{
|
|
7
8
|
readonly id: Schema.String;
|
|
8
9
|
readonly isShowing: Schema.Boolean;
|
|
9
10
|
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
11
|
+
readonly transitionGeneration: Schema.Number;
|
|
10
12
|
}>;
|
|
11
13
|
export type Model = typeof Model.Type;
|
|
12
14
|
/** Union of all messages the animation component can produce. */
|
|
13
15
|
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
14
16
|
readonly Showed: {};
|
|
15
17
|
readonly Hid: {};
|
|
16
|
-
readonly CompletedWaitForPaint: {
|
|
17
|
-
|
|
18
|
+
readonly CompletedWaitForPaint: {
|
|
19
|
+
generation: Schema.Number;
|
|
20
|
+
};
|
|
21
|
+
readonly EndedAnimation: {
|
|
22
|
+
generation: Schema.Number;
|
|
23
|
+
};
|
|
18
24
|
}>;
|
|
19
25
|
export type Message = typeof Message.Type;
|
|
20
26
|
export type Showed = typeof Message.Showed.Type;
|
|
21
27
|
export type Hid = typeof Message.Hid.Type;
|
|
28
|
+
/** Union of the facts Animation reports to its parent. */
|
|
22
29
|
export declare const OutMessage: import("foldkit/message").MessageUnion<{
|
|
23
|
-
readonly StartedLeaveAnimating: {
|
|
30
|
+
readonly StartedLeaveAnimating: {
|
|
31
|
+
generation: Schema.Number;
|
|
32
|
+
};
|
|
24
33
|
readonly TransitionedOut: {};
|
|
25
34
|
}>;
|
|
26
35
|
export type OutMessage = typeof OutMessage.Type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/animation/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAK/B,6EAA6E;AAC7E,eAAO,MAAM,eAAe,oGAM1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/animation/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAK/B,6EAA6E;AAC7E,eAAO,MAAM,eAAe,oGAM1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD;6BAC6B;AAC7B,eAAO,MAAM,KAAK;;;;;EAKhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,iEAAiE;AACjE,eAAO,MAAM,OAAO;;;;QAGO,UAAU;;;QACjB,UAAU;;EAC5B,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,MAAM,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA;AAC/C,MAAM,MAAM,GAAG,GAAG,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA;AAIzC,0DAA0D;AAC1D,eAAO,MAAM,UAAU;;QACI,UAAU;;;EAEnC,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAI/C,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC,CAAA;AAEF,4EAA4E;AAC5E,eAAO,MAAM,IAAI,WAAY,UAAU,KAAG,KAKxC,CAAA"}
|
package/dist/animation/schema.js
CHANGED
|
@@ -11,23 +11,26 @@ export const TransitionState = Schema.Literals([
|
|
|
11
11
|
'LeaveAnimating',
|
|
12
12
|
]);
|
|
13
13
|
// MODEL
|
|
14
|
-
/** Schema for
|
|
14
|
+
/** Schema for Animation state, including the transition generation used to reject
|
|
15
|
+
* stale Command results. */
|
|
15
16
|
export const Model = Schema.Struct({
|
|
16
17
|
id: Schema.String,
|
|
17
18
|
isShowing: Schema.Boolean,
|
|
18
19
|
transitionState: TransitionState,
|
|
20
|
+
transitionGeneration: Schema.Number,
|
|
19
21
|
});
|
|
20
22
|
// MESSAGE
|
|
21
23
|
/** Union of all messages the animation component can produce. */
|
|
22
24
|
export const Message = defineMessageUnion({
|
|
23
25
|
Showed: {},
|
|
24
26
|
Hid: {},
|
|
25
|
-
CompletedWaitForPaint: {},
|
|
26
|
-
EndedAnimation: {},
|
|
27
|
+
CompletedWaitForPaint: { generation: Schema.Number },
|
|
28
|
+
EndedAnimation: { generation: Schema.Number },
|
|
27
29
|
});
|
|
28
30
|
// OUT MESSAGE
|
|
31
|
+
/** Union of the facts Animation reports to its parent. */
|
|
29
32
|
export const OutMessage = defineMessageUnion({
|
|
30
|
-
StartedLeaveAnimating: {},
|
|
33
|
+
StartedLeaveAnimating: { generation: Schema.Number },
|
|
31
34
|
TransitionedOut: {},
|
|
32
35
|
});
|
|
33
36
|
/** Creates an initial animation model from a config. Defaults to hidden. */
|
|
@@ -35,4 +38,5 @@ export const init = (config) => (__foldkitBrandViewResult(({
|
|
|
35
38
|
id: config.id,
|
|
36
39
|
isShowing: config.isShowing ?? false,
|
|
37
40
|
transitionState: 'Idle',
|
|
41
|
+
transitionGeneration: 0,
|
|
38
42
|
}), "@foldkit/ui/animation/schema.js#init"));
|
|
@@ -3,20 +3,28 @@ import { type Update } from 'foldkit';
|
|
|
3
3
|
import * as Command from 'foldkit/command';
|
|
4
4
|
import { type Hid, Message, type Model, OutMessage, type Showed } from './schema.js';
|
|
5
5
|
type UpdateReturn = Update.ReturnWithOutMessage<Model, Message, OutMessage>;
|
|
6
|
-
/** Waits for paint via double-rAF
|
|
7
|
-
|
|
6
|
+
/** Waits for paint via double-rAF, then reports the transition generation that
|
|
7
|
+
* scheduled the wait. */
|
|
8
|
+
export declare const WaitForPaint: Command.CommandDefinitionWithArgs<"WaitForPaint", {
|
|
9
|
+
generation: Schema.Number;
|
|
10
|
+
}, Effect.Effect<{
|
|
8
11
|
readonly _tag: "CompletedWaitForPaint";
|
|
12
|
+
readonly generation: number;
|
|
9
13
|
}, never, never>>;
|
|
10
|
-
/** Waits for all CSS animations on the element to
|
|
14
|
+
/** Waits for all CSS transitions and keyframe animations on the element to
|
|
15
|
+
* settle, then reports the transition generation that scheduled the wait. */
|
|
11
16
|
export declare const WaitForAnimationSettled: Command.CommandDefinitionWithArgs<"WaitForAnimationSettled", {
|
|
12
17
|
id: Schema.String;
|
|
18
|
+
generation: Schema.Number;
|
|
13
19
|
}, Effect.Effect<{
|
|
14
20
|
readonly _tag: "EndedAnimation";
|
|
21
|
+
readonly generation: number;
|
|
15
22
|
}, never, never>>;
|
|
16
23
|
/** Processes an Animation Message and returns the next Model, optional
|
|
17
24
|
* Commands, and an optional OutMessage. `Showed` and `Hid` start a transition
|
|
18
25
|
* but cannot finish one, so direct calls with either Message return a plain
|
|
19
|
-
* update result.
|
|
26
|
+
* update result. Results from an earlier transition generation leave the Model
|
|
27
|
+
* unchanged. */
|
|
20
28
|
export declare function update(model: Model, message: Showed | Hid): Update.Return<Model, Message>;
|
|
21
29
|
export declare function update(model: Model, message: Message): UpdateReturn;
|
|
22
30
|
/** Programmatically starts the enter lifecycle. */
|
|
@@ -25,7 +33,9 @@ export declare const show: (model: Model) => Update.Return<Model, Message>;
|
|
|
25
33
|
export declare const hide: (model: Model) => Update.Return<Model, Message>;
|
|
26
34
|
/** Toggles the animation between its shown and hidden states. */
|
|
27
35
|
export declare const toggle: (model: Model) => Update.Return<Model, Message>;
|
|
28
|
-
/** Creates the standard leave
|
|
36
|
+
/** Creates the standard leave Command for the Model's current transition. Use
|
|
37
|
+
* this when handling `StartedLeaveAnimating` unless the component needs its
|
|
38
|
+
* own settlement strategy. */
|
|
29
39
|
export declare const defaultLeaveCommand: (model: Model) => Command.Command<Message>;
|
|
30
40
|
export {};
|
|
31
41
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAM1C,OAAO,EACL,KAAK,GAAG,EACR,OAAO,EACP,KAAK,KAAK,EACV,UAAU,EACV,KAAK,MAAM,EACZ,MAAM,aAAa,CAAA;AAMpB,KAAK,YAAY,GAAG,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;AAG3E;0BAC0B;AAC1B,eAAO,MAAM,YAAY;;;;;iBAOvB,CAAA;AACF;8EAC8E;AAC9E,eAAO,MAAM,uBAAuB;;;;;;iBAUnC,CAAA;AAED;;;;iBAIiB;AACjB,wBAAgB,MAAM,CACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,MAAM,GAAG,GAAG,GACpB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;AAChC,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,YAAY,CAAA;AA+FpE,mDAAmD;AACnD,eAAO,MAAM,IAAI,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAC/B,CAAA;AAEjC,mDAAmD;AACnD,eAAO,MAAM,IAAI,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAClC,CAAA;AAE9B,iEAAiE;AACjE,eAAO,MAAM,MAAM,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAMjE,CAAA;AAED;;+BAE+B;AAC/B,eAAO,MAAM,mBAAmB,UAAW,KAAK,KAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAItE,CAAA"}
|
package/dist/animation/update.js
CHANGED
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Effect, Match, Schema } from 'effect';
|
|
2
|
+
import { Effect, Match, Number, Schema } from 'effect';
|
|
3
3
|
import * as Command from 'foldkit/command';
|
|
4
4
|
import * as Dom from 'foldkit/dom';
|
|
5
5
|
import * as Render from 'foldkit/render';
|
|
6
|
-
import {
|
|
6
|
+
import { modifyFields } from 'foldkit/struct';
|
|
7
7
|
import { idSelector } from '../internal/selectors.js';
|
|
8
8
|
import { Message, OutMessage, } from './schema.js';
|
|
9
9
|
// UPDATE
|
|
10
10
|
const elementSelector = (id) => __foldkitBrandViewResult((idSelector(id)), "@foldkit/ui/animation/update.js#elementSelector");
|
|
11
11
|
const withUpdateReturn = Match.withReturnType();
|
|
12
|
-
/** Waits for paint via double-rAF
|
|
12
|
+
/** Waits for paint via double-rAF, then reports the transition generation that
|
|
13
|
+
* scheduled the wait. */
|
|
13
14
|
export const WaitForPaint = Command.define('WaitForPaint', {
|
|
15
|
+
args: { generation: Schema.Number },
|
|
14
16
|
messages: [Message.CompletedWaitForPaint],
|
|
15
|
-
execute: Render.afterPaint.pipe(Effect.as(Message.CompletedWaitForPaint())),
|
|
17
|
+
execute: ({ generation }) => __foldkitBrandViewResult((Render.afterPaint.pipe(Effect.as(Message.CompletedWaitForPaint({ generation })))), "@foldkit/ui/animation/update.js#execute"),
|
|
16
18
|
});
|
|
17
|
-
/** Waits for all CSS animations on the element to
|
|
19
|
+
/** Waits for all CSS transitions and keyframe animations on the element to
|
|
20
|
+
* settle, then reports the transition generation that scheduled the wait. */
|
|
18
21
|
export const WaitForAnimationSettled = Command.define('WaitForAnimationSettled', {
|
|
19
|
-
args: { id: Schema.String },
|
|
22
|
+
args: { id: Schema.String, generation: Schema.Number },
|
|
20
23
|
messages: [Message.EndedAnimation],
|
|
21
|
-
execute: ({ id }) => __foldkitBrandViewResult((Dom.waitForAnimationSettled(elementSelector(id)).pipe(Effect.as(Message.EndedAnimation()))), "@foldkit/ui/animation/update.js#execute"),
|
|
24
|
+
execute: ({ id, generation }) => __foldkitBrandViewResult((Dom.waitForAnimationSettled(elementSelector(id)).pipe(Effect.as(Message.EndedAnimation({ generation })))), "@foldkit/ui/animation/update.js#execute~2"),
|
|
22
25
|
});
|
|
23
26
|
export function update(model, message) {
|
|
24
|
-
const maybeNextFrame = WaitForPaint();
|
|
25
27
|
return __foldkitBrandViewResult((Message.match(message, {
|
|
26
28
|
Showed: () => {
|
|
27
29
|
if (model.isShowing) {
|
|
28
30
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#Showed");
|
|
29
31
|
}
|
|
32
|
+
const nextTransitionGeneration = Number.increment(model.transitionGeneration);
|
|
30
33
|
return __foldkitBrandViewResult(({
|
|
31
|
-
model:
|
|
34
|
+
model: modifyFields(model, {
|
|
32
35
|
isShowing: () => __foldkitBrandViewResult((true), "@foldkit/ui/animation/update.js#isShowing"),
|
|
33
36
|
transitionState: () => __foldkitBrandViewResult(('EnterStart'), "@foldkit/ui/animation/update.js#transitionState"),
|
|
37
|
+
transitionGeneration: () => __foldkitBrandViewResult((nextTransitionGeneration), "@foldkit/ui/animation/update.js#transitionGeneration"),
|
|
34
38
|
}),
|
|
35
|
-
commands: [
|
|
39
|
+
commands: [WaitForPaint({ generation: nextTransitionGeneration })],
|
|
36
40
|
}), "@foldkit/ui/animation/update.js#Showed");
|
|
37
41
|
},
|
|
38
42
|
Hid: () => {
|
|
@@ -41,27 +45,50 @@ export function update(model, message) {
|
|
|
41
45
|
if (isLeaving || !model.isShowing) {
|
|
42
46
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#Hid");
|
|
43
47
|
}
|
|
48
|
+
const nextTransitionGeneration = Number.increment(model.transitionGeneration);
|
|
44
49
|
return __foldkitBrandViewResult(({
|
|
45
|
-
model:
|
|
50
|
+
model: modifyFields(model, {
|
|
46
51
|
isShowing: () => __foldkitBrandViewResult((false), "@foldkit/ui/animation/update.js#isShowing~2"),
|
|
47
52
|
transitionState: () => __foldkitBrandViewResult(('LeaveStart'), "@foldkit/ui/animation/update.js#transitionState~2"),
|
|
53
|
+
transitionGeneration: () => __foldkitBrandViewResult((nextTransitionGeneration), "@foldkit/ui/animation/update.js#transitionGeneration~2"),
|
|
48
54
|
}),
|
|
49
|
-
commands: [
|
|
55
|
+
commands: [WaitForPaint({ generation: nextTransitionGeneration })],
|
|
50
56
|
}), "@foldkit/ui/animation/update.js#Hid");
|
|
51
57
|
},
|
|
52
|
-
CompletedWaitForPaint: (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
CompletedWaitForPaint: ({ generation }) => {
|
|
59
|
+
if (generation !== model.transitionGeneration) {
|
|
60
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#CompletedWaitForPaint");
|
|
61
|
+
}
|
|
62
|
+
return __foldkitBrandViewResult((Match.value(model.transitionState).pipe(withUpdateReturn, Match.when('EnterStart', () => (__foldkitBrandViewResult(({
|
|
63
|
+
model: modifyFields(model, {
|
|
64
|
+
transitionState: () => __foldkitBrandViewResult(('EnterAnimating'), "@foldkit/ui/animation/update.js#transitionState~3"),
|
|
65
|
+
}),
|
|
66
|
+
commands: [
|
|
67
|
+
WaitForAnimationSettled({
|
|
68
|
+
id: model.id,
|
|
69
|
+
generation: model.transitionGeneration,
|
|
70
|
+
}),
|
|
71
|
+
],
|
|
72
|
+
}), "@foldkit/ui/animation/update.js#anonymous"))), Match.when('LeaveStart', () => (__foldkitBrandViewResult(({
|
|
73
|
+
model: modifyFields(model, {
|
|
74
|
+
transitionState: () => __foldkitBrandViewResult(('LeaveAnimating'), "@foldkit/ui/animation/update.js#transitionState~4"),
|
|
75
|
+
}),
|
|
76
|
+
outMessage: OutMessage.StartedLeaveAnimating({
|
|
77
|
+
generation: model.transitionGeneration,
|
|
78
|
+
}),
|
|
79
|
+
}), "@foldkit/ui/animation/update.js#anonymous~2"))), Match.orElse(() => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#anonymous~3"))))), "@foldkit/ui/animation/update.js#CompletedWaitForPaint");
|
|
80
|
+
},
|
|
81
|
+
EndedAnimation: ({ generation }) => {
|
|
82
|
+
if (generation !== model.transitionGeneration) {
|
|
83
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#EndedAnimation");
|
|
84
|
+
}
|
|
85
|
+
return __foldkitBrandViewResult((Match.value(model.transitionState).pipe(withUpdateReturn, Match.when('EnterAnimating', () => (__foldkitBrandViewResult(({
|
|
86
|
+
model: modifyFields(model, { transitionState: () => __foldkitBrandViewResult(('Idle'), "@foldkit/ui/animation/update.js#transitionState~5") }),
|
|
87
|
+
}), "@foldkit/ui/animation/update.js#anonymous~4"))), Match.when('LeaveAnimating', () => (__foldkitBrandViewResult(({
|
|
88
|
+
model: modifyFields(model, { transitionState: () => __foldkitBrandViewResult(('Idle'), "@foldkit/ui/animation/update.js#transitionState~6") }),
|
|
89
|
+
outMessage: OutMessage.TransitionedOut(),
|
|
90
|
+
}), "@foldkit/ui/animation/update.js#anonymous~5"))), Match.orElse(() => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#anonymous~6"))))), "@foldkit/ui/animation/update.js#EndedAnimation");
|
|
91
|
+
},
|
|
65
92
|
})), "@foldkit/ui/animation/update.js#update");
|
|
66
93
|
}
|
|
67
94
|
/** Programmatically starts the enter lifecycle. */
|
|
@@ -77,5 +104,10 @@ export const toggle = (model) => {
|
|
|
77
104
|
return __foldkitBrandViewResult((show(model)), "@foldkit/ui/animation/update.js#toggle");
|
|
78
105
|
}
|
|
79
106
|
};
|
|
80
|
-
/** Creates the standard leave
|
|
81
|
-
|
|
107
|
+
/** Creates the standard leave Command for the Model's current transition. Use
|
|
108
|
+
* this when handling `StartedLeaveAnimating` unless the component needs its
|
|
109
|
+
* own settlement strategy. */
|
|
110
|
+
export const defaultLeaveCommand = (model) => __foldkitBrandViewResult((WaitForAnimationSettled({
|
|
111
|
+
id: model.id,
|
|
112
|
+
generation: model.transitionGeneration,
|
|
113
|
+
})), "@foldkit/ui/animation/update.js#defaultLeaveCommand");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAIN,MAAM,EACN,MAAM,EAEP,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EAGV,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAOxC;;8EAE8E;AAC9E,eAAO,MAAM,QAAQ,uDAA+C,CAAA;AACpE,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C;;;YAGY;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWhB,CAAA"}
|
package/dist/calendar/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as Command from 'foldkit/command';
|
|
|
5
5
|
import * as Dom from 'foldkit/dom';
|
|
6
6
|
import { childAttributes, } from 'foldkit/html';
|
|
7
7
|
import { defineMessageUnion } from 'foldkit/message';
|
|
8
|
-
import {
|
|
8
|
+
import { modifyFields } from 'foldkit/struct';
|
|
9
9
|
import { defineView } from 'foldkit/submodel';
|
|
10
10
|
import * as Update from 'foldkit/update';
|
|
11
11
|
import * as OptionExt from '../internal/optionExtensions.js';
|
|
@@ -104,7 +104,7 @@ export const selectDate = (model, date) => __foldkitBrandViewResult((update(mode
|
|
|
104
104
|
* example when opening a date picker onto its current value so the selected
|
|
105
105
|
* month is visible. Returns the model directly because it produces no
|
|
106
106
|
* commands and no OutMessage. */
|
|
107
|
-
export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewResult((
|
|
107
|
+
export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewResult((modifyFields(model, {
|
|
108
108
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(date)), "@foldkit/ui/calendar/index.js#maybeFocusedDate"),
|
|
109
109
|
viewYear: () => __foldkitBrandViewResult((date.year), "@foldkit/ui/calendar/index.js#viewYear"),
|
|
110
110
|
viewMonth: () => __foldkitBrandViewResult((date.month), "@foldkit/ui/calendar/index.js#viewMonth"),
|
|
@@ -117,17 +117,17 @@ export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewRes
|
|
|
117
117
|
* Does NOT reconcile the current selection. If a previously-selected date
|
|
118
118
|
* is now below the new minimum, it remains selected. Callers should clear or
|
|
119
119
|
* reassign the selection explicitly if their domain requires it. */
|
|
120
|
-
export const reflectMinDate = Function.dual(2, (model, maybeMinDate) => __foldkitBrandViewResult((
|
|
120
|
+
export const reflectMinDate = Function.dual(2, (model, maybeMinDate) => __foldkitBrandViewResult((modifyFields(model, { maybeMinDate: () => __foldkitBrandViewResult((maybeMinDate), "@foldkit/ui/calendar/index.js#maybeMinDate") })), "@foldkit/ui/calendar/index.js#anonymous~2"));
|
|
121
121
|
/** Reflects the maximum selectable date onto the model. Pass `Option.none()`
|
|
122
122
|
* to remove the maximum. Does NOT reconcile the current selection. */
|
|
123
|
-
export const reflectMaxDate = Function.dual(2, (model, maybeMaxDate) => __foldkitBrandViewResult((
|
|
123
|
+
export const reflectMaxDate = Function.dual(2, (model, maybeMaxDate) => __foldkitBrandViewResult((modifyFields(model, { maybeMaxDate: () => __foldkitBrandViewResult((maybeMaxDate), "@foldkit/ui/calendar/index.js#maybeMaxDate") })), "@foldkit/ui/calendar/index.js#anonymous~3"));
|
|
124
124
|
/** Reflects the list of individually-disabled dates onto the model. Pass an
|
|
125
125
|
* empty array to clear. Does NOT reconcile the current selection. */
|
|
126
|
-
export const reflectDisabledDates = Function.dual(2, (model, disabledDates) => __foldkitBrandViewResult((
|
|
126
|
+
export const reflectDisabledDates = Function.dual(2, (model, disabledDates) => __foldkitBrandViewResult((modifyFields(model, { disabledDates: () => __foldkitBrandViewResult((disabledDates), "@foldkit/ui/calendar/index.js#disabledDates") })), "@foldkit/ui/calendar/index.js#anonymous~4"));
|
|
127
127
|
/** Reflects the days of the week that are disabled (e.g. weekends) onto the
|
|
128
128
|
* model. Pass an empty array to clear. Does NOT reconcile the current
|
|
129
129
|
* selection. */
|
|
130
|
-
export const reflectDisabledDaysOfWeek = Function.dual(2, (model, disabledDaysOfWeek) => __foldkitBrandViewResult((
|
|
130
|
+
export const reflectDisabledDaysOfWeek = Function.dual(2, (model, disabledDaysOfWeek) => __foldkitBrandViewResult((modifyFields(model, { disabledDaysOfWeek: () => __foldkitBrandViewResult((disabledDaysOfWeek), "@foldkit/ui/calendar/index.js#disabledDaysOfWeek") })), "@foldkit/ui/calendar/index.js#anonymous~5"));
|
|
131
131
|
/** Returns the calendar to Days mode regardless of current depth. Useful for
|
|
132
132
|
* standalone (non-popovered) consumers that want to wire their own back-out
|
|
133
133
|
* gesture. Popovered consumers like `DatePicker` don't need this. Escape
|
|
@@ -143,7 +143,7 @@ export const dropToDays = (model) => {
|
|
|
143
143
|
onNone: () => __foldkitBrandViewResult((1), "@foldkit/ui/calendar/index.js#onNone"),
|
|
144
144
|
onSome: date => __foldkitBrandViewResult((Math.min(date.day, Calendar.daysInMonth(model.viewYear, model.viewMonth))), "@foldkit/ui/calendar/index.js#onSome"),
|
|
145
145
|
});
|
|
146
|
-
return __foldkitBrandViewResult((
|
|
146
|
+
return __foldkitBrandViewResult((modifyFields(model, {
|
|
147
147
|
viewMode: () => __foldkitBrandViewResult(('Days'), "@foldkit/ui/calendar/index.js#viewMode"),
|
|
148
148
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(Calendar.make(model.viewYear, model.viewMonth, focusedDay))), "@foldkit/ui/calendar/index.js#maybeFocusedDate~2"),
|
|
149
149
|
})), "@foldkit/ui/calendar/index.js#dropToDays");
|
|
@@ -214,7 +214,7 @@ const currentOrFallbackFocus = (model) => __foldkitBrandViewResult((Option.getOr
|
|
|
214
214
|
* the parent infers month transitions from the date itself rather than from
|
|
215
215
|
* a separate `ChangedViewMonth` signal that would race with the selection. */
|
|
216
216
|
const commitSelection = (model, date) => (__foldkitBrandViewResult(({
|
|
217
|
-
model:
|
|
217
|
+
model: modifyFields(model, {
|
|
218
218
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(date)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~3"),
|
|
219
219
|
viewYear: () => __foldkitBrandViewResult((date.year), "@foldkit/ui/calendar/index.js#viewYear~2"),
|
|
220
220
|
viewMonth: () => __foldkitBrandViewResult((date.month), "@foldkit/ui/calendar/index.js#viewMonth~2"),
|
|
@@ -228,7 +228,7 @@ const applyFocusMove = (model, candidate, direction, cap) => {
|
|
|
228
228
|
const clamped = clampToRange(model, candidate);
|
|
229
229
|
const nextFocus = skipDisabled(model, clamped, direction, cap);
|
|
230
230
|
const crossedMonth = nextFocus.year !== model.viewYear || nextFocus.month !== model.viewMonth;
|
|
231
|
-
const nextModel =
|
|
231
|
+
const nextModel = modifyFields(model, {
|
|
232
232
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(nextFocus)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~4"),
|
|
233
233
|
viewYear: () => __foldkitBrandViewResult((nextFocus.year), "@foldkit/ui/calendar/index.js#viewYear~3"),
|
|
234
234
|
viewMonth: () => __foldkitBrandViewResult((nextFocus.month), "@foldkit/ui/calendar/index.js#viewMonth~3"),
|
|
@@ -265,7 +265,7 @@ const applyViewMonthChange = (model, year, month, direction) => {
|
|
|
265
265
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/calendar/index.js#applyViewMonthChange");
|
|
266
266
|
}
|
|
267
267
|
const nextFocus = moveFocusForViewChange(model, year, month, direction);
|
|
268
|
-
const nextModel =
|
|
268
|
+
const nextModel = modifyFields(model, {
|
|
269
269
|
viewYear: () => __foldkitBrandViewResult((year), "@foldkit/ui/calendar/index.js#viewYear~4"),
|
|
270
270
|
viewMonth: () => __foldkitBrandViewResult((month), "@foldkit/ui/calendar/index.js#viewMonth~4"),
|
|
271
271
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(nextFocus)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~5"),
|
|
@@ -298,7 +298,7 @@ const applyMonthsFocusShift = (model, monthShift) => {
|
|
|
298
298
|
const focused = currentOrFallbackFocus(model);
|
|
299
299
|
const nextFocus = Calendar.addMonths(focused, monthShift);
|
|
300
300
|
return __foldkitBrandViewResult(({
|
|
301
|
-
model:
|
|
301
|
+
model: modifyFields(model, {
|
|
302
302
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(nextFocus)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~6"),
|
|
303
303
|
viewYear: () => __foldkitBrandViewResult((nextFocus.year), "@foldkit/ui/calendar/index.js#viewYear~5"),
|
|
304
304
|
}),
|
|
@@ -312,7 +312,7 @@ const applyYearsFocusShift = (model, yearShift) => {
|
|
|
312
312
|
const focused = currentOrFallbackFocus(model);
|
|
313
313
|
const nextFocus = Calendar.addYears(focused, yearShift);
|
|
314
314
|
return __foldkitBrandViewResult(({
|
|
315
|
-
model:
|
|
315
|
+
model: modifyFields(model, {
|
|
316
316
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(nextFocus)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~7"),
|
|
317
317
|
}),
|
|
318
318
|
}), "@foldkit/ui/calendar/index.js#applyYearsFocusShift");
|
|
@@ -360,10 +360,10 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
360
360
|
return __foldkitBrandViewResult((applyViewMonthChange(model, next.year, next.month, 1)), "@foldkit/ui/calendar/index.js#ClickedNextMonthButton");
|
|
361
361
|
},
|
|
362
362
|
ClickedHeading: () => __foldkitBrandViewResult((Match.value(model.viewMode).pipe(withUpdateReturn, Match.when('Days', () => (__foldkitBrandViewResult(({
|
|
363
|
-
model:
|
|
363
|
+
model: modifyFields(model, { viewMode: () => __foldkitBrandViewResult(('Months'), "@foldkit/ui/calendar/index.js#viewMode~2") }),
|
|
364
364
|
commands: [FocusGrid({ id: model.id })],
|
|
365
365
|
}), "@foldkit/ui/calendar/index.js#anonymous~35"))), Match.when('Months', () => (__foldkitBrandViewResult(({
|
|
366
|
-
model:
|
|
366
|
+
model: modifyFields(model, { viewMode: () => __foldkitBrandViewResult(('Years'), "@foldkit/ui/calendar/index.js#viewMode~3") }),
|
|
367
367
|
commands: [FocusGrid({ id: model.id })],
|
|
368
368
|
}), "@foldkit/ui/calendar/index.js#anonymous~36"))), Match.when('Years', () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/calendar/index.js#anonymous~37"))), Match.exhaustive)), "@foldkit/ui/calendar/index.js#ClickedHeading"),
|
|
369
369
|
SelectedMonth: ({ month }) => {
|
|
@@ -373,7 +373,9 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
373
373
|
else {
|
|
374
374
|
const viewMonthChange = applyViewMonthChange(model, model.viewYear, month, jumpDirection(model, model.viewYear, month));
|
|
375
375
|
const monthSelection = {
|
|
376
|
-
model:
|
|
376
|
+
model: modifyFields(viewMonthChange.model, {
|
|
377
|
+
viewMode: () => __foldkitBrandViewResult(('Days'), "@foldkit/ui/calendar/index.js#viewMode~4"),
|
|
378
|
+
}),
|
|
377
379
|
commands: [FocusGrid({ id: model.id })],
|
|
378
380
|
};
|
|
379
381
|
return __foldkitBrandViewResult((pipe(monthSelection, Update.withOutMessage(viewMonthChange.outMessage))), "@foldkit/ui/calendar/index.js#SelectedMonth");
|
|
@@ -386,17 +388,23 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
386
388
|
else {
|
|
387
389
|
const yearViewMonthChange = applyViewMonthChange(model, year, model.viewMonth, jumpDirection(model, year, model.viewMonth));
|
|
388
390
|
const yearSelection = {
|
|
389
|
-
model:
|
|
391
|
+
model: modifyFields(yearViewMonthChange.model, {
|
|
392
|
+
viewMode: () => __foldkitBrandViewResult(('Months'), "@foldkit/ui/calendar/index.js#viewMode~5"),
|
|
393
|
+
}),
|
|
390
394
|
commands: [FocusGrid({ id: model.id })],
|
|
391
395
|
};
|
|
392
396
|
return __foldkitBrandViewResult((pipe(yearSelection, Update.withOutMessage(yearViewMonthChange.outMessage))), "@foldkit/ui/calendar/index.js#SelectedYear");
|
|
393
397
|
}
|
|
394
398
|
},
|
|
395
399
|
PagedYears: ({ direction }) => __foldkitBrandViewResult((applyYearsFocusShift(model, direction * YEARS_PAGE_SIZE)), "@foldkit/ui/calendar/index.js#PagedYears"),
|
|
396
|
-
FocusedGrid: () => (__foldkitBrandViewResult(({
|
|
397
|
-
|
|
400
|
+
FocusedGrid: () => (__foldkitBrandViewResult(({
|
|
401
|
+
model: modifyFields(model, { isGridFocused: () => __foldkitBrandViewResult((true), "@foldkit/ui/calendar/index.js#isGridFocused") }),
|
|
402
|
+
}), "@foldkit/ui/calendar/index.js#FocusedGrid")),
|
|
403
|
+
BlurredGrid: () => (__foldkitBrandViewResult(({
|
|
404
|
+
model: modifyFields(model, { isGridFocused: () => __foldkitBrandViewResult((false), "@foldkit/ui/calendar/index.js#isGridFocused~2") }),
|
|
405
|
+
}), "@foldkit/ui/calendar/index.js#BlurredGrid")),
|
|
398
406
|
RefreshedToday: ({ today }) => (__foldkitBrandViewResult(({
|
|
399
|
-
model:
|
|
407
|
+
model: modifyFields(model, { today: () => __foldkitBrandViewResult((today), "@foldkit/ui/calendar/index.js#today") }),
|
|
400
408
|
}), "@foldkit/ui/calendar/index.js#RefreshedToday")),
|
|
401
409
|
CompletedFocusGrid: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/calendar/index.js#CompletedFocusGrid")),
|
|
402
410
|
})), "@foldkit/ui/calendar/index.js#update");
|
package/dist/checkbox/index.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare const descriptionId: (id: string) => string;
|
|
|
77
77
|
*
|
|
78
78
|
* // In update:
|
|
79
79
|
* ToggledTerms: ({ isChecked }) => ({
|
|
80
|
-
* model:
|
|
80
|
+
* model: modifyFields(model, { acceptedTerms: () => isChecked }),
|
|
81
81
|
* }),
|
|
82
82
|
* ``` */
|
|
83
83
|
export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
|
package/dist/checkbox/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export const descriptionId = (id) => __foldkitBrandViewResult((`${id}-descriptio
|
|
|
22
22
|
*
|
|
23
23
|
* // In update:
|
|
24
24
|
* ToggledTerms: ({ isChecked }) => ({
|
|
25
|
-
* model:
|
|
25
|
+
* model: modifyFields(model, { acceptedTerms: () => isChecked }),
|
|
26
26
|
* }),
|
|
27
27
|
* ``` */
|
|
28
28
|
export const view = (config, h) => {
|
package/dist/combobox/multi.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const Model: Schema.Struct<{
|
|
|
15
15
|
readonly id: Schema.String;
|
|
16
16
|
readonly isShowing: Schema.Boolean;
|
|
17
17
|
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
18
|
+
readonly transitionGeneration: Schema.Number;
|
|
18
19
|
}>;
|
|
19
20
|
readonly maybeActiveItemIndex: Schema.Option<Schema.Number>;
|
|
20
21
|
readonly activationTrigger: Schema.Literals<readonly ["Pointer", "Keyboard"]>;
|
|
@@ -47,6 +48,7 @@ export declare const update: (model: {
|
|
|
47
48
|
readonly id: string;
|
|
48
49
|
readonly isShowing: boolean;
|
|
49
50
|
readonly transitionState: "EnterAnimating" | "EnterStart" | "Idle" | "LeaveAnimating" | "LeaveStart";
|
|
51
|
+
readonly transitionGeneration: number;
|
|
50
52
|
};
|
|
51
53
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
52
54
|
readonly activationTrigger: "Keyboard" | "Pointer";
|
|
@@ -68,6 +70,7 @@ export declare const update: (model: {
|
|
|
68
70
|
readonly id: string;
|
|
69
71
|
readonly isShowing: boolean;
|
|
70
72
|
readonly transitionState: "EnterAnimating" | "EnterStart" | "Idle" | "LeaveAnimating" | "LeaveStart";
|
|
73
|
+
readonly transitionGeneration: number;
|
|
71
74
|
};
|
|
72
75
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
73
76
|
readonly activationTrigger: "Keyboard" | "Pointer";
|
|
@@ -120,8 +123,10 @@ export declare const update: (model: {
|
|
|
120
123
|
readonly _tag: "GotAnimationMessage";
|
|
121
124
|
readonly message: {
|
|
122
125
|
readonly _tag: "CompletedWaitForPaint";
|
|
126
|
+
readonly generation: number;
|
|
123
127
|
} | {
|
|
124
128
|
readonly _tag: "EndedAnimation";
|
|
129
|
+
readonly generation: number;
|
|
125
130
|
} | {
|
|
126
131
|
readonly _tag: "Hid";
|
|
127
132
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../src/combobox/multi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,KAAK,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE5D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,OAAO,EACP,UAAU,EAKX,MAAM,aAAa,CAAA;AAIpB,qOAAqO;AACrO,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../src/combobox/multi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,KAAK,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE5D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,OAAO,EACP,UAAU,EAKX,MAAM,aAAa,CAAA;AAIpB,qOAAqO;AACrO,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;EAEhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,mOAAmO;AACnO,MAAM,MAAM,UAAU,GAAG,cAAc,CAAA;AAEvC,+HAA+H;AAC/H,eAAO,MAAM,IAAI,WAAY,UAAU,KAAG,KAAyB,CAAA;AAInE;;;;;8DAK8D;AAC9D,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,OAAK,MAAM,CAAC,IAAI,CA2BlE,CAAA"}
|
package/dist/combobox/multi.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import { Option, Schema } from 'effect';
|
|
3
|
-
import {
|
|
3
|
+
import { modifyFields } from 'foldkit/struct';
|
|
4
4
|
import { BaseModel, Message, OutMessage, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared.js';
|
|
5
5
|
// MODEL
|
|
6
6
|
/** Schema for the multi-select combobox's private interaction state (open/closed status, active item, activation trigger, typed input value). The selection is owned by the parent and passed in via `ViewInputs.selectedValues`. */
|
|
@@ -18,7 +18,7 @@ export const init = (config) => __foldkitBrandViewResult((baseInit(config)), "@f
|
|
|
18
18
|
* design. Clear the selection by toggling each value off. */
|
|
19
19
|
export const update = makeUpdate({
|
|
20
20
|
handleClose: model => (__foldkitBrandViewResult(({
|
|
21
|
-
model:
|
|
21
|
+
model: modifyFields(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/multi.js#inputValue") }),
|
|
22
22
|
}), "@foldkit/ui/combobox/multi.js#handleClose")),
|
|
23
23
|
handleSelectedItem: (model, item) => (__foldkitBrandViewResult(({
|
|
24
24
|
model,
|