x-essential-lib 0.10.3 → 0.10.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/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, forward: boolean): void;
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 {
package/dist/index.js CHANGED
@@ -121,12 +121,13 @@ async function waitUtil(conditionFunc, timeout, interval) {
121
121
  check();
122
122
  });
123
123
  }
124
- function appAppear(name, forward) {
124
+ function appAppear(name, diff) {
125
125
  const appElement = document.getElementById("single-spa-application:" + name);
126
126
  if (!appElement) return;
127
- appElement.classList.remove("app-left", "app-right", "app-reset");
128
- if (forward) appElement.classList.add("app-left");
129
- else appElement.classList.add("app-right");
127
+ appElement.classList.remove("app-fade", "app-left", "app-right", "app-reset");
128
+ if (diff > 0) appElement.classList.add("app-left");
129
+ else if (diff < 0) appElement.classList.add("app-right");
130
+ else appElement.classList.add("app-fade");
130
131
  setTimeout(() => {
131
132
  appElement.classList.add("app-reset");
132
133
  }, 50);
@@ -586,13 +587,13 @@ function onBeforeChange(toPath, fromPath, lastAppPath) {
586
587
  console.info(`~~~~routeChange~~~~ ${fromPath} -> ${toPath}`);
587
588
  if (!fromRouteMeta) return;
588
589
  const sameApp = toRouteMeta.app === fromRouteMeta.app;
589
- const samePath = toRouteMeta.path === fromRouteMeta.path;
590
- const forward = toRouteMeta.level >= fromRouteMeta.level;
591
- if (sameApp) if (samePath) routeTransName.value = "";
592
- else routeTransName.value = forward ? "inner-left" : "inner-right";
590
+ const diff = toRouteMeta.level - fromRouteMeta.level;
591
+ if (sameApp) if (diff > 0) routeTransName.value = "inner-left";
592
+ else if (diff < 0) routeTransName.value = "inner-right";
593
+ else routeTransName.value = "inner-fade";
593
594
  else {
594
595
  routeTransName.value = "";
595
- appAppear(toRouteMeta.app, forward);
596
+ appAppear(toRouteMeta.app, diff);
596
597
  }
597
598
  }
598
599
  function isHasAccessToken() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-essential-lib",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "files": [
5
5
  "dist"
6
6
  ],