@plasmicapp/react-web 0.2.360 → 0.2.362
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/all.d.ts +4 -0
- 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 +4 -4
- 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
package/dist/all.d.ts
CHANGED
|
@@ -12258,6 +12258,10 @@ interface CustomFunctionMeta<F extends (...args: any[]) => any> {
|
|
|
12258
12258
|
* provided by `params` and `returnValue`.
|
|
12259
12259
|
*/
|
|
12260
12260
|
typescriptDeclaration?: string;
|
|
12261
|
+
/**
|
|
12262
|
+
* Whether this function can be used as a query in the editor.
|
|
12263
|
+
*/
|
|
12264
|
+
isQuery?: boolean;
|
|
12261
12265
|
/**
|
|
12262
12266
|
* The path to be used when importing the function in the generated code.
|
|
12263
12267
|
* It can be the name of the package that contains the function, or the path
|
package/dist/index.cjs.js
CHANGED
|
@@ -2240,9 +2240,12 @@ function create$StateProxy($$state, leafHandlers) {
|
|
|
2240
2240
|
Reflect.set(target, property, value, receiver);
|
|
2241
2241
|
if (nextSpec === null || nextSpec === void 0 ? void 0 : nextSpec.onChangeProp) {
|
|
2242
2242
|
var pathKey = JSON.stringify(nextPath);
|
|
2243
|
-
var isInitOnChange =
|
|
2243
|
+
var isInitOnChange =
|
|
2244
|
+
// If we are dealing with a valueProp it means that this state cell value is provided by the parent
|
|
2245
|
+
// and we don't need to consider initialization calls for it.
|
|
2246
|
+
!nextSpec.valueProp && !$$state.initializedLeafPaths.has(pathKey);
|
|
2244
2247
|
// We need to call the onChangeProp during initialization process so that the parent
|
|
2245
|
-
// state can be updated with the correct value. We will provide an
|
|
2248
|
+
// state can be updated with the correct value. We will provide an additional parameter
|
|
2246
2249
|
// to the onChangeProp function to indicate that the call is made during initialization.
|
|
2247
2250
|
(_d = (_c = $$state.env.$props)[nextSpec.onChangeProp]) === null || _d === void 0 ? void 0 : _d.call(_c, value, {
|
|
2248
2251
|
_plasmic_state_init_: isInitOnChange,
|
|
@@ -2523,11 +2526,10 @@ function useDollarState(specs) {
|
|
|
2523
2526
|
useIsomorphicLayoutEffect(function () {
|
|
2524
2527
|
$$state.specTreeLeaves.forEach(function (node) {
|
|
2525
2528
|
var spec = node.getSpec();
|
|
2526
|
-
if (!spec.isRepeated && spec.type !== "private"
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
}
|
|
2529
|
+
if (!spec.isRepeated && spec.type !== "private") {
|
|
2530
|
+
// We only need to attempt to access the state cell to trigger initialization,
|
|
2531
|
+
// Check create$StateProxy for more details on how this works.
|
|
2532
|
+
getStateCellFrom$StateRoot($state, spec.pathObj);
|
|
2531
2533
|
}
|
|
2532
2534
|
});
|
|
2533
2535
|
}, []);
|