@next-core/runtime 1.5.5 → 1.6.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/dist/cjs/internal/compute/getTracks.js +12 -3
- package/dist/cjs/internal/compute/getTracks.js.map +1 -1
- package/dist/esm/internal/compute/getTracks.js +14 -5
- package/dist/esm/internal/compute/getTracks.js.map +1 -1
- package/dist/types/internal/compute/getTracks.d.ts +3 -3
- package/package.json +5 -5
|
@@ -13,9 +13,18 @@ function getTracks(value) {
|
|
|
13
13
|
let formStateNames = false;
|
|
14
14
|
if (typeof value === "string" ? (0, _cook.isEvaluable)(value) : (0, _evaluate.isPreEvaluated)(value)) {
|
|
15
15
|
const raw = typeof value === "string" ? value : (0, _evaluate.getPreEvaluatedRaw)(value);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if ((0, _cook.isTrackAll)(raw)) {
|
|
17
|
+
const result = (0, _storyboard.trackAll)(raw);
|
|
18
|
+
if (result) {
|
|
19
|
+
contextNames = result.context;
|
|
20
|
+
stateNames = result.state;
|
|
21
|
+
formStateNames = result.formState;
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
contextNames = (0, _storyboard.track)(raw, "track context", "CTX");
|
|
25
|
+
stateNames = (0, _storyboard.track)(raw, "track state", "STATE");
|
|
26
|
+
formStateNames = (0, _storyboard.track)(raw, "track formstate", "FORM_STATE");
|
|
27
|
+
}
|
|
19
28
|
}
|
|
20
29
|
return {
|
|
21
30
|
contextNames,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTracks.js","names":["_cook","require","_storyboard","_evaluate","getTracks","value","contextNames","stateNames","formStateNames","isEvaluable","isPreEvaluated","raw","getPreEvaluatedRaw","track"],"sources":["../../../../src/internal/compute/getTracks.ts"],"sourcesContent":["import { isEvaluable } from \"@next-core/cook\";\nimport { track } from \"@next-core/utils/storyboard\";\nimport {\n PreEvaluated,\n getPreEvaluatedRaw,\n isPreEvaluated,\n} from \"./evaluate.js\";\n\nexport function getTracks(value: unknown) {\n let contextNames: string[] | Set<string> | false = false;\n let stateNames: string[] | Set<string> | false = false;\n let formStateNames: string[] | Set<string> | false = false;\n if (typeof value === \"string\" ? isEvaluable(value) : isPreEvaluated(value)) {\n const raw =\n typeof value === \"string\"\n ? value\n : getPreEvaluatedRaw(value as PreEvaluated);\n contextNames = track(raw, \"track context\", \"CTX\");\n
|
|
1
|
+
{"version":3,"file":"getTracks.js","names":["_cook","require","_storyboard","_evaluate","getTracks","value","contextNames","stateNames","formStateNames","isEvaluable","isPreEvaluated","raw","getPreEvaluatedRaw","isTrackAll","result","trackAll","context","state","formState","track"],"sources":["../../../../src/internal/compute/getTracks.ts"],"sourcesContent":["import { isEvaluable, isTrackAll } from \"@next-core/cook\";\nimport { track, trackAll } from \"@next-core/utils/storyboard\";\nimport {\n PreEvaluated,\n getPreEvaluatedRaw,\n isPreEvaluated,\n} from \"./evaluate.js\";\n\nexport function getTracks(value: unknown) {\n let contextNames: string[] | Set<string> | false = false;\n let stateNames: string[] | Set<string> | false = false;\n let formStateNames: string[] | Set<string> | false = false;\n if (typeof value === \"string\" ? isEvaluable(value) : isPreEvaluated(value)) {\n const raw =\n typeof value === \"string\"\n ? value\n : getPreEvaluatedRaw(value as PreEvaluated);\n if (isTrackAll(raw)) {\n const result = trackAll(raw);\n if (result) {\n contextNames = result.context;\n stateNames = result.state;\n formStateNames = result.formState;\n }\n } else {\n contextNames = track(raw, \"track context\", \"CTX\");\n stateNames = track(raw, \"track state\", \"STATE\");\n formStateNames = track(raw, \"track formstate\", \"FORM_STATE\");\n }\n }\n\n return { contextNames, stateNames, formStateNames };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAMO,SAASG,SAASA,CAACC,KAAc,EAAE;EACxC,IAAIC,YAA4C,GAAG,KAAK;EACxD,IAAIC,UAA0C,GAAG,KAAK;EACtD,IAAIC,cAA8C,GAAG,KAAK;EAC1D,IAAI,OAAOH,KAAK,KAAK,QAAQ,GAAG,IAAAI,iBAAW,EAACJ,KAAK,CAAC,GAAG,IAAAK,wBAAc,EAACL,KAAK,CAAC,EAAE;IAC1E,MAAMM,GAAG,GACP,OAAON,KAAK,KAAK,QAAQ,GACrBA,KAAK,GACL,IAAAO,4BAAkB,EAACP,KAAK,CAAiB;IAC/C,IAAI,IAAAQ,gBAAU,EAACF,GAAG,CAAC,EAAE;MACnB,MAAMG,MAAM,GAAG,IAAAC,oBAAQ,EAACJ,GAAG,CAAC;MAC5B,IAAIG,MAAM,EAAE;QACVR,YAAY,GAAGQ,MAAM,CAACE,OAAO;QAC7BT,UAAU,GAAGO,MAAM,CAACG,KAAK;QACzBT,cAAc,GAAGM,MAAM,CAACI,SAAS;MACnC;IACF,CAAC,MAAM;MACLZ,YAAY,GAAG,IAAAa,iBAAK,EAACR,GAAG,EAAE,eAAe,EAAE,KAAK,CAAC;MACjDJ,UAAU,GAAG,IAAAY,iBAAK,EAACR,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC;MAC/CH,cAAc,GAAG,IAAAW,iBAAK,EAACR,GAAG,EAAE,iBAAiB,EAAE,YAAY,CAAC;IAC9D;EACF;EAEA,OAAO;IAAEL,YAAY;IAAEC,UAAU;IAAEC;EAAe,CAAC;AACrD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isEvaluable } from "@next-core/cook";
|
|
2
|
-
import { track } from "@next-core/utils/storyboard";
|
|
1
|
+
import { isEvaluable, isTrackAll } from "@next-core/cook";
|
|
2
|
+
import { track, trackAll } from "@next-core/utils/storyboard";
|
|
3
3
|
import { getPreEvaluatedRaw, isPreEvaluated } from "./evaluate.js";
|
|
4
4
|
export function getTracks(value) {
|
|
5
5
|
var contextNames = false;
|
|
@@ -7,9 +7,18 @@ export function getTracks(value) {
|
|
|
7
7
|
var formStateNames = false;
|
|
8
8
|
if (typeof value === "string" ? isEvaluable(value) : isPreEvaluated(value)) {
|
|
9
9
|
var raw = typeof value === "string" ? value : getPreEvaluatedRaw(value);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
if (isTrackAll(raw)) {
|
|
11
|
+
var result = trackAll(raw);
|
|
12
|
+
if (result) {
|
|
13
|
+
contextNames = result.context;
|
|
14
|
+
stateNames = result.state;
|
|
15
|
+
formStateNames = result.formState;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
contextNames = track(raw, "track context", "CTX");
|
|
19
|
+
stateNames = track(raw, "track state", "STATE");
|
|
20
|
+
formStateNames = track(raw, "track formstate", "FORM_STATE");
|
|
21
|
+
}
|
|
13
22
|
}
|
|
14
23
|
return {
|
|
15
24
|
contextNames,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTracks.js","names":["isEvaluable","track","getPreEvaluatedRaw","isPreEvaluated","getTracks","value","contextNames","stateNames","formStateNames","raw"],"sources":["../../../../src/internal/compute/getTracks.ts"],"sourcesContent":["import { isEvaluable } from \"@next-core/cook\";\nimport { track } from \"@next-core/utils/storyboard\";\nimport {\n PreEvaluated,\n getPreEvaluatedRaw,\n isPreEvaluated,\n} from \"./evaluate.js\";\n\nexport function getTracks(value: unknown) {\n let contextNames: string[] | Set<string> | false = false;\n let stateNames: string[] | Set<string> | false = false;\n let formStateNames: string[] | Set<string> | false = false;\n if (typeof value === \"string\" ? isEvaluable(value) : isPreEvaluated(value)) {\n const raw =\n typeof value === \"string\"\n ? value\n : getPreEvaluatedRaw(value as PreEvaluated);\n contextNames = track(raw, \"track context\", \"CTX\");\n
|
|
1
|
+
{"version":3,"file":"getTracks.js","names":["isEvaluable","isTrackAll","track","trackAll","getPreEvaluatedRaw","isPreEvaluated","getTracks","value","contextNames","stateNames","formStateNames","raw","result","context","state","formState"],"sources":["../../../../src/internal/compute/getTracks.ts"],"sourcesContent":["import { isEvaluable, isTrackAll } from \"@next-core/cook\";\nimport { track, trackAll } from \"@next-core/utils/storyboard\";\nimport {\n PreEvaluated,\n getPreEvaluatedRaw,\n isPreEvaluated,\n} from \"./evaluate.js\";\n\nexport function getTracks(value: unknown) {\n let contextNames: string[] | Set<string> | false = false;\n let stateNames: string[] | Set<string> | false = false;\n let formStateNames: string[] | Set<string> | false = false;\n if (typeof value === \"string\" ? isEvaluable(value) : isPreEvaluated(value)) {\n const raw =\n typeof value === \"string\"\n ? value\n : getPreEvaluatedRaw(value as PreEvaluated);\n if (isTrackAll(raw)) {\n const result = trackAll(raw);\n if (result) {\n contextNames = result.context;\n stateNames = result.state;\n formStateNames = result.formState;\n }\n } else {\n contextNames = track(raw, \"track context\", \"CTX\");\n stateNames = track(raw, \"track state\", \"STATE\");\n formStateNames = track(raw, \"track formstate\", \"FORM_STATE\");\n }\n }\n\n return { contextNames, stateNames, formStateNames };\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,UAAU,QAAQ,iBAAiB;AACzD,SAASC,KAAK,EAAEC,QAAQ,QAAQ,6BAA6B;AAC7D,SAEEC,kBAAkB,EAClBC,cAAc,QACT,eAAe;AAEtB,OAAO,SAASC,SAASA,CAACC,KAAc,EAAE;EACxC,IAAIC,YAA4C,GAAG,KAAK;EACxD,IAAIC,UAA0C,GAAG,KAAK;EACtD,IAAIC,cAA8C,GAAG,KAAK;EAC1D,IAAI,OAAOH,KAAK,KAAK,QAAQ,GAAGP,WAAW,CAACO,KAAK,CAAC,GAAGF,cAAc,CAACE,KAAK,CAAC,EAAE;IAC1E,IAAMI,GAAG,GACP,OAAOJ,KAAK,KAAK,QAAQ,GACrBA,KAAK,GACLH,kBAAkB,CAACG,KAAK,CAAiB;IAC/C,IAAIN,UAAU,CAACU,GAAG,CAAC,EAAE;MACnB,IAAMC,MAAM,GAAGT,QAAQ,CAACQ,GAAG,CAAC;MAC5B,IAAIC,MAAM,EAAE;QACVJ,YAAY,GAAGI,MAAM,CAACC,OAAO;QAC7BJ,UAAU,GAAGG,MAAM,CAACE,KAAK;QACzBJ,cAAc,GAAGE,MAAM,CAACG,SAAS;MACnC;IACF,CAAC,MAAM;MACLP,YAAY,GAAGN,KAAK,CAACS,GAAG,EAAE,eAAe,EAAE,KAAK,CAAC;MACjDF,UAAU,GAAGP,KAAK,CAACS,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC;MAC/CD,cAAc,GAAGR,KAAK,CAACS,GAAG,EAAE,iBAAiB,EAAE,YAAY,CAAC;IAC9D;EACF;EAEA,OAAO;IAAEH,YAAY;IAAEC,UAAU;IAAEC;EAAe,CAAC;AACrD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function getTracks(value: unknown): {
|
|
2
|
-
contextNames: false | Set<string>;
|
|
3
|
-
stateNames: false | Set<string>;
|
|
4
|
-
formStateNames: false | Set<string>;
|
|
2
|
+
contextNames: false | string[] | Set<string>;
|
|
3
|
+
stateNames: false | string[] | Set<string>;
|
|
4
|
+
formStateNames: false | string[] | Set<string>;
|
|
5
5
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/runtime",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"repository": {
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"@next-api-sdk/cmdb-sdk": "^1.1.0",
|
|
48
48
|
"@next-api-sdk/micro-app-sdk": "^1.1.0",
|
|
49
49
|
"@next-api-sdk/micro-app-standalone-sdk": "^1.1.0",
|
|
50
|
-
"@next-core/cook": "^2.0
|
|
50
|
+
"@next-core/cook": "^2.1.0",
|
|
51
51
|
"@next-core/http": "^1.0.4",
|
|
52
|
-
"@next-core/i18n": "^1.0.
|
|
52
|
+
"@next-core/i18n": "^1.0.12",
|
|
53
53
|
"@next-core/inject": "^1.0.8",
|
|
54
54
|
"@next-core/loader": "^1.3.0",
|
|
55
55
|
"@next-core/supply": "^2.0.4",
|
|
56
56
|
"@next-core/types": "^1.1.2",
|
|
57
|
-
"@next-core/utils": "^1.
|
|
57
|
+
"@next-core/utils": "^1.4.0",
|
|
58
58
|
"@ungap/event-target": "^0.2.3",
|
|
59
59
|
"compare-versions": "^5.0.3",
|
|
60
60
|
"history": "^4.10.1",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@next-core/build-next-libs": "^1.0.3",
|
|
68
68
|
"@next-core/test-next": "^1.0.4"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "125aede7b3cf5fdbb8040326dea72a25cdabc3aa"
|
|
71
71
|
}
|