@steedos/webapp 3.0.7-beta.4 → 3.0.7
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./index-
|
|
1
|
+
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./index-CIjj35sk.js";
|
|
2
2
|
function _mergeNamespaces(n, m) {
|
|
3
3
|
for (var i = 0; i < m.length; i++) {
|
|
4
4
|
const e = m[i];
|
|
@@ -29192,6 +29192,52 @@ function useRouteError() {
|
|
|
29192
29192
|
}
|
|
29193
29193
|
return state.errors?.[routeId];
|
|
29194
29194
|
}
|
|
29195
|
+
var blockerId = 0;
|
|
29196
|
+
function useBlocker(shouldBlock) {
|
|
29197
|
+
let { router, basename: basename2 } = useDataRouterContext(
|
|
29198
|
+
"useBlocker"
|
|
29199
|
+
/* UseBlocker */
|
|
29200
|
+
);
|
|
29201
|
+
let state = useDataRouterState(
|
|
29202
|
+
"useBlocker"
|
|
29203
|
+
/* UseBlocker */
|
|
29204
|
+
);
|
|
29205
|
+
let [blockerKey, setBlockerKey] = reactExports.useState("");
|
|
29206
|
+
let blockerFunction = reactExports.useCallback(
|
|
29207
|
+
(arg) => {
|
|
29208
|
+
if (typeof shouldBlock !== "function") {
|
|
29209
|
+
return !!shouldBlock;
|
|
29210
|
+
}
|
|
29211
|
+
if (basename2 === "/") {
|
|
29212
|
+
return shouldBlock(arg);
|
|
29213
|
+
}
|
|
29214
|
+
let { currentLocation, nextLocation, historyAction } = arg;
|
|
29215
|
+
return shouldBlock({
|
|
29216
|
+
currentLocation: {
|
|
29217
|
+
...currentLocation,
|
|
29218
|
+
pathname: stripBasename(currentLocation.pathname, basename2) || currentLocation.pathname
|
|
29219
|
+
},
|
|
29220
|
+
nextLocation: {
|
|
29221
|
+
...nextLocation,
|
|
29222
|
+
pathname: stripBasename(nextLocation.pathname, basename2) || nextLocation.pathname
|
|
29223
|
+
},
|
|
29224
|
+
historyAction
|
|
29225
|
+
});
|
|
29226
|
+
},
|
|
29227
|
+
[basename2, shouldBlock]
|
|
29228
|
+
);
|
|
29229
|
+
reactExports.useEffect(() => {
|
|
29230
|
+
let key2 = String(++blockerId);
|
|
29231
|
+
setBlockerKey(key2);
|
|
29232
|
+
return () => router.deleteBlocker(key2);
|
|
29233
|
+
}, [router]);
|
|
29234
|
+
reactExports.useEffect(() => {
|
|
29235
|
+
if (blockerKey !== "") {
|
|
29236
|
+
router.getBlocker(blockerKey, blockerFunction);
|
|
29237
|
+
}
|
|
29238
|
+
}, [router, blockerKey, blockerFunction]);
|
|
29239
|
+
return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER;
|
|
29240
|
+
}
|
|
29195
29241
|
function useNavigateStable() {
|
|
29196
29242
|
let { router } = useDataRouterContext(
|
|
29197
29243
|
"useNavigate"
|
|
@@ -54766,6 +54812,25 @@ const GlobalLinkInterceptor = () => {
|
|
|
54766
54812
|
function RouteChangeHandler() {
|
|
54767
54813
|
const location2 = useLocation();
|
|
54768
54814
|
const navigationType = useNavigationType();
|
|
54815
|
+
const blocker = useBlocker(
|
|
54816
|
+
({ currentLocation, nextLocation }) => {
|
|
54817
|
+
console.log(`blocker`, currentLocation, nextLocation);
|
|
54818
|
+
return currentLocation.pathname !== nextLocation.pathname;
|
|
54819
|
+
}
|
|
54820
|
+
);
|
|
54821
|
+
reactExports.useEffect(() => {
|
|
54822
|
+
if (blocker.state === "blocked") {
|
|
54823
|
+
const handleNavigation = async () => {
|
|
54824
|
+
const result = await window.SteedosUI?.navigationGuard?.executeHandlers(blocker);
|
|
54825
|
+
if (result.allowed) {
|
|
54826
|
+
blocker.proceed();
|
|
54827
|
+
} else {
|
|
54828
|
+
blocker.reset();
|
|
54829
|
+
}
|
|
54830
|
+
};
|
|
54831
|
+
handleNavigation();
|
|
54832
|
+
}
|
|
54833
|
+
}, [blocker]);
|
|
54769
54834
|
reactExports.useEffect(() => {
|
|
54770
54835
|
const routeChangeData = {
|
|
54771
54836
|
type: "ROUTE_CHANGE",
|
|
@@ -77132,16 +77197,6 @@ window.waitForThing = (obj, path2, func) => {
|
|
|
77132
77197
|
return _innerWaitForThing(obj, path2, func);
|
|
77133
77198
|
};
|
|
77134
77199
|
window.signOut = Steedos$1.logout;
|
|
77135
|
-
var i18next_1;
|
|
77136
|
-
var hasRequiredI18next;
|
|
77137
|
-
function requireI18next() {
|
|
77138
|
-
if (hasRequiredI18next) return i18next_1;
|
|
77139
|
-
hasRequiredI18next = 1;
|
|
77140
|
-
i18next_1 = i18next;
|
|
77141
|
-
return i18next_1;
|
|
77142
|
-
}
|
|
77143
|
-
var i18nextExports = requireI18next();
|
|
77144
|
-
const i18n = /* @__PURE__ */ getDefaultExportFromCjs(i18nextExports);
|
|
77145
77200
|
const PACKET_TYPES = /* @__PURE__ */ Object.create(null);
|
|
77146
77201
|
PACKET_TYPES["open"] = "0";
|
|
77147
77202
|
PACKET_TYPES["close"] = "1";
|
|
@@ -80448,28 +80503,6 @@ _window.io = lookup;
|
|
|
80448
80503
|
_window["axios"] = axios;
|
|
80449
80504
|
_window["Builder"] = Builder$1;
|
|
80450
80505
|
_window["builder"] = builder;
|
|
80451
|
-
_window["t"] = function(key2, parameters, locale) {
|
|
80452
|
-
if (!key2) {
|
|
80453
|
-
return key2;
|
|
80454
|
-
}
|
|
80455
|
-
if (locale === "zh-cn") {
|
|
80456
|
-
locale = "zh-CN";
|
|
80457
|
-
}
|
|
80458
|
-
if (!locale) {
|
|
80459
|
-
locale = Builder$1.settings.context?.user?.language || Builder$1.settings.default_language || "zh-CN";
|
|
80460
|
-
}
|
|
80461
|
-
let keys2;
|
|
80462
|
-
if (lodash.isArray(key2)) {
|
|
80463
|
-
keys2 = key2;
|
|
80464
|
-
} else {
|
|
80465
|
-
keys2 = [`CustomLabels.${key2}`, key2];
|
|
80466
|
-
}
|
|
80467
|
-
if (parameters != null && !lodash.isObject(parameters)) {
|
|
80468
|
-
return i18nextExports.t(keys2, { lng: locale, postProcess: "sprintf", sprintf: [parameters], keySeparator: false });
|
|
80469
|
-
} else {
|
|
80470
|
-
return i18nextExports.t(keys2, Object.assign({ lng: locale }, { keySeparator: false }, parameters));
|
|
80471
|
-
}
|
|
80472
|
-
};
|
|
80473
80506
|
if (_window["Steedos"]) {
|
|
80474
80507
|
_window["Steedos"] = Object.assign(_window["Steedos"], Steedos$1);
|
|
80475
80508
|
} else {
|
|
@@ -80671,6 +80704,16 @@ function mapDispatchToProps(dispatch2) {
|
|
|
80671
80704
|
};
|
|
80672
80705
|
}
|
|
80673
80706
|
const IntlProvider = connect(mapStateToProps, mapDispatchToProps)(IntlProvider$1);
|
|
80707
|
+
var i18next_1;
|
|
80708
|
+
var hasRequiredI18next;
|
|
80709
|
+
function requireI18next() {
|
|
80710
|
+
if (hasRequiredI18next) return i18next_1;
|
|
80711
|
+
hasRequiredI18next = 1;
|
|
80712
|
+
i18next_1 = i18next;
|
|
80713
|
+
return i18next_1;
|
|
80714
|
+
}
|
|
80715
|
+
var i18nextExports = requireI18next();
|
|
80716
|
+
const i18n = /* @__PURE__ */ getDefaultExportFromCjs(i18nextExports);
|
|
80674
80717
|
const {
|
|
80675
80718
|
slice: slice$1,
|
|
80676
80719
|
forEach
|
|
@@ -81178,7 +81221,7 @@ if (typeof ActiveXObject === "function") {
|
|
|
81178
81221
|
if (typeof fetchApi !== "function") fetchApi = void 0;
|
|
81179
81222
|
if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi) {
|
|
81180
81223
|
try {
|
|
81181
|
-
__vitePreload(() => import("./browser-ponyfill-
|
|
81224
|
+
__vitePreload(() => import("./browser-ponyfill-1f0ORRk4.js").then((n) => n.b), true ? [] : void 0).then(function(mod) {
|
|
81182
81225
|
fetchApi = mod.default;
|
|
81183
81226
|
}).catch(function() {
|
|
81184
81227
|
});
|
|
@@ -81961,8 +82004,9 @@ const sprintf = {
|
|
|
81961
82004
|
}
|
|
81962
82005
|
};
|
|
81963
82006
|
i18n.use(sprintf).use(ICU).use(Backend).use(Browser).use(initReactI18next).init({
|
|
82007
|
+
load: "currentOnly",
|
|
81964
82008
|
fallbackLng: "en",
|
|
81965
|
-
supportedLngs: ["en", "zh-CN"],
|
|
82009
|
+
// supportedLngs: ["en", "zh-CN"],
|
|
81966
82010
|
debug: false,
|
|
81967
82011
|
interpolation: {
|
|
81968
82012
|
escapeValue: false
|
package/dist/index.html
CHANGED
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
window['AmisUI'] = amis.require('amis-ui');
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
window['Amis'].registerFilter('t', function (key,param) {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// window['Amis'].registerFilter('t', function (key,param) {
|
|
30
|
+
// return typeof key === 'string' ? window.t(key,param) : key;
|
|
31
|
+
// })
|
|
32
32
|
|
|
33
33
|
// 监听窗口的 load 事件,确保所有脚本都加载完成
|
|
34
34
|
window.addEventListener('load', function() {
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
<link rel="stylesheet" href="https://unpkg.com/@steedos-widgets/amis@6.3.0-patch.8/lib/themes/antd.css">
|
|
67
67
|
<link rel="stylesheet" href="https://unpkg.com/@steedos-widgets/amis@6.3.0-patch.8/lib/helper.css">
|
|
68
68
|
<link rel="stylesheet" href="https://unpkg.com/@steedos-widgets/amis@6.3.0-patch.8/sdk/iconfont.css">
|
|
69
|
-
<script type="module" crossorigin src="/assets/index-
|
|
70
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
69
|
+
<script type="module" crossorigin src="/assets/index-CIjj35sk.js"></script>
|
|
70
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CvjS7Xyp.css">
|
|
71
71
|
</head>
|
|
72
72
|
<body class="skin-blue-light fixed steedos sidebar-mini three-columns" >
|
|
73
73
|
<div id="root" class="steedos skin-blue-light creator h-full flex flex-col relative overflow-hidden bg-slate-50"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/webapp",
|
|
3
|
-
"version": "3.0.7
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
76
|
"repository": "https://github.com/steedos/app-builder/tree/master/apps/accounts",
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "313eb9122450ffaaa06b8d6c6f21795cc703b340",
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@steedos-widgets/amis-object": "^6.10.
|
|
79
|
+
"@steedos-widgets/amis-object": "^6.10.44",
|
|
80
80
|
"autoprefixer": "^10.4.23"
|
|
81
81
|
}
|
|
82
82
|
}
|