@gjermundgaraba-designs/pixel-paper 0.23.0 → 0.25.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/DESIGN.md +11 -8
- package/dist/src/iconButton/iconButton.d.ts +6 -1
- package/dist/src/iconButton/iconButton.d.ts.map +1 -1
- package/dist/src/iconButton/iconButton.js +7 -2
- package/dist/src/panel/panel.d.ts +3 -0
- package/dist/src/panel/panel.d.ts.map +1 -1
- package/dist/src/panel/panel.js +2 -1
- package/dist/src/rail/index.d.ts +1 -1
- package/dist/src/rail/index.d.ts.map +1 -1
- package/dist/src/rail/index.js +1 -1
- package/dist/src/rail/rail.d.ts +78 -17
- package/dist/src/rail/rail.d.ts.map +1 -1
- package/dist/src/rail/rail.js +98 -41
- package/dist/src/reel/index.d.ts +1 -1
- package/dist/src/reel/index.d.ts.map +1 -1
- package/dist/src/reel/index.js +1 -1
- package/dist/src/reel/reel.d.ts +85 -7
- package/dist/src/reel/reel.d.ts.map +1 -1
- package/dist/src/reel/reel.js +232 -115
- package/dist/src/tips/tips.d.ts +30 -1
- package/dist/src/tips/tips.d.ts.map +1 -1
- package/dist/src/tips/tips.js +53 -31
- package/package.json +1 -1
- package/src/iconButton/iconButton.ts +19 -2
- package/src/panel/panel.ts +5 -0
- package/src/pixel-paper.css +167 -4
- package/src/rail/index.ts +2 -0
- package/src/rail/rail.ts +119 -41
- package/src/reel/index.ts +2 -0
- package/src/reel/reel.ts +221 -31
- package/src/tips/tips.ts +71 -35
- package/src/tokens.css +1 -0
package/dist/src/rail/rail.js
CHANGED
|
@@ -22,8 +22,8 @@ const Resizing = Schema.Struct({
|
|
|
22
22
|
width: Schema.Number,
|
|
23
23
|
});
|
|
24
24
|
/** Schema for a rail: whether it is open as a drawer (at 900px and under; wider, it is always
|
|
25
|
-
* in the page and this stays false), and its splitter while a pointer drags it. Its width
|
|
26
|
-
* the parent's. */
|
|
25
|
+
* in the page and this stays false), and its splitter while a pointer drags it. Its width,
|
|
26
|
+
* and whether the reader hid it, are the parent's. */
|
|
27
27
|
export const Model = Schema.Struct({
|
|
28
28
|
id: Schema.String,
|
|
29
29
|
isOpen: Schema.Boolean,
|
|
@@ -35,6 +35,7 @@ export const Model = Schema.Struct({
|
|
|
35
35
|
* the window growing past 900px while it is open, where the rail is back in the page. */
|
|
36
36
|
export const Message = defineMessageUnion({
|
|
37
37
|
ClickedOpen: {},
|
|
38
|
+
ClickedToggle: {},
|
|
38
39
|
PressedSplitter: { pointerId: Schema.Number, clientX: Schema.Number, width: Schema.Number },
|
|
39
40
|
MovedSplitter: { clientX: Schema.Number },
|
|
40
41
|
ReleasedSplitter: { clientX: Schema.Number },
|
|
@@ -47,12 +48,16 @@ export const Message = defineMessageUnion({
|
|
|
47
48
|
WidenedPastDrawer: {},
|
|
48
49
|
CompletedShowRailDrawer: {},
|
|
49
50
|
CompletedHideRailDrawer: {},
|
|
51
|
+
CompletedFocusRailToggle: {},
|
|
50
52
|
});
|
|
51
53
|
/** What a rail asks of its parent. `ResizedRail`: its splitter was let go, or stepped by a
|
|
52
54
|
* key, at `width` pixels, within the rail's bounds; the parent keeps it (per client) and
|
|
53
|
-
* passes it back as the view's `maybeWidth`.
|
|
55
|
+
* passes it back as the view's `maybeWidth`. `ToggledRail`: its toggle was pressed; the
|
|
56
|
+
* parent flips whether it keeps the rail hidden (per client) and passes it back as the view's
|
|
57
|
+
* `isHidden`. */
|
|
54
58
|
export const OutMessage = defineMessageUnion({
|
|
55
59
|
ResizedRail: { width: Schema.Number },
|
|
60
|
+
ToggledRail: {},
|
|
56
61
|
});
|
|
57
62
|
/** Creates a rail, closed, its splitter at rest. */
|
|
58
63
|
export const init = (config) => (__foldkitBrandViewResult(({
|
|
@@ -75,12 +80,14 @@ export const id = (model) => __foldkitBrandViewResult((model.id), "@gjermundgara
|
|
|
75
80
|
/** Whether the rail is open as a drawer: a parent pauses its own page keys while it is. */
|
|
76
81
|
export const isOpen = (model) => __foldkitBrandViewResult((model.isOpen), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#isOpen");
|
|
77
82
|
const openButtonId = (model) => __foldkitBrandViewResult((`${model.id}-open`), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#openButtonId");
|
|
83
|
+
const toggleId = (model) => __foldkitBrandViewResult((`${model.id}-toggle`), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#toggleId");
|
|
78
84
|
// COMMAND
|
|
79
85
|
const FOCUSABLE = "a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]";
|
|
80
86
|
const findRail = (railId) => __foldkitBrandViewResult((Effect.suspend(() => __foldkitBrandViewResult((Effect.fromNullishOr(document.querySelector(`#${CSS.escape(railId)}`))), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous"))), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#findRail");
|
|
81
87
|
/** The drawer's first Tab stop past its head: a control the keyboard reaches, so a tree's
|
|
82
|
-
* items other than its one stop (`tabindex="-1"`) are passed over
|
|
83
|
-
|
|
88
|
+
* items other than its one stop (`tabindex="-1"`) are passed over, and so is the toggle,
|
|
89
|
+
* which the drawer does not print. */
|
|
90
|
+
export const firstTabStop = (rail) => __foldkitBrandViewResult((Array.findFirst(Array.fromIterable(rail.querySelectorAll(`.rail-head ~ * :is(${FOCUSABLE})`)), (control) => __foldkitBrandViewResult((control.tabIndex >= 0 && control.closest("[inert], [hidden], .rail-toggle") === null), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~2"))), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#firstTabStop");
|
|
84
91
|
/** Opens the rail as a drawer over the page and puts focus on its first control past its
|
|
85
92
|
* head. */
|
|
86
93
|
export const ShowRailDrawer = Command.define("ShowRailDrawer", {
|
|
@@ -108,6 +115,22 @@ export const HideRailDrawer = Command.define("HideRailDrawer", {
|
|
|
108
115
|
}
|
|
109
116
|
}).pipe(Effect.ignore, Effect.andThen(isReturningFocus ? Dom.focus(`#${CSS.escape(buttonId)}`).pipe(Effect.ignore) : Effect.void), Effect.as(Message.CompletedHideRailDrawer()))), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#execute~2"),
|
|
110
117
|
});
|
|
118
|
+
/** Puts focus on the rail's toggle once the rail has folded or unfolded, if focus was in the
|
|
119
|
+
* rail or on its splitter: folding takes away every control in it but the toggle, which
|
|
120
|
+
* brings it back, and the splitter with them. Focus anywhere else stays where it is. */
|
|
121
|
+
export const FocusRailToggle = Command.define("FocusRailToggle", {
|
|
122
|
+
args: { railId: Schema.String, toggleId: Schema.String },
|
|
123
|
+
messages: [Message.CompletedFocusRailToggle],
|
|
124
|
+
execute: ({ railId, toggleId: buttonId }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
125
|
+
// NOTE: read before the fold renders, which takes away the control focus is on
|
|
126
|
+
const rail = yield* findRail(railId);
|
|
127
|
+
const active = document.activeElement;
|
|
128
|
+
const isOnSplitter = active?.matches(`.rail-resize[aria-controls="${CSS.escape(railId)}"]`) ?? false;
|
|
129
|
+
if (rail.contains(active) || isOnSplitter) {
|
|
130
|
+
yield* Dom.focus(`#${CSS.escape(buttonId)}`);
|
|
131
|
+
}
|
|
132
|
+
}).pipe(Effect.ignore, Effect.as(Message.CompletedFocusRailToggle()))), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#execute~3"),
|
|
133
|
+
});
|
|
111
134
|
const closeDrawer = (model, isReturningFocus) => __foldkitBrandViewResult((model.isOpen
|
|
112
135
|
? {
|
|
113
136
|
model: modifyFields(model, { isOpen: () => __foldkitBrandViewResult((false), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#isOpen~2") }),
|
|
@@ -123,16 +146,25 @@ const open = (model) => (__foldkitBrandViewResult(({
|
|
|
123
146
|
}), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#open"));
|
|
124
147
|
/** Closes the rail's drawer, focus back on its button. */
|
|
125
148
|
export const close = (model) => __foldkitBrandViewResult((closeDrawer(model, true)), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#close");
|
|
149
|
+
/** Folds or unfolds the rail from a key of the parent's: the parent flips whether it keeps the
|
|
150
|
+
* rail hidden, as it does for `ToggledRail`, and folds this in, which moves focus in the rail
|
|
151
|
+
* onto the toggle. */
|
|
152
|
+
export const toggle = (model) => (__foldkitBrandViewResult(({
|
|
153
|
+
model,
|
|
154
|
+
commands: [FocusRailToggle({ railId: model.id, toggleId: toggleId(model) })],
|
|
155
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#toggle"));
|
|
126
156
|
const withResizing = (model, maybeResizing) => __foldkitBrandViewResult((modifyFields(model, { maybeResizing: () => __foldkitBrandViewResult((maybeResizing), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#maybeResizing") })), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#withResizing");
|
|
127
157
|
/** The width a dragged splitter previews with the pointer at `clientX`. */
|
|
128
158
|
const dragTo = (model, clientX) => __foldkitBrandViewResult((withResizing(model, Option.map(model.maybeResizing, (resizing) => (__foldkitBrandViewResult(({
|
|
129
159
|
...resizing,
|
|
130
160
|
width: bounded(resizing.fromWidth + clientX - resizing.pressX),
|
|
131
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~
|
|
161
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~8"))))), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#dragTo");
|
|
132
162
|
/** Processes a rail Message and returns the next Model, Commands and OutMessage: a splitter let
|
|
133
|
-
* go where it changes the width, or stepped by a key, asks for the width
|
|
163
|
+
* go where it changes the width, or stepped by a key, asks for the width, and the toggle asks
|
|
164
|
+
* to fold or unfold the rail. */
|
|
134
165
|
export const update = (model, message) => __foldkitBrandViewResult((Message.match(message, {
|
|
135
166
|
ClickedOpen: () => __foldkitBrandViewResult((open(model)), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#ClickedOpen"),
|
|
167
|
+
ClickedToggle: () => (__foldkitBrandViewResult(({ ...toggle(model), outMessage: OutMessage.ToggledRail() }), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#ClickedToggle")),
|
|
136
168
|
PressedSplitter: ({ pointerId, clientX, width }) => __foldkitBrandViewResult((Option.isSome(model.maybeResizing)
|
|
137
169
|
? { model }
|
|
138
170
|
: {
|
|
@@ -158,6 +190,7 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
158
190
|
WidenedPastDrawer: () => __foldkitBrandViewResult((closeDrawer(model, false)), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#WidenedPastDrawer"),
|
|
159
191
|
CompletedShowRailDrawer: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#CompletedShowRailDrawer")),
|
|
160
192
|
CompletedHideRailDrawer: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#CompletedHideRailDrawer")),
|
|
193
|
+
CompletedFocusRailToggle: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#CompletedFocusRailToggle")),
|
|
161
194
|
})), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#update");
|
|
162
195
|
/** The width at and under which the rail is a drawer, as the stylesheet has it. */
|
|
163
196
|
export const DRAWER_QUERY = "(max-width: 900px)";
|
|
@@ -166,10 +199,10 @@ export const DRAWER_QUERY = "(max-width: 900px)";
|
|
|
166
199
|
export const widthChangeMessage = (isDrawerWidth, isDrawerOpen) => __foldkitBrandViewResult((!isDrawerWidth && isDrawerOpen ? Option.some(Message.WidenedPastDrawer()) : Option.none()), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#widthChangeMessage");
|
|
167
200
|
/** The browser closing the drawer (Escape, a press on the veil); a toggle that opened it says
|
|
168
201
|
* nothing. */
|
|
169
|
-
export const drawerToggleMessage = (event) => __foldkitBrandViewResult((Option.liftPredicate(Message.ClosedDrawer(), () => __foldkitBrandViewResult((event.newState === "closed"), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~
|
|
202
|
+
export const drawerToggleMessage = (event) => __foldkitBrandViewResult((Option.liftPredicate(Message.ClosedDrawer(), () => __foldkitBrandViewResult((event.newState === "closed"), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~9"))), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#drawerToggleMessage");
|
|
170
203
|
/** Focus leaving the drawer while it is open (`isDrawerOpen`, the rail matching
|
|
171
204
|
* `:popover-open`); focus moving inside it says nothing. */
|
|
172
|
-
export const drawerFocusOutMessage = (rail, event, isDrawerOpen) => __foldkitBrandViewResult((Option.liftPredicate(Message.BlurredDrawer(), () => __foldkitBrandViewResult((isDrawerOpen && event.relatedTarget instanceof Node && !rail.contains(event.relatedTarget)), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~
|
|
205
|
+
export const drawerFocusOutMessage = (rail, event, isDrawerOpen) => __foldkitBrandViewResult((Option.liftPredicate(Message.BlurredDrawer(), () => __foldkitBrandViewResult((isDrawerOpen && event.relatedTarget instanceof Node && !rail.contains(event.relatedTarget)), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~10"))), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#drawerFocusOutMessage");
|
|
173
206
|
/** Follows the drawer the browser shows: the browser closing it (Escape, a press on the
|
|
174
207
|
* veil), focus leaving it while it is open, and the window growing past its width while it
|
|
175
208
|
* is open, each of which closes the rail. */
|
|
@@ -190,17 +223,17 @@ export const FollowRailDrawer = Mount.defineStream("FollowRailDrawer", {
|
|
|
190
223
|
const fromWidth = Dom.streamFromMediaQuery({
|
|
191
224
|
query: DRAWER_QUERY,
|
|
192
225
|
mapMatches: (isDrawerWidth) => __foldkitBrandViewResult((widthChangeMessage(isDrawerWidth, isDrawerOpen())), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#mapMatches"),
|
|
193
|
-
}).pipe(Stream.filter(Option.isSome), Stream.map(({ value }) => __foldkitBrandViewResult((value), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~
|
|
226
|
+
}).pipe(Stream.filter(Option.isSome), Stream.map(({ value }) => __foldkitBrandViewResult((value), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~11")));
|
|
194
227
|
return __foldkitBrandViewResult((Stream.mergeAll([fromToggle, fromFocusOut, fromWidth], {
|
|
195
228
|
concurrency: "unbounded",
|
|
196
|
-
})), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#execute~
|
|
229
|
+
})), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#execute~4");
|
|
197
230
|
},
|
|
198
231
|
});
|
|
199
232
|
// SUBSCRIPTION
|
|
200
233
|
const railSubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResult(({
|
|
201
234
|
resize: entry({ maybePointerId: Schema.Option(Schema.Number) }, {
|
|
202
235
|
modelToDependencies: (model) => (__foldkitBrandViewResult(({
|
|
203
|
-
maybePointerId: Option.map(model.maybeResizing, ({ pointerId }) => __foldkitBrandViewResult((pointerId), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~
|
|
236
|
+
maybePointerId: Option.map(model.maybeResizing, ({ pointerId }) => __foldkitBrandViewResult((pointerId), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~13")),
|
|
204
237
|
}), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#modelToDependencies")),
|
|
205
238
|
dependenciesToStream: ({ maybePointerId }) => __foldkitBrandViewResult((Option.match(maybePointerId, {
|
|
206
239
|
onNone: () => __foldkitBrandViewResult((Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#onNone~2"),
|
|
@@ -215,17 +248,18 @@ const railSubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResu
|
|
|
215
248
|
modelToDependencies: (model) => (__foldkitBrandViewResult(({ isResizing: Option.isSome(model.maybeResizing) }), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#modelToDependencies~2")),
|
|
216
249
|
dependenciesToStream: ({ isResizing }) => __foldkitBrandViewResult((isResizing ? escapeKeys(Message.PressedEscape()) : Stream.empty), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#dependenciesToStream~2"),
|
|
217
250
|
}),
|
|
218
|
-
}), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~
|
|
251
|
+
}), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~12")));
|
|
219
252
|
/** A dragged splitter follows the pointer, and Escape puts it back before a dialog or the
|
|
220
253
|
* page sees it, from listeners that run only while it is dragged. Lift them into the
|
|
221
254
|
* application's Subscriptions behind a key prefix of the parent's: `subscriptions("rail")` is
|
|
222
255
|
* keyed `railResize` and `railEscape`. */
|
|
223
256
|
export const subscriptions = (keyPrefix) => __foldkitBrandViewResult((prefixKeys(keyPrefix, railSubscriptions)), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#subscriptions");
|
|
224
257
|
/**
|
|
225
|
-
* A column of panels beside the deck, fixed under the top bar
|
|
226
|
-
* `
|
|
227
|
-
*
|
|
228
|
-
*
|
|
258
|
+
* A column of panels beside the deck, fixed under the top bar: `div.railed >` the deck, then
|
|
259
|
+
* `aside.rail[popover="auto"][aria-label]`, then its splitter, `div.rail-resize[role="separator"]`,
|
|
260
|
+
* on its right edge. What comes before its last panel keeps its height, and the last panel
|
|
261
|
+
* shrinks to the room left, its bar and foot staying while its body scrolls. One element
|
|
262
|
+
* serves both layouts, so nothing in it renders twice or loses its state. At 900px and under it leaves the page, and
|
|
229
263
|
* `span.rail-open > button.btn.small` at the top of the deck opens the same element as a drawer
|
|
230
264
|
* over a veil, its head (the name and a close glyph) showing. Opening focuses its first
|
|
231
265
|
* control; Escape, a press on the veil, the close glyph, focus leaving or the window growing
|
|
@@ -237,14 +271,21 @@ export const subscriptions = (keyPrefix) => __foldkitBrandViewResult((prefixKeys
|
|
|
237
271
|
* and the rail's width follow it (without one, `--rail`). The drawer keeps its own width. Lift
|
|
238
272
|
* `subscriptions(keyPrefix)` into the application's, or a dragged splitter follows nothing.
|
|
239
273
|
*
|
|
274
|
+
* Its toggle, `span.rail-toggle > button.iconbtn.quiet[aria-expanded]` ("Hide <label>"), comes
|
|
275
|
+
* to `toAsideView` to print as the first panel's `lead`. Pressed, it reports `ToggledRail` for
|
|
276
|
+
* the parent to keep and pass back as `isHidden`: `div.railed.folded` then stands the first
|
|
277
|
+
* panel's title bar on end on the ground (the toggle at its top, "Show <label>"), the rest of
|
|
278
|
+
* the rail and its splitter gone, and the deck takes the width. Focus in the rail lands on the
|
|
279
|
+
* toggle. The drawer, at 900px and under, prints neither the toggle nor the fold.
|
|
280
|
+
*
|
|
240
281
|
* Its state is its own, not `@foldkit/ui`'s Popover: that panel is placed by Floating UI and
|
|
241
282
|
* rendered only while open, and this one is always in the page, placed by the stylesheet, and
|
|
242
283
|
* opened as a native popover so the browser keeps it in the top layer.
|
|
243
284
|
*/
|
|
244
285
|
export const view = defineView((model, viewInputs, h) => {
|
|
245
|
-
const { label, toAsideView, toDeckView } = viewInputs;
|
|
246
|
-
const maybeWidth = Option.orElse(Option.map(model.maybeResizing, ({ width }) => __foldkitBrandViewResult((width), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~
|
|
247
|
-
const width = Option.getOrElse(maybeWidth, () => __foldkitBrandViewResult((WIDTH.start), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~
|
|
286
|
+
const { label, isHidden, maybeToggleKeyHint, toAsideView, toDeckView } = viewInputs;
|
|
287
|
+
const maybeWidth = Option.orElse(Option.map(model.maybeResizing, ({ width }) => __foldkitBrandViewResult((width), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~15")), () => __foldkitBrandViewResult((Option.map(viewInputs.maybeWidth, bounded)), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~16"));
|
|
288
|
+
const width = Option.getOrElse(maybeWidth, () => __foldkitBrandViewResult((WIDTH.start), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~17"));
|
|
248
289
|
const openButton = h.span([h.Class("rail-open")], [
|
|
249
290
|
Button.view({
|
|
250
291
|
label,
|
|
@@ -258,11 +299,43 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
258
299
|
],
|
|
259
300
|
}, h),
|
|
260
301
|
]);
|
|
302
|
+
const toggleButton = h.span([h.Class("rail-toggle")], [
|
|
303
|
+
IconButton.view({
|
|
304
|
+
glyph: "sidebar",
|
|
305
|
+
label: `${isHidden ? "Show" : "Hide"} ${label}`,
|
|
306
|
+
isQuiet: true,
|
|
307
|
+
onClick: Message.ClickedToggle(),
|
|
308
|
+
...Option.match(maybeToggleKeyHint, {
|
|
309
|
+
onNone: () => (__foldkitBrandViewResult(({}), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#onNone~3")),
|
|
310
|
+
onSome: (keyHint) => (__foldkitBrandViewResult(({ keyHint }), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#onSome~3")),
|
|
311
|
+
}),
|
|
312
|
+
attributes: [h.Id(toggleId(model)), h.AriaExpanded(!isHidden), h.AriaControls(model.id)],
|
|
313
|
+
}, h),
|
|
314
|
+
]);
|
|
315
|
+
const splitter = h.div([
|
|
316
|
+
h.Class("rail-resize"),
|
|
317
|
+
h.Role("separator"),
|
|
318
|
+
h.AriaLabel(`Width of ${label}`),
|
|
319
|
+
h.AriaControls(model.id),
|
|
320
|
+
h.AriaValuemin(WIDTH.least),
|
|
321
|
+
h.AriaValuemax(WIDTH.most),
|
|
322
|
+
h.AriaValuenow(width),
|
|
323
|
+
h.AriaValuetext(`${width} pixels`),
|
|
324
|
+
h.Tabindex(0),
|
|
325
|
+
...splitterAttributes({
|
|
326
|
+
orientation: "vertical",
|
|
327
|
+
isIdle: Option.isNone(model.maybeResizing),
|
|
328
|
+
onPress: (pointerId, clientX) => __foldkitBrandViewResult((Message.PressedSplitter({ pointerId, clientX, width })), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#onPress"),
|
|
329
|
+
onStep: (direction) => __foldkitBrandViewResult((Message.PressedSplitterKey({ width: width + direction * WIDTH.step })), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#onStep"),
|
|
330
|
+
}, h),
|
|
331
|
+
]);
|
|
261
332
|
// NOTE: the deck comes first so the page's main content, and its h1, precede the rail's
|
|
262
333
|
// panels in reading order; the stylesheet places the rail, fixed, at the left.
|
|
263
334
|
return __foldkitBrandViewResult((h.div([
|
|
264
|
-
h.Class("railed"),
|
|
265
|
-
...
|
|
335
|
+
h.Class(isHidden ? "railed folded" : "railed"),
|
|
336
|
+
...(isHidden
|
|
337
|
+
? []
|
|
338
|
+
: Array.fromOption(Option.map(maybeWidth, (shown) => __foldkitBrandViewResult((h.Style({ "--railed-width": `${shown}px` })), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~18")))),
|
|
266
339
|
], [
|
|
267
340
|
toDeckView(openButton),
|
|
268
341
|
h.aside([
|
|
@@ -276,24 +349,8 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
276
349
|
h.span([h.Class("label")], [label]),
|
|
277
350
|
IconButton.view({ glyph: "cross", label: "Close", onClick: Message.ClickedClose() }, h),
|
|
278
351
|
]),
|
|
279
|
-
...toAsideView(),
|
|
280
|
-
]),
|
|
281
|
-
h.div([
|
|
282
|
-
h.Class("rail-resize"),
|
|
283
|
-
h.Role("separator"),
|
|
284
|
-
h.AriaLabel(`Width of ${label}`),
|
|
285
|
-
h.AriaControls(model.id),
|
|
286
|
-
h.AriaValuemin(WIDTH.least),
|
|
287
|
-
h.AriaValuemax(WIDTH.most),
|
|
288
|
-
h.AriaValuenow(width),
|
|
289
|
-
h.AriaValuetext(`${width} pixels`),
|
|
290
|
-
h.Tabindex(0),
|
|
291
|
-
...splitterAttributes({
|
|
292
|
-
orientation: "vertical",
|
|
293
|
-
isIdle: Option.isNone(model.maybeResizing),
|
|
294
|
-
onPress: (pointerId, clientX) => __foldkitBrandViewResult((Message.PressedSplitter({ pointerId, clientX, width })), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#onPress"),
|
|
295
|
-
onStep: (direction) => __foldkitBrandViewResult((Message.PressedSplitterKey({ width: width + direction * WIDTH.step })), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#onStep"),
|
|
296
|
-
}, h),
|
|
352
|
+
...toAsideView(toggleButton),
|
|
297
353
|
]),
|
|
298
|
-
|
|
354
|
+
...(isHidden ? [] : [splitter]),
|
|
355
|
+
])), "@gjermundgaraba-designs/pixel-paper/src/rail/rail.js#anonymous~14");
|
|
299
356
|
});
|
package/dist/src/reel/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Layout, OutMessage, Pane, apply } from "./layout.ts";
|
|
2
|
-
export { Action, AnnounceReel, FocusPane, Message, Model, RestoreFocus, ScrollIntoView, SizeLiftedPane, focusedPaneId, init, perform, reconcile, subscriptions, update, view, } from "./reel.ts";
|
|
2
|
+
export { Action, AnnounceReel, Arrangement, FocusPane, FocusTab, Message, Model, RestoreFocus, ScrollIntoView, SizeLiftedPane, focusedPaneId, init, perform, reconcile, subscriptions, update, view, } from "./reel.ts";
|
|
3
3
|
export type { InitConfig, PaneRender, UpdateContext, ViewInputs } from "./reel.ts";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EACT,OAAO,EACP,KAAK,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,aAAa,EACb,IAAI,EACJ,OAAO,EACP,SAAS,EACT,aAAa,EACb,MAAM,EACN,IAAI,GACL,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EACL,MAAM,EACN,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,OAAO,EACP,KAAK,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,aAAa,EACb,IAAI,EACJ,OAAO,EACP,SAAS,EACT,aAAa,EACb,MAAM,EACN,IAAI,GACL,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/src/reel/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Layout, OutMessage, Pane, apply } from "./layout.js";
|
|
2
|
-
export { Action, AnnounceReel, FocusPane, Message, Model, RestoreFocus, ScrollIntoView, SizeLiftedPane, focusedPaneId, init, perform, reconcile, subscriptions, update, view, } from "./reel.js";
|
|
2
|
+
export { Action, AnnounceReel, Arrangement, FocusPane, FocusTab, Message, Model, RestoreFocus, ScrollIntoView, SizeLiftedPane, focusedPaneId, init, perform, reconcile, subscriptions, update, view, } from "./reel.js";
|
package/dist/src/reel/reel.d.ts
CHANGED
|
@@ -59,6 +59,11 @@ export declare const Model: Schema.Struct<{
|
|
|
59
59
|
}>>;
|
|
60
60
|
}>;
|
|
61
61
|
export type Model = typeof Model.Type;
|
|
62
|
+
/** How a reel shows its panes: side by side in their columns (`Strip`), or one at a time at
|
|
63
|
+
* the reel's full size under a tab per pane (`Tabs`). The application holds it and passes it
|
|
64
|
+
* in; the layout is the same in both. */
|
|
65
|
+
export declare const Arrangement: Schema.Literals<readonly ["Strip", "Tabs"]>;
|
|
66
|
+
export type Arrangement = typeof Arrangement.Type;
|
|
62
67
|
/** Union of all Messages a reel can produce. */
|
|
63
68
|
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
64
69
|
readonly PressedGrip: {
|
|
@@ -106,6 +111,12 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
106
111
|
readonly FocusedPane: {
|
|
107
112
|
paneId: Schema.String;
|
|
108
113
|
};
|
|
114
|
+
readonly PressedTab: {
|
|
115
|
+
paneId: Schema.String;
|
|
116
|
+
};
|
|
117
|
+
readonly SteppedTab: {
|
|
118
|
+
paneId: Schema.String;
|
|
119
|
+
};
|
|
109
120
|
readonly PressedSplitter: {
|
|
110
121
|
splitter: import("foldkit/schema").TaggedUnion<{
|
|
111
122
|
readonly Width: {
|
|
@@ -139,6 +150,7 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
139
150
|
};
|
|
140
151
|
readonly CompletedAnnounceReel: {};
|
|
141
152
|
readonly CompletedFocusPane: {};
|
|
153
|
+
readonly CompletedFocusTab: {};
|
|
142
154
|
readonly CompletedRestoreFocus: {};
|
|
143
155
|
readonly CompletedScrollIntoView: {};
|
|
144
156
|
readonly CompletedSizeLiftedPane: {};
|
|
@@ -169,6 +181,13 @@ export declare const FocusPane: Command.CommandDefinitionWithArgs<"FocusPane", {
|
|
|
169
181
|
}, Effect.Effect<{
|
|
170
182
|
readonly _tag: "CompletedFocusPane";
|
|
171
183
|
}, never, never>>;
|
|
184
|
+
/** Focuses the tab `tabHook` names, for a tab the arrows step to: the keyboard stays in the
|
|
185
|
+
* tab list until the reader goes into the pane. */
|
|
186
|
+
export declare const FocusTab: Command.CommandDefinitionWithArgs<"FocusTab", {
|
|
187
|
+
tabHook: Schema.String;
|
|
188
|
+
}, Effect.Effect<{
|
|
189
|
+
readonly _tag: "CompletedFocusTab";
|
|
190
|
+
}, never, never>>;
|
|
172
191
|
/** Focuses the pane `paneHook` names only where focus was lost (it left with the pane that
|
|
173
192
|
* held it), so focus the reader put somewhere else stays there. */
|
|
174
193
|
export declare const RestoreFocus: Command.CommandDefinitionWithArgs<"RestoreFocus", {
|
|
@@ -185,9 +204,11 @@ export declare const ScrollIntoView: Command.CommandDefinitionWithArgs<"ScrollIn
|
|
|
185
204
|
readonly _tag: "CompletedScrollIntoView";
|
|
186
205
|
}, never, never>>;
|
|
187
206
|
/** What the reel reads from its parent as each Message arrives: the layout as the
|
|
188
|
-
* application holds it now
|
|
207
|
+
* application holds it now, and how the view shows it (`Strip` when not given), which
|
|
208
|
+
* `perform` reads. */
|
|
189
209
|
export type UpdateContext = Readonly<{
|
|
190
210
|
layout: Layout;
|
|
211
|
+
arrangement?: Arrangement;
|
|
191
212
|
}>;
|
|
192
213
|
type UpdateReturn = Update.ReturnWithOutMessage<Model, Message, OutMessage>;
|
|
193
214
|
/** Processes a reel Message against the layout as the application holds it now, and returns
|
|
@@ -214,7 +235,8 @@ export type Action = typeof Action.Type;
|
|
|
214
235
|
* layout as the application holds it: focus moves focus the pane and scroll the reel to it;
|
|
215
236
|
* moves report their request as the OutMessage, which the application applies, with focus
|
|
216
237
|
* kept on the pane. Each is said through the live region. Nothing happens while something is
|
|
217
|
-
* held, or where there is nowhere to go.
|
|
238
|
+
* held, or where there is nowhere to go. Under tabs, only the focus keys act, stepping from tab
|
|
239
|
+
* to tab.
|
|
218
240
|
*/
|
|
219
241
|
export declare const perform: (model: Model, action: Action, context: UpdateContext) => UpdateReturn;
|
|
220
242
|
/** A held pane follows the pointer (the reel scrolling near its edges), a dragged
|
|
@@ -285,6 +307,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
285
307
|
readonly _tag: "CompletedAnnounceReel";
|
|
286
308
|
} | {
|
|
287
309
|
readonly _tag: "CompletedFocusPane";
|
|
310
|
+
} | {
|
|
311
|
+
readonly _tag: "CompletedFocusTab";
|
|
288
312
|
} | {
|
|
289
313
|
readonly _tag: "CompletedRestoreFocus";
|
|
290
314
|
} | {
|
|
@@ -344,6 +368,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
344
368
|
readonly columnId: string;
|
|
345
369
|
};
|
|
346
370
|
readonly share: number;
|
|
371
|
+
} | {
|
|
372
|
+
readonly _tag: "PressedTab";
|
|
373
|
+
readonly paneId: string;
|
|
347
374
|
} | {
|
|
348
375
|
readonly _tag: "ReleasedPointer";
|
|
349
376
|
readonly clientX: number;
|
|
@@ -362,6 +389,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
362
389
|
} | {
|
|
363
390
|
readonly _tag: "SteppedHeld";
|
|
364
391
|
readonly step: "Down" | "Left" | "Right" | "Up";
|
|
392
|
+
} | {
|
|
393
|
+
readonly _tag: "SteppedTab";
|
|
394
|
+
readonly paneId: string;
|
|
365
395
|
}, {
|
|
366
396
|
readonly maybeHold: Option.Option<{
|
|
367
397
|
readonly reelHook: string;
|
|
@@ -433,6 +463,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
433
463
|
readonly _tag: "CompletedAnnounceReel";
|
|
434
464
|
} | {
|
|
435
465
|
readonly _tag: "CompletedFocusPane";
|
|
466
|
+
} | {
|
|
467
|
+
readonly _tag: "CompletedFocusTab";
|
|
436
468
|
} | {
|
|
437
469
|
readonly _tag: "CompletedRestoreFocus";
|
|
438
470
|
} | {
|
|
@@ -492,6 +524,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
492
524
|
readonly columnId: string;
|
|
493
525
|
};
|
|
494
526
|
readonly share: number;
|
|
527
|
+
} | {
|
|
528
|
+
readonly _tag: "PressedTab";
|
|
529
|
+
readonly paneId: string;
|
|
495
530
|
} | {
|
|
496
531
|
readonly _tag: "ReleasedPointer";
|
|
497
532
|
readonly clientX: number;
|
|
@@ -510,6 +545,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
510
545
|
} | {
|
|
511
546
|
readonly _tag: "SteppedHeld";
|
|
512
547
|
readonly step: "Down" | "Left" | "Right" | "Up";
|
|
548
|
+
} | {
|
|
549
|
+
readonly _tag: "SteppedTab";
|
|
550
|
+
readonly paneId: string;
|
|
513
551
|
}, {
|
|
514
552
|
readonly maybeHold: Option.Option<{
|
|
515
553
|
readonly reelHook: string;
|
|
@@ -581,6 +619,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
581
619
|
readonly _tag: "CompletedAnnounceReel";
|
|
582
620
|
} | {
|
|
583
621
|
readonly _tag: "CompletedFocusPane";
|
|
622
|
+
} | {
|
|
623
|
+
readonly _tag: "CompletedFocusTab";
|
|
584
624
|
} | {
|
|
585
625
|
readonly _tag: "CompletedRestoreFocus";
|
|
586
626
|
} | {
|
|
@@ -640,6 +680,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
640
680
|
readonly columnId: string;
|
|
641
681
|
};
|
|
642
682
|
readonly share: number;
|
|
683
|
+
} | {
|
|
684
|
+
readonly _tag: "PressedTab";
|
|
685
|
+
readonly paneId: string;
|
|
643
686
|
} | {
|
|
644
687
|
readonly _tag: "ReleasedPointer";
|
|
645
688
|
readonly clientX: number;
|
|
@@ -658,6 +701,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
658
701
|
} | {
|
|
659
702
|
readonly _tag: "SteppedHeld";
|
|
660
703
|
readonly step: "Down" | "Left" | "Right" | "Up";
|
|
704
|
+
} | {
|
|
705
|
+
readonly _tag: "SteppedTab";
|
|
706
|
+
readonly paneId: string;
|
|
661
707
|
}, {
|
|
662
708
|
readonly maybeHold: Option.Option<{
|
|
663
709
|
readonly reelHook: string;
|
|
@@ -737,6 +783,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
737
783
|
readonly _tag: "CompletedAnnounceReel";
|
|
738
784
|
} | {
|
|
739
785
|
readonly _tag: "CompletedFocusPane";
|
|
786
|
+
} | {
|
|
787
|
+
readonly _tag: "CompletedFocusTab";
|
|
740
788
|
} | {
|
|
741
789
|
readonly _tag: "CompletedRestoreFocus";
|
|
742
790
|
} | {
|
|
@@ -796,6 +844,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
796
844
|
readonly columnId: string;
|
|
797
845
|
};
|
|
798
846
|
readonly share: number;
|
|
847
|
+
} | {
|
|
848
|
+
readonly _tag: "PressedTab";
|
|
849
|
+
readonly paneId: string;
|
|
799
850
|
} | {
|
|
800
851
|
readonly _tag: "ReleasedPointer";
|
|
801
852
|
readonly clientX: number;
|
|
@@ -814,6 +865,9 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
814
865
|
} | {
|
|
815
866
|
readonly _tag: "SteppedHeld";
|
|
816
867
|
readonly step: "Down" | "Left" | "Right" | "Up";
|
|
868
|
+
} | {
|
|
869
|
+
readonly _tag: "SteppedTab";
|
|
870
|
+
readonly paneId: string;
|
|
817
871
|
}, {
|
|
818
872
|
readonly isHolding: boolean;
|
|
819
873
|
}, never> & {
|
|
@@ -829,11 +883,12 @@ export declare const SizeLiftedPane: Mount.MountDefinitionWithArgs<"SizeLiftedPa
|
|
|
829
883
|
}, {
|
|
830
884
|
readonly _tag: "CompletedSizeLiftedPane";
|
|
831
885
|
}>;
|
|
832
|
-
/** What the reel hands `toPaneView` for each pane: put `
|
|
886
|
+
/** What the reel hands `toPaneView` for each pane: put `lead` in the Window's `lead` and give
|
|
833
887
|
* it `id`. */
|
|
834
888
|
export type PaneRender = Readonly<{
|
|
835
|
-
/** The
|
|
836
|
-
|
|
889
|
+
/** The title bar's `lead`: the pane's grip, a quiet glyph button named "Move <label>", or
|
|
890
|
+
* nothing under tabs, where a pane does not move. */
|
|
891
|
+
lead: ReadonlyArray<Html>;
|
|
837
892
|
/** The window's id, unique in the document. */
|
|
838
893
|
id: string;
|
|
839
894
|
}>;
|
|
@@ -844,10 +899,15 @@ export type ViewInputs = Readonly<{
|
|
|
844
899
|
layout: Layout;
|
|
845
900
|
/** Names the reel for screen readers. */
|
|
846
901
|
label: string;
|
|
847
|
-
/** Renders one pane, a `Window.view` with `render.
|
|
902
|
+
/** Renders one pane, a `Window.view` with `render.lead` as its `lead` and `render.id` as its
|
|
848
903
|
* `id`. Mark the control focus should land on in it (a terminal's input) with
|
|
849
904
|
* `data-reel-focus`. */
|
|
850
905
|
toPaneView: (pane: Pane, render: PaneRender) => Html;
|
|
906
|
+
/** How the panes print: in their columns (`Strip`, when not given), or one at a time under
|
|
907
|
+
* their tabs (`Tabs`). Pass the same to `perform`. */
|
|
908
|
+
arrangement?: Arrangement;
|
|
909
|
+
/** What a pane's tab prints before its label: a kind glyph. Nothing when not given. */
|
|
910
|
+
toTabLeadView?: (pane: Pane) => ReadonlyArray<Html>;
|
|
851
911
|
}>;
|
|
852
912
|
/**
|
|
853
913
|
* A row of columns wider than the view when it must be, each a stack of panes, scrolled
|
|
@@ -862,6 +922,11 @@ export type ViewInputs = Readonly<{
|
|
|
862
922
|
* panes), Space drops it, and Escape or Tab puts it back. A drop reports what it asks
|
|
863
923
|
* of the layout as the OutMessage. Lift `subscriptions(keyPrefix)` into the application's, or
|
|
864
924
|
* nothing follows the pointer, and call `reconcile` whenever the layout changes.
|
|
925
|
+
*
|
|
926
|
+
* Under tabs (`arrangement: "Tabs"`) the reel is `div.reel.tabbed`: a `div.nav.tabs.reel-tabs`
|
|
927
|
+
* tab list over the scroller, whose track holds one `div.reel-slot.reel-stage` at the reel's
|
|
928
|
+
* full size where the columns were. Every pane is pinned to it, the focused one shown and the
|
|
929
|
+
* others `.behind`, hidden and inert; there are no grips and no splitters.
|
|
865
930
|
*/
|
|
866
931
|
export declare const view: import("foldkit/submodel").View<{
|
|
867
932
|
readonly id: string;
|
|
@@ -925,6 +990,8 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
925
990
|
readonly _tag: "CompletedAnnounceReel";
|
|
926
991
|
} | {
|
|
927
992
|
readonly _tag: "CompletedFocusPane";
|
|
993
|
+
} | {
|
|
994
|
+
readonly _tag: "CompletedFocusTab";
|
|
928
995
|
} | {
|
|
929
996
|
readonly _tag: "CompletedRestoreFocus";
|
|
930
997
|
} | {
|
|
@@ -984,6 +1051,9 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
984
1051
|
readonly columnId: string;
|
|
985
1052
|
};
|
|
986
1053
|
readonly share: number;
|
|
1054
|
+
} | {
|
|
1055
|
+
readonly _tag: "PressedTab";
|
|
1056
|
+
readonly paneId: string;
|
|
987
1057
|
} | {
|
|
988
1058
|
readonly _tag: "ReleasedPointer";
|
|
989
1059
|
readonly clientX: number;
|
|
@@ -1002,15 +1072,23 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
1002
1072
|
} | {
|
|
1003
1073
|
readonly _tag: "SteppedHeld";
|
|
1004
1074
|
readonly step: "Down" | "Left" | "Right" | "Up";
|
|
1075
|
+
} | {
|
|
1076
|
+
readonly _tag: "SteppedTab";
|
|
1077
|
+
readonly paneId: string;
|
|
1005
1078
|
}, Readonly<{
|
|
1006
1079
|
/** The columns and their panes, as the application holds them. */
|
|
1007
1080
|
layout: Layout;
|
|
1008
1081
|
/** Names the reel for screen readers. */
|
|
1009
1082
|
label: string;
|
|
1010
|
-
/** Renders one pane, a `Window.view` with `render.
|
|
1083
|
+
/** Renders one pane, a `Window.view` with `render.lead` as its `lead` and `render.id` as its
|
|
1011
1084
|
* `id`. Mark the control focus should land on in it (a terminal's input) with
|
|
1012
1085
|
* `data-reel-focus`. */
|
|
1013
1086
|
toPaneView: (pane: Pane, render: PaneRender) => Html;
|
|
1087
|
+
/** How the panes print: in their columns (`Strip`, when not given), or one at a time under
|
|
1088
|
+
* their tabs (`Tabs`). Pass the same to `perform`. */
|
|
1089
|
+
arrangement?: Arrangement;
|
|
1090
|
+
/** What a pane's tab prints before its label: a kind glyph. Nothing when not given. */
|
|
1091
|
+
toTabLeadView?: (pane: Pane) => ReadonlyArray<Html>;
|
|
1014
1092
|
}>>;
|
|
1015
1093
|
export {};
|
|
1016
1094
|
//# sourceMappingURL=reel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reel.d.ts","sourceRoot":"","sources":["../../../src/reel/reel.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAIN,MAAM,EAGN,MAAM,EAGP,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAa,IAAI,EAAe,MAAM,cAAc,CAAC;AAEjE,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAKvC,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAiB9C,OAAO,EAGL,KAAK,MAAM,EACX,UAAU,EACV,KAAK,IAAI,EA4BV,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"reel.d.ts","sourceRoot":"","sources":["../../../src/reel/reel.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAIN,MAAM,EAGN,MAAM,EAGP,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAa,IAAI,EAAe,MAAM,cAAc,CAAC;AAEjE,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAKvC,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAiB9C,OAAO,EAGL,KAAK,MAAM,EACX,UAAU,EACV,KAAK,IAAI,EA4BV,MAAM,aAAa,CAAC;AAgErB;+DAC+D;AAC/D,eAAO,MAAM,KAAK;;;;;;;;;;;gBA/Bd,SAAS;gBACT,MAAM;gBACN,MAAM;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