@plasmicapp/react-web 0.2.139 → 0.2.140
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 +44 -41
- 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 +44 -41
- package/dist/react-web.esm.js.map +1 -1
- package/package.json +6 -6
- package/skinny/dist/index.js +40 -36
- package/skinny/dist/index.js.map +1 -1
|
@@ -1285,10 +1285,16 @@ function renderPlasmicSlot(opts) {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
function maybeAsString(node) {
|
|
1287
1287
|
// Unwrap fragments
|
|
1288
|
-
if (React.isValidElement(node)
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1288
|
+
if (React.isValidElement(node)) {
|
|
1289
|
+
// Fragment doesn't render DOM elements
|
|
1290
|
+
if (node.type === React.Fragment) {
|
|
1291
|
+
return maybeAsString(node.props.children);
|
|
1292
|
+
} else if (node.type === Trans) {
|
|
1293
|
+
// Trans also doesn't render DOM elements. But we don't want to just render
|
|
1294
|
+
// its content string, because we want to keep the <Trans/> for the localization.
|
|
1295
|
+
// So we render the same node, to be wrapped into __wab_slot-string-wrapper.
|
|
1296
|
+
return node;
|
|
1297
|
+
}
|
|
1292
1298
|
}
|
|
1293
1299
|
if (typeof node === "string") {
|
|
1294
1300
|
return node;
|
|
@@ -1872,7 +1878,7 @@ function create$StateProxy($$state, leafHandlers) {
|
|
|
1872
1878
|
return true;
|
|
1873
1879
|
}
|
|
1874
1880
|
};
|
|
1875
|
-
var baseObject = !isOutside && !currNode.isLeaf() ? currNode.hasArrayTransition() ? [] : {} : Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject));
|
|
1881
|
+
var baseObject = !isOutside && !currNode.isLeaf() ? currNode.hasArrayTransition() ? [] : {} : Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject != null ? initialObject : {}));
|
|
1876
1882
|
var proxyObj = new Proxy(baseObject, handlers);
|
|
1877
1883
|
if (initialObject) {
|
|
1878
1884
|
Reflect.ownKeys(initialObject).forEach(function (key) {
|
|
@@ -1905,46 +1911,43 @@ function useDollarState(specs, props, $ctx) {
|
|
|
1905
1911
|
}()).current;
|
|
1906
1912
|
$$state.props = props;
|
|
1907
1913
|
$$state.ctx = $ctx != null ? $ctx : {};
|
|
1908
|
-
var $state = React__default.useRef(function () {
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1914
|
+
var $state = React__default.useRef(Object.assign(create$StateProxy($$state, function (node, path, proxyRoot) {
|
|
1915
|
+
if (!node.hasState(path)) {
|
|
1916
|
+
node.createStateCell(path);
|
|
1917
|
+
var spec = node.getSpec();
|
|
1918
|
+
if (spec.initFunc) {
|
|
1919
|
+
initializeStateValue($$state, node, path, proxyRoot);
|
|
1920
|
+
} else if (!spec.valueProp) {
|
|
1921
|
+
set(proxyRoot, path, spec.initVal);
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
return {
|
|
1925
|
+
get: function get(target, property, receiver) {
|
|
1912
1926
|
var spec = node.getSpec();
|
|
1913
|
-
if (spec.
|
|
1914
|
-
|
|
1915
|
-
} else
|
|
1916
|
-
|
|
1927
|
+
if (spec.valueProp) {
|
|
1928
|
+
return $$state.props[spec.valueProp];
|
|
1929
|
+
} else {
|
|
1930
|
+
return Reflect.get(target, property, receiver);
|
|
1917
1931
|
}
|
|
1918
1932
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
}
|
|
1928
|
-
};
|
|
1929
|
-
}), {
|
|
1930
|
-
registerInitFunc: function registerInitFunc(pathStr, f, repetitionIndex) {
|
|
1931
|
-
var _findStateCell = findStateCell($$state.rootSpecTree, pathStr, repetitionIndex),
|
|
1932
|
-
node = _findStateCell.node,
|
|
1933
|
-
realPath = _findStateCell.realPath;
|
|
1934
|
-
if (!node.hasState(realPath)) {
|
|
1935
|
-
node.createStateCell(realPath);
|
|
1936
|
-
}
|
|
1937
|
-
if (!deepEqual(node.getState(realPath).initialValue, f($$state.props, useRef$state, $$state.ctx))) {
|
|
1938
|
-
$$state.registrationsQueue.push({
|
|
1939
|
-
node: node,
|
|
1940
|
-
path: realPath,
|
|
1941
|
-
f: f
|
|
1942
|
-
});
|
|
1943
|
-
}
|
|
1933
|
+
};
|
|
1934
|
+
}), {
|
|
1935
|
+
registerInitFunc: function registerInitFunc(pathStr, f, repetitionIndex) {
|
|
1936
|
+
var _findStateCell = findStateCell($$state.rootSpecTree, pathStr, repetitionIndex),
|
|
1937
|
+
node = _findStateCell.node,
|
|
1938
|
+
realPath = _findStateCell.realPath;
|
|
1939
|
+
if (!node.hasState(realPath)) {
|
|
1940
|
+
node.createStateCell(realPath);
|
|
1944
1941
|
}
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1942
|
+
if (!deepEqual(node.getState(realPath).initialValue, f($$state.props, $state, $$state.ctx))) {
|
|
1943
|
+
$$state.registrationsQueue.push({
|
|
1944
|
+
node: node,
|
|
1945
|
+
path: realPath,
|
|
1946
|
+
f: f
|
|
1947
|
+
});
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
})).current;
|
|
1948
1951
|
// For each spec with an initFunc, evaluate it and see if
|
|
1949
1952
|
// the init value has changed. If so, reset its state.
|
|
1950
1953
|
var resetSpecs = [];
|