@fusion.dev/helix-core 0.135.0 → 0.137.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 +148 -1
- package/dist/helix-element/helix-element.js +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/utils/report-usage/report-usage.d.ts +42 -0
- package/dist/utils/report-usage/report-usage.js +25 -0
- package/dist/version.d.ts +9 -0
- package/dist/version.js +1 -0
- package/package.json +4 -4
package/custom-elements.json
CHANGED
|
@@ -8078,6 +8078,38 @@
|
|
|
8078
8078
|
"module": "./utils/relative-time/relative-time.js"
|
|
8079
8079
|
}
|
|
8080
8080
|
},
|
|
8081
|
+
{
|
|
8082
|
+
"kind": "js",
|
|
8083
|
+
"name": "noteVersion",
|
|
8084
|
+
"declaration": {
|
|
8085
|
+
"name": "noteVersion",
|
|
8086
|
+
"module": "./utils/report-usage/report-usage.js"
|
|
8087
|
+
}
|
|
8088
|
+
},
|
|
8089
|
+
{
|
|
8090
|
+
"kind": "js",
|
|
8091
|
+
"name": "reportUsage",
|
|
8092
|
+
"declaration": {
|
|
8093
|
+
"name": "reportUsage",
|
|
8094
|
+
"module": "./utils/report-usage/report-usage.js"
|
|
8095
|
+
}
|
|
8096
|
+
},
|
|
8097
|
+
{
|
|
8098
|
+
"kind": "js",
|
|
8099
|
+
"name": "USAGE_SLOT",
|
|
8100
|
+
"declaration": {
|
|
8101
|
+
"name": "USAGE_SLOT",
|
|
8102
|
+
"module": "./utils/report-usage/report-usage.js"
|
|
8103
|
+
}
|
|
8104
|
+
},
|
|
8105
|
+
{
|
|
8106
|
+
"kind": "js",
|
|
8107
|
+
"name": "VERSIONS_SLOT",
|
|
8108
|
+
"declaration": {
|
|
8109
|
+
"name": "VERSIONS_SLOT",
|
|
8110
|
+
"module": "./utils/report-usage/report-usage.js"
|
|
8111
|
+
}
|
|
8112
|
+
},
|
|
8081
8113
|
{
|
|
8082
8114
|
"kind": "js",
|
|
8083
8115
|
"name": "reportValues",
|
|
@@ -8365,6 +8397,14 @@
|
|
|
8365
8397
|
"name": "writtenNumbers",
|
|
8366
8398
|
"module": "./utils/written-list/written-list.js"
|
|
8367
8399
|
}
|
|
8400
|
+
},
|
|
8401
|
+
{
|
|
8402
|
+
"kind": "js",
|
|
8403
|
+
"name": "VERSION",
|
|
8404
|
+
"declaration": {
|
|
8405
|
+
"name": "VERSION",
|
|
8406
|
+
"module": "./version.js"
|
|
8407
|
+
}
|
|
8368
8408
|
}
|
|
8369
8409
|
]
|
|
8370
8410
|
},
|
|
@@ -14312,6 +14352,84 @@
|
|
|
14312
14352
|
}
|
|
14313
14353
|
]
|
|
14314
14354
|
},
|
|
14355
|
+
{
|
|
14356
|
+
"kind": "javascript-module",
|
|
14357
|
+
"path": "src/utils/report-usage/report-usage.ts",
|
|
14358
|
+
"declarations": [
|
|
14359
|
+
{
|
|
14360
|
+
"kind": "variable",
|
|
14361
|
+
"name": "USAGE_SLOT",
|
|
14362
|
+
"description": "The key the listener is kept under. `@fusion.dev/helix-diagnostics` names the same string."
|
|
14363
|
+
},
|
|
14364
|
+
{
|
|
14365
|
+
"kind": "variable",
|
|
14366
|
+
"name": "VERSIONS_SLOT",
|
|
14367
|
+
"description": "The key the loaded versions are listed under: every copy of core on the\npage adds its own once, so a page holding two copies lists two.\n`@fusion.dev/helix-diagnostics` compares the list with the version its\nmanifest names.\n\n**On `globalThis` and not on the element classes**, where a field would be\nlisted as a member of every component in the manifest and on every\nreference page."
|
|
14368
|
+
},
|
|
14369
|
+
{
|
|
14370
|
+
"kind": "function",
|
|
14371
|
+
"name": "noteVersion",
|
|
14372
|
+
"return": {
|
|
14373
|
+
"type": {
|
|
14374
|
+
"text": "void"
|
|
14375
|
+
}
|
|
14376
|
+
},
|
|
14377
|
+
"description": "Adds this copy's version to the page's list, once."
|
|
14378
|
+
},
|
|
14379
|
+
{
|
|
14380
|
+
"kind": "function",
|
|
14381
|
+
"name": "reportUsage",
|
|
14382
|
+
"return": {
|
|
14383
|
+
"type": {
|
|
14384
|
+
"text": "void"
|
|
14385
|
+
}
|
|
14386
|
+
},
|
|
14387
|
+
"parameters": [
|
|
14388
|
+
{
|
|
14389
|
+
"name": "element",
|
|
14390
|
+
"type": {
|
|
14391
|
+
"text": "HTMLElement"
|
|
14392
|
+
}
|
|
14393
|
+
}
|
|
14394
|
+
],
|
|
14395
|
+
"description": "Tells the listener, where there is one, that `element` has rendered for the\nfirst time.\n\n**A listener that throws never breaks the element.** The error is thrown\nagain on a later microtask, so it reaches the console and the page's error\nhandlers, and the render that called this finishes as if nothing listened."
|
|
14396
|
+
}
|
|
14397
|
+
],
|
|
14398
|
+
"exports": [
|
|
14399
|
+
{
|
|
14400
|
+
"kind": "js",
|
|
14401
|
+
"name": "USAGE_SLOT",
|
|
14402
|
+
"declaration": {
|
|
14403
|
+
"name": "USAGE_SLOT",
|
|
14404
|
+
"module": "src/utils/report-usage/report-usage.ts"
|
|
14405
|
+
}
|
|
14406
|
+
},
|
|
14407
|
+
{
|
|
14408
|
+
"kind": "js",
|
|
14409
|
+
"name": "VERSIONS_SLOT",
|
|
14410
|
+
"declaration": {
|
|
14411
|
+
"name": "VERSIONS_SLOT",
|
|
14412
|
+
"module": "src/utils/report-usage/report-usage.ts"
|
|
14413
|
+
}
|
|
14414
|
+
},
|
|
14415
|
+
{
|
|
14416
|
+
"kind": "js",
|
|
14417
|
+
"name": "noteVersion",
|
|
14418
|
+
"declaration": {
|
|
14419
|
+
"name": "noteVersion",
|
|
14420
|
+
"module": "src/utils/report-usage/report-usage.ts"
|
|
14421
|
+
}
|
|
14422
|
+
},
|
|
14423
|
+
{
|
|
14424
|
+
"kind": "js",
|
|
14425
|
+
"name": "reportUsage",
|
|
14426
|
+
"declaration": {
|
|
14427
|
+
"name": "reportUsage",
|
|
14428
|
+
"module": "src/utils/report-usage/report-usage.ts"
|
|
14429
|
+
}
|
|
14430
|
+
}
|
|
14431
|
+
]
|
|
14432
|
+
},
|
|
14315
14433
|
{
|
|
14316
14434
|
"kind": "javascript-module",
|
|
14317
14435
|
"path": "src/utils/report-values/report-values.ts",
|
|
@@ -15326,6 +15444,35 @@
|
|
|
15326
15444
|
}
|
|
15327
15445
|
}
|
|
15328
15446
|
]
|
|
15447
|
+
},
|
|
15448
|
+
{
|
|
15449
|
+
"kind": "javascript-module",
|
|
15450
|
+
"path": "src/version.ts",
|
|
15451
|
+
"declarations": [
|
|
15452
|
+
{
|
|
15453
|
+
"kind": "variable",
|
|
15454
|
+
"name": "VERSION",
|
|
15455
|
+
"type": {
|
|
15456
|
+
"text": "string"
|
|
15457
|
+
},
|
|
15458
|
+
"default": "'0.137.0'",
|
|
15459
|
+
"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."
|
|
15460
|
+
}
|
|
15461
|
+
],
|
|
15462
|
+
"exports": [
|
|
15463
|
+
{
|
|
15464
|
+
"kind": "js",
|
|
15465
|
+
"name": "VERSION",
|
|
15466
|
+
"declaration": {
|
|
15467
|
+
"name": "VERSION",
|
|
15468
|
+
"module": "src/version.ts"
|
|
15469
|
+
}
|
|
15470
|
+
}
|
|
15471
|
+
]
|
|
15329
15472
|
}
|
|
15330
|
-
]
|
|
15473
|
+
],
|
|
15474
|
+
"helix": {
|
|
15475
|
+
"package": "@fusion.dev/helix-core",
|
|
15476
|
+
"version": "0.137.0"
|
|
15477
|
+
}
|
|
15331
15478
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { css, LitElement } from 'lit';
|
|
2
2
|
import { unsafeStatic } from 'lit/static-html.js';
|
|
3
|
+
import { noteVersion, reportUsage } from '../utils/report-usage/report-usage.js';
|
|
3
4
|
import { applyReactProperties, auditReactProps, bindReactHandler, reactPropsOf, } from './react-bridge.js';
|
|
4
5
|
const BOX_SIZING = css `
|
|
5
6
|
*,
|
|
@@ -114,6 +115,7 @@ export class HelixElement extends LitElement {
|
|
|
114
115
|
}
|
|
115
116
|
firstUpdated(changed) {
|
|
116
117
|
super.firstUpdated(changed);
|
|
118
|
+
reportUsage(this);
|
|
117
119
|
let applied = applyReactProperties(this);
|
|
118
120
|
requestAnimationFrame(() => {
|
|
119
121
|
this.toggleState('settled', true);
|
|
@@ -146,3 +148,4 @@ export const whenHydrated = (element, write) => {
|
|
|
146
148
|
write();
|
|
147
149
|
}
|
|
148
150
|
};
|
|
151
|
+
noteVersion();
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export { onUnlessFalse } from './utils/on-unless-false/on-unless-false.js';
|
|
|
63
63
|
export { type ColorBytes, readColor } from './utils/read-color/read-color.js';
|
|
64
64
|
export { type Row, type RowCell, readRows, readSeries, type Series, type SeriesPoint, } from './utils/read-series/read-series.js';
|
|
65
65
|
export { type Relative, relativeTime, } from './utils/relative-time/relative-time.js';
|
|
66
|
+
export { noteVersion, reportUsage, USAGE_SLOT, VERSIONS_SLOT, } from './utils/report-usage/report-usage.js';
|
|
66
67
|
export { reportValues } from './utils/report-values/report-values.js';
|
|
67
68
|
export { type ChangeRequestOptions, requestChange, } from './utils/request-change/request-change.js';
|
|
68
69
|
export { type ActivatableItem, resolveActiveItem, } from './utils/resolve-active-item/resolve-active-item.js';
|
|
@@ -80,3 +81,4 @@ export { dateAsValue, isDateValue, isTimeValue, minutesAsValue, numberAsValue, t
|
|
|
80
81
|
export { watchTheme } from './utils/watch-theme/watch-theme.js';
|
|
81
82
|
export { writeTime } from './utils/write-time/write-time.js';
|
|
82
83
|
export { writtenList, writtenNumbers } from './utils/written-list/written-list.js';
|
|
84
|
+
export { VERSION } from './version.js';
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,7 @@ export { onUnlessFalse } from './utils/on-unless-false/on-unless-false.js';
|
|
|
63
63
|
export { readColor } from './utils/read-color/read-color.js';
|
|
64
64
|
export { readRows, readSeries, } from './utils/read-series/read-series.js';
|
|
65
65
|
export { relativeTime, } from './utils/relative-time/relative-time.js';
|
|
66
|
+
export { noteVersion, reportUsage, USAGE_SLOT, VERSIONS_SLOT, } from './utils/report-usage/report-usage.js';
|
|
66
67
|
export { reportValues } from './utils/report-values/report-values.js';
|
|
67
68
|
export { requestChange, } from './utils/request-change/request-change.js';
|
|
68
69
|
export { resolveActiveItem, } from './utils/resolve-active-item/resolve-active-item.js';
|
|
@@ -80,3 +81,4 @@ export { dateAsValue, isDateValue, isTimeValue, minutesAsValue, numberAsValue, t
|
|
|
80
81
|
export { watchTheme } from './utils/watch-theme/watch-theme.js';
|
|
81
82
|
export { writeTime } from './utils/write-time/write-time.js';
|
|
82
83
|
export { writtenList, writtenNumbers } from './utils/written-list/written-list.js';
|
|
84
|
+
export { VERSION } from './version.js';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a rendered element is told to whoever is counting usage.
|
|
3
|
+
*
|
|
4
|
+
* **One slot on `globalThis`, under a registered symbol, and empty by default.**
|
|
5
|
+
* `@fusion.dev/helix-diagnostics` fills it from `watch()` and counts what
|
|
6
|
+
* renders: the tags, the axes set on them, and the named slots filled. With
|
|
7
|
+
* nothing in the slot, which is every page that has not asked, an element pays
|
|
8
|
+
* one property read and a type check once, after its first render.
|
|
9
|
+
*
|
|
10
|
+
* **A registered symbol and not an export**, for two reasons. Diagnostics does
|
|
11
|
+
* not depend on the library it diagnoses, so it cannot import a setter from
|
|
12
|
+
* here, and a page holding two copies of Helix runs two copies of this module:
|
|
13
|
+
* `Symbol.for` is the one key both copies and the collector agree on, so every
|
|
14
|
+
* copy's elements are counted.
|
|
15
|
+
*
|
|
16
|
+
* **Counting only, never sending.** This module holds no network code and
|
|
17
|
+
* never will; what the listener does with an element is the listener's.
|
|
18
|
+
*/
|
|
19
|
+
/** The key the listener is kept under. `@fusion.dev/helix-diagnostics` names the same string. */
|
|
20
|
+
export declare const USAGE_SLOT: unique symbol;
|
|
21
|
+
/**
|
|
22
|
+
* The key the loaded versions are listed under: every copy of core on the
|
|
23
|
+
* page adds its own once, so a page holding two copies lists two.
|
|
24
|
+
* `@fusion.dev/helix-diagnostics` compares the list with the version its
|
|
25
|
+
* manifest names.
|
|
26
|
+
*
|
|
27
|
+
* **On `globalThis` and not on the element classes**, where a field would be
|
|
28
|
+
* listed as a member of every component in the manifest and on every
|
|
29
|
+
* reference page.
|
|
30
|
+
*/
|
|
31
|
+
export declare const VERSIONS_SLOT: unique symbol;
|
|
32
|
+
/** Adds this copy's version to the page's list, once. */
|
|
33
|
+
export declare const noteVersion: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Tells the listener, where there is one, that `element` has rendered for the
|
|
36
|
+
* first time.
|
|
37
|
+
*
|
|
38
|
+
* **A listener that throws never breaks the element.** The error is thrown
|
|
39
|
+
* again on a later microtask, so it reaches the console and the page's error
|
|
40
|
+
* handlers, and the render that called this finishes as if nothing listened.
|
|
41
|
+
*/
|
|
42
|
+
export declare const reportUsage: (element: HTMLElement) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VERSION } from '../../version.js';
|
|
2
|
+
export const USAGE_SLOT = Symbol.for('fusion.dev/helix/usage');
|
|
3
|
+
export const VERSIONS_SLOT = Symbol.for('fusion.dev/helix/versions');
|
|
4
|
+
export const noteVersion = () => {
|
|
5
|
+
const store = globalThis;
|
|
6
|
+
const listed = Array.isArray(store[VERSIONS_SLOT]) ? store[VERSIONS_SLOT] : [];
|
|
7
|
+
if (!listed.includes(VERSION)) {
|
|
8
|
+
listed.push(VERSION);
|
|
9
|
+
}
|
|
10
|
+
store[VERSIONS_SLOT] = listed;
|
|
11
|
+
};
|
|
12
|
+
export const reportUsage = (element) => {
|
|
13
|
+
const listener = globalThis[USAGE_SLOT];
|
|
14
|
+
if (typeof listener !== 'function') {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
listener(element);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
queueMicrotask(() => {
|
|
22
|
+
throw error;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The version of the package this file ships in.
|
|
3
|
+
*
|
|
4
|
+
* **Written by `fusion/scripts/version.mjs`** wherever it writes the package's
|
|
5
|
+
* `package.json`, and stamped back into the repository beside it after a
|
|
6
|
+
* release, so the two never disagree; a spec beside this holds them to it.
|
|
7
|
+
* Nothing else in the running code knows which release it is.
|
|
8
|
+
*/
|
|
9
|
+
export declare const VERSION = "0.137.0";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = '0.137.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.137.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ross Sheppard <ross.sheppard@fusion.dev>",
|
|
7
7
|
"repository": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@floating-ui/dom": "^1.8.0",
|
|
37
|
-
"@fusion.dev/helix-icons": "0.
|
|
37
|
+
"@fusion.dev/helix-icons": "0.137.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@fusion.dev/helix-cem": "0.
|
|
41
|
-
"@fusion.dev/helix-testing": "0.
|
|
40
|
+
"@fusion.dev/helix-cem": "0.137.0",
|
|
41
|
+
"@fusion.dev/helix-testing": "0.137.0",
|
|
42
42
|
"@lit-labs/ssr": "^4.1.0",
|
|
43
43
|
"lit": "^3.2.1"
|
|
44
44
|
},
|