@xfe-repo/web-register 1.0.1 → 1.0.3

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.js CHANGED
@@ -335,7 +335,7 @@ var import_hoist_non_react_statics = __toESM(require("hoist-non-react-statics"))
335
335
  // src/Register.tsx
336
336
  var import_react = require("react");
337
337
  var import_react_helmet = require("react-helmet");
338
- var import_qs = __toESM(require("qs"));
338
+ var import_query_string = __toESM(require("query-string"));
339
339
  var import_jsx_runtime = require("react/jsx-runtime");
340
340
  var createRegisterComponent = function(config, getContext, WrappedComponent) {
341
341
  var RegisterComponent = (0, import_react.memo)(function(props) {
@@ -343,8 +343,9 @@ var createRegisterComponent = function(config, getContext, WrappedComponent) {
343
343
  var isPreload = context.isPreload;
344
344
  var name = config.name, ErrorFullback = config.ErrorFullback, LoadFullback = config.LoadFullback, renderTitle = config.renderTitle;
345
345
  var query = (0, import_react.useMemo)(function() {
346
- return import_qs.default.parse(location.search, {
347
- ignoreQueryPrefix: true
346
+ return import_query_string.default.parse(location.search, {
347
+ parseBooleans: true,
348
+ parseNumbers: true
348
349
  });
349
350
  }, []);
350
351
  var _ref = _sliced_to_array((0, import_react.useState)(!isPreload), 2), needLoad = _ref[0], setNeedLoad = _ref[1];
package/dist/index.mjs CHANGED
@@ -4,14 +4,14 @@ import hoistNonReactStatic from "hoist-non-react-statics";
4
4
  // src/Register.tsx
5
5
  import { memo, Fragment, useEffect, useState, useCallback, useMemo } from "react";
6
6
  import { Helmet } from "react-helmet";
7
- import qs from "qs";
7
+ import queryString from "query-string";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  var createRegisterComponent = (config, getContext, WrappedComponent) => {
10
10
  const RegisterComponent = memo((props) => {
11
11
  const context = getContext();
12
12
  const { isPreload } = context;
13
13
  const { name, ErrorFullback, LoadFullback, renderTitle } = config;
14
- const query = useMemo(() => qs.parse(location.search, { ignoreQueryPrefix: true }), []);
14
+ const query = useMemo(() => queryString.parse(location.search, { parseBooleans: true, parseNumbers: true }), []);
15
15
  const [needLoad, setNeedLoad] = useState(!isPreload);
16
16
  const [loadError, setLoadError] = useState();
17
17
  let isLeave = false;
package/package.json CHANGED
@@ -1,12 +1,21 @@
1
1
  {
2
2
  "name": "@xfe-repo/web-register",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "sideEffects": false,
5
5
  "exports": {
6
6
  ".": {
7
- "import": "./dist/index.mjs",
8
- "require": "./dist/index.js",
9
- "types": "./dist/index.d.ts"
7
+ "import": {
8
+ "types": "./dist/index.d.mts",
9
+ "default": "./dist/index.mjs"
10
+ },
11
+ "require": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "default": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.js"
18
+ }
10
19
  }
11
20
  },
12
21
  "files": [
@@ -14,17 +23,16 @@
14
23
  ],
15
24
  "dependencies": {
16
25
  "hoist-non-react-statics": "^3.3.2",
17
- "qs": "^6.11.2",
26
+ "query-string": "^7.1.3",
18
27
  "react-helmet": "^6.1.0"
19
28
  },
20
29
  "devDependencies": {
21
30
  "@types/hoist-non-react-statics": "^3.3.5",
22
31
  "@types/node": "^20.10.4",
23
- "@types/qs": "^6.9.10",
24
32
  "@types/react": "^18.2.0",
25
33
  "@types/react-helmet": "^6.1.11",
26
- "@xfe-repo/eslint-config": "0.0.1",
27
- "@xfe-repo/typescript-config": "0.0.2"
34
+ "@xfe-repo/typescript-config": "0.0.3",
35
+ "@xfe-repo/eslint-config": "0.0.1"
28
36
  },
29
37
  "scripts": {
30
38
  "build": "tsup",