@webstudio-is/sdk-components-react-remix 0.91.0 → 0.92.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 (44) hide show
  1. package/lib/__generated__/form.props.js +2 -4
  2. package/lib/__generated__/link.props.js +2 -4
  3. package/lib/__generated__/rich-text-link.props.js +2 -4
  4. package/lib/components.js +4 -8
  5. package/lib/form.js +3 -6
  6. package/lib/form.ws.js +3 -6
  7. package/lib/link.js +2 -4
  8. package/lib/link.ws.js +3 -6
  9. package/lib/metas.js +2 -4
  10. package/lib/props.js +4 -8
  11. package/lib/rich-text-link.js +2 -4
  12. package/lib/rich-text-link.ws.js +3 -6
  13. package/lib/shared/remix-link.js +2 -4
  14. package/lib/types/__generated__/form.props.d.ts +1 -1
  15. package/lib/types/__generated__/link.props.d.ts +1 -1
  16. package/lib/types/__generated__/rich-text-link.props.d.ts +1 -1
  17. package/package.json +15 -19
  18. package/lib/cjs/__generated__/form.props.js +0 -591
  19. package/lib/cjs/__generated__/link.props.js +0 -594
  20. package/lib/cjs/__generated__/rich-text-link.props.js +0 -593
  21. package/lib/cjs/components.js +0 -28
  22. package/lib/cjs/form.js +0 -55
  23. package/lib/cjs/form.ws.js +0 -157
  24. package/lib/cjs/link.js +0 -26
  25. package/lib/cjs/link.ws.js +0 -37
  26. package/lib/cjs/metas.js +0 -24
  27. package/lib/cjs/package.json +0 -1
  28. package/lib/cjs/props.js +0 -28
  29. package/lib/cjs/rich-text-link.js +0 -26
  30. package/lib/cjs/rich-text-link.ws.js +0 -27
  31. package/lib/cjs/shared/remix-link.js +0 -46
  32. package/src/__generated__/form.props.ts +0 -642
  33. package/src/__generated__/link.props.ts +0 -641
  34. package/src/__generated__/rich-text-link.props.ts +0 -639
  35. package/src/components.ts +0 -3
  36. package/src/form.tsx +0 -67
  37. package/src/form.ws.tsx +0 -144
  38. package/src/link.tsx +0 -4
  39. package/src/link.ws.ts +0 -16
  40. package/src/metas.ts +0 -1
  41. package/src/props.ts +0 -3
  42. package/src/rich-text-link.tsx +0 -4
  43. package/src/rich-text-link.ws.tsx +0 -6
  44. package/src/shared/remix-link.tsx +0 -46
