@ultimat3/ui 9.0.0 → 10.0.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/package.json +5 -5
- package/src/components/ErrorState.tsx +6 -3
- package/src/errors.ts +0 -1
- package/src/fake-dom.ts +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "SolidJS design system: semantic design tokens, dark/RTL-ready SCSS modules, a11y primitives",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"icons": "bun run src/icons/build-icons.ts"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@ultimat3/core": "
|
|
48
|
-
"@ultimat3/i18n": "
|
|
49
|
-
"@ultimat3/money": "
|
|
50
|
-
"@ultimat3/time": "
|
|
47
|
+
"@ultimat3/core": "10.0.0",
|
|
48
|
+
"@ultimat3/i18n": "10.0.0",
|
|
49
|
+
"@ultimat3/money": "10.0.0",
|
|
50
|
+
"@ultimat3/time": "10.0.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"solid-js": "^1.9.0"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// code, cause, fix. Identical text in the CLI, the overlay, and `--json` is the
|
|
3
3
|
// whole point of the error contract — this component must not paraphrase.
|
|
4
4
|
|
|
5
|
-
import { isUltimateError, renderCauseValue } from '@ultimat3/core';
|
|
5
|
+
import { describeErrorCode, isUltimateError, renderCauseValue } from '@ultimat3/core';
|
|
6
6
|
import type { JSX } from 'solid-js';
|
|
7
7
|
import { cx } from '../cx';
|
|
8
8
|
import { UI_KEYS } from '../i18n-keys';
|
|
@@ -44,15 +44,18 @@ export function errorParts(error: unknown): ErrorParts {
|
|
|
44
44
|
// blank tree. Laundering it through a local `message` is exactly what `scripts/error-render.ts`
|
|
45
45
|
// says it cannot see, which is why this one shipped.
|
|
46
46
|
const message = error instanceof Error ? error.message : renderCauseValue(error);
|
|
47
|
+
// Title and docs come from core's registry, never a hand-copy: this screen must read exactly
|
|
48
|
+
// as `x errors explain X_INTERNAL` does, and there is one docs URL for every code.
|
|
49
|
+
const described = describeErrorCode('X_INTERNAL');
|
|
47
50
|
return {
|
|
48
51
|
code: 'X_INTERNAL',
|
|
49
|
-
title:
|
|
52
|
+
title: described.title,
|
|
50
53
|
cause: message,
|
|
51
54
|
// No command can name a throw site the framework never saw typed. The one repair is at the
|
|
52
55
|
// throw itself, which is also the repo's own rule — never a bare Error — so the fix says that
|
|
53
56
|
// rather than sending the reader to a log that holds the same message this screen already has.
|
|
54
57
|
fix: 'throw an UltimateError subclass where this failed — new UltimateError({ code, cause, fix }) — so this screen renders that code and its fix instead of X_INTERNAL',
|
|
55
|
-
docs:
|
|
58
|
+
docs: described.docs,
|
|
56
59
|
};
|
|
57
60
|
}
|
|
58
61
|
|
package/src/errors.ts
CHANGED
package/src/fake-dom.ts
CHANGED
|
@@ -76,8 +76,15 @@ export class FakeElement extends Listeners {
|
|
|
76
76
|
this.attrs['tabindex'] = String(value);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/**
|
|
80
|
+
* `Object.hasOwn`, never the read alone: `attrs` is a `{...spread}`, so
|
|
81
|
+
* `attrs['constructor']` answered with the `Object` FUNCTION where a real
|
|
82
|
+
* `Element.getAttribute` answers `null` — and `attrMatches` decides presence with
|
|
83
|
+
* `getAttribute(inner) !== null`, so `querySelectorAll('[constructor]')` matched every
|
|
84
|
+
* element in the tree. A fake that disagrees with the DOM makes every suite built on it lie.
|
|
85
|
+
*/
|
|
79
86
|
getAttribute(name: string): string | null {
|
|
80
|
-
return this.attrs[name] ?? null;
|
|
87
|
+
return Object.hasOwn(this.attrs, name) ? (this.attrs[name] ?? null) : null;
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
append(...children: readonly FakeElement[]): FakeElement {
|