@arbor-css/core 0.0.137 → 0.0.139
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/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/resolveRuntimeValue.d.ts +7 -0
- package/dist/runtime/resolveRuntimeValue.d.ts.map +1 -0
- package/dist/runtime/resolveRuntimeValue.js +17 -0
- package/dist/runtime/resolveRuntimeValue.js.map +1 -0
- package/package.json +8 -8
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { connect, getContext, getEnvValues, getPreset, getStyleSheet, ready, subscribeToEnvChanges, } from './registration.js';
|
|
2
|
+
export { loadSimplifier } from '@arbor-css/css-eval/browser';
|
|
3
|
+
export { resolveRuntimeValue } from './resolveRuntimeValue.js';
|
|
2
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,KAAK,EACL,qBAAqB,GACrB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,KAAK,EACL,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { connect, getContext, getEnvValues, getPreset, getStyleSheet, ready, subscribeToEnvChanges, } from './registration.js';
|
|
2
|
+
export { loadSimplifier } from '@arbor-css/css-eval/browser';
|
|
3
|
+
export { resolveRuntimeValue } from './resolveRuntimeValue.js';
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,KAAK,EACL,qBAAqB,GACrB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,KAAK,EACL,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TokenPurpose } from '@arbor-css/tokens';
|
|
2
|
+
export declare function resolveRuntimeValue(tokenName: string, options?: {
|
|
3
|
+
target?: HTMLElement;
|
|
4
|
+
simplifierPasses?: number;
|
|
5
|
+
tokenPurpose?: TokenPurpose;
|
|
6
|
+
}): Promise<string | null>;
|
|
7
|
+
//# sourceMappingURL=resolveRuntimeValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRuntimeValue.d.ts","sourceRoot":"","sources":["../../src/runtime/resolveRuntimeValue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,wBAAsB,mBAAmB,CACxC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACR,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,CAAC;CACqB,GAChD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { css } from '@arbor-css/css-eval';
|
|
2
|
+
import { loadSimplifier } from '@arbor-css/css-eval/browser';
|
|
3
|
+
export async function resolveRuntimeValue(tokenName, options = { simplifierPasses: 1, tokenPurpose: 'other' }) {
|
|
4
|
+
const style = getComputedStyle(options.target ?? document.documentElement);
|
|
5
|
+
const value = style.getPropertyValue(tokenName).trim();
|
|
6
|
+
if (!value) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const simplifier = await loadSimplifier({
|
|
10
|
+
passes: options.simplifierPasses ?? 1,
|
|
11
|
+
});
|
|
12
|
+
const simplified = simplifier(css `
|
|
13
|
+
${value}
|
|
14
|
+
`, { purpose: options.tokenPurpose });
|
|
15
|
+
return simplified;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=resolveRuntimeValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRuntimeValue.js","sourceRoot":"","sources":["../../src/runtime/resolveRuntimeValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,SAAiB,EACjB,UAII,EAAE,gBAAgB,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE;IAElD,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,MAAM,IAAI,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC3E,MAAM,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;IAEvD,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC;QACvC,MAAM,EAAE,OAAO,CAAC,gBAAgB,IAAI,CAAC;KACrC,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,UAAU,CAC5B,GAAG,CAAA;KACA,KAAK;GACP,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,CACjC,CAAC;IACF,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbor-css/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.139",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
"lil-gui": "^0.21.0",
|
|
56
56
|
"lit-element": "^4.2.2",
|
|
57
57
|
"yargs": "^18.0.0",
|
|
58
|
-
"@arbor-css/css-eval": "0.0.
|
|
59
|
-
"@arbor-css/
|
|
60
|
-
"@arbor-css/
|
|
61
|
-
"@arbor-css/
|
|
62
|
-
"@arbor-css/util": "0.0.
|
|
63
|
-
"@arbor-css/
|
|
64
|
-
"@arbor-css/
|
|
58
|
+
"@arbor-css/css-eval": "0.0.139",
|
|
59
|
+
"@arbor-css/functions": "0.0.139",
|
|
60
|
+
"@arbor-css/globals": "0.0.139",
|
|
61
|
+
"@arbor-css/modes": "0.0.139",
|
|
62
|
+
"@arbor-css/util": "0.0.139",
|
|
63
|
+
"@arbor-css/tokens": "0.0.139",
|
|
64
|
+
"@arbor-css/preset": "0.0.139"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "tsc",
|