@@ -1,4 +1,5 @@
1
- const props = {
1
+ "use strict";
2
+ export const props = {
2
3
  about: { required: false, control: "text", type: "string" },
3
4
  acceptCharset: {
4
5
  required: false,
@@ -566,6 +567,3 @@ const props = {
566
567
  },
567
568
  vocab: { required: false, control: "text", type: "string" }
568
569
  };
569
- export {
570
- props
571
- };
@@ -1,4 +1,5 @@
1
- const props = {
1
+ "use strict";
2
+ export const props = {
2
3
  about: { required: false, control: "text", type: "string" },
3
4
  accessKey: {
4
5
  required: false,
@@ -569,6 +570,3 @@ const props = {
569
570
  },
570
571
  vocab: { required: false, control: "text", type: "string" }
571
572
  };
572
- export {
573
- props
574
- };
@@ -1,4 +1,5 @@
1
- const props = {
1
+ "use strict";
2
+ export const props = {
2
3
  about: { required: false, control: "text", type: "string" },
3
4
  accessKey: {
4
5
  required: false,
@@ -568,6 +569,3 @@ const props = {
568
569
  },
569
570
  vocab: { required: false, control: "text", type: "string" }
570
571
  };
571
- export {
572
- props
573
- };
package/lib/components.js CHANGED
@@ -1,8 +1,4 @@
1
- import { Link } from "./link";
2
- import { RichTextLink } from "./rich-text-link";
3
- import { Form } from "./form";
4
- export {
5
- Form,
6
- Link,
7
- RichTextLink
8
- };
1
+ "use strict";
2
+ export { Link } from "./link";
3
+ export { RichTextLink } from "./rich-text-link";
4
+ export { Form } from "./form";
package/lib/form.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import {
3
4
  forwardRef,
@@ -11,7 +12,7 @@ import {
11
12
  ReactSdkContext,
12
13
  getInstanceIdFromComponentProps
13
14
  } from "@webstudio-is/react-sdk";
14
- const defaultTag = "form";
15
+ export const defaultTag = "form";
15
16
  const useOnFetchEnd = (fetcher, handler) => {
16
17
  const latestHandler = useRef(handler);
17
18
  latestHandler.current = handler;
@@ -23,7 +24,7 @@ const useOnFetchEnd = (fetcher, handler) => {
23
24
  prevFetcher.current = fetcher;
24
25
  }, [fetcher]);
25
26
  };
26
- const Form = forwardRef(({ children, action, method, state = "initial", ...rest }, ref) => {
27
+ export const Form = forwardRef(({ children, action, method, state = "initial", ...rest }, ref) => {
27
28
  const { setBoundDataSourceValue } = useContext(ReactSdkContext);
28
29
  const fetcher = useFetcher();
29
30
  const instanceId = getInstanceIdFromComponentProps(rest);
@@ -37,7 +38,3 @@ const Form = forwardRef(({ children, action, method, state = "initial", ...rest
37
38
  ] });
38
39
  });
39
40
  Form.displayName = "Form";
40
- export {
41
- Form,
42
- defaultTag
43
- };
package/lib/form.ws.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  import { FormIcon } from "@webstudio-is/icons/svg";
2
3
  import { form } from "@webstudio-is/react-sdk/css-normalize";
3
4
  import {
@@ -10,7 +11,7 @@ const presetStyle = {
10
11
  { property: "minHeight", value: { type: "unit", unit: "px", value: 20 } }
11
12
  ]
12
13
  };
13
- const meta = {
14
+ export const meta = {
14
15
  category: "forms",
15
16
  type: "container",
16
17
  invalidAncestors: ["Form"],
@@ -129,11 +130,7 @@ const meta = {
129
130
  }
130
131
  ]
131
132
  };
132
- const propsMeta = {
133
+ export const propsMeta = {
133
134
  props,
134
135
  initialProps: ["id", "state", "action"]
135
136
  };
136
- export {
137
- meta,
138
- propsMeta
139
- };
package/lib/link.js CHANGED
@@ -1,6 +1,4 @@
1
+ "use strict";
1
2
  import { Link as BaseLink } from "@webstudio-is/sdk-components-react";
2
3
  import { wrapLinkComponent } from "./shared/remix-link";
3
- const Link = wrapLinkComponent(BaseLink);
4
- export {
5
- Link
6
- };
4
+ export const Link = wrapLinkComponent(BaseLink);
package/lib/link.ws.js CHANGED
@@ -1,6 +1,7 @@
1
+ "use strict";
1
2
  import { props } from "./__generated__/link.props";
2
- import { Link } from "@webstudio-is/sdk-components-react/metas";
3
- const propsMeta = {
3
+ export { Link as meta } from "@webstudio-is/sdk-components-react/metas";
4
+ export const propsMeta = {
4
5
  props: {
5
6
  ...props,
6
7
  href: {
@@ -11,7 +12,3 @@ const propsMeta = {
11
12
  },
12
13
  initialProps: ["id", "href", "target", "prefetch"]
13
14
  };
14
- export {
15
- Link as meta,
16
- propsMeta
17
- };
package/lib/metas.js CHANGED
@@ -1,4 +1,2 @@
1
- import { meta } from "./form.ws";
2
- export {
3
- meta as Form
4
- };
1
+ "use strict";
2
+ export { meta as Form } from "./form.ws";
package/lib/props.js CHANGED
@@ -1,8 +1,4 @@
1
- import { propsMeta } from "./form.ws";
2
- import { propsMeta as propsMeta2 } from "./link.ws";
3
- import { propsMeta as propsMeta3 } from "./rich-text-link.ws";
4
- export {
5
- propsMeta as Form,
6
- propsMeta2 as Link,
7
- propsMeta3 as RichTextLink
8
- };
1
+ "use strict";
2
+ export { propsMeta as Form } from "./form.ws";
3
+ export { propsMeta as Link } from "./link.ws";
4
+ export { propsMeta as RichTextLink } from "./rich-text-link.ws";
@@ -1,6 +1,4 @@
1
+ "use strict";
1
2
  import { RichTextLink as BaseLink } from "@webstudio-is/sdk-components-react";
2
3
  import { wrapLinkComponent } from "./shared/remix-link";
3
- const RichTextLink = wrapLinkComponent(BaseLink);
4
- export {
5
- RichTextLink
6
- };
4
+ export const RichTextLink = wrapLinkComponent(BaseLink);
@@ -1,7 +1,4 @@
1
+ "use strict";
1
2
  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
- };
3
+ export { RichTextLink as meta } from "@webstudio-is/sdk-components-react/metas";
4
+ export const propsMeta = linkPropsMeta;
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  import { jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { NavLink as RemixLink } from "@remix-run/react";
@@ -5,7 +6,7 @@ import {
5
6
  usePropUrl,
6
7
  getInstanceIdFromComponentProps
7
8
  } from "@webstudio-is/react-sdk";
8
- const wrapLinkComponent = (BaseLink) => {
9
+ export const wrapLinkComponent = (BaseLink) => {
9
10
  const Component = forwardRef((props, ref) => {
10
11
  const href = usePropUrl(getInstanceIdFromComponentProps(props), "href");
11
12
  if (href?.type === "page") {
@@ -24,6 +25,3 @@ const wrapLinkComponent = (BaseLink) => {
24
25
  Component.displayName = BaseLink.displayName;
25
26
  return Component;
26
27
  };
27
- export {
28
- wrapLinkComponent
29
- };
@@ -1,2 +1,2 @@
1
- import type { PropMeta } from "@webstudio-is/generate-arg-types";
1
+ import type { PropMeta } from "@webstudio-is/react-sdk";
2
2
  export declare const props: Record<string, PropMeta>;
@@ -1,2 +1,2 @@
1
- import type { PropMeta } from "@webstudio-is/generate-arg-types";
1
+ import type { PropMeta } from "@webstudio-is/react-sdk";
2
2
  export declare const props: Record<string, PropMeta>;
@@ -1,2 +1,2 @@
1
- import type { PropMeta } from "@webstudio-is/generate-arg-types";
1
+ import type { PropMeta } from "@webstudio-is/react-sdk";
2
2
  export declare const props: Record<string, PropMeta>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react-remix",
3
- "version": "0.91.0",
3
+ "version": "0.92.0",
4
4
  "description": "Webstudio components for Remix",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -9,27 +9,24 @@
9
9
  "type": "module",
10
10
  "files": [
11
11
  "lib/*",
12
- "src/*"
12
+ "!*.{test,stories}.*"
13
13
  ],
14
14
  "sideEffects": false,
15
15
  "exports": {
16
16
  ".": {
17
17
  "source": "./src/components.ts",
18
18
  "types": "./lib/types/components.d.ts",
19
- "import": "./lib/components.js",
20
- "require": "./lib/cjs/components.js"
19
+ "import": "./lib/components.js"
21
20
  },
22
21
  "./metas": {
23
22
  "source": "./src/metas.ts",
24
23
  "types": "./lib/types/metas.d.ts",
25
- "import": "./lib/metas.js",
26
- "require": "./lib/cjs/metas.js"
24
+ "import": "./lib/metas.js"
27
25
  },
28
26
  "./props": {
29
27
  "source": "./src/props.ts",
30
28
  "types": "./lib/types/props.d.ts",
31
- "import": "./lib/props.js",
32
- "require": "./lib/cjs/props.js"
29
+ "import": "./lib/props.js"
33
30
  }
34
31
  },
35
32
  "peerDependencies": {
@@ -38,26 +35,25 @@
38
35
  "react-dom": "^18.2.0"
39
36
  },
40
37
  "dependencies": {
41
- "@webstudio-is/form-handlers": "^0.91.0",
42
- "@webstudio-is/generate-arg-types": "^0.91.0",
43
- "@webstudio-is/icons": "^0.91.0",
44
- "@webstudio-is/react-sdk": "^0.91.0",
45
- "@webstudio-is/sdk-components-react": "^0.91.0"
38
+ "@webstudio-is/form-handlers": "^0.92.0",
39
+ "@webstudio-is/icons": "^0.92.0",
40
+ "@webstudio-is/react-sdk": "^0.92.0",
41
+ "@webstudio-is/sdk-components-react": "^0.92.0"
46
42
  },
47
43
  "devDependencies": {
48
44
  "@remix-run/react": "^1.19.2",
49
- "@types/react": "^18.2.20",
45
+ "@types/react": "^18.2.21",
50
46
  "@types/react-dom": "^18.2.7",
51
47
  "react": "^18.2.0",
52
48
  "react-dom": "^18.2.0",
53
- "typescript": "5.1.6",
54
- "@webstudio-is/scripts": "^0.0.0",
49
+ "typescript": "5.2.2",
50
+ "@webstudio-is/generate-arg-types": "^0.92.0",
55
51
  "@webstudio-is/tsconfig": "^1.0.7"
56
52
  },
57
53
  "scripts": {
58
- "dev": "build-package --watch",
59
- "build": "build-package",
60
- "build:args": "generate-arg-types './src/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.tsx' && prettier --write \"**/*.props.ts\"",
54
+ "dev": "pnpm build --watch",
55
+ "build": "rm -rf lib && esbuild 'src/**/*.ts' 'src/**/*.tsx' --outdir=lib",
56
+ "build:args": "NODE_OPTIONS=--conditions=source generate-arg-types './src/*.tsx !./src/**/*.stories.tsx !./src/**/*.ws.tsx' && prettier --write \"**/*.props.ts\"",
61
57
  "dts": "tsc --project tsconfig.dts.json",
62
58
  "typecheck": "tsc",
63
59
  "checks": "pnpm typecheck"