@bigbinary/neeto-molecules 1.7.0-beta.1 → 1.7.0
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/Builder.js +58 -124
- package/dist/Builder.js.map +1 -1
- package/dist/HelpPopover.js +109 -28
- package/dist/HelpPopover.js.map +1 -1
- package/dist/IntegrationCard.js +1 -1
- package/dist/IntegrationCard.js.map +1 -1
- package/dist/IpRestriction.js +1 -3
- package/dist/IpRestriction.js.map +1 -1
- package/dist/ProductEmbed.js +2 -2
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/Settings.js +2 -2
- package/dist/Settings.js.map +1 -1
- package/dist/Sidebar.js +426 -47
- package/dist/Sidebar.js.map +1 -1
- package/dist/cjs/Builder.js +58 -124
- package/dist/cjs/Builder.js.map +1 -1
- package/dist/cjs/HelpPopover.js +109 -27
- package/dist/cjs/HelpPopover.js.map +1 -1
- package/dist/cjs/IntegrationCard.js +1 -1
- package/dist/cjs/IntegrationCard.js.map +1 -1
- package/dist/cjs/IpRestriction.js +1 -3
- package/dist/cjs/IpRestriction.js.map +1 -1
- package/dist/cjs/ProductEmbed.js +2 -2
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/dist/cjs/Settings.js +2 -2
- package/dist/cjs/Settings.js.map +1 -1
- package/dist/cjs/Sidebar.js +419 -39
- package/dist/cjs/Sidebar.js.map +1 -1
- package/package.json +2 -2
- package/src/translations/en.json +12 -1
- package/types/Builder.d.ts +52 -11
- package/types/HelpPopover.d.ts +1 -0
- package/types/Sidebar.d.ts +6 -2
package/dist/Builder.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { useState, useMemo, memo, useRef, useEffect } from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
2
|
import { noop, isPresent, isNotEmpty, findById, hyphenate } from '@bigbinary/neeto-cist';
|
|
4
|
-
import { useBreakpoints } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
5
|
-
import { Search, MenuVertical, MenuHorizontal, Flash, Collapse, DownArrow, Close } from '@bigbinary/neeto-icons';
|
|
6
|
-
import { Typography, Button, Input, Dropdown, Tooltip } from '@bigbinary/neetoui';
|
|
7
3
|
import { isEmpty, mergeRight } from 'ramda';
|
|
8
4
|
import { joinHyphenCase, withEventTargetValue } from '@bigbinary/neeto-commons-frontend/utils/general';
|
|
5
|
+
import { Search, MenuVertical, MenuHorizontal, Flash, DownArrow } from '@bigbinary/neeto-icons';
|
|
6
|
+
import { Typography, Button, Input, Dropdown, Tooltip } from '@bigbinary/neetoui';
|
|
9
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import classnames from 'classnames';
|
|
10
9
|
import { DragDropContext, Droppable, Draggable } from '@hello-pangea/dnd';
|
|
11
10
|
import { PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
|
|
12
11
|
import withT from '@bigbinary/neeto-commons-frontend/react-utils/withT';
|
|
@@ -107,6 +106,18 @@ function _defineProperty(obj, key, value) {
|
|
|
107
106
|
return obj;
|
|
108
107
|
}
|
|
109
108
|
|
|
109
|
+
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
110
|
+
|
|
111
|
+
var css = ":root{--neeto-molecule-builder-left-sidebar-width:360px;--neeto-molecule-builder-left-sidebar-header-height:70px;--neeto-molecule-builder-left-sidebar-search-height:40px;--neeto-molecule-builder-right-sidebar-width:420px}.neeto-molecules-builder-elements-list-panel{height:100%;min-width:360px;min-width:var(--neeto-molecule-builder-left-sidebar-width);width:360px;width:var(--neeto-molecule-builder-left-sidebar-width)}.neeto-molecules-builder-questions-list-panel__scroll{height:calc(100% - 70px);height:calc(100% - var(--neeto-molecule-builder-left-sidebar-header-height));overflow-y:auto;padding:8px 24px}.neeto-molecules-builder-questions-list-panel__scroll.neeto-molecules-builder-questions-list-panel__scroll--small{height:calc(100% - 110px);height:calc(100% - var(--neeto-molecule-builder-left-sidebar-header-height) - var(--neeto-molecule-builder-left-sidebar-search-height))}.neeto-molecules-builder-elements-list{margin-bottom:24px}.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper{border-bottom:none}.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper .neeto-ui-accordion__item{padding:12px 0}.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper .neeto-ui-accordion__item .neeto-ui-accordion__item-handle{color:rgb(var(--neeto-ui-gray-600));font-size:var(--neeto-ui-text-xs);font-weight:var(--neeto-ui-font-semibold);text-transform:uppercase;transition:var(--neeto-ui-transition)}.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper .neeto-ui-accordion__item .neeto-ui-accordion__item-toggle-icon{transform:rotate(90deg)!important}.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper .neeto-ui-accordion__item:hover{background-color:transparent}.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper .neeto-ui-accordion__item.neeto-ui-accordion__item--open .neeto-ui-accordion__item-handle,.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper .neeto-ui-accordion__item:hover .neeto-ui-accordion__item-handle{color:rgb(var(--neeto-ui-gray-800))}.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper .neeto-ui-accordion__item.neeto-ui-accordion__item--open .neeto-ui-accordion__item-toggle-icon{transform:rotate(270deg)!important}.neeto-molecules-builder-elements-list .neeto-ui-accordion__wrapper .neeto-ui-accordion__drop{padding:0}.neeto-molecules-builder-element-properties-panel{height:100%;min-width:420px;min-width:var(--neeto-molecule-builder-right-sidebar-width);padding-left:24px;padding-top:24px;width:420px;width:var(--neeto-molecule-builder-right-sidebar-width)}.neeto-molecules-builder-element--active{border-color:rgb(var(--neeto-ui-primary-500))!important;box-shadow:0 0 0 1px rgb(var(--neeto-ui-primary-500))!important}";
|
|
112
|
+
n(css,{});
|
|
113
|
+
|
|
114
|
+
var Body = function Body(props) {
|
|
115
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: "neeto-molecules-builder-questions-list-panel__scroll neeto-molecules-builder-questions-list-panel__scroll--small",
|
|
117
|
+
"data-testid": props["data-testid"]
|
|
118
|
+
}, props.children);
|
|
119
|
+
};
|
|
120
|
+
|
|
110
121
|
function _extends() {
|
|
111
122
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
112
123
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -122,51 +133,6 @@ function _extends() {
|
|
|
122
133
|
return _extends.apply(this, arguments);
|
|
123
134
|
}
|
|
124
135
|
|
|
125
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
126
|
-
if (source == null) return {};
|
|
127
|
-
var target = {};
|
|
128
|
-
var sourceKeys = Object.keys(source);
|
|
129
|
-
var key, i;
|
|
130
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
131
|
-
key = sourceKeys[i];
|
|
132
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
133
|
-
target[key] = source[key];
|
|
134
|
-
}
|
|
135
|
-
return target;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function _objectWithoutProperties(source, excluded) {
|
|
139
|
-
if (source == null) return {};
|
|
140
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
141
|
-
var key, i;
|
|
142
|
-
if (Object.getOwnPropertySymbols) {
|
|
143
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
144
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
145
|
-
key = sourceSymbolKeys[i];
|
|
146
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
147
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
148
|
-
target[key] = source[key];
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return target;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
155
|
-
|
|
156
|
-
var css = ":root{--neeto-molecule-builder-left-sidebar-width:288px;--neeto-molecule-builder-left-sidebar-width-lg:360px;--neeto-molecule-builder-left-sidebar-header-height:70px;--neeto-molecule-builder-left-sidebar-search-height:40px;--neeto-molecule-builder-right-sidebar-width:420px}.neeto-molecules-builder-elements-list-panel__wrapper{height:100%;min-width:360px;min-width:var(--neeto-molecule-builder-left-sidebar-width-lg);position:relative;transition:all .15s;width:360px;width:var(--neeto-molecule-builder-left-sidebar-width-lg);z-index:101}@media screen and (min-width:768px) and (max-width:1279px){.neeto-molecules-builder-elements-list-panel__wrapper{min-width:288px;min-width:var(--neeto-molecule-builder-left-sidebar-width);width:288px;width:var(--neeto-molecule-builder-left-sidebar-width)}}@media screen and (max-width:767px){.neeto-molecules-builder-elements-list-panel__wrapper{left:0;position:fixed;top:0;transition:none}}@media screen and (max-width:576px){.neeto-molecules-builder-elements-list-panel__wrapper{height:100%;max-width:100%;min-width:0;width:100%}}.neeto-molecules-builder-elements-list-panel__wrapper--collapsed{max-width:0;min-width:0;width:0}.neeto-molecules-builder-elements-list-panel__wrapper--collapsed .neeto-molecules-builder-elements-list-panel__toggler{transform:scale(-1)}@media screen and (max-width:767px){.neeto-molecules-builder-elements-list-panel__wrapper--collapsed .neeto-molecules-builder-elements-list-panel__toggler{top:72px}}@media screen and (max-width:576px){.neeto-molecules-builder-elements-list-panel__wrapper--collapsed .neeto-molecules-builder-elements-list-panel__toggler{left:8px;right:auto}}.neeto-molecules-builder-elements-list-panel__container{height:100%;overflow:hidden;width:100%}.neeto-molecules-builder-elements-list-panel{height:100%;min-width:360px;min-width:var(--neeto-molecule-builder-left-sidebar-width-lg);width:360px;width:var(--neeto-molecule-builder-left-sidebar-width-lg)}@media screen and (min-width:768px) and (max-width:1279px){.neeto-molecules-builder-elements-list-panel{min-width:288px;min-width:var(--neeto-molecule-builder-left-sidebar-width);width:288px;width:var(--neeto-molecule-builder-left-sidebar-width)}}@media screen and (max-width:576px){.neeto-molecules-builder-elements-list-panel{padding-top:24px;width:100%}}.neeto-molecules-builder-elements-list-panel__toggler{flex-shrink:0;left:calc(100% + 8px);position:absolute;top:8px;transition:color .3s ease-in-out}@media screen and (min-width:1024px){.neeto-molecules-builder-elements-list-panel__toggler{opacity:0;pointer-events:none}}@media screen and (max-width:576px){.neeto-molecules-builder-elements-list-panel__toggler{left:24px}}.neeto-molecules-builder-questions-list-panel__scroll{height:calc(100% - 70px);height:calc(100% - var(--neeto-molecule-builder-left-sidebar-header-height));overflow-y:auto;padding:8px 24px;width:100%}.neeto-molecules-builder-questions-list-panel__scroll.neeto-molecules-builder-questions-list-panel__scroll--small{height:calc(100% - 110px);height:calc(100% - var(--neeto-molecule-builder-left-sidebar-header-height) - var(--neeto-molecule-builder-left-sidebar-search-height))}.neeto-molecules-builder-element-properties-panel__wrapper{height:100%;min-width:420px;min-width:var(--neeto-molecule-builder-right-sidebar-width);position:relative;transition:all .15s;width:420px;width:var(--neeto-molecule-builder-right-sidebar-width);z-index:101}.neeto-molecules-builder-element-properties-panel__wrapper .neeto-molecules-builder-properties-panel__close{opacity:0;pointer-events:none;position:absolute;right:8px;top:8px}@media screen and (max-width:1279px){.neeto-molecules-builder-element-properties-panel__wrapper .neeto-molecules-builder-properties-panel__close{opacity:1;pointer-events:all}.neeto-molecules-builder-element-properties-panel__wrapper{position:fixed;right:0;top:0;transition:none}}@media screen and (max-width:576px){.neeto-molecules-builder-element-properties-panel__wrapper{height:100%;max-width:100%;min-width:0;width:100%}}.neeto-molecules-builder-element-properties-panel__wrapper--collapsed{max-width:0;min-width:0;width:0}.neeto-molecules-builder-element-properties-panel{display:flex;flex-direction:column;height:100%;min-width:0;overflow-y:auto;padding-left:24px;padding-top:24px;width:100%}.neeto-molecules-builder-element-properties-panel--collapsed{max-width:0;min-width:0;padding:0;width:0}@media screen and (max-width:1279px){.neeto-molecules-builder-element-properties-panel{padding-top:48px}}.neeto-molecules-builder-element--active{border-color:rgb(var(--neeto-ui-primary-500))!important;box-shadow:0 0 0 1px rgb(var(--neeto-ui-primary-500))!important}.neeto-molecules-builder-panel__backdrop{background-color:rgba(var(--neeto-ui-black),.4);display:none;height:100%;left:0;position:fixed;top:0;visibility:hidden;width:100%;z-index:101}@media screen and (max-width:767px){.neeto-molecules-builder-panel__backdrop{display:block;visibility:visible}}@media screen and (max-width:1279px){.neeto-molecules-builder-panel__backdrop--extended{display:block;visibility:visible}}";
|
|
157
|
-
n(css,{});
|
|
158
|
-
|
|
159
|
-
var _excluded$4 = ["size"];
|
|
160
|
-
var Body = function Body(_ref) {
|
|
161
|
-
var size = _ref.size,
|
|
162
|
-
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
163
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
164
|
-
className: classnames("neeto-molecules-builder-questions-list-panel__scroll", {
|
|
165
|
-
"neeto-molecules-builder-questions-list-panel__scroll--small": size === "small"
|
|
166
|
-
})
|
|
167
|
-
}));
|
|
168
|
-
};
|
|
169
|
-
|
|
170
136
|
var Element = function Element(_ref) {
|
|
171
137
|
var label = _ref.label,
|
|
172
138
|
Icon = _ref.icon,
|
|
@@ -275,8 +241,9 @@ var ElementList = function ElementList(_ref) {
|
|
|
275
241
|
value: searchString,
|
|
276
242
|
onChange: withEventTargetValue(setSearchString)
|
|
277
243
|
})), /*#__PURE__*/React.createElement(Body, {
|
|
278
|
-
"data-testid": "elements-container"
|
|
279
|
-
|
|
244
|
+
"data-testid": "elements-container"
|
|
245
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
246
|
+
className: "neeto-molecules-builder-questions-list-panel__scroll--small"
|
|
280
247
|
}, filteredSections.map(function (section) {
|
|
281
248
|
return /*#__PURE__*/React.createElement(Section, {
|
|
282
249
|
onSelect: onSelect,
|
|
@@ -285,9 +252,38 @@ var ElementList = function ElementList(_ref) {
|
|
|
285
252
|
key: section.key,
|
|
286
253
|
title: section.title
|
|
287
254
|
});
|
|
288
|
-
})));
|
|
255
|
+
}))));
|
|
289
256
|
};
|
|
290
257
|
|
|
258
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
259
|
+
if (source == null) return {};
|
|
260
|
+
var target = {};
|
|
261
|
+
var sourceKeys = Object.keys(source);
|
|
262
|
+
var key, i;
|
|
263
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
264
|
+
key = sourceKeys[i];
|
|
265
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
266
|
+
target[key] = source[key];
|
|
267
|
+
}
|
|
268
|
+
return target;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function _objectWithoutProperties(source, excluded) {
|
|
272
|
+
if (source == null) return {};
|
|
273
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
274
|
+
var key, i;
|
|
275
|
+
if (Object.getOwnPropertySymbols) {
|
|
276
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
277
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
278
|
+
key = sourceSymbolKeys[i];
|
|
279
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
280
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
281
|
+
target[key] = source[key];
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return target;
|
|
285
|
+
}
|
|
286
|
+
|
|
291
287
|
var MENU_ITEM_TYPES = {
|
|
292
288
|
menuItem: "menuItem",
|
|
293
289
|
divider: "divider"
|
|
@@ -464,10 +460,12 @@ var SelectedElement = function SelectedElement(_ref) {
|
|
|
464
460
|
style: "body2"
|
|
465
461
|
}, element.label)), shouldShowDropdown && /*#__PURE__*/React.createElement(MoreDropdown, {
|
|
466
462
|
menuItems: menuItems,
|
|
463
|
+
isDisabled: element.isPending,
|
|
467
464
|
dropdownButtonProps: {
|
|
468
465
|
className: "min-h-0 flex-shrink-0",
|
|
469
466
|
"data-testid": "".concat(hyphenate(element.label), "-more-dropdown"),
|
|
470
|
-
"data-cy": "".concat(hyphenate(element.label, "new-element"), "-more-dropdown")
|
|
467
|
+
"data-cy": "".concat(hyphenate(element.label, "new-element"), "-more-dropdown"),
|
|
468
|
+
loading: element.isPending
|
|
471
469
|
}
|
|
472
470
|
}));
|
|
473
471
|
};
|
|
@@ -637,34 +635,13 @@ var ElementsPanel = function ElementsPanel(_ref) {
|
|
|
637
635
|
_useState2 = _slicedToArray(_useState, 2),
|
|
638
636
|
isElementsListVisible = _useState2[0],
|
|
639
637
|
setIsElementsListVisible = _useState2[1];
|
|
640
|
-
var _useBreakpoints = useBreakpoints(),
|
|
641
|
-
isSize = _useBreakpoints.isSize;
|
|
642
|
-
var isLargerScreen = !isSize("mobile");
|
|
643
|
-
var _useState3 = useState(!isLargerScreen),
|
|
644
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
645
|
-
isElementsPanelCollapsed = _useState4[0],
|
|
646
|
-
setIsElementsPanelCollapsed = _useState4[1];
|
|
647
638
|
var isSelectedElementsEmpty = isEmpty(selectedElements);
|
|
648
639
|
var shouldShowElementsList = isSelectedElementsEmpty || isElementsListVisible;
|
|
649
640
|
var handleElementSelect = function handleElementSelect(element) {
|
|
650
641
|
setIsElementsListVisible(false);
|
|
651
642
|
handleAddElement(element);
|
|
652
643
|
};
|
|
653
|
-
|
|
654
|
-
setIsElementsPanelCollapsed(!isLargerScreen);
|
|
655
|
-
}, [isLargerScreen]);
|
|
656
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, !isElementsPanelCollapsed && /*#__PURE__*/React.createElement("div", {
|
|
657
|
-
className: "neeto-molecules-builder-panel__backdrop",
|
|
658
|
-
onClick: function onClick() {
|
|
659
|
-
setIsElementsPanelCollapsed(!isElementsPanelCollapsed);
|
|
660
|
-
}
|
|
661
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
662
|
-
className: classnames("neeto-molecules-builder-elements-list-panel__wrapper", {
|
|
663
|
-
"neeto-molecules-builder-elements-list-panel__wrapper--collapsed": isElementsPanelCollapsed
|
|
664
|
-
})
|
|
665
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
666
|
-
className: "neeto-molecules-builder-elements-list-panel__container"
|
|
667
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
644
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
668
645
|
className: "neeto-molecules-builder-elements-list-panel neeto-ui-bg-gray-100",
|
|
669
646
|
onClick: function onClick(event) {
|
|
670
647
|
return event.stopPropagation();
|
|
@@ -691,20 +668,13 @@ var ElementsPanel = function ElementsPanel(_ref) {
|
|
|
691
668
|
selectedElements: selectedElements,
|
|
692
669
|
setIsElementsListVisible: setIsElementsListVisible,
|
|
693
670
|
showElementsFillButton: showElementsFillButton
|
|
694
|
-
}))
|
|
695
|
-
className: "neeto-molecules-builder-elements-list-panel__toggler",
|
|
696
|
-
icon: Collapse,
|
|
697
|
-
style: "secondary",
|
|
698
|
-
onClick: function onClick() {
|
|
699
|
-
setIsElementsPanelCollapsed(!isElementsPanelCollapsed);
|
|
700
|
-
}
|
|
701
|
-
})));
|
|
671
|
+
}));
|
|
702
672
|
};
|
|
703
673
|
|
|
704
674
|
var EmptyProperty = withT(function (_ref) {
|
|
705
675
|
var t = _ref.t;
|
|
706
676
|
return /*#__PURE__*/React.createElement("div", {
|
|
707
|
-
className: "space-y-4
|
|
677
|
+
className: "space-y-4 "
|
|
708
678
|
}, /*#__PURE__*/React.createElement("div", {
|
|
709
679
|
className: "neeto-ui-bg-gray-200 neeto-ui-text-gray-600 neeto-ui-rounded-lg flex w-full flex-col items-center justify-center space-y-2 px-16 py-8"
|
|
710
680
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
@@ -722,7 +692,7 @@ var EmptyProperty = withT(function (_ref) {
|
|
|
722
692
|
var Skeleton = withT(function (_ref) {
|
|
723
693
|
var t = _ref.t;
|
|
724
694
|
return /*#__PURE__*/React.createElement("div", {
|
|
725
|
-
className: "space-y-4 pr-6
|
|
695
|
+
className: "space-y-4 pr-6"
|
|
726
696
|
}, /*#__PURE__*/React.createElement("div", {
|
|
727
697
|
className: "neeto-ui-bg-gray-200 neeto-ui-rounded-lg h-12 w-full"
|
|
728
698
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -740,46 +710,10 @@ var Skeleton = withT(function (_ref) {
|
|
|
740
710
|
});
|
|
741
711
|
|
|
742
712
|
var PropertiesPanel = function PropertiesPanel(_ref) {
|
|
743
|
-
var
|
|
744
|
-
|
|
745
|
-
onClose = _ref.onClose;
|
|
746
|
-
var _useBreakpoints = useBreakpoints(function (window) {
|
|
747
|
-
return {
|
|
748
|
-
largeDesktop: window.innerWidth >= 1280
|
|
749
|
-
};
|
|
750
|
-
}),
|
|
751
|
-
isSize = _useBreakpoints.isSize;
|
|
752
|
-
var isLargerScreen = isSize("largeDesktop");
|
|
753
|
-
var _useState = useState(!isLargerScreen),
|
|
754
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
755
|
-
isPropertiesPanelCollapsed = _useState2[0],
|
|
756
|
-
setIsPropertiesPanelCollapsed = _useState2[1];
|
|
757
|
-
useEffect(function () {
|
|
758
|
-
setIsPropertiesPanelCollapsed(!isLargerScreen);
|
|
759
|
-
}, [isLargerScreen]);
|
|
760
|
-
useEffect(function () {
|
|
761
|
-
if (!id) return;
|
|
762
|
-
setIsPropertiesPanelCollapsed(false);
|
|
763
|
-
}, [id]);
|
|
764
|
-
var handleCollapsePanel = function handleCollapsePanel() {
|
|
765
|
-
setIsPropertiesPanelCollapsed(!isPropertiesPanelCollapsed);
|
|
766
|
-
onClose === null || onClose === void 0 ? void 0 : onClose(id);
|
|
767
|
-
};
|
|
768
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, !isPropertiesPanelCollapsed && /*#__PURE__*/React.createElement("div", {
|
|
769
|
-
className: "neeto-molecules-builder-panel__backdrop neeto-molecules-builder-panel__backdrop--extended",
|
|
770
|
-
onClick: handleCollapsePanel
|
|
771
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
772
|
-
className: classnames("neeto-molecules-builder-element-properties-panel__wrapper", {
|
|
773
|
-
"neeto-molecules-builder-element-properties-panel__wrapper--collapsed": isPropertiesPanelCollapsed
|
|
774
|
-
})
|
|
775
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
713
|
+
var children = _ref.children;
|
|
714
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
776
715
|
className: "neeto-molecules-builder-element-properties-panel neeto-ui-bg-gray-100"
|
|
777
|
-
}, children !== null && children !== void 0 ? children : /*#__PURE__*/React.createElement(Skeleton, null))
|
|
778
|
-
className: "neeto-molecules-builder-properties-panel__close",
|
|
779
|
-
icon: Close,
|
|
780
|
-
style: "secondary",
|
|
781
|
-
onClick: handleCollapsePanel
|
|
782
|
-
})));
|
|
716
|
+
}, children !== null && children !== void 0 ? children : /*#__PURE__*/React.createElement(Skeleton, null));
|
|
783
717
|
};
|
|
784
718
|
PropertiesPanel.EmptyProperty = EmptyProperty;
|
|
785
719
|
|