@webstudio-is/sdk-components-react-remix 0.70.0 → 0.72.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.
Files changed (42) hide show
  1. package/README.md +1 -2
  2. package/lib/__generated__/link-block.props.js +11 -8
  3. package/lib/__generated__/link.props.js +11 -8
  4. package/lib/__generated__/rich-text-link.props.js +11 -8
  5. package/lib/cjs/__generated__/link-block.props.js +11 -8
  6. package/lib/cjs/__generated__/link.props.js +11 -8
  7. package/lib/cjs/__generated__/rich-text-link.props.js +11 -8
  8. package/lib/cjs/link-block.js +2 -2
  9. package/lib/cjs/link-block.ws.js +27 -0
  10. package/lib/cjs/link.js +2 -2
  11. package/lib/cjs/link.ws.js +37 -0
  12. package/lib/cjs/props.js +7 -1
  13. package/lib/cjs/rich-text-link.js +2 -2
  14. package/lib/cjs/rich-text-link.ws.js +27 -0
  15. package/lib/link-block.js +1 -1
  16. package/lib/link-block.ws.js +7 -0
  17. package/lib/link.js +1 -1
  18. package/lib/link.ws.js +17 -0
  19. package/lib/props.js +7 -1
  20. package/lib/rich-text-link.js +1 -1
  21. package/lib/rich-text-link.ws.js +7 -0
  22. package/lib/types/form.d.ts +1 -1
  23. package/lib/types/link-block.d.ts +7 -3
  24. package/lib/types/link-block.ws.d.ts +3 -0
  25. package/lib/types/link.d.ts +7 -3
  26. package/lib/types/link.ws.d.ts +3 -0
  27. package/lib/types/props.d.ts +3 -0
  28. package/lib/types/rich-text-link.d.ts +7 -3
  29. package/lib/types/rich-text-link.ws.d.ts +3 -0
  30. package/lib/types/shared/remix-link.d.ts +7 -6
  31. package/package.json +12 -11
  32. package/src/__generated__/link-block.props.ts +10 -7
  33. package/src/__generated__/link.props.ts +10 -7
  34. package/src/__generated__/rich-text-link.props.ts +10 -7
  35. package/src/link-block.tsx +1 -1
  36. package/src/link-block.ws.tsx +6 -0
  37. package/src/link.tsx +1 -1
  38. package/src/link.ws.ts +16 -0
  39. package/src/props.ts +3 -0
  40. package/src/rich-text-link.tsx +1 -1
  41. package/src/rich-text-link.ws.tsx +6 -0
  42. package/src/shared/remix-link.tsx +13 -5
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
- # Webstudio SDK
1
+ # Webstudio SDK Components
2
2
 
3
3
  Webstudio SDK is a TypeScript API that lets you use your Webstudio site or some components in your custom codebase or just render a complete Remix Document.
4
- It is currently under development, but feel free to play with the the current [landing site](https://github.com/webstudio-is/webstudio-landing)
@@ -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
  };
@@ -21,6 +21,6 @@ __export(link_block_exports, {
21
21
  LinkBlock: () => LinkBlock
22
22
  });
23
23
  module.exports = __toCommonJS(link_block_exports);
24
- var import_react_sdk = require("@webstudio-is/react-sdk");
24
+ var import_sdk_components_react = require("@webstudio-is/sdk-components-react");
25
25
  var import_remix_link = require("./shared/remix-link");
26
- const LinkBlock = (0, import_remix_link.wrapLinkComponent)(import_react_sdk.LinkBlock);
26
+ const LinkBlock = (0, import_remix_link.wrapLinkComponent)(import_sdk_components_react.LinkBlock);
@@ -0,0 +1,27 @@
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_block_ws_exports = {};
20
+ __export(link_block_ws_exports, {
21
+ meta: () => import_metas.LinkBlock,
22
+ propsMeta: () => propsMeta
23
+ });
24
+ module.exports = __toCommonJS(link_block_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/cjs/link.js CHANGED
@@ -21,6 +21,6 @@ __export(link_exports, {
21
21
  Link: () => Link
22
22
  });
23
23
  module.exports = __toCommonJS(link_exports);
24
- var import_react_sdk = require("@webstudio-is/react-sdk");
24
+ var import_sdk_components_react = require("@webstudio-is/sdk-components-react");
25
25
  var import_remix_link = require("./shared/remix-link");
26
- const Link = (0, import_remix_link.wrapLinkComponent)(import_react_sdk.Link);
26
+ const Link = (0, import_remix_link.wrapLinkComponent)(import_sdk_components_react.Link);
@@ -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,13 @@ 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
+ LinkBlock: () => import_link_block.propsMeta,
24
+ RichTextLink: () => import_rich_text_link.propsMeta
22
25
  });
