@webstudio-is/sdk-components-react-remix 0.71.0 → 0.73.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.
@@ -2,14 +2,8 @@ const props = {
2
2
  slot: { required: false, control: "text", type: "string" },
3
3
  style: { required: false, control: "text", type: "string" },
4
4
  title: { required: false, control: "text", type: "string" },
5
- href: { required: false, control: "text", type: "string" },
6
- target: {
7
- required: false,
8
- control: "select",
9
- type: "string",
10
- options: ["_self", "_blank", "_parent", "_top"]
11
- },
12
5
  download: { required: false, control: "text", type: "string" },
6
+ href: { required: false, control: "text", type: "string" },
13
7
  hrefLang: { required: false, control: "text", type: "string" },
14
8
  media: { required: false, control: "text", type: "string" },
15
9
  ping: { required: false, control: "text", type: "string" },
@@ -420,12 +414,21 @@ const props = {
420
414
  control: "text",
421
415
  type: "string"
422
416
  },
417
+ target: {
418
+ required: false,
419
+ control: "select",
420
+ type: "string",
421
+ options: ["_self", "_blank", "_parent", "_top"]
422
+ },
423
423
  prefetch: {
424
424
  required: false,
425
425
  control: "radio",
426
426
  type: "string",
427
427
  options: ["none", "intent", "render"]
428
- }
428
+ },
429
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
430
+ replace: { required: false, control: "boolean", type: "boolean" },
431
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" }
429
432
  };
430
433
  export {
431
434
  props
@@ -2,14 +2,8 @@ const props = {
2
2
  slot: { required: false, control: "text", type: "string" },
3
3
  style: { required: false, control: "text", type: "string" },
4
4
  title: { required: false, control: "text", type: "string" },
5
- href: { required: false, control: "text", type: "string" },
6
- target: {
7
- required: false,
8
- control: "select",
9
- type: "string",
10
- options: ["_self", "_blank", "_parent", "_top"]
11
- },
12
5
  download: { required: false, control: "text", type: "string" },
6
+ href: { required: false, control: "text", type: "string" },
13
7
  hrefLang: { required: false, control: "text", type: "string" },
14
8
  media: { required: false, control: "text", type: "string" },
15
9
  ping: { required: false, control: "text", type: "string" },
@@ -420,12 +414,21 @@ const props = {
420
414
  control: "text",
421
415
  type: "string"
422
416
  },
417
+ target: {
418
+ required: false,
419
+ control: "select",
420
+ type: "string",
421
+ options: ["_self", "_blank", "_parent", "_top"]
422
+ },
423
423
  prefetch: {
424
424
  required: false,
425
425
  control: "radio",
426
426
  type: "string",
427
427
  options: ["none", "intent", "render"]
428
- }
428
+ },
429
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
430
+ replace: { required: false, control: "boolean", type: "boolean" },
431
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" }
429
432
  };
430
433
  export {
431
434
  props
@@ -2,14 +2,8 @@ const props = {
2
2
  slot: { required: false, control: "text", type: "string" },
3
3
  style: { required: false, control: "text", type: "string" },
4
4
  title: { required: false, control: "text", type: "string" },
5
- href: { required: false, control: "text", type: "string" },
6
- target: {
7
- required: false,
8
- control: "select",
9
- type: "string",
10
- options: ["_self", "_blank", "_parent", "_top"]
11
- },
12
5
  download: { required: false, control: "text", type: "string" },
6
+ href: { required: false, control: "text", type: "string" },
13
7
  hrefLang: { required: false, control: "text", type: "string" },
14
8
  media: { required: false, control: "text", type: "string" },
15
9
  ping: { required: false, control: "text", type: "string" },
@@ -420,12 +414,21 @@ const props = {
420
414
  control: "text",
421
415
  type: "string"
422
416
  },
417
+ target: {
418
+ required: false,
419
+ control: "select",
420
+ type: "string",
421
+ options: ["_self", "_blank", "_parent", "_top"]
422
+ },
423
423
  prefetch: {
424
424
  required: false,
425
425
  control: "radio",
426
426
  type: "string",
427
427
  options: ["none", "intent", "render"]
428
- }
428
+ },
429
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
430
+ replace: { required: false, control: "boolean", type: "boolean" },
431
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" }
429
432
  };
