@fusion.dev/helix-core 0.183.0 → 0.184.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/custom-elements.json +76 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/audit-children/audit-children-off.d.ts +3 -1
- package/dist/utils/audit-children/audit-children-off.js +1 -0
- package/dist/utils/audit-children/audit-children.d.ts +16 -0
- package/dist/utils/audit-children/audit-children.js +32 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/custom-elements.json
CHANGED
|
@@ -14159,6 +14159,14 @@
|
|
|
14159
14159
|
"package": "#audit-children"
|
|
14160
14160
|
}
|
|
14161
14161
|
},
|
|
14162
|
+
{
|
|
14163
|
+
"kind": "js",
|
|
14164
|
+
"name": "auditEntry",
|
|
14165
|
+
"declaration": {
|
|
14166
|
+
"name": "auditEntry",
|
|
14167
|
+
"package": "#audit-children"
|
|
14168
|
+
}
|
|
14169
|
+
},
|
|
14162
14170
|
{
|
|
14163
14171
|
"kind": "js",
|
|
14164
14172
|
"name": "auditName",
|
|
@@ -25953,6 +25961,14 @@
|
|
|
25953
25961
|
"type": {
|
|
25954
25962
|
"text": "typeof audit"
|
|
25955
25963
|
}
|
|
25964
|
+
},
|
|
25965
|
+
{
|
|
25966
|
+
"kind": "function",
|
|
25967
|
+
"name": "auditEntry",
|
|
25968
|
+
"description": "The missing-entry warning in a production build: nothing. See `auditEntry`.",
|
|
25969
|
+
"type": {
|
|
25970
|
+
"text": "typeof entry"
|
|
25971
|
+
}
|
|
25956
25972
|
}
|
|
25957
25973
|
],
|
|
25958
25974
|
"exports": [
|
|
@@ -25963,6 +25979,14 @@
|
|
|
25963
25979
|
"name": "auditChildren",
|
|
25964
25980
|
"module": "src/utils/audit-children/audit-children-off.ts"
|
|
25965
25981
|
}
|
|
25982
|
+
},
|
|
25983
|
+
{
|
|
25984
|
+
"kind": "js",
|
|
25985
|
+
"name": "auditEntry",
|
|
25986
|
+
"declaration": {
|
|
25987
|
+
"name": "auditEntry",
|
|
25988
|
+
"module": "src/utils/audit-children/audit-children-off.ts"
|
|
25989
|
+
}
|
|
25966
25990
|
}
|
|
25967
25991
|
]
|
|
25968
25992
|
},
|
|
@@ -26009,6 +26033,48 @@
|
|
|
26009
26033
|
}
|
|
26010
26034
|
],
|
|
26011
26035
|
"description": "Reports a child from another family that a container holds and nobody\nregistered, naming the entry to import.\n\n**A container does not register another family's children.** An option\nbelongs to the Option family, and a page writing one inside a Select imports\n`@fusion.dev/helix/option` itself, as it imports the Select. Left out, the\noption is an unknown element: the list reads no choices and nothing throws.\nThis says so, once for each container tag and child tag on the page, with\nthe line to add.\n\nAsked once the page has loaded and painted, so an entry a later module\nimports is not taken for a missing one.\n\n**In a development build only**, as `missing-name` is: every container would\npay for a sentence meant for the person writing the page. Core imports it as\n`#audit-children`, which `package.json` resolves here under the\n`development` condition and to `audit-children-off.ts`, which does nothing,\neverywhere else.\n\n`part` is the child's tag after the tier, such as `option`, and `entry` its\nfamily's entry, such as `option`; the host's `tier` gives the rest of both.\n`consequence` says what the missing child costs, after \"so\". `drawn` is for\nchildren the host draws from data, such as the options of Listbox's `items`:\nthe page wrote none, so an undefined tag is reported without one in the\nhost's light DOM."
|
|
26036
|
+
},
|
|
26037
|
+
{
|
|
26038
|
+
"kind": "function",
|
|
26039
|
+
"name": "auditEntry",
|
|
26040
|
+
"return": {
|
|
26041
|
+
"type": {
|
|
26042
|
+
"text": "void"
|
|
26043
|
+
}
|
|
26044
|
+
},
|
|
26045
|
+
"parameters": [
|
|
26046
|
+
{
|
|
26047
|
+
"name": "host",
|
|
26048
|
+
"type": {
|
|
26049
|
+
"text": "HTMLElement"
|
|
26050
|
+
}
|
|
26051
|
+
},
|
|
26052
|
+
{
|
|
26053
|
+
"name": "attribute",
|
|
26054
|
+
"type": {
|
|
26055
|
+
"text": "string"
|
|
26056
|
+
}
|
|
26057
|
+
},
|
|
26058
|
+
{
|
|
26059
|
+
"name": "entry",
|
|
26060
|
+
"type": {
|
|
26061
|
+
"text": "string"
|
|
26062
|
+
}
|
|
26063
|
+
},
|
|
26064
|
+
{
|
|
26065
|
+
"name": "consequence",
|
|
26066
|
+
"type": {
|
|
26067
|
+
"text": "string"
|
|
26068
|
+
}
|
|
26069
|
+
},
|
|
26070
|
+
{
|
|
26071
|
+
"name": "missing",
|
|
26072
|
+
"type": {
|
|
26073
|
+
"text": "() => boolean"
|
|
26074
|
+
}
|
|
26075
|
+
}
|
|
26076
|
+
],
|
|
26077
|
+
"description": "Reports a property set on a host whose behavior is in an entry of its own\nthat nobody imported, naming the entry.\n\n**The second shape of the same mistake.** Menu's filter is\n`menu/filter`, so a menu that never filters carries none of its code, and a\npage that sets `filterable` and imports only the menu gets a menu with no\nfield and nothing thrown. This says so, once for each host tag and entry on\nthe page, with the line to add.\n\n`attribute` is the one the page set, `entry` the entry after the tier's\npackage, such as `menu/filter`, and `consequence` what the missing entry\ncosts, after \"so\". `missing` is asked once the page has loaded and painted,\nso an entry a later module imports is not taken for a missing one."
|
|
26012
26078
|
}
|
|
26013
26079
|
],
|
|
26014
26080
|
"exports": [
|
|
@@ -26019,6 +26085,14 @@
|
|
|
26019
26085
|
"name": "auditChildren",
|
|
26020
26086
|
"module": "src/utils/audit-children/audit-children.ts"
|
|
26021
26087
|
}
|
|
26088
|
+
},
|
|
26089
|
+
{
|
|
26090
|
+
"kind": "js",
|
|
26091
|
+
"name": "auditEntry",
|
|
26092
|
+
"declaration": {
|
|
26093
|
+
"name": "auditEntry",
|
|
26094
|
+
"module": "src/utils/audit-children/audit-children.ts"
|
|
26095
|
+
}
|
|
26022
26096
|
}
|
|
26023
26097
|
]
|
|
26024
26098
|
},
|
|
@@ -35422,7 +35496,7 @@
|
|
|
35422
35496
|
"type": {
|
|
35423
35497
|
"text": "string"
|
|
35424
35498
|
},
|
|
35425
|
-
"default": "'0.
|
|
35499
|
+
"default": "'0.184.0'",
|
|
35426
35500
|
"description": "The version of the package this file ships in.\n\n**Written by `fusion/scripts/version.mjs`** wherever it writes the package's\n`package.json`, and stamped back into the repository beside it after a\nrelease, so the two never disagree; a spec beside this holds them to it.\nNothing else in the running code knows which release it is."
|
|
35427
35501
|
}
|
|
35428
35502
|
],
|
|
@@ -36058,6 +36132,6 @@
|
|
|
36058
36132
|
],
|
|
36059
36133
|
"helix": {
|
|
36060
36134
|
"package": "@fusion.dev/helix-core",
|
|
36061
|
-
"version": "0.
|
|
36135
|
+
"version": "0.184.0"
|
|
36062
36136
|
}
|
|
36063
36137
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { auditChildren } from '@fusion.dev/helix-core/audits/children';
|
|
1
|
+
export { auditChildren, auditEntry } from '@fusion.dev/helix-core/audits/children';
|
|
2
2
|
export { auditName } from '@fusion.dev/helix-core/audits/name';
|
|
3
3
|
export { auditNesting } from '@fusion.dev/helix-core/audits/nesting';
|
|
4
4
|
export { auditServed } from '@fusion.dev/helix-core/audits/served';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { auditChildren } from '@fusion.dev/helix-core/audits/children';
|
|
1
|
+
export { auditChildren, auditEntry } from '@fusion.dev/helix-core/audits/children';
|
|
2
2
|
export { auditName } from '@fusion.dev/helix-core/audits/name';
|
|
3
3
|
export { auditNesting } from '@fusion.dev/helix-core/audits/nesting';
|
|
4
4
|
export { auditServed } from '@fusion.dev/helix-core/audits/served';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { auditChildren as audit } from './audit-children.js';
|
|
1
|
+
import type { auditChildren as audit, auditEntry as entry } from './audit-children.js';
|
|
2
2
|
/**
|
|
3
3
|
* The unregistered-child warning in a production build: nothing.
|
|
4
4
|
*
|
|
@@ -8,3 +8,5 @@ import type { auditChildren as audit } from './audit-children.js';
|
|
|
8
8
|
* builds. See `audit-children.ts`.
|
|
9
9
|
*/
|
|
10
10
|
export declare const auditChildren: typeof audit;
|
|
11
|
+
/** The missing-entry warning in a production build: nothing. See `auditEntry`. */
|
|
12
|
+
export declare const auditEntry: typeof entry;
|
|
@@ -26,3 +26,19 @@
|
|
|
26
26
|
* host's light DOM.
|
|
27
27
|
*/
|
|
28
28
|
export declare const auditChildren: (host: HTMLElement, part: string, entry: string, consequence: string, drawn?: boolean) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Reports a property set on a host whose behavior is in an entry of its own
|
|
31
|
+
* that nobody imported, naming the entry.
|
|
32
|
+
*
|
|
33
|
+
* **The second shape of the same mistake.** Menu's filter is
|
|
34
|
+
* `menu/filter`, so a menu that never filters carries none of its code, and a
|
|
35
|
+
* page that sets `filterable` and imports only the menu gets a menu with no
|
|
36
|
+
* field and nothing thrown. This says so, once for each host tag and entry on
|
|
37
|
+
* the page, with the line to add.
|
|
38
|
+
*
|
|
39
|
+
* `attribute` is the one the page set, `entry` the entry after the tier's
|
|
40
|
+
* package, such as `menu/filter`, and `consequence` what the missing entry
|
|
41
|
+
* costs, after "so". `missing` is asked once the page has loaded and painted,
|
|
42
|
+
* so an entry a later module imports is not taken for a missing one.
|
|
43
|
+
*/
|
|
44
|
+
export declare const auditEntry: (host: HTMLElement, attribute: string, entry: string, consequence: string, missing: () => boolean) => void;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { reportRuntime } from '../report-runtime/report-runtime.js';
|
|
2
2
|
const reported = new Set();
|
|
3
|
+
const afterPaint = (check) => {
|
|
4
|
+
const frame = () => {
|
|
5
|
+
requestAnimationFrame(check);
|
|
6
|
+
};
|
|
7
|
+
if (document.readyState === 'complete') {
|
|
8
|
+
frame();
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
window.addEventListener('load', frame, { once: true });
|
|
12
|
+
}
|
|
13
|
+
};
|
|
3
14
|
export const auditChildren = (host, part, entry, consequence, drawn = false) => {
|
|
4
15
|
if (typeof window === 'undefined') {
|
|
5
16
|
return;
|
|
@@ -25,13 +36,27 @@ export const auditChildren = (host, part, entry, consequence, drawn = false) =>
|
|
|
25
36
|
tag: host.localName,
|
|
26
37
|
});
|
|
27
38
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
|
|
39
|
+
afterPaint(check);
|
|
40
|
+
};
|
|
41
|
+
export const auditEntry = (host, attribute, entry, consequence, missing) => {
|
|
42
|
+
if (typeof window === 'undefined') {
|
|
43
|
+
return;
|
|
33
44
|
}
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
const key = `${host.localName}>${entry}`;
|
|
46
|
+
if (reported.has(key)) {
|
|
47
|
+
return;
|
|
36
48
|
}
|
|
49
|
+
afterPaint(() => {
|
|
50
|
+
if (reported.has(key) || !host.isConnected || !missing()) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
reported.add(key);
|
|
54
|
+
const tier = host.constructor.tier ?? 'helix-headless-';
|
|
55
|
+
const pkg = tier === 'helix-' ? '@fusion.dev/helix' : '@fusion.dev/helix-headless';
|
|
56
|
+
reportRuntime({
|
|
57
|
+
kind: 'unregistered-part',
|
|
58
|
+
message: `<${host.localName}> has \`${attribute}\` and its entry is not imported, so ${consequence}. Import '${pkg}/${entry}'.`,
|
|
59
|
+
tag: host.localName,
|
|
60
|
+
});
|
|
61
|
+
});
|
|
37
62
|
};
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.184.0';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion.dev/helix-core",
|
|
3
3
|
"description": "Helix element primitives: base classes, mixins, decorators, utilities.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.184.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@floating-ui/dom": "^1.8.0",
|
|
77
|
-
"@fusion.dev/helix-icons": "0.
|
|
77
|
+
"@fusion.dev/helix-icons": "0.184.0",
|
|
78
78
|
"tslib": "^2.8.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@fusion.dev/helix-cem": "0.
|
|
82
|
-
"@fusion.dev/helix-testing": "0.
|
|
81
|
+
"@fusion.dev/helix-cem": "0.184.0",
|
|
82
|
+
"@fusion.dev/helix-testing": "0.184.0",
|
|
83
83
|
"@lit-labs/ssr": "^4.1.0",
|
|
84
84
|
"lit": "^3.2.1"
|
|
85
85
|
},
|