@navita/core 1.0.1 → 3.0.0-next.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/_virtual/_rolldown/runtime.cjs +23 -0
- package/createRenderer.cjs +49 -48
- package/createRenderer.d.ts +31 -24
- package/createRenderer.mjs +49 -46
- package/evaluateAndProcess.cjs +63 -67
- package/evaluateAndProcess.d.ts +44 -29
- package/evaluateAndProcess.mjs +64 -69
- package/helpers/createCompiledFunction.cjs +21 -27
- package/helpers/createCompiledFunction.mjs +20 -24
- package/helpers/createDefineFunction.cjs +75 -92
- package/helpers/createDefineFunction.mjs +74 -94
- package/helpers/magicProxy.cjs +4 -8
- package/helpers/magicProxy.mjs +6 -6
- package/helpers/setAdapter.cjs +42 -55
- package/helpers/setAdapter.mjs +44 -53
- package/package.json +6 -6
package/helpers/setAdapter.mjs
CHANGED
|
@@ -1,55 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
resultCache[filePath][index] = {
|
|
45
|
-
start,
|
|
46
|
-
end,
|
|
47
|
-
value: result === undefined ? "undefined" : JSON.stringify(result)
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { ClassList } from "@navita/engine";
|
|
5
|
+
import { setAdapter as setAdapter$1 } from "@navita/adapter";
|
|
6
|
+
//#region src/helpers/setAdapter.ts
|
|
7
|
+
function setAdapter({ engine, resultCache }) {
|
|
8
|
+
setAdapter$1({
|
|
9
|
+
generateIdentifier: (value) => engine.generateIdentifier(value),
|
|
10
|
+
addStaticCss: (selector, css) => engine.addStatic(selector, css),
|
|
11
|
+
addCss: (css) => engine.addStyle(css),
|
|
12
|
+
addKeyframe: (keyframe) => engine.addKeyframes(keyframe),
|
|
13
|
+
addFontFace: (fontFace) => {
|
|
14
|
+
if ((Array.isArray(fontFace) ? fontFace : [fontFace]).some((fontFace) => "fontFamily" in fontFace)) throw new Error("This function creates and returns a font-family name, so the \"fontFamily\" property should not be provided.");
|
|
15
|
+
return engine.addFontFace(fontFace);
|
|
16
|
+
},
|
|
17
|
+
collectResult({ index, filePath, identifier, result: resultFactory, sourceMap: { line, column }, position }) {
|
|
18
|
+
engine.setFilePath(filePath);
|
|
19
|
+
let result = resultFactory();
|
|
20
|
+
engine.setFilePath(void 0);
|
|
21
|
+
if (result instanceof ClassList) {
|
|
22
|
+
const extraClass = engine.addSourceMapReference({
|
|
23
|
+
index,
|
|
24
|
+
identifier,
|
|
25
|
+
classList: result,
|
|
26
|
+
filePath,
|
|
27
|
+
line,
|
|
28
|
+
column
|
|
29
|
+
});
|
|
30
|
+
if (extraClass) result = new ClassList([result.toString(), extraClass].join(" "));
|
|
31
|
+
}
|
|
32
|
+
if (resultCache) {
|
|
33
|
+
if (!resultCache[filePath]) resultCache[filePath] = [];
|
|
34
|
+
const [start, end] = position;
|
|
35
|
+
resultCache[filePath][index] = {
|
|
36
|
+
start,
|
|
37
|
+
end,
|
|
38
|
+
value: result === void 0 ? "undefined" : JSON.stringify(result)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
53
44
|
}
|
|
54
|
-
|
|
45
|
+
//#endregion
|
|
55
46
|
export { setAdapter };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navita/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-next.0",
|
|
4
4
|
"description": "Core package for Navita. Used for creating integrations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"core",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"enhanced-resolve": "5.15.0",
|
|
29
|
-
"outdent": "^0.8.0",
|
|
30
29
|
"magic-string": "^0.30.3",
|
|
31
|
-
"
|
|
32
|
-
"@navita/adapter": "0.
|
|
33
|
-
"@navita/engine": "0.
|
|
34
|
-
"@navita/
|
|
30
|
+
"outdent": "^0.8.0",
|
|
31
|
+
"@navita/adapter": "3.0.0-next.0",
|
|
32
|
+
"@navita/engine": "3.0.0-next.0",
|
|
33
|
+
"@navita/extraction": "3.0.0-next.0",
|
|
34
|
+
"@navita/types": "3.0.0-next.0"
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"author": "Eagerpatch",
|