@bigbinary/neeto-themes-frontend 1.1.20 → 1.1.22

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/index.js CHANGED
@@ -35,7 +35,7 @@ import Tag from '@bigbinary/neetoui/Tag';
35
35
  /** @type {import("neetocommons/react-utils").ZustandStoreHook} */
36
36
  var useConfigStore = create$3(withImmutableActions(function (set) {
37
37
  return {
38
- themeConfig: {},
38
+ themeConfig: [],
39
39
  entityType: "",
40
40
  entityId: "",
41
41
  variableNamesMap: {},
@@ -625,6 +625,7 @@ var useThemeUtils = function useThemeUtils() {
625
625
  var root = document.querySelector(":root");
626
626
  var setVariable = function setVariable(name, value) {
627
627
  var variableName = variableNamesMap[name];
628
+ if (!variableName) return;
628
629
  root.style.setProperty(variableName, value);
629
630
  };
630
631
  var setTheme = function setTheme(theme) {
@@ -23292,7 +23293,7 @@ var Slider$1 = Slider;
23292
23293
  var SliderBlock = function SliderBlock(_ref) {
23293
23294
  var label = _ref.label,
23294
23295
  onChange = _ref.onChange,
23295
- defaultValue = _ref.defaultValue,
23296
+ value = _ref.value,
23296
23297
  min = _ref.min,
23297
23298
  max = _ref.max,
23298
23299
  marks = _ref.marks;
@@ -23304,11 +23305,11 @@ var SliderBlock = function SliderBlock(_ref) {
23304
23305
  style: "body2",
23305
23306
  children: label
23306
23307
  }), /*#__PURE__*/jsx(Slider$1, {
23307
- defaultValue: defaultValue,
23308
23308
  marks: marks,
23309
23309
  max: max,
23310
23310
  min: min,
23311
23311
  onChange: onChange,
23312
+ value: value,
23312
23313
  className: "my-2 w-20",
23313
23314
  tooltip: {
23314
23315
  formatter: null
@@ -23400,8 +23401,12 @@ var Properties = function Properties() {
23400
23401
  setVariable(snakeToCamelCase(name), variableValue !== null && variableValue !== void 0 ? variableValue : value);
23401
23402
  };
23402
23403
  var handleOverlayChange = function handleOverlayChange(key, value) {
23404
+ var index = findIndexBy({
23405
+ key: key
23406
+ }, values.properties);
23403
23407
  var overlayColorVariable = "".concat(key, "_overlay_color");
23404
- handleChange("".concat(key, "_overlay_opacity"), value, Math.abs(value / 100));
23408
+ setFieldValue("properties[".concat(index, "].value"), value);
23409
+ setVariable("".concat(key, "_overlay_opacity"), Math.abs(value / 100));
23405
23410
  if (value < 0) {
23406
23411
  handleChange(overlayColorVariable, "#000000", "0, 0, 0");
23407
23412
  } else {
@@ -23455,11 +23460,11 @@ var Properties = function Properties() {
23455
23460
  value = _ref5.value,
23456
23461
  kind = _ref5.kind;
23457
23462
  return isPropertyVisible(key, values, themeConfig) && /*#__PURE__*/jsx(SliderBlock, {
23458
- defaultValue: Number(value) || 0,
23459
23463
  label: buildLabel(key, kind),
23460
23464
  marks: OVERLAY_OPACITY_SLIDER_MARKS,
23461
23465
  max: HUNDRED,
23462
23466
  min: negate(HUNDRED),
23467
+ value: Number(value) || 0,
23463
23468
  onChange: function onChange(opacity) {
23464
23469
  return handleOverlayChange(key, opacity);
23465
23470
  }