@plasmicapp/react-web 0.2.175 → 0.2.177
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 +11668 -81
- package/dist/react-web.cjs.development.js +48 -3
- 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 +46 -4
- package/dist/react-web.esm.js.map +1 -1
- package/dist/states/helpers.d.ts +11 -1
- package/dist/states/index.d.ts +1 -1
- package/package.json +4 -4
- package/skinny/dist/index.js +59 -1
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/states/helpers.d.ts +11 -1
- package/skinny/dist/states/index.d.ts +1 -1
|
@@ -2863,11 +2863,53 @@ function useDollarState(specs) {
|
|
|
2863
2863
|
return $state;
|
|
2864
2864
|
}
|
|
2865
2865
|
|
|
2866
|
+
function initializeCodeComponentStates($state, states, repetitionIndex, componentHelpers, child$Props) {
|
|
2867
|
+
var _componentHelpers$sta;
|
|
2868
|
+
var stateHelpers = (_componentHelpers$sta = componentHelpers == null ? void 0 : componentHelpers.states) != null ? _componentHelpers$sta : {};
|
|
2869
|
+
var _loop = function _loop() {
|
|
2870
|
+
var _step$value = _step.value,
|
|
2871
|
+
name = _step$value.name,
|
|
2872
|
+
plasmicStateName = _step$value.plasmicStateName;
|
|
2873
|
+
if (name in stateHelpers && "initFunc" in stateHelpers[name]) {
|
|
2874
|
+
$state.registerInitFunc == null ? void 0 : $state.registerInitFunc(plasmicStateName, function (_ref) {
|
|
2875
|
+
var _stateHelpers$name$in, _stateHelpers$name;
|
|
2876
|
+
var $props = _ref.$props;
|
|
2877
|
+
return (_stateHelpers$name$in = (_stateHelpers$name = stateHelpers[name]).initFunc) == null ? void 0 : _stateHelpers$name$in.call(_stateHelpers$name, $props);
|
|
2878
|
+
}, repetitionIndex != null ? repetitionIndex : [], {
|
|
2879
|
+
$props: child$Props
|
|
2880
|
+
});
|
|
2881
|
+
}
|
|
2882
|
+
};
|
|
2883
|
+
for (var _iterator = _createForOfIteratorHelperLoose(states), _step; !(_step = _iterator()).done;) {
|
|
2884
|
+
_loop();
|
|
2885
|
+
}
|
|
2886
|
+
}
|
|
2887
|
+
function initializePlasmicStates($state, states, repetitionIndex) {
|
|
2888
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(states), _step2; !(_step2 = _iterator2()).done;) {
|
|
2889
|
+
var _step2$value = _step2.value,
|
|
2890
|
+
name = _step2$value.name,
|
|
2891
|
+
initFunc = _step2$value.initFunc;
|
|
2892
|
+
$state.registerInitFunc == null ? void 0 : $state.registerInitFunc(name, initFunc, repetitionIndex != null ? repetitionIndex : []);
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2866
2895
|
function generateStateOnChangeProp($state, path) {
|
|
2867
2896
|
return function (val) {
|
|
2868
2897
|
return set($state, path, val);
|
|
2869
2898
|
};
|
|
2870
2899
|
}
|
|
2900
|
+
function generateStateOnChangePropForCodeComponents($state, stateName, plasmicStatePath, componentHelpers) {
|
|
2901
|
+
var _componentHelpers$sta2, _componentHelpers$sta3;
|
|
2902
|
+
var onChangeArgsToValue = componentHelpers == null ? void 0 : (_componentHelpers$sta2 = componentHelpers.states) == null ? void 0 : (_componentHelpers$sta3 = _componentHelpers$sta2[stateName]) == null ? void 0 : _componentHelpers$sta3.onChangeArgsToValue;
|
|
2903
|
+
if (!onChangeArgsToValue || typeof onChangeArgsToValue !== "function") {
|
|
2904
|
+
return generateStateOnChangeProp($state, plasmicStatePath);
|
|
2905
|
+
}
|
|
2906
|
+
return function () {
|
|
2907
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2908
|
+
args[_key] = arguments[_key];
|
|
2909
|
+
}
|
|
2910
|
+
return generateStateOnChangeProp($state, plasmicStatePath)(onChangeArgsToValue.apply(null, args));
|
|
2911
|
+
};
|
|
2912
|
+
}
|
|
2871
2913
|
function generateStateValueProp($state, path) {
|
|
2872
2914
|
return _get($state, path);
|
|
2873
2915
|
}
|
|
@@ -2889,9 +2931,9 @@ function getStateCells($state, root) {
|
|
|
2889
2931
|
return getStateCells($state[key], ensure(root.makeTransition(ARRAY_SYMBOL)));
|
|
2890
2932
|
}));
|
|
2891
2933
|
} else {
|
|
2892
|
-
return [].concat(stateCells, [].concat(root.edges().entries()).flatMap(function (
|
|
2893
|
-
var key =
|
|
2894
|
-
child =
|
|
2934
|
+
return [].concat(stateCells, [].concat(root.edges().entries()).flatMap(function (_ref2) {
|
|
2935
|
+
var key = _ref2[0],
|
|
2936
|
+
child = _ref2[1];
|
|
2895
2937
|
return typeof key === "string" && key in $state ? getStateCells($state[key], child) : [];
|
|
2896
2938
|
}));
|
|
2897
2939
|
}
|
|
@@ -4531,12 +4573,15 @@ exports.deriveRenderOpts = deriveRenderOpts;
|
|
|
4531
4573
|
exports.ensureGlobalVariants = ensureGlobalVariants;
|
|
4532
4574
|
exports.genTranslatableString = genTranslatableString;
|
|
4533
4575
|
exports.generateStateOnChangeProp = generateStateOnChangeProp;
|
|
4576
|
+
exports.generateStateOnChangePropForCodeComponents = generateStateOnChangePropForCodeComponents;
|
|
4534
4577
|
exports.generateStateValueProp = generateStateValueProp;
|
|
4535
4578
|
exports.getCurrentInitialValue = getCurrentInitialValue;
|
|
4536
4579
|
exports.getDataProps = getDataProps;
|
|
4537
4580
|
exports.getStateCellsInPlasmicProxy = getStateCellsInPlasmicProxy;
|
|
4538
4581
|
exports.getStateSpecInPlasmicProxy = getStateSpecInPlasmicProxy;
|
|
4539
4582
|
exports.hasVariant = hasVariant;
|
|
4583
|
+
exports.initializeCodeComponentStates = initializeCodeComponentStates;
|
|
4584
|
+
exports.initializePlasmicStates = initializePlasmicStates;
|
|
4540
4585
|
exports.isPlasmicStateProxy = isPlasmicStateProxy;
|
|
4541
4586
|
exports.makeFragment = makeFragment;
|
|
4542
4587
|
exports.mergeVariantsWithStates = mergeVariantsWithStates;
|