@webstudio-is/react-sdk 0.98.0 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -34,10 +34,7 @@ var ReactSdkContext = createContext({
34
34
  throw Error("React SDK executeEffectfulExpression is not implemented");
35
35
  },
36
36
  setDataSourceValues: () => {
37
- throw Error("React SDK setBoundDataSourceValue is not implemented");
38
- },
39
- setBoundDataSourceValue: () => {
40
- throw Error("React SDK setBoundDataSourceValue is not implemented");
37
+ throw Error("React SDK setDataSourceValues is not implemented");
41
38
  },
42
39
  indexesWithinAncestors: /* @__PURE__ */ new Map()
43
40
  });
@@ -100,19 +97,7 @@ var createElementsTree = ({
100
97
  imageBaseUrl,
101
98
  indexesWithinAncestors,
102
99
  executeEffectfulExpression: executeEffectfulExpression2,
103
- setDataSourceValues: onDataSourceUpdate,
104
- setBoundDataSourceValue: (instanceId, propName, value) => {
105
- const propsByInstanceId = propsByInstanceIdStore.get();
106
- const props = propsByInstanceId.get(instanceId);
107
- const prop = props?.find((prop2) => prop2.name === propName);
108
- if (prop?.type !== "dataSource") {
109
- throw Error(`${propName} is not data source`);
110
- }
111
- const dataSourceId = prop.value;
112
- const newValues = /* @__PURE__ */ new Map();
113
- newValues.set(dataSourceId, value);
114
- onDataSourceUpdate(newValues);
115
- }
100
+ setDataSourceValues: onDataSourceUpdate
116
101
  },
117
102
  children: root
118
103
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { type ReadableAtom } from "nanostores";
3
- import type { DataSource, Instance, Prop, Assets } from "@webstudio-is/sdk";
3
+ import type { DataSource, Assets } from "@webstudio-is/sdk";
4
4
  import type { Pages, PropsByInstanceId } from "./props";
5
5
  import type { IndexesWithinAncestors } from "./instance-utils";
6
6
  import type { ImageLoader } from "@webstudio-is/image";
@@ -39,6 +39,5 @@ export declare const ReactSdkContext: import("react").Context<Params & {
39
39
  dataSourceValuesStore: ReadableAtom<DataSourceValues>;
40
40
  executeEffectfulExpression: (expression: string, args: DataSourceValues, values: DataSourceValues) => DataSourceValues;
41
41
  setDataSourceValues: (newValues: DataSourceValues) => void;
42
- setBoundDataSourceValue: (instanceId: Instance["id"], prop: Prop["name"], value: unknown) => void;
43
42
  indexesWithinAncestors: IndexesWithinAncestors;
44
43
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/react-sdk",
3
- "version": "0.98.0",
3
+ "version": "0.99.0",
4
4
  "description": "Webstudio JavaScript / TypeScript API",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -34,10 +34,10 @@
34
34
  "nanostores": "^0.9.3",
35
35
  "no-case": "^3.0.4",
36
36
  "title-case": "^3.0.3",
37
- "@webstudio-is/css-engine": "^0.98.0",
38
- "@webstudio-is/fonts": "^0.98.0",
39
- "@webstudio-is/image": "^0.98.0",
40
- "@webstudio-is/sdk": "^0.98.0"
37
+ "@webstudio-is/css-engine": "^0.99.0",
38
+ "@webstudio-is/fonts": "^0.99.0",
39
+ "@webstudio-is/image": "^0.99.0",
40
+ "@webstudio-is/sdk": "^0.99.0"
41
41
  },
42
42
  "exports": {
43
43
  ".": {