430
433
  export {
431
434
  props
@@ -25,14 +25,8 @@ const props = {
25
25
  slot: { required: false, control: "text", type: "string" },
26
26
  style: { required: false, control: "text", type: "string" },
27
27
  title: { required: false, control: "text", type: "string" },
28
- href: { required: false, control: "text", type: "string" },
29
- target: {
30
- required: false,
31
- control: "select",
32
- type: "string",
33
- options: ["_self", "_blank", "_parent", "_top"]
34
- },
35
28
  download: { required: false, control: "text", type: "string" },
29
+ href: { required: false, control: "text", type: "string" },
36
30
  hrefLang: { required: false, control: "text", type: "string" },
37
31
  media: { required: false, control: "text", type: "string" },
38
32
  ping: { required: false, control: "text", type: "string" },
@@ -443,10 +437,19 @@ const props = {
443
437
  control: "text",
444
438
  type: "string"
445
439
  },
440
+ target: {
441
+ required: false,
442
+ control: "select",
443
+ type: "string",
444
+ options: ["_self", "_blank", "_parent", "_top"]
445
+ },
446
446
  prefetch: {
447
447
  required: false,
448
448
  control: "radio",
449
449
  type: "string",
450
450
  options: ["none", "intent", "render"]
451
- }
451
+ },
452
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
453
+ replace: { required: false, control: "boolean", type: "boolean" },
454
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" }
452
455
  };
@@ -25,14 +25,8 @@ const props = {
25
25
  slot: { required: false, control: "text", type: "string" },
26
26
  style: { required: false, control: "text", type: "string" },
27
27
  title: { required: false, control: "text", type: "string" },
28
- href: { required: false, control: "text", type: "string" },
29
- target: {
30
- required: false,
31
- control: "select",
32
- type: "string",
33
- options: ["_self", "_blank", "_parent", "_top"]
34
- },
35
28
  download: { required: false, control: "text", type: "string" },
29
+ href: { required: false, control: "text", type: "string" },
36
30
  hrefLang: { required: false, control: "text", type: "string" },
37
31
  media: { required: false, control: "text", type: "string" },
38
32
  ping: { required: false, control: "text", type: "string" },
@@ -443,10 +437,19 @@ const props = {
443
437
  control: "text",
444
438
  type: "string"
445
439
  },
440
+ target: {
441
+ required: false,
442
+ control: "select",
443
+ type: "string",
444
+ options: ["_self", "_blank", "_parent", "_top"]
445
+ },
446
446
  prefetch: {
447
447
  required: false,
448
448
  control: "radio",
449
449
  type: "string",
450
450
  options: ["none", "intent", "render"]
451
- }
451
+ },
452
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
453
+ replace: { required: false, control: "boolean", type: "boolean" },
454
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" }
452
455
  };
@@ -25,14 +25,8 @@ const props = {
25
25
  slot: { required: false, control: "text", type: "string" },
26
26
  style: { required: false, control: "text", type: "string" },
27
27
  title: { required: false, control: "text", type: "string" },
28
- href: { required: false, control: "text", type: "string" },
29
- target: {
30
- required: false,
31
- control: "select",
32
- type: "string",
33
- options: ["_self", "_blank", "_parent", "_top"]
34
- },
35
28
  download: { required: false, control: "text", type: "string" },
29
+ href: { required: false, control: "text", type: "string" },
36
30
  hrefLang: { required: false, control: "text", type: "string" },
37
31
  media: { required: false, control: "text", type: "string" },
38
32
  ping: { required: false, control: "text", type: "string" },
@@ -443,10 +437,19 @@ const props = {
443
437
  control: "text",
444
438
  type: "string"
445
439
  },
440
+ target: {
441
+ required: false,
442
+ control: "select",
443
+ type: "string",
444
+ options: ["_self", "_blank", "_parent", "_top"]
445
+ },
446
446
  prefetch: {
447
447
  required: false,
448
448
  control: "radio",
449
449
  type: "string",
450
450
  options: ["none", "intent", "render"]
451
- }
451
+ },
452
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
453
+ replace: { required: false, control: "boolean", type: "boolean" },
454
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" }
452
455
  };
@@ -20,11 +20,9 @@ var components_exports = {};
20
20
  __export(components_exports, {
21
21
  Form: () => import_form.Form,
22
22
  Link: () => import_link.Link,
23
- LinkBlock: () => import_link_block.LinkBlock,
24
23
  RichTextLink: () => import_rich_text_link.RichTextLink
25
24
  });
26
25
  module.exports = __toCommonJS(components_exports);
27
26
  var import_link = require("./link");
28
- var import_link_block = require("./link-block");
29
27
  var import_rich_text_link = require("./rich-text-link");
