@gjermundgaraba-designs/pixel-paper 0.22.2 → 0.24.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 +18 -17
- package/dist/src/adapters/mermaid.d.ts.map +1 -1
- package/dist/src/adapters/mermaid.js +0 -24
- package/dist/src/announcer/announcer.d.ts.map +1 -1
- package/dist/src/announcer/announcer.js +12 -12
- package/dist/src/board/board.d.ts +0 -10
- package/dist/src/board/board.d.ts.map +1 -1
- package/dist/src/board/board.js +36 -64
- package/dist/src/board/index.d.ts +2 -1
- package/dist/src/board/index.d.ts.map +1 -1
- package/dist/src/board/index.js +2 -1
- package/dist/src/button/button.d.ts +1 -1
- package/dist/src/button/button.d.ts.map +1 -1
- package/dist/src/commandPalette/commandPalette.d.ts.map +1 -1
- package/dist/src/commandPalette/commandPalette.js +78 -83
- package/dist/src/commandPalette/keys.d.ts +2 -2
- package/dist/src/commandPalette/keys.d.ts.map +1 -1
- package/dist/src/commandPalette/keys.js +2 -4
- package/dist/src/commandPalette/match.d.ts.map +1 -1
- package/dist/src/commandPalette/match.js +2 -2
- package/dist/src/confirmDialog/confirmDialog.d.ts.map +1 -1
- package/dist/src/confirmDialog/confirmDialog.js +1 -2
- package/dist/src/copyButton/copyButton.d.ts +0 -5
- package/dist/src/copyButton/copyButton.d.ts.map +1 -1
- package/dist/src/copyButton/copyButton.js +2 -2
- package/dist/src/crumbs/crumbs.d.ts +0 -2
- package/dist/src/crumbs/crumbs.d.ts.map +1 -1
- package/dist/src/crumbs/crumbs.js +2 -2
- package/dist/src/dialog/dialog.d.ts +2 -0
- package/dist/src/dialog/dialog.d.ts.map +1 -1
- package/dist/src/dialog/dialog.js +3 -2
- package/dist/src/drag/drag.d.ts +28 -0
- package/dist/src/drag/drag.d.ts.map +1 -1
- package/dist/src/drag/drag.js +39 -17
- package/dist/src/editableTitle/editableTitle.d.ts +4 -4
- package/dist/src/field/field.d.ts +7 -1
- package/dist/src/field/field.d.ts.map +1 -1
- package/dist/src/field/field.js +14 -6
- package/dist/src/fieldset/fieldset.d.ts.map +1 -1
- package/dist/src/fieldset/fieldset.js +2 -4
- package/dist/src/fileTree/fileTree.d.ts.map +1 -1
- package/dist/src/fileTree/fileTree.js +16 -16
- 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/inlineInput/inlineInput.d.ts +4 -0
- package/dist/src/inlineInput/inlineInput.d.ts.map +1 -1
- package/dist/src/inlineInput/inlineInput.js +9 -6
- package/dist/src/keyHelp/index.d.ts +1 -1
- package/dist/src/keyHelp/index.d.ts.map +1 -1
- package/dist/src/keyHelp/index.js +1 -1
- package/dist/src/keyHelp/keyHelp.d.ts +1 -3
- package/dist/src/keyHelp/keyHelp.d.ts.map +1 -1
- package/dist/src/keyHelp/keyHelp.js +3 -6
- package/dist/src/keyHint/keyLabel.d.ts +2 -0
- package/dist/src/keyHint/keyLabel.d.ts.map +1 -1
- package/dist/src/keyHint/keyLabel.js +3 -2
- package/dist/src/lineDiff/diff.d.ts +6 -3
- package/dist/src/lineDiff/diff.d.ts.map +1 -1
- package/dist/src/lineDiff/diff.js +40 -28
- package/dist/src/lineDiff/patch.d.ts.map +1 -1
- package/dist/src/lineDiff/patch.js +18 -13
- package/dist/src/linkState/linkState.d.ts.map +1 -1
- package/dist/src/linkState/linkState.js +1 -7
- package/dist/src/menu/slip.js +2 -2
- package/dist/src/meter/meter.d.ts.map +1 -1
- package/dist/src/meter/meter.js +22 -17
- package/dist/src/notice/notice.d.ts +2 -0
- package/dist/src/notice/notice.d.ts.map +1 -1
- package/dist/src/notice/notice.js +2 -1
- 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/passwordField/passwordField.d.ts.map +1 -1
- package/dist/src/passwordField/passwordField.js +3 -7
- 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 +95 -20
- package/dist/src/rail/rail.d.ts.map +1 -1
- package/dist/src/rail/rail.js +103 -46
- package/dist/src/reel/layout.d.ts +9 -5
- package/dist/src/reel/layout.d.ts.map +1 -1
- package/dist/src/reel/layout.js +11 -5
- package/dist/src/reel/reel.d.ts.map +1 -1
- package/dist/src/reel/reel.js +122 -68
- package/dist/src/scheme/scheme.d.ts +1 -1
- package/dist/src/scheme/scheme.d.ts.map +1 -1
- package/dist/src/segmented/segmented.d.ts +0 -3
- package/dist/src/segmented/segmented.d.ts.map +1 -1
- package/dist/src/segmented/segmented.js +1 -6
- package/dist/src/selectField/selectField.d.ts.map +1 -1
- package/dist/src/selectField/selectField.js +3 -10
- package/dist/src/sortable/index.d.ts +1 -1
- package/dist/src/sortable/index.d.ts.map +1 -1
- package/dist/src/sortable/index.js +1 -1
- package/dist/src/sortable/sortable.d.ts +39 -40
- package/dist/src/sortable/sortable.d.ts.map +1 -1
- package/dist/src/sortable/sortable.js +14 -31
- package/dist/src/stack/stack.d.ts +1 -1
- package/dist/src/stack/stack.d.ts.map +1 -1
- package/dist/src/stack/stack.js +1 -1
- package/dist/src/tabs/tabs.d.ts +1 -1
- package/dist/src/tabs/tabs.d.ts.map +1 -1
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/textareaField/textareaField.d.ts.map +1 -1
- package/dist/src/textareaField/textareaField.js +3 -7
- package/dist/src/time/time.d.ts.map +1 -1
- package/dist/src/time/time.js +4 -2
- package/dist/src/tips/index.d.ts +1 -1
- package/dist/src/tips/index.d.ts.map +1 -1
- 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/dist/src/toast/index.d.ts +1 -1
- package/dist/src/toast/index.d.ts.map +1 -1
- package/dist/src/toast/toast.d.ts +5 -5
- package/dist/src/toast/toast.d.ts.map +1 -1
- package/dist/src/toast/toast.js +1 -6
- package/dist/src/toolbar/toolbar.d.ts +0 -3
- package/dist/src/toolbar/toolbar.d.ts.map +1 -1
- package/dist/src/toolbar/toolbar.js +1 -2
- package/package.json +1 -1
- package/src/adapters/mermaid.ts +0 -24
- package/src/announcer/announcer.ts +13 -17
- package/src/board/board.ts +32 -80
- package/src/board/index.ts +1 -1
- package/src/button/button.ts +1 -1
- package/src/commandPalette/commandPalette.ts +21 -38
- package/src/commandPalette/keys.ts +2 -4
- package/src/commandPalette/match.ts +3 -3
- package/src/confirmDialog/confirmDialog.ts +5 -3
- package/src/copyButton/copyButton.ts +2 -5
- package/src/crumbs/crumbs.ts +2 -4
- package/src/dialog/dialog.ts +3 -2
- package/src/drag/drag.ts +54 -5
- package/src/field/field.ts +29 -7
- package/src/fieldset/fieldset.ts +2 -4
- package/src/fileTree/fileTree.ts +10 -12
- package/src/iconButton/iconButton.ts +19 -2
- package/src/inlineInput/inlineInput.ts +11 -2
- package/src/keyHelp/index.ts +0 -1
- package/src/keyHelp/keyHelp.ts +3 -9
- package/src/keyHint/keyLabel.ts +5 -2
- package/src/lineDiff/diff.ts +70 -54
- package/src/lineDiff/patch.ts +27 -14
- package/src/linkState/linkState.ts +1 -8
- package/src/menu/slip.ts +2 -2
- package/src/meter/meter.ts +25 -15
- package/src/notice/notice.ts +2 -1
- package/src/panel/panel.ts +5 -0
- package/src/passwordField/passwordField.ts +3 -7
- package/src/pixel-paper.css +200 -134
- package/src/rail/index.ts +2 -0
- package/src/rail/rail.ts +124 -44
- package/src/reel/layout.ts +14 -7
- package/src/reel/reel.ts +132 -63
- package/src/scheme/scheme.ts +1 -1
- package/src/segmented/segmented.ts +1 -9
- package/src/selectField/selectField.ts +3 -10
- package/src/sortable/index.ts +0 -1
- package/src/sortable/sortable.ts +35 -54
- package/src/stack/stack.ts +1 -1
- package/src/tabs/tabs.ts +1 -1
- package/src/textareaField/textareaField.ts +3 -7
- package/src/time/time.ts +6 -7
- package/src/tips/index.ts +1 -1
- package/src/tips/tips.ts +71 -35
- package/src/toast/index.ts +1 -1
- package/src/toast/toast.ts +2 -8
- package/src/tokens.css +7 -0
- package/src/toolbar/toolbar.ts +0 -5
- package/dist/src/inlineInput/inline.d.ts +0 -6
- package/dist/src/inlineInput/inline.d.ts.map +0 -1
- package/dist/src/inlineInput/inline.js +0 -7
- package/src/inlineInput/inline.ts +0 -13
package/dist/src/tips/tips.d.ts
CHANGED
|
@@ -12,15 +12,18 @@ export declare const TipState: import("foldkit/schema").TaggedUnion<{
|
|
|
12
12
|
readonly Cold: {};
|
|
13
13
|
readonly Waiting: {
|
|
14
14
|
text: Schema.String;
|
|
15
|
+
maybeKey: Schema.Option<Schema.String>;
|
|
15
16
|
side: Schema.Literals<readonly ["Top", "Right"]>;
|
|
16
17
|
};
|
|
17
18
|
readonly Shown: {
|
|
18
19
|
text: Schema.String;
|
|
20
|
+
maybeKey: Schema.Option<Schema.String>;
|
|
19
21
|
side: Schema.Literals<readonly ["Top", "Right"]>;
|
|
20
22
|
trigger: Schema.Literals<readonly ["Pointer", "Focus"]>;
|
|
21
23
|
};
|
|
22
24
|
readonly Leaving: {
|
|
23
25
|
text: Schema.String;
|
|
26
|
+
maybeKey: Schema.Option<Schema.String>;
|
|
24
27
|
side: Schema.Literals<readonly ["Top", "Right"]>;
|
|
25
28
|
trigger: Schema.Literals<readonly ["Pointer", "Focus"]>;
|
|
26
29
|
};
|
|
@@ -36,15 +39,18 @@ export declare const Model: Schema.Struct<{
|
|
|
36
39
|
readonly Cold: {};
|
|
37
40
|
readonly Waiting: {
|
|
38
41
|
text: Schema.String;
|
|
42
|
+
maybeKey: Schema.Option<Schema.String>;
|
|
39
43
|
side: Schema.Literals<readonly ["Top", "Right"]>;
|
|
40
44
|
};
|
|
41
45
|
readonly Shown: {
|
|
42
46
|
text: Schema.String;
|
|
47
|
+
maybeKey: Schema.Option<Schema.String>;
|
|
43
48
|
side: Schema.Literals<readonly ["Top", "Right"]>;
|
|
44
49
|
trigger: Schema.Literals<readonly ["Pointer", "Focus"]>;
|
|
45
50
|
};
|
|
46
51
|
readonly Leaving: {
|
|
47
52
|
text: Schema.String;
|
|
53
|
+
maybeKey: Schema.Option<Schema.String>;
|
|
48
54
|
side: Schema.Literals<readonly ["Top", "Right"]>;
|
|
49
55
|
trigger: Schema.Literals<readonly ["Pointer", "Focus"]>;
|
|
50
56
|
};
|
|
@@ -56,12 +62,14 @@ export type Model = typeof Model.Type;
|
|
|
56
62
|
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
57
63
|
readonly EnteredTipTarget: {
|
|
58
64
|
text: Schema.String;
|
|
65
|
+
maybeKey: Schema.Option<Schema.String>;
|
|
59
66
|
side: Schema.Literals<readonly ["Top", "Right"]>;
|
|
60
67
|
};
|
|
61
68
|
readonly LeftTipTarget: {};
|
|
62
69
|
readonly EnteredTip: {};
|
|
63
70
|
readonly FocusedTipTarget: {
|
|
64
71
|
text: Schema.String;
|
|
72
|
+
maybeKey: Schema.Option<Schema.String>;
|
|
65
73
|
side: Schema.Literals<readonly ["Top", "Right"]>;
|
|
66
74
|
};
|
|
67
75
|
readonly BlurredTipTarget: {};
|
|
@@ -136,16 +144,19 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
136
144
|
} | {
|
|
137
145
|
readonly _tag: "Leaving";
|
|
138
146
|
readonly text: string;
|
|
147
|
+
readonly maybeKey: Option.Option<string>;
|
|
139
148
|
readonly side: "Right" | "Top";
|
|
140
149
|
readonly trigger: "Focus" | "Pointer";
|
|
141
150
|
} | {
|
|
142
151
|
readonly _tag: "Shown";
|
|
143
152
|
readonly text: string;
|
|
153
|
+
readonly maybeKey: Option.Option<string>;
|
|
144
154
|
readonly side: "Right" | "Top";
|
|
145
155
|
readonly trigger: "Focus" | "Pointer";
|
|
146
156
|
} | {
|
|
147
157
|
readonly _tag: "Waiting";
|
|
148
158
|
readonly text: string;
|
|
159
|
+
readonly maybeKey: Option.Option<string>;
|
|
149
160
|
readonly side: "Right" | "Top";
|
|
150
161
|
} | {
|
|
151
162
|
readonly _tag: "Warm";
|
|
@@ -171,10 +182,12 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
171
182
|
} | {
|
|
172
183
|
readonly _tag: "EnteredTipTarget";
|
|
173
184
|
readonly text: string;
|
|
185
|
+
readonly maybeKey: Option.Option<string>;
|
|
174
186
|
readonly side: "Right" | "Top";
|
|
175
187
|
} | {
|
|
176
188
|
readonly _tag: "FocusedTipTarget";
|
|
177
189
|
readonly text: string;
|
|
190
|
+
readonly maybeKey: Option.Option<string>;
|
|
178
191
|
readonly side: "Right" | "Top";
|
|
179
192
|
} | {
|
|
180
193
|
readonly _tag: "LeftTipTarget";
|
|
@@ -210,16 +223,19 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
210
223
|
} | {
|
|
211
224
|
readonly _tag: "Leaving";
|
|
212
225
|
readonly text: string;
|
|
226
|
+
readonly maybeKey: Option.Option<string>;
|
|
213
227
|
readonly side: "Right" | "Top";
|
|
214
228
|
readonly trigger: "Focus" | "Pointer";
|
|
215
229
|
} | {
|
|
216
230
|
readonly _tag: "Shown";
|
|
217
231
|
readonly text: string;
|
|
232
|
+
readonly maybeKey: Option.Option<string>;
|
|
218
233
|
readonly side: "Right" | "Top";
|
|
219
234
|
readonly trigger: "Focus" | "Pointer";
|
|
220
235
|
} | {
|
|
221
236
|
readonly _tag: "Waiting";
|
|
222
237
|
readonly text: string;
|
|
238
|
+
readonly maybeKey: Option.Option<string>;
|
|
223
239
|
readonly side: "Right" | "Top";
|
|
224
240
|
} | {
|
|
225
241
|
readonly _tag: "Warm";
|
|
@@ -244,10 +260,12 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
244
260
|
} | {
|
|
245
261
|
readonly _tag: "EnteredTipTarget";
|
|
246
262
|
readonly text: string;
|
|
263
|
+
readonly maybeKey: Option.Option<string>;
|
|
247
264
|
readonly side: "Right" | "Top";
|
|
248
265
|
} | {
|
|
249
266
|
readonly _tag: "FocusedTipTarget";
|
|
250
267
|
readonly text: string;
|
|
268
|
+
readonly maybeKey: Option.Option<string>;
|
|
251
269
|
readonly side: "Right" | "Top";
|
|
252
270
|
} | {
|
|
253
271
|
readonly _tag: "LeftTipTarget";
|
|
@@ -268,16 +286,19 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
268
286
|
} | {
|
|
269
287
|
readonly _tag: "Leaving";
|
|
270
288
|
readonly text: string;
|
|
289
|
+
readonly maybeKey: Option.Option<string>;
|
|
271
290
|
readonly side: "Right" | "Top";
|
|
272
291
|
readonly trigger: "Focus" | "Pointer";
|
|
273
292
|
} | {
|
|
274
293
|
readonly _tag: "Shown";
|
|
275
294
|
readonly text: string;
|
|
295
|
+
readonly maybeKey: Option.Option<string>;
|
|
276
296
|
readonly side: "Right" | "Top";
|
|
277
297
|
readonly trigger: "Focus" | "Pointer";
|
|
278
298
|
} | {
|
|
279
299
|
readonly _tag: "Waiting";
|
|
280
300
|
readonly text: string;
|
|
301
|
+
readonly maybeKey: Option.Option<string>;
|
|
281
302
|
readonly side: "Right" | "Top";
|
|
282
303
|
} | {
|
|
283
304
|
readonly _tag: "Warm";
|
|
@@ -302,10 +323,12 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
302
323
|
} | {
|
|
303
324
|
readonly _tag: "EnteredTipTarget";
|
|
304
325
|
readonly text: string;
|
|
326
|
+
readonly maybeKey: Option.Option<string>;
|
|
305
327
|
readonly side: "Right" | "Top";
|
|
306
328
|
} | {
|
|
307
329
|
readonly _tag: "FocusedTipTarget";
|
|
308
330
|
readonly text: string;
|
|
331
|
+
readonly maybeKey: Option.Option<string>;
|
|
309
332
|
readonly side: "Right" | "Top";
|
|
310
333
|
} | {
|
|
311
334
|
readonly _tag: "LeftTipTarget";
|
|
@@ -321,7 +344,8 @@ export declare const subscriptions: <Prefix extends string>(keyPrefix: Prefix) =
|
|
|
321
344
|
} extends infer T ? { readonly [Key in keyof T as `${Prefix}${Capitalize<Key>}`]: T[Key]; } : never;
|
|
322
345
|
/**
|
|
323
346
|
* The page's one tip: `div.tip[popover="manual"][aria-hidden="true"]`, which shows the words
|
|
324
|
-
* of any control carrying `data-tip` (IconButton, the glyph switch, a board's grip)
|
|
347
|
+
* of any control carrying `data-tip` (IconButton, the glyph switch, a board's grip), then the
|
|
348
|
+
* key in its `data-tip-key` where it has one (an IconButton's `keyHint`). Render it
|
|
325
349
|
* once, beside the Announcer, and lift `subscriptions(keyPrefix)`. It opens on a resting
|
|
326
350
|
* pointer after a moment (at once while another has just closed), never on touch, and on
|
|
327
351
|
* keyboard focus; it can be hovered; leaving, blur, a press or any key closes it, and Escape
|
|
@@ -340,16 +364,19 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
340
364
|
} | {
|
|
341
365
|
readonly _tag: "Leaving";
|
|
342
366
|
readonly text: string;
|
|
367
|
+
readonly maybeKey: Option.Option<string>;
|
|
343
368
|
readonly side: "Right" | "Top";
|
|
344
369
|
readonly trigger: "Focus" | "Pointer";
|
|
345
370
|
} | {
|
|
346
371
|
readonly _tag: "Shown";
|
|
347
372
|
readonly text: string;
|
|
373
|
+
readonly maybeKey: Option.Option<string>;
|
|
348
374
|
readonly side: "Right" | "Top";
|
|
349
375
|
readonly trigger: "Focus" | "Pointer";
|
|
350
376
|
} | {
|
|
351
377
|
readonly _tag: "Waiting";
|
|
352
378
|
readonly text: string;
|
|
379
|
+
readonly maybeKey: Option.Option<string>;
|
|
353
380
|
readonly side: "Right" | "Top";
|
|
354
381
|
} | {
|
|
355
382
|
readonly _tag: "Warm";
|
|
@@ -374,10 +401,12 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
374
401
|
} | {
|
|
375
402
|
readonly _tag: "EnteredTipTarget";
|
|
376
403
|
readonly text: string;
|
|
404
|
+
readonly maybeKey: Option.Option<string>;
|
|
377
405
|
readonly side: "Right" | "Top";
|
|
378
406
|
} | {
|
|
379
407
|
readonly _tag: "FocusedTipTarget";
|
|
380
408
|
readonly text: string;
|
|
409
|
+
readonly maybeKey: Option.Option<string>;
|
|
381
410
|
readonly side: "Right" | "Top";
|
|
382
411
|
} | {
|
|
383
412
|
readonly _tag: "LeftTipTarget";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tips.d.ts","sourceRoot":"","sources":["../../../src/tips/tips.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tips.d.ts","sourceRoot":"","sources":["../../../src/tips/tips.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAIN,MAAM,EACN,MAAM,EAGP,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAQ3C,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAW9C,iEAAiE;AACjE,eAAO,MAAM,OAAO,gDAAwC,CAAC;AAC7D,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAQ1C;;+FAE+F;AAC/F,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;EAMnB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE5C;sDACsD;AACtD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;EAIhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAItC,uDAAuD;AACvD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;QAQY,OAAO;;;QACR,OAAO;;;QACN,OAAO;;;;EAGrC,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAI1C,2FAA2F;AAC3F,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mGAC7B,CAAC;AAW1C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqBf,CAAC"}
|
package/dist/src/tips/tips.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Array, Duration, Effect, Match, Number, Option, Schema, Stream, pipe } from "effect";
|
|
2
|
+
import { Array, Duration, Effect, Equal, Match, Number, Option, Schema, Stream, pipe, } from "effect";
|
|
3
3
|
import * as Command from "foldkit/command";
|
|
4
4
|
import * as Dom from "foldkit/dom";
|
|
5
5
|
import { defineMessageUnion } from "foldkit/message";
|
|
@@ -15,7 +15,9 @@ import { prefixKeys } from "../subscription/prefixKeys.js";
|
|
|
15
15
|
const Side = Schema.Literals(["Top", "Right"]);
|
|
16
16
|
/** What brought the tip: a resting pointer or keyboard focus. */
|
|
17
17
|
export const Trigger = Schema.Literals(["Pointer", "Focus"]);
|
|
18
|
-
|
|
18
|
+
/** What a tip says: its control's name, and the key that does the same where the control
|
|
19
|
+
* names one (`data-tip-key`). */
|
|
20
|
+
const Words = { text: Schema.String, maybeKey: Schema.Option(Schema.String), side: Side };
|
|
19
21
|
const ShownWords = { ...Words, trigger: Trigger };
|
|
20
22
|
/** Where the page's tip is. `Cold`: none lately. `Waiting`: a pointer rests on a control, for
|
|
21
23
|
* a moment first. `Shown`. `Leaving`: the pointer left, with a moment to cross onto the tip.
|
|
@@ -37,10 +39,10 @@ export const Model = Schema.Struct({
|
|
|
37
39
|
// MESSAGE
|
|
38
40
|
/** Union of all Messages the tip layer can produce. */
|
|
39
41
|
export const Message = defineMessageUnion({
|
|
40
|
-
EnteredTipTarget:
|
|
42
|
+
EnteredTipTarget: Words,
|
|
41
43
|
LeftTipTarget: {},
|
|
42
44
|
EnteredTip: {},
|
|
43
|
-
FocusedTipTarget:
|
|
45
|
+
FocusedTipTarget: Words,
|
|
44
46
|
BlurredTipTarget: {},
|
|
45
47
|
PressedPointer: {},
|
|
46
48
|
PressedKey: {},
|
|
@@ -70,6 +72,8 @@ const GRACE = Duration.millis(120);
|
|
|
70
72
|
const WARMTH = Duration.millis(400);
|
|
71
73
|
/** The attribute that holds a control's tip: its accessible name. */
|
|
72
74
|
const TIP_ATTRIBUTE = "data-tip";
|
|
75
|
+
/** The attribute that holds the key a control's tip prints after its name. */
|
|
76
|
+
const TIP_KEY_ATTRIBUTE = "data-tip-key";
|
|
73
77
|
const TIP_SELECTOR = `[${TIP_ATTRIBUTE}]`;
|
|
74
78
|
const hasText = (element, text) => __foldkitBrandViewResult((element.isConnected && element.getAttribute(TIP_ATTRIBUTE) === text), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#hasText");
|
|
75
79
|
/** The control a tip belongs to, found when it opens: the innermost hovered element with
|
|
@@ -117,9 +121,10 @@ export const WaitBeforeCooling = Command.define("WaitBeforeCooling", {
|
|
|
117
121
|
messages: [Message.CompletedWaitBeforeCooling],
|
|
118
122
|
execute: ({ version }) => __foldkitBrandViewResult((Effect.sleep(WARMTH).pipe(Effect.as(Message.CompletedWaitBeforeCooling({ version })))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#execute~5"),
|
|
119
123
|
});
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
const wordsOf = ({ text, maybeKey, side }) => (__foldkitBrandViewResult(({ text, maybeKey, side }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#wordsOf"));
|
|
125
|
+
const show = (model, words, trigger) => (__foldkitBrandViewResult(({
|
|
126
|
+
model: modifyFields(model, { state: () => __foldkitBrandViewResult((TipState.Shown({ ...wordsOf(words), trigger })), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#state") }),
|
|
127
|
+
commands: [ShowTip({ tipId: model.id, text: words.text, trigger })],
|
|
123
128
|
}), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#show"));
|
|
124
129
|
const hide = (model) => {
|
|
125
130
|
const nextVersion = Number.increment(model.version);
|
|
@@ -128,12 +133,12 @@ const hide = (model) => {
|
|
|
128
133
|
commands: [HideTip({ tipId: model.id }), WaitBeforeCooling({ version: nextVersion })],
|
|
129
134
|
}), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#hide");
|
|
130
135
|
};
|
|
131
|
-
const wait = (model,
|
|
136
|
+
const wait = (model, words) => {
|
|
132
137
|
const nextVersion = Number.increment(model.version);
|
|
133
138
|
return __foldkitBrandViewResult(({
|
|
134
139
|
model: modifyFields(model, {
|
|
135
140
|
version: () => __foldkitBrandViewResult((nextVersion), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#version~2"),
|
|
136
|
-
state: () => __foldkitBrandViewResult((TipState.Waiting(
|
|
141
|
+
state: () => __foldkitBrandViewResult((TipState.Waiting(wordsOf(words))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#state~3"),
|
|
137
142
|
}),
|
|
138
143
|
commands: [WaitBeforeShowing({ version: nextVersion })],
|
|
139
144
|
}), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#wait");
|
|
@@ -143,7 +148,7 @@ const leave = (model, shown) => {
|
|
|
143
148
|
return __foldkitBrandViewResult(({
|
|
144
149
|
model: modifyFields(model, {
|
|
145
150
|
version: () => __foldkitBrandViewResult((nextVersion), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#version~3"),
|
|
146
|
-
state: () => __foldkitBrandViewResult((TipState.Leaving({
|
|
151
|
+
state: () => __foldkitBrandViewResult((TipState.Leaving({ ...wordsOf(shown), trigger: shown.trigger })), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#state~4"),
|
|
147
152
|
}),
|
|
148
153
|
commands: [WaitBeforeHiding({ version: nextVersion })],
|
|
149
154
|
}), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#leave");
|
|
@@ -159,47 +164,55 @@ const dismiss = (model) => __foldkitBrandViewResult((TipState.match(model.state,
|
|
|
159
164
|
Leaving: () => __foldkitBrandViewResult((hide(model)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Leaving"),
|
|
160
165
|
Warm: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Warm")),
|
|
161
166
|
})), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#dismiss");
|
|
162
|
-
const entered = (model,
|
|
163
|
-
Cold: () => __foldkitBrandViewResult((wait(model,
|
|
164
|
-
Waiting: (waiting) => (__foldkitBrandViewResult((waiting.text === text ? { model } : wait(model,
|
|
165
|
-
Shown: (shown) => (__foldkitBrandViewResult((shown.text === text ? { model } : show(model,
|
|
166
|
-
Leaving: (leaving) => __foldkitBrandViewResult((leaving.text === text
|
|
167
|
+
const entered = (model, words) => __foldkitBrandViewResult((TipState.match(model.state, {
|
|
168
|
+
Cold: () => __foldkitBrandViewResult((wait(model, words)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Cold~2"),
|
|
169
|
+
Waiting: (waiting) => (__foldkitBrandViewResult((waiting.text === words.text ? { model } : wait(model, words)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Waiting~2")),
|
|
170
|
+
Shown: (shown) => (__foldkitBrandViewResult((shown.text === words.text ? { model } : show(model, words, "Pointer")), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Shown~2")),
|
|
171
|
+
Leaving: (leaving) => __foldkitBrandViewResult((leaving.text === words.text
|
|
167
172
|
? {
|
|
168
173
|
model: modifyFields(model, {
|
|
169
|
-
state: () => __foldkitBrandViewResult((TipState.Shown({
|
|
174
|
+
state: () => __foldkitBrandViewResult((TipState.Shown({ ...wordsOf(words), trigger: leaving.trigger })), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#state~6"),
|
|
170
175
|
}),
|
|
171
176
|
}
|
|
172
|
-
: show(model,
|
|
173
|
-
Warm: () => __foldkitBrandViewResult((show(model,
|
|
177
|
+
: show(model, words, "Pointer")), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Leaving~2"),
|
|
178
|
+
Warm: () => __foldkitBrandViewResult((show(model, words, "Pointer")), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Warm~2"),
|
|
174
179
|
})), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#entered");
|
|
175
180
|
/** Processes a tip layer Message and returns the next Model and Commands. */
|
|
176
181
|
export const update = (model, message) => __foldkitBrandViewResult((Message.match(message, {
|
|
177
|
-
EnteredTipTarget: (
|
|
182
|
+
EnteredTipTarget: (words) => __foldkitBrandViewResult((entered(model, wordsOf(words))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#EnteredTipTarget"),
|
|
178
183
|
LeftTipTarget: () => __foldkitBrandViewResult((TipState.matchOrElse(model.state, {
|
|
179
184
|
Waiting: () => __foldkitBrandViewResult((cool(model)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Waiting~3"),
|
|
180
185
|
Shown: (shown) => (__foldkitBrandViewResult((shown.trigger === "Pointer" ? leave(model, shown) : { model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Shown~3")),
|
|
181
186
|
}, () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~11")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#LeftTipTarget"),
|
|
182
187
|
EnteredTip: () => __foldkitBrandViewResult((TipState.matchOrElse(model.state, {
|
|
183
|
-
Leaving: (
|
|
184
|
-
model: modifyFields(model, {
|
|
188
|
+
Leaving: (leaving) => (__foldkitBrandViewResult(({
|
|
189
|
+
model: modifyFields(model, {
|
|
190
|
+
state: () => __foldkitBrandViewResult((TipState.Shown({ ...wordsOf(leaving), trigger: leaving.trigger })), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#state~7"),
|
|
191
|
+
}),
|
|
185
192
|
}), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Leaving~3")),
|
|
186
193
|
}, () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~12")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#EnteredTip"),
|
|
187
|
-
FocusedTipTarget: (
|
|
194
|
+
FocusedTipTarget: (words) => __foldkitBrandViewResult((show(model, wordsOf(words), "Focus")), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#FocusedTipTarget"),
|
|
188
195
|
BlurredTipTarget: () => __foldkitBrandViewResult((dismiss(model)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#BlurredTipTarget"),
|
|
189
196
|
PressedPointer: () => __foldkitBrandViewResult((dismiss(model)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#PressedPointer"),
|
|
190
197
|
PressedKey: () => __foldkitBrandViewResult((dismiss(model)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#PressedKey"),
|
|
191
198
|
CompletedWaitBeforeShowing: ({ version }) => __foldkitBrandViewResult((TipState.matchOrElse(model.state, {
|
|
192
|
-
Waiting: (
|
|
199
|
+
Waiting: (waiting) => __foldkitBrandViewResult((model.version === version ? show(model, wordsOf(waiting), "Pointer") : { model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Waiting~4"),
|
|
193
200
|
}, () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~13")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#CompletedWaitBeforeShowing"),
|
|
194
201
|
CompletedWaitBeforeHiding: ({ version }) => __foldkitBrandViewResult((TipState.matchOrElse(model.state, { Leaving: () => (__foldkitBrandViewResult((model.version === version ? hide(model) : { model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Leaving~4")) }, () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~14")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#CompletedWaitBeforeHiding"),
|
|
195
202
|
CompletedWaitBeforeCooling: ({ version }) => __foldkitBrandViewResult((TipState.matchOrElse(model.state, { Warm: () => (__foldkitBrandViewResult((model.version === version ? cool(model) : { model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#Warm~3")) }, () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~15")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#CompletedWaitBeforeCooling"),
|
|
196
203
|
CompletedShowTip: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#CompletedShowTip")),
|
|
197
204
|
CompletedHideTip: () => (__foldkitBrandViewResult(({ model }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#CompletedHideTip")),
|
|
198
205
|
})), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#update");
|
|
199
|
-
|
|
206
|
+
/** A control in a vertical strip of tools, or set in vertical writing (a folded rail's title
|
|
207
|
+
* bar), takes its tip at its side, where the tip would cover the next tool or the top bar. */
|
|
208
|
+
const sideOf = (element) => __foldkitBrandViewResult((element.closest('[aria-orientation="vertical"]') === null &&
|
|
209
|
+
!getComputedStyle(element).writingMode.startsWith("vertical")
|
|
210
|
+
? "Top"
|
|
211
|
+
: "Right"), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#sideOf");
|
|
200
212
|
const tipTargetOf = (target) => __foldkitBrandViewResult((pipe(Option.liftPredicate(target, (node) => __foldkitBrandViewResult((node instanceof Element), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~16")), Option.flatMap((element) => __foldkitBrandViewResult((Option.fromNullishOr(element.closest(TIP_SELECTOR))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~17")), Option.flatMap((element) => __foldkitBrandViewResult((Option.map(Option.fromNullishOr(element.getAttribute(TIP_ATTRIBUTE)), (text) => (__foldkitBrandViewResult(({
|
|
201
213
|
element,
|
|
202
214
|
text,
|
|
215
|
+
maybeKey: Option.fromNullishOr(element.getAttribute(TIP_KEY_ATTRIBUTE)),
|
|
203
216
|
side: sideOf(element),
|
|
204
217
|
}), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~19")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~18")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#tipTargetOf");
|
|
205
218
|
/** What a pointer arriving over `target` means for the tip: over a control with a tip, over
|
|
@@ -214,12 +227,12 @@ export const pointerOverMessage = (tipId, event) => {
|
|
|
214
227
|
}
|
|
215
228
|
return __foldkitBrandViewResult((Option.some(Option.match(tipTargetOf(event.target), {
|
|
216
229
|
onNone: () => __foldkitBrandViewResult((Message.LeftTipTarget()), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#onNone"),
|
|
217
|
-
onSome: (
|
|
230
|
+
onSome: (target) => __foldkitBrandViewResult((Message.EnteredTipTarget(wordsOf(target))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#onSome"),
|
|
218
231
|
}))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#pointerOverMessage");
|
|
219
232
|
};
|
|
220
233
|
/** What focus arriving on `target` means for the tip: keyboard focus (`:focus-visible`) on a
|
|
221
234
|
* control with a tip shows it; any other focus says nothing. */
|
|
222
|
-
const focusInMessage = (event) => __foldkitBrandViewResult((Option.map(Option.filter(tipTargetOf(event.target), ({ element }) => __foldkitBrandViewResult((element.matches(":focus-visible")), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~20")), (
|
|
235
|
+
const focusInMessage = (event) => __foldkitBrandViewResult((Option.map(Option.filter(tipTargetOf(event.target), ({ element }) => __foldkitBrandViewResult((element.matches(":focus-visible")), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~20")), (target) => __foldkitBrandViewResult((Message.FocusedTipTarget(wordsOf(target))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~21"))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#focusInMessage");
|
|
223
236
|
/** Focus leaving a control with a tip, not into a part of itself, closes the tip (and
|
|
224
237
|
* cancels one still waiting). */
|
|
225
238
|
export const focusOutMessage = (event) => __foldkitBrandViewResult((Option.map(Option.filter(tipTargetOf(event.target), ({ element }) => __foldkitBrandViewResult((!(event.relatedTarget instanceof Node && element.contains(event.relatedTarget))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~22")), () => __foldkitBrandViewResult((Message.BlurredTipTarget()), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~23"))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#focusOutMessage");
|
|
@@ -244,7 +257,9 @@ const pointerOverChanges = (tipId) => __foldkitBrandViewResult((Dom.streamFromEv
|
|
|
244
257
|
}).pipe(Stream.changesWith((previous, next) => __foldkitBrandViewResult((previous._tag === next._tag && sameWords(previous, next)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~24")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#pointerOverChanges");
|
|
245
258
|
const sameWords = (previous, next) => __foldkitBrandViewResult((previous._tag !== "EnteredTipTarget" ||
|
|
246
259
|
next._tag !== "EnteredTipTarget" ||
|
|
247
|
-
(previous.text === next.text &&
|
|
260
|
+
(previous.text === next.text &&
|
|
261
|
+
previous.side === next.side &&
|
|
262
|
+
Equal.equals(previous.maybeKey, next.maybeKey))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#sameWords");
|
|
248
263
|
const tipSubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResult(({
|
|
249
264
|
pointerAndFocus: entry({ tipId: Schema.String }, {
|
|
250
265
|
modelToDependencies: (model) => (__foldkitBrandViewResult(({ tipId: model.id }), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#modelToDependencies")),
|
|
@@ -286,10 +301,11 @@ const tipSubscriptions = Subscription.make()((entry) => (__foldkitBrandViewResul
|
|
|
286
301
|
* only while a tip shows. */
|
|
287
302
|
export const subscriptions = (keyPrefix) => __foldkitBrandViewResult((prefixKeys(keyPrefix, tipSubscriptions)), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#subscriptions");
|
|
288
303
|
// VIEW
|
|
289
|
-
const
|
|
304
|
+
const maybeWordsOf = (model) => __foldkitBrandViewResult((Match.value(model.state).pipe(Match.withReturnType(), Match.tag("Waiting", "Shown", "Leaving", (words) => __foldkitBrandViewResult((Option.some(wordsOf(words))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~26")), Match.orElse(() => __foldkitBrandViewResult((Option.none()), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~27")))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#maybeWordsOf");
|
|
290
305
|
/**
|
|
291
306
|
* The page's one tip: `div.tip[popover="manual"][aria-hidden="true"]`, which shows the words
|
|
292
|
-
* of any control carrying `data-tip` (IconButton, the glyph switch, a board's grip)
|
|
307
|
+
* of any control carrying `data-tip` (IconButton, the glyph switch, a board's grip), then the
|
|
308
|
+
* key in its `data-tip-key` where it has one (an IconButton's `keyHint`). Render it
|
|
293
309
|
* once, beside the Announcer, and lift `subscriptions(keyPrefix)`. It opens on a resting
|
|
294
310
|
* pointer after a moment (at once while another has just closed), never on touch, and on
|
|
295
311
|
* keyboard focus; it can be hovered; leaving, blur, a press or any key closes it, and Escape
|
|
@@ -301,7 +317,7 @@ const wordsOf = (model) => __foldkitBrandViewResult((Match.value(model.state).pi
|
|
|
301
317
|
* accessibility tree, and any control takes one by carrying `data-tip`.
|
|
302
318
|
*/
|
|
303
319
|
export const view = defineView((model, h) => {
|
|
304
|
-
const maybeWords =
|
|
320
|
+
const maybeWords = maybeWordsOf(model);
|
|
305
321
|
return __foldkitBrandViewResult((h.div([
|
|
306
322
|
h.Id(model.id),
|
|
307
323
|
h.Popover("manual"),
|
|
@@ -310,5 +326,11 @@ export const view = defineView((model, h) => {
|
|
|
310
326
|
...(Option.exists(maybeWords, ({ side }) => __foldkitBrandViewResult((side === "Right"), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~29"))
|
|
311
327
|
? [h.DataAttribute("side", "right")]
|
|
312
328
|
: []),
|
|
313
|
-
], Option.
|
|
329
|
+
], Option.match(maybeWords, {
|
|
330
|
+
onNone: () => __foldkitBrandViewResult(([]), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#onNone~3"),
|
|
331
|
+
onSome: ({ text, maybeKey }) => __foldkitBrandViewResult(([
|
|
332
|
+
text,
|
|
333
|
+
...Array.fromOption(Option.map(maybeKey, (key) => __foldkitBrandViewResult((h.kbd([h.Class("key-hint")], [key])), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~30"))),
|
|
334
|
+
]), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#onSome~3"),
|
|
335
|
+
}))), "@gjermundgaraba-designs/pixel-paper/src/tips/tips.js#anonymous~28");
|
|
314
336
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AnnounceSlip, BindStack, FocusSlip, Message, Model, OutMessage, dismiss, id, init, sceneMounts, show, update, view, } from "./toast.ts";
|
|
2
|
-
export type { InitConfig, ShowConfig
|
|
2
|
+
export type { InitConfig, ShowConfig } from "./toast.ts";
|
|
3
3
|
export type { Action, Tone } from "./stack.ts";
|
|
4
4
|
export { Focus } from "../focus/focus.ts";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,EACL,UAAU,EACV,OAAO,EACP,EAAE,EACF,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,MAAM,EACN,IAAI,GACL,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,EACL,UAAU,EACV,OAAO,EACP,EAAE,EACF,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,MAAM,EACN,IAAI,GACL,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -326,8 +326,6 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
326
326
|
readonly pendingDismissVersion: number;
|
|
327
327
|
readonly isHovered: boolean;
|
|
328
328
|
readonly swipeState: {
|
|
329
|
-
readonly _tag: "Idle";
|
|
330
|
-
} | {
|
|
331
329
|
readonly _tag: "Dismissing";
|
|
332
330
|
readonly offsetX: number;
|
|
333
331
|
readonly direction: "Left" | "Right";
|
|
@@ -336,6 +334,8 @@ export declare const update: (model: Model, message: Message) => Readonly<{
|
|
|
336
334
|
readonly pointerId: number;
|
|
337
335
|
readonly startX: number;
|
|
338
336
|
readonly currentX: number;
|
|
337
|
+
} | {
|
|
338
|
+
readonly _tag: "Idle";
|
|
339
339
|
} | {
|
|
340
340
|
readonly _tag: "Settling";
|
|
341
341
|
readonly offsetX: number;
|
|
@@ -421,7 +421,7 @@ export type ShowConfig = Readonly<{
|
|
|
421
421
|
}>;
|
|
422
422
|
/** What `show` returns: the next Model and Commands, and the new slip's id, to take it back
|
|
423
423
|
* with `dismiss`. */
|
|
424
|
-
|
|
424
|
+
type ShowReturn = Update.Return<Model, Message> & Readonly<{
|
|
425
425
|
entryId: string;
|
|
426
426
|
}>;
|
|
427
427
|
/**
|
|
@@ -557,8 +557,6 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
557
557
|
readonly pendingDismissVersion: number;
|
|
558
558
|
readonly isHovered: boolean;
|
|
559
559
|
readonly swipeState: {
|
|
560
|
-
readonly _tag: "Idle";
|
|
561
|
-
} | {
|
|
562
560
|
readonly _tag: "Dismissing";
|
|
563
561
|
readonly offsetX: number;
|
|
564
562
|
readonly direction: "Left" | "Right";
|
|
@@ -567,6 +565,8 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
567
565
|
readonly pointerId: number;
|
|
568
566
|
readonly startX: number;
|
|
569
567
|
readonly currentX: number;
|
|
568
|
+
} | {
|
|
569
|
+
readonly _tag: "Idle";
|
|
570
570
|
} | {
|
|
571
571
|
readonly _tag: "Settling";
|
|
572
572
|
readonly offsetX: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/toast/toast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,QAAQ,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,EAAgB,MAAM,QAAQ,CAAC;AACtF,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAI3C,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAIvC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AASzC,OAAO,EAAE,MAAM,EAAgB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAI7D;;wDAEwD;AACxD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAC;AAItC,yDAAyD;AACzD,eAAO,MAA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AC;AAkDtC,2FAA2F;AAC3F,eAAO,MAAM,YAAY,UAChB,OAAO,SACP,UAAU,KAChB,MAAM,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAG9C,CAAC;AAEJ,wDAAwD;AACxD,eAAO,MAAM,aAAa,UACjB,OAAO,SACP,UAAU,KAChB,MAAM,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,YAAY,CAAC,IAAI,CAC0C,CAAC;AAE5F,uEAAuE;AACvE,eAAO,MAAM,QAAQ,UAAW,aAAa,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,CACzB,CAAC;AAEvE;;6DAE6D;AAC7D,eAAO,MAAM,SAAS;;;;;;;EAuBpB,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkBhB,CAAC;AAEF;+DAC+D;AAC/D,eAAO,MAAM,WAAW;;;;;;;;;GAAiD,CAAC"}
|
package/dist/src/toast/toast.js
CHANGED
|
@@ -215,14 +215,9 @@ export const show = (model, config) => {
|
|
|
215
215
|
/** Takes a slip back by its id: what it reported has recovered. */
|
|
216
216
|
export const dismiss = (model, entryId) => __foldkitBrandViewResult((dismissKeepingFocus(model, entryId)), "@gjermundgaraba-designs/pixel-paper/src/toast/toast.js#dismiss");
|
|
217
217
|
// VIEW
|
|
218
|
-
const TONE_CLASS = {
|
|
219
|
-
Ok: "notice toast ok",
|
|
220
|
-
Error: "notice toast error",
|
|
221
|
-
Quiet: "notice toast quiet",
|
|
222
|
-
};
|
|
223
218
|
const slipView = (entry, h) => {
|
|
224
219
|
const { tone, title, maybeBody, maybeAction } = entry.payload;
|
|
225
|
-
return __foldkitBrandViewResult((h.div([h.Class(TONE_CLASS[tone])], [
|
|
220
|
+
return __foldkitBrandViewResult((h.div([h.Class(`notice toast${Notice.TONE_CLASS[tone]}`)], [
|
|
226
221
|
Notice.toneGlyphView({ tone }, h),
|
|
227
222
|
h.div([], [h.strong([], [title]), ...Option.toArray(maybeBody)]),
|
|
228
223
|
...Array.fromOption(Option.map(maybeAction, (action) => __foldkitBrandViewResult((Button.view({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import type { Html, HtmlBuilder } from "foldkit/html";
|
|
3
3
|
import * as Mount from "foldkit/mount";
|
|
4
|
-
import type { Attributes } from "../attributes/attributes.ts";
|
|
5
4
|
/** Which way the strip lies. A `Vertical` strip stands on end: a canvas's tools down its left
|
|
6
5
|
* edge. The arrows of both axes move in either. */
|
|
7
6
|
export declare const Orientation: Schema.Literals<readonly ["Horizontal", "Vertical"]>;
|
|
@@ -38,8 +37,6 @@ export type ViewConfig<ParentMessage> = Readonly<{
|
|
|
38
37
|
* Scene, resolve the Mount by name with the lifted Message:
|
|
39
38
|
* `Scene.Mount.resolve({ name: Toolbar.BindToolKeys.name }, toParentMessage(Toolbar.Message.MovedToolFocus({ move })))`. */
|
|
40
39
|
toParentMessage: (message: Message) => ParentMessage;
|
|
41
|
-
/** Further attributes for the toolbar, never a class. */
|
|
42
|
-
attributes?: Attributes<ParentMessage>;
|
|
43
40
|
}>;
|
|
44
41
|
/** A strip of tools that is one stop for Tab (`role="toolbar"`, named by its label, with its
|
|
45
42
|
* `aria-orientation`): the arrows move between the tools and stop at the ends, Home and End
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAEpF,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/toolbar/toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAEpF,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAMvC;oDACoD;AACpD,eAAO,MAAM,WAAW,sDAA8C,CAAC;AACvE,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;AAQlD,6FAA6F;AAC7F,eAAO,MAAM,OAAO;;QAA0C,IAAI;;EAAe,CAAC;AAClF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAsG1C;;;;;;yDAMyD;AACzD,eAAO,MAAM,YAAY;;;EAuBvB,CAAC;AAIH,yDAAyD;AACzD,MAAM,MAAM,UAAU,CAAC,aAAa,IAAI,QAAQ,CAAC;IAC/C,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;iIAG6H;IAC7H,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,aAAa,CAAC;CACtD,CAAC,CAAC;AAEH;;gEAEgE;AAChE,eAAO,MAAM,IAAI,GAAI,aAAa,UACxB,UAAU,CAAC,aAAa,CAAC,KAC9B,WAAW,CAAC,aAAa,CAAC,KAC5B,IAmBF,CAAC"}
|
|
@@ -90,9 +90,8 @@ export const BindToolKeys = Mount.defineStream("BindToolKeys", {
|
|
|
90
90
|
* `aria-orientation`): the arrows move between the tools and stop at the ends, Home and End
|
|
91
91
|
* go to the ends, and Tab comes back to the tool used last. */
|
|
92
92
|
export const view = (config, h) => {
|
|
93
|
-
const { label, tools: toolViews, orientation = "Horizontal", isFloating = false, toParentMessage,
|
|
93
|
+
const { label, tools: toolViews, orientation = "Horizontal", isFloating = false, toParentMessage, } = config;
|
|
94
94
|
return __foldkitBrandViewResult((h.div([
|
|
95
|
-
...attributes,
|
|
96
95
|
h.Role("toolbar"),
|
|
97
96
|
h.AriaLabel(label),
|
|
98
97
|
h.AriaOrientation(orientation === "Vertical" ? "vertical" : "horizontal"),
|
package/package.json
CHANGED
package/src/adapters/mermaid.ts
CHANGED
|
@@ -2,30 +2,6 @@
|
|
|
2
2
|
// faces, in the page's palette. An optional entry point ("./adapters/mermaid"):
|
|
3
3
|
// mermaid is the adopter's own dependency, loaded here only when a diagram is drawn.
|
|
4
4
|
//
|
|
5
|
-
// `view` renders the diagram's box and draws into it from a Mount (`DrawDiagram`), so it
|
|
6
|
-
// needs the DOM only once the box is on the page, never while rendering on the server. The
|
|
7
|
-
// box is keyed by the palette the page prints in, from the application's SchemeSwitch
|
|
8
|
-
// (`Scheme.SchemeSwitch.palette`, which under "System" follows the reader's system as it
|
|
9
|
-
// changes), so a new palette mounts a new box and draws the diagram again; a new source does
|
|
10
|
-
// the same. The box reports `SucceededDrawDiagram`, `FailedLoadMermaid` or `FailedDrawDiagram`
|
|
11
|
-
// through the caller's `toParentMessage`, and the caller keeps what it shows meanwhile (a
|
|
12
|
-
// Loading line, an error Notice) in its own Model:
|
|
13
|
-
//
|
|
14
|
-
// Mermaid.view(
|
|
15
|
-
// {
|
|
16
|
-
// source,
|
|
17
|
-
// palette: Scheme.SchemeSwitch.palette(model.schemeSwitch),
|
|
18
|
-
// toParentMessage: (message) => GotDiagramMessage({ message }),
|
|
19
|
-
// },
|
|
20
|
-
// h,
|
|
21
|
-
// );
|
|
22
|
-
//
|
|
23
|
-
// `renderDiagram` waits for the faces, so words are measured in them and not a fallback;
|
|
24
|
-
// renders in the box (it must be on the page), so labels are measured where they will print;
|
|
25
|
-
// and returns the SVG. Mermaid's settings are global, so draws run one at a time. It fails with
|
|
26
|
-
// `MermaidMissing` when mermaid itself does not load, and with `DiagramError` when mermaid
|
|
27
|
-
// loads but the diagram is not drawn.
|
|
28
|
-
//
|
|
29
5
|
// Two layers. themeCSS repaints with var(…), so the parts it names (nodes, edges, labels,
|
|
30
6
|
// clusters, actors, messages, notes) follow a palette switch in place. themeVariables must be
|
|
31
7
|
// colours, not var() strings (mermaid mixes its own shades from them), so they are read from
|