@popcorn245/cornfield-components 0.52.1 → 0.53.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 (43) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/around-BcnegEdS.js +99 -0
  3. package/dist/chunks/connection-KDiWvV19.js +23 -0
  4. package/dist/chunks/{engine-BmXtSISH.js → engine-xmHJvQY9.js} +1188 -1186
  5. package/dist/chunks/{layers-Bj4Tluxe.js → layers-ho10a2y7.js} +48 -48
  6. package/dist/chunks/{map-BZRFOYkt.js → map-DbfPgQRe.js} +385 -385
  7. package/dist/chunks/node-panel-CC8UrSzJ.js +410 -0
  8. package/dist/chunks/panel-review-ih7RlfkH.js +884 -0
  9. package/dist/chunks/review-pieces-DtRxCDMr.js +2523 -0
  10. package/dist/chunks/{review-source-CK5tYIqk.js → review-source-CmbwaPCM.js} +1 -1
  11. package/dist/chunks/scope-2m2VmJXn.js +185 -0
  12. package/dist/chunks/scope-proposal-T06ndbin.js +116 -0
  13. package/dist/chunks/{sheets-D-sMZzSs.js → sheets-BWANwtZP.js} +7 -2
  14. package/dist/chunks/source-address-DXanAREm.js +57 -0
  15. package/dist/chunks/{status-DI5QLlAp.js → status-DM-iIEsg.js} +4 -3
  16. package/dist/corn-changes.js +43 -0
  17. package/dist/corn-decision.js +52 -0
  18. package/dist/corn-layers.js +275 -1
  19. package/dist/corn-map.js +125 -1
  20. package/dist/corn-node-panel.js +42 -1
  21. package/dist/corn-proposal.js +50 -0
  22. package/dist/corn-review.js +425 -1
  23. package/dist/corn-scope.js +33 -9
  24. package/dist/corn-search.js +484 -1
  25. package/dist/index.js +11 -8
  26. package/dist/manifest.json +95 -70
  27. package/dist/tokens.css +6 -0
  28. package/dist/types/components.d.ts +111 -5
  29. package/dist/types/corn-changes.d.ts +2 -0
  30. package/dist/types/corn-decision.d.ts +2 -0
  31. package/dist/types/corn-proposal.d.ts +2 -0
  32. package/dist/types/index.d.ts +3 -0
  33. package/dist/version.json +1 -1
  34. package/package.json +17 -5
  35. package/dist/chunks/around-BFqYTZ0K.js +0 -78
  36. package/dist/chunks/corn-layers-Cni5rISZ.js +0 -275
  37. package/dist/chunks/corn-map-B2-YxiEL.js +0 -125
  38. package/dist/chunks/corn-node-panel-BkvJThlp.js +0 -42
  39. package/dist/chunks/corn-review-5wf7AT4o.js +0 -2900
  40. package/dist/chunks/corn-search-CXs5d06S.js +0 -484
  41. package/dist/chunks/node-panel-BdvFvWCE.js +0 -1291
  42. package/dist/chunks/scope-CqPbHcKL.js +0 -137
  43. package/dist/chunks/source-address-C70zNPIj.js +0 -79
