Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aliyun-obv/app-loader

Package Overview
Dependencies
Maintainers
0
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aliyun-obv/app-loader - npm Package Compare versions

Comparing version 0.3.11 to 0.3.12

dist/style.css

41

dist/es/index.js

@@ -53,3 +53,3 @@ var __defProp = Object.defineProperty;

var _a, _b, _c;
import React, { forwardRef, useState, useCallback, useEffect, Suspense, useRef } from "react";
import React, { useMemo, forwardRef, useState, useCallback, useEffect, Suspense, useRef } from "react";
import ReactDOM from "react-dom";

@@ -490,4 +490,40 @@ const topWindowKey = "__CONSOLE_OBVIZ_APP__";

}
function Skeleton({
count = 1,
duration = 1.2,
width = "100%",
height,
circle = false,
style: customStyle,
className: customClassName,
theme = "light"
}) {
const defaultStyle = useMemo(() => {
return __spreadValues({
animation: `${void 0} ${duration}s ease-in-out infinite`
}, customStyle);
}, [customStyle, duration]);
const elements = useMemo(() => {
const els = [];
for (let i = 0; i < count; i++) {
const style = __spreadValues({}, defaultStyle);
style.width = width;
if (height !== null) {
style.height = height;
}
if (width !== null && height !== null && circle) {
style.borderRadius = "50%";
}
els.push(
/* @__PURE__ */ React.createElement("span", { key: i, className: `${void 0} ${customClassName}`, style }, "‌")
);
}
return els;
}, [circle, count, customClassName, defaultStyle, height, width]);
return /* @__PURE__ */ React.createElement("span", { className: `${void 0} ${theme === "dark" ? void 0 : void 0}` }, elements);
}
function _Application(_d, ref) {
var _e = _d, { appInfo, exportName } = _e, props = __objRest(_e, ["appInfo", "exportName"]);
var _a2;
const showLoading = (_a2 = appInfo == null ? void 0 : appInfo.showLoading) != null ? _a2 : false;
const [appCom, setAppCom] = useState({ current: null });

@@ -504,2 +540,5 @@ const init = useCallback(() => __async(this, null, function* () {

if (appCom == null || appCom.current == null) {
if (showLoading === true) {
return /* @__PURE__ */ React.createElement("div", { style: { padding: "20px" } }, /* @__PURE__ */ React.createElement(Skeleton, { width: "100%", count: 3 }));
}
return null;

@@ -506,0 +545,0 @@ }

@@ -10,2 +10,6 @@ export interface IOBSApp {

slsEnv?: boolean;
/**
* 是否需要显示 loading 效果
*/
showLoading?: boolean;
}

@@ -12,0 +16,0 @@ export interface IOBSAppInner extends IOBSApp {

9

dist/types/plugin/ObvizAsyncComponent.d.ts
import React from 'react';
export type LazyComponent<T extends React.ComponentType<any>> = React.ExoticComponent<React.ComponentPropsWithRef<T>>;
export type LazyComponent<T extends React.ComponentType<any>, K = {}> = React.ExoticComponent<React.ComponentPropsWithRef<T> & K>;
export type FilteredValueOfKey<T, K extends keyof T, U> = T[K] extends U ? T[K] : never;
export declare function ObvizAsyncComponent<O, T extends React.ComponentType<any>, K extends keyof O>(factory: () => Promise<O>, exportName: K): LazyComponent<FilteredValueOfKey<O, K, T>>;
export interface LoaderAppProps {
appProps?: {
baseRouter?: string;
};
}
export declare function ObvizAsyncComponent<O, T extends React.ComponentType<any>, K extends keyof O>(factory: () => Promise<O>, exportName: K): LazyComponent<FilteredValueOfKey<O, K, T>, LoaderAppProps>;

@@ -17,3 +17,3 @@ {

"devDependencies": {},
"version": "0.3.11"
"version": "0.3.12"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc