@plasmicapp/react-web 0.2.181 → 0.2.183
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/react-web.cjs.development.js +14 -12
- package/dist/react-web.cjs.development.js.map +1 -1
- package/dist/react-web.cjs.production.min.js +1 -1
- package/dist/react-web.cjs.production.min.js.map +1 -1
- package/dist/react-web.esm.js +14 -12
- package/dist/react-web.esm.js.map +1 -1
- package/dist/stories/UseDollarState.stories.d.ts +1 -0
- package/package.json +20 -4
- package/skinny/dist/index.js +15 -11
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/stories/UseDollarState.stories.d.ts +1 -0
|
@@ -72,5 +72,6 @@ export declare const ImmutableStateCells: import("@storybook/csf").AnnotatedStor
|
|
|
72
72
|
people: Person[];
|
|
73
73
|
}>;
|
|
74
74
|
export declare const InCanvasDollarState: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, {}>;
|
|
75
|
+
export declare const AddDeleteSpecsInCanvas: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, {}>;
|
|
75
76
|
export declare const TodoApp: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, {}>;
|
|
76
77
|
export declare const CycleInStateInitialization: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, {}>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.183",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"module": "dist/react-web.esm.js",
|
|
8
|
+
"nx": {
|
|
9
|
+
"targets": {
|
|
10
|
+
"build": {
|
|
11
|
+
"inputs": [
|
|
12
|
+
"{projectRoot}/**/*",
|
|
13
|
+
"!{projectRoot}/**/dist/**/*",
|
|
14
|
+
"!{projectRoot}/lib/**/*"
|
|
15
|
+
],
|
|
16
|
+
"outputs": [
|
|
17
|
+
"{projectRoot}/dist",
|
|
18
|
+
"{projectRoot}/**/dist",
|
|
19
|
+
"{projectRoot}/lib"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
8
24
|
"size-limit": [
|
|
9
25
|
{
|
|
10
26
|
"path": "dist/react-web.cjs.production.min.js",
|
|
@@ -86,9 +102,9 @@
|
|
|
86
102
|
},
|
|
87
103
|
"prettier": {},
|
|
88
104
|
"dependencies": {
|
|
89
|
-
"@plasmicapp/data-sources": "0.1.
|
|
105
|
+
"@plasmicapp/data-sources": "0.1.55",
|
|
90
106
|
"@plasmicapp/data-sources-context": "0.1.7",
|
|
91
|
-
"@plasmicapp/host": "1.0.
|
|
107
|
+
"@plasmicapp/host": "1.0.120",
|
|
92
108
|
"@plasmicapp/query": "0.1.61",
|
|
93
109
|
"@react-aria/checkbox": "^3.5.0",
|
|
94
110
|
"@react-aria/focus": "^3.7.0",
|
|
@@ -155,5 +171,5 @@
|
|
|
155
171
|
"react": ">=16.8.0",
|
|
156
172
|
"react-dom": ">=16.8.0"
|
|
157
173
|
},
|
|
158
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "40a5cdf705d54bbd0e4891bf5ea4b8470731bd12"
|
|
159
175
|
}
|
package/skinny/dist/index.js
CHANGED
|
@@ -1296,11 +1296,13 @@ function useDollarState(specs) {
|
|
|
1296
1296
|
var old$state_1 = $state;
|
|
1297
1297
|
$state = ref.current = create$State();
|
|
1298
1298
|
$$state.specTreeLeaves = newLeaves;
|
|
1299
|
-
getStateCells(
|
|
1299
|
+
getStateCells(old$state_1, $$state.rootSpecTree).forEach(function (_a) {
|
|
1300
1300
|
var path = _a.path;
|
|
1301
1301
|
var oldStateCell = tryGetStateCellFrom$StateRoot(old$state_1, path);
|
|
1302
1302
|
if (oldStateCell) {
|
|
1303
1303
|
set($state, path, get(old$state_1, path));
|
|
1304
|
+
var newStateCell = getStateCellFrom$StateRoot($state, path);
|
|
1305
|
+
newStateCell.initialValue = oldStateCell.initialValue;
|
|
1304
1306
|
}
|
|
1305
1307
|
});
|
|
1306
1308
|
}
|
|
@@ -1313,7 +1315,9 @@ function useDollarState(specs) {
|
|
|
1313
1315
|
}
|
|
1314
1316
|
var stateCell = getStateCellFrom$StateRoot($state, spec.pathObj);
|
|
1315
1317
|
var newSpec = specs.find(function (sp) { return sp.path === spec.path; });
|
|
1316
|
-
if (!newSpec ||
|
|
1318
|
+
if (!newSpec ||
|
|
1319
|
+
stateCell.initFuncHash === (newSpec === null || newSpec === void 0 ? void 0 : newSpec.initFuncHash) ||
|
|
1320
|
+
stateCell.initialValue !== UNINITIALIZED) {
|
|
1317
1321
|
return;
|
|
1318
1322
|
}
|
|
1319
1323
|
stateCell.initFunc = newSpec.initFunc;
|
|
@@ -1451,22 +1455,22 @@ function getStateCells($state, root) {
|
|
|
1451
1455
|
if ($state == null || typeof $state !== "object") {
|
|
1452
1456
|
return [];
|
|
1453
1457
|
}
|
|
1454
|
-
var stateCells = Object.values((_b = proxyObjToStateCell.get($state)) !== null && _b !== void 0 ? _b : {});
|
|
1455
|
-
if (root.isLeaf()) {
|
|
1456
|
-
return stateCells;
|
|
1457
|
-
}
|
|
1458
1458
|
if (root.hasArrayTransition()) {
|
|
1459
|
-
return
|
|
1459
|
+
return Object.keys($state).flatMap(function (key) {
|
|
1460
1460
|
return getStateCells($state[key], ensure(root.makeTransition(ARRAY_SYMBOL)));
|
|
1461
|
-
})
|
|
1461
|
+
});
|
|
1462
1462
|
}
|
|
1463
1463
|
else {
|
|
1464
|
-
var
|
|
1464
|
+
var stateCell = (_b = proxyObjToStateCell.get($state)) !== null && _b !== void 0 ? _b : {};
|
|
1465
|
+
var stateCells = [];
|
|
1465
1466
|
try {
|
|
1466
1467
|
for (var _c = __values(root.edges().entries()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1467
1468
|
var _e = __read(_d.value, 2), key = _e[0], child = _e[1];
|
|
1468
1469
|
if (typeof key === "string" && key in $state) {
|
|
1469
|
-
|
|
1470
|
+
stateCells.push.apply(stateCells, __spreadArray([], __read(getStateCells($state[key], child)), false));
|
|
1471
|
+
if (key in stateCell) {
|
|
1472
|
+
stateCells.push(stateCell[key]);
|
|
1473
|
+
}
|
|
1470
1474
|
}
|
|
1471
1475
|
}
|
|
1472
1476
|
}
|
|
@@ -1477,7 +1481,7 @@ function getStateCells($state, root) {
|
|
|
1477
1481
|
}
|
|
1478
1482
|
finally { if (e_3) throw e_3.error; }
|
|
1479
1483
|
}
|
|
1480
|
-
return
|
|
1484
|
+
return stateCells;
|
|
1481
1485
|
}
|
|
1482
1486
|
}
|
|
1483
1487
|
function getStateCellsInPlasmicProxy(obj) {
|