@bbki.ng/components 1.5.30 → 1.5.33

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
@@ -1,4 +1,4 @@
1
- import React, { FunctionComponent, EventHandler, ReactElement, CSSProperties, Ref, ReactNode } from 'react';
1
+ import React, { FunctionComponent, EventHandler, ReactElement, ReactNode, CSSProperties, Ref } from 'react';
2
2
  import { LinkProps as LinkProps$1 } from 'react-router-dom';
3
3
 
4
4
  declare type ArticleProps = {
@@ -82,7 +82,7 @@ declare const Panel: (props: PanelProps) => JSX.Element;
82
82
  declare type PageProps = {
83
83
  nav: ReactElement;
84
84
  main: ReactElement;
85
- footer: ReactElement;
85
+ footer: ReactNode;
86
86
  };
87
87
  declare const Page: (props: PageProps) => JSX.Element;
88
88
  declare const NotFound: (props: {
@@ -273,6 +273,7 @@ interface IOpt {
273
273
  color: number[];
274
274
  spiralConstA: number;
275
275
  spiralConstB: number;
276
+ offset?: number;
276
277
  }
277
278
 
278
279
  interface LoadingSpiralProps extends IOpt, ISettings {
package/dist/index.js CHANGED
@@ -233,9 +233,11 @@ var Breadcrumb = (props) => {
233
233
  const offsetCls = (0, import_classnames3.default)({ "relative top-[2px]": isNonEnName });
234
234
  const link = path ? /* @__PURE__ */ import_react4.default.createElement(Link, {
235
235
  to: path,
236
- className: offsetCls
236
+ className: offsetCls,
237
+ style: { padding: 4 }
237
238
  }, name) : /* @__PURE__ */ import_react4.default.createElement("span", {
238
- className: (0, import_classnames3.default)("text-gray-400", offsetCls)
239
+ className: (0, import_classnames3.default)("text-gray-400", offsetCls),
240
+ style: { padding: 4 }
239
241
  }, name);
240
242
  return /* @__PURE__ */ import_react4.default.createElement("span", {
241
243
  key: path || name
@@ -1068,6 +1070,7 @@ var createSettings = (settings) => {
1068
1070
  var VERTEX_SHADER = `
1069
1071
  attribute vec3 ${"aPositionStart" /* POSITION_START */};
1070
1072
  attribute vec3 ${"aColor" /* COLOR */};
1073
+ attribute float ${"aOffsetY" /* OFFSET_Y */};
1071
1074
  uniform mat4 uProjectionMatrix;
1072
1075
  uniform mat4 uModelMatrix;
1073
1076
  uniform mat4 uViewMatrix;
@@ -1081,6 +1084,14 @@ var VERTEX_SHADER = `
1081
1084
  0.0, 0.0, 0.0, 1.0
1082
1085
  );
1083
1086
  }
1087
+ mat4 translateY(float _offset){
1088
+ return mat4(
1089
+ 1.0, 0.0, 0.0, 0.0,
1090
+ 0.0, 1.0, 0.0, -1.0 * _offset,
1091
+ 0.0, 0.0, 1.0, 0.0,
1092
+ 0.0, 0.0, 0.0, 1.0
1093
+ );
1094
+ }
1084
1095
  mat4 translate(float _angle){
1085
1096
  return mat4(
1086
1097
  1.0, 0.0, 0.0, sin(_angle) * 0.02,
@@ -1090,7 +1101,7 @@ var VERTEX_SHADER = `
1090
1101
  );
1091
1102
  }
1092
1103
  void main(){
1093
- gl_Position = rotate(uProgress) * uProjectionMatrix * uModelMatrix * uViewMatrix * vec4(${"aPositionStart" /* POSITION_START */}, 1.0) * translate(uProgress);
1104
+ gl_Position = rotate(uProgress) * uProjectionMatrix * uModelMatrix * uViewMatrix * vec4(${"aPositionStart" /* POSITION_START */}, 1.0) * translate(uProgress) * translateY(${"aOffsetY" /* OFFSET_Y */});
1094
1105
  gl_PointSize = 1.0;
1095
1106
  vColor = ${"aColor" /* COLOR */};
1096
1107
  }
@@ -1120,10 +1131,17 @@ var DEFAULT_OPT = {
1120
1131
  multiplier: 1e4,
1121
1132
  color: [209, 213, 219, 1],
1122
1133
  spiralConstA: 0.04,
1123
- spiralConstB: 0.16
1134
+ spiralConstB: 0.16,
1135
+ offset: -0.3
1124
1136
  };
1125
1137
  var createOptions = (opt = DEFAULT_OPT) => {
1126
- const { multiplier, spiralConstA, spiralConstB, color } = opt;
1138
+ const {
1139
+ multiplier,
1140
+ spiralConstA,
1141
+ spiralConstB,
1142
+ color,
1143
+ offset = -1 * 0.3
1144
+ } = opt;
1127
1145
  const attributes = [
1128
1146
  {
1129
1147
  name: "aPositionStart" /* POSITION_START */,
@@ -1141,6 +1159,11 @@ var createOptions = (opt = DEFAULT_OPT) => {
1141
1159
  name: "aColor" /* COLOR */,
1142
1160
  data: () => rgba(color),
1143
1161
  size: 3
1162
+ },
1163
+ {
1164
+ name: "aOffsetY" /* OFFSET_Y */,
1165
+ data: () => [offset],
1166
+ size: 1
1144
1167
  }
1145
1168
  ];
1146
1169
  return {
@@ -1153,7 +1176,7 @@ var createOptions = (opt = DEFAULT_OPT) => {
1153
1176
 
1154
1177
  // src/loading-spiral/useCanvasRef.ts
1155
1178
  var import_react22 = require("react");
1156
- var useResizedCanvasRef = (maxSize, offset) => {
1179
+ var useResizedCanvasRef = (maxSize) => {
1157
1180
  const canvasRef = (0, import_react22.useRef)(null);
1158
1181
  const containerRef = (0, import_react22.useRef)(null);
1159
1182
  (0, import_react22.useEffect)(() => {
@@ -1164,7 +1187,6 @@ var useResizedCanvasRef = (maxSize, offset) => {
1164
1187
  const { width, height } = container.getBoundingClientRect();
1165
1188
  const canvasSize = Math.max(width, height);
1166
1189
  const size = Math.min(canvasSize, maxSize);
1167
- canvas.style.top = `${offset}px`;
1168
1190
  canvas.setAttribute("width", `${size}`);
1169
1191
  canvas.setAttribute("height", `${size}`);
1170
1192
  }, []);
@@ -1176,20 +1198,8 @@ var useResizedCanvasRef = (maxSize, offset) => {
1176
1198
 
1177
1199
  // src/loading-spiral/LoadingSpiral.tsx
1178
1200
  var LoadingSpiral = (props) => {
1179
- const _a = props || {}, {
1180
- className,
1181
- canvas,
1182
- step,
1183
- maxWidth = 1e3,
1184
- offset = -100
1185
- } = _a, rest = __objRest(_a, [
1186
- "className",
1187
- "canvas",
1188
- "step",
1189
- "maxWidth",
1190
- "offset"
1191
- ]);
1192
- const { canvasRef, containerRef } = useResizedCanvasRef(maxWidth, offset);
1201
+ const _a = props || {}, { className, canvas, step, maxWidth = 1e3 } = _a, rest = __objRest(_a, ["className", "canvas", "step", "maxWidth"]);
1202
+ const { canvasRef, containerRef } = useResizedCanvasRef(maxWidth);
1193
1203
  (0, import_react23.useEffect)(() => {
1194
1204
  if (!canvasRef.current) {
1195
1205
  return;
package/dist/index.mjs CHANGED
@@ -172,9 +172,11 @@ var Breadcrumb = (props) => {
172
172
  const offsetCls = classNames3({ "relative top-[2px]": isNonEnName });
173
173
  const link = path ? /* @__PURE__ */ React5.createElement(Link, {
174
174
  to: path,
175
- className: offsetCls
175
+ className: offsetCls,
176
+ style: { padding: 4 }
176
177
  }, name) : /* @__PURE__ */ React5.createElement("span", {
177
- className: classNames3("text-gray-400", offsetCls)
178
+ className: classNames3("text-gray-400", offsetCls),
179
+ style: { padding: 4 }
178
180
  }, name);
179
181
  return /* @__PURE__ */ React5.createElement("span", {
180
182
  key: path || name
@@ -1010,6 +1012,7 @@ var createSettings = (settings) => {
1010
1012
  var VERTEX_SHADER = `
1011
1013
  attribute vec3 ${"aPositionStart" /* POSITION_START */};
1012
1014
  attribute vec3 ${"aColor" /* COLOR */};
1015
+ attribute float ${"aOffsetY" /* OFFSET_Y */};
1013
1016
  uniform mat4 uProjectionMatrix;
1014
1017
  uniform mat4 uModelMatrix;
1015
1018
  uniform mat4 uViewMatrix;
@@ -1023,6 +1026,14 @@ var VERTEX_SHADER = `
1023
1026
  0.0, 0.0, 0.0, 1.0
1024
1027
  );
1025
1028
  }
1029
+ mat4 translateY(float _offset){
1030
+ return mat4(
1031
+ 1.0, 0.0, 0.0, 0.0,
1032
+ 0.0, 1.0, 0.0, -1.0 * _offset,
1033
+ 0.0, 0.0, 1.0, 0.0,
1034
+ 0.0, 0.0, 0.0, 1.0
1035
+ );
1036
+ }
1026
1037
  mat4 translate(float _angle){
1027
1038
  return mat4(
1028
1039
  1.0, 0.0, 0.0, sin(_angle) * 0.02,
@@ -1032,7 +1043,7 @@ var VERTEX_SHADER = `
1032
1043
  );
1033
1044
  }
1034
1045
  void main(){
1035
- gl_Position = rotate(uProgress) * uProjectionMatrix * uModelMatrix * uViewMatrix * vec4(${"aPositionStart" /* POSITION_START */}, 1.0) * translate(uProgress);
1046
+ gl_Position = rotate(uProgress) * uProjectionMatrix * uModelMatrix * uViewMatrix * vec4(${"aPositionStart" /* POSITION_START */}, 1.0) * translate(uProgress) * translateY(${"aOffsetY" /* OFFSET_Y */});
1036
1047
  gl_PointSize = 1.0;
1037
1048
  vColor = ${"aColor" /* COLOR */};
1038
1049
  }
@@ -1062,10 +1073,17 @@ var DEFAULT_OPT = {
1062
1073
  multiplier: 1e4,
1063
1074
  color: [209, 213, 219, 1],
1064
1075
  spiralConstA: 0.04,
1065
- spiralConstB: 0.16
1076
+ spiralConstB: 0.16,
1077
+ offset: -0.3
1066
1078
  };
1067
1079
  var createOptions = (opt = DEFAULT_OPT) => {
1068
- const { multiplier, spiralConstA, spiralConstB, color } = opt;
1080
+ const {
1081
+ multiplier,
1082
+ spiralConstA,
1083
+ spiralConstB,
1084
+ color,
1085
+ offset = -1 * 0.3
1086
+ } = opt;
1069
1087
  const attributes = [
1070
1088
  {
1071
1089
  name: "aPositionStart" /* POSITION_START */,
@@ -1083,6 +1101,11 @@ var createOptions = (opt = DEFAULT_OPT) => {
1083
1101
  name: "aColor" /* COLOR */,
1084
1102
  data: () => rgba(color),
1085
1103
  size: 3
1104
+ },
1105
+ {
1106
+ name: "aOffsetY" /* OFFSET_Y */,
1107
+ data: () => [offset],
1108
+ size: 1
1086
1109
  }
1087
1110
  ];
1088
1111
  return {
@@ -1095,7 +1118,7 @@ var createOptions = (opt = DEFAULT_OPT) => {
1095
1118
 
1096
1119
  // src/loading-spiral/useCanvasRef.ts
1097
1120
  import { useEffect as useEffect3, useRef as useRef2 } from "react";
1098
- var useResizedCanvasRef = (maxSize, offset) => {
1121
+ var useResizedCanvasRef = (maxSize) => {
1099
1122
  const canvasRef = useRef2(null);
1100
1123
  const containerRef = useRef2(null);
1101
1124
  useEffect3(() => {
@@ -1106,7 +1129,6 @@ var useResizedCanvasRef = (maxSize, offset) => {
1106
1129
  const { width, height } = container.getBoundingClientRect();
1107
1130
  const canvasSize = Math.max(width, height);
1108
1131
  const size = Math.min(canvasSize, maxSize);
1109
- canvas.style.top = `${offset}px`;
1110
1132
  canvas.setAttribute("width", `${size}`);
1111
1133
  canvas.setAttribute("height", `${size}`);
1112
1134
  }, []);
@@ -1118,20 +1140,8 @@ var useResizedCanvasRef = (maxSize, offset) => {
1118
1140
 
1119
1141
  // src/loading-spiral/LoadingSpiral.tsx
1120
1142
  var LoadingSpiral = (props) => {
1121
- const _a = props || {}, {
1122
- className,
1123
- canvas,
1124
- step,
1125
- maxWidth = 1e3,
1126
- offset = -100
1127
- } = _a, rest = __objRest(_a, [
1128
- "className",
1129
- "canvas",
1130
- "step",
1131
- "maxWidth",
1132
- "offset"
1133
- ]);
1134
- const { canvasRef, containerRef } = useResizedCanvasRef(maxWidth, offset);
1143
+ const _a = props || {}, { className, canvas, step, maxWidth = 1e3 } = _a, rest = __objRest(_a, ["className", "canvas", "step", "maxWidth"]);
1144
+ const { canvasRef, containerRef } = useResizedCanvasRef(maxWidth);
1135
1145
  useEffect4(() => {
1136
1146
  if (!canvasRef.current) {
1137
1147
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/components",
3
- "version": "1.5.30",
3
+ "version": "1.5.33",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",