23
26
  module.exports = __toCommonJS(props_exports);
24
27
  var import_form = require("./form.ws");
28
+ var import_link = require("./link.ws");
29
+ var import_link_block = require("./link-block.ws");
30
+ var import_rich_text_link = require("./rich-text-link.ws");
@@ -21,6 +21,6 @@ __export(rich_text_link_exports, {
21
21
  RichTextLink: () => RichTextLink
22
22
  });
23
23
  module.exports = __toCommonJS(rich_text_link_exports);
24
- var import_react_sdk = require("@webstudio-is/react-sdk");
24
+ var import_sdk_components_react = require("@webstudio-is/sdk-components-react");
25
25
  var import_remix_link = require("./shared/remix-link");
26
- const RichTextLink = (0, import_remix_link.wrapLinkComponent)(import_react_sdk.RichTextLink);
26
+ const RichTextLink = (0, import_remix_link.wrapLinkComponent)(import_sdk_components_react.RichTextLink);
@@ -0,0 +1,27 @@
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 rich_text_link_ws_exports = {};
20
+ __export(rich_text_link_ws_exports, {
21
+ meta: () => import_metas.RichTextLink,
22
+ propsMeta: () => propsMeta
23
+ });
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/link-block.js CHANGED
@@ -1,4 +1,4 @@
1
- import { LinkBlock as BaseLink } from "@webstudio-is/react-sdk";
1
+ import { LinkBlock as BaseLink } from "@webstudio-is/sdk-components-react";
2
2
  import { wrapLinkComponent } from "./shared/remix-link";
3
3
  const LinkBlock = wrapLinkComponent(BaseLink);
4
4
  export {
@@ -0,0 +1,7 @@
1
+ import { propsMeta as linkPropsMeta } from "./link.ws";
2
+ import { LinkBlock } from "@webstudio-is/sdk-components-react/metas";
3
+ const propsMeta = linkPropsMeta;
4
+ export {
5
+ LinkBlock as meta,
6
+ propsMeta
7
+ };
package/lib/link.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Link as BaseLink } from "@webstudio-is/react-sdk";
1
+ import { Link as BaseLink } from "@webstudio-is/sdk-components-react";
2
2
  import { wrapLinkComponent } from "./shared/remix-link";
3
3
  const Link = wrapLinkComponent(BaseLink);
