@bigbinary/neeto-molecules 1.0.1 → 1.0.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/README.md +1 -0
- package/dist/DateRangeFilter.cjs.js +29 -10
- package/dist/DateRangeFilter.js +29 -10
- package/dist/EmailPreview.cjs.js +1 -1
- package/dist/EmailPreview.js +1 -1
- package/dist/ErrorPage.cjs.js +56 -2
- package/dist/ErrorPage.js +58 -4
- package/dist/KeyboardShortcuts.cjs.js +87 -74
- package/dist/KeyboardShortcuts.js +88 -75
- package/dist/Schedule.cjs.js +6 -5
- package/dist/Schedule.js +8 -7
- package/dist/ShareViaEmail.cjs.js +35134 -0
- package/dist/ShareViaEmail.js +35106 -0
- package/package.json +7 -6
- package/src/translations/en.json +37 -1
- package/types/KeyboardShortcuts.d.ts +5 -3
- package/types/ShareViaEmail.d.ts +18 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useDebugValue } from 'react';
|
|
2
2
|
import { useHotKeys } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
3
3
|
import { Close } from '@bigbinary/neeto-icons';
|
|
4
|
-
import {
|
|
4
|
+
import { Typography, Kbd, Button } from '@bigbinary/neetoui';
|
|
5
5
|
import { manager } from '@bigbinary/neetoui/managers';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import i18next from 'i18next';
|
|
@@ -743,30 +743,23 @@ var classnames$1 = {exports: {}};
|
|
|
743
743
|
|
|
744
744
|
var classnames = classnames$1.exports;
|
|
745
745
|
|
|
746
|
-
var
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
762
|
-
key: idx
|
|
763
|
-
}, /*#__PURE__*/React.createElement(Kbd, {
|
|
764
|
-
keyName: keyName
|
|
765
|
-
}), isSequentialHotkey && idx + 1 !== sequences.length && /*#__PURE__*/React.createElement(Kbd, {
|
|
766
|
-
keyName: "then"
|
|
767
|
-
}));
|
|
768
|
-
});
|
|
746
|
+
var KEY_SHORTFORM_MAP = {
|
|
747
|
+
command: "cmd",
|
|
748
|
+
escape: "esc",
|
|
749
|
+
control: "ctrl",
|
|
750
|
+
option: "opt"
|
|
751
|
+
};
|
|
752
|
+
var MAC_TO_WINDOWS_KEYS_MAP = {
|
|
753
|
+
option: "alt",
|
|
754
|
+
command: "ctrl",
|
|
755
|
+
"return": "enter",
|
|
756
|
+
"delete": "backspace"
|
|
757
|
+
};
|
|
758
|
+
var OS = {
|
|
759
|
+
mac: "OS X",
|
|
760
|
+
windows: "Windows"
|
|
769
761
|
};
|
|
762
|
+
var FULL_SHORTCUTS_LINK_PROP_NAME = "fullShortcutsLink";
|
|
770
763
|
|
|
771
764
|
function _typeof(obj) {
|
|
772
765
|
"@babel/helpers - typeof";
|
|
@@ -2055,46 +2048,34 @@ var platform$1 = {exports: {}};
|
|
|
2055
2048
|
|
|
2056
2049
|
var platform = platform$1.exports;
|
|
2057
2050
|
|
|
2058
|
-
var
|
|
2059
|
-
|
|
2060
|
-
escape: "esc",
|
|
2061
|
-
control: "ctrl",
|
|
2062
|
-
option: "opt"
|
|
2063
|
-
};
|
|
2064
|
-
var MAC_TO_WINDOWS_KEYS_MAP = {
|
|
2065
|
-
option: "alt",
|
|
2066
|
-
command: "ctrl",
|
|
2067
|
-
"return": "enter",
|
|
2068
|
-
"delete": "backspace"
|
|
2069
|
-
};
|
|
2070
|
-
var OS = {
|
|
2071
|
-
mac: "OS X",
|
|
2072
|
-
windows: "Windows"
|
|
2073
|
-
};
|
|
2074
|
-
|
|
2075
|
-
var shortenHotKey = function shortenHotKey(hotkey) {
|
|
2076
|
-
var result = hotkey;
|
|
2077
|
-
Object.entries(KEY_SHORTFORM_MAP).forEach(function (_ref) {
|
|
2051
|
+
var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
|
|
2052
|
+
toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
|
|
2078
2053
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2054
|
+
macKey = _ref2[0],
|
|
2055
|
+
windowsKey = _ref2[1];
|
|
2056
|
+
hotkey = hotkey.replaceAll(macKey, windowsKey);
|
|
2082
2057
|
});
|
|
2083
|
-
return
|
|
2058
|
+
return hotkey;
|
|
2059
|
+
};
|
|
2060
|
+
var replaceDeleteKeyWithBackspace = function replaceDeleteKeyWithBackspace(hotkey) {
|
|
2061
|
+
return hotkey.replaceAll("delete", "backspace");
|
|
2084
2062
|
};
|
|
2085
2063
|
var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
|
|
2086
2064
|
var _platformInfo$os, _platformInfo$os$fami;
|
|
2087
2065
|
var platformInfo = platform.parse(navigator.userAgent);
|
|
2088
2066
|
var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
|
|
2089
|
-
if (isOSX) return hotkey;
|
|
2090
|
-
|
|
2091
|
-
|
|
2067
|
+
if (isOSX) return replaceDeleteKeyWithBackspace(hotkey);
|
|
2068
|
+
return convertHotKeyToWindows(hotkey);
|
|
2069
|
+
};
|
|
2070
|
+
var shortenHotKey = function shortenHotKey(hotkey) {
|
|
2071
|
+
var result = hotkey;
|
|
2072
|
+
Object.entries(KEY_SHORTFORM_MAP).forEach(function (_ref3) {
|
|
2092
2073
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2074
|
+
longform = _ref4[0],
|
|
2075
|
+
shortform = _ref4[1];
|
|
2076
|
+
result = result.replaceAll(longform, shortform);
|
|
2096
2077
|
});
|
|
2097
|
-
return
|
|
2078
|
+
return result;
|
|
2098
2079
|
};
|
|
2099
2080
|
var getGlobalShortcuts = function getGlobalShortcuts() {
|
|
2100
2081
|
return _defineProperty({}, i18next.t("neetoMolecules.keyboardShortcuts.global.categoryName"), {
|
|
@@ -2109,35 +2090,71 @@ var getGlobalShortcuts = function getGlobalShortcuts() {
|
|
|
2109
2090
|
});
|
|
2110
2091
|
};
|
|
2111
2092
|
|
|
2093
|
+
var HotKey = function HotKey(_ref) {
|
|
2094
|
+
var description = _ref.description,
|
|
2095
|
+
sequence = _ref.sequence;
|
|
2096
|
+
var hotkey = shortenHotKey(convertHotkeyToUsersPlatform(sequence));
|
|
2097
|
+
var isSequentialHotkey = hotkey.includes(" ");
|
|
2098
|
+
var isSimultaneousHotkey = hotkey.includes("+");
|
|
2099
|
+
var isSingleKeyHotkey = !isSequentialHotkey && !isSimultaneousHotkey;
|
|
2100
|
+
var sequences = [];
|
|
2101
|
+
if (isSingleKeyHotkey) {
|
|
2102
|
+
sequences = [hotkey];
|
|
2103
|
+
} else if (isSequentialHotkey) {
|
|
2104
|
+
sequences = hotkey.split(" ");
|
|
2105
|
+
} else if (isSimultaneousHotkey) {
|
|
2106
|
+
sequences = hotkey.split("+");
|
|
2107
|
+
}
|
|
2108
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2109
|
+
className: "my-3 px-4"
|
|
2110
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2111
|
+
className: "flex items-center justify-between gap-3",
|
|
2112
|
+
"data-testid": "hotkey-item"
|
|
2113
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
2114
|
+
className: "neeto-ui-text-gray-800",
|
|
2115
|
+
lineHeight: "normal",
|
|
2116
|
+
style: "body2"
|
|
2117
|
+
}, description), /*#__PURE__*/React.createElement("div", {
|
|
2118
|
+
className: "flex items-center gap-1"
|
|
2119
|
+
}, sequences.map(function (keyName, idx) {
|
|
2120
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
2121
|
+
key: idx
|
|
2122
|
+
}, /*#__PURE__*/React.createElement(Kbd, {
|
|
2123
|
+
keyName: keyName
|
|
2124
|
+
}), isSequentialHotkey && idx + 1 !== sequences.length && /*#__PURE__*/React.createElement(Kbd, {
|
|
2125
|
+
keyName: "then"
|
|
2126
|
+
}));
|
|
2127
|
+
}))));
|
|
2128
|
+
};
|
|
2129
|
+
|
|
2112
2130
|
var HotKeyList = function HotKeyList(_ref) {
|
|
2113
2131
|
var hotkeys = _ref.hotkeys;
|
|
2132
|
+
var _useTranslation = useTranslation(),
|
|
2133
|
+
t = _useTranslation.t;
|
|
2114
2134
|
return Object.keys(hotkeys).map(function (categoryName) {
|
|
2135
|
+
var categoryValues = hotkeys[categoryName];
|
|
2136
|
+
var fullShortcutsLink = categoryValues[FULL_SHORTCUTS_LINK_PROP_NAME];
|
|
2115
2137
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
2116
2138
|
key: categoryName
|
|
2117
2139
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
2118
2140
|
className: "neeto-ui-text-gray-800 mt-4 px-4 text-xs font-bold",
|
|
2119
2141
|
lineHeight: "normal",
|
|
2120
2142
|
style: "body2"
|
|
2121
|
-
}, categoryName), Object.entries(
|
|
2143
|
+
}, categoryName), Object.entries(categoryValues).map(function (_ref2) {
|
|
2122
2144
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
2123
2145
|
_ref3$ = _ref3[1],
|
|
2124
2146
|
sequence = _ref3$.sequence,
|
|
2125
2147
|
description = _ref3$.description;
|
|
2126
|
-
return /*#__PURE__*/React.createElement(
|
|
2127
|
-
|
|
2128
|
-
key: sequence
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
}, description), /*#__PURE__*/React.createElement("div", {
|
|
2137
|
-
className: "flex items-center gap-1"
|
|
2138
|
-
}, /*#__PURE__*/React.createElement(DisplayHotKey, {
|
|
2139
|
-
hotkey: shortenHotKey(convertHotkeyToUsersPlatform(sequence))
|
|
2140
|
-
}))));
|
|
2148
|
+
return sequence && /*#__PURE__*/React.createElement(HotKey, {
|
|
2149
|
+
description: description,
|
|
2150
|
+
key: sequence,
|
|
2151
|
+
sequence: sequence
|
|
2152
|
+
});
|
|
2153
|
+
}), fullShortcutsLink && /*#__PURE__*/React.createElement(Button, {
|
|
2154
|
+
className: "pl-4 mb-3",
|
|
2155
|
+
href: fullShortcutsLink,
|
|
2156
|
+
style: "link",
|
|
2157
|
+
label: t("neetoMolecules.keyboardShortcuts.viewFullListOfShortcuts")
|
|
2141
2158
|
}));
|
|
2142
2159
|
});
|
|
2143
2160
|
};
|
|
@@ -2163,13 +2180,9 @@ var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
|
|
|
2163
2180
|
return setIsOpen(function (prevIsOpen) {
|
|
2164
2181
|
return !prevIsOpen;
|
|
2165
2182
|
});
|
|
2166
|
-
}, {
|
|
2167
|
-
mode: "global"
|
|
2168
2183
|
});
|
|
2169
2184
|
useHotKeys(shortcuts.close.sequence, function () {
|
|
2170
2185
|
return setIsOpen(false);
|
|
2171
|
-
}, {
|
|
2172
|
-
mode: "global"
|
|
2173
2186
|
});
|
|
2174
2187
|
return /*#__PURE__*/React.createElement("div", {
|
|
2175
2188
|
className: classnames("neeto-commons-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width ml-auto min-h-screen border-l bg-white duration-300 ease-in-out overflow-y-scroll", {
|
package/dist/Schedule.cjs.js
CHANGED
|
@@ -864,12 +864,13 @@ var Header = function Header(_ref) {
|
|
|
864
864
|
}
|
|
865
865
|
}, t("neetoMolecules.common.actions.edit"))))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
866
866
|
className: "flex items-center space-x-2"
|
|
867
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
868
|
-
|
|
869
|
-
|
|
867
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, {
|
|
868
|
+
content: t("neetoMolecules.schedule.timezoneTooltip"),
|
|
869
|
+
position: "bottom"
|
|
870
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
870
871
|
style: "h4",
|
|
871
872
|
weight: "medium"
|
|
872
|
-
}, timeZoneAndTime), /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, {
|
|
873
|
+
}, timeZoneAndTime)), /*#__PURE__*/React__default["default"].createElement(neetoui.Dropdown, {
|
|
873
874
|
icon: neetoIcons.MenuVertical,
|
|
874
875
|
buttonProps: {
|
|
875
876
|
style: "text",
|
|
@@ -879,7 +880,7 @@ var Header = function Header(_ref) {
|
|
|
879
880
|
onClick: function onClick() {
|
|
880
881
|
return window.location.href = MY_PROFILE_URL;
|
|
881
882
|
}
|
|
882
|
-
}, t("neetoMolecules.common.actions.
|
|
883
|
+
}, t("neetoMolecules.common.actions.changeTimezone"))))));
|
|
883
884
|
};
|
|
884
885
|
|
|
885
886
|
var Schedule = /*#__PURE__*/React.forwardRef(function (_ref, scheduleRef) {
|
package/dist/Schedule.js
CHANGED
|
@@ -3,7 +3,7 @@ import { findIndexBy, isPresent, toLabelAndValue, isNotPresent, noop } from '@bi
|
|
|
3
3
|
import { FieldArray, ErrorMessage, useFormikContext, Formik, Form as Form$1 } from 'formik';
|
|
4
4
|
import { uniq, pluck, difference, append, without, identity, pick, assoc } from 'ramda';
|
|
5
5
|
import { timeFormat, joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
|
|
6
|
-
import { Typography, Button, Dropdown, Label, Checkbox as Checkbox$1 } from '@bigbinary/neetoui';
|
|
6
|
+
import { Typography, Button, Dropdown, Label, Checkbox as Checkbox$1, Tooltip } from '@bigbinary/neetoui';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import dayjs from 'dayjs';
|
|
9
9
|
import i18next from 'i18next';
|
|
@@ -12,7 +12,7 @@ import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
|
12
12
|
import timezone from 'dayjs/plugin/timezone';
|
|
13
13
|
import utc from 'dayjs/plugin/utc';
|
|
14
14
|
import weekday from 'dayjs/plugin/weekday';
|
|
15
|
-
import { Delete, Plus, Copy, MenuVertical
|
|
15
|
+
import { Delete, Plus, Copy, MenuVertical } from '@bigbinary/neeto-icons';
|
|
16
16
|
import { Select, Checkbox } from '@bigbinary/neetoui/formik';
|
|
17
17
|
|
|
18
18
|
var DAYS = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
|
|
@@ -833,12 +833,13 @@ var Header = function Header(_ref) {
|
|
|
833
833
|
}
|
|
834
834
|
}, t("neetoMolecules.common.actions.edit"))))), /*#__PURE__*/React.createElement("div", {
|
|
835
835
|
className: "flex items-center space-x-2"
|
|
836
|
-
}, /*#__PURE__*/React.createElement(
|
|
837
|
-
|
|
838
|
-
|
|
836
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
837
|
+
content: t("neetoMolecules.schedule.timezoneTooltip"),
|
|
838
|
+
position: "bottom"
|
|
839
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
839
840
|
style: "h4",
|
|
840
841
|
weight: "medium"
|
|
841
|
-
}, timeZoneAndTime), /*#__PURE__*/React.createElement(Dropdown, {
|
|
842
|
+
}, timeZoneAndTime)), /*#__PURE__*/React.createElement(Dropdown, {
|
|
842
843
|
icon: MenuVertical,
|
|
843
844
|
buttonProps: {
|
|
844
845
|
style: "text",
|
|
@@ -848,7 +849,7 @@ var Header = function Header(_ref) {
|
|
|
848
849
|
onClick: function onClick() {
|
|
849
850
|
return window.location.href = MY_PROFILE_URL;
|
|
850
851
|
}
|
|
851
|
-
}, t("neetoMolecules.common.actions.
|
|
852
|
+
}, t("neetoMolecules.common.actions.changeTimezone"))))));
|
|
852
853
|
};
|
|
853
854
|
|
|
854
855
|
var Schedule = /*#__PURE__*/forwardRef(function (_ref, scheduleRef) {
|