@bigbinary/neeto-themes-frontend 1.2.2 → 1.2.3

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
@@ -654,17 +654,16 @@ var SwitchBlock = function SwitchBlock(_ref) {
654
654
  });
655
655
  };
656
656
 
657
- var Properties = function Properties() {
657
+ var Properties = function Properties(_ref) {
658
+ var onPropertiesChange = _ref.onPropertiesChange;
658
659
  var _useTranslation = useTranslation(),
659
660
  t = _useTranslation.t;
660
661
  var _useConfigStore = useConfigStore(function (store) {
661
662
  return {
662
- themePropertiesSchema: store["themePropertiesSchema"],
663
- onPropertiesChange: store["onPropertiesChange"]
663
+ themePropertiesSchema: store["themePropertiesSchema"]
664
664
  };
665
665
  }, shallow),
666
- themePropertiesSchema = _useConfigStore.themePropertiesSchema,
667
- onPropertiesChange = _useConfigStore.onPropertiesChange;
666
+ themePropertiesSchema = _useConfigStore.themePropertiesSchema;
668
667
  var _useThemeStore = useThemeStore(function (store) {
669
668
  return {
670
669
  setThemeState: store["setThemeState"]
@@ -678,9 +677,9 @@ var Properties = function Properties() {
678
677
  setVariable = _useThemeUtils.setVariable,
679
678
  setTheme = _useThemeUtils.setTheme;
680
679
  var handleColorChange = function handleColorChange(name) {
681
- return function (_ref) {
682
- var hex = _ref.hex,
683
- rgb = _ref.rgb;
680
+ return function (_ref2) {
681
+ var hex = _ref2.hex,
682
+ rgb = _ref2.rgb;
684
683
  handleChange(name, hex, "".concat(rgb.r, ", ").concat(rgb.g, ", ").concat(rgb.b, ", ").concat(rgb.a));
685
684
  };
686
685
  };
@@ -717,27 +716,27 @@ var Properties = function Properties() {
717
716
  className: "divide-y divide-gray-200",
718
717
  children: [filterBy({
719
718
  kind: "font_family"
720
- }, values.properties).map(function (_ref2) {
721
- var key = _ref2.key,
722
- value = _ref2.value,
723
- kind = _ref2.kind;
719
+ }, values.properties).map(function (_ref3) {
720
+ var key = _ref3.key,
721
+ value = _ref3.value,
722
+ kind = _ref3.kind;
724
723
  return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(FontPickerBlock, {
725
724
  label: buildLabel(key, kind),
726
725
  options: FONT_OPTIONS,
727
726
  value: findBy({
728
727
  value: value || null
729
728
  }, FONT_OPTIONS),
730
- onChange: function onChange(_ref3) {
731
- var value = _ref3.value;
729
+ onChange: function onChange(_ref4) {
730
+ var value = _ref4.value;
732
731
  handleChange(key, value);
733
732
  }
734
733
  }, key);
735
734
  }), filterBy({
736
735
  kind: "color"
737
- }, values.properties).map(function (_ref4) {
738
- var key = _ref4.key,
739
- value = _ref4.value,
740
- kind = _ref4.kind;
736
+ }, values.properties).map(function (_ref5) {
737
+ var key = _ref5.key,
738
+ value = _ref5.value,
739
+ kind = _ref5.kind;
741
740
  return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(ColorBlock, {
742
741
  color: value,
743
742
  label: buildLabel(key, kind),
@@ -745,10 +744,10 @@ var Properties = function Properties() {
745
744
  }, key);
746
745
  }), filterBy({
747
746
  kind: "overlay_opacity"
748
- }, values.properties).map(function (_ref5) {
749
- var key = _ref5.key,
750
- value = _ref5.value,
751
- kind = _ref5.kind;
747
+ }, values.properties).map(function (_ref6) {
748
+ var key = _ref6.key,
749
+ value = _ref6.value,
750
+ kind = _ref6.kind;
752
751
  return isPropertyVisible(key, values, themePropertiesSchema) && /*#__PURE__*/jsx(SliderBlock, {
753
752
  label: buildLabel(key, kind),
754
753
  marks: OVERLAY_OPACITY_SLIDER_MARKS,
@@ -761,11 +760,11 @@ var Properties = function Properties() {
761
760
  }, key);
762
761
  }), filterBy({
763
762
  kind: "position_selector"
764
- }, values.properties).map(function (_ref6) {
763
+ }, values.properties).map(function (_ref7) {
765
764
  var _findBy;
766
- var key = _ref6.key,
767
- kind = _ref6.kind,
768
- value = _ref6.value;
765
+ var key = _ref7.key,
766
+ kind = _ref7.kind,
767
+ value = _ref7.value;
769
768
  var index = findIndexBy({
770
769
  key: key
771
770
  }, values.properties);
@@ -783,10 +782,10 @@ var Properties = function Properties() {
783
782
  }, key);
784
783
  }), filterBy({
785
784
  kind: "boolean"
786
- }, values.properties).map(function (_ref7) {
787
- var key = _ref7.key,
788
- kind = _ref7.kind,
789
- value = _ref7.value;
785
+ }, values.properties).map(function (_ref8) {
786
+ var key = _ref8.key,
787
+ kind = _ref8.kind,
788
+ value = _ref8.value;
790
789
  var index = findIndexBy({
791
790
  key: key
792
791
  }, values.properties);
@@ -821,7 +820,8 @@ var Customize = function Customize(_ref) {
821
820
  theme = _ref.theme,
822
821
  onCreateTheme = _ref.onCreateTheme,
823
822
  onApplyTheme = _ref.onApplyTheme,
824
- isApplyingTheme = _ref.isApplyingTheme;
823
+ isApplyingTheme = _ref.isApplyingTheme,
824
+ onPropertiesChange = _ref.onPropertiesChange;
825
825
  var _useTranslation = useTranslation(),
826
826
  t = _useTranslation.t;
827
827
  var _useState = useState({}),
@@ -885,7 +885,9 @@ var Customize = function Customize(_ref) {
885
885
  className: "neeto-themes-sidebar__scroll",
886
886
  children: [/*#__PURE__*/jsxs("div", {
887
887
  className: "flex flex-col gap-6 p-4",
888
- children: [/*#__PURE__*/jsx(ThemeMeta, {}), /*#__PURE__*/jsx(Properties, {}), filterBy({
888
+ children: [/*#__PURE__*/jsx(ThemeMeta, {}), /*#__PURE__*/jsx(Properties, {
889
+ onPropertiesChange: onPropertiesChange
890
+ }), filterBy({
889
891
  kind: "image"
890
892
  }, themePropertiesSchema).map(function (_ref5) {
891
893
  var key = _ref5.key;
@@ -1430,7 +1432,8 @@ var TitleBar = function TitleBar(_ref) {
1430
1432
  var MemoizedAlert = /*#__PURE__*/memo(Alert);
1431
1433
  var Sidebar = function Sidebar(_ref) {
1432
1434
  var _themeToEdit$current, _themeToEdit$current2, _themeToDelete$curren2, _themeToDelete$curren3;
1433
- var thumbnail = _ref.thumbnail;
1435
+ var thumbnail = _ref.thumbnail,
1436
+ onPropertiesChange = _ref.onPropertiesChange;
1434
1437
  var _useState = useState(DESIGN_SCREENS.THEMES),
1435
1438
  _useState2 = _slicedToArray(_useState, 2),
1436
1439
  currentScreen = _useState2[0],
@@ -1598,6 +1601,7 @@ var Sidebar = function Sidebar(_ref) {
1598
1601
  isApplyingTheme: isApplyingTheme,
1599
1602
  onApplyTheme: onApplyTheme,
1600
1603
  onCreateTheme: onCreateTheme,
1604
+ onPropertiesChange: onPropertiesChange,
1601
1605
  theme: themeToEdit.current,
1602
1606
  themeId: (_themeToEdit$current2 = themeToEdit.current) === null || _themeToEdit$current2 === void 0 ? void 0 : _themeToEdit$current2.id
1603
1607
  }), /*#__PURE__*/jsx(MemoizedAlert, {
@@ -1636,13 +1640,13 @@ var NeetoThemesBuilder = function NeetoThemesBuilder(_ref) {
1636
1640
  useEffect(function () {
1637
1641
  setConfigState({
1638
1642
  entityType: entityType,
1639
- entityId: entityId,
1640
- onPropertiesChange: onPropertiesChange
1643
+ entityId: entityId
1641
1644
  });
1642
1645
  }, []);
1643
1646
  return /*#__PURE__*/jsxs("div", {
1644
1647
  className: "neeto-themes__wrapper",
1645
1648
  children: [/*#__PURE__*/jsx(Sidebar, {
1649
+ onPropertiesChange: onPropertiesChange,
1646
1650
  thumbnail: thumbnail
1647
1651
  }), /*#__PURE__*/jsx("div", {
1648
1652
  className: "neeto-themes-preview__wrapper",