@webstudio-is/react-sdk 0.55.0 → 0.57.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 (165) hide show
  1. package/lib/app/custom-components/image.js +6 -6
  2. package/lib/app/custom-components/shared/remix-link.js +3 -3
  3. package/lib/app/params.js +4 -2
  4. package/lib/cjs/app/custom-components/image.js +6 -6
  5. package/lib/cjs/app/custom-components/shared/remix-link.js +3 -3
  6. package/lib/cjs/app/params.js +4 -2
  7. package/lib/cjs/components/link.js +14 -8
  8. package/lib/cjs/css/css.js +8 -5
  9. package/lib/cjs/css/global-rules.js +3 -3
  10. package/lib/cjs/css/style-rules.js +10 -3
  11. package/lib/cjs/props.js +18 -9
  12. package/lib/cjs/pubsub/raf-queue.js +3 -6
  13. package/lib/cjs/tree/root.js +1 -1
  14. package/lib/components/link.js +14 -8
  15. package/lib/css/css.js +8 -5
  16. package/lib/css/global-rules.js +4 -7
  17. package/lib/css/style-rules.js +10 -3
  18. package/lib/props.js +18 -9
  19. package/lib/pubsub/raf-queue.js +3 -6
  20. package/lib/tree/root.js +1 -1
  21. package/package.json +21 -21
  22. package/src/app/custom-components/image.tsx +6 -7
  23. package/src/app/custom-components/shared/remix-link.tsx +3 -3
  24. package/src/app/params.ts +6 -4
  25. package/src/components/link.tsx +17 -7
  26. package/src/css/css.ts +9 -7
  27. package/src/css/global-rules.ts +6 -10
  28. package/src/css/style-rules.test.ts +22 -0
  29. package/src/css/style-rules.ts +15 -4
  30. package/src/props.test.ts +50 -20
  31. package/src/props.ts +27 -12
  32. package/src/pubsub/raf-queue.ts +3 -9
  33. package/src/tree/create-elements-tree.tsx +3 -7
  34. package/src/tree/root.ts +1 -1
  35. package/src/tree/webstudio-component.tsx +2 -2
  36. package/lib/types/app/custom-components/image.d.ts +0 -6
  37. package/lib/types/app/custom-components/index.d.ts +0 -26
  38. package/lib/types/app/custom-components/link-block.d.ts +0 -6
  39. package/lib/types/app/custom-components/link.d.ts +0 -6
  40. package/lib/types/app/custom-components/rich-text-link.d.ts +0 -6
  41. package/lib/types/app/custom-components/shared/remix-link.d.ts +0 -10
  42. package/lib/types/app/handle-request.server.d.ts +0 -2
  43. package/lib/types/app/index.d.ts +0 -3
  44. package/lib/types/app/params.d.ts +0 -6
  45. package/lib/types/app/root.d.ts +0 -8
  46. package/lib/types/components/__generated__/blockquote.props.d.ts +0 -2
  47. package/lib/types/components/__generated__/body.props.d.ts +0 -2
  48. package/lib/types/components/__generated__/bold.props.d.ts +0 -2
  49. package/lib/types/components/__generated__/box.props.d.ts +0 -2
  50. package/lib/types/components/__generated__/button.props.d.ts +0 -2
  51. package/lib/types/components/__generated__/code.props.d.ts +0 -2
  52. package/lib/types/components/__generated__/form.props.d.ts +0 -2
  53. package/lib/types/components/__generated__/fragment.props.d.ts +0 -2
  54. package/lib/types/components/__generated__/heading.props.d.ts +0 -2
  55. package/lib/types/components/__generated__/image.props.d.ts +0 -2
  56. package/lib/types/components/__generated__/input.props.d.ts +0 -2
  57. package/lib/types/components/__generated__/italic.props.d.ts +0 -2
  58. package/lib/types/components/__generated__/link-block.props.d.ts +0 -2
  59. package/lib/types/components/__generated__/link.props.d.ts +0 -2
  60. package/lib/types/components/__generated__/list-item.props.d.ts +0 -2
  61. package/lib/types/components/__generated__/list.props.d.ts +0 -2
  62. package/lib/types/components/__generated__/paragraph.props.d.ts +0 -2
  63. package/lib/types/components/__generated__/rich-text-link.props.d.ts +0 -2
  64. package/lib/types/components/__generated__/separator.props.d.ts +0 -2
  65. package/lib/types/components/__generated__/slot.props.d.ts +0 -2
  66. package/lib/types/components/__generated__/span.props.d.ts +0 -2
  67. package/lib/types/components/__generated__/subscript.props.d.ts +0 -2
  68. package/lib/types/components/__generated__/superscript.props.d.ts +0 -2
  69. package/lib/types/components/__generated__/text-block.props.d.ts +0 -2
  70. package/lib/types/components/blockquote.d.ts +0 -3
  71. package/lib/types/components/blockquote.stories.d.ts +0 -5
  72. package/lib/types/components/blockquote.ws.d.ts +0 -3
  73. package/lib/types/components/body.d.ts +0 -3
  74. package/lib/types/components/body.stories.d.ts +0 -6
  75. package/lib/types/components/body.ws.d.ts +0 -3
  76. package/lib/types/components/bold.d.ts +0 -3
  77. package/lib/types/components/bold.stories.d.ts +0 -5
  78. package/lib/types/components/bold.ws.d.ts +0 -3
  79. package/lib/types/components/box.d.ts +0 -7
  80. package/lib/types/components/box.stories.d.ts +0 -9
  81. package/lib/types/components/box.ws.d.ts +0 -3
  82. package/lib/types/components/button.d.ts +0 -7
  83. package/lib/types/components/button.stories.d.ts +0 -9
  84. package/lib/types/components/button.ws.d.ts +0 -3
  85. package/lib/types/components/code.d.ts +0 -9
  86. package/lib/types/components/code.stories.d.ts +0 -11
  87. package/lib/types/components/code.ws.d.ts +0 -3
  88. package/lib/types/components/component-meta.d.ts +0 -610
  89. package/lib/types/components/components-utils.d.ts +0 -34
  90. package/lib/types/components/components.d.ts +0 -31
  91. package/lib/types/components/form.d.ts +0 -3
  92. package/lib/types/components/form.stories.d.ts +0 -5
  93. package/lib/types/components/form.ws.d.ts +0 -3
  94. package/lib/types/components/fragment.d.ts +0 -6
  95. package/lib/types/components/fragment.ws.d.ts +0 -3
  96. package/lib/types/components/heading.d.ts +0 -7
  97. package/lib/types/components/heading.stories.d.ts +0 -9
  98. package/lib/types/components/heading.ws.d.ts +0 -3
  99. package/lib/types/components/image.d.ts +0 -3
  100. package/lib/types/components/image.stories.d.ts +0 -5
  101. package/lib/types/components/image.ws.d.ts +0 -3
  102. package/lib/types/components/index.d.ts +0 -17
  103. package/lib/types/components/input.d.ts +0 -3
  104. package/lib/types/components/input.stories.d.ts +0 -5
  105. package/lib/types/components/input.ws.d.ts +0 -3
  106. package/lib/types/components/italic.d.ts +0 -3
  107. package/lib/types/components/italic.stories.d.ts +0 -5
  108. package/lib/types/components/italic.ws.d.ts +0 -3
  109. package/lib/types/components/link-block.d.ts +0 -3
  110. package/lib/types/components/link-block.stories.d.ts +0 -13
  111. package/lib/types/components/link-block.ws.d.ts +0 -3
  112. package/lib/types/components/link.d.ts +0 -9
  113. package/lib/types/components/link.stories.d.ts +0 -13
  114. package/lib/types/components/link.ws.d.ts +0 -3
  115. package/lib/types/components/list-item.d.ts +0 -3
  116. package/lib/types/components/list-item.stories.d.ts +0 -5
  117. package/lib/types/components/list-item.ws.d.ts +0 -3
  118. package/lib/types/components/list.d.ts +0 -9
  119. package/lib/types/components/list.stories.d.ts +0 -9
  120. package/lib/types/components/list.ws.d.ts +0 -3
  121. package/lib/types/components/paragraph.d.ts +0 -3
  122. package/lib/types/components/paragraph.stories.d.ts +0 -5
  123. package/lib/types/components/paragraph.ws.d.ts +0 -3
  124. package/lib/types/components/rich-text-link.d.ts +0 -2
  125. package/lib/types/components/rich-text-link.stories.d.ts +0 -13
  126. package/lib/types/components/rich-text-link.ws.d.ts +0 -3
  127. package/lib/types/components/separator.d.ts +0 -3
  128. package/lib/types/components/separator.stories.d.ts +0 -5
  129. package/lib/types/components/separator.ws.d.ts +0 -3
  130. package/lib/types/components/slot.d.ts +0 -6
  131. package/lib/types/components/slot.stories.d.ts +0 -9
  132. package/lib/types/components/slot.ws.d.ts +0 -3
  133. package/lib/types/components/span.d.ts +0 -3
  134. package/lib/types/components/span.stories.d.ts +0 -5
  135. package/lib/types/components/span.ws.d.ts +0 -3
  136. package/lib/types/components/subscript.d.ts +0 -3
  137. package/lib/types/components/subscript.stories.d.ts +0 -5
  138. package/lib/types/components/subscript.ws.d.ts +0 -3
  139. package/lib/types/components/superscript.d.ts +0 -3
  140. package/lib/types/components/superscript.stories.d.ts +0 -5
  141. package/lib/types/components/superscript.ws.d.ts +0 -3
  142. package/lib/types/components/text-block.d.ts +0 -3
  143. package/lib/types/components/text-block.stories.d.ts +0 -5
  144. package/lib/types/components/text-block.ws.d.ts +0 -3
  145. package/lib/types/context.d.ts +0 -9
  146. package/lib/types/css/css.d.ts +0 -54
  147. package/lib/types/css/get-browser-style.d.ts +0 -2
  148. package/lib/types/css/global-rules.d.ts +0 -44
  149. package/lib/types/css/index.d.ts +0 -4
  150. package/lib/types/css/normalize-type-check.d.ts +0 -1
  151. package/lib/types/css/normalize.d.ts +0 -2429
  152. package/lib/types/css/presets.d.ts +0 -38
  153. package/lib/types/css/style-rules.d.ts +0 -201
  154. package/lib/types/css/style-rules.test.d.ts +0 -1
  155. package/lib/types/index.d.ts +0 -9
  156. package/lib/types/props.d.ts +0 -97
  157. package/lib/types/props.test.d.ts +0 -1
  158. package/lib/types/pubsub/create.d.ts +0 -28
  159. package/lib/types/pubsub/index.d.ts +0 -1
  160. package/lib/types/pubsub/raf-queue.d.ts +0 -1
  161. package/lib/types/tree/create-elements-tree.d.ts +0 -29
  162. package/lib/types/tree/index.d.ts +0 -3
  163. package/lib/types/tree/root.d.ts +0 -25
  164. package/lib/types/tree/session-storage-polyfill.d.ts +0 -2
  165. package/lib/types/tree/webstudio-component.d.ts +0 -15
