@xoong/cli 0.0.36 → 0.0.39
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/package.json +4 -4
- package/src/check.js +2 -0
- package/src/html-data.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xoong/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"description": "The xoong command line: sync (OpenAPI to typed operations), doctor, check (lint screens), dev, build (strict-CSP static output), render and i18n.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"parse5": "^8.1.0",
|
|
19
19
|
"yaml": "^2.8.0",
|
|
20
|
-
"@xoong/server": "0.0.
|
|
21
|
-
"@xoong/core": "0.0.
|
|
22
|
-
"@xoong/i18n": "0.0.
|
|
20
|
+
"@xoong/server": "0.0.39",
|
|
21
|
+
"@xoong/core": "0.0.39",
|
|
22
|
+
"@xoong/i18n": "0.0.39"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"src"
|
package/src/check.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* XO222 <form xo-submit> outside an <xo-view> (it never binds)
|
|
12
12
|
* XO221 empty xo-each / xo-if / xo-body expression
|
|
13
13
|
* XO230 unknown xo-* attribute or element (with the closest match)
|
|
14
|
+
* XO242 <xo-image> without an alt attribute (alt="" is a decorative image)
|
|
14
15
|
* XO240 button/link triggered by xo-click has no accessible name
|
|
15
16
|
* XO241 xo-click on a non-interactive element (not reachable by keyboard)
|
|
16
17
|
* XO250 <xo-table sortable|page-size> but the view's operation lacks the query parameters (sort | limit, offset)
|
|
@@ -108,6 +109,7 @@ export function checkHtml(source, table, file = '<input>') {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
}
|
|
112
|
+
if (tag === 'xo-image' && attr(node, 'alt') === undefined) report('warn', 'XO242', node, undefined, '<xo-image> has no alt attribute', 'Describe the image in alt, or write alt="" when it is decorative');
|
|
111
113
|
if (tag === 'xo-table') {
|
|
112
114
|
const op = view && attr(view, 'get') ? ops.get((v => (v.startsWith('/') ? `GET ${v}` : v.replace(/\s+/g, ' ')))(attr(view, 'get').value.trim())) : undefined;
|
|
113
115
|
if (!view || !attr(view, 'get')) report('error', 'XO251', node, undefined, '<xo-table> is not inside an <xo-view get="...">', 'Wrap it: <xo-view get="/things"><xo-table ...></xo-table></xo-view>');
|
package/src/html-data.js
CHANGED
|
@@ -24,6 +24,7 @@ export const ATTRIBUTE_DOCS = {
|
|
|
24
24
|
'xo-with': 'On xo-click/xo-submit: fixed fields added to the request body, `field=value,other={path}` (typed from the request schema).',
|
|
25
25
|
'xo-confirm': 'On xo-click/xo-submit: ask before running, with a native dialog. `{path}` names the item: `xo-confirm="Delete {title}?"`.',
|
|
26
26
|
'xo-notice': 'On xo-click/xo-submit: after success, show this message in <xo-toast> (`{path}` and `{$selectedCount}` work).',
|
|
27
|
+
'xo-then': 'On xo-click/xo-submit: after success, go to this path; `{id}` comes from the result (a created record), then from the item acted on: `xo-then="/articles/{id}"`, or `xo-then="/articles"` after a delete. <xo-router> navigates.',
|
|
27
28
|
'xo-guard': 'On a <form xo-submit>: with unsaved changes the router asks before the page is left. `xo-guard="off"` disables it; any other text is the question to ask.',
|
|
28
29
|
'xo-route': 'On a <template> inside <xo-router>: the path this route answers, for example `/users/:id`; `*` is the not-found route. The content is inert until the route matches.',
|
|
29
30
|
'xo-layout': 'On a <template> inside <xo-router>: a layout (shell) that routes use with `layout="name"`. It must contain one element with xo-outlet.',
|
|
@@ -56,6 +57,7 @@ export const ELEMENT_DOCS = {
|
|
|
56
57
|
'xo-stepper': ['A number with minus and plus buttons (@xoong/controls); arrows change by step, Page by ten steps, the value is clamped.', [['name', 'Form field path.'], ['label', 'Accessible name.'], ['min', 'Lowest value.'], ['max', 'Highest value.'], ['step', 'Step (default 1).']]],
|
|
57
58
|
'xo-password': ['A password field with a show/hide button (@xoong/controls).', [['name', 'Form field path.'], ['label', 'Accessible name.'], ['autocomplete', '`new-password` or `current-password`, for password managers.'], ['placeholder', 'Hint text of the empty field.']]],
|
|
58
59
|
'xo-copy': ['A read-only value with a Copy button (@xoong/controls); fires `copied`.', [['value', 'The text to show and copy.'], ['label', 'Accessible name of the field.']]],
|
|
60
|
+
'xo-image': ['An image that loads lazily, keeps its space (no layout jump), shows a placeholder while loading and a fallback on error (@xoong/controls). `data-state`: empty, loading, loaded, error.', [['src', 'The image URL (in an xo-view: `src="{cover.url}"`).'], ['alt', 'Required: the text for the image, or `alt=""` when it is decorative.'], ['width', 'Intrinsic width, reserves the space with height.'], ['height', 'Intrinsic height.'], ['ratio', 'Aspect ratio to reserve instead of width/height: `16/9`, `1.5`.'], ['fit', '`cover` (default) or `contain`.'], ['position', 'object-position, e.g. `top`.'], ['srcset', 'Responsive sources, passed to the img.'], ['sizes', 'Display sizes for srcset.'], ['priority', 'The image above the fold: loads at once with high priority (not lazy).'], ['loading', '`lazy` (default) or `eager`.'], ['fallback', 'A src to use once when the image fails.']]],
|
|
59
61
|
'xo-dialog': ['A modal on the native <dialog>. Open it with xo-open, close it with xo-close or by submitting a form inside.', []],
|
|
60
62
|
};
|
|
61
63
|
|