x-essential-lib 0.10.2 → 0.10.4
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/index.d.ts +2 -2
- package/dist/index.js +10 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ declare const globalObjects: {
|
|
|
104
104
|
declare const eventBus: Emitter<Record<EventType, unknown>>;
|
|
105
105
|
declare function waitMs(ms: number): Promise<void>;
|
|
106
106
|
declare function waitUtil(conditionFunc: () => boolean, timeout?: number, interval?: number): Promise<boolean>;
|
|
107
|
-
declare function appAppear(name: string,
|
|
107
|
+
declare function appAppear(name: string, diff: number): void;
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/utils/permission.d.ts
|
|
110
110
|
declare enum Permission {
|
|
@@ -262,7 +262,7 @@ declare function injectViews(): Ref<string[]>;
|
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/utils/router.d.ts
|
|
264
264
|
interface RouteMeta {
|
|
265
|
-
app: 'x-app-mf' | 'x-compute-mf' | 'x-data-mf' | 'x-main-mf' | 'x-mine-mf' | 'x-org-mf' | 'x-passport-mf' | 'x-resource-mf';
|
|
265
|
+
app: 'x-app-mf' | 'x-compute-mf' | 'x-create-mf' | 'x-data-mf' | 'x-ecosystem-mf' | 'x-main-mf' | 'x-mine-mf' | 'x-org-mf' | 'x-passport-mf' | 'x-resource-mf';
|
|
266
266
|
path: string;
|
|
267
267
|
level: number;
|
|
268
268
|
requiredState?: 'auth' | 'org';
|
package/dist/index.js
CHANGED
|
@@ -121,12 +121,12 @@ async function waitUtil(conditionFunc, timeout, interval) {
|
|
|
121
121
|
check();
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
function appAppear(name,
|
|
124
|
+
function appAppear(name, diff) {
|
|
125
125
|
const appElement = document.getElementById("single-spa-application:" + name);
|
|
126
126
|
if (!appElement) return;
|
|
127
127
|
appElement.classList.remove("app-left", "app-right", "app-reset");
|
|
128
|
-
if (
|
|
129
|
-
else appElement.classList.add("app-right");
|
|
128
|
+
if (diff > 0) appElement.classList.add("app-left");
|
|
129
|
+
else if (diff < 0) appElement.classList.add("app-right");
|
|
130
130
|
setTimeout(() => {
|
|
131
131
|
appElement.classList.add("app-reset");
|
|
132
132
|
}, 50);
|
|
@@ -471,13 +471,13 @@ const routeMetas = [
|
|
|
471
471
|
requiredState: "org"
|
|
472
472
|
},
|
|
473
473
|
{
|
|
474
|
-
app: "x-
|
|
474
|
+
app: "x-create-mf",
|
|
475
475
|
path: "/create",
|
|
476
476
|
level: 0,
|
|
477
477
|
requiredState: "org"
|
|
478
478
|
},
|
|
479
479
|
{
|
|
480
|
-
app: "x-
|
|
480
|
+
app: "x-ecosystem-mf",
|
|
481
481
|
path: "/ecosystem",
|
|
482
482
|
level: 0,
|
|
483
483
|
requiredState: "org"
|
|
@@ -586,13 +586,13 @@ function onBeforeChange(toPath, fromPath, lastAppPath) {
|
|
|
586
586
|
console.info(`~~~~routeChange~~~~ ${fromPath} -> ${toPath}`);
|
|
587
587
|
if (!fromRouteMeta) return;
|
|
588
588
|
const sameApp = toRouteMeta.app === fromRouteMeta.app;
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
if (
|
|
592
|
-
else routeTransName.value =
|
|
589
|
+
const diff = toRouteMeta.level - fromRouteMeta.level;
|
|
590
|
+
if (sameApp) if (diff > 0) routeTransName.value = "inner-left";
|
|
591
|
+
else if (diff < 0) routeTransName.value = "inner-right";
|
|
592
|
+
else routeTransName.value = "";
|
|
593
593
|
else {
|
|
594
594
|
routeTransName.value = "";
|
|
595
|
-
appAppear(toRouteMeta.app,
|
|
595
|
+
appAppear(toRouteMeta.app, diff);
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
function isHasAccessToken() {
|