@lo-tek/interfaces 0.41.0 → 0.43.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/CHANGELOG.md +107 -0
- package/agent/astro.md +1 -1
- package/agent/bundles.md +1 -1
- package/agent/datastar.md +57 -50
- package/agent/html.md +53 -53
- package/agent/kotlin.md +4 -4
- package/agent/react.md +1 -1
- package/agent/templates.md +50 -50
- package/dist/components/frame/dialog/lt-dialog.d.ts +11 -3
- package/dist/components/frame/dialog/lt-dialog.d.ts.map +1 -1
- package/dist/components/frame/dialog/lt-dialog.js +59 -46
- package/dist/components/frame/dialog/lt-dialog.js.map +1 -1
- package/dist/components/frame/error-summary/lt-error-summary.d.ts +9 -6
- package/dist/components/frame/error-summary/lt-error-summary.d.ts.map +1 -1
- package/dist/components/frame/error-summary/lt-error-summary.js +38 -57
- package/dist/components/frame/error-summary/lt-error-summary.js.map +1 -1
- package/dist/components/frame/field/lt-field.d.ts +17 -26
- package/dist/components/frame/field/lt-field.d.ts.map +1 -1
- package/dist/components/frame/field/lt-field.js +81 -143
- package/dist/components/frame/field/lt-field.js.map +1 -1
- package/dist/components/frame/popover/lt-popover.d.ts +1 -1
- package/dist/components/frame/popover/lt-popover.d.ts.map +1 -1
- package/dist/components/frame/popover/lt-popover.js +31 -33
- package/dist/components/frame/popover/lt-popover.js.map +1 -1
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +14 -2
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts.map +1 -1
- package/dist/components/frame/session-timeout/lt-session-timeout.js +73 -46
- package/dist/components/frame/session-timeout/lt-session-timeout.js.map +1 -1
- package/dist/components/frame/suggestion/lt-suggestion.d.ts +5 -7
- package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -1
- package/dist/components/frame/suggestion/lt-suggestion.js +57 -72
- package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -1
- package/dist/components/frame/tabs/lt-tabs.d.ts +14 -5
- package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -1
- package/dist/components/frame/tabs/lt-tabs.js +86 -106
- package/dist/components/frame/tabs/lt-tabs.js.map +1 -1
- package/dist/components/frame/term/lt-term.d.ts +5 -1
- package/dist/components/frame/term/lt-term.d.ts.map +1 -1
- package/dist/components/frame/term/lt-term.js +23 -21
- package/dist/components/frame/term/lt-term.js.map +1 -1
- package/dist/components/host-element.d.ts +137 -2
- package/dist/components/host-element.d.ts.map +1 -1
- package/dist/components/host-element.js +187 -4
- package/dist/components/host-element.js.map +1 -1
- package/dist/lotek.css +1 -1
- package/dist/react.d.ts +51 -437
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +48 -208
- package/dist/react.js.map +1 -1
- package/live-templates-kotlin.xml +4 -6
- package/manifest/manifest.json +1 -1
- package/package.json +7 -3
- package/src/components/frame/dialog/lt-dialog.ts +56 -50
- package/src/components/frame/error-summary/lt-error-summary.ts +33 -46
- package/src/components/frame/field/lt-field.ts +99 -207
- package/src/components/frame/popover/lt-popover.ts +37 -35
- package/src/components/frame/session-timeout/lt-session-timeout.ts +88 -46
- package/src/components/frame/suggestion/lt-suggestion.ts +59 -73
- package/src/components/frame/tabs/lt-tabs.ts +96 -122
- package/src/components/frame/term/lt-term.ts +27 -21
- package/src/components/host-element.ts +306 -3
- package/src/react.ts +125 -240
- package/web-types.json +1 -1
package/dist/react.js
CHANGED
|
@@ -1,51 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { avatar } from "./components/css/avatar/avatar.js";
|
|
4
|
-
import { badge } from "./components/css/badge/badge.js";
|
|
5
|
-
import { breadcrumbs } from "./components/css/breadcrumbs/breadcrumbs.js";
|
|
6
|
-
import { button } from "./components/css/button/button.js";
|
|
7
|
-
import { card } from "./components/css/card/card.js";
|
|
8
|
-
import { checkbox } from "./components/css/checkbox/checkbox.js";
|
|
9
|
-
import { divider } from "./components/css/divider/divider.js";
|
|
10
|
-
import { errorText } from "./components/css/error-text/error-text.js";
|
|
11
|
-
import { fieldset, legend } from "./components/css/fieldset/fieldset.js";
|
|
12
|
-
import { fileUpload } from "./components/css/file-upload/file-upload.js";
|
|
13
|
-
import { heading } from "./components/css/heading/heading.js";
|
|
14
|
-
import { helpText } from "./components/css/help-text/help-text.js";
|
|
15
|
-
import { icon } from "./components/css/icon/icon.js";
|
|
16
|
-
import { input } from "./components/css/input/input.js";
|
|
17
|
-
import { label } from "./components/css/label/label.js";
|
|
18
|
-
import { link } from "./components/css/link/link.js";
|
|
19
|
-
import { list } from "./components/css/list/list.js";
|
|
20
|
-
import { pagination } from "./components/css/pagination/pagination.js";
|
|
21
|
-
import { paragraph } from "./components/css/paragraph/paragraph.js";
|
|
22
|
-
import { progress } from "./components/css/progress/progress.js";
|
|
23
|
-
import { radio } from "./components/css/radio/radio.js";
|
|
24
|
-
import { search } from "./components/css/search/search.js";
|
|
25
|
-
import { select } from "./components/css/select/select.js";
|
|
26
|
-
import { fieldStates, isFieldState, isRequiredMarker, managedNames, rememberManaged, requiredMarkers, } from "./components/css/shared.js";
|
|
27
|
-
import { skeleton } from "./components/css/skeleton/skeleton.js";
|
|
28
|
-
import { skipLink } from "./components/css/skip-link/skip-link.js";
|
|
29
|
-
import { spinner } from "./components/css/spinner/spinner.js";
|
|
30
|
-
import { srOnly } from "./components/css/sr-only/sr-only.js";
|
|
31
|
-
import { steps } from "./components/css/steps/steps.js";
|
|
32
|
-
import { switchControl } from "./components/css/switch/switch.js";
|
|
33
|
-
import { table, tableSort } from "./components/css/table/table.js";
|
|
34
|
-
import { tag } from "./components/css/tag/tag.js";
|
|
35
|
-
import { textarea } from "./components/css/textarea/textarea.js";
|
|
36
|
-
import { toggleGroup } from "./components/css/toggle-group/toggle-group.js";
|
|
37
|
-
import { tooltip } from "./components/css/tooltip/tooltip.js";
|
|
38
|
-
import { dialog } from "./components/frame/dialog/dialog.js";
|
|
39
|
-
import { errorSummary } from "./components/frame/error-summary/error-summary.js";
|
|
40
|
-
import { computeFieldAttributes, createFieldId, } from "./components/frame/field/field-core.js";
|
|
41
|
-
import { popover } from "./components/frame/popover/popover.js";
|
|
42
|
-
import { sessionTimeout } from "./components/frame/session-timeout/session-timeout.js";
|
|
43
|
-
import { suggestion } from "./components/frame/suggestion/suggestion.js";
|
|
1
|
+
import { managedNames, rememberManaged } from "./components/css/shared.js";
|
|
2
|
+
import { createFieldId } from "./components/frame/field/field-core.js";
|
|
44
3
|
import { tabsWithState, } from "./components/frame/tabs/tabs.js";
|
|
45
4
|
import { termWithState } from "./components/frame/term/term.js";
|
|
46
|
-
import { connectionStatus } from "./components/standalone/connection-status/connection-status.js";
|
|
47
|
-
import { toast } from "./components/standalone/toast/toast.js";
|
|
48
5
|
import { setAttributes as setHtmlAttributes } from "./dom.js";
|
|
6
|
+
import { lt as html } from "./lt.js";
|
|
49
7
|
/**
|
|
50
8
|
* The attributes that have another name in React.
|
|
51
9
|
*
|
|
@@ -118,16 +76,48 @@ export function setAttributes(element, ...sets) {
|
|
|
118
76
|
setHtmlAttributes(element, ...sets.map((set) => toHtmlAttributes(set)));
|
|
119
77
|
}
|
|
120
78
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
79
|
+
* The result with the React names. A set is recognised by what
|
|
80
|
+
* `attributes()` notes on every set a builder function makes, not by its
|
|
81
|
+
* shape, so a compound whose parts are all absent is not taken for one.
|
|
82
|
+
*/
|
|
83
|
+
function toReactResult(value) {
|
|
84
|
+
if (Array.isArray(value))
|
|
85
|
+
return value.map(toReactResult);
|
|
86
|
+
if (!value || typeof value !== "object")
|
|
87
|
+
return value;
|
|
88
|
+
if (managedNames(value))
|
|
89
|
+
return toReactAttributes(value);
|
|
90
|
+
return Object.fromEntries(Object.entries(value).map(([name, child]) => [name, toReactResult(child)]));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Wraps a builder function so the result gets the React names, and keeps
|
|
94
|
+
* what hangs on the function: `variants`, `isVariant` and the others.
|
|
126
95
|
*/
|
|
127
96
|
function forReact(fn) {
|
|
128
|
-
const wrapped = (
|
|
97
|
+
const wrapped = (...args) => toReactResult(fn(...args));
|
|
129
98
|
return Object.assign(wrapped, fn);
|
|
130
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* A guard on `lt`, such as `isState`: it builds nothing, and passes through
|
|
102
|
+
* as the same function. Named `is` and a capital letter, as every guard in
|
|
103
|
+
* the package is.
|
|
104
|
+
*/
|
|
105
|
+
const isGuard = (name) => /^is[A-Z]/.test(name);
|
|
106
|
+
/**
|
|
107
|
+
* What stands by hand in `lt` below: the two that give the whole state, and
|
|
108
|
+
* `setAttributes`, which takes an element and builds nothing.
|
|
109
|
+
*/
|
|
110
|
+
const BY_HAND = ["tabs", "term", "setAttributes"];
|
|
111
|
+
function everyBuilder() {
|
|
112
|
+
const result = {};
|
|
113
|
+
for (const [name, value] of Object.entries(html))
|
|
114
|
+
if (!BY_HAND.includes(name))
|
|
115
|
+
result[name] =
|
|
116
|
+
typeof value === "function" && !isGuard(name)
|
|
117
|
+
? forReact(value)
|
|
118
|
+
: value;
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
131
121
|
/**
|
|
132
122
|
* Re-exported from the main entry point.
|
|
133
123
|
*
|
|
@@ -138,173 +128,23 @@ function forReact(fn) {
|
|
|
138
128
|
* also in an app without a server.
|
|
139
129
|
*/
|
|
140
130
|
export { createFieldId };
|
|
131
|
+
/**
|
|
132
|
+
* Every builder function from the main entry, with the React names. A new
|
|
133
|
+
* component comes along by itself; only the exceptions stand here.
|
|
134
|
+
*/
|
|
141
135
|
export const lt = {
|
|
142
|
-
|
|
143
|
-
alert: forReact(alert),
|
|
144
|
-
avatar: forReact(avatar),
|
|
145
|
-
badge: forReact(badge),
|
|
146
|
-
breadcrumbs: forReact(breadcrumbs),
|
|
147
|
-
button: forReact(button),
|
|
148
|
-
card: forReact(card),
|
|
149
|
-
checkbox: forReact(checkbox),
|
|
150
|
-
divider: forReact(divider),
|
|
151
|
-
errorText: forReact(errorText),
|
|
152
|
-
fieldset: forReact(fieldset),
|
|
153
|
-
heading: forReact(heading),
|
|
154
|
-
fileUpload: forReact(fileUpload),
|
|
155
|
-
helpText: forReact(helpText),
|
|
156
|
-
icon: forReact(icon),
|
|
157
|
-
input: forReact(input),
|
|
158
|
-
label: forReact(label),
|
|
159
|
-
legend: forReact(legend),
|
|
160
|
-
link: forReact(link),
|
|
161
|
-
list: forReact(list),
|
|
162
|
-
pagination: forReact(pagination),
|
|
163
|
-
paragraph: forReact(paragraph),
|
|
164
|
-
radio: forReact(radio),
|
|
165
|
-
search: forReact(search),
|
|
166
|
-
select: forReact(select),
|
|
167
|
-
skeleton: forReact(skeleton),
|
|
168
|
-
skipLink: forReact(skipLink),
|
|
169
|
-
progress: forReact(progress),
|
|
170
|
-
spinner: forReact(spinner),
|
|
171
|
-
srOnly: forReact(srOnly),
|
|
172
|
-
steps: forReact(steps),
|
|
173
|
-
switch: forReact(switchControl),
|
|
174
|
-
toggleGroup: forReact(toggleGroup),
|
|
175
|
-
tooltip: forReact(tooltip),
|
|
176
|
-
table: forReact(table),
|
|
177
|
-
tableSort: Object.assign((options) => {
|
|
178
|
-
const built = tableSort(options);
|
|
179
|
-
return {
|
|
180
|
-
header: built.header,
|
|
181
|
-
button: toReactAttributes(built.button),
|
|
182
|
-
};
|
|
183
|
-
}, { isDirection: tableSort.isDirection }),
|
|
184
|
-
tag: forReact(tag),
|
|
185
|
-
textarea: forReact(textarea),
|
|
186
|
-
/**
|
|
187
|
-
* Wires a whole field, with `className` and `htmlFor` on the label.
|
|
188
|
-
*
|
|
189
|
-
* `control`, `help` and `error` have no keys that need renaming, and are
|
|
190
|
-
* therefore the same in both entry points.
|
|
191
|
-
*/
|
|
192
|
-
field: (options) => {
|
|
193
|
-
const field = computeFieldAttributes(options);
|
|
194
|
-
return { ...field, label: toReactAttributes(field.label) };
|
|
195
|
-
},
|
|
196
|
-
/**
|
|
197
|
-
* The compound builder functions return one attribute set per element,
|
|
198
|
-
* and each set must be renamed on its own. `host` has `tabindex`, and the
|
|
199
|
-
* panels in `lt.tabs()` have both `tabindex` and `class`.
|
|
200
|
-
*/
|
|
201
|
-
errorSummary: (options = {}) => {
|
|
202
|
-
const built = errorSummary(options);
|
|
203
|
-
return {
|
|
204
|
-
host: toReactAttributes(built.host),
|
|
205
|
-
title: toReactAttributes(built.title),
|
|
206
|
-
};
|
|
207
|
-
},
|
|
208
|
-
dialog: Object.assign((options) => {
|
|
209
|
-
const built = dialog(options);
|
|
210
|
-
return {
|
|
211
|
-
host: built.host,
|
|
212
|
-
dialog: toReactAttributes(built.dialog),
|
|
213
|
-
header: toReactAttributes(built.header),
|
|
214
|
-
title: toReactAttributes(built.title),
|
|
215
|
-
subtitle: toReactAttributes(built.subtitle),
|
|
216
|
-
body: toReactAttributes(built.body),
|
|
217
|
-
footer: toReactAttributes(built.footer),
|
|
218
|
-
};
|
|
219
|
-
}, {
|
|
220
|
-
dialog: dialog.dialog,
|
|
221
|
-
header: dialog.header,
|
|
222
|
-
title: dialog.title,
|
|
223
|
-
subtitle: dialog.subtitle,
|
|
224
|
-
body: dialog.body,
|
|
225
|
-
footer: dialog.footer,
|
|
226
|
-
colors: dialog.colors,
|
|
227
|
-
isColor: dialog.isColor,
|
|
228
|
-
}),
|
|
229
|
-
popover: Object.assign((options) => {
|
|
230
|
-
const built = popover(options);
|
|
231
|
-
return {
|
|
232
|
-
host: built.host,
|
|
233
|
-
trigger: toReactAttributes(built.trigger),
|
|
234
|
-
panel: toReactAttributes(built.panel),
|
|
235
|
-
};
|
|
236
|
-
}, { isPlacement: popover.isPlacement }),
|
|
136
|
+
...everyBuilder(),
|
|
237
137
|
/**
|
|
238
138
|
* The whole state, not just the links: React reports a mismatch for every
|
|
239
139
|
* attribute the component writes on an element React has rendered. See
|
|
240
140
|
* `tabsWithState`.
|
|
241
141
|
*/
|
|
242
|
-
tabs: (options) =>
|
|
243
|
-
const built = tabsWithState(options);
|
|
244
|
-
return {
|
|
245
|
-
list: toReactAttributes(built.list),
|
|
246
|
-
item: toReactAttributes(built.item),
|
|
247
|
-
tabs: built.tabs.map(toReactAttributes),
|
|
248
|
-
panels: built.panels.map(toReactAttributes),
|
|
249
|
-
};
|
|
250
|
-
},
|
|
142
|
+
tabs: (options) => toReactResult(tabsWithState(options)),
|
|
251
143
|
/**
|
|
252
144
|
* With `aria-expanded`, which `<lt-term>` writes: React reports a mismatch
|
|
253
145
|
* for an attribute it did not render. See `termWithState`.
|
|
254
146
|
*/
|
|
255
|
-
term: (options) =>
|
|
256
|
-
const built = termWithState(options);
|
|
257
|
-
return {
|
|
258
|
-
word: toReactAttributes(built.word),
|
|
259
|
-
entry: toReactAttributes(built.entry),
|
|
260
|
-
};
|
|
261
|
-
},
|
|
262
|
-
suggestion: (options) => {
|
|
263
|
-
const built = suggestion(options);
|
|
264
|
-
return {
|
|
265
|
-
...built,
|
|
266
|
-
label: toReactAttributes(built.label),
|
|
267
|
-
control: toReactAttributes(built.control),
|
|
268
|
-
list: toReactAttributes(built.list),
|
|
269
|
-
options: built.options.map(toReactAttributes),
|
|
270
|
-
empty: toReactAttributes(built.empty),
|
|
271
|
-
status: toReactAttributes(built.status),
|
|
272
|
-
value: toReactAttributes(built.value),
|
|
273
|
-
};
|
|
274
|
-
},
|
|
275
|
-
toast: (options = {}) => {
|
|
276
|
-
const built = toast(options);
|
|
277
|
-
return {
|
|
278
|
-
host: toReactAttributes(built.host),
|
|
279
|
-
message: toReactAttributes(built.message),
|
|
280
|
-
close: toReactAttributes(built.close),
|
|
281
|
-
};
|
|
282
|
-
},
|
|
283
|
-
sessionTimeout: Object.assign((options) => {
|
|
284
|
-
const built = sessionTimeout(options);
|
|
285
|
-
return {
|
|
286
|
-
host: toReactAttributes(built.host),
|
|
287
|
-
dialog: toReactAttributes(built.dialog),
|
|
288
|
-
title: toReactAttributes(built.title),
|
|
289
|
-
text: toReactAttributes(built.text),
|
|
290
|
-
count: toReactAttributes(built.count),
|
|
291
|
-
live: toReactAttributes(built.live),
|
|
292
|
-
actions: toReactAttributes(built.actions),
|
|
293
|
-
extend: toReactAttributes(built.extend),
|
|
294
|
-
logout: toReactAttributes(built.logout),
|
|
295
|
-
};
|
|
296
|
-
}, {
|
|
297
|
-
dialog: sessionTimeout.dialog,
|
|
298
|
-
title: sessionTimeout.title,
|
|
299
|
-
text: sessionTimeout.text,
|
|
300
|
-
count: sessionTimeout.count,
|
|
301
|
-
actions: sessionTimeout.actions,
|
|
302
|
-
}),
|
|
303
|
-
connectionStatus: forReact(connectionStatus),
|
|
147
|
+
term: (options) => toReactResult(termWithState(options)),
|
|
304
148
|
setAttributes,
|
|
305
|
-
states: fieldStates,
|
|
306
|
-
isState: isFieldState,
|
|
307
|
-
markers: requiredMarkers,
|
|
308
|
-
isMarker: isRequiredMarker,
|
|
309
149
|
};
|
|
310
150
|
//# sourceMappingURL=react.js.map
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AACtE,OAAO,EAEL,aAAa,GACd,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAmB,aAAa,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC9E,OAAO,EAAE,EAAE,IAAI,IAAI,EAAW,MAAM,SAAS,CAAA;AAqD7C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,GAA2B;IAC1C,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE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,MAAM,CAAC,OAAO,EAAE,EAAE,CAA6B,CAAA;AAC/D,CAAC;AAuBD;;;;GAIG;AACH,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEvD;;;GAGG;AACH,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,CAAU,CAAA;AAa1D,SAAS,YAAY;IACnB,MAAM,MAAM,GAA4B,EAAE,CAAA;IAC1C,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;QAC9C,IAAI,CAAE,OAA6B,CAAC,QAAQ,CAAC,IAAI,CAAC;YAChD,MAAM,CAAC,IAAI,CAAC;gBACV,OAAO,KAAK,KAAK,UAAU,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;oBAC3C,CAAC,CAAC,QAAQ,CAAC,KAAsC,CAAC;oBAClD,CAAC,CAAC,KAAK,CAAA;IACf,OAAO,MAAkB,CAAA;AAC3B,CAAC;AAED;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,CAAA;AAuBxB;;;GAGG;AACH,MAAM,CAAC,MAAM,EAAE,GAAY;IACzB,GAAG,YAAY,EAAE;IAEjB;;;;OAIG;IACH,IAAI,EAAE,CAAC,OAA6B,EAAE,EAAE,CACtC,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAEnC;IAEH;;;OAGG;IACH,IAAI,EAAE,CAAC,OAA4C,EAAE,EAAE,CACrD,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,CAEnC;IAEH,aAAa;CACd,CAAA"}
|
|
@@ -40,28 +40,26 @@
|
|
|
40
40
|
<option name="KOTLIN_TOPLEVEL" value="true" />
|
|
41
41
|
</context>
|
|
42
42
|
</template>
|
|
43
|
-
<template name="ltdialog" value="fun FlowContent.cancelJob() { val box = no.lotek.Lt.dialog(titleId = "$confirm_title$"
|
|
43
|
+
<template name="ltdialog" value="fun FlowContent.cancelJob(open: Boolean = true) { val box = no.lotek.Lt.dialog(titleId = "$confirm_title$", open = open) ltDialog { lt(box.host) id = "$confirm$" dialog { lt(box.dialog) // Escape is a close request, reported with `cancel`, and it // keeps the job. A close the server makes gives no `cancel`. attributes["data-on:cancel"] = "@post('/jobs/222-0481/keep')" h2 { lt(box.title); +"Cancel job 222-0481?" } div { lt(box.body) p { +"The crew keeps the advance. This cannot be undone." } } form { lt(box.footer) attributes["method"] = "dialog" button { lt(no.lotek.Lt.button(variant = no.lotek.ButtonVariant.SECONDARY)) value = "keep" attributes["data-on:click"] = "@post('/jobs/222-0481/keep')" +"Keep the job" } button { lt(no.lotek.Lt.button(variant = no.lotek.ButtonVariant.DANGER)) value = "cancel" attributes["data-on:click"] = "@post('/jobs/222-0481/cancel')" +"Cancel the job" } } } } }" description="The Kotlin recipe from the dialog page, in kotlinx.html. Needs import kotlinx.html.* and no.lotek.html.*; the names from no.lotek are imported when it is inserted." toReformat="true" toShortenFQNames="true">
|
|
44
44
|
<variable name="confirm_title" expression="" defaultValue="" alwaysStopAt="true" />
|
|
45
|
-
<variable name="open_confirm" expression="" defaultValue="" alwaysStopAt="true" />
|
|
46
45
|
<variable name="confirm" expression="" defaultValue="" alwaysStopAt="true" />
|
|
47
46
|
<context>
|
|
48
47
|
<option name="KOTLIN_TOPLEVEL" value="true" />
|
|
49
48
|
</context>
|
|
50
49
|
</template>
|
|
51
|
-
<template name="lttoast" value="fun FlowContent.relay() { ltToast { lt(no.lotek.Lt.toast(label = "Messages").host); id = "$messages$" } button {
|
|
50
|
+
<template name="lttoast" value="fun FlowContent.relay() { ltToast { lt(no.lotek.Lt.toast(label = "Messages").host); id = "$messages$" } button { lt(no.lotek.Lt.button()) type = ButtonType.button attributes["data-on:click"] = "@post('/relays/14/restart')" +"Restart relay 14" } }" description="The Kotlin recipe from the toast page, in kotlinx.html. Needs import kotlinx.html.* and no.lotek.html.*; the names from no.lotek are imported when it is inserted." toReformat="true" toShortenFQNames="true">
|
|
52
51
|
<variable name="messages" expression="" defaultValue="" alwaysStopAt="true" />
|
|
53
|
-
<variable name="restart" expression="" defaultValue="" alwaysStopAt="true" />
|
|
54
52
|
<context>
|
|
55
53
|
<option name="KOTLIN_TOPLEVEL" value="true" />
|
|
56
54
|
</context>
|
|
57
55
|
</template>
|
|
58
|
-
<template name="ltsessiontimeout" value="fun FlowContent.sessionWarning() { val session = no.lotek.Lt.sessionTimeout(titleId = "$session_title$", warnAt = 1500, expiresAt = 1800) ltSessionTimeout { lt(session.host) dialog { lt(session.dialog) h2 { lt(session.title); +"Your session is ending" } p { lt(session.text) +"Your session on the Lattice ends in " span { lt(session.count) } +". Unsaved routes will be lost." } span { lt(session.live) } form { lt(session.actions) attributes["method"] = "dialog" button { lt(no.lotek.Lt.button(), session.extend); +"Stay connected" } button { lt(no.lotek.Lt.button(variant = no.lotek.ButtonVariant.SECONDARY), session.logout) // Logging out is a post to the server, which ends the session. formMethod = ButtonFormMethod.post formAction = "/log-out" +"Log out" } } } }
|
|
56
|
+
<template name="ltsessiontimeout" value="fun FlowContent.sessionWarning() { val session = no.lotek.Lt.sessionTimeout(titleId = "$session_title$", warnAt = 1500, expiresAt = 1800) ltSessionTimeout { lt(session.host) attributes["data-on:session-extend"] = "@post('/api/extend-session')" attributes["data-on:session-expired"] = "window.location = '/log-in?reason=expired'" dialog { lt(session.dialog) h2 { lt(session.title); +"Your session is ending" } p { lt(session.text) +"Your session on the Lattice ends in " span { lt(session.count) } +". Unsaved routes will be lost." } span { lt(session.live) } form { lt(session.actions) attributes["method"] = "dialog" button { lt(no.lotek.Lt.button(), session.extend); +"Stay connected" } button { lt(no.lotek.Lt.button(variant = no.lotek.ButtonVariant.SECONDARY), session.logout) // Logging out is a post to the server, which ends the session. formMethod = ButtonFormMethod.post formAction = "/log-out" +"Log out" } } } } }" description="The Kotlin recipe from the session-timeout page, in kotlinx.html. Needs import kotlinx.html.* and no.lotek.html.*; the names from no.lotek are imported when it is inserted." toReformat="true" toShortenFQNames="true">
|
|
59
57
|
<variable name="session_title" expression="" defaultValue="" alwaysStopAt="true" />
|
|
60
58
|
<context>
|
|
61
59
|
<option name="KOTLIN_TOPLEVEL" value="true" />
|
|
62
60
|
</context>
|
|
63
61
|
</template>
|
|
64
|
-
<template name="ltconnectionstatus" value="fun FlowContent.connection() { ltConnectionStatus {
|
|
62
|
+
<template name="ltconnectionstatus" value="fun FlowContent.connection() { ltConnectionStatus { lt(no.lotek.Lt.connectionStatus()) // `retrying`: the request got no answer. `error`: an answer of 400 or // more; 502, 503 and 504 come from a gateway whose server is gone, // any other is a server that is there. A patch: the stream is alive. attributes["data-on:datastar-fetch__document"] = "evt.detail.type === 'retrying' || [502, 503, 504].includes(+evt.detail.argsRaw.status) ? el.reportFailure() : (evt.detail.type === 'error' || evt.detail.type.startsWith('datastar-patch')) && el.reportSuccess()" } }" description="The Kotlin recipe from the connection-status page, in kotlinx.html. Needs import kotlinx.html.* and no.lotek.html.*; the names from no.lotek are imported when it is inserted." toReformat="true" toShortenFQNames="true">
|
|
65
63
|
<context>
|
|
66
64
|
<option name="KOTLIN_TOPLEVEL" value="true" />
|
|
67
65
|
</context>
|
package/manifest/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lo-tek/interfaces",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"description": "Framework-agnostic design system: tokens, CSS components and web components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "August Søberg-Klyver",
|
|
@@ -367,14 +367,14 @@
|
|
|
367
367
|
"access": "public"
|
|
368
368
|
},
|
|
369
369
|
"scripts": {
|
|
370
|
-
"generate": "bun scripts/generate-matrix.ts && bun scripts/generate-tokens.ts && bun scripts/generate-tailwind.ts && bun scripts/generate-vocabulary.ts && bun scripts/generate-agent.ts && bun scripts/generate-manifest.ts",
|
|
370
|
+
"generate": "bun scripts/extract-recipes.ts && bun scripts/generate-matrix.ts && bun scripts/generate-tokens.ts && bun scripts/generate-tailwind.ts && bun scripts/generate-vocabulary.ts && bun scripts/generate-agent.ts && bun scripts/generate-manifest.ts",
|
|
371
371
|
"build:css": "bun scripts/build-css.ts",
|
|
372
372
|
"pack": "bun run core && rm -rf dist && tsc -b --force && bun run build:css && npm pack --ignore-scripts",
|
|
373
373
|
"build:browser": "tsc -b && bun run build:css",
|
|
374
374
|
"vocabulary": "bun scripts/generate-vocabulary.ts",
|
|
375
375
|
"check:vocabulary": "bun scripts/check-vocabulary.ts",
|
|
376
376
|
"core": "bun ../core/scripts/build.ts && mkdir -p core && cp ../core/dist/lotek-core.wasm ../core/dist/lotek.wasm core/",
|
|
377
|
-
"build": "bun run core && bun run generate && rm -rf dist && tsc -b --force && bun run build:css && bun run check:exports && bun run check:server && bun run check:types && bun run check:writes && bun run check:test-files && bun run check:texts && bun run check:identifiers && bun run check:agent && bun run check:vocabulary && bun run check:css-witness && bun run check:wording && bun run check:cli && bun run check:version && bun run check:package",
|
|
377
|
+
"build": "bun run core && bun run generate && rm -rf dist && tsc -b --force && bun run build:css && bun run check:exports && bun run check:server && bun run check:types && bun run check:writes && bun run check:layers && bun run check:test-files && bun run check:texts && bun run check:identifiers && bun run check:agent && bun run check:vocabulary && bun run check:css-witness && bun run check:wording && bun run check:cli && bun run check:version && bun run check:package",
|
|
378
378
|
"typecheck": "tsc --noEmit",
|
|
379
379
|
"typecheck:tests": "tsc --noEmit -p tsconfig.tests.json",
|
|
380
380
|
"test:browser": "vitest --config vitest.config.ts --run",
|
|
@@ -391,6 +391,7 @@
|
|
|
391
391
|
"check:package": "publint",
|
|
392
392
|
"prepublishOnly": "bun run build",
|
|
393
393
|
"check:writes": "bun scripts/check-writes.ts",
|
|
394
|
+
"check:layers": "bun scripts/check-layers.ts",
|
|
394
395
|
"check:test-files": "bun scripts/check-test-files.ts",
|
|
395
396
|
"check:identifiers": "bun scripts/check-identifiers.ts",
|
|
396
397
|
"typecheck:scripts": "tsc --noEmit -p scripts/tsconfig.json",
|
|
@@ -411,7 +412,10 @@
|
|
|
411
412
|
"publint": "^0.3.24",
|
|
412
413
|
"react": "19",
|
|
413
414
|
"react-dom": "19",
|
|
415
|
+
"remark-mdx": "3.1.1",
|
|
416
|
+
"remark-parse": "11.0.0",
|
|
414
417
|
"tailwindcss": "4.3.0",
|
|
418
|
+
"unified": "11.0.5",
|
|
415
419
|
"vite": "7.3.7",
|
|
416
420
|
"vitest": "4.1.12"
|
|
417
421
|
}
|