@plasmicapp/react-web 0.2.360 → 0.2.361
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/dist/index.cjs.js +9 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +9 -7
- package/dist/react-web.esm.js.map +1 -1
- package/dist/stories/UseDollarState.stories.d.ts +1 -0
- package/package.json +2 -2
- package/skinny/dist/index.js +9 -7
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/stories/UseDollarState.stories.d.ts +1 -0
|
@@ -68,6 +68,7 @@ export declare const StateCellIsMatrix: import("@storybook/types").AnnotatedStor
|
|
|
68
68
|
board: number[][];
|
|
69
69
|
}>;
|
|
70
70
|
export declare const IsOnChangePropImmediatelyFired: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
|
|
71
|
+
export declare const IsOnChangeFiredWithCorrectInitialValue: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {}>;
|
|
71
72
|
export declare const ImmutableStateCells: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
72
73
|
people: Person[];
|
|
73
74
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.361",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
"react": ">=16.8.0",
|
|
169
169
|
"react-dom": ">=16.8.0"
|
|
170
170
|
},
|
|
171
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "ca6c646bde3852007b61d28b61b27bcfa7388430"
|
|
172
172
|
}
|
package/skinny/dist/index.js
CHANGED
|
@@ -1147,9 +1147,12 @@ function create$StateProxy($$state, leafHandlers) {
|
|
|
1147
1147
|
Reflect.set(target, property, value, receiver);
|
|
1148
1148
|
if (nextSpec === null || nextSpec === void 0 ? void 0 : nextSpec.onChangeProp) {
|
|
1149
1149
|
var pathKey = JSON.stringify(nextPath);
|
|
1150
|
-
var isInitOnChange =
|
|
1150
|
+
var isInitOnChange =
|
|
1151
|
+
// If we are dealing with a valueProp it means that this state cell value is provided by the parent
|
|
1152
|
+
// and we don't need to consider initialization calls for it.
|
|
1153
|
+
!nextSpec.valueProp && !$$state.initializedLeafPaths.has(pathKey);
|
|
1151
1154
|
// We need to call the onChangeProp during initialization process so that the parent
|
|
1152
|
-
// state can be updated with the correct value. We will provide an
|
|
1155
|
+
// state can be updated with the correct value. We will provide an additional parameter
|
|
1153
1156
|
// to the onChangeProp function to indicate that the call is made during initialization.
|
|
1154
1157
|
(_d = (_c = $$state.env.$props)[nextSpec.onChangeProp]) === null || _d === void 0 ? void 0 : _d.call(_c, value, {
|
|
1155
1158
|
_plasmic_state_init_: isInitOnChange,
|
|
@@ -1430,11 +1433,10 @@ function useDollarState(specs) {
|
|
|
1430
1433
|
useIsomorphicLayoutEffect(function () {
|
|
1431
1434
|
$$state.specTreeLeaves.forEach(function (node) {
|
|
1432
1435
|
var spec = node.getSpec();
|
|
1433
|
-
if (!spec.isRepeated && spec.type !== "private"
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
}
|
|
1436
|
+
if (!spec.isRepeated && spec.type !== "private") {
|
|
1437
|
+
// We only need to attempt to access the state cell to trigger initialization,
|
|
1438
|
+
// Check create$StateProxy for more details on how this works.
|
|
1439
|
+
getStateCellFrom$StateRoot($state, spec.pathObj);
|
|
1438
1440
|
}
|
|
1439
1441
|
});
|
|
1440
1442
|
}, []);
|