4
4
  export {
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,10 @@
1
1
  import { propsMeta } from "./form.ws";
2
+ import { propsMeta as propsMeta2 } from "./link.ws";
3
+ import { propsMeta as propsMeta3 } from "./link-block.ws";
4
+ import { propsMeta as propsMeta4 } from "./rich-text-link.ws";
2
5
  export {
3
- propsMeta as Form
6
+ propsMeta as Form,
7
+ propsMeta2 as Link,
8
+ propsMeta3 as LinkBlock,
9
+ propsMeta4 as RichTextLink
4
10
  };
@@ -1,4 +1,4 @@
1
- import { RichTextLink as BaseLink } from "@webstudio-is/react-sdk";
1
+ import { RichTextLink as BaseLink } from "@webstudio-is/sdk-components-react";
2
2
  import { wrapLinkComponent } from "./shared/remix-link";
3
3
  const RichTextLink = wrapLinkComponent(BaseLink);
4
4
  export {
@@ -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,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const defaultTag = "form";
3
3
  export declare const Form: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "action" | "method"> & {
4
- initialState?: "error" | "initial" | "success" | undefined;
4
+ initialState?: "initial" | "error" | "success" | undefined;
5
5
  }, "ref"> & import("react").RefAttributes<HTMLFormElement>>;
@@ -1,6 +1,10 @@
1
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;
2
+ export declare const LinkBlock: 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 { LinkBlock as meta } from "@webstudio-is/sdk-components-react/metas";
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -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,4 @@
1
1
  export { propsMeta as Form } from "./form.ws";
2
+ export { propsMeta as Link } from "./link.ws";
3
+ export { propsMeta as LinkBlock } from "./link-block.ws";
4
+ 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.70.0",
3
+ "version": "0.72.0",
4
4
  "description": "Webstudio components for Remix",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -15,21 +15,21 @@
15
15
  "exports": {
16
16
  ".": {
17
17
  "source": "./src/components.ts",
18
- "types": "./lib/types/components.d.ts",
19
18
  "import": "./lib/components.js",
20
- "require": "./lib/cjs/components.js"
19
+ "require": "./lib/cjs/components.js",
20
+ "types": "./lib/types/components.d.ts"
21
21
  },
22
22
  "./metas": {
23
23
  "source": "./src/metas.ts",
24
- "types": "./lib/types/metas.d.ts",
25
24
  "import": "./lib/metas.js",
26
- "require": "./lib/cjs/metas.js"
25
+ "require": "./lib/cjs/metas.js",
26
+ "types": "./lib/types/metas.d.ts"
27
27
  },
28
28
  "./props": {
29
29
  "source": "./src/props.ts",
30
- "types": "./lib/types/props.d.ts",
31
30
  "import": "./lib/props.js",
32
- "require": "./lib/cjs/props.js"
31
+ "require": "./lib/cjs/props.js",
32
+ "types": "./lib/types/props.d.ts"
33
33
  }
34
34
  },
35
35
  "peerDependencies": {
@@ -38,10 +38,11 @@
38
38
  "react-dom": "^18.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@webstudio-is/form-handlers": "^0.70.0",
42
- "@webstudio-is/generate-arg-types": "^0.70.0",
43
- "@webstudio-is/icons": "^0.70.0",
44
- "@webstudio-is/react-sdk": "^0.70.0"
41
+ "@webstudio-is/form-handlers": "^0.72.0",
42
+ "@webstudio-is/generate-arg-types": "^0.72.0",
43
+ "@webstudio-is/icons": "^0.72.0",
44
+ "@webstudio-is/react-sdk": "^0.72.0",
45
+ "@webstudio-is/sdk-components-react": "^0.72.0"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@remix-run/react": "^1.15.0",
@@ -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
  };
@@ -1,4 +1,4 @@
1
- import { LinkBlock as BaseLink } from "@webstudio-is/react-sdk";
1
+ import { LinkBlock as BaseLink } from "@webstudio-is/sdk-components-react";
2
2
  import { wrapLinkComponent } from "./shared/remix-link";
3
3
 
4
4
  export const LinkBlock = wrapLinkComponent(BaseLink);
@@ -0,0 +1,6 @@
1
+ import type { WsComponentPropsMeta } from "@webstudio-is/react-sdk";
2
+ import { propsMeta as linkPropsMeta } from "./link.ws";
3
+
4
+ export { LinkBlock as meta } from "@webstudio-is/sdk-components-react/metas";
5
+
6
+ export const propsMeta: WsComponentPropsMeta = linkPropsMeta;
package/src/link.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { Link as BaseLink } from "@webstudio-is/react-sdk";
1
+ import { Link as BaseLink } from "@webstudio-is/sdk-components-react";
2
2
  import { wrapLinkComponent } from "./shared/remix-link";
3
3
 
4
4
  export const Link = wrapLinkComponent(BaseLink);
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,4 @@
1
1
  export { propsMeta as Form } from "./form.ws";
2
+ export { propsMeta as Link } from "./link.ws";
3
+ export { propsMeta as LinkBlock } from "./link-block.ws";
4
+ export { propsMeta as RichTextLink } from "./rich-text-link.ws";
@@ -1,4 +1,4 @@
1
- import { RichTextLink as BaseLink } from "@webstudio-is/react-sdk";
1
+ import { RichTextLink as BaseLink } from "@webstudio-is/sdk-components-react";
2
2
  import { wrapLinkComponent } from "./shared/remix-link";
3
3
 
4
4
  export const RichTextLink = wrapLinkComponent(BaseLink);
@@ -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;
@@ -1,16 +1,24 @@
1
1
  import { forwardRef, type ComponentPropsWithoutRef } from "react";
2
2
  import { NavLink as RemixLink } from "@remix-run/react";
3
3
  import {
4
- type Link,
5
4
  usePropUrl,
6
5
  getInstanceIdFromComponentProps,
7
6
  } from "@webstudio-is/react-sdk";
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") {