@plasmicapp/react-web 0.2.176 → 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 +2 -2
- 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
package/dist/react-web.esm.js
CHANGED
|
@@ -2858,11 +2858,53 @@ function useDollarState(specs) {
|
|
|
2858
2858
|
return $state;
|
|
2859
2859
|
}
|
|
2860
2860
|
|
|
2861
|
+
function initializeCodeComponentStates($state, states, repetitionIndex, componentHelpers, child$Props) {
|
|
2862
|
+
var _componentHelpers$sta;
|
|
2863
|
+
var stateHelpers = (_componentHelpers$sta = componentHelpers == null ? void 0 : componentHelpers.states) != null ? _componentHelpers$sta : {};
|
|
2864
|
+
var _loop = function _loop() {
|
|
2865
|
+
var _step$value = _step.value,
|
|
2866
|
+
name = _step$value.name,
|
|
2867
|
+
plasmicStateName = _step$value.plasmicStateName;
|
|
2868
|
+
if (name in stateHelpers && "initFunc" in stateHelpers[name]) {
|
|
2869
|
+
$state.registerInitFunc == null ? void 0 : $state.registerInitFunc(plasmicStateName, function (_ref) {
|
|
2870
|
+
var _stateHelpers$name$in, _stateHelpers$name;
|
|
2871
|
+
var $props = _ref.$props;
|
|
2872
|
+
return (_stateHelpers$name$in = (_stateHelpers$name = stateHelpers[name]).initFunc) == null ? void 0 : _stateHelpers$name$in.call(_stateHelpers$name, $props);
|
|
2873
|
+
}, repetitionIndex != null ? repetitionIndex : [], {
|
|
2874
|
+
$props: child$Props
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
};
|
|
2878
|
+
for (var _iterator = _createForOfIteratorHelperLoose(states), _step; !(_step = _iterator()).done;) {
|
|
2879
|
+
_loop();
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
function initializePlasmicStates($state, states, repetitionIndex) {
|
|
2883
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(states), _step2; !(_step2 = _iterator2()).done;) {
|
|
2884
|
+
var _step2$value = _step2.value,
|
|
2885
|
+
name = _step2$value.name,
|
|
2886
|
+
initFunc = _step2$value.initFunc;
|
|
2887
|
+
$state.registerInitFunc == null ? void 0 : $state.registerInitFunc(name, initFunc, repetitionIndex != null ? repetitionIndex : []);
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2861
2890
|
function generateStateOnChangeProp($state, path) {
|
|
2862
2891
|
return function (val) {
|
|
2863
2892
|
return set($state, path, val);
|
|
2864
2893
|
};
|
|
2865
2894
|
}
|
|
2895
|
+
function generateStateOnChangePropForCodeComponents($state, stateName, plasmicStatePath, componentHelpers) {
|
|
2896
|
+
var _componentHelpers$sta2, _componentHelpers$sta3;
|
|
2897
|
+
var onChangeArgsToValue = componentHelpers == null ? void 0 : (_componentHelpers$sta2 = componentHelpers.states) == null ? void 0 : (_componentHelpers$sta3 = _componentHelpers$sta2[stateName]) == null ? void 0 : _componentHelpers$sta3.onChangeArgsToValue;
|
|
2898
|
+
if (!onChangeArgsToValue || typeof onChangeArgsToValue !== "function") {
|
|
2899
|
+
return generateStateOnChangeProp($state, plasmicStatePath);
|
|
2900
|
+
}
|
|
2901
|
+
return function () {
|
|
2902
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2903
|
+
args[_key] = arguments[_key];
|
|
2904
|
+
}
|
|
2905
|
+
return generateStateOnChangeProp($state, plasmicStatePath)(onChangeArgsToValue.apply(null, args));
|
|
2906
|
+
};
|
|
2907
|
+
}
|
|
2866
2908
|
function generateStateValueProp($state, path) {
|
|
2867
2909
|
return _get($state, path);
|
|
2868
2910
|
}
|
|
@@ -2884,9 +2926,9 @@ function getStateCells($state, root) {
|
|
|
2884
2926
|
return getStateCells($state[key], ensure(root.makeTransition(ARRAY_SYMBOL)));
|
|
2885
2927
|
}));
|
|
2886
2928
|
} else {
|
|
2887
|
-
return [].concat(stateCells, [].concat(root.edges().entries()).flatMap(function (
|
|
2888
|
-
var key =
|
|
2889
|
-
child =
|
|
2929
|
+
return [].concat(stateCells, [].concat(root.edges().entries()).flatMap(function (_ref2) {
|
|
2930
|
+
var key = _ref2[0],
|
|
2931
|
+
child = _ref2[1];
|
|
2890
2932
|
return typeof key === "string" && key in $state ? getStateCells($state[key], child) : [];
|
|
2891
2933
|
}));
|
|
2892
2934
|
}
|
|
@@ -4494,5 +4536,5 @@ function useTriggeredOverlay(plasmicClass, props, config, outerRef, isDismissabl
|
|
|
4494
4536
|
};
|
|
4495
4537
|
}
|
|
4496
4538
|
|
|
4497
|
-
export { DropdownMenu, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicPageGuard, PlasmicRootProvider, PlasmicSlot, SelectContext, Stack, Trans, TriggeredOverlayContext, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateValueProp, getCurrentInitialValue, getDataProps, getStateCellsInPlasmicProxy, getStateSpecInPlasmicProxy, hasVariant, isPlasmicStateProxy, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, resetToInitialValue, set, setPlumeStrictMode, useButton, useCheckbox, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
|
|
4539
|
+
export { DropdownMenu, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicPageGuard, PlasmicRootProvider, PlasmicSlot, SelectContext, Stack, Trans, TriggeredOverlayContext, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateOnChangePropForCodeComponents, generateStateValueProp, getCurrentInitialValue, getDataProps, getStateCellsInPlasmicProxy, getStateSpecInPlasmicProxy, hasVariant, initializeCodeComponentStates, initializePlasmicStates, isPlasmicStateProxy, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, resetToInitialValue, set, setPlumeStrictMode, useButton, useCheckbox, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
|
|
4498
4540
|
//# sourceMappingURL=react-web.esm.js.map
|