@bigbinary/neeto-molecules 4.1.18 → 4.1.19
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 +1 -1
- package/dist/CalendarView.js +1 -1
- package/dist/{Columns-D51hN86M.js → Columns-6JwGF3TU.js} +2 -2
- package/dist/{Columns-D51hN86M.js.map → Columns-6JwGF3TU.js.map} +1 -1
- package/dist/Columns.js +1 -1
- package/dist/FloatingActionMenu.js +1 -1
- package/dist/FloatingActionMenu.js.map +1 -1
- package/dist/IpRestriction.js +47 -47
- package/dist/IpRestriction.js.map +1 -1
- package/dist/KeyboardShortcuts.js +1 -1
- package/dist/KeyboardShortcuts.js.map +1 -1
- package/dist/Onboarding.js +1 -236
- package/dist/Onboarding.js.map +1 -1
- package/dist/PhoneNumber.js +4 -4
- package/dist/PhoneNumber.js.map +1 -1
- package/dist/SendToFields.js +1 -1
- package/dist/SessionEnvironment.js +1 -1
- package/dist/Sidebar.js +1 -1
- package/dist/SubHeader.js +1 -1
- package/dist/Taxonomy.js +1 -1
- package/dist/cjs/BrowserSupport.js +14 -14
- package/dist/cjs/BrowserSupport.js.map +1 -1
- package/dist/cjs/Builder.js +8 -8
- package/dist/cjs/Builder.js.map +1 -1
- package/dist/cjs/Engagements.js +3 -3
- package/dist/cjs/Engagements.js.map +1 -1
- package/dist/cjs/FloatingActionMenu.js +4 -4
- package/dist/cjs/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/IconPicker.js +3 -3
- package/dist/cjs/IconPicker.js.map +1 -1
- package/dist/cjs/Insights.js +24 -24
- package/dist/cjs/Insights.js.map +1 -1
- package/dist/cjs/IpRestriction.js +52 -52
- package/dist/cjs/IpRestriction.js.map +1 -1
- package/dist/cjs/KeyboardShortcuts.js +8 -8
- package/dist/cjs/KeyboardShortcuts.js.map +1 -1
- package/dist/cjs/MadeWith.js +3 -3
- package/dist/cjs/MadeWith.js.map +1 -1
- package/dist/cjs/NeetoWidget.js +6 -6
- package/dist/cjs/NeetoWidget.js.map +1 -1
- package/dist/cjs/Onboarding.js +1 -236
- package/dist/cjs/Onboarding.js.map +1 -1
- package/dist/cjs/PhoneNumber.js +3 -3
- package/dist/cjs/PhoneNumber.js.map +1 -1
- package/dist/cjs/Schedule.js +6 -6
- package/dist/cjs/Schedule.js.map +1 -1
- package/dist/cjs/SendToFields.js +4 -4
- package/dist/cjs/SendToFields.js.map +1 -1
- package/dist/cjs/SessionEnvironment.js +8 -8
- package/dist/cjs/SessionEnvironment.js.map +1 -1
- package/dist/cjs/Settings.js +6 -6
- package/dist/cjs/Settings.js.map +1 -1
- package/dist/cjs/Sidebar.js +3 -3
- package/dist/cjs/Sidebar.js.map +1 -1
- package/dist/cjs/StatusDropdown.js +7 -7
- package/dist/cjs/StatusDropdown.js.map +1 -1
- package/dist/cjs/{phone-number-CKeWRcTL.js → phone-number-ycxkC0mm.js} +10 -10
- package/dist/cjs/{phone-number-CKeWRcTL.js.map → phone-number-ycxkC0mm.js.map} +1 -1
- package/dist/{phone-number-HpVGHffA.js → phone-number--BBsxLSh.js} +2 -2
- package/dist/{phone-number-HpVGHffA.js.map → phone-number--BBsxLSh.js.map} +1 -1
- package/package.json +3 -3
|
@@ -96,7 +96,7 @@ var getGlobalShortcuts = function getGlobalShortcuts() {
|
|
|
96
96
|
description: i18next.t("neetoMolecules.keyboardShortcuts.global.submitForm")
|
|
97
97
|
},
|
|
98
98
|
openProductSwitcher: {
|
|
99
|
-
sequence: "command+
|
|
99
|
+
sequence: "command+u",
|
|
100
100
|
description: i18next.t("neetoMolecules.keyboardShortcuts.global.openProductSwitcher")
|
|
101
101
|
}
|
|
102
102
|
});
|
|
@@ -112,7 +112,7 @@ var getTooltipProps = function getTooltipProps(key) {
|
|
|
112
112
|
return null;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
var HotKey = function HotKey(_ref) {
|
|
115
|
+
var HotKey$1 = function HotKey(_ref) {
|
|
116
116
|
var description = _ref.description,
|
|
117
117
|
sequence = _ref.sequence;
|
|
118
118
|
var hotkey = shortenHotKey(convertHotkeyToUsersPlatform(sequence));
|
|
@@ -153,9 +153,9 @@ var HotKey = function HotKey(_ref) {
|
|
|
153
153
|
})
|
|
154
154
|
});
|
|
155
155
|
};
|
|
156
|
-
var HotKey
|
|
156
|
+
var HotKey = /*#__PURE__*/React.memo(HotKey$1);
|
|
157
157
|
|
|
158
|
-
var HotKeyList = reactUtils.withT(function (_ref) {
|
|
158
|
+
var HotKeyList$1 = reactUtils.withT(function (_ref) {
|
|
159
159
|
var t = _ref.t,
|
|
160
160
|
hotkeys = _ref.hotkeys;
|
|
161
161
|
return Object.keys(hotkeys).map(function (categoryName) {
|
|
@@ -173,7 +173,7 @@ var HotKeyList = reactUtils.withT(function (_ref) {
|
|
|
173
173
|
_ref3$ = _ref3[1],
|
|
174
174
|
sequence = _ref3$.sequence,
|
|
175
175
|
description = _ref3$.description;
|
|
176
|
-
return sequence && /*#__PURE__*/React.createElement(HotKey
|
|
176
|
+
return sequence && /*#__PURE__*/React.createElement(HotKey, {
|
|
177
177
|
description: description,
|
|
178
178
|
sequence: sequence,
|
|
179
179
|
key: sequence
|
|
@@ -188,7 +188,7 @@ var HotKeyList = reactUtils.withT(function (_ref) {
|
|
|
188
188
|
}, categoryName);
|
|
189
189
|
});
|
|
190
190
|
});
|
|
191
|
-
var HotKeyList
|
|
191
|
+
var HotKeyList = /*#__PURE__*/React.memo(HotKeyList$1);
|
|
192
192
|
|
|
193
193
|
var css = ".neeto-molecules-keyboard-shortcuts-pane{flex-grow:0;flex-shrink:0;z-index:calc(var(--neeto-ui-modal-z-index) + 1)}";
|
|
194
194
|
injectCss.n(css,{});
|
|
@@ -243,9 +243,9 @@ var KeyboardShortcutsPane = function KeyboardShortcutsPane(_ref) {
|
|
|
243
243
|
return setIsOpen(false);
|
|
244
244
|
}
|
|
245
245
|
})]
|
|
246
|
-
}), /*#__PURE__*/jsxRuntime.jsx(HotKeyList
|
|
246
|
+
}), /*#__PURE__*/jsxRuntime.jsx(HotKeyList, {
|
|
247
247
|
hotkeys: GLOBAL_SHORTCUTS
|
|
248
|
-
}), /*#__PURE__*/jsxRuntime.jsx(HotKeyList
|
|
248
|
+
}), /*#__PURE__*/jsxRuntime.jsx(HotKeyList, {
|
|
249
249
|
hotkeys: productShortcuts
|
|
250
250
|
})]
|
|
251
251
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardShortcuts.js","sources":["../../src/components/KeyboardShortcuts/Pane/constants.js","../../src/components/KeyboardShortcuts/Pane/utils.js","../../src/components/KeyboardShortcuts/Pane/HotKey.jsx","../../src/components/KeyboardShortcuts/Pane/HotKeyList.jsx","../../src/components/KeyboardShortcuts/Pane/index.jsx","../../src/components/KeyboardShortcuts/index.js"],"sourcesContent":["export const KEY_SHORTFORM_MAP = {\n command: \"⌘\",\n escape: \"esc\",\n control: \"ctrl\",\n option: \"opt\",\n return: \"enter\",\n};\n\nexport const MAC_TO_WINDOWS_KEYS_MAP = {\n option: \"alt\",\n command: \"ctrl\",\n return: \"enter\",\n delete: \"backspace\",\n};\n\nexport const OS = { mac: \"macOS\", windows: \"Windows\" };\n\nexport const FULL_SHORTCUTS_LINK_PROP_NAME = \"fullShortcutsLink\";\n\nexport const TOOLTIP_CONTENT = {\n \"⌘\": \"command\",\n esc: \"escape\",\n ctrl: \"control\",\n opt: \"option\",\n backspace: \"delete\",\n};\n","import i18next from \"i18next\";\nimport { toPairs } from \"ramda\";\nimport { UAParser } from \"ua-parser-js\";\n\nimport {\n KEY_SHORTFORM_MAP,\n MAC_TO_WINDOWS_KEYS_MAP,\n OS,\n TOOLTIP_CONTENT,\n} from \"./constants\";\n\nconst isMultipleHotkey = hotkey => Array.isArray(hotkey);\n\nconst replaceKeys = (hotkey, keyName, replaceWith) =>\n isMultipleHotkey(hotkey)\n ? hotkey.map(item => item.replaceAll(keyName, replaceWith))\n : hotkey.replaceAll(keyName, replaceWith);\n\nconst convertHotKeyToWindows = hotkey => {\n toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(([macKey, windowsKey]) => {\n hotkey = replaceKeys(hotkey, macKey, windowsKey);\n });\n\n return hotkey;\n};\n\nexport const convertHotkeyToUsersPlatform = hotkey => {\n const parser = new UAParser(navigator.userAgent);\n const result = parser.getResult();\n const isOSX = result.os.name?.includes(OS.mac);\n if (isOSX) return hotkey;\n\n return convertHotKeyToWindows(hotkey);\n};\n\nexport const shortenHotKey = hotkey => {\n let result = hotkey;\n Object.entries(KEY_SHORTFORM_MAP).forEach(([longform, shortform]) => {\n result = result.replaceAll(longform, shortform);\n });\n\n return result;\n};\n\nexport const getGlobalShortcuts = () => ({\n [i18next.t(\"neetoMolecules.keyboardShortcuts.global.categoryName\")]: {\n openKeyboardShortcutsPane: {\n sequence: \"command+/\",\n description: i18next.t(\n \"neetoMolecules.keyboardShortcuts.global.openKeyboardShortcutsPane\"\n ),\n },\n close: {\n sequence: \"esc\",\n description: i18next.t(\"neetoMolecules.keyboardShortcuts.global.close\"),\n },\n submitForm: {\n sequence: \"command+return\",\n description: i18next.t(\n \"neetoMolecules.keyboardShortcuts.global.submitForm\"\n ),\n },\n openProductSwitcher: {\n sequence: \"command+e\",\n description: i18next.t(\n \"neetoMolecules.keyboardShortcuts.global.openProductSwitcher\"\n ),\n },\n },\n});\n\nexport const getTooltipProps = key => {\n if (TOOLTIP_CONTENT[key]) {\n return {\n position: \"top\",\n content: TOOLTIP_CONTENT[key],\n followCursor: \"horizontal\",\n };\n }\n\n return null;\n};\n","import { memo, Fragment } from \"react\";\n\n// eslint-disable-next-line @bigbinary/neeto/use-webpack-alias\nimport { Kbd, Typography } from \"@bigbinary/neetoui\";\n\nimport {\n convertHotkeyToUsersPlatform,\n shortenHotKey,\n getTooltipProps,\n} from \"./utils\";\n\nconst HotKey = ({ description, sequence }) => {\n const hotkey = shortenHotKey(convertHotkeyToUsersPlatform(sequence));\n const isSequentialHotkey = hotkey.includes(\" \");\n const isSimultaneousHotkey = hotkey.includes(\"+\");\n const isSingleKeyHotkey = !isSequentialHotkey && !isSimultaneousHotkey;\n let sequences = [];\n\n if (isSingleKeyHotkey) {\n sequences = [hotkey];\n } else if (isSequentialHotkey) {\n sequences = hotkey.split(\" \");\n } else if (isSimultaneousHotkey) {\n sequences = hotkey.split(\"+\");\n }\n\n return (\n <div className=\"my-3 w-full\">\n <div\n className=\"flex items-center justify-between gap-3\"\n data-testid=\"hotkey-item\"\n >\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {description}\n </Typography>\n <div className=\"flex flex-shrink-0 items-center gap-1\">\n {sequences.map((keyName, idx) => (\n <Fragment key={idx}>\n <Kbd {...{ keyName }} tooltipProps={getTooltipProps(keyName)} />\n {isSequentialHotkey && idx + 1 !== sequences.length && (\n <Kbd keyName=\"then\" />\n )}\n </Fragment>\n ))}\n </div>\n </div>\n </div>\n );\n};\n\nexport default memo(HotKey);\n","import { memo } from \"react\";\n\n// eslint-disable-next-line @bigbinary/neeto/use-webpack-alias\nimport { Button, Typography } from \"@bigbinary/neetoui\";\nimport { withT } from \"neetocommons/react-utils\";\n\nimport { FULL_SHORTCUTS_LINK_PROP_NAME } from \"./constants\";\nimport HotKey from \"./HotKey\";\n\nconst HotKeyList = withT(({ t, hotkeys }) =>\n Object.keys(hotkeys).map(categoryName => {\n const categoryValues = hotkeys[categoryName];\n const fullShortcutsLink = categoryValues[FULL_SHORTCUTS_LINK_PROP_NAME];\n\n return (\n <div className=\"mt-4 px-4\" key={categoryName}>\n <Typography style=\"h6\" textTransform=\"uppercase\" weight=\"bold\">\n {categoryName}\n </Typography>\n {Object.entries(categoryValues).map(\n ([, { sequence, description }]) =>\n sequence && <HotKey {...{ description, sequence }} key={sequence} />\n )}\n {fullShortcutsLink && (\n <Button\n className=\"mb-3\"\n href={fullShortcutsLink}\n style=\"link\"\n target=\"_blank\"\n label={t(\n \"neetoMolecules.keyboardShortcuts.viewFullListOfShortcuts\"\n )}\n />\n )}\n </div>\n );\n })\n);\n\nexport default memo(HotKeyList);\n","/* eslint-disable @bigbinary/neeto/use-webpack-alias */\nimport { Close } from \"@bigbinary/neeto-icons\";\nimport { Typography, Button } from \"@bigbinary/neetoui\";\nimport { manager } from \"@bigbinary/neetoui/managers\";\nimport classnames from \"classnames\";\nimport useHotkeys from \"neetohotkeys\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport HotKeyList from \"./HotKeyList\";\nimport \"./keyboard-shortcuts.scss\";\nimport { getGlobalShortcuts } from \"./utils\";\n\nimport useKeyboardShortcutsPaneState from \"../hooks/useKeyboardShortcutsPaneState\";\n\nconst KeyboardShortcutsPane = ({ productShortcuts = {} }) => {\n const [isOpen, setIsOpen] = useKeyboardShortcutsPaneState();\n const hasOverlays = manager.hasOverlays();\n // eslint-disable-next-line @bigbinary/neeto/no-dangling-constants\n const GLOBAL_SHORTCUTS = getGlobalShortcuts();\n const { t } = useTranslation();\n\n const shortcuts =\n GLOBAL_SHORTCUTS[t(\"neetoMolecules.keyboardShortcuts.global.categoryName\")];\n\n useHotkeys(\n shortcuts.openKeyboardShortcutsPane.sequence,\n () => setIsOpen(prevIsOpen => !prevIsOpen),\n { mode: \"global\" }\n );\n\n useHotkeys(shortcuts.close.sequence, () => setIsOpen(false), {\n mode: \"global\",\n enabled: isOpen,\n });\n\n return (\n <div\n data-testid=\"keyboard-shortcuts-pane\"\n className={classnames(\n \"neeto-molecules-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width neeto-ui-bg-white ms-auto h-dvh overflow-hidden border-l duration-300 ease-in-out rtl:border-l-0 rtl:border-r\",\n {\n \"w-80\": isOpen,\n \"w-0\": !isOpen,\n absolute: hasOverlays,\n \"end-0\": hasOverlays,\n }\n )}\n >\n <div className=\"h-full w-80 overflow-y-auto\">\n <div className=\"neeto-ui-border-gray-300 my-2 flex items-center justify-between border-b px-4 pb-2\">\n <Typography data-testid=\"keyboard-shortcuts-pane-title\" style=\"h4\">\n {t(\"neetoMolecules.keyboardShortcuts.title\")}\n </Typography>\n <Button\n data-testid=\"keyboard-shortcuts-pane-close-button\"\n icon={Close}\n style=\"text\"\n onClick={() => setIsOpen(false)}\n />\n </div>\n <HotKeyList hotkeys={GLOBAL_SHORTCUTS} />\n <HotKeyList hotkeys={productShortcuts} />\n </div>\n </div>\n );\n};\n\nKeyboardShortcutsPane.propTypes = {\n /**\n * Used to pass in the product specific keyboard shortcuts.\n */\n productShortcuts: PropTypes.object,\n};\n\nexport default KeyboardShortcutsPane;\n","import useKeyboardShortcutsPaneState from \"./hooks/useKeyboardShortcutsPaneState\";\nimport KeyboardShortcutsPane from \"./Pane\";\nimport { getGlobalShortcuts } from \"./Pane/utils\";\n\nconst KeyboardShortcuts = {\n Pane: KeyboardShortcutsPane,\n usePaneState: useKeyboardShortcutsPaneState,\n GLOBAL_SHORTCUTS: getGlobalShortcuts(),\n};\n\nexport default KeyboardShortcuts;\n"],"names":["KEY_SHORTFORM_MAP","command","escape","control","option","MAC_TO_WINDOWS_KEYS_MAP","OS","mac","FULL_SHORTCUTS_LINK_PROP_NAME","TOOLTIP_CONTENT","esc","ctrl","opt","backspace","isMultipleHotkey","hotkey","Array","isArray","replaceKeys","keyName","replaceWith","map","item","replaceAll","convertHotKeyToWindows","toPairs","forEach","_ref","_ref2","_slicedToArray","macKey","windowsKey","convertHotkeyToUsersPlatform","_result$os$name","parser","UAParser","navigator","userAgent","result","getResult","isOSX","os","name","includes","shortenHotKey","Object","entries","_ref3","_ref4","longform","shortform","getGlobalShortcuts","_defineProperty","i18next","t","openKeyboardShortcutsPane","sequence","description","close","submitForm","openProductSwitcher","getTooltipProps","key","position","content","followCursor","HotKey","isSequentialHotkey","isSimultaneousHotkey","isSingleKeyHotkey","sequences","split","_jsx","className","children","_jsxs","Typography","lineHeight","style","idx","Fragment","Kbd","tooltipProps","length","memo","HotKeyList","withT","hotkeys","keys","categoryName","categoryValues","fullShortcutsLink","textTransform","weight","_ref3$","_createElement","Button","href","target","label","KeyboardShortcutsPane","_ref$productShortcuts","productShortcuts","_useKeyboardShortcuts","useKeyboardShortcutsPaneState","_useKeyboardShortcuts2","isOpen","setIsOpen","hasOverlays","manager","GLOBAL_SHORTCUTS","_useTranslation","useTranslation","shortcuts","useHotkeys","prevIsOpen","mode","enabled","classnames","absolute","icon","Close","onClick","KeyboardShortcuts","Pane","usePaneState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,iBAAiB,GAAG;AAC/BC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,OAAO,EAAE,MAAM;AACfC,EAAAA,MAAM,EAAE,KAAK;EACb,QAAA,EAAQ;AACV,CAAC;AAEM,IAAMC,uBAAuB,GAAG;AACrCD,EAAAA,MAAM,EAAE,KAAK;AACbH,EAAAA,OAAO,EAAE,MAAM;AACf,EAAA,QAAA,EAAQ,OAAO;EACf,QAAA,EAAQ;AACV,CAAC;AAEM,IAAMK,EAAE,GAAG;AAAEC,EAAAA,GAAG,EAAE,OAA4B,CAAC;AAE/C,IAAMC,6BAA6B,GAAG,mBAAmB;AAEzD,IAAMC,eAAe,GAAG;AAC7B,EAAA,GAAG,EAAE,SAAS;AACdC,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,IAAI,EAAE,SAAS;AACfC,EAAAA,GAAG,EAAE,QAAQ;AACbC,EAAAA,SAAS,EAAE;AACb,CAAC;;ACdD,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAGC,MAAM,EAAA;AAAA,EAAA,OAAIC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC;AAAA,CAAA;AAExD,IAAMG,WAAW,GAAG,SAAdA,WAAWA,CAAIH,MAAM,EAAEI,OAAO,EAAEC,WAAW,EAAA;EAAA,OAC/CN,gBAAgB,CAACC,MAAM,CAAC,GACpBA,MAAM,CAACM,GAAG,CAAC,UAA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AAA,KAAA,EAAA;AAAKF,QAAAA,SAAS,EAAC,oFAAoF;QAAAC,QAAA,EAAA,cACjGF,cAAA,CAACI,UAAU,EAAA;AAAC,UAAA,aAAA,EAAY,+BAA+B;AAACE,UAAAA,KAAK,EAAC,IAAI;UAAAJ,QAAA,EAC/DpB,CAAC,CAAC,wCAAwC;AAAC,SAClC,CAAC,eACbkB,cAAA,CAACwB,MAAM,EAAA;AACL,UAAA,aAAA,EAAY,sCAAsC;AAClDwB,UAAAA,IAAI,EAAEC,KAAM;AACZ3C,UAAAA,KAAK,EAAC,MAAM;UACZ4C,OAAO,EAAE,SAATA,OAAOA,GAAA;YAAA,OAAQf,SAAS,CAAC,KAAK,CAAC;AAAA,UAAA;AAAC,SACjC,CAAC;AAAA,OACC,CAAC,eACNnC,cAAA,CAACa,YAAU,EAAA;AAACE,QAAAA,OAAO,EAAEuB;AAAiB,OAAE,CAAC,eACzCtC,cAAA,CAACa,YAAU,EAAA;AAACE,QAAAA,OAAO,EAAEe;AAAiB,OAAE,CAAC;KACtC;AAAC,GACH,CAAC;AAEV,CAAC;;AC9DD,IAAMqB,iBAAiB,GAAG;AACxBC,EAAAA,IAAI,EAAExB,qBAAqB;AAC3ByB,EAAAA,YAAY,EAAErB,2DAA6B;EAC3CM,gBAAgB,EAAE3D,kBAAkB;AACtC;;;;"}
|
|
1
|
+
{"version":3,"file":"KeyboardShortcuts.js","sources":["../../src/components/KeyboardShortcuts/Pane/constants.js","../../src/components/KeyboardShortcuts/Pane/utils.js","../../src/components/KeyboardShortcuts/Pane/HotKey.jsx","../../src/components/KeyboardShortcuts/Pane/HotKeyList.jsx","../../src/components/KeyboardShortcuts/Pane/index.jsx","../../src/components/KeyboardShortcuts/index.js"],"sourcesContent":["export const KEY_SHORTFORM_MAP = {\n command: \"⌘\",\n escape: \"esc\",\n control: \"ctrl\",\n option: \"opt\",\n return: \"enter\",\n};\n\nexport const MAC_TO_WINDOWS_KEYS_MAP = {\n option: \"alt\",\n command: \"ctrl\",\n return: \"enter\",\n delete: \"backspace\",\n};\n\nexport const OS = { mac: \"macOS\", windows: \"Windows\" };\n\nexport const FULL_SHORTCUTS_LINK_PROP_NAME = \"fullShortcutsLink\";\n\nexport const TOOLTIP_CONTENT = {\n \"⌘\": \"command\",\n esc: \"escape\",\n ctrl: \"control\",\n opt: \"option\",\n backspace: \"delete\",\n};\n","import i18next from \"i18next\";\nimport { toPairs } from \"ramda\";\nimport { UAParser } from \"ua-parser-js\";\n\nimport {\n KEY_SHORTFORM_MAP,\n MAC_TO_WINDOWS_KEYS_MAP,\n OS,\n TOOLTIP_CONTENT,\n} from \"./constants\";\n\nconst isMultipleHotkey = hotkey => Array.isArray(hotkey);\n\nconst replaceKeys = (hotkey, keyName, replaceWith) =>\n isMultipleHotkey(hotkey)\n ? hotkey.map(item => item.replaceAll(keyName, replaceWith))\n : hotkey.replaceAll(keyName, replaceWith);\n\nconst convertHotKeyToWindows = hotkey => {\n toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(([macKey, windowsKey]) => {\n hotkey = replaceKeys(hotkey, macKey, windowsKey);\n });\n\n return hotkey;\n};\n\nexport const convertHotkeyToUsersPlatform = hotkey => {\n const parser = new UAParser(navigator.userAgent);\n const result = parser.getResult();\n const isOSX = result.os.name?.includes(OS.mac);\n if (isOSX) return hotkey;\n\n return convertHotKeyToWindows(hotkey);\n};\n\nexport const shortenHotKey = hotkey => {\n let result = hotkey;\n Object.entries(KEY_SHORTFORM_MAP).forEach(([longform, shortform]) => {\n result = result.replaceAll(longform, shortform);\n });\n\n return result;\n};\n\nexport const getGlobalShortcuts = () => ({\n [i18next.t(\"neetoMolecules.keyboardShortcuts.global.categoryName\")]: {\n openKeyboardShortcutsPane: {\n sequence: \"command+/\",\n description: i18next.t(\n \"neetoMolecules.keyboardShortcuts.global.openKeyboardShortcutsPane\"\n ),\n },\n close: {\n sequence: \"esc\",\n description: i18next.t(\"neetoMolecules.keyboardShortcuts.global.close\"),\n },\n submitForm: {\n sequence: \"command+return\",\n description: i18next.t(\n \"neetoMolecules.keyboardShortcuts.global.submitForm\"\n ),\n },\n openProductSwitcher: {\n sequence: \"command+u\",\n description: i18next.t(\n \"neetoMolecules.keyboardShortcuts.global.openProductSwitcher\"\n ),\n },\n },\n});\n\nexport const getTooltipProps = key => {\n if (TOOLTIP_CONTENT[key]) {\n return {\n position: \"top\",\n content: TOOLTIP_CONTENT[key],\n followCursor: \"horizontal\",\n };\n }\n\n return null;\n};\n","import { memo, Fragment } from \"react\";\n\n// eslint-disable-next-line @bigbinary/neeto/use-webpack-alias\nimport { Kbd, Typography } from \"@bigbinary/neetoui\";\n\nimport {\n convertHotkeyToUsersPlatform,\n shortenHotKey,\n getTooltipProps,\n} from \"./utils\";\n\nconst HotKey = ({ description, sequence }) => {\n const hotkey = shortenHotKey(convertHotkeyToUsersPlatform(sequence));\n const isSequentialHotkey = hotkey.includes(\" \");\n const isSimultaneousHotkey = hotkey.includes(\"+\");\n const isSingleKeyHotkey = !isSequentialHotkey && !isSimultaneousHotkey;\n let sequences = [];\n\n if (isSingleKeyHotkey) {\n sequences = [hotkey];\n } else if (isSequentialHotkey) {\n sequences = hotkey.split(\" \");\n } else if (isSimultaneousHotkey) {\n sequences = hotkey.split(\"+\");\n }\n\n return (\n <div className=\"my-3 w-full\">\n <div\n className=\"flex items-center justify-between gap-3\"\n data-testid=\"hotkey-item\"\n >\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {description}\n </Typography>\n <div className=\"flex flex-shrink-0 items-center gap-1\">\n {sequences.map((keyName, idx) => (\n <Fragment key={idx}>\n <Kbd {...{ keyName }} tooltipProps={getTooltipProps(keyName)} />\n {isSequentialHotkey && idx + 1 !== sequences.length && (\n <Kbd keyName=\"then\" />\n )}\n </Fragment>\n ))}\n </div>\n </div>\n </div>\n );\n};\n\nexport default memo(HotKey);\n","import { memo } from \"react\";\n\n// eslint-disable-next-line @bigbinary/neeto/use-webpack-alias\nimport { Button, Typography } from \"@bigbinary/neetoui\";\nimport { withT } from \"neetocommons/react-utils\";\n\nimport { FULL_SHORTCUTS_LINK_PROP_NAME } from \"./constants\";\nimport HotKey from \"./HotKey\";\n\nconst HotKeyList = withT(({ t, hotkeys }) =>\n Object.keys(hotkeys).map(categoryName => {\n const categoryValues = hotkeys[categoryName];\n const fullShortcutsLink = categoryValues[FULL_SHORTCUTS_LINK_PROP_NAME];\n\n return (\n <div className=\"mt-4 px-4\" key={categoryName}>\n <Typography style=\"h6\" textTransform=\"uppercase\" weight=\"bold\">\n {categoryName}\n </Typography>\n {Object.entries(categoryValues).map(\n ([, { sequence, description }]) =>\n sequence && <HotKey {...{ description, sequence }} key={sequence} />\n )}\n {fullShortcutsLink && (\n <Button\n className=\"mb-3\"\n href={fullShortcutsLink}\n style=\"link\"\n target=\"_blank\"\n label={t(\n \"neetoMolecules.keyboardShortcuts.viewFullListOfShortcuts\"\n )}\n />\n )}\n </div>\n );\n })\n);\n\nexport default memo(HotKeyList);\n","/* eslint-disable @bigbinary/neeto/use-webpack-alias */\nimport { Close } from \"@bigbinary/neeto-icons\";\nimport { Typography, Button } from \"@bigbinary/neetoui\";\nimport { manager } from \"@bigbinary/neetoui/managers\";\nimport classnames from \"classnames\";\nimport useHotkeys from \"neetohotkeys\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport HotKeyList from \"./HotKeyList\";\nimport \"./keyboard-shortcuts.scss\";\nimport { getGlobalShortcuts } from \"./utils\";\n\nimport useKeyboardShortcutsPaneState from \"../hooks/useKeyboardShortcutsPaneState\";\n\nconst KeyboardShortcutsPane = ({ productShortcuts = {} }) => {\n const [isOpen, setIsOpen] = useKeyboardShortcutsPaneState();\n const hasOverlays = manager.hasOverlays();\n // eslint-disable-next-line @bigbinary/neeto/no-dangling-constants\n const GLOBAL_SHORTCUTS = getGlobalShortcuts();\n const { t } = useTranslation();\n\n const shortcuts =\n GLOBAL_SHORTCUTS[t(\"neetoMolecules.keyboardShortcuts.global.categoryName\")];\n\n useHotkeys(\n shortcuts.openKeyboardShortcutsPane.sequence,\n () => setIsOpen(prevIsOpen => !prevIsOpen),\n { mode: \"global\" }\n );\n\n useHotkeys(shortcuts.close.sequence, () => setIsOpen(false), {\n mode: \"global\",\n enabled: isOpen,\n });\n\n return (\n <div\n data-testid=\"keyboard-shortcuts-pane\"\n className={classnames(\n \"neeto-molecules-keyboard-shortcuts-pane neeto-ui-border-gray-300 transition-width neeto-ui-bg-white ms-auto h-dvh overflow-hidden border-l duration-300 ease-in-out rtl:border-l-0 rtl:border-r\",\n {\n \"w-80\": isOpen,\n \"w-0\": !isOpen,\n absolute: hasOverlays,\n \"end-0\": hasOverlays,\n }\n )}\n >\n <div className=\"h-full w-80 overflow-y-auto\">\n <div className=\"neeto-ui-border-gray-300 my-2 flex items-center justify-between border-b px-4 pb-2\">\n <Typography data-testid=\"keyboard-shortcuts-pane-title\" style=\"h4\">\n {t(\"neetoMolecules.keyboardShortcuts.title\")}\n </Typography>\n <Button\n data-testid=\"keyboard-shortcuts-pane-close-button\"\n icon={Close}\n style=\"text\"\n onClick={() => setIsOpen(false)}\n />\n </div>\n <HotKeyList hotkeys={GLOBAL_SHORTCUTS} />\n <HotKeyList hotkeys={productShortcuts} />\n </div>\n </div>\n );\n};\n\nKeyboardShortcutsPane.propTypes = {\n /**\n * Used to pass in the product specific keyboard shortcuts.\n */\n productShortcuts: PropTypes.object,\n};\n\nexport default KeyboardShortcutsPane;\n","import useKeyboardShortcutsPaneState from \"./hooks/useKeyboardShortcutsPaneState\";\nimport KeyboardShortcutsPane from \"./Pane\";\nimport { getGlobalShortcuts } from \"./Pane/utils\";\n\nconst KeyboardShortcuts = {\n Pane: KeyboardShortcutsPane,\n usePaneState: useKeyboardShortcutsPaneState,\n GLOBAL_SHORTCUTS: getGlobalShortcuts(),\n};\n\nexport default KeyboardShortcuts;\n"],"names":["KEY_SHORTFORM_MAP","command","escape","control","option","MAC_TO_WINDOWS_KEYS_MAP","OS","mac","FULL_SHORTCUTS_LINK_PROP_NAME","TOOLTIP_CONTENT","esc","ctrl","opt","backspace","isMultipleHotkey","hotkey","Array","isArray","replaceKeys","keyName","replaceWith","map","item","replaceAll","convertHotKeyToWindows","toPairs","forEach","_ref","_ref2","_slicedToArray","macKey","windowsKey","convertHotkeyToUsersPlatform","_result$os$name","parser","UAParser","navigator","userAgent","result","getResult","isOSX","os","name","includes","shortenHotKey","Object","entries","_ref3","_ref4","longform","shortform","getGlobalShortcuts","_defineProperty","i18next","t","openKeyboardShortcutsPane","sequence","description","close","submitForm","openProductSwitcher","getTooltipProps","key","position","content","followCursor","HotKey","isSequentialHotkey","isSimultaneousHotkey","isSingleKeyHotkey","sequences","split","_jsx","className","children","_jsxs","Typography","lineHeight","style","idx","Fragment","Kbd","tooltipProps","length","memo","HotKeyList","withT","hotkeys","keys","categoryName","categoryValues","fullShortcutsLink","textTransform","weight","_ref3$","_createElement","Button","href","target","label","KeyboardShortcutsPane","_ref$productShortcuts","productShortcuts","_useKeyboardShortcuts","useKeyboardShortcutsPaneState","_useKeyboardShortcuts2","isOpen","setIsOpen","hasOverlays","manager","GLOBAL_SHORTCUTS","_useTranslation","useTranslation","shortcuts","useHotkeys","prevIsOpen","mode","enabled","classnames","absolute","icon","Close","onClick","KeyboardShortcuts","Pane","usePaneState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,iBAAiB,GAAG;AAC/BC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,OAAO,EAAE,MAAM;AACfC,EAAAA,MAAM,EAAE,KAAK;EACb,QAAA,EAAQ;AACV,CAAC;AAEM,IAAMC,uBAAuB,GAAG;AACrCD,EAAAA,MAAM,EAAE,KAAK;AACbH,EAAAA,OAAO,EAAE,MAAM;AACf,EAAA,QAAA,EAAQ,OAAO;EACf,QAAA,EAAQ;AACV,CAAC;AAEM,IAAMK,EA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AC;AAEV,CAAC;;AC9DD,IAAMqB,iBAAiB,GAAG;AACxBC,EAAAA,IAAI,EAAExB,qBAAqB;AAC3ByB,EAAAA,YAAY,EAAErB,2DAA6B;EAC3CM,gBAAgB,EAAE3D,kBAAkB;AACtC;;;;"}
|
package/dist/cjs/MadeWith.js
CHANGED
|
@@ -95,12 +95,12 @@ var camelcase = function (str) {
|
|
|
95
95
|
|
|
96
96
|
const camelCase = camelcase;
|
|
97
97
|
|
|
98
|
-
var uppercamelcase = function () {
|
|
98
|
+
var uppercamelcase$1 = function () {
|
|
99
99
|
const cased = camelCase.apply(camelCase, arguments);
|
|
100
100
|
return cased.charAt(0).toUpperCase() + cased.slice(1);
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
var uppercamelcase
|
|
103
|
+
var uppercamelcase = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(uppercamelcase$1);
|
|
104
104
|
|
|
105
105
|
var css = ".neeto-molecules-made-with__wrapper{align-items:center;background:#fff;border:.5px solid #dfdfde;border-radius:.375rem;color:#000;display:inline-flex;font-family:-apple-system,BlinkMacSystemFont,Inter,Arial,Segoe UI,Roboto,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:.875rem;font-weight:400;gap:.375rem;padding:.375rem .5rem;transition:all;transition-duration:.3s;-webkit-user-select:none;-moz-user-select:none;user-select:none}@media (prefers-reduced-motion:reduce){.neeto-molecules-made-with__wrapper{transition:none}}.neeto-molecules-made-with__wrapper strong{font-weight:700}.neeto-molecules-made-with__wrapper:hover{box-shadow:inset 0 0 0 1px #dfdfde}";
|
|
106
106
|
injectCss.n(css,{});
|
|
@@ -116,7 +116,7 @@ var MadeWith = function MadeWith(_ref) {
|
|
|
116
116
|
var name = neetoCist.capitalize(productName || globalProps.appName || "Neeto");
|
|
117
117
|
var subdomain = (_globalProps$organiza = globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.subdomain;
|
|
118
118
|
var utmParams = "utm_source=madewith".concat(subdomain ? "&utm_campaign=".concat(subdomain) : "");
|
|
119
|
-
var IconComponent = ProductIcon || Icons__namespace[uppercamelcase
|
|
119
|
+
var IconComponent = ProductIcon || Icons__namespace[uppercamelcase(name)];
|
|
120
120
|
return /*#__PURE__*/jsxRuntime.jsxs("a", _objectSpread(_objectSpread({
|
|
121
121
|
className: "neeto-molecules-made-with__wrapper",
|
|
122
122
|
"data-testid": "made-with-".concat(name.toLowerCase()),
|
package/dist/cjs/MadeWith.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MadeWith.js","sources":["../../node_modules/uppercamelcase/node_modules/camelcase/index.js","../../node_modules/uppercamelcase/index.js","../../src/components/MadeWith/index.jsx"],"sourcesContent":["'use strict';\n\nfunction preserveCamelCase(str) {\n\tlet isLastCharLower = false;\n\tlet isLastCharUpper = false;\n\tlet isLastLastCharUpper = false;\n\n\tfor (let i = 0; i < str.length; i++) {\n\t\tconst c = str[i];\n\n\t\tif (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) {\n\t\t\tstr = str.substr(0, i) + '-' + str.substr(i);\n\t\t\tisLastCharLower = false;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = true;\n\t\t\ti++;\n\t\t} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) {\n\t\t\tstr = str.substr(0, i - 1) + '-' + str.substr(i - 1);\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = false;\n\t\t\tisLastCharLower = true;\n\t\t} else {\n\t\t\tisLastCharLower = c.toLowerCase() === c;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = c.toUpperCase() === c;\n\t\t}\n\t}\n\n\treturn str;\n}\n\nmodule.exports = function (str) {\n\tif (arguments.length > 1) {\n\t\tstr = Array.from(arguments)\n\t\t\t.map(x => x.trim())\n\t\t\t.filter(x => x.length)\n\t\t\t.join('-');\n\t} else {\n\t\tstr = str.trim();\n\t}\n\n\tif (str.length === 0) {\n\t\treturn '';\n\t}\n\n\tif (str.length === 1) {\n\t\treturn str.toLowerCase();\n\t}\n\n\tif (/^[a-z0-9]+$/.test(str)) {\n\t\treturn str;\n\t}\n\n\tconst hasUpperCase = str !== str.toLowerCase();\n\n\tif (hasUpperCase) {\n\t\tstr = preserveCamelCase(str);\n\t}\n\n\treturn str\n\t\t.replace(/^[_.\\- ]+/, '')\n\t\t.toLowerCase()\n\t\t.replace(/[_.\\- ]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n};\n","'use strict';\nconst camelCase = require('camelcase');\n\nmodule.exports = function () {\n\tconst cased = camelCase.apply(camelCase, arguments);\n\treturn cased.charAt(0).toUpperCase() + cased.slice(1);\n};\n","import { memo } from \"react\";\n\nimport { capitalize } from \"neetocist\";\nimport * as Icons from \"neetoicons/logos\";\nimport { Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { Trans } from \"react-i18next\";\nimport uppercamelcase from \"uppercamelcase\";\n\nimport \"./made-with.scss\";\n\nconst MadeWith = ({ productName, productIcon: ProductIcon, ...otherProps }) => {\n const name = capitalize(productName || globalProps.appName || \"Neeto\");\n const subdomain = globalProps.organization?.subdomain;\n const utmParams = `utm_source=madewith${\n subdomain ? `&utm_campaign=${subdomain}` : \"\"\n }`;\n\n const IconComponent = ProductIcon || Icons[uppercamelcase(name)];\n\n return (\n <a\n className=\"neeto-molecules-made-with__wrapper\"\n data-testid={`made-with-${name.toLowerCase()}`}\n href={`https://www.neeto.com/${name.toLowerCase()}?${utmParams}`}\n rel=\"noreferrer\"\n target=\"_blank\"\n {...otherProps}\n >\n {IconComponent && (\n <span data-testid={`made-with-${name.toLowerCase()}-icon`}>\n <IconComponent size={14} />\n </span>\n )}\n <Typography className=\"leading-snug\" style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.common.madeWith\"\n values={{ productName: name }}\n />\n </Typography>\n </a>\n );\n};\n\nMadeWith.propTypes = {\n /**\n * Product name to be displayed on the component (optional).\n */\n productName: PropTypes.string,\n\n /**\n * Product icon component to be displayed on the badge (optional).\n */\n productIcon: PropTypes.elementType,\n};\n\nexport default memo(MadeWith);\n"],"names":["require$$0","MadeWith","_ref","_globalProps$organiza","productName","ProductIcon","productIcon","otherProps","_objectWithoutProperties","_excluded","name","capitalize","globalProps","appName","subdomain","organization","utmParams","concat","IconComponent","Icons","
|
|
1
|
+
{"version":3,"file":"MadeWith.js","sources":["../../node_modules/uppercamelcase/node_modules/camelcase/index.js","../../node_modules/uppercamelcase/index.js","../../src/components/MadeWith/index.jsx"],"sourcesContent":["'use strict';\n\nfunction preserveCamelCase(str) {\n\tlet isLastCharLower = false;\n\tlet isLastCharUpper = false;\n\tlet isLastLastCharUpper = false;\n\n\tfor (let i = 0; i < str.length; i++) {\n\t\tconst c = str[i];\n\n\t\tif (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) {\n\t\t\tstr = str.substr(0, i) + '-' + str.substr(i);\n\t\t\tisLastCharLower = false;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = true;\n\t\t\ti++;\n\t\t} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) {\n\t\t\tstr = str.substr(0, i - 1) + '-' + str.substr(i - 1);\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = false;\n\t\t\tisLastCharLower = true;\n\t\t} else {\n\t\t\tisLastCharLower = c.toLowerCase() === c;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = c.toUpperCase() === c;\n\t\t}\n\t}\n\n\treturn str;\n}\n\nmodule.exports = function (str) {\n\tif (arguments.length > 1) {\n\t\tstr = Array.from(arguments)\n\t\t\t.map(x => x.trim())\n\t\t\t.filter(x => x.length)\n\t\t\t.join('-');\n\t} else {\n\t\tstr = str.trim();\n\t}\n\n\tif (str.length === 0) {\n\t\treturn '';\n\t}\n\n\tif (str.length === 1) {\n\t\treturn str.toLowerCase();\n\t}\n\n\tif (/^[a-z0-9]+$/.test(str)) {\n\t\treturn str;\n\t}\n\n\tconst hasUpperCase = str !== str.toLowerCase();\n\n\tif (hasUpperCase) {\n\t\tstr = preserveCamelCase(str);\n\t}\n\n\treturn str\n\t\t.replace(/^[_.\\- ]+/, '')\n\t\t.toLowerCase()\n\t\t.replace(/[_.\\- ]+(\\w|$)/g, (m, p1) => p1.toUpperCase());\n};\n","'use strict';\nconst camelCase = require('camelcase');\n\nmodule.exports = function () {\n\tconst cased = camelCase.apply(camelCase, arguments);\n\treturn cased.charAt(0).toUpperCase() + cased.slice(1);\n};\n","import { memo } from \"react\";\n\nimport { capitalize } from \"neetocist\";\nimport * as Icons from \"neetoicons/logos\";\nimport { Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { Trans } from \"react-i18next\";\nimport uppercamelcase from \"uppercamelcase\";\n\nimport \"./made-with.scss\";\n\nconst MadeWith = ({ productName, productIcon: ProductIcon, ...otherProps }) => {\n const name = capitalize(productName || globalProps.appName || \"Neeto\");\n const subdomain = globalProps.organization?.subdomain;\n const utmParams = `utm_source=madewith${\n subdomain ? `&utm_campaign=${subdomain}` : \"\"\n }`;\n\n const IconComponent = ProductIcon || Icons[uppercamelcase(name)];\n\n return (\n <a\n className=\"neeto-molecules-made-with__wrapper\"\n data-testid={`made-with-${name.toLowerCase()}`}\n href={`https://www.neeto.com/${name.toLowerCase()}?${utmParams}`}\n rel=\"noreferrer\"\n target=\"_blank\"\n {...otherProps}\n >\n {IconComponent && (\n <span data-testid={`made-with-${name.toLowerCase()}-icon`}>\n <IconComponent size={14} />\n </span>\n )}\n <Typography className=\"leading-snug\" style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.common.madeWith\"\n values={{ productName: name }}\n />\n </Typography>\n </a>\n );\n};\n\nMadeWith.propTypes = {\n /**\n * Product name to be displayed on the component (optional).\n */\n productName: PropTypes.string,\n\n /**\n * Product icon component to be displayed on the badge (optional).\n */\n productIcon: PropTypes.elementType,\n};\n\nexport default memo(MadeWith);\n"],"names":["require$$0","uppercamelcase","MadeWith","_ref","_globalProps$organiza","productName","ProductIcon","productIcon","otherProps","_objectWithoutProperties","_excluded","name","capitalize","globalProps","appName","subdomain","organization","utmParams","concat","IconComponent","Icons","_jsxs","_objectSpread","className","toLowerCase","href","rel","target","children","_jsx","size","Typography","style","Trans","i18nKey","values","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,iBAAiB,CAAC,GAAG,EAAE;AAChC,CAAC,IAAI,eAAe,GAAG,KAAK;AAC5B,CAAC,IAAI,eAAe,GAAG,KAAK;AAC5B,CAAC,IAAI,mBAAmB,GAAG,KAAK;;AAEhC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACtC,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;;AAElB,EAAE,IAAI,eAAe,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;AACtE,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/C,GAAG,eAAe,GAAG,KAAK;AAC1B,GAAG,mBAAmB,GAAG,eAAe;AACxC,GAAG,eAAe,GAAG,IAAI;AACzB,GAAG,CAAC,EAAE;AACN,EAAA,CAAG,MAAM,IAAI,eAAe,IAAI,mBAAmB,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;AACpG,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC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ACEU,eAAA,CAAA,GAAA,EAAAC,aAAA,CAAAA,aAAA,CAAA;AACEC,IAAAA,SAAS,EAAC,oCAAoC;AAC9C,IAAA,aAAA,EAAA,YAAA,CAAAL,MAAA,CAA0BP,IAAI,CAACa,WAAW,EAAE,CAAG;AAC/CC,IAAAA,IAAI,EAAA,wBAAA,CAAAP,MAAA,CAA2BP,IAAI,CAACa,WAAW,EAAE,EAAA,GAAA,CAAA,CAAAN,MAAA,CAAID,SAAS,CAAG;AACjES,IAAAA,GAAG,EAAC,YAAY;AAChBC,IAAAA,MAAM,EAAC;AAAQ,GAAA,EACXnB,UAAU,CAAA,EAAA,EAAA,EAAA;IAAAoB,QAAA,EAAA,CAEbT,aAAa,iBACZU,cAAA,CAAA,MAAA,EAAA;AAAM,MAAA,aAAA,EAAA,YAAA,CAAAX,MAAA,CAA0BP,IAAI,CAACa,WAAW,EAAE,EAAA,OAAA,CAAQ;MAAAI,QAAA,eACxDC,cAAA,CAACV,aAAa,EAAA;AAACW,QAAAA,IAAI,EAAE;OAAK;AAAC,KACvB,CACP,eACDD,cAAA,CAACE,UAAU,EAAA;AAACR,MAAAA,SAAS,EAAC,cAAc;AAACS,MAAAA,KAAK,EAAC,OAAO;MAAAJ,QAAA,eAChDC,cAAA,CAACI,kBAAK,EAAA;AACJC,QAAAA,OAAO,EAAC,gCAAgC;AACxCC,QAAAA,MAAM,EAAE;AAAE9B,UAAAA,WAAW,EAAEM;AAAK;OAC7B;AAAC,KACQ,CAAC;AAAA,GAAA,CACZ,CAAC;AAER,CAAC;AAcD,YAAA,aAAeyB,UAAI,CAAClC,QAAQ,CAAC;;;;","x_google_ignoreList":[0,1]}
|
package/dist/cjs/NeetoWidget.js
CHANGED
|
@@ -2141,7 +2141,7 @@ var Prism = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(prismExports);
|
|
|
2141
2141
|
var css = "code[class*=language-],pre[class*=language-]{word-wrap:normal;background:none;color:#ccc;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;-webkit-hyphens:none;hyphens:none;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-align:left;white-space:pre;word-break:normal;word-spacing:normal}pre[class*=language-]{margin:.5em 0;overflow:auto;padding:1em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{border-radius:.3em;padding:.1em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}";
|
|
2142
2142
|
injectCss.n(css,{});
|
|
2143
2143
|
|
|
2144
|
-
var SyntaxHighlighter = function SyntaxHighlighter(_ref) {
|
|
2144
|
+
var SyntaxHighlighter$1 = function SyntaxHighlighter(_ref) {
|
|
2145
2145
|
var className = _ref.className,
|
|
2146
2146
|
code = _ref.code,
|
|
2147
2147
|
language = _ref.language;
|
|
@@ -2156,7 +2156,7 @@ var SyntaxHighlighter = function SyntaxHighlighter(_ref) {
|
|
|
2156
2156
|
})
|
|
2157
2157
|
});
|
|
2158
2158
|
};
|
|
2159
|
-
var SyntaxHighlighter
|
|
2159
|
+
var SyntaxHighlighter = /*#__PURE__*/React.memo(SyntaxHighlighter$1);
|
|
2160
2160
|
|
|
2161
2161
|
var CodeBlock = function CodeBlock(_ref) {
|
|
2162
2162
|
var _ref$title = _ref.title,
|
|
@@ -2212,7 +2212,7 @@ var CodeBlock = function CodeBlock(_ref) {
|
|
|
2212
2212
|
tooltipProps: {
|
|
2213
2213
|
content: t("neetoMolecules.widget.installation.snippet.copy")
|
|
2214
2214
|
}
|
|
2215
|
-
}), /*#__PURE__*/jsxRuntime.jsx(SyntaxHighlighter
|
|
2215
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SyntaxHighlighter, {
|
|
2216
2216
|
className: "neeto-ui-bg-gray-800 neeto-ui-rounded-lg m-0 rounded-t-none pt-4",
|
|
2217
2217
|
code: codeString,
|
|
2218
2218
|
language: "javascript"
|
|
@@ -2507,7 +2507,7 @@ withT(function (_ref) {
|
|
|
2507
2507
|
|
|
2508
2508
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2509
2509
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2510
|
-
var EmbedCode = function EmbedCode(_ref) {
|
|
2510
|
+
var EmbedCode$1 = function EmbedCode(_ref) {
|
|
2511
2511
|
var showSessionContext = _ref.showSessionContext,
|
|
2512
2512
|
showUserIdentity = _ref.showUserIdentity,
|
|
2513
2513
|
_ref$primaryApp = _ref.primaryApp,
|
|
@@ -2794,7 +2794,7 @@ var EmbedCode = function EmbedCode(_ref) {
|
|
|
2794
2794
|
}, _getSnippetProps(emailType)))]
|
|
2795
2795
|
});
|
|
2796
2796
|
};
|
|
2797
|
-
var EmbedCode
|
|
2797
|
+
var EmbedCode = /*#__PURE__*/React.memo(EmbedCode$1);
|
|
2798
2798
|
|
|
2799
2799
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2800
2800
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -2805,7 +2805,7 @@ var Main = function Main(props) {
|
|
|
2805
2805
|
var shouldRenderEmbedCode = window.globalProps.ssoEnabled;
|
|
2806
2806
|
return shouldRenderEmbedCode ? /*#__PURE__*/jsxRuntime.jsx(reactQuery.QueryClientProvider, {
|
|
2807
2807
|
client: queryClient,
|
|
2808
|
-
children: /*#__PURE__*/jsxRuntime.jsx(EmbedCode
|
|
2808
|
+
children: /*#__PURE__*/jsxRuntime.jsx(EmbedCode, _objectSpread({}, props))
|
|
2809
2809
|
}) : /*#__PURE__*/jsxRuntime.jsx(Callout, {
|
|
2810
2810
|
icon: Info,
|
|
2811
2811
|
style: "info",
|