@@ -1,61 +1,51 @@
1
1
  {
2
2
  "name": "@popcorn245/cornfield-components",
3
- "cornfield": "0.52.1",
3
+ "cornfield": "0.53.0",
4
4
  "files": [
5
5
  {
6
- "path": "chunks/around-BFqYTZ0K.js",
7
- "bytes": 2896,
8
- "sha256": "9d1f527b8e9570a460b5258073739159e7399bbecde37f10c46fcd4851c648e0"
6
+ "path": "chunks/around-BcnegEdS.js",
7
+ "bytes": 3898,
8
+ "sha256": "bb2a6e24aca4551853425730ae650ce8725434337ccd5420aea37880d46748a1"
9
9
  },
10
10
  {
11
- "path": "chunks/corn-layers-Cni5rISZ.js",
12
- "bytes": 29459,
13
- "sha256": "0a0b82f36f3e3eb8d7f156095cfed0e02d4c6e6deebd0cda63f9bd3b09ce2426"
11
+ "path": "chunks/connection-KDiWvV19.js",
12
+ "bytes": 608,
13
+ "sha256": "638a1f5d688d0f32baba18bab64a445ecca0684aed4fb2ffcd40043bf2146642"
14
14
  },
15
15
  {
16
- "path": "chunks/corn-map-B2-YxiEL.js",
17
- "bytes": 7117,
18
- "sha256": "8bd1374bcbd80a39c90698dd63ce0eac41d524d18ad4fe52e737dc4f48841d9a"
16
+ "path": "chunks/engine-xmHJvQY9.js",
17
+ "bytes": 146691,
18
+ "sha256": "a97f63a3555f721319b4e31bfae58ee272bbf4672296c4a1d4a899a2c9bd0b37"
19
19
  },
20
20
  {
21
- "path": "chunks/corn-node-panel-BkvJThlp.js",
22
- "bytes": 22896,
23
- "sha256": "7736a35c70aacfed1e29b1828aa8a28dd8b9ab1337ef196714aa4fd783c383a0"
21
+ "path": "chunks/layers-ho10a2y7.js",
22
+ "bytes": 6492,
23
+ "sha256": "803bdc66b443e8a797a6ff680533cd6a574add42bcc3f65c17954411b419a273"
24
24
  },
25
25
  {
26
- "path": "chunks/corn-review-5wf7AT4o.js",
27
- "bytes": 186364,
28
- "sha256": "944daf44e60351759d434f2d313e40bf245324e7fb87f01efc6e4f029fdbc781"
26
+ "path": "chunks/map-DbfPgQRe.js",
27
+ "bytes": 91109,
28
+ "sha256": "a5436aedb8e6afbc998c696fd8d3a25e145c74e33d0edf3d85945533daa346c5"
29
29
  },
30
30
  {
31
- "path": "chunks/corn-search-CXs5d06S.js",
32
- "bytes": 35167,
33
- "sha256": "20fefdc1a5e7f70c6fa354fe1fd3de2119ec3a3647e84c2adf1a90186be00697"
31
+ "path": "chunks/node-panel-CC8UrSzJ.js",
32
+ "bytes": 28124,
33
+ "sha256": "e78ad68bdb65224d9cc2c84f193d03b86a9764ce200bfb8d0611b186ab2b9293"
34
34
  },
35
35
  {
36
- "path": "chunks/engine-BmXtSISH.js",
37
- "bytes": 146493,
38
- "sha256": "e6d9526497526120f38b079e5602d96f6ec62db2d97e498672a00d1d0fa5b685"
36
+ "path": "chunks/panel-review-ih7RlfkH.js",
37
+ "bytes": 39520,
38
+ "sha256": "e4bcc3cb3558890c1eafe57306c6477aaec30c597791fd67657142ea41648ed1"
39
39
  },
40
40
  {
41
- "path": "chunks/layers-Bj4Tluxe.js",
42
- "bytes": 6493,
43
- "sha256": "c93d0d2cc5526610865301cdee3c6d5b7cc48cb3f033fc7ad78be8acbf951e00"
41
+ "path": "chunks/review-pieces-DtRxCDMr.js",
42
+ "bytes": 110199,
43
+ "sha256": "308c202faecd25a3154ede6049102507c4dc63d17918e104b58bb2e631ee52f1"
44
44
  },
45
45
  {
46
- "path": "chunks/map-BZRFOYkt.js",
47
- "bytes": 90990,
48
- "sha256": "ad465b215c232d22885152b79881ae62b0ef0693d029c031ea76ecea86d8e424"
49
- },
50
- {
51
- "path": "chunks/node-panel-BdvFvWCE.js",
52
- "bytes": 67520,
53
- "sha256": "3fc233a5d6e71389fab5d9a5e26d6186def39f1cc069d975504d820856e7ce88"
54
- },
55
- {
56
- "path": "chunks/review-source-CK5tYIqk.js",
46
+ "path": "chunks/review-source-CmbwaPCM.js",
57
47
  "bytes": 1482,
58
- "sha256": "663faa3e8a677994c59bb668f5c975c3b2926613c8cfef1a4acbd1abc5dfb142"
48
+ "sha256": "0d80bfddeafc384f538289de2c184e6656773c9efe8b458ba9689441c458f65a"
59
49
  },
60
50
  {
61
51
  "path": "chunks/rolldown-runtime-CGnMp29N.js",
@@ -68,69 +58,99 @@
68
58
  "sha256": "47327281b56616b00075dd5e4b52c0142fc3414509eb8258d9b98c8b56fc372d"
69
59
  },
70
60
  {
71
- "path": "chunks/scope-CqPbHcKL.js",
72
- "bytes": 3812,
73
- "sha256": "ebd3f9facc995e636b482d58f4cfdc07c108655a9fde046a501311203537816b"
61
+ "path": "chunks/scope-2m2VmJXn.js",
62
+ "bytes": 5217,
63
+ "sha256": "b5a0a742b99d70f125020b097b48b9449be6c96f0a8827c2d91625b79fecb952"
64
+ },
65
+ {
66
+ "path": "chunks/scope-proposal-T06ndbin.js",
67
+ "bytes": 3866,
68
+ "sha256": "b0aa20af4ea88faafd3f12a166cfff60ab6ec53341d9aec4d7a4483a18ab01c5"
69
+ },
70
+ {
71
+ "path": "chunks/sheets-BWANwtZP.js",
72
+ "bytes": 8043,
73
+ "sha256": "f1915376a04daa55571d642fe1bbf8da3fea3e66fdd84a62b2a74d47357a8ef0"
74
+ },
75
+ {
76
+ "path": "chunks/source-address-DXanAREm.js",
77
+ "bytes": 1308,
78
+ "sha256": "452946bcdaf813b823c08333af31f6ed35eff6f9c090ddd3b06e037c73c4b7b7"
74
79
  },
75
80
  {
76
- "path": "chunks/sheets-D-sMZzSs.js",
77
- "bytes": 7813,
78
- "sha256": "e2511ecb63d522c3c88693cfd408015eb4f6b8770761e86c1d43b9b5c537072a"
81
+ "path": "chunks/status-DM-iIEsg.js",
82
+ "bytes": 20020,
83
+ "sha256": "f31b86dffa1c0c16f8f6f011cd8c0080254f0be890de1973c9e85f2ee3778909"
79
84
  },
80
85
  {
81
- "path": "chunks/source-address-C70zNPIj.js",
82
- "bytes": 1910,
83
- "sha256": "4227bb62d97d74a9ffe339ee437c9b7aab0c7049544d85af4c408b29d19a5a4b"
86
+ "path": "corn-changes.js",
87
+ "bytes": 22295,
88
+ "sha256": "dab708a087756db7a41657ac8935d699d28904a49aceef4aab6b97d0aa6298be"
84
89
  },
85
90
  {
86
- "path": "chunks/status-DI5QLlAp.js",
87
- "bytes": 19972,
88
- "sha256": "46f80cc2ff9e0026086500fee197876a484f947ac79c5e209d6283370de0da32"
91
+ "path": "corn-decision.js",
92
+ "bytes": 16960,
93
+ "sha256": "623e5a4df62c252f3720dc3d535cbfc58fba34d2ed45ad4b030880174cc4cee3"
89
94
  },
90
95
  {
91
96
  "path": "corn-layers.js",
92
- "bytes": 68,
93
- "sha256": "783c8008b2145011d5a5b530b8844d3f17ffe5230d9a049c26bf470322ce2f13"
97
+ "bytes": 29548,
98
+ "sha256": "030f97fafd7027391137f8d6ed16a3596ad8d4b916254c1dc57174976ffd71ff"
94
99
  },
95
100
  {
96
101
  "path": "corn-map.js",
97
- "bytes": 62,
98
- "sha256": "7196935576e93d680b57aa69116d16720a07b20e8307d9721b6ac53aa99ed62d"
102
+ "bytes": 7144,
103
+ "sha256": "45a1649eb636fecc252d6640830a4e5ac64c15193895ac66f803ea2f38221284"
99
104
  },
100
105
  {
101
106
  "path": "corn-node-panel.js",
102
- "bytes": 75,
103
- "sha256": "6f98a3fb4c1045a461e0c6cfe707de889b546af73637e47381310052bd20cdce"
107
+ "bytes": 22984,
108
+ "sha256": "d85045362c4043710cfb9ceb1f6b200730267e7b0ca3e9917678624f227012a8"
109
+ },
110
+ {
111
+ "path": "corn-proposal.js",
112
+ "bytes": 23547,
113
+ "sha256": "295e442c73f1e5f86ec49ff801656704c1e36de3e42ae0007e49ee5b4bdbb0f1"
104
114
  },
105
115
  {
106
116
  "path": "corn-review.js",
107
- "bytes": 68,
108
- "sha256": "55a17ddf23ae37eff8f82e7e66ce984809a4e06587bafb21674022029c1230fe"
117
+ "bytes": 78426,
118
+ "sha256": "ff7a3043e25a8f0bd7a7bfe0c415e462efbf5a2556b31304e4274c27c7adb1d3"
109
119
  },
110
120
  {
111
121
  "path": "corn-scope.js",
112
- "bytes": 1877,
113
- "sha256": "4c1faf95126eceba1b523ffb1aa7bdfda105e4d87a45ae3670c5c5a4d9e4f890"
122
+ "bytes": 2630,
123
+ "sha256": "dc5a949ebcebbb9b5c700b162458885e16bb94bd499a995589ebdd673fb6647f"
114
124
  },
115
125
  {
116
126
  "path": "corn-search.js",
117
- "bytes": 68,
118
- "sha256": "2afcefef5b2cccf1eaf80b90e6f7e5d8e4b3f868545134ea19f2bbffd91a8bd7"
127
+ "bytes": 35217,
128
+ "sha256": "9356cca1a2c2642fe3a9fb39ba22e3c066597c219baea8d95603028a3c969774"
119
129
  },
120
130
  {
121
131
  "path": "index.js",
122
- "bytes": 501,
123
- "sha256": "a337babbe250f4518d489365d194ebb5ea12058aecab84d2bee608a5854d2980"
132
+ "bytes": 693,
133
+ "sha256": "f6a078be4d81e69b3e628fe2e210c7af7da7479948a62abce8f96dff24cfca7b"
124
134
  },
125
135
  {
126
136
  "path": "tokens.css",
127
- "bytes": 22696,
128
- "sha256": "4b2b297897f0110c010c065e528e62bce7b60f9467748a64369c221055f5bd88"
137
+ "bytes": 22919,
138
+ "sha256": "3b551ddfbfbe96835e49c115c0127c45d1849c959f88b3a097569a7105a3848e"
129
139
  },
130
140
  {
131
141
  "path": "types/components.d.ts",
132
- "bytes": 29804,
133
- "sha256": "5ead47bcb5ff8fdc98eeb1c244b060023dcbbe721500fecd2c65d69a570ae959"
142
+ "bytes": 41060,
143
+ "sha256": "3170d2d9a831dbf98a6e4be4838825a1fce3794813761afa994c373e100e4e1b"
144
+ },
145
+ {
146
+ "path": "types/corn-changes.d.ts",
147
+ "bytes": 138,
148
+ "sha256": "da818faf1582d76cc0c8a3c3603e80aced8c80ff4784ca86960560e05eb2362b"
149
+ },
150
+ {
151
+ "path": "types/corn-decision.d.ts",
152
+ "bytes": 141,
153
+ "sha256": "092e4012ed905d1f532dd37d70107d611814ee6166d4ff0ada91910d3baf969c"
134
154
  },
135
155
  {
136
156
  "path": "types/corn-layers.d.ts",
@@ -147,6 +167,11 @@
147
167
  "bytes": 144,
148
168
  "sha256": "3cc470c8b4327068a5dbfe4f12ba2b83670dfd0a41216c5c372f240487af0fcf"
149
169
  },
170
+ {
171
+ "path": "types/corn-proposal.d.ts",
172
+ "bytes": 141,
173
+ "sha256": "d07a095a611642fc804cc6a1287df9f1f9b613bb164a7dbdc3bbcb6d4c6f512d"
174
+ },
150
175
  {
151
176
  "path": "types/corn-review.d.ts",
152
177
  "bytes": 135,
@@ -164,13 +189,13 @@
164
189
  },
165
190
  {
166
191
  "path": "types/index.d.ts",
167
- "bytes": 782,
168
- "sha256": "976b599ceecd957faace0a18964cfbe0fe9f1491c8a82db791f2ed05996f0064"
192
+ "bytes": 1103,
193
+ "sha256": "624e407ce7a75b3f9493380c6507e51b37baceac6e20f5f9ee9588605881ff2b"
169
194
  },
170
195
  {
171
196
  "path": "version.json",
172
197
  "bytes": 65,
173
- "sha256": "93eea33531fd5e16173f6669db098b628413d6fecee5459cea0a3963b7d42266"
198
+ "sha256": "31e1bcce4e5ecb921c9a6e64b93f45d09c7468bdd2fa9257d66060d3dc986372"
174
199
  }
175
200
  ]
176
201
  }
