@webstudio-is/sdk-components-react-router 0.205.0 → 0.206.0

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/lib/components.js CHANGED
@@ -1,12 +1,11 @@
1
1
  import { Body as m } from "./body.js";
2
- import { Link as x } from "./link.js";
3
- import { RichTextLink as f } from "./rich-text-link.js";
4
- import { WebhookForm as i } from "./webhook-form.js";
5
- import { RemixForm as F } from "./remix-form.js";
2
+ import { Link as x, Link as i } from "./link.js";
3
+ import { WebhookForm as f } from "./webhook-form.js";
4
+ import { RemixForm as p } from "./remix-form.js";
6
5
  export {
7
6
  m as Body,
8
- i as Form,
7
+ f as Form,
9
8
  x as Link,
10
- F as RemixForm,
11
- f as RichTextLink
9
+ p as RemixForm,
10
+ i as RichTextLink
12
11
  };
package/lib/link.js CHANGED
@@ -1,6 +1,19 @@
1
- import { Link as o } from "@webstudio-is/sdk-components-react";
2
- import { wrapLinkComponent as n } from "./shared/remix-link.js";
3
- const m = n(o);
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { forwardRef as n, useContext as m } from "react";
3
+ import { NavLink as f } from "react-router";
4
+ import { ReactSdkContext as c } from "@webstudio-is/react-sdk/runtime";
5
+ import { Link as s } from "@webstudio-is/sdk-components-react";
6
+ const l = n((r, e) => {
7
+ const { assetBaseUrl: a } = m(c), t = String(r.href ?? "");
8
+ if (
9
+ // remix appends ?index in runtime but not in ssr
10
+ t === "" || t.startsWith("?") || t.startsWith("/") && t.startsWith(a) === !1
11
+ )
12
+ return /* @__PURE__ */ o(f, { ...r, to: t, ref: e, end: !0 });
13
+ const { prefetch: p, reloadDocument: d, replace: h, preventScrollReset: k, ...i } = r;
14
+ return /* @__PURE__ */ o(s, { ...i, ref: e });
15
+ });
16
+ l.displayName = s.displayName;
4
17
  export {
5
- m as Link
18
+ l as Link
6
19
  };
@@ -1,16 +1 @@
1
- export declare const RichTextLink: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target" | "download"> & {
2
- target?: "_self" | "_blank" | "_parent" | "_top";
3
- download?: boolean;
4
- prefetch?: "none" | "intent" | "render" | "viewport";
5
- preventScrollReset?: boolean;
6
- reloadDocument?: boolean;
7
- replace?: boolean;
8
- } & {
9
- $webstudio$canvasOnly$assetId?: string | undefined;
10
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
11
- target?: "_self" | "_blank" | "_parent" | "_top";
12
- prefetch?: "none" | "intent" | "render" | "viewport";
13
- reloadDocument?: boolean;
14
- replace?: boolean;
15
- preventScrollReset?: boolean;
16
- } & import("react").RefAttributes<HTMLAnchorElement>>;
1
+ export { Link as RichTextLink } from "./link";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react-router",
3
- "version": "0.205.0",
3
+ "version": "0.206.0",
4
4
  "description": "Webstudio components for React Router",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -35,9 +35,9 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "react-router": "^7.1.5",
38
- "@webstudio-is/sdk": "0.205.0",
39
- "@webstudio-is/react-sdk": "0.205.0",
40
- "@webstudio-is/sdk-components-react": "0.205.0"
38
+ "@webstudio-is/react-sdk": "0.206.0",
39
+ "@webstudio-is/sdk": "0.206.0",
40
+ "@webstudio-is/sdk-components-react": "0.206.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/react": "^18.2.70",
@@ -1,6 +0,0 @@
1
- import { RichTextLink as i } from "@webstudio-is/sdk-components-react";
2
- import { wrapLinkComponent as o } from "./shared/remix-link.js";
3
- const r = o(i);
4
- export {
5
- r as RichTextLink
6
- };
@@ -1,20 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as m, useContext as c } from "react";
3
- import { NavLink as f } from "react-router";
4
- import { ReactSdkContext as p } from "@webstudio-is/react-sdk/runtime";
5
- const R = (e) => {
6
- const o = m((r, s) => {
7
- const { assetBaseUrl: a } = c(p), t = String(r.href ?? "");
8
- if (
9
- // remix appends ?index in runtime but not in ssr
10
- t === "" || t.startsWith("?") || t.startsWith("#") || t.startsWith("/") && t.startsWith(a) === !1
11
- )
12
- return /* @__PURE__ */ n(f, { ...r, to: t, ref: s, end: !0 });
13
- const { prefetch: l, reloadDocument: h, replace: d, preventScrollReset: u, ...i } = r;
14
- return /* @__PURE__ */ n(e, { ...i, ref: s });
15
- });
16
- return o.displayName = e.displayName, o;
17
- };
18
- export {
19
- R as wrapLinkComponent
20
- };
@@ -1,17 +0,0 @@
1
- import type { Link } from "@webstudio-is/sdk-components-react";
2
- export declare const wrapLinkComponent: (BaseLink: typeof Link) => import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target" | "download"> & {
3
- target?: "_self" | "_blank" | "_parent" | "_top";
4
- download?: boolean;
5
- prefetch?: "none" | "intent" | "render" | "viewport";
6
- preventScrollReset?: boolean;
7
- reloadDocument?: boolean;
8
- replace?: boolean;
9
- } & {
10
- $webstudio$canvasOnly$assetId?: string | undefined;
11
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
12
- target?: "_self" | "_blank" | "_parent" | "_top";
13
- prefetch?: "none" | "intent" | "render" | "viewport";
14
- reloadDocument?: boolean;
15
- replace?: boolean;
16
- preventScrollReset?: boolean;
17
- } & import("react").RefAttributes<HTMLAnchorElement>>;