@next-core/runtime 1.17.3 → 1.17.5
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/history.js +17 -3
- package/dist/cjs/history.js.map +1 -1
- package/dist/esm/history.js +15 -1
- package/dist/esm/history.js.map +1 -1
- package/package.json +10 -10
package/dist/cjs/history.js
CHANGED
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createHistory = createHistory;
|
|
7
7
|
exports.getHistory = getHistory;
|
|
8
|
-
var
|
|
8
|
+
var _history2 = require("history");
|
|
9
9
|
var _getBasePath = require("./getBasePath.js");
|
|
10
10
|
var _historyExtended = require("./internal/historyExtended.js");
|
|
11
11
|
let history;
|
|
12
12
|
function createHistory() {
|
|
13
13
|
if (!history) {
|
|
14
14
|
// https://github.com/remix-run/history/issues/810
|
|
15
|
-
const browserHistory = (0,
|
|
15
|
+
const browserHistory = (0, _history2.createBrowserHistory)({
|
|
16
16
|
basename: (0, _getBasePath.getBasePath)().replace(/\/$/, ""),
|
|
17
17
|
getUserConfirmation: _historyExtended.getUserConfirmation
|
|
18
18
|
});
|
|
@@ -22,6 +22,20 @@ function createHistory() {
|
|
|
22
22
|
return history;
|
|
23
23
|
}
|
|
24
24
|
function getHistory() {
|
|
25
|
-
|
|
25
|
+
var _history;
|
|
26
|
+
return (_history = history) !== null && _history !== void 0 ? _history : getV2History();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* When using v3 bricks in v2 runtime, return history from v2 runtime.
|
|
31
|
+
*/
|
|
32
|
+
function getV2History() {
|
|
33
|
+
const {
|
|
34
|
+
dll
|
|
35
|
+
} = window;
|
|
36
|
+
if (typeof dll === "function") {
|
|
37
|
+
const LegacyBrickKit = dll("tYg3");
|
|
38
|
+
return LegacyBrickKit.getHistory();
|
|
39
|
+
}
|
|
26
40
|
}
|
|
27
41
|
//# sourceMappingURL=history.js.map
|
package/dist/cjs/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","names":["
|
|
1
|
+
{"version":3,"file":"history.js","names":["_history2","require","_getBasePath","_historyExtended","history","createHistory","browserHistory","createBrowserHistory","basename","getBasePath","replace","getUserConfirmation","Object","assign","historyExtended","getHistory","_history","getV2History","dll","window","LegacyBrickKit"],"sources":["../../src/history.ts"],"sourcesContent":["import { History, Location, createBrowserHistory } from \"history\";\nimport { getBasePath } from \"./getBasePath.js\";\nimport {\n type ExtendedHistory,\n getUserConfirmation,\n historyExtended,\n NextHistoryState,\n} from \"./internal/historyExtended.js\";\n\nexport type NextHistory = History<NextHistoryState> & ExtendedHistory;\n\nlet history: NextHistory;\n\nexport function createHistory(): NextHistory {\n if (!history) {\n // https://github.com/remix-run/history/issues/810\n const browserHistory = createBrowserHistory<NextHistoryState>({\n basename: getBasePath().replace(/\\/$/, \"\"),\n getUserConfirmation,\n });\n Object.assign(browserHistory, historyExtended(browserHistory));\n history = browserHistory as NextHistory;\n }\n return history;\n}\n\nexport function getHistory(): NextHistory {\n return history ?? getV2History();\n}\n\n/**\n * When using v3 bricks in v2 runtime, return history from v2 runtime.\n */\nfunction getV2History() {\n const { dll } = window as unknown as { dll?: DLL };\n if (typeof dll === \"function\") {\n const LegacyBrickKit = dll(\"tYg3\");\n return LegacyBrickKit.getHistory();\n }\n}\n\ninterface DLL {\n (moduleId: \"tYg3\"): {\n getHistory(): NextHistory;\n };\n}\n\nexport type NextLocation = Location<NextHistoryState>;\n\nexport type { NextHistoryState };\n"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AASA,IAAIG,OAAoB;AAEjB,SAASC,aAAaA,CAAA,EAAgB;EAC3C,IAAI,CAACD,OAAO,EAAE;IACZ;IACA,MAAME,cAAc,GAAG,IAAAC,8BAAoB,EAAmB;MAC5DC,QAAQ,EAAE,IAAAC,wBAAW,EAAC,CAAC,CAACC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;MAC1CC,mBAAmB,EAAnBA;IACF,CAAC,CAAC;IACFC,MAAM,CAACC,MAAM,CAACP,cAAc,EAAE,IAAAQ,gCAAe,EAACR,cAAc,CAAC,CAAC;IAC9DF,OAAO,GAAGE,cAA6B;EACzC;EACA,OAAOF,OAAO;AAChB;AAEO,SAASW,UAAUA,CAAA,EAAgB;EAAA,IAAAC,QAAA;EACxC,QAAAA,QAAA,GAAOZ,OAAO,cAAAY,QAAA,cAAAA,QAAA,GAAIC,YAAY,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA,SAASA,YAAYA,CAAA,EAAG;EACtB,MAAM;IAAEC;EAAI,CAAC,GAAGC,MAAkC;EAClD,IAAI,OAAOD,GAAG,KAAK,UAAU,EAAE;IAC7B,MAAME,cAAc,GAAGF,GAAG,CAAC,MAAM,CAAC;IAClC,OAAOE,cAAc,CAACL,UAAU,CAAC,CAAC;EACpC;AACF"}
|
package/dist/esm/history.js
CHANGED
|
@@ -15,6 +15,20 @@ export function createHistory() {
|
|
|
15
15
|
return history;
|
|
16
16
|
}
|
|
17
17
|
export function getHistory() {
|
|
18
|
-
|
|
18
|
+
var _history;
|
|
19
|
+
return (_history = history) !== null && _history !== void 0 ? _history : getV2History();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* When using v3 bricks in v2 runtime, return history from v2 runtime.
|
|
24
|
+
*/
|
|
25
|
+
function getV2History() {
|
|
26
|
+
var {
|
|
27
|
+
dll
|
|
28
|
+
} = window;
|
|
29
|
+
if (typeof dll === "function") {
|
|
30
|
+
var LegacyBrickKit = dll("tYg3");
|
|
31
|
+
return LegacyBrickKit.getHistory();
|
|
32
|
+
}
|
|
19
33
|
}
|
|
20
34
|
//# sourceMappingURL=history.js.map
|
package/dist/esm/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","names":["createBrowserHistory","getBasePath","getUserConfirmation","historyExtended","history","createHistory","browserHistory","basename","replace","Object","assign","getHistory"],"sources":["../../src/history.ts"],"sourcesContent":["import { History, Location, createBrowserHistory } from \"history\";\nimport { getBasePath } from \"./getBasePath.js\";\nimport {\n type ExtendedHistory,\n getUserConfirmation,\n historyExtended,\n NextHistoryState,\n} from \"./internal/historyExtended.js\";\n\nexport type NextHistory = History<NextHistoryState> & ExtendedHistory;\n\nlet history: NextHistory;\n\nexport function createHistory(): NextHistory {\n if (!history) {\n // https://github.com/remix-run/history/issues/810\n const browserHistory = createBrowserHistory<NextHistoryState>({\n basename: getBasePath().replace(/\\/$/, \"\"),\n getUserConfirmation,\n });\n Object.assign(browserHistory, historyExtended(browserHistory));\n history = browserHistory as NextHistory;\n }\n return history;\n}\n\nexport function getHistory(): NextHistory {\n return history;\n}\n\nexport type NextLocation = Location<NextHistoryState>;\n\nexport type { NextHistoryState };\n"],"mappings":"AAAA,SAA4BA,oBAAoB,QAAQ,SAAS;AACjE,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAEEC,mBAAmB,EACnBC,eAAe,QAEV,+BAA+B;AAItC,IAAIC,OAAoB;AAExB,OAAO,SAASC,aAAaA,CAAA,EAAgB;EAC3C,IAAI,CAACD,OAAO,EAAE;IACZ;IACA,IAAME,cAAc,GAAGN,oBAAoB,CAAmB;MAC5DO,QAAQ,EAAEN,WAAW,CAAC,CAAC,CAACO,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;MAC1CN;IACF,CAAC,CAAC;IACFO,MAAM,CAACC,MAAM,CAACJ,cAAc,EAAEH,eAAe,CAACG,cAAc,CAAC,CAAC;IAC9DF,OAAO,GAAGE,cAA6B;EACzC;EACA,OAAOF,OAAO;AAChB;AAEA,OAAO,SAASO,UAAUA,CAAA,EAAgB;EACxC,
|
|
1
|
+
{"version":3,"file":"history.js","names":["createBrowserHistory","getBasePath","getUserConfirmation","historyExtended","history","createHistory","browserHistory","basename","replace","Object","assign","getHistory","_history","getV2History","dll","window","LegacyBrickKit"],"sources":["../../src/history.ts"],"sourcesContent":["import { History, Location, createBrowserHistory } from \"history\";\nimport { getBasePath } from \"./getBasePath.js\";\nimport {\n type ExtendedHistory,\n getUserConfirmation,\n historyExtended,\n NextHistoryState,\n} from \"./internal/historyExtended.js\";\n\nexport type NextHistory = History<NextHistoryState> & ExtendedHistory;\n\nlet history: NextHistory;\n\nexport function createHistory(): NextHistory {\n if (!history) {\n // https://github.com/remix-run/history/issues/810\n const browserHistory = createBrowserHistory<NextHistoryState>({\n basename: getBasePath().replace(/\\/$/, \"\"),\n getUserConfirmation,\n });\n Object.assign(browserHistory, historyExtended(browserHistory));\n history = browserHistory as NextHistory;\n }\n return history;\n}\n\nexport function getHistory(): NextHistory {\n return history ?? getV2History();\n}\n\n/**\n * When using v3 bricks in v2 runtime, return history from v2 runtime.\n */\nfunction getV2History() {\n const { dll } = window as unknown as { dll?: DLL };\n if (typeof dll === \"function\") {\n const LegacyBrickKit = dll(\"tYg3\");\n return LegacyBrickKit.getHistory();\n }\n}\n\ninterface DLL {\n (moduleId: \"tYg3\"): {\n getHistory(): NextHistory;\n };\n}\n\nexport type NextLocation = Location<NextHistoryState>;\n\nexport type { NextHistoryState };\n"],"mappings":"AAAA,SAA4BA,oBAAoB,QAAQ,SAAS;AACjE,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAEEC,mBAAmB,EACnBC,eAAe,QAEV,+BAA+B;AAItC,IAAIC,OAAoB;AAExB,OAAO,SAASC,aAAaA,CAAA,EAAgB;EAC3C,IAAI,CAACD,OAAO,EAAE;IACZ;IACA,IAAME,cAAc,GAAGN,oBAAoB,CAAmB;MAC5DO,QAAQ,EAAEN,WAAW,CAAC,CAAC,CAACO,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;MAC1CN;IACF,CAAC,CAAC;IACFO,MAAM,CAACC,MAAM,CAACJ,cAAc,EAAEH,eAAe,CAACG,cAAc,CAAC,CAAC;IAC9DF,OAAO,GAAGE,cAA6B;EACzC;EACA,OAAOF,OAAO;AAChB;AAEA,OAAO,SAASO,UAAUA,CAAA,EAAgB;EAAA,IAAAC,QAAA;EACxC,QAAAA,QAAA,GAAOR,OAAO,cAAAQ,QAAA,cAAAA,QAAA,GAAIC,YAAY,CAAC,CAAC;AAClC;;AAEA;AACA;AACA;AACA,SAASA,YAAYA,CAAA,EAAG;EACtB,IAAM;IAAEC;EAAI,CAAC,GAAGC,MAAkC;EAClD,IAAI,OAAOD,GAAG,KAAK,UAAU,EAAE;IAC7B,IAAME,cAAc,GAAGF,GAAG,CAAC,MAAM,CAAC;IAClC,OAAOE,cAAc,CAACL,UAAU,CAAC,CAAC;EACpC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/runtime",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.5",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/runtime",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"test:ci": "cross-env NODE_ENV='test' CI=true test-next"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@next-core/cook": "^2.2.
|
|
47
|
-
"@next-core/http": "^1.0.
|
|
48
|
-
"@next-core/i18n": "^1.0.
|
|
49
|
-
"@next-core/inject": "^1.0.
|
|
50
|
-
"@next-core/loader": "^1.3.
|
|
51
|
-
"@next-core/supply": "^2.1.
|
|
46
|
+
"@next-core/cook": "^2.2.3",
|
|
47
|
+
"@next-core/http": "^1.0.7",
|
|
48
|
+
"@next-core/i18n": "^1.0.22",
|
|
49
|
+
"@next-core/inject": "^1.0.15",
|
|
50
|
+
"@next-core/loader": "^1.3.4",
|
|
51
|
+
"@next-core/supply": "^2.1.2",
|
|
52
52
|
"@next-core/types": "^1.5.0",
|
|
53
|
-
"@next-core/utils": "^1.5.
|
|
53
|
+
"@next-core/utils": "^1.5.5",
|
|
54
54
|
"@ungap/event-target": "^0.2.4",
|
|
55
55
|
"compare-versions": "^5.0.3",
|
|
56
56
|
"history": "^4.10.1",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@next-api-sdk/api-gateway-sdk": "^1.1.0",
|
|
64
64
|
"@next-api-sdk/micro-app-sdk": "^1.2.1",
|
|
65
65
|
"@next-core/build-next-libs": "^1.0.5",
|
|
66
|
-
"@next-core/test-next": "^1.0.
|
|
66
|
+
"@next-core/test-next": "^1.0.7"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "ade903abfe7858ec69518eed83a91c43b54bdd4a"
|
|
69
69
|
}
|