package/dist/tokens.css CHANGED
@@ -314,9 +314,12 @@
314
314
  }
315
315
 
316
316
  /* theme="light" on an element: this mode's tokens, on the element itself */
317
+ :where(corn-changes[theme="light"]),
318
+ :where(corn-decision[theme="light"]),
317
319
  :where(corn-layers[theme="light"]),
318
320
  :where(corn-map[theme="light"]),
319
321
  :where(corn-node-panel[theme="light"]),
322
+ :where(corn-proposal[theme="light"]),
320
323
  :where(corn-review[theme="light"]),
321
324
  :where(corn-scope[theme="light"]),
322
325
  :where(corn-search[theme="light"]) {
@@ -436,9 +439,12 @@
436
439
  }
437
440
 
438
441
  /* theme="dark" on an element: this mode's tokens, on the element itself */
442
+ :where(corn-changes[theme="dark"]),
443
+ :where(corn-decision[theme="dark"]),
439
444
  :where(corn-layers[theme="dark"]),
440
445
  :where(corn-map[theme="dark"]),
441
446
  :where(corn-node-panel[theme="dark"]),
447
+ :where(corn-proposal[theme="dark"]),
442
448
  :where(corn-review[theme="dark"]),
443
449
  :where(corn-scope[theme="dark"]),
