react-better-html 1.1.162 → 1.1.163

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.mts CHANGED
@@ -2,7 +2,6 @@ import { WebTarget } from 'styled-components';
2
2
  import * as react from 'react';
3
3
  import { ComponentProps, ReactNode } from 'react';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import * as reactRouterDomLib from 'react-router-dom';
6
5
 
7
6
  type PluginName = "alerts" | "react-router-dom" | "localStorage";
8
7
  type BetterHtmlPluginConstructor<T extends object = object> = (config?: T) => BetterHtmlPlugin<T>;
@@ -1012,9 +1011,7 @@ type AlertsPluginOptions = {
1012
1011
  declare const defaultAlertsPluginOptions: Required<AlertsPluginOptions>;
1013
1012
  declare const alertsPlugin: BetterHtmlPluginConstructor<AlertsPluginOptions>;
1014
1013
 
1015
- type ReactRouterDomPluginOptions = {
1016
- reactRouterDomLib: typeof reactRouterDomLib;
1017
- };
1014
+ type ReactRouterDomPluginOptions = {};
1018
1015
  declare const defaultReactRouterDomPluginOptions: Required<ReactRouterDomPluginOptions>;
1019
1016
  declare const reactRouterDomPlugin: BetterHtmlPluginConstructor<ReactRouterDomPluginOptions>;
1020
1017
 
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import { WebTarget } from 'styled-components';
2
2
  import * as react from 'react';
3
3
  import { ComponentProps, ReactNode } from 'react';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import * as reactRouterDomLib from 'react-router-dom';
6
5
 
7
6
  type PluginName = "alerts" | "react-router-dom" | "localStorage";
8
7
  type BetterHtmlPluginConstructor<T extends object = object> = (config?: T) => BetterHtmlPlugin<T>;
@@ -1012,9 +1011,7 @@ type AlertsPluginOptions = {
1012
1011
  declare const defaultAlertsPluginOptions: Required<AlertsPluginOptions>;
1013
1012
  declare const alertsPlugin: BetterHtmlPluginConstructor<AlertsPluginOptions>;
1014
1013
 
1015
- type ReactRouterDomPluginOptions = {
1016
- reactRouterDomLib: typeof reactRouterDomLib;
1017
- };
1014
+ type ReactRouterDomPluginOptions = {};
1018
1015
  declare const defaultReactRouterDomPluginOptions: Required<ReactRouterDomPluginOptions>;
1019
1016
  declare const reactRouterDomPlugin: BetterHtmlPluginConstructor<ReactRouterDomPluginOptions>;
1020
1017
 
package/dist/index.js CHANGED
@@ -102,6 +102,7 @@ var isMobileDevice = /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Op
102
102
 
103
103
  // src/utils/hooks.ts
104
104
  var import_react10 = require("react");
105
+ var import_react_router_dom = require("react-router-dom");
105
106
 
106
107
  // src/constants/css.ts
107
108
  var cssProps = {
@@ -1639,10 +1640,7 @@ var alertsPlugin = (options) => ({
1639
1640
  });
1640
1641
 
1641
1642
  // src/plugins/reactRouterDom.ts
1642
- var reactRouterDomLib = __toESM(require("react-router-dom"));
1643
- var defaultReactRouterDomPluginOptions = {
1644
- reactRouterDomLib
1645
- };
1643
+ var defaultReactRouterDomPluginOptions = {};
1646
1644
  var reactRouterDomPlugin = (options) => ({
1647
1645
  name: "react-router-dom",
1648
1646
  initialize: () => {
@@ -3153,15 +3151,14 @@ function useUrlQuery() {
3153
3151
  "`useUrlQuery` hook requires the `react-router-dom` plugin to be added to the `plugins` prop in `<BetterHtmlProvider>`."
3154
3152
  );
3155
3153
  }
3156
- const reactRouterDomPluginConfig = reactRouterDomPlugin2.getConfig();
3157
- const isInRouterContext = reactRouterDomPluginConfig.reactRouterDomLib.useInRouterContext();
3154
+ const isInRouterContext = (0, import_react_router_dom.useInRouterContext)();
3158
3155
  if (!isInRouterContext) {
3159
3156
  throw new Error(
3160
3157
  "`useUrlQuery` hook must be used inside a React Router context. Make sure your component is wrapped in a `<BrowserRouter>`, or another Router component."
3161
3158
  );
3162
3159
  }
3163
- const navigate = reactRouterDomPluginConfig.reactRouterDomLib.useNavigate();
3164
- const [searchParams] = reactRouterDomPluginConfig.reactRouterDomLib.useSearchParams();
3160
+ const navigate = (0, import_react_router_dom.useNavigate)();
3161
+ const [searchParams] = (0, import_react_router_dom.useSearchParams)();
3165
3162
  const setQuery = (0, import_react10.useCallback)(
3166
3163
  (query, keepHistory = true) => {
3167
3164
  const currentSearchParams = {};
@@ -3170,7 +3167,7 @@ function useUrlQuery() {
3170
3167
  });
3171
3168
  navigate(
3172
3169
  {
3173
- search: reactRouterDomPluginConfig.reactRouterDomLib.createSearchParams({
3170
+ search: (0, import_react_router_dom.createSearchParams)({
3174
3171
  ...currentSearchParams,
3175
3172
  ...Object.fromEntries(Object.entries(query).map(([key, value]) => [key, value.toString()]))
3176
3173
  }).toString()