@yaks/ux 0.0.0-stage → 0.2.36
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/Answer.js +43 -0
- package/Answer.js.map +1 -0
- package/Answer.ts +84 -0
- package/Conversation.js +520 -0
- package/Conversation.js.map +1 -0
- package/Conversation.ts +649 -0
- package/ConversationBox.js +106 -0
- package/ConversationBox.js.map +1 -0
- package/ConversationBox.ts +198 -0
- package/ConversationLines.js +29 -0
- package/ConversationLines.js.map +1 -0
- package/ConversationLines.ts +48 -0
- package/Disclosure.js +79 -0
- package/Disclosure.js.map +1 -0
- package/Disclosure.ts +130 -0
- package/Edit.js +330 -0
- package/Edit.js.map +1 -0
- package/Edit.ts +488 -0
- package/EntityPopup.js +35 -0
- package/EntityPopup.js.map +1 -0
- package/EntityPopup.ts +52 -0
- package/Fields.js +161 -0
- package/Fields.js.map +1 -0
- package/Fields.ts +276 -0
- package/LICENSE +202 -0
- package/Order.js +105 -0
- package/Order.js.map +1 -0
- package/Order.ts +159 -0
- package/README.md +1023 -2
- package/Save.js +50 -0
- package/Save.js.map +1 -0
- package/Save.ts +115 -0
- package/Sort.js +49 -0
- package/Sort.js.map +1 -0
- package/Sort.ts +98 -0
- package/Submit.js +115 -0
- package/Submit.js.map +1 -0
- package/Submit.ts +174 -0
- package/Text.js +114 -0
- package/Text.js.map +1 -0
- package/Text.ts +140 -0
- package/TokenPicker.js +65 -0
- package/TokenPicker.js.map +1 -0
- package/TokenPicker.ts +117 -0
- package/_dist/Answer.d.ts +39 -0
- package/_dist/Answer.d.ts.map +1 -0
- package/_dist/Conversation.d.ts +131 -0
- package/_dist/Conversation.d.ts.map +1 -0
- package/_dist/ConversationBox.d.ts +29 -0
- package/_dist/ConversationBox.d.ts.map +1 -0
- package/_dist/ConversationLines.d.ts +13 -0
- package/_dist/ConversationLines.d.ts.map +1 -0
- package/_dist/Disclosure.d.ts +36 -0
- package/_dist/Disclosure.d.ts.map +1 -0
- package/_dist/Edit.d.ts +87 -0
- package/_dist/Edit.d.ts.map +1 -0
- package/_dist/EntityPopup.d.ts +12 -0
- package/_dist/EntityPopup.d.ts.map +1 -0
- package/_dist/Fields.d.ts +29 -0
- package/_dist/Fields.d.ts.map +1 -0
- package/_dist/Order.d.ts +40 -0
- package/_dist/Order.d.ts.map +1 -0
- package/_dist/Save.d.ts +28 -0
- package/_dist/Save.d.ts.map +1 -0
- package/_dist/Sort.d.ts +28 -0
- package/_dist/Sort.d.ts.map +1 -0
- package/_dist/Submit.d.ts +48 -0
- package/_dist/Submit.d.ts.map +1 -0
- package/_dist/Text.d.ts +27 -0
- package/_dist/Text.d.ts.map +1 -0
- package/_dist/TokenPicker.d.ts +19 -0
- package/_dist/TokenPicker.d.ts.map +1 -0
- package/_dist/anchor.d.ts +52 -0
- package/_dist/anchor.d.ts.map +1 -0
- package/_dist/anchored.d.ts +30 -0
- package/_dist/anchored.d.ts.map +1 -0
- package/_dist/completion-state.d.ts +65 -0
- package/_dist/completion-state.d.ts.map +1 -0
- package/_dist/completion.d.ts +73 -0
- package/_dist/completion.d.ts.map +1 -0
- package/_dist/composer-browser.d.ts +1 -0
- package/_dist/composer-browser.d.ts.map +1 -0
- package/_dist/composer.d.ts +31 -0
- package/_dist/composer.d.ts.map +1 -0
- package/_dist/context-menu-browser.d.ts +4 -0
- package/_dist/context-menu-browser.d.ts.map +1 -0
- package/_dist/context-menu.d.ts +95 -0
- package/_dist/context-menu.d.ts.map +1 -0
- package/_dist/drag.d.ts +29 -0
- package/_dist/drag.d.ts.map +1 -0
- package/_dist/edit-keys.d.ts +42 -0
- package/_dist/edit-keys.d.ts.map +1 -0
- package/_dist/emit.d.ts +7 -0
- package/_dist/emit.d.ts.map +1 -0
- package/_dist/entity-popup-browser.d.ts +3 -0
- package/_dist/entity-popup-browser.d.ts.map +1 -0
- package/_dist/face/FaceTagger.d.ts +25 -0
- package/_dist/face/FaceTagger.d.ts.map +1 -0
- package/_dist/face/review.d.ts +5 -0
- package/_dist/face/review.d.ts.map +1 -0
- package/_dist/face/tags.d.ts +99 -0
- package/_dist/face/tags.d.ts.map +1 -0
- package/_dist/field-values.d.ts +4 -0
- package/_dist/field-values.d.ts.map +1 -0
- package/_dist/fit-list.d.ts +4 -0
- package/_dist/fit-list.d.ts.map +1 -0
- package/_dist/hits.d.ts +27 -0
- package/_dist/hits.d.ts.map +1 -0
- package/_dist/host.d.ts +91 -0
- package/_dist/host.d.ts.map +1 -0
- package/_dist/image-fallback.d.ts +5 -0
- package/_dist/image-fallback.d.ts.map +1 -0
- package/_dist/keys.d.ts +95 -0
- package/_dist/keys.d.ts.map +1 -0
- package/_dist/kit.d.ts +23 -0
- package/_dist/kit.d.ts.map +1 -0
- package/_dist/lightbox-browser.d.ts +2 -0
- package/_dist/lightbox-browser.d.ts.map +1 -0
- package/_dist/lightbox.d.ts +42 -0
- package/_dist/lightbox.d.ts.map +1 -0
- package/_dist/live.d.ts +21 -0
- package/_dist/live.d.ts.map +1 -0
- package/_dist/mod.d.ts +67 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/read.d.ts +12 -0
- package/_dist/read.d.ts.map +1 -0
- package/_dist/resize.d.ts +43 -0
- package/_dist/resize.d.ts.map +1 -0
- package/_dist/rows.d.ts +31 -0
- package/_dist/rows.d.ts.map +1 -0
- package/_dist/save-browser.d.ts +29 -0
- package/_dist/save-browser.d.ts.map +1 -0
- package/_dist/select-browser.d.ts +1 -0
- package/_dist/select-browser.d.ts.map +1 -0
- package/_dist/select.d.ts +12 -0
- package/_dist/select.d.ts.map +1 -0
- package/_dist/sending.d.ts +10 -0
- package/_dist/sending.d.ts.map +1 -0
- package/_dist/sort-browser.d.ts +11 -0
- package/_dist/sort-browser.d.ts.map +1 -0
- package/_dist/state.d.ts +74 -0
- package/_dist/state.d.ts.map +1 -0
- package/_dist/suggest.d.ts +18 -0
- package/_dist/suggest.d.ts.map +1 -0
- package/_dist/swipe.d.ts +60 -0
- package/_dist/swipe.d.ts.map +1 -0
- package/_dist/ui.d.ts +6 -0
- package/_dist/ui.d.ts.map +1 -0
- package/_dist/upload-browser.d.ts +13 -0
- package/_dist/upload-browser.d.ts.map +1 -0
- package/_dist/views.d.ts +8 -0
- package/_dist/views.d.ts.map +1 -0
- package/_dist/vocab.d.ts +6 -0
- package/_dist/vocab.d.ts.map +1 -0
- package/anchor.js +58 -0
- package/anchor.js.map +1 -0
- package/anchor.ts +87 -0
- package/anchored.js +180 -0
- package/anchored.js.map +1 -0
- package/anchored.ts +232 -0
- package/completion-state.js +76 -0
- package/completion-state.js.map +1 -0
- package/completion-state.ts +120 -0
- package/completion.js +301 -0
- package/completion.js.map +1 -0
- package/completion.ts +433 -0
- package/composer-browser.js +4 -0
- package/composer-browser.js.map +1 -0
- package/composer-browser.ts +5 -0
- package/composer.js +42 -0
- package/composer.js.map +1 -0
- package/composer.ts +53 -0
- package/context-menu-browser.js +221 -0
- package/context-menu-browser.js.map +1 -0
- package/context-menu-browser.ts +231 -0
- package/context-menu.js +146 -0
- package/context-menu.js.map +1 -0
- package/context-menu.ts +194 -0
- package/deno.json +1 -0
- package/drag.js +33 -0
- package/drag.js.map +1 -0
- package/drag.ts +41 -0
- package/edit-keys.js +51 -0
- package/edit-keys.js.map +1 -0
- package/edit-keys.ts +81 -0
- package/emit.js +34 -0
- package/emit.js.map +1 -0
- package/emit.ts +55 -0
- package/entity-popup-browser.js +94 -0
- package/entity-popup-browser.js.map +1 -0
- package/entity-popup-browser.ts +100 -0
- package/face/FaceTagger.js +361 -0
- package/face/FaceTagger.js.map +1 -0
- package/face/FaceTagger.ts +507 -0
- package/face/NameProposal.js +61 -0
- package/face/NameProposal.js.map +1 -0
- package/face/NameProposal.ts +100 -0
- package/face/review.js +33 -0
- package/face/review.js.map +1 -0
- package/face/review.ts +49 -0
- package/face/tags.js +344 -0
- package/face/tags.js.map +1 -0
- package/face/tags.ts +357 -0
- package/field-values.js +20 -0
- package/field-values.js.map +1 -0
- package/field-values.ts +35 -0
- package/fit-list.js +66 -0
- package/fit-list.js.map +1 -0
- package/fit-list.ts +81 -0
- package/hits.js +65 -0
- package/hits.js.map +1 -0
- package/hits.ts +75 -0
- package/host.js +88 -0
- package/host.js.map +1 -0
- package/host.ts +212 -0
- package/image-fallback.js +32 -0
- package/image-fallback.js.map +1 -0
- package/image-fallback.ts +37 -0
- package/keys.js +418 -0
- package/keys.js.map +1 -0
- package/keys.ts +444 -0
- package/kit.js +41 -0
- package/kit.js.map +1 -0
- package/kit.ts +71 -0
- package/lightbox-browser.js +248 -0
- package/lightbox-browser.js.map +1 -0
- package/lightbox-browser.ts +232 -0
- package/lightbox.js +84 -0
- package/lightbox.js.map +1 -0
- package/lightbox.ts +103 -0
- package/live.js +111 -0
- package/live.js.map +1 -0
- package/live.ts +139 -0
- package/mod.js +67 -0
- package/mod.js.map +1 -0
- package/mod.ts +180 -0
- package/package.json +143 -4
- package/read.js +33 -0
- package/read.js.map +1 -0
- package/read.ts +56 -0
- package/resize.js +159 -0
- package/resize.js.map +1 -0
- package/resize.ts +203 -0
- package/rows.js +73 -0
- package/rows.js.map +1 -0
- package/rows.ts +97 -0
- package/save-browser.js +469 -0
- package/save-browser.js.map +1 -0
- package/save-browser.ts +530 -0
- package/select-browser.js +4 -0
- package/select-browser.js.map +1 -0
- package/select-browser.ts +5 -0
- package/select.js +296 -0
- package/select.js.map +1 -0
- package/select.ts +343 -0
- package/sending.js +36 -0
- package/sending.js.map +1 -0
- package/sending.ts +44 -0
- package/sort-browser.js +51 -0
- package/sort-browser.js.map +1 -0
- package/sort-browser.ts +70 -0
- package/state.js +99 -0
- package/state.js.map +1 -0
- package/state.ts +121 -0
- package/suggest.js +28 -0
- package/suggest.js.map +1 -0
- package/suggest.ts +32 -0
- package/swipe.js +186 -0
- package/swipe.js.map +1 -0
- package/swipe.ts +250 -0
- package/ui.js +507 -0
- package/ui.js.map +1 -0
- package/ui.ts +378 -0
- package/upload-browser.js +195 -0
- package/upload-browser.js.map +1 -0
- package/upload-browser.ts +303 -0
- package/upload-files.js +41 -0
- package/upload-files.js.map +1 -0
- package/upload-files.ts +49 -0
- package/views.js +8 -0
- package/views.js.map +1 -0
- package/views.ts +9 -0
- package/vocab.js +16 -0
- package/vocab.js.map +1 -0
- package/vocab.json +287 -0
- package/vocab.ts +17 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sources":["../host.ts"],"names":[],"mappings":"AAgB0C,SAGxC,KAAK,iBAAiB,EACtB,KAAK,GAAG,EACR,KAAK,SAAS,uBAGS;AACzB,cAAc,MAAM,2BAAgC;AACpD,cAAc,UAAU,0BAAyB;AACjD,cAAc,WAAW,4BAAiC;AAC1D,cAAc,KAAK,2BAAgC;AACnD,cAAc,IAAI,oBAAmB;AAErC,cAAc,MAAM,GAAE;AAEtB;kEACkE,GAClE,YAAY;EACV,SAAS,SAAS,aAAa,OAAO;EACtC,QAAQ,OAAO,MAAM;IACnB,OAAO;IACP,gEAAgE,YACvD,QAAQ,OAAO;IACxB,8BAA8B,YACrB,UAAU,MAAM;IACzB,YAAY,KAAK,MAAM,aAAa,IAAI,WAAW,IAAI;IACvD,cAAc,IAAI;;EAEpB,MAAM,KAAK,MAAM,KAAK,SAAS,SAAS;;AAG1C;;;uEAGuE,GACvE,YAAY;EACV,OAAO,OAAO,MAAM,KAAK,MAAM;EAC/B,OAAO,OAAO,MAAM,EAAE,MAAM,MAAM,KAAK,IAAI;EAC3C,QAAQ,OAAO,MAAM,KAAK,IAAI;EAC9B;;2BAEyB,GACzB,UAAU,UAAU,IAAI,WAAW,IAAI;;AAGzC;mBACmB,GACnB,YAAY,QAAQ;EAClB;IAAU,SAAS,cAAc,IAAI;;EACrC,OAAO,UAAU;EACjB,WAAW;;AAGb,0BAA0B,GAC1B,YAAY;EACV;mCACiC,GACjC,OAAO;EACP,mEAAmE,GACnE,OAAO;EACP,wEAAwE,GACxE,QAAQ;EACR;;qBAEmB,GACnB,QAAQ,GAAG,WAAW,OAAO;EAC7B,yCAAyC,GACzC,OAAO,KAAK,MAAM,KAAK,MAAM;EAC7B,iCAAiC,GACjC,KAAK,GAAG,WAAW,MAAM;EACzB,oCAAoC,GACpC,OAAO,GAAG,WAAW,MAAM;EAC3B,uBAAuB,GACvB,OAAO,IAAI,MAAM,KAAK,MAAM;EAC5B;uEACqE,GACrE,MAAM,KAAK;EACX;2BACyB,GACzB,SAAS,MAAM;EACf,kDAAkD,GAClD,UAAU;EACV;oEACkE,GAClE,aAAa,MAAM,MAAM,KAAK,MAAM;EACpC;mCACiC,GACjC;IAAW,QAAQ,kBAAkB;;EACrC,2DAA2D,GAC3D,UAAU,MAAM,MAAM,KAAK;EAC3B;;;oCAGkC,GAClC,SAAS,MAAM,MAAM,KAAK,MAAM;EAChC,wDAAwD,GACxD,SAAS,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,OAAO,MAAM,KAAK;EACvD,mDAAmD,GACnD,QAAQ;;AAOV;;;;;;CAMC,GACD,OAAO,YAAI,KACT;EACE,OAAO;EACP,KAAK,MAAM;EACX,WAAW;CACZ,KACA,IAAI,QASN;AAED,0BAA0B,GAC1B,OAAO,YAAI,eAAc,KAIxB;AAED;oBACoB,GACpB,OAAO,YAAI,gBAAe,MAAM,CAAwB;AAExD,+EAA+E,GAC/E,OAAO,YAAI,YAAa,SAAS,WAAS,OAKzC;AAED;gDACgD,GAChD,OAAO,YAAI,cAAe,GACxB,QAAQ,KAAK,QAAQ,WACrB,YAAY,GACZ,MAAM,OAAO,OACZ,EAUF;AAED;wBACwB,GACxB,OAAO,YAAI,WAAY,OAAO,MAAM,EAAE,SAAS,WAAS,MAAM,CAG7D;AAED;0EAC0E,GAC1E,OAAO,YAAI,kBAAiB,SAAS,SAAS,KAAK,QAAQ,WAkB1D"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Hide an image's backdrop once its current source can be shown. A swap or
|
|
2
|
+
* a redraw (@yaks/ui/navigate `morph`) can keep the node and its pixels while
|
|
3
|
+
* taking the mark away, as the server never drew it: it is put back while the
|
|
4
|
+
* image can still be shown. */ export declare let imageFallbacks: (doc: Document) => void;
|
|
5
|
+
//# sourceMappingURL=image-fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-fallback.d.ts","sources":["../image-fallback.ts"],"names":[],"mappings":"AAWA;;;6BAG6B,GAC7B,OAAO,YAAI,iBAAkB,KAAK,aAAW,IAAI,CAmBhD"}
|
package/_dist/keys.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keys that walk a page: vim's, one keymap and one cursor for every door.
|
|
3
|
+
*
|
|
4
|
+
* The **cursor** is the item the keys stand on, a mark of its own
|
|
5
|
+
* (`data-cursor`), never the browser's focus: standing on a field doesn't
|
|
6
|
+
* type into it, and nothing opening or closing moves it. In normal mode h, j,
|
|
7
|
+
* k and l move it to the item left of, below, above or right of where it
|
|
8
|
+
* stands; gg and G to the first and the last; Enter or Space presses the item
|
|
9
|
+
* (a link opens, a button presses); H and L go back and forward. An **item**
|
|
10
|
+
* is anything a person can press or type into.
|
|
11
|
+
*
|
|
12
|
+
* Insert mode is the browser's focus in a field: i, or Enter on a field,
|
|
13
|
+
* gives the item under the cursor the focus to type into, and every key is
|
|
14
|
+
* the field's until Esc leaves it, the cursor still on it.
|
|
15
|
+
*
|
|
16
|
+
* A **layer** is what floats over the page: a peek, a menu, a popover, a
|
|
17
|
+
* dialog (`role="dialog"`, `role="menu"`, `aria-modal`). The front-most one
|
|
18
|
+
* takes the keys: the cursor walks only its items, and Esc or q sends it
|
|
19
|
+
* `cancel`, which a layer answers by closing, and the cursor goes back to
|
|
20
|
+
* what it stood on when the layer opened. Without a layer the keys walk the
|
|
21
|
+
* whole surface, the sidebar beside the page included.
|
|
22
|
+
*
|
|
23
|
+
* A browser hears the keys as it hears any, and @yaks/tui's document
|
|
24
|
+
* dispatches the same keydown, measures what it painted, and presses and
|
|
25
|
+
* focuses as a browser does, so one `walk` walks a page in either.
|
|
26
|
+
*
|
|
27
|
+
* The core is pure: `chord` reads keys into moves, and `land` picks the item
|
|
28
|
+
* a move lands on from where the items sit. `walk` is the boundary that reads
|
|
29
|
+
* the document and moves the cursor.
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { land } from '@yaks/ux/keys'
|
|
33
|
+
* import { equal } from '@yaks/testing'
|
|
34
|
+
*
|
|
35
|
+
* // Two rows of two: l goes right, j goes down, h from the left edge stays.
|
|
36
|
+
* let at = (left: number, top: number) =>
|
|
37
|
+
* ({ left, top, right: left + 10, bottom: top + 10 })
|
|
38
|
+
* let page = [at(0, 0), at(20, 0), at(0, 20), at(20, 20)]
|
|
39
|
+
* equal(land(page, 0, 'right'), 1)
|
|
40
|
+
* equal(land(page, 1, 'down'), 3)
|
|
41
|
+
* equal(land(page, 2, 'left'), undefined)
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @module
|
|
45
|
+
*/ import { type OverlayOptions } from "@yaks/ui/overlays";
|
|
46
|
+
/** Where an item sits, in its platform's units: pixels, or a terminal's
|
|
47
|
+
* cells. */ export type Box = {
|
|
48
|
+
left: number;
|
|
49
|
+
top: number;
|
|
50
|
+
right: number;
|
|
51
|
+
bottom: number;
|
|
52
|
+
};
|
|
53
|
+
type Way = 'up' | 'down' | 'left' | 'right';
|
|
54
|
+
/** What a chord does. */ export type Move = Way | 'first' | 'last' | 'back' | 'forward' | 'open' | 'insert' | 'close';
|
|
55
|
+
/** The keymap: a chord typed in normal mode, and its move. */ export declare let keymap: Record<string, Move>;
|
|
56
|
+
/** The keymap as a keybinding card reads it. */ export declare let walkKeys: {
|
|
57
|
+
keys: string[];
|
|
58
|
+
about: string;
|
|
59
|
+
}[];
|
|
60
|
+
/** A key read after the keys still pending: the move a whole chord makes, or
|
|
61
|
+
* the chord begun and still pending. A key that ends no chord starts over. */ export declare let chord: (pending: string, key: string) => {
|
|
62
|
+
move?: Move;
|
|
63
|
+
pending: string;
|
|
64
|
+
};
|
|
65
|
+
/** The item a move lands on from the one at `at` (-1 for none), among items
|
|
66
|
+
* in reading order with where each sits; undefined stays put. An item with no
|
|
67
|
+
* box is out of sight (a terminal paints only what its window shows): a walk
|
|
68
|
+
* up or down that finds nothing in sight reaches it in reading order. From
|
|
69
|
+
* nowhere, a walk starts at the first item in `view`, or the last walking up
|
|
70
|
+
* or left. */ export declare let land: (boxes: (Box | undefined)[], at: number, move: Way | 'first' | 'last', view?: Box) => number | undefined;
|
|
71
|
+
/** Whether `at` is being typed into: a field that takes every printable key,
|
|
72
|
+
* j and k among them. A select, a checkbox or a button lets the keys walk
|
|
73
|
+
* on. */ export declare let typing: (at: EventTarget | null | undefined) => boolean;
|
|
74
|
+
/** The items under `root` the cursor stands on, in reading order: what can
|
|
75
|
+
* be pressed or typed into, and is shown. */ export declare let items: (root: Element) => Element[];
|
|
76
|
+
/** The front-most layer for the cursor, using the shared overlay stack. */ export declare let front: (surface: Element) => Element | undefined;
|
|
77
|
+
/** Put up a layer that no kit part draws (one a server drew, a game's glass,
|
|
78
|
+
* a frame's whole page standing over its parent's): while it is open and
|
|
79
|
+
* `shown` (default: not `hidden`), Esc in front of everything opened before
|
|
80
|
+
* it sends it `close`, which closes it or answers false to stay. A kit part
|
|
81
|
+
* is a layer by its `onCancel` instead. Returns what takes it down. */ export declare let layer: (node: HTMLElement, close: () => boolean | void, o?: OverlayOptions) => () => void;
|
|
82
|
+
/** The walk over a surface (the app's frame: the sidebar and the page):
|
|
83
|
+
* `key` hears keydowns, and `point` hears presses, which carry the cursor,
|
|
84
|
+
* unmarked, to the item pressed. A walk from nowhere starts in `start` (the
|
|
85
|
+
* page) when there is one. A key someone took before it, a key with Ctrl,
|
|
86
|
+
* Alt or Meta, and every key while a field is typed into pass by. */ export declare let walk: (o: {
|
|
87
|
+
surface: () => Element | null | undefined;
|
|
88
|
+
start?: () => Element | null | undefined;
|
|
89
|
+
back?: () => void;
|
|
90
|
+
forward?: () => void;
|
|
91
|
+
}) => {
|
|
92
|
+
key: (e: KeyboardEvent) => void;
|
|
93
|
+
point: (e: Event) => void;
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sources":["../keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CC,GAED,SAKE,KAAK,cAAc,iCACgB;AAErC;UACU,GACV,YAAY;EAAQ,MAAM,MAAM;EAAE,KAAK,MAAM;EAAE,OAAO,MAAM;EAAE,QAAQ,MAAM;;KAEvE,MAAM,OAAO,SAAS,SAAS;AAEpC,uBAAuB,GACvB,YAAY,OACR,MACA,UACA,SACA,SACA,YACA,SACA,WACA;AAEJ,4DAA4D,GAC5D,OAAO,YAAI,QAAQ,OAAO,MAAM,EAAE,MAcjC;AAED,8CAA8C,GAC9C,OAAO,YAAI;EAAY,MAAM,MAAM;EAAI,OAAO,MAAM;IAanD;AAED;4EAC4E,GAM5E,OAAO,YAAI,QACT,SAAS,MAAM,EACf,KAAK,MAAM;EACR,OAAO;EAAM,SAAS,MAAM;EAOhC;AAyCD;;;;;YAKY,GAKZ,OAAO,YAAI,OACT,QAAQ,MAAM,SAAS,KACvB,IAAI,MAAM,EACV,MAAM,MAAM,UAAU,QACtB,OAAO,QACN,MAAM,GAAG,SAAS,CAsBpB;AAiCD;;OAEO,GACP,OAAO,YAAI,SAAU,IAAI,cAAc,IAAI,GAAG,SAAS,KAAG,OAAO,CAKhE;AASD;2CAC2C,GAC3C,OAAO,YAAI,QAAS,MAAM,YAAU,UAIjC;AAEH,yEAAyE,GACzE,OAAO,YAAI,QAAS,SAAS,YAAU,UAAU,SAAS,CASzD;AAED;;;;qEAIqE,GACrE,OAAO,YAAI,QACT,MAAM,aACN,aAAa,OAAO,GAAG,IAAI,EAC3B,IAAI,yBACG,IAAI,CAA+B;AAuC5C;;;;mEAImE,GACnE,OAAO,YAAI,OAAQ;EACjB,eAAe,UAAU,IAAI,GAAG,SAAS;EACzC,cAAc,UAAU,IAAI,GAAG,SAAS;EACxC,aAAa,IAAI;EACjB,gBAAgB,IAAI;;EAChB,MAAM,GAAG,kBAAkB,IAAI;EAAE,QAAQ,GAAG,UAAU,IAAI;EAoH/D"}
|
package/_dist/kit.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** UX kits describe controlled components and the page-only words they own.
|
|
2
|
+
* A kit carries declarations, not a store: the page loads its vocabulary and
|
|
3
|
+
* names each instance's entity. Drafts stay with the host, outside kit state.
|
|
4
|
+
* @module
|
|
5
|
+
*/ import type { ReactElement } from "@types/react";
|
|
6
|
+
import { type VocabDoc } from "@yaks/vocab";
|
|
7
|
+
/** A labelled tree, drawn by the guide within its own composition. */ export type Specimen = [label: string, node: ReactElement];
|
|
8
|
+
/** Metadata for one controlled component. Props remain on its own export;
|
|
9
|
+
* this erased component reference is for discovery, not invocation. */ export type Piece = {
|
|
10
|
+
Component: (props: never) => ReactElement | null;
|
|
11
|
+
description: string;
|
|
12
|
+
specimens: () => Specimen[];
|
|
13
|
+
/** CamelCase state and event components declared in this kit's vocabulary. */ state: string[];
|
|
14
|
+
};
|
|
15
|
+
/** A bringer's components and vocabulary, usable without a plugin host. */ export type Kit = {
|
|
16
|
+
description: string;
|
|
17
|
+
components: Record<string, Piece>;
|
|
18
|
+
vocab: VocabDoc;
|
|
19
|
+
};
|
|
20
|
+
/** Check the kit boundary before exposing it to a page. Every state word
|
|
21
|
+
* belongs to the bringer, is CamelCase, and stays off the wire. */ export declare let defineKit: <T extends Kit>(kit: T) => T;
|
|
22
|
+
/** The documents a page loads beside its domain vocabulary. */ export declare let kitDocs: (kits: Record<string, Kit>) => VocabDoc[];
|
|
23
|
+
//# sourceMappingURL=kit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kit.d.ts","sources":["../kit.ts"],"names":[],"mappings":"AAAA;;;;CAIC,GAEyC,cAAc,YAAY,uBAA0B;AAC9F,SAAmB,KAAK,QAAQ,2BAAgC;AAEhE,oEAAoE,GACpE,YAAY,YAAY,OAAO,MAAM,EAAE,MAAM;AAE7C;qEACqE,GACrE,YAAY;EACV,YAAY,OAAO,KAAK,KAAK,eAAe,IAAI;EAChD,aAAa,MAAM;EACnB,iBAAiB;EACjB,4EAA4E,GAC5E,OAAO,MAAM;;AAGf,yEAAyE,GACzE,YAAY;EACV,aAAa,MAAM;EACnB,YAAY,OAAO,MAAM,EAAE;EAC3B,OAAO;;AAGT;iEACiE,GACjE,OAAO,YAAI,YAAa,UAAU,KAAK,KAAK,MAAI,EAgC/C;AAED,6DAA6D,GAC7D,OAAO,YAAI,UACT,MAAM,OAAO,MAAM,EAAE,SACpB,WAEF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lightbox-browser.d.ts","sources":["../lightbox-browser.ts"],"names":[],"mappings":"AAgCA,0DAA0D,GAC1D,OAAO,YAAI,aAAc,KAAK,aAAW,IAAI,CAsM5C"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A picture opened over the page (@yaks/ui `Lightbox`): the shell a page
|
|
3
|
+
* draws once, and the arithmetic of zooming, panning and stepping that
|
|
4
|
+
* `lightboxes` (./lightbox-browser.ts) moves it by.
|
|
5
|
+
*
|
|
6
|
+
* A `View` is the picture's scale and its offset from the stage's middle, in
|
|
7
|
+
* pixels. Zooming keeps the point under the finger or pointer where it is,
|
|
8
|
+
* and the picture never leaves an empty edge it could have covered.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { bounded, stepped, zoomAt } from '@yaks/ux/lightbox'
|
|
12
|
+
* import { equal } from '@yaks/testing'
|
|
13
|
+
*
|
|
14
|
+
* // Twice as large about a point 100px right of the middle: the middle
|
|
15
|
+
* // moves left, so the point stays put.
|
|
16
|
+
* equal(zoomAt({ scale: 1, x: 0, y: 0 }, 2, 100, 0), { scale: 2, x: -100, y: 0 })
|
|
17
|
+
* // Back to its fit, it is centred again.
|
|
18
|
+
* equal(zoomAt({ scale: 2, x: -100, y: 0 }, .25, 0, 0), { scale: 1, x: 0, y: 0 })
|
|
19
|
+
* // A 400×300 picture twice as large on a 500×700 stage pans 150px across
|
|
20
|
+
* // and not at all down, where it still fits.
|
|
21
|
+
* equal(bounded({ scale: 2, x: -400, y: 80 }, 400, 300, 500, 700), { scale: 2, x: -150, y: 0 })
|
|
22
|
+
* equal([stepped(0, 3, -1), stepped(0, 3, 1), stepped(2, 3, 1)], [0, 1, 2])
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @module
|
|
26
|
+
*/ import { type ReactElement } from "@types/react";
|
|
27
|
+
/** How a picture is shown: its scale and its offset from the middle. */ export type View = {
|
|
28
|
+
scale: number;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
/** The picture fit to the stage. */ export declare let FIT: View;
|
|
33
|
+
/** The largest a picture is drawn, over its fit. */ export declare let MOST: number;
|
|
34
|
+
/** How far a finger moves sideways on a fit picture to step to the next. */ export declare let SWIPE: number;
|
|
35
|
+
/** `view` scaled by `factor` about the point `px`, `py` from the middle. */ export declare let zoomAt: ({}: View, factor: number, px: number, py: number) => View;
|
|
36
|
+
/** `view` kept over the stage: a `width`×`height` picture (as fit) on a
|
|
37
|
+
* `w`×`h` stage pans no further than its edges, and stays centred along a
|
|
38
|
+
* side it does not fill. */ export declare let bounded: (view: View, width: number, height: number, w: number, h: number) => View;
|
|
39
|
+
/** The picture `by` from `at` among `count`, going no further than the
|
|
40
|
+
* first or the last. */ export declare let stepped: (at: number, count: number, by: number) => number;
|
|
41
|
+
/** The one picture frame a page draws, filled by `lightboxes`. */ export declare let LightboxShell: () => ReactElement;
|
|
42
|
+
//# sourceMappingURL=lightbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lightbox.d.ts","sources":["../lightbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACyC,SAA6B,KAAK,YAAY,uBAA0B;AAGlH,sEAAsE,GACtE,YAAY;EAAS,OAAO,MAAM;EAAE,GAAG,MAAM;EAAE,GAAG,MAAM;;AAExD,kCAAkC,GAClC,OAAO,YAAI,KAAK,KAA+B;AAC/C,kDAAkD,GAClD,OAAO,YAAI,aAAQ;AACnB,0EAA0E,GAC1E,OAAO,YAAI,cAAU;AAErB,0EAA0E,GAC1E,OAAO,YAAI,SACT,IAAiB,IAAI,EACrB,QAAQ,MAAM,EACd,IAAI,MAAM,EACV,IAAI,MAAM,KACT,KAKF;AAED;;0BAE0B,GAC1B,OAAO,YAAI,UACT,MAAM,MACN,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,GAAG,MAAM,EACT,GAAG,MAAM,KACR,KAUF;AAED;sBACsB,GACtB,OAAO,YAAI,UAAW,IAAI,MAAM,EAAE,OAAO,MAAM,EAAE,IAAI,MAAM,KAAG,MAAM,CACzB;AAE3C,gEAAgE,GAChE,OAAO,YAAI,qBAAoB,aAuB5B"}
|
package/_dist/live.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Row } from "./state.js";
|
|
2
|
+
/** One `Edit`, as its owner and the component itself hold it: its eid, its
|
|
3
|
+
* row, the draft of its value, and the acts on them. */ export type Editing = {
|
|
4
|
+
/** its eid in the page's graph */ at: string;
|
|
5
|
+
/** its state, read live */ row: Row | undefined;
|
|
6
|
+
/** the place its value's draft is typed in */ place: string;
|
|
7
|
+
/** what is typed over the value and not yet sent ('' for nothing) */ text: string;
|
|
8
|
+
/** being changed: its state says so, or its value's draft says something */ open: boolean;
|
|
9
|
+
/** its state as the graph holds it now, for a handler that runs between
|
|
10
|
+
* paints */ now: () => Row | undefined;
|
|
11
|
+
/** open it */ begin: () => void;
|
|
12
|
+
/** close it; the draft stays */ end: () => void;
|
|
13
|
+
/** what is typed over the value: the draft */ type: (text: string) => void;
|
|
14
|
+
/** the draft was sent, or put back: empty it */ spend: () => void;
|
|
15
|
+
/** what is typed in its picker's search */ search: (query: string) => void;
|
|
16
|
+
};
|
|
17
|
+
/** The `Edit` that changes `comp.prop` of `eid` here: its state the one its
|
|
18
|
+
* caller names (`at`), or the one derived from the owner above (host.ts
|
|
19
|
+
* `Ux`); `value` is what the value holds now, which a draft saying the same
|
|
20
|
+
* does not open. */ export declare let useEdit: (eid: string, comp: string, prop: string, _dts_1: never) => Editing;
|
|
21
|
+
//# sourceMappingURL=live.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.d.ts","sources":["../live.ts"],"names":[],"mappings":"AAeA,SAAyB,KAAK,GAAG,qBAA4B;AAqD7D;sDACsD,GACtD,YAAY;EACV,gCAAgC,GAChC,IAAI,MAAM;EACV,yBAAyB,GACzB,KAAK,MAAM,SAAS;EACpB,4CAA4C,GAC5C,OAAO,MAAM;EACb,mEAAmE,GACnE,MAAM,MAAM;EACZ,0EAA0E,GAC1E,MAAM,OAAO;EACb;YACU,GACV,WAAW,MAAM,SAAS;EAC1B,YAAY,GACZ,aAAa,IAAI;EACjB,8BAA8B,GAC9B,WAAW,IAAI;EACf,4CAA4C,GAC5C,OAAO,MAAM,MAAM,KAAK,IAAI;EAC5B,8CAA8C,GAC9C,aAAa,IAAI;EACjB,yCAAyC,GACzC,SAAS,OAAO,MAAM,KAAK,IAAI;;AAGjC;;;kBAGkB,GAClB,OAAO,YAAI,UACT,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,MAAM,MAAM,EACZ,kBACC,QAiCF"}
|
package/_dist/mod.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @yaks/ux: UX components, between UI components (@yaks/ui: a look, no
|
|
3
|
+
* behavior) and domain components (meaning: queries, server data). A UX
|
|
4
|
+
* component prescribes behavior and holds no state of its own in memory: it
|
|
5
|
+
* is controlled by a bundle and emits a bundle of the same shape, the way
|
|
6
|
+
* `<input value onChange>` does, and an event bundle only when it has
|
|
7
|
+
* something to say that is not a new value. Its own state is one component
|
|
8
|
+
* named after it, in CamelCase, on an entity of its own in the page's graph
|
|
9
|
+
* (./vocab.json), so its owner can read it and a remount finds it again.
|
|
10
|
+
*
|
|
11
|
+
* - `Edit`, `Edit.Text`, `Edit.Control`: a property's value changed where it
|
|
12
|
+
* stands, typed over in place, or its control alone (./Edit.ts, ./Text.ts).
|
|
13
|
+
* - `Disclosure`: the kit's fold, its summary opening what it holds, and
|
|
14
|
+
* `DisclosureMark`, a second way to open it; `Loading`, what a lazy one
|
|
15
|
+
* holds until opened; `disclosureAt`, `isOpen`,
|
|
16
|
+
* `disclosed`, its page eid and bundles, pure (./Disclosure.ts).
|
|
17
|
+
* - `Answer`: a query's rows, or that it is loading, empty or could not
|
|
18
|
+
* load, from its `Answered` state (`useAnswered`); `Refused`, a read of
|
|
19
|
+
* one entity that could not load (./Answer.ts).
|
|
20
|
+
* - `Fields`: controlled inputs and repeat groups (./Fields.ts).
|
|
21
|
+
* - `Submit`: loading, durable drafts and submission lifecycle (./Submit.ts).
|
|
22
|
+
* - `Ux`, `useHost`, `Host`: what a page hands down, once per tree
|
|
23
|
+
* (./host.ts).
|
|
24
|
+
* - `drag`, `drags`, `dragged`: an entity dragged from one place to
|
|
25
|
+
* another, whoever drew either (./drag.ts).
|
|
26
|
+
* - `Order`: a list put in order by dragging its rows, taking a dragged
|
|
27
|
+
* entity between two of them; `orderAt`, `landing`, `landed`, `among`,
|
|
28
|
+
* `placing`, its page eid, bundles and arithmetic, pure (./Order.ts).
|
|
29
|
+
* - `useEdit`, `Editing`: an `Edit`'s state, read and changed by whoever
|
|
30
|
+
* owns it (./live.ts).
|
|
31
|
+
* - `at`, `place`, `put`, `changed`, `refused`, `valueOf`: the bundles and
|
|
32
|
+
* names, pure (./state.ts).
|
|
33
|
+
* - `editorViews`, `views`: the editors as registrations (the `/views`
|
|
34
|
+
* facet); `TimeVal`, `UrlVal`: faces.
|
|
35
|
+
* - `pickLine`, `useHits`, `label`: a picker's candidates, asked of the
|
|
36
|
+
* graph.
|
|
37
|
+
* - `canEdit`, `formatProp`, `reading`: what a value is, pure.
|
|
38
|
+
*
|
|
39
|
+
* What binds the DOM is a `-browser` module, at a subpath of its own
|
|
40
|
+
* (`./save`, `./sort`) and never here: a server imports this front door, and
|
|
41
|
+
* the Workers program checks what it reaches with the runtime's globals,
|
|
42
|
+
* which have no DOM.
|
|
43
|
+
*
|
|
44
|
+
* @module
|
|
45
|
+
*/ export { type Bundle, type Drafts, type Float, type Front, heldDrafts, type Host, useDraft, useDrafts, useFollowed, useHost, useOwner, Ux } from "./host.js";
|
|
46
|
+
export { type ControlOwnProps, type ControlProps, Edit, type Editor, editorViews, type EditProps, TimeVal, UrlVal, views } from "./Edit.js";
|
|
47
|
+
export { Text, type TextProps } from "./Text.js";
|
|
48
|
+
export { Save, type SaveFieldProps, type SaveProps } from "./Save.js";
|
|
49
|
+
export { type Disclosed, disclosed, Disclosure, disclosureAt, DisclosureMark, type DisclosureProps, isOpen, Loading } from "./Disclosure.js";
|
|
50
|
+
export { type BoxProps, Conversation, conversationAt, type ConversationProps, conversed, type Conversing, conversingOf, Fold, Folds, type Line, NEAR, shown, stopped, TAKE, useFold } from "./Conversation.js";
|
|
51
|
+
export { useAnswered, useObserved, useRows, useStoreEdit, useWatch } from "./rows.js";
|
|
52
|
+
export { Answer, type Answered, type AnswerProps, Refused, type RefusedProps } from "./Answer.js";
|
|
53
|
+
export { Fields, type FieldSpec, type FieldsProps } from "./Fields.js";
|
|
54
|
+
export { type Feedback, type Read, type Send, Submit, submitAt, submitOf, type SubmitProps, type SubmitState, type SubmitView, type Upload } from "./Submit.js";
|
|
55
|
+
export { type Path, put as putValue, type Values } from "./field-values.js";
|
|
56
|
+
export { drag, DRAGGED, dragged, drags } from "./drag.js";
|
|
57
|
+
export { among, landed, landing, Order, orderAt, type OrderProps, placing } from "./Order.js";
|
|
58
|
+
export { type Editing, useEdit } from "./live.js";
|
|
59
|
+
export { at, changed, place, put, refused, type Row, source, valueOf } from "./state.js";
|
|
60
|
+
export { emit, type OnChange, reading } from "./emit.js";
|
|
61
|
+
export { canEdit, formatProp, isBody, wellOf } from "./read.js";
|
|
62
|
+
export { type Find, pickLine, useHits } from "./hits.js";
|
|
63
|
+
export { label } from "./suggest.js";
|
|
64
|
+
export { defineKit, type Kit, kitDocs, type Piece, type Specimen } from "./kit.js";
|
|
65
|
+
export { completion, type Controller as CompletionController, type FieldProps } from "./completion.js";
|
|
66
|
+
export { Sort, sortAt, sorted, sortOf, type SortProps, type SortRow, sortRows, type SortState, type SortValue } from "./Sort.js";
|
|
67
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sources":["../mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CC,GAED,SACE,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,KAAK,EACV,UAAU,EACV,KAAK,IAAI,EACT,QAAQ,EACR,SAAS,EACT,WAAW,EACX,OAAO,EACP,QAAQ,EACR,EAAE,oBACc;AAClB,SACE,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,IAAI,EACJ,KAAK,MAAM,EACX,WAAW,EACX,KAAK,SAAS,EACd,OAAO,EACP,MAAM,EACN,KAAK,oBACW;AAClB,SAAS,IAAI,EAAE,KAAK,SAAS,oBAAmB;AAChD,SAAS,IAAI,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,oBAAmB;AACrE,SACE,KAAK,SAAS,EACd,SAAS,EACT,UAAU,EACV,YAAY,EACZ,cAAc,EACd,KAAK,eAAe,EACpB,MAAM,EACN,OAAO,0BACe;AACxB,SACE,KAAK,QAAQ,EACb,YAAY,EACZ,cAAc,EACd,KAAK,iBAAiB,EACtB,SAAS,EACT,KAAK,UAAU,EACf,YAAY,EACZ,IAAI,EACJ,KAAK,EACL,KAAK,IAAI,EACT,IAAI,EACJ,KAAK,EACL,OAAO,EACP,IAAI,EACJ,OAAO,4BACiB;AAC1B,SACE,WAAW,EACX,WAAW,EACX,OAAO,EACP,YAAY,EACZ,QAAQ,oBACQ;AAClB,SACE,MAAM,EACN,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,OAAO,EACP,KAAK,YAAY,sBACC;AACpB,SAAS,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,sBAAqB;AACtE,SACE,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,IAAI,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,MAAM,sBACO;AACpB,SAAS,KAAK,IAAI,EAAE,OAAO,QAAQ,EAAE,KAAK,MAAM,4BAA2B;AAE3E,SAAS,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,oBAAmB;AACzD,SACE,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,OAAO,EACP,KAAK,UAAU,EACf,OAAO,qBACU;AACnB,SAAS,KAAK,OAAO,EAAE,OAAO,oBAAmB;AACjD,SACE,EAAE,EACF,OAAO,EACP,KAAK,EACL,GAAG,EACH,OAAO,EACP,KAAK,GAAG,EACR,MAAM,EACN,OAAO,qBACU;AACnB,SAAS,IAAI,EAAE,KAAK,QAAQ,EAAE,OAAO,oBAAmB;AACxD,SAAS,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,oBAAmB;AAC/D,SAAS,KAAK,IAAI,EAAE,QAAQ,EAAE,OAAO,oBAAmB;AACxD,SAAS,KAAK,uBAAsB;AAEpC,SACE,SAAS,EACT,KAAK,GAAG,EACR,OAAO,EACP,KAAK,KAAK,EACV,KAAK,QAAQ,mBACE;AAEjB,SACE,UAAU,EACV,KAAK,cAAc,oBAAoB,EACvC,KAAK,UAAU,0BACO;AAExB,SACE,IAAI,EACJ,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,QAAQ,EACR,KAAK,SAAS,EACd,KAAK,SAAS,oBACE"}
|
package/_dist/read.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Vocab } from "@yaks/vocab";
|
|
2
|
+
/** Whether a client may write this property: its component is on the wire and
|
|
3
|
+
* the property is neither stamped nor computed. */ export declare let canEdit: (vocab: Vocab, comp: string, prop: string) => boolean;
|
|
4
|
+
/** Whether a property is a body: long text kept apart (`store: 'blob'`),
|
|
5
|
+
* typed over on many lines. */ export declare let isBody: (vocab: Vocab, comp: string, prop: string) => boolean;
|
|
6
|
+
/** The well a property's suggestions come from, or '' for none. */ export declare let wellOf: (vocab: Vocab, comp: string, prop: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* A value as its face says it, or null for nothing to show: a priority with
|
|
9
|
+
* its P, a flag as true or false, a reference as what it is called, a JSON
|
|
10
|
+
* value as its text.
|
|
11
|
+
*/ export declare let formatProp: (vocab: Vocab, comp: string, prop: string, value: unknown, name?: (eid: string) => string | undefined) => string | null;
|
|
12
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sources":["../read.ts"],"names":[],"mappings":"AASA,cAAc,KAAK,2BAAgC;AAEnD;iDACiD,GACjD,OAAO,YAAI,UAAW,OAAO,OAAO,MAAM,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAGvE;AAUD;6BAC6B,GAC7B,OAAO,YAAI,SAAU,OAAO,OAAO,MAAM,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAC/B;AAExC,iEAAiE,GACjE,OAAO,YAAI,SAAU,OAAO,OAAO,MAAM,MAAM,EAAE,MAAM,MAAM,KAAG,MAAM,CACnC;AAEnC;;;;CAIC,GACD,OAAO,YAAI,aACT,OAAO,OACP,MAAM,MAAM,EACZ,MAAM,MAAM,EACZ,OAAO,OAAO,EACd,QAAO,KAAK,MAAM,KAAK,MAAM,GAAG,SAAS,KACxC,MAAM,GAAG,IAAI,CASf"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A pane the person resizes by its edge: a grip (`data-resize`, a focusable
|
|
3
|
+
* `separator`) stands on the edge of the pane it names (`aria-controls`), on
|
|
4
|
+
* the pane's `left` or `right` (`data-resize`'s value, the side the grip is
|
|
5
|
+
* on). Dragging the grip moves the edge with the pointer; with the grip
|
|
6
|
+
* focused, the arrow keys move it a step, a bigger one with Shift, and Home
|
|
7
|
+
* and End take it to its narrowest and widest. The pane's width is its
|
|
8
|
+
* `--shell-aside` (@yaks/ui `Shell`), held between the pane's own computed
|
|
9
|
+
* `min-width` and `max-width`, so its sheet says how narrow and wide it goes.
|
|
10
|
+
*
|
|
11
|
+
* Once a drag ends, or a moment after the last key, the width is kept: posted
|
|
12
|
+
* as the grip's `data-resize-name` to its `data-resize-action`, where the
|
|
13
|
+
* page keeps it for the person and draws it again on every page. A double
|
|
14
|
+
* press on the grip gives the pane back its sheet's width, posting none.
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { held, keyed, widened } from '@yaks/ux/resize'
|
|
18
|
+
* import { equal } from '@yaks/testing'
|
|
19
|
+
*
|
|
20
|
+
* // A pane on the page's right, its grip on its left: moving left widens.
|
|
21
|
+
* equal(widened('left', 320, -40), 360)
|
|
22
|
+
* equal(widened('right', 320, -40), 280)
|
|
23
|
+
* equal(held(500, 256, 480), 480)
|
|
24
|
+
* equal(keyed('left', 'ArrowLeft', false, 320, 256, 640), 336)
|
|
25
|
+
* equal(keyed('left', 'ArrowRight', true, 320, 256, 640), 256)
|
|
26
|
+
* equal(keyed('left', 'End', false, 320, 256, 640), 640)
|
|
27
|
+
* equal(keyed('left', 'a', false, 320, 256, 640), undefined)
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @module
|
|
31
|
+
*/ /** The side of its pane a grip stands on. */ export type Side = 'left' | 'right';
|
|
32
|
+
/** How far an arrow key moves the edge, and with Shift, px. */ export declare let STEP: number;
|
|
33
|
+
export declare let LEAP: number;
|
|
34
|
+
/** How long after the last key the width is kept, ms. */ export declare let SETTLE: number;
|
|
35
|
+
/** `width` held between `min` and `max`. */ export declare let held: (width: number, min: number, max: number) => number;
|
|
36
|
+
/** The width of a pane `from` wide once its grip on `side` has moved `dx`:
|
|
37
|
+
* a grip on the left widens the pane moving left. */ export declare let widened: (side: Side, from: number, dx: number) => number;
|
|
38
|
+
/** The width a key on a grip on `side` takes a pane `width` wide to, held
|
|
39
|
+
* between `min` and `max`, or nothing for a key that is not the grip's. */ export declare let keyed: (side: Side, key: string, shift: boolean, width: number, min: number, max: number) => number | undefined;
|
|
40
|
+
/** What the grips read of the window, and post the width with. */ export type Window = Pick<typeof globalThis, 'getComputedStyle' | 'fetch'>;
|
|
41
|
+
/** Resize `doc`'s panes by their grips, keeping a width `settle` ms after
|
|
42
|
+
* the last key. */ export declare let resize: (doc: Document, win: Window) => () => void;
|
|
43
|
+
//# sourceMappingURL=resize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize.d.ts","sources":["../resize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GAED,2CAA2C,GAC3C,YAAY,OAAO,SAAS;AAE5B,6DAA6D,GAC7D,OAAO,YAAI,aAAS;AACpB,OAAO,YAAI,aAAS;AACpB,uDAAuD,GACvD,OAAO,YAAI,eAAY;AAEvB,0CAA0C,GAC1C,OAAO,YAAI,OAAQ,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MAAM,CAClB;AAEjD;mDACmD,GACnD,OAAO,YAAI,UAAW,MAAM,MAAM,MAAM,MAAM,EAAE,IAAI,MAAM,KAAG,MAAM,CAC3B;AAExC;yEACyE,GACzE,OAAO,YAAI,QACT,MAAM,MACN,KAAK,MAAM,EACX,OAAO,OAAO,EACd,OAAO,MAAM,EACb,KAAK,MAAM,EACX,KAAK,MAAM,KACV,MAAM,GAAG,SAAS,CAMpB;AAED,gEAAgE,GAChE,YAAY,SAAS,YAAY,YAAY,qBAAqB;AAOlE;iBACiB,GACjB,OAAO,YAAI,SACT,KAAK,UACL,KAAK,iBAEE,IAAI,CAuHZ"}
|
package/_dist/rows.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Bundle } from "@yaks/graph";
|
|
2
|
+
import type { Front } from "./host.js";
|
|
3
|
+
import type { Answered } from "./Answer.js";
|
|
4
|
+
/** Read a query live from a page graph or the app's store client: its rows,
|
|
5
|
+
* whether its first answer has arrived, and why it was refused, for `Answer`
|
|
6
|
+
* to draw. The hook owns the subscription for as long as the component needs
|
|
7
|
+
* it. A watch that says nothing of its readiness (a page's own graph) is
|
|
8
|
+
* ready. */ export declare let useAnswered: (front: Pick<Front, 'watch'>, query: string) => Answered;
|
|
9
|
+
/** Read matching bundles live from a page graph or the app's store client.
|
|
10
|
+
* The hook owns the subscription for as long as the component needs it. */ export declare let useRows: (front: Pick<Front, 'watch'>, query: string) => Bundle[];
|
|
11
|
+
/** Read a watch already held by the host without taking over its lifetime. */ export declare let useWatch: <T>(watch: {
|
|
12
|
+
readonly value: T;
|
|
13
|
+
subscribe: (changed: () => void) => () => void;
|
|
14
|
+
}) => T;
|
|
15
|
+
/** Read an observable snapshot and subscribe while the component is mounted. */ export declare let useObserved: <T>(source: {
|
|
16
|
+
peek: () => T;
|
|
17
|
+
subscribe: (changed: () => void) => () => void;
|
|
18
|
+
}) => T;
|
|
19
|
+
/** Bind an entity's buttons or inputs to optimistic edits. Read `issue`
|
|
20
|
+
* beside the value so a refusal remains visible after the rollback. */ export declare let useStoreEdit: (app: {
|
|
21
|
+
apply: (bundle: Bundle) => Promise<unknown>;
|
|
22
|
+
issue: (eid: string) => string | undefined;
|
|
23
|
+
prepareEdits?: () => unknown;
|
|
24
|
+
outbox: {
|
|
25
|
+
onPending: (changed: () => void) => () => void;
|
|
26
|
+
};
|
|
27
|
+
}, eid: string) => {
|
|
28
|
+
issue: string | undefined;
|
|
29
|
+
apply: (components: Omit<Bundle, 'entity'>) => Promise<unknown>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sources":["../rows.ts"],"names":[],"mappings":"AAUA,cAAc,MAAM,2BAAgC;AACpD,cAAc,KAAK,oBAAmB;AACtC,cAAc,QAAQ,sBAAqB;AAE3C;;;;UAIU,GACV,OAAO,YAAI,cACT,OAAO,KAAK,OAAO,UACnB,OAAO,MAAM,KACZ,SAoBF;AAED;yEACyE,GACzE,OAAO,YAAI,UAAW,OAAO,KAAK,OAAO,UAAU,OAAO,MAAM,KAAG,SACnC;AAEhC,4EAA4E,GAC5E,OAAO,YAAI,WAAY,GAAG;WACf,OAAO;EAChB,YAAY,eAAe,IAAI,WAAW,IAAI;MAC5C,EAMH;AAED,8EAA8E,GAC9E,OAAO,YAAI,cAAe,GAAG;EAC3B,YAAY;EACZ,YAAY,eAAe,IAAI,WAAW,IAAI;MAC5C,EAMH;AAED;qEACqE,GACrE,OAAO,YAAI,eACT;EACE,QAAQ,QAAQ,WAAW,QAAQ,OAAO;EAC1C,QAAQ,KAAK,MAAM,KAAK,MAAM,GAAG,SAAS;EAC1C,qBAAqB,OAAO;EAC5B;IAAU,YAAY,eAAe,IAAI,WAAW,IAAI;;GAE1D,KAAK,MAAM;EAEX,OAAO,MAAM,GAAG,SAAS;EACzB,QAAQ,YAAY,KAAK,QAAQ,cAAc,QAAQ,OAAO;EAW/D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Tell the Save bar what a live field now has saved. Keep a pending edit
|
|
2
|
+
* captured before the page was redrawn. */ export declare let rebaseSave: (field: HTMLSelectElement, saved: string, previous: string) => void;
|
|
3
|
+
export type SaveOptions = {
|
|
4
|
+
drafts: {
|
|
5
|
+
text: (place: string) => string;
|
|
6
|
+
type: (place: string, text: string) => void;
|
|
7
|
+
spend?: (place: string) => Promise<boolean>;
|
|
8
|
+
/** Run `fn` now and again whenever a text it read changes (@yaks/ux
|
|
9
|
+
* `Drafts`). */ follow: (fn: () => void) => () => void;
|
|
10
|
+
};
|
|
11
|
+
/** Save the captured body, after the page already shows it is saving; a
|
|
12
|
+
* rejection puts its fields back to pending, and a string it resolves to is
|
|
13
|
+
* what the bar says in place of "Saved". */ save: (form: HTMLFormElement, body: FormData) => Promise<unknown>;
|
|
14
|
+
report?: (error: unknown) => void;
|
|
15
|
+
/** Called after every changed form's write succeeds and no newer changes
|
|
16
|
+
* or writes remain. */ saved?: () => void;
|
|
17
|
+
/** How long the bar says a save worked before it goes, in milliseconds. */ linger?: number;
|
|
18
|
+
};
|
|
19
|
+
export type SaveBinding = {
|
|
20
|
+
/** Show the changes saving and write them; resolves once every write this
|
|
21
|
+
* binding has sent is answered. */ save: () => Promise<void>;
|
|
22
|
+
discard: () => void;
|
|
23
|
+
report: (error: unknown) => void;
|
|
24
|
+
close: () => void;
|
|
25
|
+
readonly count: number;
|
|
26
|
+
};
|
|
27
|
+
/** Bind page forms to the viewport bar and each dialog form to its own Save.
|
|
28
|
+
* A form can place those actions beside a field with Save.Slot. */ export declare let bindSave: (root: Document | HTMLElement, opts: SaveOptions) => SaveBinding;
|
|
29
|
+
//# sourceMappingURL=save-browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-browser.d.ts","sources":["../save-browser.ts"],"names":[],"mappings":"AAwBA;yCACyC,GACzC,OAAO,YAAI,aACT,OAAO,mBACP,OAAO,MAAM,EACb,UAAU,MAAM,KACf,IAAI,CAON;AAED,YAAY;EACV;IACE,OAAO,OAAO,MAAM,KAAK,MAAM;IAC/B,OAAO,OAAO,MAAM,EAAE,MAAM,MAAM,KAAK,IAAI;IAC3C,SAAS,OAAO,MAAM,KAAK,QAAQ,OAAO;IAC1C;kBACc,GACd,SAAS,UAAU,IAAI,WAAW,IAAI;;EAExC;;4CAE0C,GAC1C,OAAO,MAAM,iBAAiB,MAAM,aAAa,QAAQ,OAAO;EAChE,UAAU,OAAO,OAAO,KAAK,IAAI;EACjC;uBACqB,GACrB,cAAc,IAAI;EAClB,yEAAyE,GACzE,SAAS,MAAM;;AAGjB,YAAY;EACV;mCACiC,GACjC,YAAY,QAAQ,IAAI;EACxB,eAAe,IAAI;EACnB,SAAS,OAAO,OAAO,KAAK,IAAI;EAChC,aAAa,IAAI;WACR,OAAO,MAAM;;AAoZxB;iEACiE,GACjE,OAAO,YAAI,WACT,MAAM,WAAW,aACjB,MAAM,gBACL,YAqDF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=select-browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-browser.d.ts","sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Where a key moves the active one of `n` choices from `at`, or undefined
|
|
2
|
+
* for a key that does not move it. */ export declare let step: (n: number, at: number, key: string) => number | undefined;
|
|
3
|
+
/** The choice of `words` that typing `said` finds from `at` (-1 for none):
|
|
4
|
+
* the next one starting with it, after `at` when `said` is one letter, so
|
|
5
|
+
* pressing a letter again walks the choices it starts; or at `at` itself,
|
|
6
|
+
* so a word typed on goes on matching the one it found. */ export declare let typed: (words: string[], at: number, said: string) => number | undefined;
|
|
7
|
+
/** The class of the native select inside a Select, which the binder opens
|
|
8
|
+
* the kit's list for. */ export declare let NATIVE: string;
|
|
9
|
+
/** The class of a Select's list of choices. */ export declare let LIST: string;
|
|
10
|
+
/** Binds every Select in `doc`, and every one drawn into it later. Binding
|
|
11
|
+
* a document twice binds it once. */ export declare let selecting: (doc: Document) => void;
|
|
12
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sources":["../select.ts"],"names":[],"mappings":"AAkCA;oCACoC,GACpC,OAAO,YAAI,OAAQ,GAAG,MAAM,EAAE,IAAI,MAAM,EAAE,KAAK,MAAM,KAAG,MAAM,GAAG,SAAS,CAgBzE;AAED;;;yDAGyD,GACzD,OAAO,YAAI,QACT,OAAO,MAAM,IACb,IAAI,MAAM,EACV,MAAM,MAAM,KACX,MAAM,GAAG,SAAS,CASpB;AAKD;uBACuB,GACvB,OAAO,YAAI,eAAwB;AAEnC,6CAA6C,GAC7C,OAAO,YAAI,aAAoB;AAW/B;mCACmC,GACnC,OAAO,YAAI,YAAa,KAAK,aAAW,IAAI,CAwP3C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A form the browser sends shows it is sending in the frame of the press:
|
|
2
|
+
* the button pressed waits (`aria-busy`) until the next page replaces this
|
|
3
|
+
* one. A send a script took over (`preventDefault`), one into another tab and
|
|
4
|
+
* a dialog's close are the page's own to show. A page restored by Back is
|
|
5
|
+
* drawn as it was before the send.
|
|
6
|
+
* @module
|
|
7
|
+
*/ type Window = typeof globalThis;
|
|
8
|
+
/** The element that waits on `e`'s send, or none where the page stays. */ export declare let waiting: (e: SubmitEvent) => Element | undefined;
|
|
9
|
+
/** Show each native send of `win`'s forms as pending. */ export declare let sending: (win: Window) => void;
|
|
10
|
+
//# sourceMappingURL=sending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sending.d.ts","sources":["../sending.ts"],"names":[],"mappings":"AAAA;;;;;;CAMC,QAEI,gBAAgB;AAIrB,wEAAwE,GACxE,OAAO,YAAI,UAAW,GAAG,gBAAc,UAAU,SAAS,CAQzD;AAED,uDAAuD,GACvD,OAAO,YAAI,UAAW,KAAK,WAAS,IAAI,CAiBvC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Sort behavior for server-rendered Sort tables, controlled by page bundles.
|
|
2
|
+
* @module
|
|
3
|
+
*/ import type { Bundle } from "@yaks/graph";
|
|
4
|
+
export { Sort, sortAt, sorted, sortOf, sortRows } from "./Sort.js";
|
|
5
|
+
export type { SortProps, SortRow, SortState, SortValue } from "./Sort.js";
|
|
6
|
+
/** The host keeps choices in its page graph and returns them on each press. */ export type SortHost = {
|
|
7
|
+
read: (eid: string) => Bundle | undefined;
|
|
8
|
+
write: (bundle: Bundle) => unknown | Promise<unknown>;
|
|
9
|
+
};
|
|
10
|
+
/** Bind all Sort tables under a surface; returns listener cleanup. */ export declare let bindSort: (root: ParentNode, host: SortHost) => () => void;
|
|
11
|
+
//# sourceMappingURL=sort-browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-browser.d.ts","sources":["../sort-browser.ts"],"names":[],"mappings":"AAAA;;CAEC,GACD,cAAc,MAAM,2BAAgC;AAEpD,SAAS,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,oBAAmB;AAClE,cAAc,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,oBAAmB;AAEzE,6EAA6E,GAC7E,YAAY;EACV,OAAO,KAAK,MAAM,KAAK,SAAS,SAAS;EACzC,QAAQ,QAAQ,WAAW,OAAO,GAAG,QAAQ,OAAO;;AAEtD,oEAAoE,GACpE,OAAO,YAAI,WAAY,MAAM,YAAY,MAAM,mBAAiB,IAAI,CAuDnE"}
|
package/_dist/state.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an `Edit` keeps and says, as bundles: pure. Its own state is the `Edit`
|
|
3
|
+
* component (./vocab.json) on an entity of its own in the page's graph, whose
|
|
4
|
+
* eid is derived from its owner and the value it changes, so a remount finds
|
|
5
|
+
* it again; each change to that state is a patch built here. What is typed
|
|
6
|
+
* over a value is the person's draft, in the place named for the value alone
|
|
7
|
+
* (`place`), so every view of it, in every interface, types on from the same
|
|
8
|
+
* text. What it emits is a bundle of the shape it was handed (the value,
|
|
9
|
+
* changed), or, the exception, an event bundle: `Refused`, input that could
|
|
10
|
+
* not be read.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/ import type { Bundle } from "@yaks/graph";
|
|
14
|
+
/** What the `Edit` component holds. */ export type Row = {
|
|
15
|
+
/** being changed: typed over in place, or its picker floating beside it */ open?: boolean;
|
|
16
|
+
/** what is typed in its picker's search */ query?: string;
|
|
17
|
+
};
|
|
18
|
+
/** The eid of the `Edit` that changes `comp.prop` of `eid` for `owner`: the
|
|
19
|
+
* same every time it is asked, so a remount finds its state again.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { assertEquals, assertNotEquals } from '@std/assert'
|
|
23
|
+
* import { at } from '@yaks/ux'
|
|
24
|
+
*
|
|
25
|
+
* assertEquals(at('', 'e1', 'doc', 'title'), at('', 'e1', 'doc', 'title'))
|
|
26
|
+
* assertNotEquals(at('card', 'e1', 'doc', 'title'), at('', 'e1', 'doc', 'title'))
|
|
27
|
+
* ```
|
|
28
|
+
*/ export declare let at: (owner: string, eid: string, comp: string, prop: string) => string;
|
|
29
|
+
/** The place the person's draft of `comp.prop` of `eid` is typed in: the
|
|
30
|
+
* value's own, whichever view or interface types over it.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { assertEquals } from '@std/assert'
|
|
34
|
+
* import { place } from '@yaks/ux'
|
|
35
|
+
*
|
|
36
|
+
* assertEquals(place('e1', 'doc', 'title'), 'edit:e1:doc.title')
|
|
37
|
+
* ```
|
|
38
|
+
*/ export declare let place: (eid: string, comp: string, prop: string) => string;
|
|
39
|
+
/** A patch to an `Edit`'s state; `null` closes it, leaving nothing behind.
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { assertEquals } from '@std/assert'
|
|
43
|
+
* import { put } from '@yaks/ux'
|
|
44
|
+
*
|
|
45
|
+
* assertEquals(put('x', { open: true }), [{ entity: { eid: 'x' }, Edit: { open: true } }])
|
|
46
|
+
* assertEquals(put('x', null), [{ entity: { eid: 'x' }, Edit: null }])
|
|
47
|
+
* ```
|
|
48
|
+
*/ export declare let put: (eid: string, patch: Row | null) => Bundle[];
|
|
49
|
+
/** A value as the text it is typed over as: a JSON value as its JSON text.
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { assertEquals } from '@std/assert'
|
|
53
|
+
* import { source } from '@yaks/ux'
|
|
54
|
+
*
|
|
55
|
+
* assertEquals([source(null), source(3), source({ a: 1 })], ['', '3', '{"a":1}'])
|
|
56
|
+
* ```
|
|
57
|
+
*/ export declare let source: (v: unknown) => string;
|
|
58
|
+
/** The value `comp.prop` of `e` holds. */ export declare let valueOf: (e: Bundle | undefined, comp: string, prop: string) => unknown;
|
|
59
|
+
/** `e`, its `comp.prop` changed to `value`: the bundle an `Edit` emits.
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* import { assertEquals } from '@std/assert'
|
|
63
|
+
* import { changed } from '@yaks/ux'
|
|
64
|
+
*
|
|
65
|
+
* let e = { entity: { eid: 'e1', num: 3 }, doc: { title: 'Draft', body: 'b' } }
|
|
66
|
+
* assertEquals(changed(e, 'doc', 'title', 'Ship it'), {
|
|
67
|
+
* entity: { eid: 'e1' },
|
|
68
|
+
* doc: { title: 'Ship it' },
|
|
69
|
+
* })
|
|
70
|
+
* ```
|
|
71
|
+
*/ export declare let changed: (e: Bundle, comp: string, prop: string, value: unknown) => Bundle;
|
|
72
|
+
/** The event an `Edit` emits when what was typed could not be read: on the
|
|
73
|
+
* entity the value belongs to, saying why. */ export declare let refused: (e: Bundle, said: string) => Bundle;
|
|
74
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sources":["../state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;CAYC,GAED,cAAc,MAAM,2BAAgC;AAGpD,qCAAqC,GACrC,YAAY;EACV,yEAAyE,GACzE,OAAO,OAAO;EACd,yCAAyC,GACzC,QAAQ,MAAM;;AAGhB;;;;;;;;;;CAUC,GACD,OAAO,YAAI,KACT,OAAO,MAAM,EACb,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,MAAM,MAAM,KACX,MAAM,CAAiE;AAE1E;;;;;;;;;CASC,GACD,OAAO,YAAI,QAAS,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,KAAG,MAAM,CACrC;AAE/B;;;;;;;;;CASC,GACD,OAAO,YAAI,MAAO,KAAK,MAAM,EAAE,OAAO,MAAM,IAAI,KAAG,SAGjD;AAEF;;;;;;;;CAQC,GACD,OAAO,YAAI,SAAU,GAAG,OAAO,KAAG,MAAM,CAC+B;AAEvE,wCAAwC,GACxC,OAAO,YAAI,UACT,GAAG,SAAS,SAAS,EACrB,MAAM,MAAM,EACZ,MAAM,MAAM,KACX,OAAO,CAKT;AAED;;;;;;;;;;;;CAYC,GACD,OAAO,YAAI,UACT,GAAG,QACH,MAAM,MAAM,EACZ,MAAM,MAAM,EACZ,OAAO,OAAO,KACb,OAAwE;AAE3E;4CAC4C,GAC5C,OAAO,YAAI,UAAW,GAAG,QAAQ,MAAM,MAAM,KAAG,OAG9C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Bundle, Host } from "./host.js";
|
|
2
|
+
/** A candidate as a picker lists it: `T-9 — Draw the map`, its ranked
|
|
3
|
+
* title where a search gave one, else its document's, else its kind.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { assertEquals } from '@std/assert'
|
|
7
|
+
* import { label } from '@yaks/ux'
|
|
8
|
+
*
|
|
9
|
+
* import type { Bundle } from '@yaks/graph'
|
|
10
|
+
*
|
|
11
|
+
* let host = { id: (b: Bundle) => `T-${b.entity.num}`, kind: () => 'task' }
|
|
12
|
+
* let row = (num: number, comps = {}) => ({ entity: { eid: 'e', num }, ...comps })
|
|
13
|
+
* assertEquals(label(host, row(1, { doc: { title: 'Older' } })), 'T-1 — Older')
|
|
14
|
+
* assertEquals(label(host, row(2, { rank: { title: 'Ranked' } })), 'T-2 — Ranked')
|
|
15
|
+
* assertEquals(label(host, row(3)), 'T-3 — task')
|
|
16
|
+
* ```
|
|
17
|
+
*/ export declare let label: (host: Pick<Host, 'id' | 'kind'>, b: Bundle) => string;
|
|
18
|
+
//# sourceMappingURL=suggest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest.d.ts","sources":["../suggest.ts"],"names":[],"mappings":"AAKA,cAAc,MAAM,EAAE,IAAI,oBAAmB;AAS7C;;;;;;;;;;;;;;;CAeC,GACD,OAAO,YAAI,QAAS,MAAM,KAAK,MAAM,OAAO,SAAS,GAAG,WAAS,MAAM,CACtB"}
|