foldkit-primitives 0.15.3 → 0.15.4
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/device/index.d.mts +10 -20
- package/dist/device/index.d.mts.map +1 -1
- package/dist/device/index.mjs +6 -11
- package/dist/device/index.mjs.map +1 -1
- package/dist/dom/index.d.mts +1 -37
- package/dist/dom/index.d.mts.map +1 -1
- package/dist/dom/index.mjs +18 -35
- package/dist/dom/index.mjs.map +1 -1
- package/dist/{editable-text-1D31qthY.d.mts → editable-text-Bg7vil7h.d.mts} +1 -13
- package/dist/editable-text-Bg7vil7h.d.mts.map +1 -0
- package/dist/events/index.d.mts +1 -17
- package/dist/events/index.d.mts.map +1 -1
- package/dist/events/index.mjs +10 -18
- package/dist/events/index.mjs.map +1 -1
- package/dist/{follow-tab-stop-Caog2qg1.mjs → follow-tab-stop-DM5EI4Ci.mjs} +8 -15
- package/dist/{follow-tab-stop-Caog2qg1.mjs.map → follow-tab-stop-DM5EI4Ci.mjs.map} +1 -1
- package/dist/{index-CmmxqSEi.d.mts → index-Bomdwb7e.d.mts} +4 -11
- package/dist/index-Bomdwb7e.d.mts.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/{input-modality-BXD383jg.mjs → input-modality-XwQOFLip.mjs} +2 -3
- package/dist/{input-modality-BXD383jg.mjs.map → input-modality-XwQOFLip.mjs.map} +1 -1
- package/dist/{input-modality-BY-bSrEc.d.mts → input-modality-l7InESYh.d.mts} +1 -3
- package/dist/input-modality-l7InESYh.d.mts.map +1 -0
- package/dist/interaction/index.d.mts +2 -3
- package/dist/interaction/index.d.mts.map +1 -1
- package/dist/interaction/index.mjs +24 -44
- package/dist/interaction/index.mjs.map +1 -1
- package/dist/{internal-DP-xLKbT.mjs → internal-C4gHodLc.mjs} +2 -3
- package/dist/{internal-DP-xLKbT.mjs.map → internal-C4gHodLc.mjs.map} +1 -1
- package/dist/media/index.d.mts +0 -6
- package/dist/media/index.d.mts.map +1 -1
- package/dist/media/index.mjs +3 -6
- package/dist/media/index.mjs.map +1 -1
- package/dist/motion/index.d.mts +1 -1
- package/dist/motion/index.mjs +1 -1
- package/dist/{motion-DmFDppRn.mjs → motion-BmlJCjn6.mjs} +6 -10
- package/dist/{motion-DmFDppRn.mjs.map → motion-BmlJCjn6.mjs.map} +1 -1
- package/dist/net/index.d.mts +0 -10
- package/dist/net/index.d.mts.map +1 -1
- package/dist/net/index.mjs +6 -11
- package/dist/net/index.mjs.map +1 -1
- package/dist/observers/index.d.mts +0 -8
- package/dist/observers/index.d.mts.map +1 -1
- package/dist/observers/index.mjs +4 -8
- package/dist/observers/index.mjs.map +1 -1
- package/dist/{rolldown-runtime-D7D4PA-g.mjs → rolldown-runtime-D8jQpDG7.mjs} +1 -2
- package/dist/state/index.d.mts +0 -12
- package/dist/state/index.d.mts.map +1 -1
- package/dist/state/index.mjs +7 -13
- package/dist/state/index.mjs.map +1 -1
- package/dist/time/index.d.mts +0 -12
- package/dist/time/index.d.mts.map +1 -1
- package/dist/time/index.mjs +6 -12
- package/dist/time/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/editable-text-1D31qthY.d.mts.map +0 -1
- package/dist/index-CmmxqSEi.d.mts.map +0 -1
- package/dist/input-modality-BY-bSrEc.d.mts.map +0 -1
package/dist/dom/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as FocusScope, C as targetOf, D as Moved, E as MoveStarted, O as HideOutside, S as Targets, T as MoveEnded, _ as PointerDrag, a as TextCommitted, b as TargetHovered, c as DRAG_THRESHOLD, d as DragPlace, f as DragStarted, g as HOLD_TO_DRAG_MS, h as HOLD_SLOP, i as TextCancelled, j as tabbableWithin, k as ScrollLock, l as DragCancelled, m as DraggedOver, n as EditAsked, o as TextEdited, p as DragZone, r as EditableText, s as textOf, t as FollowTabStop, u as DragDropped, v as boxOf, w as Move, x as TargetPressed, y as zoneOf } from "../follow-tab-stop-
|
|
1
|
+
import { A as FocusScope, C as targetOf, D as Moved, E as MoveStarted, O as HideOutside, S as Targets, T as MoveEnded, _ as PointerDrag, a as TextCommitted, b as TargetHovered, c as DRAG_THRESHOLD, d as DragPlace, f as DragStarted, g as HOLD_TO_DRAG_MS, h as HOLD_SLOP, i as TextCancelled, j as tabbableWithin, k as ScrollLock, l as DragCancelled, m as DraggedOver, n as EditAsked, o as TextEdited, p as DragZone, r as EditableText, s as textOf, t as FollowTabStop, u as DragDropped, v as boxOf, w as Move, x as TargetPressed, y as zoneOf } from "../follow-tab-stop-DM5EI4Ci.mjs";
|
|
2
2
|
import { Effect, Option, Queue, Schema, Stream } from "effect";
|
|
3
3
|
import * as Mount from "foldkit/mount";
|
|
4
4
|
import { defineMessageUnion } from "foldkit/message";
|
|
5
5
|
import * as Dom from "foldkit/dom";
|
|
6
6
|
import { fromString, toString } from "foldkit/url";
|
|
7
|
-
|
|
7
|
+
// src/dom/autofocus.ts
|
|
8
8
|
const Focused = Schema.TaggedStruct("Focused", {});
|
|
9
9
|
/**
|
|
10
10
|
* Autofocus as a Mount: focuses the element on insert, then emits `Focused`.
|
|
@@ -21,8 +21,7 @@ const Autofocus = Mount.define("Autofocus", {
|
|
|
21
21
|
return Focused.make({});
|
|
22
22
|
})
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
//#region src/dom/clipboard.ts
|
|
24
|
+
// src/dom/clipboard.ts
|
|
26
25
|
/**
|
|
27
26
|
* The clipboard as Commands: run in `update` beside any bundle. A copy yields
|
|
28
27
|
* `Copied` or `CopyFailed`, a read `Read` or `ReadFailed`. No Model involved:
|
|
@@ -67,8 +66,7 @@ const readText = () => ({
|
|
|
67
66
|
onSuccess: (text) => Effect.succeed(ClipboardReadMessage.Read({ text }))
|
|
68
67
|
}) : Effect.succeed(ClipboardReadMessage.ReadFailed({ message: "clipboard is unavailable" }))
|
|
69
68
|
});
|
|
70
|
-
|
|
71
|
-
//#region src/dom/input-mask.ts
|
|
69
|
+
// src/dom/input-mask.ts
|
|
72
70
|
/** What `InputMask` reports after each edit: the masked text shown, and the characters typed. */
|
|
73
71
|
const Input = Schema.TaggedStruct("Input", {
|
|
74
72
|
value: Schema.String,
|
|
@@ -153,8 +151,7 @@ const InputMask = Mount.defineStream("InputMask", {
|
|
|
153
151
|
}), (current) => Effect.sync(() => current.removeEventListener("input", onInput)));
|
|
154
152
|
}))
|
|
155
153
|
});
|
|
156
|
-
|
|
157
|
-
//#region src/dom/keep-in-view.ts
|
|
154
|
+
// src/dom/keep-in-view.ts
|
|
158
155
|
/**
|
|
159
156
|
* Keeps what is marked in view as a Mount: whenever an element in the mounted
|
|
160
157
|
* one's subtree newly matches `selector`, such as the row just selected in a
|
|
@@ -187,8 +184,7 @@ selector: Schema.String },
|
|
|
187
184
|
return observer;
|
|
188
185
|
}), (observer) => Effect.sync(() => observer.disconnect())))
|
|
189
186
|
});
|
|
190
|
-
|
|
191
|
-
//#region src/dom/script-loader.ts
|
|
187
|
+
// src/dom/script-loader.ts
|
|
192
188
|
/**
|
|
193
189
|
* Script loading as a Command: appends a `src` script to the head unless one
|
|
194
190
|
* is already there. Idempotent by URL — concurrent placements collapse onto
|
|
@@ -237,8 +233,7 @@ const loadScript = (src) => ({
|
|
|
237
233
|
onSuccess: () => Effect.succeed(ScriptMessage.Loaded())
|
|
238
234
|
})
|
|
239
235
|
});
|
|
240
|
-
|
|
241
|
-
//#region src/dom/share.ts
|
|
236
|
+
// src/dom/share.ts
|
|
242
237
|
/**
|
|
243
238
|
* Web Share as a Command: runs in `update` beside any bundle, yields
|
|
244
239
|
* `Shared` on success. Dismissal is its own outcome, not a failure — the
|
|
@@ -274,8 +269,7 @@ const share = (data) => ({
|
|
|
274
269
|
onSuccess: () => Effect.succeed(ShareMessage.Shared())
|
|
275
270
|
}) : Effect.succeed(ShareMessage.ShareFailed({ message: "share is unavailable" }))
|
|
276
271
|
});
|
|
277
|
-
|
|
278
|
-
//#region src/dom/measure.ts
|
|
272
|
+
// src/dom/measure.ts
|
|
279
273
|
/** The custom properties `Measure` writes for a target named `name`. */
|
|
280
274
|
const measured = (name) => ({
|
|
281
275
|
x: `--fk-${name}-x`,
|
|
@@ -393,8 +387,7 @@ targets: Schema.Record(Schema.String, Schema.String) },
|
|
|
393
387
|
};
|
|
394
388
|
}), (stop) => Effect.sync(stop)))
|
|
395
389
|
});
|
|
396
|
-
|
|
397
|
-
//#region src/dom/scroll.ts
|
|
390
|
+
// src/dom/scroll.ts
|
|
398
391
|
/**
|
|
399
392
|
* Where the window is scrolled, across an application's own navigations, as
|
|
400
393
|
* a stream. Left to itself, a browser keeps the scroll of the entry it
|
|
@@ -531,8 +524,7 @@ const keepScroll = (options = {}) => {
|
|
|
531
524
|
const patience = options.patience ?? 2e3;
|
|
532
525
|
return Stream.callback(() => Effect.acquireRelease(Effect.sync(() => attach(storageKey, kept, patience)), (detach) => Effect.sync(detach)));
|
|
533
526
|
};
|
|
534
|
-
|
|
535
|
-
//#region src/dom/pointed-links.ts
|
|
527
|
+
// src/dom/pointed-links.ts
|
|
536
528
|
/**
|
|
537
529
|
* The address of the link a reader points at or tabs to, on the page's own
|
|
538
530
|
* origin: where they may go next, for a `Data.preload` before they go. Each
|
|
@@ -556,8 +548,7 @@ const pointedLinks = () => {
|
|
|
556
548
|
filterMapEvent: linkOf
|
|
557
549
|
})).pipe(Stream.changesWith((a, b) => toString(a) === toString(b)));
|
|
558
550
|
};
|
|
559
|
-
|
|
560
|
-
//#region src/dom/fluid-hover.ts
|
|
551
|
+
// src/dom/fluid-hover.ts
|
|
561
552
|
/** The custom properties `FluidHover` writes on its container for a highlight named `name`. */
|
|
562
553
|
const fluidHovered = (name) => ({
|
|
563
554
|
x: `--fk-${name}-x`,
|
|
@@ -846,8 +837,7 @@ const FluidHover = Mount.defineStream("FluidHover", {
|
|
|
846
837
|
};
|
|
847
838
|
}), (stop) => Effect.sync(stop)))
|
|
848
839
|
});
|
|
849
|
-
|
|
850
|
-
//#region src/dom/keyboard-inset.ts
|
|
840
|
+
// src/dom/keyboard-inset.ts
|
|
851
841
|
/**
|
|
852
842
|
* The custom property `KeyboardInset` writes on its element: how much of the layout
|
|
853
843
|
* viewport's bottom the on-screen keyboard (or anything else the visual viewport leaves
|
|
@@ -887,8 +877,7 @@ const KeyboardInset = Mount.defineStream("KeyboardInset", {
|
|
|
887
877
|
};
|
|
888
878
|
}), (release) => Effect.sync(release)))
|
|
889
879
|
});
|
|
890
|
-
|
|
891
|
-
//#region src/dom/scroll-bars.ts
|
|
880
|
+
// src/dom/scroll-bars.ts
|
|
892
881
|
/**
|
|
893
882
|
* The attribute that marks a bar beside a scroller `ScrollBars` runs on, set
|
|
894
883
|
* to the axis it shows: `block` (the up-and-down bar) or `inline`.
|
|
@@ -1142,8 +1131,7 @@ const ScrollBars = Mount.defineStream("ScrollBars", {
|
|
|
1142
1131
|
};
|
|
1143
1132
|
}), (stop) => Effect.sync(stop)))
|
|
1144
1133
|
});
|
|
1145
|
-
|
|
1146
|
-
//#region src/dom/swipe.ts
|
|
1134
|
+
// src/dom/swipe.ts
|
|
1147
1135
|
const SwipeStarted = Schema.TaggedStruct("SwipeStarted", {
|
|
1148
1136
|
pointerId: Schema.Number,
|
|
1149
1137
|
pointerType: Schema.String,
|
|
@@ -1429,8 +1417,7 @@ const Swipe = Mount.defineStream("Swipe", {
|
|
|
1429
1417
|
} catch {}
|
|
1430
1418
|
})))
|
|
1431
1419
|
});
|
|
1432
|
-
|
|
1433
|
-
//#region src/dom/scroll-settle.ts
|
|
1420
|
+
// src/dom/scroll-settle.ts
|
|
1434
1421
|
const ScrollSettled = Schema.TaggedStruct("ScrollSettled", {
|
|
1435
1422
|
/** The item whose start lies nearest the scroller's start, from 0. */
|
|
1436
1423
|
index: Schema.Number });
|
|
@@ -1509,8 +1496,7 @@ const ScrollSettle = Mount.defineStream("ScrollSettle", {
|
|
|
1509
1496
|
};
|
|
1510
1497
|
}), (detach) => Effect.sync(detach)))
|
|
1511
1498
|
});
|
|
1512
|
-
|
|
1513
|
-
//#region src/dom/pointer-position.ts
|
|
1499
|
+
// src/dom/pointer-position.ts
|
|
1514
1500
|
/**
|
|
1515
1501
|
* A place in an element's padding box, in CSS pixels from its top left
|
|
1516
1502
|
* corner, and the pointer's pressure there (0 to 1; a mouse reads 0.5 while
|
|
@@ -1678,8 +1664,7 @@ focus: Schema.optionalKey(Schema.String) },
|
|
|
1678
1664
|
};
|
|
1679
1665
|
}), (stop) => Effect.sync(stop)))
|
|
1680
1666
|
});
|
|
1681
|
-
|
|
1682
|
-
//#region src/dom/track-box.ts
|
|
1667
|
+
// src/dom/track-box.ts
|
|
1683
1668
|
/** The attribute on the mounted element naming the element `TrackBox` follows, by id. */
|
|
1684
1669
|
const TRACK_TARGET_ATTRIBUTE = "data-target";
|
|
1685
1670
|
/** The custom properties `TrackBox` writes for `name`, as `measured` names `Measure`'s. */
|
|
@@ -1805,8 +1790,7 @@ const TrackBox = Mount.defineStream("TrackBox", {
|
|
|
1805
1790
|
};
|
|
1806
1791
|
}), (stop) => Effect.sync(stop)))
|
|
1807
1792
|
});
|
|
1808
|
-
|
|
1809
|
-
//#region src/dom/image-decode.ts
|
|
1793
|
+
// src/dom/image-decode.ts
|
|
1810
1794
|
/**
|
|
1811
1795
|
* An image fetched and decoded before it is shown, as a Command: a lightbox
|
|
1812
1796
|
* or a carousel asks for the next picture, and shows it on `Decoded`, so the
|
|
@@ -1851,7 +1835,6 @@ const decodeImage = (source) => ({
|
|
|
1851
1835
|
onSuccess: () => Effect.succeed(ImageDecodeMessage.Decoded({ src: source.src }))
|
|
1852
1836
|
})
|
|
1853
1837
|
});
|
|
1854
|
-
//#endregion
|
|
1855
1838
|
export { Autofocus, ClipboardMessage, ClipboardReadMessage, DRAG_THRESHOLD, DragCancelled, DragDropped, DragPlace, DragStarted, DragZone, DraggedOver, EditAsked, EditableText, FLUID_HELD_ATTRIBUTE, FLUID_HOVER_ATTRIBUTE, FLUID_LIT_ATTRIBUTE, FLUID_PRESS_ATTRIBUTE, FluidHover, FocusScope, Focused, FollowTabStop, HOLD_SLOP, HOLD_TO_DRAG_MS, HideOutside, ImageDecodeMessage, Input, InputMask, KEYBOARD_INSET, KeepInView, KeyboardInset, Measure, Move, MoveEnded, MoveStarted, Moved, NO_SWIPE, PointerDrag, PointerMoved, PointerPoint, PointerPosition, PointerPressed, PointerReleased, SCROLL_BAR_ATTRIBUTE, SCROLL_OVERLAID_ATTRIBUTE, SETTLE_QUIET, SWIPE_WINDOW, ScriptMessage, ScrollBars, ScrollLock, ScrollSettle, ScrollSettled, ShareData, ShareMessage, Swipe, SwipeEnded, SwipeStarted, Swiped, TRACK_TARGET_ATTRIBUTE, TargetHovered, TargetPressed, Targets, TextCancelled, TextCommitted, TextEdited, TrackBox, TrackedTarget, applyMask, boxOf, canScroll, copyText, cornerRadius, decodeImage, fluidHovered, keepScroll, keyboardInset, loadScript, measurePaddingBox, measured, paddingBoxOf, pointedLinks, readText, scrollThumb, share, tabbableWithin, targetOf, textOf, trackedBox, velocityOf, zoneOf };
|
|
1856
1839
|
|
|
1857
1840
|
//# sourceMappingURL=index.mjs.map
|