@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.
- package/README.md +45 -68
- package/dist/Extend.js +1 -1
- package/dist/{Standard-BPpzr5SM.js → Standard-BC6CfFOv.js} +116 -159
- package/dist/Standard.js +1 -1
- package/dist/Ui-DSgtM8Tf.js +591 -0
- package/dist/Ui.d.ts +4 -4
- package/dist/Ui.js +1 -1
- package/dist/index.js +2 -2
- package/dist/standard/page/page.d.ts +4 -6
- package/dist/standard/page/page.d.ts.map +1 -1
- package/dist/standard/tokens/tokens.d.ts +20 -103
- package/dist/standard/tokens/tokens.d.ts.map +1 -1
- package/dist/standard.css +1 -1
- package/dist/ui/flap/flap.d.ts +10 -10
- package/dist/ui/flap/flap.d.ts.map +1 -1
- package/dist/ui/modal/modal.d.ts +4 -1
- package/dist/ui/modal/modal.d.ts.map +1 -1
- package/dist/ui/navigator/navigator.d.ts +58 -59
- package/dist/ui/navigator/navigator.d.ts.map +1 -1
- package/dist/ui/notice/notice.d.ts +6 -1
- package/dist/ui/notice/notice.d.ts.map +1 -1
- package/dist/ui/sheet/sheet.d.ts +9 -9
- package/dist/ui/toasts/toasts.d.ts +8 -7
- package/dist/ui/toasts/toasts.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/standard/page/page.module.css +85 -47
- package/src/standard/page/page.module.d.css.ts +4 -2
- package/src/standard/page/page.ts +83 -1
- package/src/standard/tokens/tokens.ts +20 -268
- package/src/ui/dialog/dialog.module.css +24 -11
- package/src/ui/flap/flap.module.css +108 -52
- package/src/ui/flap/flap.module.d.css.ts +6 -1
- package/src/ui/flap/flap.ts +140 -13
- package/src/ui/modal/modal.module.css +73 -22
- package/src/ui/modal/modal.module.d.css.ts +1 -0
- package/src/ui/modal/modal.ts +21 -15
- package/src/ui/navigator/navigator.module.css +334 -176
- package/src/ui/navigator/navigator.module.d.css.ts +2 -10
- package/src/ui/navigator/navigator.ts +111 -106
- package/src/ui/notice/notice.ts +7 -2
- package/src/ui/popover/popover.ts +3 -3
- package/src/ui/sheet/sheet.module.css +51 -58
- package/src/ui/sheet/sheet.ts +9 -9
- package/src/ui/toasts/toasts.module.css +70 -11
- package/src/ui/toasts/toasts.module.d.css.ts +1 -0
- package/src/ui/toasts/toasts.ts +148 -4
- 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":"
|
|
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
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
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 ["
|
|
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
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
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
|
|
74
|
-
*
|
|
75
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
144
|
-
*
|
|
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.
|
|
70
|
+
* @since 0.5.0
|
|
154
71
|
*/
|
|
155
|
-
export declare const
|
|
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,+FAAuF,CAAA;AACxG,MAAM,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,CAAA;AAEnC,yDAAyD;AAC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