@xoong/cli 0.0.41 → 0.0.42

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoong/cli",
3
- "version": "0.0.41",
3
+ "version": "0.0.42",
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.41",
21
- "@xoong/core": "0.0.41",
22
- "@xoong/i18n": "0.0.41"
20
+ "@xoong/server": "0.0.42",
21
+ "@xoong/core": "0.0.42",
22
+ "@xoong/i18n": "0.0.42"
23
23
  },
24
24
  "files": [
25
25
  "src"
@@ -42,7 +42,7 @@
42
42
  "bugs": {
43
43
  "url": "https://github.com/fpt-duongtx/xoong/issues"
44
44
  },
45
- "homepage": "https://github.com/fpt-duongtx/xoong#readme",
45
+ "homepage": "https://fpt-duongtx.github.io/xoong/",
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  }
@@ -1,7 +1,7 @@
1
1
  // @ts-check
2
2
  /**
3
3
  * OpenAPI request schema -> the compact node tree that forms use at runtime (`bodySchema` in operations.json; see
4
- * packages/data/src/schema.js for the node shapes and docs/decisions/0009-forms-from-the-api-schema.md).
4
+ * packages/forms/src/schema.js for the node shapes and docs/decisions/0009-forms-from-the-api-schema.md).
5
5
  */
6
6
 
7
7
  const refName = (r) => r.slice(r.lastIndexOf('/') + 1);