@@ -1,5 +1,6 @@
1
1
  import { forwardRef, type ComponentProps } from "react";
2
2
  import { usePropUrl, getInstanceIdFromComponentProps } from "../props";
3
+ import { getParams } from "../app/params";
3
4
 
4
5
  export const defaultTag = "a";
5
6
 
@@ -15,13 +16,22 @@ type Props = Omit<ComponentProps<"a">, "href" | "target"> & {
15
16
 
16
17
  export const Link = forwardRef<HTMLAnchorElement, Props>((props, ref) => {
17
18
  const href = usePropUrl(getInstanceIdFromComponentProps(props), "href");
18
- return (
19
- <a
20
- {...props}
21
- href={typeof href === "string" ? href : href?.path}
22
- ref={ref}
23
- />
24
- );
19
+
20
+ const { assetBaseUrl } = getParams();
21
+
22
+ let url: string | undefined;
23
+ switch (href?.type) {
24
+ case "page":
25
+ url = href.page.path;
26
+ break;
27
+ case "asset":
28
+ url = `${assetBaseUrl}${href.asset.name}`;
29
+ break;
30
+ case "string":
31
+ url = href.url;
32
+ }
33
+
34
+ return <a {...props} href={url} ref={ref} />;
25
35
  });
26
36
 
27
37
  Link.displayName = "Link";
package/src/css/css.ts CHANGED
@@ -15,7 +15,7 @@ type Data = {
15
15
  };
16
16
 
17
17
  type CssOptions = {
18
- publicPath?: string;
18
+ assetBaseUrl: string;
19
19
  };
20
20
 
21
21
  export const createImageValueTransformer =
@@ -28,9 +28,8 @@ export const createImageValueTransformer =
28
28
  }