30
28
  var import_form = require("./form");
@@ -80,7 +80,7 @@ const meta = {
80
80
  children: [
81
81
  {
82
82
  type: "instance",
83
- component: "TextBlock",
83
+ component: "Text",
84
84
  children: [
85
85
  { type: "text", value: "Thank you for getting in touch!" }
86
86
  ]
@@ -93,7 +93,7 @@ const meta = {
93
93
  children: [
94
94
  {
95
95
  type: "instance",
96
- component: "TextBlock",
96
+ component: "Text",
97
97
  children: [
98
98
  { type: "text", value: "Sorry, something went wrong." }
99
99
  ]
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var link_ws_exports = {};
20
+ __export(link_ws_exports, {
21
+ meta: () => import_metas.Link,
22
+ propsMeta: () => propsMeta
23
+ });
24
+ module.exports = __toCommonJS(link_ws_exports);
25
+ var import_link = require("./__generated__/link.props");
26
+ var import_metas = require("@webstudio-is/sdk-components-react/metas");
27
+ const propsMeta = {
28
+ props: {
29
+ ...import_link.props,
30
+ href: {
31
+ type: "string",
32
+ control: "url",
33
+ required: false
34
+ }
35
+ },
36
+ initialProps: ["href", "target", "prefetch"]
37
+ };
package/lib/cjs/props.js CHANGED
@@ -18,7 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var props_exports = {};
20
20
  __export(props_exports, {
21
- Form: () => import_form.propsMeta
21
+ Form: () => import_form.propsMeta,
22
+ Link: () => import_link.propsMeta,
23
+ RichTextLink: () => import_rich_text_link.propsMeta
22
24
  });
23
25
  module.exports = __toCommonJS(props_exports);
24
26
  var import_form = require("./form.ws");
27
+ var import_link = require("./link.ws");
28
+ var import_rich_text_link = require("./rich-text-link.ws");
@@ -16,11 +16,12 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var link_block_exports = {};
20
- __export(link_block_exports, {
21
- LinkBlock: () => LinkBlock
19
+ var rich_text_link_ws_exports = {};
20
+ __export(rich_text_link_ws_exports, {
21
+ meta: () => import_metas.RichTextLink,
22
+ propsMeta: () => propsMeta
22
23
  });
23
- module.exports = __toCommonJS(link_block_exports);
24
- var import_sdk_components_react = require("@webstudio-is/sdk-components-react");
25
- var import_remix_link = require("./shared/remix-link");
26
- const LinkBlock = (0, import_remix_link.wrapLinkComponent)(import_sdk_components_react.LinkBlock);
24
+ module.exports = __toCommonJS(rich_text_link_ws_exports);
25
+ var import_link = require("./link.ws");
26
+ var import_metas = require("@webstudio-is/sdk-components-react/metas");
27
+ const propsMeta = import_link.propsMeta;
package/lib/components.js CHANGED
@@ -1,10 +1,8 @@
1
1
  import { Link } from "./link";
2
- import { LinkBlock } from "./link-block";
3
2
  import { RichTextLink } from "./rich-text-link";
4
3
  import { Form } from "./form";
5
4
  export {
6
5
  Form,
7
6
  Link,
8
- LinkBlock,
9
7
  RichTextLink
10
8
  };
package/lib/form.ws.js CHANGED
@@ -56,7 +56,7 @@ const meta = {
56
56
  children: [
57
57
  {
58
58
  type: "instance",
59
- component: "TextBlock",
59
+ component: "Text",
60
60
  children: [
61
61
  { type: "text", value: "Thank you for getting in touch!" }
62
62
  ]
@@ -69,7 +69,7 @@ const meta = {
69
69
  children: [
70
70
  {
71
71
  type: "instance",
72
- component: "TextBlock",
72
+ component: "Text",
73
73
  children: [
74
74
  { type: "text", value: "Sorry, something went wrong." }
75
75
  ]
package/lib/link.ws.js ADDED
@@ -0,0 +1,17 @@
1
+ import { props } from "./__generated__/link.props";
2
+ import { Link } from "@webstudio-is/sdk-components-react/metas";
3
+ const propsMeta = {
4
+ props: {
5
+ ...props,
6
+ href: {
7
+ type: "string",
8
+ control: "url",
9
+ required: false
10
+ }
11
+ },
12
+ initialProps: ["href", "target", "prefetch"]
13
+ };
14
+ export {
15
+ Link as meta,
16
+ propsMeta
17
+ };
package/lib/props.js CHANGED
@@ -1,4 +1,8 @@
1
1
  import { propsMeta } from "./form.ws";
2
+ import { propsMeta as propsMeta2 } from "./link.ws";
3
+ import { propsMeta as propsMeta3 } from "./rich-text-link.ws";
2
4
  export {
3
- propsMeta as Form
5
+ propsMeta as Form,
6
+ propsMeta2 as Link,
7
+ propsMeta3 as RichTextLink
4
8
  };
@@ -0,0 +1,7 @@
1
+ import { propsMeta as linkPropsMeta } from "./link.ws";
2
+ import { RichTextLink } from "@webstudio-is/sdk-components-react/metas";
3
+ const propsMeta = linkPropsMeta;
4
+ export {
5
+ RichTextLink as meta,
6
+ propsMeta
7
+ };
@@ -1,4 +1,3 @@
1
1
  export { Link } from "./link";
2
- export { LinkBlock } from "./link-block";
3
2
  export { RichTextLink } from "./rich-text-link";
4
3
  export { Form } from "./form";
@@ -1,6 +1,10 @@
1
1
  /// <reference types="react" />
2
- export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
3
- href?: string | undefined;
2
+ export declare const Link: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
3
+ target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
4
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
4
5
  target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
5
6
  prefetch?: "none" | "intent" | "render" | undefined;
6
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
7
+ reloadDocument?: boolean | undefined;
8
+ replace?: boolean | undefined;
9
+ preventScrollReset?: boolean | undefined;
10
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,3 @@
1
+ import type { WsComponentPropsMeta } from "@webstudio-is/react-sdk";
2
+ export { Link as meta } from "@webstudio-is/sdk-components-react/metas";
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -1 +1,3 @@
1
1
  export { propsMeta as Form } from "./form.ws";
2
+ export { propsMeta as Link } from "./link.ws";
3
+ export { propsMeta as RichTextLink } from "./rich-text-link.ws";
@@ -1,6 +1,10 @@
1
1
  /// <reference types="react" />
2
- export declare const RichTextLink: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
3
- href?: string | undefined;
2
+ export declare const RichTextLink: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
3
+ target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
4
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
4
5
  target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
5
6
  prefetch?: "none" | "intent" | "render" | undefined;
6
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
7
+ reloadDocument?: boolean | undefined;
8
+ replace?: boolean | undefined;
9
+ preventScrollReset?: boolean | undefined;
10
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,3 @@
1
+ import type { WsComponentPropsMeta } from "@webstudio-is/react-sdk";
2
+ export { RichTextLink as meta } from "@webstudio-is/sdk-components-react/metas";
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
- export declare const wrapLinkComponent: (BaseLink: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
3
- href?: string | undefined;
2
+ import type { Link } from "@webstudio-is/sdk-components-react";
3
+ export declare const wrapLinkComponent: (BaseLink: typeof Link) => import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "target"> & {
4
4
  target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
5
- prefetch?: "none" | "intent" | "render" | undefined;
6
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>) => import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
7
- href?: string | undefined;
5
+ }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>, "ref">, "target"> & {
8
6
  target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
9
7
  prefetch?: "none" | "intent" | "render" | undefined;
10
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
8
+ reloadDocument?: boolean | undefined;
9
+ replace?: boolean | undefined;
10
+ preventScrollReset?: boolean | undefined;
11
+ } & import("react").RefAttributes<HTMLAnchorElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react-remix",
3
- "version": "0.71.0",
3
+ "version": "0.73.0",
4
4
  "description": "Webstudio components for Remix",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -38,11 +38,11 @@
38
38
  "react-dom": "^18.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@webstudio-is/form-handlers": "^0.71.0",
42
- "@webstudio-is/generate-arg-types": "^0.71.0",
43
- "@webstudio-is/icons": "^0.71.0",
44
- "@webstudio-is/react-sdk": "^0.71.0",
45
- "@webstudio-is/sdk-components-react": "^0.71.0"
41
+ "@webstudio-is/form-handlers": "^0.73.0",
42
+ "@webstudio-is/generate-arg-types": "^0.73.0",
43
+ "@webstudio-is/icons": "^0.73.0",
44
+ "@webstudio-is/react-sdk": "^0.73.0",
45
+ "@webstudio-is/sdk-components-react": "^0.73.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@remix-run/react": "^1.15.0",
@@ -50,7 +50,7 @@
50
50
  "@types/react-dom": "^18.0.11",
51
51
  "react": "^18.2.0",
52
52
  "react-dom": "^18.2.0",
53
- "typescript": "5.0.3",
53
+ "typescript": "5.1.3",
54
54
  "@webstudio-is/scripts": "^0.0.0",
55
55
  "@webstudio-is/tsconfig": "^1.0.6"
56
56
  },
@@ -4,14 +4,8 @@ export const props: Record<string, PropMeta> = {
4
4
  slot: { required: false, control: "text", type: "string" },
5
5
  style: { required: false, control: "text", type: "string" },
6
6
  title: { required: false, control: "text", type: "string" },
7
- href: { required: false, control: "text", type: "string" },
8
- target: {
9
- required: false,
10
- control: "select",
11
- type: "string",
12
- options: ["_self", "_blank", "_parent", "_top"],
13
- },
14
7
  download: { required: false, control: "text", type: "string" },
8
+ href: { required: false, control: "text", type: "string" },
15
9
  hrefLang: { required: false, control: "text", type: "string" },
16
10
  media: { required: false, control: "text", type: "string" },
17
11
  ping: { required: false, control: "text", type: "string" },
@@ -468,10 +462,19 @@ export const props: Record<string, PropMeta> = {
468
462
  control: "text",
469
463
  type: "string",
470
464
  },
465
+ target: {
466
+ required: false,
467
+ control: "select",
468
+ type: "string",
469
+ options: ["_self", "_blank", "_parent", "_top"],
470
+ },
471
471
  prefetch: {
472
472
  required: false,
473
473
  control: "radio",
474
474
  type: "string",
475
475
  options: ["none", "intent", "render"],
476
476
  },
477
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
478
+ replace: { required: false, control: "boolean", type: "boolean" },
479
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" },
477
480
  };
@@ -4,14 +4,8 @@ export const props: Record<string, PropMeta> = {
4
4
  slot: { required: false, control: "text", type: "string" },
5
5
  style: { required: false, control: "text", type: "string" },
6
6
  title: { required: false, control: "text", type: "string" },
7
- href: { required: false, control: "text", type: "string" },
8
- target: {
9
- required: false,
10
- control: "select",
11
- type: "string",
12
- options: ["_self", "_blank", "_parent", "_top"],
13
- },
14
7
  download: { required: false, control: "text", type: "string" },
8
+ href: { required: false, control: "text", type: "string" },
15
9
  hrefLang: { required: false, control: "text", type: "string" },
16
10
  media: { required: false, control: "text", type: "string" },
17
11
  ping: { required: false, control: "text", type: "string" },
@@ -468,10 +462,19 @@ export const props: Record<string, PropMeta> = {
468
462
  control: "text",
469
463
  type: "string",
470
464
  },
465
+ target: {
466
+ required: false,
467
+ control: "select",
468
+ type: "string",
469
+ options: ["_self", "_blank", "_parent", "_top"],
470
+ },
471
471
  prefetch: {
472
472
  required: false,
473
473
  control: "radio",
474
474
  type: "string",
475
475
  options: ["none", "intent", "render"],
476
476
  },
477
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
478
+ replace: { required: false, control: "boolean", type: "boolean" },
479
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" },
477
480
  };
@@ -4,14 +4,8 @@ export const props: Record<string, PropMeta> = {
4
4
  slot: { required: false, control: "text", type: "string" },
5
5
  style: { required: false, control: "text", type: "string" },
6
6
  title: { required: false, control: "text", type: "string" },
7
- href: { required: false, control: "text", type: "string" },
8
- target: {
9
- required: false,
10
- control: "select",
11
- type: "string",
12
- options: ["_self", "_blank", "_parent", "_top"],
13
- },
14
7
  download: { required: false, control: "text", type: "string" },
8
+ href: { required: false, control: "text", type: "string" },
15
9
  hrefLang: { required: false, control: "text", type: "string" },
16
10
  media: { required: false, control: "text", type: "string" },
17
11
  ping: { required: false, control: "text", type: "string" },
@@ -468,10 +462,19 @@ export const props: Record<string, PropMeta> = {
468
462
  control: "text",
469
463
  type: "string",
470
464
  },
465
+ target: {
466
+ required: false,
467
+ control: "select",
468
+ type: "string",
469
+ options: ["_self", "_blank", "_parent", "_top"],
470
+ },
471
471
  prefetch: {
472
472
  required: false,
473
473
  control: "radio",
474
474
  type: "string",
475
475
  options: ["none", "intent", "render"],
476
476
  },
477
+ reloadDocument: { required: false, control: "boolean", type: "boolean" },
478
+ replace: { required: false, control: "boolean", type: "boolean" },
479
+ preventScrollReset: { required: false, control: "boolean", type: "boolean" },
477
480
  };
package/src/components.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export { Link } from "./link";
2
- export { LinkBlock } from "./link-block";
3
2
  export { RichTextLink } from "./rich-text-link";
4
3
  export { Form } from "./form";
package/src/form.ws.tsx CHANGED
@@ -64,7 +64,7 @@ export const meta: WsComponentMeta = {
64
64
  children: [
65
65
  {
66
66
  type: "instance",
67
- component: "TextBlock",
67
+ component: "Text",
68
68
  children: [
69
69
  { type: "text", value: "Thank you for getting in touch!" },
70
70
  ],
@@ -77,7 +77,7 @@ export const meta: WsComponentMeta = {
77
77
  children: [
78
78
  {
79
79
  type: "instance",
80
- component: "TextBlock",
80
+ component: "Text",
81
81
  children: [
82
82
  { type: "text", value: "Sorry, something went wrong." },
83
83
  ],
package/src/link.ws.ts ADDED
@@ -0,0 +1,16 @@
1
+ import type { WsComponentPropsMeta } from "@webstudio-is/react-sdk";
2
+ import { props } from "./__generated__/link.props";
3
+
4
+ export { Link as meta } from "@webstudio-is/sdk-components-react/metas";
5
+
6
+ export const propsMeta: WsComponentPropsMeta = {
7
+ props: {
8
+ ...props,
9
+ href: {
10
+ type: "string",
11
+ control: "url",
12
+ required: false,
13
+ },
14
+ },
15
+ initialProps: ["href", "target", "prefetch"],
16
+ };
package/src/props.ts CHANGED
@@ -1 +1,3 @@
1
1
  export { propsMeta as Form } from "./form.ws";
2
+ export { propsMeta as Link } from "./link.ws";
3
+ export { propsMeta as RichTextLink } from "./rich-text-link.ws";
@@ -0,0 +1,6 @@
1
+ import type { WsComponentPropsMeta } from "@webstudio-is/react-sdk";
2
+ import { propsMeta as linkPropsMeta } from "./link.ws";
3
+
4
+ export { RichTextLink as meta } from "@webstudio-is/sdk-components-react/metas";
5
+
6
+ export const propsMeta: WsComponentPropsMeta = linkPropsMeta;
@@ -6,11 +6,19 @@ import {
6
6
  } from "@webstudio-is/react-sdk";
7
7
  import type { Link } from "@webstudio-is/sdk-components-react";
8
8
 
9
- type LinkComponent = typeof Link;
10
- type LinkProps = ComponentPropsWithoutRef<LinkComponent>;
9
+ type Props = Omit<ComponentPropsWithoutRef<typeof Link>, "target"> & {
10
+ // override (string & {}) in target to generate keywords
11
+ target?: "_self" | "_blank" | "_parent" | "_top";
11
12
 
12
- export const wrapLinkComponent = (BaseLink: LinkComponent) => {
13
- const Component: LinkComponent = forwardRef((props: LinkProps, ref) => {
13
+ // useful remix props
14
+ prefetch?: "intent" | "render" | "none";
15
+ reloadDocument?: boolean;
16
+ replace?: boolean;
17
+ preventScrollReset?: boolean;
18
+ };
19
+
20
+ export const wrapLinkComponent = (BaseLink: typeof Link) => {
21
+ const Component = forwardRef<HTMLAnchorElement, Props>((props, ref) => {
14
22
  const href = usePropUrl(getInstanceIdFromComponentProps(props), "href");
15
23
 
16
24
  if (href?.type === "page") {
package/lib/link-block.js DELETED
@@ -1,6 +0,0 @@
1
- import { LinkBlock as BaseLink } from "@webstudio-is/sdk-components-react";
2
- import { wrapLinkComponent } from "./shared/remix-link";
3
- const LinkBlock = wrapLinkComponent(BaseLink);
4
- export {
5
- LinkBlock
6
- };
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const LinkBlock: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
3
- href?: string | undefined;
4
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
5
- prefetch?: "none" | "intent" | "render" | undefined;
6
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,4 +0,0 @@
1
- import { LinkBlock as BaseLink } from "@webstudio-is/sdk-components-react";
2
- import { wrapLinkComponent } from "./shared/remix-link";
3
-
4
- export const LinkBlock = wrapLinkComponent(BaseLink);