package/src/html-data.js CHANGED
@@ -66,6 +66,18 @@ export const ELEMENT_DOCS = {
66
66
  'xo-file': ['A file field with a drop zone (@xoong/controls). The value is a File (an array with `multiple`). Refused files fire `xo-file-reject`.', [['name', 'Form field path.'], ['label', 'Accessible name.'], ['accept', 'Allowed types: `image/*`, `.pdf`.'], ['max-size', 'Largest file: bytes or `2MB`.'], ['multiple', 'Several files.'], ['hint', 'Text under the prompt.']]],
67
67
  'xo-command': ['A command palette (@xoong/controls): Ctrl/Cmd+K, type to filter, arrows, Enter. The children (links, buttons with `data-group`) are the commands. Fires `xo-command-run`.', [['shortcut', 'The key used with Ctrl/Cmd (default `k`).'], ['label', 'Accessible name of the dialog.']]],
68
68
  'xo-chart': ['A bar or line chart drawn from data, with a table of the same numbers (@xoong/controls).', [['type', '`bar` (default) or `line`.'], ['label', 'Accessible name of the chart.'], ['data', 'JSON: `[{"label":"Mon","value":12}]` or `[12, 18]`; or set `el.rows`.'], ['unit', 'Appended to values: `k`, `%`.'], ['heading', 'Label column of the table.'], ['value-heading', 'Value column of the table.']]],
69
+ 'xo-range-slider': ['A minimum and a maximum on one track (@xoong/controls): two native range inputs, thumbs cannot cross. The value is `[min, max]`; the attribute is `value="20,70"`.', [['name', 'Form field path.'], ['label', 'Accessible name of the group.'], ['min', 'Lowest value (default 0).'], ['max', 'Highest value (default 100).'], ['step', 'Step (default 1).'], ['min-label', 'Accessible name of the minimum thumb.'], ['max-label', 'Accessible name of the maximum thumb.']]],
70
+ 'xo-segmented': ['A group of buttons where one is chosen (@xoong/controls). The children `<button value>` are the segments; `aria-pressed` on each; arrows move the focus.', [['name', 'Form field path.'], ['label', 'Accessible name of the group.'], ['multiple', 'Each segment toggles on its own; the value is an array.'], ['clearable', 'A click on the chosen segment unchooses it.']]],
71
+ 'xo-split-button': ['A main action with a menu of related actions (@xoong/controls). The first child is the main button; the others are the menu items.', [['more', 'Accessible name of the arrow button (default "More options").']]],
72
+ 'xo-textarea': ['A textarea with a character counter and a thin progress bar toward `maxlength` (@xoong/controls); over the limit it is invalid and the text is kept.', [['name', 'Form field path.'], ['label', 'Accessible name.'], ['maxlength', 'Character limit.'], ['rows', 'Visible rows (default 3).'], ['placeholder', 'Hint text of the empty field.']]],
73
+ 'xo-stat': ['A KPI tile (@xoong/controls): label, value, a change against before and a sparkline from a series.', [['label', 'What is measured.'], ['value', 'The number as text (formatted by you).'], ['delta', 'Change in percent; positive shows an up arrow, negative a down arrow.'], ['delta-label', 'Text after the change, e.g. "vs last week".'], ['series', 'Comma-separated numbers for the sparkline.'], ['trend', '`down-is-good` when a fall is an improvement.']]],
74
+ 'xo-otp': ['One-time code: one box per digit (@xoong/controls); the value is the digit string; fires `complete` when all are filled. Paste splits across the boxes.', [['name', 'Form field path.'], ['label', 'Accessible name of the group.'], ['length', 'Number of digits (default 6).'], ['value', 'The start value.'], ['required', 'Must be filled.'], ['disabled', 'Not available.'], ['readonly', 'Shown but not changeable.']]],
75
+ 'xo-avatar': ['A round badge with initials from the name, or a picture (@xoong/controls); `aria-label` is the name and the status.', [['name', 'Full name (initials and accessible name).'], ['src', 'Picture URL; the initials stay when it fails.'], ['size', '`sm` or `lg`.'], ['status', '`ok`, `warn` or `muted`.']]],
76
+ 'xo-avatars': ['A stack of avatars with a +N badge for the rest (@xoong/controls); a list.', [['max', 'How many to show.'], ['label', 'Accessible name of the list.']]],
77
+ 'xo-progress': ['A progress bar (@xoong/controls); no `value` means indeterminate.', [['value', 'Current amount.'], ['max', 'Full amount (default 100).'], ['label', 'Accessible name.'], ['thin', 'The thin variant.']]],
78
+ 'xo-spinner': ['A loading spinner (@xoong/controls), `role=status`; `label=""` makes it decorative.', [['label', 'What is loading.'], ['size', '`md` or `lg`.']]],
79
+ 'xo-steps': ['Progress through a flow of steps (@xoong/controls): the children are the step titles; `aria-current=step` marks the current one; done steps show a check.', [['current', 'Index of the current step (from 0).'], ['label', 'Accessible name of the list.']]],
80
+ 'xo-inline-edit': ['Text you rename in place (@xoong/controls): select it or press the Rename button; Enter saves, Escape cancels. Fires `save` and `cancel`.', [['name', 'Form field path.'], ['value', 'The text.'], ['label', 'Accessible name of the Rename button.'], ['disabled', 'Not available.'], ['readonly', 'Not editable.']]],
69
81
  'xo-dialog': ['A modal on the native <dialog>. Open it with xo-open, close it with xo-close or by submitting a form inside.', []],
70
82
  };
71
83
 
package/src/openapi.js CHANGED
@@ -293,7 +293,7 @@ export function analyze(doc, { hints } = {}) {
293
293
  const lost = [];
294
294
  const builtBodyNode = bodySchema && !multipart ? bodySchemaOf(bodySchema, schemas, hints, lost) : undefined;
295
295
  const builtBody = () => builtBodyNode;
296
- for (const where of new Set(lost)) problems.push({ level: 'warn', code: 'XO161', where: `${method.toUpperCase()} ${path}`, message: `a union in ${where} cannot be told apart, so a generated form draws it as free-form`, fix: 'Add a discriminator (propertyName) or give each member a property with one fixed value (const or a one-value enum)' });
296
+ for (const where of new Set(lost)) problems.push({ level: 'warn', code: 'XO161', where: `${method.toUpperCase()} ${path}`, message: `a union in ${where} cannot be told apart, so a generated form draws it as free-form`, fix: 'Add a discriminator (propertyName; inline members also need the fixed value of that property) or give each member a property with a different fixed value (const or a one-value enum)' });
297
297
  operations[id] = {
298
298
  id, method: method.toUpperCase(), path,
299
299
  ...(params.some((p) => p.in === 'query') ? { query: params.filter((p) => p.in === 'query').map((p) => p.name) } : {}),