29
29
 
30
30
  // @todo reuse image loaders and generate image-set
31
- const { publicPath = "/" } = options;
32
- const url =
33
- asset.location === "REMOTE" ? asset.path : `${publicPath}${asset.name}`;
31
+ const { assetBaseUrl } = options;
32
+ const url = `${assetBaseUrl}${asset.name}`;
34
33
 
35
34
  return {
36
35
  type: "image",
@@ -53,7 +52,10 @@ export const generateCssText = (data: Data, options: CssOptions) => {
53
52
 
54
53
  const engine = createCssEngine({ name: "ssr" });
55
54
 
56
- addGlobalRules(engine, { assets });
55
+ addGlobalRules(engine, {
56
+ assets,
57
+ assetBaseUrl: options.assetBaseUrl,
58
+ });
57
59
 
58
60
  for (const breakpoint of breakpoints.values()) {
59
61
  engine.addMediaRule(breakpoint.id, breakpoint);
@@ -75,9 +77,9 @@ export const generateCssText = (data: Data, options: CssOptions) => {
75
77
  }
76
78
 
77
79
  const styleRules = getStyleRules(styles, styleSourceSelections);
78
- for (const { breakpointId, instanceId, style } of styleRules) {
80
+ for (const { breakpointId, instanceId, state, style } of styleRules) {
79
81
  engine.addStyleRule(
80
- `[${idAttribute}="${instanceId}"]`,
82
+ `[${idAttribute}="${instanceId}"]${state ?? ""}`,
81
83
  {
82
84
  breakpoint: breakpointId,
83
85
  style,
@@ -1,28 +1,24 @@
1
1
  import type { CssEngine } from "@webstudio-is/css-engine";
2
2
  import type { Assets, FontAsset } from "@webstudio-is/asset-uploader";
3
- import {
4
- type FontFormat,
5
- FONT_FORMATS,
6
- getFontFaces,
7
- } from "@webstudio-is/fonts";
3
+ import { getFontFaces } from "@webstudio-is/fonts";
8
4
 
9
5
  export const addGlobalRules = (
10
6
  engine: CssEngine,
11
- { assets }: { assets: Assets }
7
+ { assets, assetBaseUrl }: { assets: Assets; assetBaseUrl: string }
12
8
  ) => {
13
9
  // @todo we need to figure out all global resets while keeping
14
10
  // the engine aware of all of them.
15
11
  // Ideally, the user is somehow aware and in control of the reset
16
12
  engine.addPlaintextRule("html {margin: 0; height: 100%}");
17
13
 
18
- const fontAssets: Array<FontAsset> = [];
14
+ const fontAssets: FontAsset[] = [];
19
15
  for (const asset of assets.values()) {
20
- if (asset && FONT_FORMATS.has(asset.format as FontFormat)) {
21
- fontAssets.push(asset as FontAsset);
16
+ if (asset?.type === "font") {
17
+ fontAssets.push(asset);
22
18
  }
23
19
  }
24
20
 
25
- const fontFaces = getFontFaces(fontAssets);
21
+ const fontFaces = getFontFaces(fontAssets, { assetBaseUrl });
26
22
  for (const fontFace of fontFaces) {
27
23
  engine.addFontFaceRule(fontFace);
28
24
  }
@@ -55,6 +55,13 @@ test("compute styles from different style sources", () => {
55
55
  property: "color",
56
56
  value: { type: "keyword", value: "blue" },
57
57
  }),
58
+ createStyleDeclPair({
59
+ breakpointId: "a",
60
+ styleSourceId: "styleSource6",
61
+ state: ":hover",
62
+ property: "color",
63
+ value: { type: "keyword", value: "blue" },
64
+ }),
58
65
  ]);
59
66
  const styleSourceSelections: StyleSourceSelections = new Map([
60
67
  [
@@ -85,6 +92,7 @@ test("compute styles from different style sources", () => {
85
92
  {
86
93
  "breakpointId": "a",
87
94
  "instanceId": "instance1",
95
+ "state": undefined,
88
96
  "style": {
89
97
  "width": {
90
98
  "type": "unit",
@@ -96,6 +104,7 @@ test("compute styles from different style sources", () => {
96
104
  {
97
105
  "breakpointId": "a",
98
106
  "instanceId": "instance2",
107
+ "state": undefined,
99
108
  "style": {
100
109
  "color": {
101
110
  "type": "keyword",
@@ -110,6 +119,7 @@ test("compute styles from different style sources", () => {
110
119
  {
111
120
  "breakpointId": "b",
112
121
  "instanceId": "instance2",
122
+ "state": undefined,
113
123
  "style": {
114
124
  "color": {
115
125
  "type": "keyword",
@@ -120,6 +130,18 @@ test("compute styles from different style sources", () => {
120
130
  {
121
131
  "breakpointId": "a",
122
132
  "instanceId": "instance3",
133
+ "state": undefined,
134
+ "style": {
135
+ "color": {
136
+ "type": "keyword",
137
+ "value": "blue",
138
+ },
139
+ },
140
+ },
141
+ {
142
+ "breakpointId": "a",
143
+ "instanceId": "instance3",
144
+ "state": ":hover",
123
145
  "style": {
124
146
  "color": {
125
147
  "type": "keyword",
@@ -10,6 +10,7 @@ import type {
10
10
  type StyleRule = {
11
11
  instanceId: string;
12
12
  breakpointId: string;
13
+ state: undefined | string;
13
14
  style: Style;
14
15
  };
15
16
 
@@ -38,7 +39,10 @@ export const getStyleRules = (
38
39
 
39
40
  const styleRules: StyleRule[] = [];
40
41
  for (const { instanceId, values } of styleSourceSelections.values()) {
41
- const styleRuleByBreakpointId = new Map<Breakpoint["id"], StyleRule>();
42
+ const styleRuleByBreakpointId = new Map<
43
+ `${Breakpoint["id"]}:${string}`,
44
+ StyleRule
45
+ >();
42
46
 
43
47
  for (const styleSourceId of values) {
44
48
  const styleSourceStyles = stylesByStyleSourceId.get(styleSourceId);
@@ -46,15 +50,22 @@ export const getStyleRules = (
46
50
  if (styleSourceStyles === undefined) {
47
51
  continue;
48
52
  }
49
- for (const { breakpointId, property, value } of styleSourceStyles) {
50
- let styleRule = styleRuleByBreakpointId.get(breakpointId);
53
+ for (const {
54
+ breakpointId,
55
+ state,
56
+ property,
57
+ value,
58
+ } of styleSourceStyles) {
59
+ const key = `${breakpointId}:${state ?? ""}` as const;
60
+ let styleRule = styleRuleByBreakpointId.get(key);
51
61
  if (styleRule === undefined) {
52
62
  styleRule = {
53
63
  instanceId,
54
64
  breakpointId,
65
+ state,
55
66
  style: {},
56
67
  };
57
- styleRuleByBreakpointId.set(breakpointId, styleRule);
68
+ styleRuleByBreakpointId.set(key, styleRule);
58
69
  }
59
70
  styleRule.style[property] = value;
60
71
  }
package/src/props.test.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { describe, test, expect } from "@jest/globals";
2
2
  import { resolveUrlProp, type Pages, type PropsByInstanceId } from "./props";
3
3
  import type { Page, Prop } from "@webstudio-is/project-build";
4
+ import type { Asset, Assets } from "@webstudio-is/asset-uploader";
4
5
 
5
6
  const unique = () => Math.random().toString();
6
7
 
7
8
  describe("resolveUrlProp", () => {
8
9
  const instanceId = unique();
10
+ const projectId = unique();
9
11
 
10
12
  const page1: Page = {
11
13
  id: unique(),
@@ -25,6 +27,27 @@ describe("resolveUrlProp", () => {
25
27
  rootInstanceId: "0",
26
28
  };
27
29
 
30
+ const asset1: Asset = {
31
+ id: unique(),
32
+ name: unique(),
33
+ type: "image",
34
+ location: "REMOTE",
35
+ projectId,
36
+ format: "png",
37
+ size: 100000,
38
+ createdAt: new Date().toISOString(),
39
+ description: null,
40
+ meta: { width: 128, height: 180 },
41
+ };
42
+
43
+ const assetProp: Prop = {
44
+ type: "asset",
45
+ id: unique(),
46
+ instanceId,
47
+ name: unique(),
48
+ value: asset1.id,
49
+ };
50
+
28
51
  const pageByIdProp: Prop = {
29
52
  type: "page",
30
53
  id: unique(),
@@ -49,8 +72,8 @@ describe("resolveUrlProp", () => {
49
72
  value: unique(),
50
73
  };
51
74
 
52
- const propsByInstanceId: PropsByInstanceId = new Map([
53
- [instanceId, [pageByIdProp, pageByPathProp, arbitraryUrlProp]],
75
+ const props: PropsByInstanceId = new Map([
76
+ [instanceId, [pageByIdProp, pageByPathProp, arbitraryUrlProp, assetProp]],
54
77
  ]);
55
78
 
56
79
  const pages: Pages = new Map([
@@ -58,38 +81,45 @@ describe("resolveUrlProp", () => {
58
81
  [page2.id, page2],
59
82
  ]);
60
83
 
84
+ const assets: Assets = new Map([[asset1.id, asset1]]);
85
+
86
+ const stores = { props, pages, assets };
87
+
61
88
  test("if instanceId is unknown returns undefined", () => {
62
89
  expect(
63
- resolveUrlProp("unknown", pageByIdProp.name, propsByInstanceId, pages)
90
+ resolveUrlProp("unknown", pageByIdProp.name, stores)
64
91
  ).toBeUndefined();
65
92
  });
66
93
 
67
94
  test("if prop name is unknown returns undefined", () => {
68
- expect(
69
- resolveUrlProp(instanceId, "unknown", propsByInstanceId, pages)
70
- ).toBeUndefined();
95
+ expect(resolveUrlProp(instanceId, "unknown", stores)).toBeUndefined();
96
+ });
97
+
98
+ test("asset by id", () => {
99
+ expect(resolveUrlProp(instanceId, assetProp.name, stores)).toEqual({
100
+ type: "asset",
101
+ asset: asset1,
102
+ });
71
103
  });
72
104
 
73
105
  test("page by id", () => {
74
- expect(
75
- resolveUrlProp(instanceId, pageByIdProp.name, propsByInstanceId, pages)
76
- ).toBe(page1);
106
+ expect(resolveUrlProp(instanceId, pageByIdProp.name, stores)).toEqual({
107
+ type: "page",
108
+ page: page1,
109
+ });
77
110
  });
78
111
 
79
112
  test("page by path", () => {
80
- expect(
81
- resolveUrlProp(instanceId, pageByPathProp.name, propsByInstanceId, pages)
82
- ).toBe(page2);
113
+ expect(resolveUrlProp(instanceId, pageByPathProp.name, stores)).toEqual({
114
+ type: "page",
115
+ page: page2,
116
+ });
83
117
  });
84
118
 
85
119
  test("arbitrary url", () => {
86
- expect(
87
- resolveUrlProp(
88
- instanceId,
89
- arbitraryUrlProp.name,
90
- propsByInstanceId,
91
- pages
92
- )
93
- ).toBe(arbitraryUrlProp.value);
120
+ expect(resolveUrlProp(instanceId, arbitraryUrlProp.name, stores)).toEqual({
121
+ type: "string",
122
+ url: arbitraryUrlProp.value,
123
+ });
94
124
  });
95
125
  });
package/src/props.ts CHANGED
@@ -2,6 +2,7 @@ import { useContext, useMemo } from "react";
2
2
  import { computed } from "nanostores";
3
3
  import { useStore } from "@nanostores/react";
4
4
  import type { Instance, Page, Prop, Props } from "@webstudio-is/project-build";
5
+ import type { Asset, Assets } from "@webstudio-is/asset-uploader";
5
6
  import { ReactSdkContext } from "./context";
6
7
  import { idAttribute } from "./tree/webstudio-component";
7
8
 
@@ -67,10 +68,17 @@ export const usePropAsset = (instanceId: Instance["id"], name: string) => {
67
68
  export const resolveUrlProp = (
68
69
  instanceId: Instance["id"],
69
70
  name: string,
70
- propsByInstanceId: PropsByInstanceId,
71
- pages: Pages
72
- ): Page | string | undefined => {
73
- const instanceProps = propsByInstanceId.get(instanceId);
71
+ {
72
+ props,
73
+ pages,
74
+ assets,
75
+ }: { props: PropsByInstanceId; pages: Pages; assets: Assets }
76
+ ):
77
+ | { type: "page"; page: Page }
78
+ | { type: "asset"; asset: Asset }
79
+ | { type: "string"; url: string }
80
+ | undefined => {
81
+ const instanceProps = props.get(instanceId);
74
82
  if (instanceProps === undefined) {
75
83
  return;
76
84
  }
@@ -80,16 +88,22 @@ export const resolveUrlProp = (
80
88
  }
81
89
 
82
90
  if (prop.type === "page") {
83
- return pages.get(prop.value);
91
+ const page = pages.get(prop.value);
92
+ return page && { type: "page", page };
84
93
  }
85
94
 
86
95
  if (prop.type === "string") {
87
96
  for (const page of pages.values()) {
88
97
  if (page.path === prop.value) {
89
- return page;
98
+ return { type: "page", page };
90
99
  }
91
100
  }
92
- return prop.value;
101
+ return { type: "string", url: prop.value };
102
+ }
103
+
104
+ if (prop.type === "asset") {
105
+ const asset = assets.get(prop.value);
106
+ return asset && { type: "asset", asset };
93
107
  }
94
108
 
95
109
  return;
@@ -99,15 +113,16 @@ export const resolveUrlProp = (
99
113
  // this utility is used for link component in both builder and preview
100
114
  // so need to optimize rerenders with computed
101
115
  export const usePropUrl = (instanceId: Instance["id"], name: string) => {
102
- const { propsByInstanceIdStore, pagesStore } = useContext(ReactSdkContext);
116
+ const { propsByInstanceIdStore, pagesStore, assetsStore } =
117
+ useContext(ReactSdkContext);
103
118
  const pageStore = useMemo(
104
119
  () =>
105
120
  computed(
106
- [propsByInstanceIdStore, pagesStore],
107
- (propsByInstanceId, pages) =>
108
- resolveUrlProp(instanceId, name, propsByInstanceId, pages)
121
+ [propsByInstanceIdStore, pagesStore, assetsStore],
122
+ (props, pages, assets) =>
123
+ resolveUrlProp(instanceId, name, { props, pages, assets })
109
124
  ),
110
- [propsByInstanceIdStore, pagesStore, instanceId, name]
125
+ [propsByInstanceIdStore, pagesStore, assetsStore, instanceId, name]
111
126
  );
112
127
  return useStore(pageStore);
113
128
  };
@@ -1,18 +1,12 @@
1
- import { unstable_batchedUpdates as batchedUpdates } from "react-dom";
2
-
3
1
  type Task = () => void;
4
2
 
5
3
  let handle: ReturnType<typeof requestAnimationFrame> | undefined;
6
4
  let updateQueue: Task[] = [];
7
5
 
8
6
  const processUpdates = (updates: Task[]) => {
9
- // Prior to React v18, updates not called within React event handlers would not be batched
10
- // To ensure all updates are batched into a single React update, we wrap them in a batchedUpdates callback
11
- batchedUpdates(() => {
12
- for (const update of updates) {
13
- update();
14
- }
15
- });
7
+ for (const update of updates) {
8
+ update();
9
+ }
16
10
  };
17
11
 
18
12
  export const batchUpdate = (update: () => void) => {
@@ -2,11 +2,7 @@ import { type ComponentProps, Fragment } from "react";
2
2
  import type { ReadableAtom } from "nanostores";
3
3
  import { Scripts, ScrollRestoration } from "@remix-run/react";
4
4
  import type { Assets } from "@webstudio-is/asset-uploader";
5
- import type {
6
- Instance,
7
- Instances,
8
- InstancesItem,
9
- } from "@webstudio-is/project-build";
5
+ import type { Instance, Instances } from "@webstudio-is/project-build";
10
6
  import type { GetComponent } from "../components/components-utils";
11
7
  import { ReactSdkContext } from "../context";
12
8
  import type { Pages, PropsByInstanceId } from "../props";
@@ -79,7 +75,7 @@ const createInstanceChildrenElements = ({
79
75
  }: {
80
76
  instances: Instances;
81
77
  instanceSelector: InstanceSelector;
82
- children: InstancesItem["children"];
78
+ children: Instance["children"];
83
79
  Component: (props: ComponentProps<typeof WebstudioComponent>) => JSX.Element;
84
80
  getComponent: GetComponent;
85
81
  }) => {
@@ -120,7 +116,7 @@ const createInstanceElement = ({
120
116
  children = [],
121
117
  getComponent,
122
118
  }: {
123
- instance: InstancesItem;
119
+ instance: Instance;
124
120
  instanceSelector: InstanceSelector;
125
121
  Component: (props: ComponentProps<typeof WebstudioComponent>) => JSX.Element;
126
122
  children?: Array<JSX.Element | string>;
package/src/tree/root.ts CHANGED
@@ -35,7 +35,7 @@ export const InstanceRoot = ({
35
35
  customComponents = defaultCustomComponents,
36
36
  getComponent,
37
37
  }: RootProps): JSX.Element | null => {
38
- setParams(data.params ?? null);
38
+ setParams(data.params);
39
39
  registerComponents(customComponents);
40
40
  return createElementsTree({
41
41
  instances: new Map(data.build.instances),
@@ -1,5 +1,5 @@
1
1
  import { Fragment } from "react";
2
- import type { Instance, InstancesItem } from "@webstudio-is/project-build";
2
+ import type { Instance } from "@webstudio-is/project-build";
3
3
  import type { GetComponent } from "../components/components-utils";
4
4
  import { useInstanceProps } from "../props";
5
5
 
@@ -27,7 +27,7 @@ export const renderWebstudioComponentChildren = (
27
27
  };
28
28
 
29
29
  type WebstudioComponentProps = {
30
- instance: InstancesItem;
30
+ instance: Instance;
31
31
  instanceSelector: Instance["id"][];
32
32
  children: Array<JSX.Element | string>;
33
33
  getComponent: GetComponent;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const Image: import("react").ForwardRefExoticComponent<Pick<Pick<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & {
3
- quality?: number | undefined;
4
- optimize?: boolean | undefined;
5
- loader: import("@webstudio-is/image").ImageLoader;
6
- }, "key" | keyof import("react").ImgHTMLAttributes<HTMLImageElement> | "quality" | "loader" | "optimize"> & import("react").RefAttributes<HTMLImageElement>, "key" | keyof import("react").ImgHTMLAttributes<HTMLImageElement> | "quality" | "loader" | "optimize"> & import("react").RefAttributes<HTMLImageElement>>;
@@ -1,26 +0,0 @@
1
- /// <reference types="react" />
2
- import type { WsComponentPropsMeta } from "../../components/component-meta";
3
- export declare const customComponents: {
4
- Image: import("react").ForwardRefExoticComponent<Pick<Pick<import("react").ClassAttributes<HTMLImageElement> & import("react").ImgHTMLAttributes<HTMLImageElement> & {
5
- quality?: number | undefined;
6
- optimize?: boolean | undefined;
7
- loader: import("@webstudio-is/image").ImageLoader;
8
- }, "key" | keyof import("react").ImgHTMLAttributes<HTMLImageElement> | "quality" | "loader" | "optimize"> & import("react").RefAttributes<HTMLImageElement>, "key" | keyof import("react").ImgHTMLAttributes<HTMLImageElement> | "quality" | "loader" | "optimize"> & import("react").RefAttributes<HTMLImageElement>>;
9
- Link: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
10
- href?: string | undefined;
11
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
12
- prefetch?: "none" | "intent" | "render" | undefined;
13
- }, "type" | "style" | "id" | "title" | "children" | "hidden" | "color" | "translate" | "property" | "placeholder" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "target" | "download" | "hrefLang" | "media" | "ping" | "rel" | "referrerPolicy" | "prefetch"> & import("react").RefAttributes<HTMLAnchorElement>>;
14
- RichTextLink: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
15
- href?: string | undefined;
16
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
17
- prefetch?: "none" | "intent" | "render" | undefined;
18
- }, "type" | "style" | "id" | "title" | "children" | "hidden" | "color" | "translate" | "property" | "placeholder" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "target" | "download" | "hrefLang" | "media" | "ping" | "rel" | "referrerPolicy" | "prefetch"> & import("react").RefAttributes<HTMLAnchorElement>>;
19
- LinkBlock: import("react").ForwardRefExoticComponent<Pick<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
20
- href?: string | undefined;
21
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
22
- prefetch?: "none" | "intent" | "render" | undefined;
23
- }, "type" | "style" | "id" | "title" | "children" | "hidden" | "color" | "translate" | "property" | "placeholder" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "target" | "download" | "hrefLang" | "media" | "ping" | "rel" | "referrerPolicy" | "prefetch"> & import("react").RefAttributes<HTMLAnchorElement>>;
24
- };
25
- export declare const customComponentPropsMetas: Record<string, WsComponentPropsMeta>;
26
- export declare const customComponentMetas: {};
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const LinkBlock: import("react").ForwardRefExoticComponent<Pick<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
- }, "type" | "style" | "id" | "title" | "children" | "hidden" | "color" | "translate" | "property" | "placeholder" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "target" | "download" | "hrefLang" | "media" | "ping" | "rel" | "referrerPolicy" | "prefetch"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const Link: import("react").ForwardRefExoticComponent<Pick<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
- }, "type" | "style" | "id" | "title" | "children" | "hidden" | "color" | "translate" | "property" | "placeholder" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "target" | "download" | "hrefLang" | "media" | "ping" | "rel" | "referrerPolicy" | "prefetch"> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const RichTextLink: import("react").ForwardRefExoticComponent<Pick<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
- }, "type" | "style" | "id" | "title" | "children" | "hidden" | "color" | "translate" | "property" | "placeholder" | "slot" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "target" | "download" | "hrefLang" | "media" | "ping" | "rel" | "referrerPolicy" | "prefetch"> & import("react").RefAttributes<HTMLAnchorElement>>;