@bbki.ng/components 1.5.38 → 1.5.41
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 -0
- package/dist/index.js +17 -13
- package/dist/index.mjs +17 -13
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ declare const Breadcrumb: (props: BreadcrumbProps) => JSX.Element;
|
|
|
45
45
|
declare type NavProps = {
|
|
46
46
|
paths: PathObj[];
|
|
47
47
|
loading?: boolean;
|
|
48
|
+
mini?: boolean;
|
|
48
49
|
className?: string;
|
|
49
50
|
};
|
|
50
51
|
declare const Nav: (props: NavProps) => JSX.Element;
|
|
@@ -245,6 +246,7 @@ interface Photo {
|
|
|
245
246
|
interface ImgProps extends Photo {
|
|
246
247
|
className?: string;
|
|
247
248
|
size?: "large" | "normal";
|
|
249
|
+
removeBlurBgAfterLoad?: boolean;
|
|
248
250
|
}
|
|
249
251
|
|
|
250
252
|
declare const Img: (props: ImgProps) => JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -264,6 +264,13 @@ var BlinkDot = (props) => {
|
|
|
264
264
|
|
|
265
265
|
// src/nav/Nav.tsx
|
|
266
266
|
var Nav = (props) => {
|
|
267
|
+
if (props.mini) {
|
|
268
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
269
|
+
className: `p-8 w-full flex items-center ${props.className}`
|
|
270
|
+
}, /* @__PURE__ */ import_react6.default.createElement(Breadcrumb, {
|
|
271
|
+
paths: props.paths
|
|
272
|
+
}));
|
|
273
|
+
}
|
|
267
274
|
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
268
275
|
className: `p-8 w-full flex items-center ${props.className}`
|
|
269
276
|
}, /* @__PURE__ */ import_react6.default.createElement(Logo, {
|
|
@@ -865,11 +872,6 @@ var calcDefaultImgSize = (img, defaultWidth, scale) => {
|
|
|
865
872
|
height: finalWidth / whRatio
|
|
866
873
|
};
|
|
867
874
|
};
|
|
868
|
-
var delay = (time) => {
|
|
869
|
-
return new Promise((resolve) => {
|
|
870
|
-
setTimeout(resolve, time);
|
|
871
|
-
});
|
|
872
|
-
};
|
|
873
875
|
|
|
874
876
|
// src/img/Img.tsx
|
|
875
877
|
var emptyDataURL = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
@@ -881,7 +883,8 @@ var Img = (props) => {
|
|
|
881
883
|
avgColor,
|
|
882
884
|
thumbnailSrc,
|
|
883
885
|
processType,
|
|
884
|
-
size
|
|
886
|
+
size,
|
|
887
|
+
removeBlurBgAfterLoad
|
|
885
888
|
} = props;
|
|
886
889
|
const { width, height } = calcDefaultImgSize(props, renderedWidth, size === "normal" ? 0.6 : 1);
|
|
887
890
|
const [loaded, setLoaded] = (0, import_react19.useState)(false);
|
|
@@ -889,15 +892,14 @@ var Img = (props) => {
|
|
|
889
892
|
const baseWrapperStyle = {
|
|
890
893
|
width: "initial",
|
|
891
894
|
height: "initial",
|
|
892
|
-
backgroundColor: avgColor || "unset"
|
|
893
|
-
};
|
|
894
|
-
const dynamicWrapperStyle = loaded ? {
|
|
895
|
-
backgroundImage: "none"
|
|
896
|
-
} : {
|
|
897
895
|
backgroundSize: "cover",
|
|
898
896
|
backgroundPosition: "0% 0%",
|
|
897
|
+
backgroundColor: avgColor || "#f1f1f1",
|
|
899
898
|
backgroundImage: `url(${thumbnailSrc ? thumbnailSrc : addOssWebpProcessStyle(src, "thumbnail" /* THUMBNAIL */)})`
|
|
900
899
|
};
|
|
900
|
+
const dynamicWrapperStyle = loaded && removeBlurBgAfterLoad ? {
|
|
901
|
+
backgroundImage: "none"
|
|
902
|
+
} : {};
|
|
901
903
|
const handleImgLoad = (img) => {
|
|
902
904
|
const updateFunc = async () => {
|
|
903
905
|
const p = "decode" in img ? img.decode : Promise.resolve;
|
|
@@ -905,11 +907,13 @@ var Img = (props) => {
|
|
|
905
907
|
await p();
|
|
906
908
|
} catch (e) {
|
|
907
909
|
}
|
|
908
|
-
await delay(500);
|
|
909
910
|
setDecoded(true);
|
|
910
|
-
await delay(500);
|
|
911
911
|
setLoaded(true);
|
|
912
912
|
};
|
|
913
|
+
if (img.complete) {
|
|
914
|
+
updateFunc().then();
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
913
917
|
img.onload = updateFunc;
|
|
914
918
|
};
|
|
915
919
|
return /* @__PURE__ */ import_react19.default.createElement("span", {
|
package/dist/index.mjs
CHANGED
|
@@ -203,6 +203,13 @@ var BlinkDot = (props) => {
|
|
|
203
203
|
|
|
204
204
|
// src/nav/Nav.tsx
|
|
205
205
|
var Nav = (props) => {
|
|
206
|
+
if (props.mini) {
|
|
207
|
+
return /* @__PURE__ */ React7.createElement("div", {
|
|
208
|
+
className: `p-8 w-full flex items-center ${props.className}`
|
|
209
|
+
}, /* @__PURE__ */ React7.createElement(Breadcrumb, {
|
|
210
|
+
paths: props.paths
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
206
213
|
return /* @__PURE__ */ React7.createElement("div", {
|
|
207
214
|
className: `p-8 w-full flex items-center ${props.className}`
|
|
208
215
|
}, /* @__PURE__ */ React7.createElement(Logo, {
|
|
@@ -807,11 +814,6 @@ var calcDefaultImgSize = (img, defaultWidth, scale) => {
|
|
|
807
814
|
height: finalWidth / whRatio
|
|
808
815
|
};
|
|
809
816
|
};
|
|
810
|
-
var delay = (time) => {
|
|
811
|
-
return new Promise((resolve) => {
|
|
812
|
-
setTimeout(resolve, time);
|
|
813
|
-
});
|
|
814
|
-
};
|
|
815
817
|
|
|
816
818
|
// src/img/Img.tsx
|
|
817
819
|
var emptyDataURL = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
@@ -823,7 +825,8 @@ var Img = (props) => {
|
|
|
823
825
|
avgColor,
|
|
824
826
|
thumbnailSrc,
|
|
825
827
|
processType,
|
|
826
|
-
size
|
|
828
|
+
size,
|
|
829
|
+
removeBlurBgAfterLoad
|
|
827
830
|
} = props;
|
|
828
831
|
const { width, height } = calcDefaultImgSize(props, renderedWidth, size === "normal" ? 0.6 : 1);
|
|
829
832
|
const [loaded, setLoaded] = useState5(false);
|
|
@@ -831,15 +834,14 @@ var Img = (props) => {
|
|
|
831
834
|
const baseWrapperStyle = {
|
|
832
835
|
width: "initial",
|
|
833
836
|
height: "initial",
|
|
834
|
-
backgroundColor: avgColor || "unset"
|
|
835
|
-
};
|
|
836
|
-
const dynamicWrapperStyle = loaded ? {
|
|
837
|
-
backgroundImage: "none"
|
|
838
|
-
} : {
|
|
839
837
|
backgroundSize: "cover",
|
|
840
838
|
backgroundPosition: "0% 0%",
|
|
839
|
+
backgroundColor: avgColor || "#f1f1f1",
|
|
841
840
|
backgroundImage: `url(${thumbnailSrc ? thumbnailSrc : addOssWebpProcessStyle(src, "thumbnail" /* THUMBNAIL */)})`
|
|
842
841
|
};
|
|
842
|
+
const dynamicWrapperStyle = loaded && removeBlurBgAfterLoad ? {
|
|
843
|
+
backgroundImage: "none"
|
|
844
|
+
} : {};
|
|
843
845
|
const handleImgLoad = (img) => {
|
|
844
846
|
const updateFunc = async () => {
|
|
845
847
|
const p = "decode" in img ? img.decode : Promise.resolve;
|
|
@@ -847,11 +849,13 @@ var Img = (props) => {
|
|
|
847
849
|
await p();
|
|
848
850
|
} catch (e) {
|
|
849
851
|
}
|
|
850
|
-
await delay(500);
|
|
851
852
|
setDecoded(true);
|
|
852
|
-
await delay(500);
|
|
853
853
|
setLoaded(true);
|
|
854
854
|
};
|
|
855
|
+
if (img.complete) {
|
|
856
|
+
updateFunc().then();
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
855
859
|
img.onload = updateFunc;
|
|
856
860
|
};
|
|
857
861
|
return /* @__PURE__ */ React18.createElement("span", {
|