@nmnmcc/standard 0.4.0 → 0.5.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.
Files changed (47) hide show
  1. package/README.md +45 -68
  2. package/dist/Extend.js +1 -1
  3. package/dist/{Standard-BPpzr5SM.js → Standard-BC6CfFOv.js} +116 -159
  4. package/dist/Standard.js +1 -1
  5. package/dist/Ui-DSgtM8Tf.js +591 -0
  6. package/dist/Ui.d.ts +4 -4
  7. package/dist/Ui.js +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/standard/page/page.d.ts +4 -6
  10. package/dist/standard/page/page.d.ts.map +1 -1
  11. package/dist/standard/tokens/tokens.d.ts +20 -103
  12. package/dist/standard/tokens/tokens.d.ts.map +1 -1
  13. package/dist/standard.css +1 -1
  14. package/dist/ui/flap/flap.d.ts +10 -10
  15. package/dist/ui/flap/flap.d.ts.map +1 -1
  16. package/dist/ui/modal/modal.d.ts +4 -1
  17. package/dist/ui/modal/modal.d.ts.map +1 -1
  18. package/dist/ui/navigator/navigator.d.ts +58 -59
  19. package/dist/ui/navigator/navigator.d.ts.map +1 -1
  20. package/dist/ui/notice/notice.d.ts +6 -1
  21. package/dist/ui/notice/notice.d.ts.map +1 -1
  22. package/dist/ui/sheet/sheet.d.ts +9 -9
  23. package/dist/ui/toasts/toasts.d.ts +8 -7
  24. package/dist/ui/toasts/toasts.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/src/standard/page/page.module.css +85 -47
  27. package/src/standard/page/page.module.d.css.ts +4 -2
  28. package/src/standard/page/page.ts +83 -1
  29. package/src/standard/tokens/tokens.ts +20 -268
  30. package/src/ui/dialog/dialog.module.css +24 -11
  31. package/src/ui/flap/flap.module.css +108 -52
  32. package/src/ui/flap/flap.module.d.css.ts +6 -1
  33. package/src/ui/flap/flap.ts +140 -13
  34. package/src/ui/modal/modal.module.css +73 -22
  35. package/src/ui/modal/modal.module.d.css.ts +1 -0
  36. package/src/ui/modal/modal.ts +21 -15
  37. package/src/ui/navigator/navigator.module.css +334 -176
  38. package/src/ui/navigator/navigator.module.d.css.ts +2 -10
  39. package/src/ui/navigator/navigator.ts +111 -106
  40. package/src/ui/notice/notice.ts +7 -2
  41. package/src/ui/popover/popover.ts +3 -3
  42. package/src/ui/sheet/sheet.module.css +51 -58
  43. package/src/ui/sheet/sheet.ts +9 -9
  44. package/src/ui/toasts/toasts.module.css +70 -11
  45. package/src/ui/toasts/toasts.module.d.css.ts +1 -0
  46. package/src/ui/toasts/toasts.ts +148 -4
  47. package/dist/Ui-B9xQqqNT.js +0 -468
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/standard/page/page.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,KAAK,EAAqB,KAAK,IAAI,EAAQ,KAAK,IAAI,EAAE,MAAM,eAAe,CAAA;AAGzF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEzD,eAAO,MAAM,IAAI,GAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IACtC;;;;OAIG;IACH,IAAI,GAAG,CAAC,GAAG,KAAK,WACL;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,eAClD,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,KAC9C,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;CAWxB,CAAA"}
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/standard/page/page.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,KAAK,EAAqB,KAAK,IAAI,EAAQ,KAAK,IAAI,EAAE,MAAM,eAAe,CAAA;AAGzF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA8EzD,eAAO,MAAM,IAAI,GAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IACtC;;;;;;;OAOG;IACH,IAAI,GAAG,CAAC,GAAG,KAAK,WACL;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,eAClD,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,KAC9C,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;CAYxB,CAAA"}
@@ -40,119 +40,36 @@ export type Align = typeof Align.Type;
40
40
  export declare const Ratio: Schema.Literals<readonly ["1/1", "4/3", "3/2", "16/9", "3/4", "2/3"]>;
41
41
  export type Ratio = typeof Ratio.Type;
42
42
  /**
43
- * The way the window moves over the canvas in a change of view, for
44
- * `$.viewTransition(travel)` in `update`: `forward` and `back` along the
45
- * line of reading, `down` and `up` along the page, and one of each for a
46
- * diagonal. `Standard.travel` works it out from the route table.
43
+ * The way a view changes, for `$.viewTransition(...)` in `update`. `in`:
44
+ * the new view turns in on the navigator, over the one that is left, as
45
+ * the next leaf of a revolving door. `out`: the view that is left turns
46
+ * out the same way, off the one that was under it. `Standard.turn` says
47
+ * which, from where the two are in the history.
47
48
  */
48
- export declare const Travel: Schema.Literals<readonly ["forward", "back", "down", "up"]>;
49
+ export declare const Travel: Schema.Literals<readonly ["in", "out"]>;
49
50
  export type Travel = typeof Travel.Type;
50
- /** A route table, as `Route.union` of `effect/ui` makes it: all that `travel` and `canvas` read of one. */
51
- export interface Routes {
52
- readonly routes: {
53
- readonly [tag: string]: {
54
- readonly path: string;
55
- readonly params: {
56
- readonly [name: string]: unknown;
57
- };
58
- };
59
- };
60
- readonly catchAll: string | undefined;
61
- readonly Type: {
62
- readonly _tag: string;
63
- };
64
- }
65
51
  /**
66
- * The way from one route to another, for `$.viewTransition(...)`. An app is
67
- * one canvas without edges, and the screen is a window onto it: every route
68
- * has a place there, and a change of route is the window moving from one
69
- * place to another. What is in the window then slides the other way, as
70
- * what is seen through a window does when the window moves, and whatever
71
- * has its own view-transition name, such as a navigator, stays where it is.
52
+ * The way a view changes when the history goes from one entry to another,
53
+ * for `$.viewTransition(...)`: `in` when it goes on to a later entry, as it
54
+ * does for a link that is pressed, and `out` when it goes back to an
55
+ * earlier one, as it does for the button that goes back. So what turned in
56
+ * turns out again the way it came. No way at all when the entry is the
57
+ * same one, as it is when an address is replaced.
72
58
  *
73
- * The place of a route is not for the app to say. The route table says it,
74
- * and so the addresses of an app have to be written the way its canvas is
75
- * drawn: `/section/page`, and under a page whatever is under it.
59
+ * The entries are counted as the router of `effect/ui` counts them: the
60
+ * `index` of a `Location`. Keep the index of the entry the Model is at,
61
+ * and give it with the index of the one it is going to.
76
62
  *
77
- * - The first segment is the section, and sections lie along the line of
78
- * reading in the order the table first names them: from `/read/…` to
79
- * `/settings/…` is `forward`.
80
- * - The second segment is the page, and the pages of a section lie down
81
- * the page in the order the table declares them: from `/read/latest` to
82
- * `/read/archive` is `down`. Every section starts at the top, so from the
83
- * second page of one to the fifth of another is `forward` and `down`,
84
- * and to the first of another `forward` and `up`.
85
- * - Each segment after that is a step `forward` from the page it is under:
86
- * `/read/topics/:id` is straight along from `/read/topics`. Params that
87
- * follow one another are one step between them: `/read/latest/:date/:id`
88
- * is as far along as `/read/topics/:id`.
89
- * - A param takes as many places as its `Schema.Literals` has literals, in
90
- * the order they are given. A param of any other Schema takes one place,
91
- * and two of its values are in the order a list of them would be read
92
- * in: numbers as numbers, `"B9"` before `"B10"`, `"2026-11-24"` before
93
- * `"2026-12-02"`. So an address that should lie in the order of its date
94
- * has the date in it.
95
- *
96
- * No way at all when the places are the same.
97
- *
98
- * **Example** (Moving the window in `update`)
99
- *
100
- * ```ts
101
- * Navigated: ($, { route }) =>
102
- * $.evolve({ route }).viewTransition(Standard.travel(AppRoute, $.model.route, route))
103
- * ```
104
- *
105
- * @since 0.4.0
106
- */
107
- export declare const travel: <R extends Routes>(routes: R, from: R["Type"], to: R["Type"]) => ReadonlyArray<Travel>;
108
- /**
109
- * A place on a canvas that is drawn by hand: one address, as a route, or
110
- * every address of a route, as its tag.
111
- */
112
- export type Spot<R extends Routes> = R["Type"]["_tag"] | R["Type"];
113
- /** A page of a section, and with `under`, what is under it: each of those a step forward from it, and listed downwards. */
114
- export type Page<R extends Routes> = Spot<R> | {
115
- readonly at: Spot<R>;
116
- readonly under: ReadonlyArray<Page<R>>;
117
- };
118
- /** A canvas drawn by hand: it says the way from one route to another, as `travel` does. */
119
- export interface Canvas<R extends Routes> {
120
- readonly travel: (from: R["Type"], to: R["Type"]) => ReadonlyArray<Travel>;
121
- }
122
- /**
123
- * The canvas of an app whose addresses are not written the way it is drawn.
124
- * `travel` reads the canvas off the addresses, which is why they have to be
125
- * `/section/page`. With this the addresses are whatever people expect, `/`
126
- * and `/posts/:id` and `/settings`, and the canvas is said once, here: the
127
- * sections along the line of reading, in each its pages from the top down,
128
- * and under a page whatever is a step forward from it.
129
- *
130
- * A place is a route, for one address, or the tag of a route, for all its
131
- * addresses. Those are then in the order of their params: the literals of
132
- * a `Schema.Literals` as given, any other values as a list of them would
133
- * be read. An address is at the place that names it, and failing that at
134
- * the place of its tag.
135
- *
136
- * Every route but the catch-all has to be somewhere on it, or this throws:
137
- * a page can't be left off the map. A canvas is cheap to draw, so one that
138
- * depends on the Model, such as the posts there are, is drawn in `update`.
139
- *
140
- * **Example** (A blog)
63
+ * **Example** (Turning the view in `update`)
141
64
  *
142
65
  * ```ts
143
- * const Canvas = Standard.canvas(BlogRoute, [
144
- * [{ at: "Latest", under: ["Post"] }, "Archive", { at: "Topics", under: ["Topic"] }],
145
- * ["Saved", "Write"],
146
- * ["Display"]
147
- * ])
148
- *
149
- * Navigated: ($, { route }) =>
150
- * $.evolve({ route }).viewTransition(Canvas.travel($.model.route, route))
66
+ * Navigated: ($, { route, at }) =>
67
+ * $.evolve({ route, at }).viewTransition(Standard.turn($.model.at, at))
151
68
  * ```
152
69
  *
153
- * @since 0.4.0
70
+ * @since 0.5.0
154
71
  */
155
- export declare const canvas: <R extends Routes>(routes: R, sections: ReadonlyArray<ReadonlyArray<Page<R>>>) => Canvas<R>;
72
+ export declare const turn: (from: number, to: number) => ReadonlyArray<Travel>;
156
73
  /** The width of page something is shown at: every column side by side, or all of them collapsed into one. */
157
74
  export declare const Only: Schema.Literals<readonly ["wide", "narrow"]>;
158
75
  export type Only = typeof Only.Type;
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/standard/tokens/tokens.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,kFAAkF;AAClF,eAAO,MAAM,IAAI,mEAA2D,CAAA;AAC5E,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,CAAA;AAEnC,yEAAyE;AACzE,eAAO,MAAM,KAAK,6DAAqD,CAAA;AACvE,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAErC;;;GAGG;AACH,eAAO,MAAM,MAAM,kGAA0F,CAAA;AAC7G,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,MAAM,qDAA6C,CAAA;AAChE,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AAEvC,0GAA0G;AAC1G,eAAO,MAAM,IAAI,sDAA8C,CAAA;AAC/D,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,CAAA;AAEnC,mCAAmC;AACnC,eAAO,MAAM,IAAI,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