@bbki.ng/components 1.5.45 → 1.5.48
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 +3 -3
- package/dist/index.js +56 -32
- package/dist/index.mjs +54 -31
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -275,9 +275,9 @@ interface ISettings {
|
|
|
275
275
|
interface IOpt {
|
|
276
276
|
multiplier: number;
|
|
277
277
|
color: number[];
|
|
278
|
-
spiralConstA: number;
|
|
279
|
-
spiralConstB: number;
|
|
280
278
|
offset?: number;
|
|
279
|
+
length: number;
|
|
280
|
+
radius: number;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
interface LoadingSpiralProps extends IOpt, ISettings {
|
|
@@ -287,4 +287,4 @@ interface LoadingSpiralProps extends IOpt, ISettings {
|
|
|
287
287
|
}
|
|
288
288
|
declare const LoadingSpiral: (props?: LoadingSpiralProps | undefined) => JSX.Element;
|
|
289
289
|
|
|
290
|
-
export { Article, ArticleProps, ArticleSkeleton, ArticleSkeletonProps, BLinkDotProps, BlinkDot, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, DropImage, Error, ErrorBoundary, Gallery, GalleryProps, ImageDropProps, ImagePreviewerProps, ImageRenderer, Img, Link, LinkColor, LinkList, LinkListProps, LinkListSkeleton, LinkListSkeletonProps, LinkProps, List, LoadingSpiral, LoadingSpiralProps, Logo, LogoProps, Nav, NavProps, NoiseCover, NoiseCoverProps, NotFound, Page, Panel, PanelProps, PathObj, PopConfirm, PopConfirmProps, Skeleton, SkeletonColor, SkeletonProps, Table, TableProps, Tag, TagProps, Tags, ThreeColLayout, TitledList, TitledListProps, listProps, threeColLayoutProps };
|
|
290
|
+
export { Article, ArticleProps, ArticleSkeleton, ArticleSkeletonProps, BLinkDotProps, BlinkDot, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, DropImage, Error, ErrorBoundary, Gallery, GalleryProps, ImageDropProps, ImagePreviewerProps, ImageRenderer, Img, ImgProps, Link, LinkColor, LinkList, LinkListProps, LinkListSkeleton, LinkListSkeletonProps, LinkProps, List, LoadingSpiral, LoadingSpiralProps, Logo, LogoProps, Nav, NavProps, NoiseCover, NoiseCoverProps, NotFound, Page, Panel, PanelProps, PathObj, Photo, PopConfirm, PopConfirmProps, Skeleton, SkeletonColor, SkeletonProps, Table, TableProps, Tag, TagProps, Tags, ThreeColLayout, TitledList, TitledListProps, listProps, ossProcessType, threeColLayoutProps };
|
package/dist/index.js
CHANGED
|
@@ -88,7 +88,8 @@ __export(src_exports, {
|
|
|
88
88
|
Tag: () => Tag,
|
|
89
89
|
Tags: () => Tags,
|
|
90
90
|
ThreeColLayout: () => ThreeColLayout,
|
|
91
|
-
TitledList: () => TitledList
|
|
91
|
+
TitledList: () => TitledList,
|
|
92
|
+
ossProcessType: () => ossProcessType
|
|
92
93
|
});
|
|
93
94
|
|
|
94
95
|
// src/article/Article.tsx
|
|
@@ -851,6 +852,16 @@ var ThreeColLayout = (props) => {
|
|
|
851
852
|
var import_classnames10 = __toESM(require("classnames"));
|
|
852
853
|
var import_react19 = __toESM(require("react"));
|
|
853
854
|
|
|
855
|
+
// src/img/types.ts
|
|
856
|
+
var ossProcessType = /* @__PURE__ */ ((ossProcessType2) => {
|
|
857
|
+
ossProcessType2["THUMBNAIL"] = "thumbnail";
|
|
858
|
+
ossProcessType2["WEBP"] = "webp";
|
|
859
|
+
ossProcessType2["NULL"] = "null";
|
|
860
|
+
ossProcessType2["oWEBP"] = "owebp";
|
|
861
|
+
ossProcessType2["PROG"] = "prog";
|
|
862
|
+
return ossProcessType2;
|
|
863
|
+
})(ossProcessType || {});
|
|
864
|
+
|
|
854
865
|
// src/img/utils.ts
|
|
855
866
|
var addOssWebpProcessStyle = (originUrl, style) => {
|
|
856
867
|
const OSS_ADDRESS = "https://zjh-im-res.oss-cn-shenzhen.aliyuncs.com";
|
|
@@ -893,8 +904,8 @@ var Img = (props) => {
|
|
|
893
904
|
width: "initial",
|
|
894
905
|
height: "initial",
|
|
895
906
|
backgroundSize: "cover",
|
|
907
|
+
backgroundColor: avgColor || "#f1f1f1",
|
|
896
908
|
backgroundPosition: "0% 0%",
|
|
897
|
-
boxShadow: "inset 1px 1px #f1f1f1, inset -1px -1px #f1f1f1",
|
|
898
909
|
backgroundImage: `url(${thumbnailSrc ? thumbnailSrc : addOssWebpProcessStyle(src, "thumbnail" /* THUMBNAIL */)})`
|
|
899
910
|
};
|
|
900
911
|
const dynamicWrapperStyle = loaded && removeBlurBgAfterLoad ? { backgroundImage: "none" } : {};
|
|
@@ -1087,32 +1098,40 @@ var VERTEX_SHADER = `
|
|
|
1087
1098
|
uniform mat4 uViewMatrix;
|
|
1088
1099
|
uniform float uProgress;
|
|
1089
1100
|
varying vec3 vColor;
|
|
1090
|
-
mat4
|
|
1101
|
+
mat4 rotateX(float _angle){
|
|
1091
1102
|
return mat4(
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
0.0,
|
|
1103
|
+
1.0, 0.0, 0.0, 0.0,
|
|
1104
|
+
0.0, cos(_angle), -sin(_angle), 0.0,
|
|
1105
|
+
0.0, sin(_angle), cos(_angle), 0.0,
|
|
1095
1106
|
0.0, 0.0, 0.0, 1.0
|
|
1096
1107
|
);
|
|
1097
1108
|
}
|
|
1098
|
-
mat4
|
|
1109
|
+
mat4 rotateY(float _angle){
|
|
1099
1110
|
return mat4(
|
|
1100
|
-
|
|
1101
|
-
0.0, 1.0, 0.0,
|
|
1111
|
+
cos(_angle), 0.0, sin(_angle), 0.0,
|
|
1112
|
+
0.0, 1.0, 0.0, 0.0,
|
|
1113
|
+
-sin(_angle), 0.0, cos(_angle), 0.0,
|
|
1114
|
+
0.0, 0.0, 0.0, 1.0
|
|
1115
|
+
);
|
|
1116
|
+
}
|
|
1117
|
+
mat4 rotateZ(float _angle){
|
|
1118
|
+
return mat4(
|
|
1119
|
+
cos(_angle), -sin(_angle), 0.0, 0.0,
|
|
1120
|
+
sin(_angle), cos(_angle), 0.0, 0.0,
|
|
1102
1121
|
0.0, 0.0, 1.0, 0.0,
|
|
1103
1122
|
0.0, 0.0, 0.0, 1.0
|
|
1104
1123
|
);
|
|
1105
1124
|
}
|
|
1106
|
-
mat4
|
|
1125
|
+
mat4 translateY(float _offset){
|
|
1107
1126
|
return mat4(
|
|
1108
|
-
1.0, 0.0, 0.0,
|
|
1109
|
-
0.0, 1.0, 0.0,
|
|
1127
|
+
1.0, 0.0, 0.0, 0.0,
|
|
1128
|
+
0.0, 1.0, 0.0, -1.0 * _offset,
|
|
1110
1129
|
0.0, 0.0, 1.0, 0.0,
|
|
1111
1130
|
0.0, 0.0, 0.0, 1.0
|
|
1112
1131
|
);
|
|
1113
1132
|
}
|
|
1114
1133
|
void main(){
|
|
1115
|
-
gl_Position =
|
|
1134
|
+
gl_Position = uProjectionMatrix * uModelMatrix * uViewMatrix * rotateX(uProgress) * vec4(${"aPositionStart" /* POSITION_START */}, 1.0) * translateY(${"aOffsetY" /* OFFSET_Y */});
|
|
1116
1135
|
gl_PointSize = 1.0;
|
|
1117
1136
|
vColor = ${"aColor" /* COLOR */};
|
|
1118
1137
|
}
|
|
@@ -1128,10 +1147,6 @@ var FRAGMENT_SHADER = `
|
|
|
1128
1147
|
`;
|
|
1129
1148
|
|
|
1130
1149
|
// src/loading-spiral/utils.ts
|
|
1131
|
-
var scaleIndex = (multiplier, max) => (index) => {
|
|
1132
|
-
return index / (multiplier / max);
|
|
1133
|
-
};
|
|
1134
|
-
var scaleIndex2ang = (multiplier) => scaleIndex(multiplier, 360);
|
|
1135
1150
|
var rgba = (val) => {
|
|
1136
1151
|
const [r, g, b, a] = val;
|
|
1137
1152
|
return [r / 255, g / 255, b / 255, a];
|
|
@@ -1139,30 +1154,34 @@ var rgba = (val) => {
|
|
|
1139
1154
|
|
|
1140
1155
|
// src/loading-spiral/createOptions.ts
|
|
1141
1156
|
var DEFAULT_OPT = {
|
|
1142
|
-
multiplier:
|
|
1157
|
+
multiplier: 5e4,
|
|
1143
1158
|
color: [209, 213, 219, 1],
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1159
|
+
offset: -0.3,
|
|
1160
|
+
length: 0.15,
|
|
1161
|
+
radius: 0.028
|
|
1147
1162
|
};
|
|
1148
1163
|
var createOptions = (opt = DEFAULT_OPT) => {
|
|
1149
1164
|
const {
|
|
1150
1165
|
multiplier,
|
|
1151
|
-
spiralConstA,
|
|
1152
|
-
spiralConstB,
|
|
1153
1166
|
color,
|
|
1167
|
+
length,
|
|
1168
|
+
radius,
|
|
1154
1169
|
offset = -1 * 0.3
|
|
1155
1170
|
} = opt;
|
|
1156
1171
|
const attributes = [
|
|
1157
1172
|
{
|
|
1158
1173
|
name: "aPositionStart" /* POSITION_START */,
|
|
1159
|
-
data: (index) => {
|
|
1160
|
-
const
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1174
|
+
data: (index, total) => {
|
|
1175
|
+
const percent = index / total;
|
|
1176
|
+
const pi2 = Math.PI * 2;
|
|
1177
|
+
let x = length * Math.sin(pi2 * percent), y = radius * Math.cos(pi2 * 3 * percent), z, t;
|
|
1178
|
+
t = percent % 0.25 / 0.25;
|
|
1179
|
+
t = percent % 0.25 - (2 * (1 - t) * t * -0.0185 + t * t * 0.25);
|
|
1180
|
+
if (Math.floor(percent / 0.25) == 0 || Math.floor(percent / 0.25) == 2) {
|
|
1181
|
+
t *= -1;
|
|
1182
|
+
}
|
|
1183
|
+
z = radius * Math.sin(pi2 * 2 * (percent - t));
|
|
1184
|
+
return [x, y, z];
|
|
1166
1185
|
},
|
|
1167
1186
|
size: 3
|
|
1168
1187
|
},
|
|
@@ -1216,7 +1235,11 @@ var LoadingSpiral = (props) => {
|
|
|
1216
1235
|
return;
|
|
1217
1236
|
}
|
|
1218
1237
|
const phenomenon = new import_phenomenon.default({
|
|
1219
|
-
settings: createSettings({ canvas: canvasRef.current, step })
|
|
1238
|
+
settings: createSettings({ canvas: canvasRef.current, step }),
|
|
1239
|
+
context: {
|
|
1240
|
+
alpha: true,
|
|
1241
|
+
antialias: true
|
|
1242
|
+
}
|
|
1220
1243
|
});
|
|
1221
1244
|
phenomenon.add("spiral", createOptions(Object.assign({}, DEFAULT_OPT, rest)));
|
|
1222
1245
|
}, []);
|
|
@@ -1261,5 +1284,6 @@ module.exports = __toCommonJS(src_exports);
|
|
|
1261
1284
|
Tag,
|
|
1262
1285
|
Tags,
|
|
1263
1286
|
ThreeColLayout,
|
|
1264
|
-
TitledList
|
|
1287
|
+
TitledList,
|
|
1288
|
+
ossProcessType
|
|
1265
1289
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -793,6 +793,16 @@ var ThreeColLayout = (props) => {
|
|
|
793
793
|
import classnames from "classnames";
|
|
794
794
|
import React18, { useState as useState5 } from "react";
|
|
795
795
|
|
|
796
|
+
// src/img/types.ts
|
|
797
|
+
var ossProcessType = /* @__PURE__ */ ((ossProcessType2) => {
|
|
798
|
+
ossProcessType2["THUMBNAIL"] = "thumbnail";
|
|
799
|
+
ossProcessType2["WEBP"] = "webp";
|
|
800
|
+
ossProcessType2["NULL"] = "null";
|
|
801
|
+
ossProcessType2["oWEBP"] = "owebp";
|
|
802
|
+
ossProcessType2["PROG"] = "prog";
|
|
803
|
+
return ossProcessType2;
|
|
804
|
+
})(ossProcessType || {});
|
|
805
|
+
|
|
796
806
|
// src/img/utils.ts
|
|
797
807
|
var addOssWebpProcessStyle = (originUrl, style) => {
|
|
798
808
|
const OSS_ADDRESS = "https://zjh-im-res.oss-cn-shenzhen.aliyuncs.com";
|
|
@@ -835,8 +845,8 @@ var Img = (props) => {
|
|
|
835
845
|
width: "initial",
|
|
836
846
|
height: "initial",
|
|
837
847
|
backgroundSize: "cover",
|
|
848
|
+
backgroundColor: avgColor || "#f1f1f1",
|
|
838
849
|
backgroundPosition: "0% 0%",
|
|
839
|
-
boxShadow: "inset 1px 1px #f1f1f1, inset -1px -1px #f1f1f1",
|
|
840
850
|
backgroundImage: `url(${thumbnailSrc ? thumbnailSrc : addOssWebpProcessStyle(src, "thumbnail" /* THUMBNAIL */)})`
|
|
841
851
|
};
|
|
842
852
|
const dynamicWrapperStyle = loaded && removeBlurBgAfterLoad ? { backgroundImage: "none" } : {};
|
|
@@ -1029,32 +1039,40 @@ var VERTEX_SHADER = `
|
|
|
1029
1039
|
uniform mat4 uViewMatrix;
|
|
1030
1040
|
uniform float uProgress;
|
|
1031
1041
|
varying vec3 vColor;
|
|
1032
|
-
mat4
|
|
1042
|
+
mat4 rotateX(float _angle){
|
|
1033
1043
|
return mat4(
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
0.0,
|
|
1044
|
+
1.0, 0.0, 0.0, 0.0,
|
|
1045
|
+
0.0, cos(_angle), -sin(_angle), 0.0,
|
|
1046
|
+
0.0, sin(_angle), cos(_angle), 0.0,
|
|
1037
1047
|
0.0, 0.0, 0.0, 1.0
|
|
1038
1048
|
);
|
|
1039
1049
|
}
|
|
1040
|
-
mat4
|
|
1050
|
+
mat4 rotateY(float _angle){
|
|
1041
1051
|
return mat4(
|
|
1042
|
-
|
|
1043
|
-
0.0, 1.0, 0.0,
|
|
1052
|
+
cos(_angle), 0.0, sin(_angle), 0.0,
|
|
1053
|
+
0.0, 1.0, 0.0, 0.0,
|
|
1054
|
+
-sin(_angle), 0.0, cos(_angle), 0.0,
|
|
1055
|
+
0.0, 0.0, 0.0, 1.0
|
|
1056
|
+
);
|
|
1057
|
+
}
|
|
1058
|
+
mat4 rotateZ(float _angle){
|
|
1059
|
+
return mat4(
|
|
1060
|
+
cos(_angle), -sin(_angle), 0.0, 0.0,
|
|
1061
|
+
sin(_angle), cos(_angle), 0.0, 0.0,
|
|
1044
1062
|
0.0, 0.0, 1.0, 0.0,
|
|
1045
1063
|
0.0, 0.0, 0.0, 1.0
|
|
1046
1064
|
);
|
|
1047
1065
|
}
|
|
1048
|
-
mat4
|
|
1066
|
+
mat4 translateY(float _offset){
|
|
1049
1067
|
return mat4(
|
|
1050
|
-
1.0, 0.0, 0.0,
|
|
1051
|
-
0.0, 1.0, 0.0,
|
|
1068
|
+
1.0, 0.0, 0.0, 0.0,
|
|
1069
|
+
0.0, 1.0, 0.0, -1.0 * _offset,
|
|
1052
1070
|
0.0, 0.0, 1.0, 0.0,
|
|
1053
1071
|
0.0, 0.0, 0.0, 1.0
|
|
1054
1072
|
);
|
|
1055
1073
|
}
|
|
1056
1074
|
void main(){
|
|
1057
|
-
gl_Position =
|
|
1075
|
+
gl_Position = uProjectionMatrix * uModelMatrix * uViewMatrix * rotateX(uProgress) * vec4(${"aPositionStart" /* POSITION_START */}, 1.0) * translateY(${"aOffsetY" /* OFFSET_Y */});
|
|
1058
1076
|
gl_PointSize = 1.0;
|
|
1059
1077
|
vColor = ${"aColor" /* COLOR */};
|
|
1060
1078
|
}
|
|
@@ -1070,10 +1088,6 @@ var FRAGMENT_SHADER = `
|
|
|
1070
1088
|
`;
|
|
1071
1089
|
|
|
1072
1090
|
// src/loading-spiral/utils.ts
|
|
1073
|
-
var scaleIndex = (multiplier, max) => (index) => {
|
|
1074
|
-
return index / (multiplier / max);
|
|
1075
|
-
};
|
|
1076
|
-
var scaleIndex2ang = (multiplier) => scaleIndex(multiplier, 360);
|
|
1077
1091
|
var rgba = (val) => {
|
|
1078
1092
|
const [r, g, b, a] = val;
|
|
1079
1093
|
return [r / 255, g / 255, b / 255, a];
|
|
@@ -1081,30 +1095,34 @@ var rgba = (val) => {
|
|
|
1081
1095
|
|
|
1082
1096
|
// src/loading-spiral/createOptions.ts
|
|
1083
1097
|
var DEFAULT_OPT = {
|
|
1084
|
-
multiplier:
|
|
1098
|
+
multiplier: 5e4,
|
|
1085
1099
|
color: [209, 213, 219, 1],
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1100
|
+
offset: -0.3,
|
|
1101
|
+
length: 0.15,
|
|
1102
|
+
radius: 0.028
|
|
1089
1103
|
};
|
|
1090
1104
|
var createOptions = (opt = DEFAULT_OPT) => {
|
|
1091
1105
|
const {
|
|
1092
1106
|
multiplier,
|
|
1093
|
-
spiralConstA,
|
|
1094
|
-
spiralConstB,
|
|
1095
1107
|
color,
|
|
1108
|
+
length,
|
|
1109
|
+
radius,
|
|
1096
1110
|
offset = -1 * 0.3
|
|
1097
1111
|
} = opt;
|
|
1098
1112
|
const attributes = [
|
|
1099
1113
|
{
|
|
1100
1114
|
name: "aPositionStart" /* POSITION_START */,
|
|
1101
|
-
data: (index) => {
|
|
1102
|
-
const
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1115
|
+
data: (index, total) => {
|
|
1116
|
+
const percent = index / total;
|
|
1117
|
+
const pi2 = Math.PI * 2;
|
|
1118
|
+
let x = length * Math.sin(pi2 * percent), y = radius * Math.cos(pi2 * 3 * percent), z, t;
|
|
1119
|
+
t = percent % 0.25 / 0.25;
|
|
1120
|
+
t = percent % 0.25 - (2 * (1 - t) * t * -0.0185 + t * t * 0.25);
|
|
1121
|
+
if (Math.floor(percent / 0.25) == 0 || Math.floor(percent / 0.25) == 2) {
|
|
1122
|
+
t *= -1;
|
|
1123
|
+
}
|
|
1124
|
+
z = radius * Math.sin(pi2 * 2 * (percent - t));
|
|
1125
|
+
return [x, y, z];
|
|
1108
1126
|
},
|
|
1109
1127
|
size: 3
|
|
1110
1128
|
},
|
|
@@ -1158,7 +1176,11 @@ var LoadingSpiral = (props) => {
|
|
|
1158
1176
|
return;
|
|
1159
1177
|
}
|
|
1160
1178
|
const phenomenon = new Phenomenon({
|
|
1161
|
-
settings: createSettings({ canvas: canvasRef.current, step })
|
|
1179
|
+
settings: createSettings({ canvas: canvasRef.current, step }),
|
|
1180
|
+
context: {
|
|
1181
|
+
alpha: true,
|
|
1182
|
+
antialias: true
|
|
1183
|
+
}
|
|
1162
1184
|
});
|
|
1163
1185
|
phenomenon.add("spiral", createOptions(Object.assign({}, DEFAULT_OPT, rest)));
|
|
1164
1186
|
}, []);
|
|
@@ -1201,5 +1223,6 @@ export {
|
|
|
1201
1223
|
Tag,
|
|
1202
1224
|
Tags,
|
|
1203
1225
|
ThreeColLayout,
|
|
1204
|
-
TitledList
|
|
1226
|
+
TitledList,
|
|
1227
|
+
ossProcessType
|
|
1205
1228
|
};
|