444
450
  :where(corn-search[theme="dark"]) {
@@ -79,6 +79,22 @@ export interface CornReviewRecord {
79
79
  [key: string]: unknown;
80
80
  }
81
81
 
82
+ export interface CornScopeAuthDetail {
83
+ /** 401 or 403 */
84
+ status: number;
85
+ /** `<src>/auth/start?returnTo=<this page's address>`: a link the host or the piece puts in front of the person; the component never navigates the window */
86
+ signIn: string;
87
+ /** What was refused: `load` (the config or the map), `proposal` (opening it), `facts` (the line above Approve), `review` (reading the last decision), `send` (the press itself) or `landing` (Undo of the hold) */
88
+ during: 'load' | 'proposal' | 'facts' | 'review' | 'send' | 'landing';
89
+ }
90
+
91
+ export interface CornScopeErrorDetail {
92
+ /** `not-listed` (the server gave this page no CORS answer: its origin is not in `embed.origins`), `offline`, `server` (it answered with something that is not a config or a map), `address` (`src` is not an http(s) address), `version` (the package and the server differ by a minor or more; it keeps working), `theme` (the server's theme could not be had), `second-map` (a scope holds one map), `second-section` (a scope holds one `corn-proposal`, one `corn-changes` and one `corn-decision`) or `proposal` (the proposal did not open: no such proposal, or the server refused) */
93
+ kind: 'not-listed' | 'offline' | 'server' | 'address' | 'version' | 'theme' | 'second-map' | 'second-section' | 'proposal';
94
+ /** A few words more, plain text: the origin to list, the problem with the address, the two versions, what the proposal's bar says */
95
+ message?: string;
96
+ }
97
+
82
98
  export interface CornSearchDetail {
83
99
  /** What is searched for now (trimmed), or an empty string once it is cleared */
84
100
  query: string;
@@ -87,6 +103,10 @@ export interface CornSearchDetail {
87
103
  }
88
104
 
89
105
  export namespace Components {
106
+ interface CornChanges {
107
+ }
108
+ interface CornDecision {
109
+ }
90
110
  interface CornLayers {
91
111
  }
92
112
  interface CornMap {
@@ -113,6 +133,8 @@ export namespace Components {
113
133
  }
114
134
  interface CornNodePanel {
115
135
  }
136
+ interface CornProposal {
137
+ }
116
138
  interface CornReview {
117
139
  /** The base address of a cornfield server, `https://map.example.com` (an http(s) origin with an optional path): the review reads the config and the map from there, opens the proposal, and sends its decision, with the signed-in maintainer's session. Another value is refused, and said in the box and in `cornError`. Read when the element connects: a new `src` makes a new review. */
118
140
  'src'?: string | undefined;
@@ -156,6 +178,12 @@ export namespace Components {
156
178
  'config'?: { [key: string]: unknown } | null | undefined;
157
179
  /** The words the host overrides (a flat map of `strings` keys to text); they win over the server's */
158
180
  'strings'?: { [key: string]: string } | null | undefined;
181
+ /** The proposal the scope holds for every piece in it: its name (`0042-retire-the-old-export`), which the scope reads from the server, or, as a property only, the proposal object itself (shown for reading: a decision needs the name). The map narrows to it; `<corn-proposal>`, `<corn-changes>` and `<corn-decision>` show and decide it. It follows the reviewer: null once they close it in the bar, the name of a copy they open from it. Not reflected. */
182
+ 'proposal'?: string | { [key: string]: unknown } | null | undefined;
183
+ /** Which copy of the proposal: `checkout`, `pull/31` (a spec PR) or a worktree's name; with none the server answers with the first it lists */
184
+ 'source'?: string | null | undefined;
185
+ /** `before`, `diff` or `after`. Set it to choose; it follows the reviewer's own choice (the buttons on `<corn-proposal>`) and is reflected as an attribute. */
186
+ 'view'?: 'before' | 'diff' | 'after' | null | undefined;
159
187
  }
160
188
  interface CornSearch {
161
189
  /** What is searched for. Set it to search; it follows what the person types. It is not reflected: a query changes with every key. */
@@ -165,6 +193,16 @@ export namespace Components {
165
193
  }
166
194
  }
167
195
 
196
+ export interface CornChangesCustomEvent<T> extends CustomEvent<T> {
197
+ detail: T;
198
+ target: HTMLCornChangesElement;
199
+ }
200
+
201
+ export interface CornDecisionCustomEvent<T> extends CustomEvent<T> {
202
+ detail: T;
203
+ target: HTMLCornDecisionElement;
204
+ }
205
+
168
206
  export interface CornLayersCustomEvent<T> extends CustomEvent<T> {
169
207
  detail: T;
170
208
  target: HTMLCornLayersElement;
@@ -180,6 +218,11 @@ export interface CornNodePanelCustomEvent<T> extends CustomEvent<T> {
180
218
  target: HTMLCornNodePanelElement;
181
219
  }
182
220
 
221
+ export interface CornProposalCustomEvent<T> extends CustomEvent<T> {
222
+ detail: T;
223
+ target: HTMLCornProposalElement;
224
+ }
225
+
183
226
  export interface CornReviewCustomEvent<T> extends CustomEvent<T> {
184
227
  detail: T;
185
228
  target: HTMLCornReviewElement;
@@ -196,6 +239,10 @@ export interface CornSearchCustomEvent<T> extends CustomEvent<T> {
196
239
  }
197
240
 
198
241
  export namespace LocalJSX {
242
+ interface CornChanges {
243
+ }
244
+ interface CornDecision {
245
+ }
199
246
  interface CornLayers {
200
247
  }
201
248
  interface CornMap {
@@ -213,6 +260,8 @@ export namespace LocalJSX {
213
260
  }
214
261
  interface CornNodePanel {
215
262
  }
263
+ interface CornProposal {
264
+ }
216
265
  interface CornReview {
217
266
  'src'?: string | undefined;
218
267
  'proposal'?: string | { [key: string]: unknown } | null | undefined;
@@ -239,18 +288,26 @@ export namespace LocalJSX {
239
288
  'topology'?: { nodes: Array<{ id: string; [key: string]: unknown }>; edges?: Array<{ from: string; to: string; [key: string]: unknown }> } | null | undefined;
240
289
  'config'?: { [key: string]: unknown } | null | undefined;
241
290
  'strings'?: { [key: string]: string } | null | undefined;
291
+ 'proposal'?: string | { [key: string]: unknown } | null | undefined;
292
+ 'source'?: string | null | undefined;
293
+ 'view'?: 'before' | 'diff' | 'after' | null | undefined;
242
294
  'onCornReady'?: (event: CornScopeCustomEvent<void>) => void;
243
- 'onCornAuth'?: (event: CornScopeCustomEvent<CornAuthDetail>) => void;
244
- 'onCornError'?: (event: CornScopeCustomEvent<CornErrorDetail>) => void;
295
+ 'onCornAuth'?: (event: CornScopeCustomEvent<CornScopeAuthDetail>) => void;
296
+ 'onCornError'?: (event: CornScopeCustomEvent<CornScopeErrorDetail>) => void;
297
+ 'onCornNavigate'?: (event: CornScopeCustomEvent<CornNavigateDetail>) => void;
298
+ 'onCornDecision'?: (event: CornScopeCustomEvent<CornDecisionDetail>) => void;
245
299
  }
246
300
  interface CornSearch {
247
301
  'query'?: string | undefined;
248
302
  'onCornSearch'?: (event: CornSearchCustomEvent<CornSearchDetail>) => void;
249
303
  }
250
304
  interface IntrinsicElements {
305
+ 'corn-changes': LocalJSX.CornChanges & { [attribute: string]: unknown };
306
+ 'corn-decision': LocalJSX.CornDecision & { [attribute: string]: unknown };
251
307
  'corn-layers': LocalJSX.CornLayers & { [attribute: string]: unknown };
252
308
  'corn-map': LocalJSX.CornMap & { [attribute: string]: unknown };
253
309
  'corn-node-panel': LocalJSX.CornNodePanel & { [attribute: string]: unknown };
310
+ 'corn-proposal': LocalJSX.CornProposal & { [attribute: string]: unknown };
254
311
  'corn-review': LocalJSX.CornReview & { [attribute: string]: unknown };
255
312
  'corn-scope': LocalJSX.CornScope & { [attribute: string]: unknown };
256
313
  'corn-search': LocalJSX.CornSearch & { [attribute: string]: unknown };
@@ -258,6 +315,34 @@ export namespace LocalJSX {
258
315
  }
259
316
 
260
317
  declare global {
318
+ /** What `<corn-changes>` sends: the event's name and the type of its `detail` */
319
+ interface HTMLCornChangesElementEventMap {
320
+ }
321
+ /** What the proposal changes, and the scenarios that walk through it: one row for each node and edge it adds, changes or removes (a click selects it on the map and frames it, and fills a `<corn-node-panel>` in the same scope), then, persona by persona, the scenarios, and the scenario player, which flies the map from step to step. It is for use inside a `<corn-scope>` that has a `proposal`, beside a `<corn-map>`. A thin shell (spec 0011 D1): it mounts the engine's piece (explorer/pieces/changes.js) in its shadow root on the instance of the nearest `<corn-scope>`, through explorer/pieces/around.js, and ends it when it leaves the page. It holds no behaviour (test/shell.test.ts). It has no properties and sends no events of its own: the scope's selection and the map's `cornSelect` say what is chosen. A scope holds one of it: a second says so, and takes over when the first leaves. */
322
+ interface HTMLCornChangesElement extends Components.CornChanges, HTMLElement {
323
+ addEventListener<K extends keyof HTMLCornChangesElementEventMap>(type: K, listener: (this: HTMLCornChangesElement, ev: CornChangesCustomEvent<HTMLCornChangesElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
324
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCornChangesElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
325
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
326
+ removeEventListener<K extends keyof HTMLCornChangesElementEventMap>(type: K, listener: (this: HTMLCornChangesElement, ev: CornChangesCustomEvent<HTMLCornChangesElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
327
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCornChangesElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
328
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
329
+ }
330
+ var HTMLCornChangesElement: { prototype: HTMLCornChangesElement; new (): HTMLCornChangesElement };
331
+
332
+ /** What `<corn-decision>` sends: the event's name and the type of its `detail` */
333
+ interface HTMLCornDecisionElementEventMap {
334
+ }
335
+ /** Approve and Send back, the line above Approve that says what it does in this exact state, the note that opens on Send back, the hold with Undo, and what the server answered, in a box that fills the place its host gives it. It decides the proposal the nearest `<corn-scope>` holds, as the signed-in maintainer: the same requests `<corn-review>` makes, from a listed origin. A thin shell (spec 0011 D1): it mounts the engine's piece (explorer/pieces/decision.js) in its shadow root on the instance of that scope, through explorer/pieces/around.js, and ends it when it leaves the page. It holds no behaviour (test/shell.test.ts). It has no properties and sends no events of its own: `cornDecision` and `cornAuth` are the scope's, sent once however many sections it holds. A scope holds one of it: a second says so, and takes over when the first leaves. */
336
+ interface HTMLCornDecisionElement extends Components.CornDecision, HTMLElement {
337
+ addEventListener<K extends keyof HTMLCornDecisionElementEventMap>(type: K, listener: (this: HTMLCornDecisionElement, ev: CornDecisionCustomEvent<HTMLCornDecisionElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
338
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCornDecisionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
339
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
340
+ removeEventListener<K extends keyof HTMLCornDecisionElementEventMap>(type: K, listener: (this: HTMLCornDecisionElement, ev: CornDecisionCustomEvent<HTMLCornDecisionElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
341
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCornDecisionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
342
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
343
+ }
344
+ var HTMLCornDecisionElement: { prototype: HTMLCornDecisionElement; new (): HTMLCornDecisionElement };
345
+
261
346
  /** What `<corn-layers>` sends: the event's name and the type of its `detail` */
262
347
  interface HTMLCornLayersElementEventMap {
263
348
  }
@@ -308,6 +393,20 @@ declare global {
308
393
  }
309
394
  var HTMLCornNodePanelElement: { prototype: HTMLCornNodePanelElement; new (): HTMLCornNodePanelElement };
310
395
 
396
+ /** What `<corn-proposal>` sends: the event's name and the type of its `detail` */
397
+ interface HTMLCornProposalElementEventMap {
398
+ }
399
+ /** The open proposal's bar: its title and the copy under review, the counts of what it adds, changes and removes, Before, Diff and After, Whole map, and the ⋯ menu with Close, in a box that fills the place its host gives it. It is for use inside a `<corn-scope>` that has a `proposal`, beside a `<corn-map>`: Before, Diff and After change what the map shows, and Whole map puts the whole map back. A thin shell (spec 0011 D1): it mounts the engine's piece (explorer/pieces/proposal.js) in its shadow root on the instance of the nearest `<corn-scope>`, through explorer/pieces/around.js, and ends it when it leaves the page. It holds no behaviour (test/shell.test.ts). It has no properties and sends no events of its own: the proposal, its `source` and its `view` are the scope's, and so are `cornNavigate`, `cornDecision` and `cornAuth`. A scope holds one of it: a second says so, and takes over when the first leaves. */
400
+ interface HTMLCornProposalElement extends Components.CornProposal, HTMLElement {
401
+ addEventListener<K extends keyof HTMLCornProposalElementEventMap>(type: K, listener: (this: HTMLCornProposalElement, ev: CornProposalCustomEvent<HTMLCornProposalElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
402
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCornProposalElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
403
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
404
+ removeEventListener<K extends keyof HTMLCornProposalElementEventMap>(type: K, listener: (this: HTMLCornProposalElement, ev: CornProposalCustomEvent<HTMLCornProposalElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
405
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLCornProposalElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
406
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
407
+ }
408
+ var HTMLCornProposalElement: { prototype: HTMLCornProposalElement; new (): HTMLCornProposalElement };
409
+
311
410
  /** What `<corn-review>` sends: the event's name and the type of its `detail` */
312
411
  interface HTMLCornReviewElementEventMap {
313
412
  /** The first frame is drawn that shows the proposal asked for open, its title on the bar (or the bar saying why it is not): once per time the element is connected */
@@ -338,10 +437,14 @@ declare global {
338
437
  interface HTMLCornScopeElementEventMap {
339
438
  /** The scope has its data: read from the server, or handed in. Once per server. */
340
439
  'cornReady': void;
341
- /** The server answered a gated read with 401 or 403: the maintainer has to sign in. The piece shows a link to `signIn`. */
342
- 'cornAuth': CornAuthDetail;
440
+ /** The server refused a read or a press with 401 or 403: the maintainer has to sign in. The piece shows a link to `signIn`. */
441
+ 'cornAuth': CornScopeAuthDetail;
343
442
  /** Something the pieces could not do */
344
- 'cornError': CornErrorDetail;
443
+ 'cornError': CornScopeErrorDetail;
444
+ /** The open proposal, or its view, changed: what cornfield's own page would put in its address bar. The host decides what to do with it. Sent by the scope, once, whoever changed it: a property, a button on `<corn-proposal>`, a way on from a bad link. */
445
+ 'cornNavigate': CornNavigateDetail;
446
+ /** The server took a decision, Approve or Send back. Once per decision, after the server answered, whichever `<corn-decision>` was pressed. */
447
+ 'cornDecision': CornDecisionDetail;
345
448
  }
346
449
  /** Where the data comes from, and what the pieces inside it share (spec 0011 D5). It shows nothing of its own and has no shadow root: the `corn-*` pieces inside it (today `corn-map`) share one instance (one selection, one camera, one topology), and `src` is the address of a cornfield server it reads their config and topology from, with the signed-in maintainer's session. A thin shell (spec 0011 D1): the work is explorer/pieces/scope.js. */
347
450
  interface HTMLCornScopeElement extends Components.CornScope, HTMLElement {
@@ -371,9 +474,12 @@ declare global {
371
474
  var HTMLCornSearchElement: { prototype: HTMLCornSearchElement; new (): HTMLCornSearchElement };
372
475
 
373
476
  interface HTMLElementTagNameMap {
477
+ 'corn-changes': HTMLCornChangesElement;
478
+ 'corn-decision': HTMLCornDecisionElement;
374
479
  'corn-layers': HTMLCornLayersElement;
375
480
  'corn-map': HTMLCornMapElement;
376
481
  'corn-node-panel': HTMLCornNodePanelElement;
482
+ 'corn-proposal': HTMLCornProposalElement;
377
483
  'corn-review': HTMLCornReviewElement;
378
484
  'corn-scope': HTMLCornScopeElement;
379
485
  'corn-search': HTMLCornSearchElement;
@@ -0,0 +1,2 @@
1
+ export * from './components.js';
2
+ export declare const CornChanges: { prototype: HTMLCornChangesElement; new (): HTMLCornChangesElement };
@@ -0,0 +1,2 @@
1
+ export * from './components.js';
2
+ export declare const CornDecision: { prototype: HTMLCornDecisionElement; new (): HTMLCornDecisionElement };
@@ -0,0 +1,2 @@
1
+ export * from './components.js';
2
+ export declare const CornProposal: { prototype: HTMLCornProposalElement; new (): HTMLCornProposalElement };
@@ -1,9 +1,12 @@
1
1
  export * from './components.js';
2
2
  /** The version of cornfield these components were built from (the server reports the same number) */
3
3
  export declare const version: string;
4
+ export declare const CornChanges: { prototype: HTMLCornChangesElement; new (): HTMLCornChangesElement };
5
+ export declare const CornDecision: { prototype: HTMLCornDecisionElement; new (): HTMLCornDecisionElement };
4
6
  export declare const CornLayers: { prototype: HTMLCornLayersElement; new (): HTMLCornLayersElement };
5
7
  export declare const CornMap: { prototype: HTMLCornMapElement; new (): HTMLCornMapElement };
6
8
  export declare const CornNodePanel: { prototype: HTMLCornNodePanelElement; new (): HTMLCornNodePanelElement };
9
+ export declare const CornProposal: { prototype: HTMLCornProposalElement; new (): HTMLCornProposalElement };
7
10
  export declare const CornReview: { prototype: HTMLCornReviewElement; new (): HTMLCornReviewElement };
8
11
  export declare const CornScope: { prototype: HTMLCornScopeElement; new (): HTMLCornScopeElement };
9
12
  export declare const CornSearch: { prototype: HTMLCornSearchElement; new (): HTMLCornSearchElement };
package/dist/version.json CHANGED
@@ -1 +1 @@
1
- {"name":"@popcorn245/cornfield-components","cornfield":"0.52.1"}
1
+ {"name":"@popcorn245/cornfield-components","cornfield":"0.53.0"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@popcorn245/cornfield-components",
3
- "version": "0.52.1",
4
- "description": "cornfield's interface as web components (spec 0011): <corn-map>, <corn-review>, <corn-scope> and the pieces around the map (<corn-node-panel>, <corn-layers>, <corn-search>), thin StencilRS shells over the engine in cornfield. The same files are served by every cornfield server at /cornfield/components/.",
3
+ "version": "0.53.0",
4
+ "description": "cornfield's interface as web components (spec 0011): <corn-map>, <corn-review>, <corn-scope>, the pieces around the map (<corn-node-panel>, <corn-layers>, <corn-search>) and the review's sections (<corn-proposal>, <corn-changes>, <corn-decision>), thin StencilRS shells over the engine in cornfield. The same files are served by every cornfield server at /cornfield/components/.",
5
5
  "license": "MIT",
6
6
  "author": "popcorn245 (https://github.com/popcorn245)",
7
7
  "homepage": "https://github.com/popcorn245/CornField/blob/main/docs/embedding.md",
@@ -30,18 +30,30 @@
30
30
  "types": "./dist/types/index.d.ts",
31
31
  "default": "./dist/index.js"
32
32
  },
33
- "./corn-map": {
34
- "types": "./dist/types/corn-map.d.ts",
35
- "default": "./dist/corn-map.js"
33
+ "./corn-changes": {
34
+ "types": "./dist/types/corn-changes.d.ts",
35
+ "default": "./dist/corn-changes.js"
36
+ },
37
+ "./corn-decision": {
38
+ "types": "./dist/types/corn-decision.d.ts",
39
+ "default": "./dist/corn-decision.js"
36
40
  },
37
41
  "./corn-layers": {
38
42
  "types": "./dist/types/corn-layers.d.ts",
39
43
  "default": "./dist/corn-layers.js"
40
44
  },
45
+ "./corn-map": {
46
+ "types": "./dist/types/corn-map.d.ts",
47
+ "default": "./dist/corn-map.js"
48
+ },
41
49
  "./corn-node-panel": {
42
50
  "types": "./dist/types/corn-node-panel.d.ts",
43
51
  "default": "./dist/corn-node-panel.js"
44
52
  },
53
+ "./corn-proposal": {
54
+ "types": "./dist/types/corn-proposal.d.ts",
55
+ "default": "./dist/corn-proposal.js"
56
+ },
45
57
  "./corn-review": {
46
58
  "types": "./dist/types/corn-review.d.ts",
47
59
  "default": "./dist/corn-review.js"
@@ -1,78 +0,0 @@
1
- import { Dn as e, En as t, Gt as n, Kt as r, Mn as i, Wt as a, Zt as o, jn as s } from "./engine-BmXtSISH.js";
2
- // ../explorer/engine/roots.js
3
- var c = (e) => [e.root, ...e.extraRoots].filter(Boolean);
4
- function l(e, t) {
5
- if (!t || e.ended) return () => {};
6
- let n = typeof t.getRootNode == "function" ? t.getRootNode() : t;
7
- if (!n || c(e).some((e) => e === n || e === t)) return () => {};
8
- e.extraRoots.add(n), e.emit("root:changed");
9
- let r = () => {
10
- e.extraRoots.delete(n) && e.emit("root:changed"), e.release(r);
11
- };
12
- return e.own(r), r;
13
- }
14
- function u(e, t, n, r) {
15
- let i = /* @__PURE__ */ new WeakSet(), a = (e) => {
16
- i.has(e) || (i.add(e), n(e));
17
- }, o = /* @__PURE__ */ new Map(), s = () => {
18
- let n = new Set(c(e));
19
- for (let [e, t] of [...o]) n.has(e) || (t(), o.delete(e));
20
- for (let i of n) o.has(i) || o.set(i, e.listen(i, t, a, r));
21
- };
22
- s();
23
- let l = e.on("root:changed", s), u = () => {
24
- l();
25
- for (let e of o.values()) e();
26
- o.clear(), e.release(u);
27
- };
28
- return e.own(u), u;
29
- }
30
- function d(e, t, { capture: n = !0 } = {}) {
31
- return e.doc ? e.listen(e.doc, "click", (e) => t(e), n) : () => {};
32
- }
33
- // ../explorer/pieces/around.js
34
- function f(e, t) {
35
- let r = e.nodeType === 11 ? e.host : e, i = r && typeof r.getRootNode == "function" ? r.getRootNode() : null;
36
- i && t && (n(i.nodeType === 9 ? i : i.ownerDocument, t), i.nodeType === 11 && n(i, t));
37
- }
38
- function p(n, c, u, d = {}) {
39
- let p = !u;
40
- p && (u = i({ root: c }));
41
- let m = a(u), h = e(u);
42
- f(c, d.tokens), h.own(l(u, c)), m && m.serverTheme && h.own(m.serverTheme.adopt(c));
43
- let [g] = t(u, c, "<p class=\"hx-sr-only\" role=\"status\" aria-live=\"polite\"></p>", null, "announcer"), _ = o(u, g);
44
- h.on("announce:fallback", (e) => (_(e), !0)), h.own(() => g.remove());
45
- let v = null, y = [], b = { ...d.initial || {} }, x = !1, S = () => {
46
- for (let e of y) e.remove();
47
- y = [];
48
- }, C = () => !!u.map && u.state.nodes.length > 0, w = (e = !1) => {
49
- if (x) return;
50
- let n = m ? d.noMap === "nodePanelEmpty" ? s(u, "nodePanelEmpty") : u.map && !e ? s(u, "waitingForMap") : s(u, "needsMap") : s(u, "needsScope");
51
- y.length && y[0].textContent === n || (S(), y = t(u, c, `<p class="hx-needs" data-corn="empty">${r(n)}</p>`, null, "needs"));
52
- }, T = () => {
53
- v || x || (C() ? (S(), v = n.mount(c, u, {
54
- ...d.piece || {},
55
- inline: !0,
56
- phone: !1
57
- }), Object.keys(b).length && (v.update(b), b = {})) : w());
58
- }, E = () => {
59
- v &&= (v.destroy(), null);
60
- };
61
- return h.on("map:ready", T), h.on("scene", () => {
62
- v || T();
63
- }), h.on("map:gone", () => {
64
- E(), w(!0);
65
- }), d.onSearch && h.on("search", (e) => d.onSearch(e)), T(), {
66
- inst: u,
67
- update(e = {}) {
68
- x || (v ? v.update(e) : Object.assign(b, e));
69
- },
70
- focusField() {
71
- v && typeof v.focusField == "function" && v.focusField();
72
- },
73
- destroy() {
74
- x || (x = !0, E(), S(), h.destroy(), p && u.destroy());
75
- }
76
- };
77
- }
78
- export { u as n, d as r, p as t };