@bigbinary/neeto-molecules 1.19.5 → 1.19.7

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 CHANGED
@@ -69,6 +69,7 @@ https://neeto-molecules.neeto.com/
69
69
  - [ShareViaEmail](./docs/components/ShareViaEmail.md)
70
70
  - [ShareViaLink](./docs/components/ShareViaLink.md)
71
71
  - [Sidebar](./docs/components/Sidebar.md)
72
+ - [StickyRibbonsContainer](./docs/components/StickyRibbonsContainer.md)
72
73
  - [SubHeader](./docs/components/SubHeader.md)
73
74
  - [SuffixedInput](./docs/components/SuffixedInput.md)
74
75
  - [TableWrapper](./docs/components/TableWrapper.md)
@@ -19,7 +19,7 @@ var DEFAULT_EDITOR_PROPS = {
19
19
  addons: []
20
20
  };
21
21
 
22
- var css = "@media screen and (max-width:768px){.neeto-molecules-document__wrapper{width:100%}}.neeto-molecules-document__wrapper .neeto-molecules-document__container{margin:0 auto;max-width:768px!important}.neeto-molecules-document__wrapper .neeto-molecules-document-editor__menubar{position:sticky;top:0;width:100%;z-index:20}.neeto-molecules-document__wrapper .neeto-molecules-document__title{margin:24px 0 0;width:100%}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input{padding:0!important}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{color:rgb(var(--neeto-ui-black));font-size:42px;font-weight:700;line-height:48px;max-height:none;resize:none}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::-moz-placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::placeholder{color:rgb(var(--neeto-ui-gray-300))}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{font-size:36px}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:12px auto}.neeto-molecules-document__wrapper .ProseMirror{max-height:none;overflow-y:hidden}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu{border:thin solid rgb(var(--neeto-ui-gray-200));border-left:none;border-right:none}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu button.neeto-editor-fixed-menu__item{padding:6px}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:868px;padding:0 8px}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{overflow-x:auto;padding:0 16px}}.neeto-molecules-document__wrapper .editor-content__wrapper{border:none!important;padding:12px 16px 0!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:12px auto 0;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .editor-content-attachments--no-attachments{display:none!important}.neeto-molecules-document__wrapper .neeto-editor-character-count{margin:0 auto;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.editor-content__wrapper.neeto-editor{padding:0 16px}.editor-content__wrapper.neeto-editor h1{font-size:var(--neeto-ui-text-h1);margin:2rem 0 .25rem}.editor-content__wrapper.neeto-editor h2{font-size:var(--neeto-ui-text-h2);margin:1.5rem 0 .25rem}.editor-content__wrapper.neeto-editor h3{font-size:var(--neeto-ui-text-h3);margin:1rem 0 .25rem}.editor-content__wrapper.neeto-editor h4{font-size:var(--neeto-ui-text-h4);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h5{font-size:var(--neeto-ui-text-h5);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h6{font-size:var(--neeto-ui-text-h6);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h1,.editor-content__wrapper.neeto-editor h2,.editor-content__wrapper.neeto-editor h3,.editor-content__wrapper.neeto-editor h4,.editor-content__wrapper.neeto-editor h5,.editor-content__wrapper.neeto-editor h6{font-weight:var(--neeto-ui-font-semibold)}.editor-content__wrapper.neeto-editor p{font-size:var(--neeto-ui-text-body1);line-height:var(--neeto-ui-leading-normal)}.editor-content__wrapper.neeto-editor ol,.editor-content__wrapper.neeto-editor ul{margin-bottom:1rem;padding-left:24px}.editor-content__wrapper.neeto-editor ol li,.editor-content__wrapper.neeto-editor ul li{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor ol li p,.editor-content__wrapper.neeto-editor ul li p{margin-bottom:0}.editor-content__wrapper.neeto-editor ol li:last-child,.editor-content__wrapper.neeto-editor ul li:last-child{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor .neeto-editor-table{margin:8px 0 0}.editor-content__wrapper.neeto-editor .neeto-editor-table table{border-radius:0}.editor-content__wrapper.neeto-editor .neeto-editor-table p{margin-bottom:0}.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-row{visibility:hidden}.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-row{visibility:visible}ins{background-color:#c1f4cb!important;text-decoration:none!important}del{background-color:#faa!important}";
22
+ var css = "@media screen and (max-width:768px){.neeto-molecules-document__wrapper{width:100%}}.neeto-molecules-document__wrapper .neeto-molecules-document__container{margin:0 auto;max-width:768px!important}.neeto-molecules-document__wrapper .neeto-molecules-document-editor__menubar{position:sticky;top:0;width:100%;z-index:20}.neeto-molecules-document__wrapper .neeto-molecules-document__title{margin:24px 0 0;width:100%}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input{padding:0!important}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{color:rgb(var(--neeto-ui-black));font-size:42px;font-weight:700;line-height:48px;max-height:none;resize:none}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::-moz-placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::placeholder{color:rgb(var(--neeto-ui-gray-300))}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{font-size:36px}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:12px auto}.neeto-molecules-document__wrapper .ProseMirror{max-height:none;overflow-y:hidden}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu{border:thin solid rgb(var(--neeto-ui-gray-200));border-left:none;border-right:none}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu button.neeto-editor-fixed-menu__item{padding:6px}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:868px}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{overflow-x:auto}}.neeto-molecules-document__wrapper .editor-content__wrapper{border:none!important;padding:12px 16px 0!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:12px auto 0;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .editor-content-attachments--no-attachments{display:none!important}.neeto-molecules-document__wrapper .neeto-editor-character-count{margin:0 auto;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.editor-content__wrapper.neeto-editor{padding:0 16px}.editor-content__wrapper.neeto-editor h1{font-size:var(--neeto-ui-text-h1);margin:2rem 0 .25rem}.editor-content__wrapper.neeto-editor h2{font-size:var(--neeto-ui-text-h2);margin:1.5rem 0 .25rem}.editor-content__wrapper.neeto-editor h3{font-size:var(--neeto-ui-text-h3);margin:1rem 0 .25rem}.editor-content__wrapper.neeto-editor h4{font-size:var(--neeto-ui-text-h4);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h5{font-size:var(--neeto-ui-text-h5);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h6{font-size:var(--neeto-ui-text-h6);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h1,.editor-content__wrapper.neeto-editor h2,.editor-content__wrapper.neeto-editor h3,.editor-content__wrapper.neeto-editor h4,.editor-content__wrapper.neeto-editor h5,.editor-content__wrapper.neeto-editor h6{font-weight:var(--neeto-ui-font-semibold)}.editor-content__wrapper.neeto-editor p{font-size:var(--neeto-ui-text-body1);line-height:var(--neeto-ui-leading-normal)}.editor-content__wrapper.neeto-editor ol,.editor-content__wrapper.neeto-editor ul{margin-bottom:1rem;padding-left:24px}.editor-content__wrapper.neeto-editor ol li,.editor-content__wrapper.neeto-editor ul li{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor ol li p,.editor-content__wrapper.neeto-editor ul li p{margin-bottom:0}.editor-content__wrapper.neeto-editor ol li:last-child,.editor-content__wrapper.neeto-editor ul li:last-child{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor .neeto-editor-table{margin:8px 0 0}.editor-content__wrapper.neeto-editor .neeto-editor-table table{border-radius:0}.editor-content__wrapper.neeto-editor .neeto-editor-table p{margin-bottom:0}.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-row{visibility:hidden}.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-row{visibility:visible}ins{background-color:#c1f4cb!important;text-decoration:none!important}del{background-color:#faa!important}";
23
23
  n(css,{});
24
24
 
25
25
  var useEditor = function useEditor(_ref) {
@@ -1,4 +1,5 @@
1
- import React__default, { useMemo } from 'react';
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import React__default, { useMemo, useState } from 'react';
2
3
  import classnames from 'classnames';
3
4
  import { noop } from '@bigbinary/neeto-cist';
4
5
  import { Typography, Button, Stepper } from '@bigbinary/neetoui';
@@ -42,7 +43,7 @@ var CompletedScreen = withT(function (_ref) {
42
43
  }, completeButtonProps)));
43
44
  });
44
45
 
45
- var css = ".neeto-molecules-onboarding__wrapper{align-items:center;display:flex;flex-direction:column;flex-grow:1;height:100vh;overflow-y:auto;padding:15vh 32px 32px;width:100%}.neeto-molecules-onboarding__container{display:flex;flex-direction:column;height:100vh;overflow-y:auto;position:relative;width:100%}.neeto-molecules-onboarding__stepper-wrapper{background-color:rgb(var(--neeto-ui-white));border-bottom:1px solid rgb(var(--neeto-ui-gray-200));display:flex;flex-shrink:0;padding:8px 16px;width:100%}@media (min-width:1024px){.neeto-molecules-onboarding__stepper-wrapper{justify-content:center}}.neeto-molecules-onboarding__content{flex-grow:1;min-height:0;overflow-y:auto;width:100%}";
46
+ var css = ".neeto-molecules-onboarding__wrapper{align-items:center;display:flex;flex-direction:column;flex-grow:1;height:100vh;overflow-y:auto;padding:15vh 32px 32px;width:100%}.neeto-molecules-onboarding__container{display:flex;flex-direction:column;height:100vh;overflow-y:auto;position:relative;width:100%}.neeto-molecules-onboarding__stepper-wrapper{background-color:rgb(var(--neeto-ui-white));border-bottom:1px solid rgb(var(--neeto-ui-gray-200));display:flex;flex-shrink:0;padding:8px 16px;width:100%}@media (min-width:1024px){.neeto-molecules-onboarding__stepper-wrapper{justify-content:center}}.neeto-molecules-onboarding__content{flex-grow:1;min-height:0;overflow-y:auto;width:100%}.neeto-molecules-onboarding__content--forward{animation:slideInRight .4s ease backwards}.neeto-molecules-onboarding__content--backward{animation:slideInLeft .4s ease backwards}@keyframes slideInRight{0%{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}@keyframes slideInLeft{0%{opacity:0;transform:translateX(-100%)}to{opacity:1;transform:translateX(0)}}";
46
47
  n(css,{});
47
48
 
48
49
  var HelpScreen = function HelpScreen(_ref) {
@@ -141,7 +142,6 @@ var WelcomeScreen = withT(function (_ref) {
141
142
  });
142
143
 
143
144
  var Onboarding = function Onboarding(_ref) {
144
- var _steps;
145
145
  var _ref$currentStep = _ref.currentStep,
146
146
  currentStep = _ref$currentStep === void 0 ? 0 : _ref$currentStep,
147
147
  _ref$setCurrentStep = _ref.setCurrentStep,
@@ -151,10 +151,16 @@ var Onboarding = function Onboarding(_ref) {
151
151
  _ref$completeButtonPr = _ref.completeButtonProps,
152
152
  completeButtonProps = _ref$completeButtonPr === void 0 ? {} : _ref$completeButtonPr,
153
153
  _ref$helpScreenClassN = _ref.helpScreenClassName,
154
- helpScreenClassName = _ref$helpScreenClassN === void 0 ? "" : _ref$helpScreenClassN;
154
+ helpScreenClassName = _ref$helpScreenClassN === void 0 ? "" : _ref$helpScreenClassN,
155
+ _ref$isAnimated = _ref.isAnimated,
156
+ isAnimated = _ref$isAnimated === void 0 ? true : _ref$isAnimated;
155
157
  var steps = useMemo(function () {
156
158
  return createSteps(onboardingSteps, setCurrentStep, currentStep, helpScreenClassName);
157
159
  }, [onboardingSteps]);
160
+ var _useState = useState(""),
161
+ _useState2 = _slicedToArray(_useState, 2),
162
+ direction = _useState2[0],
163
+ setDirection = _useState2[1];
158
164
  if (currentStep === 0) {
159
165
  return /*#__PURE__*/React__default.createElement(WelcomeScreen, {
160
166
  currentStep: currentStep,
@@ -167,7 +173,9 @@ var Onboarding = function Onboarding(_ref) {
167
173
  });
168
174
  }
169
175
  var handleStepChange = function handleStepChange(index) {
170
- return setCurrentStep(index + 1);
176
+ var nextStep = index + 1;
177
+ setDirection(currentStep > nextStep ? "backward" : "forward");
178
+ setCurrentStep(nextStep);
171
179
  };
172
180
  var isStepperVisible = steps.length > 1;
173
181
  return /*#__PURE__*/React__default.createElement("div", {
@@ -180,9 +188,16 @@ var Onboarding = function Onboarding(_ref) {
180
188
  steps: steps,
181
189
  activeIndex: currentStep - 1,
182
190
  setActiveIndex: handleStepChange
183
- })), /*#__PURE__*/React__default.createElement("div", {
184
- className: "neeto-molecules-onboarding__content"
185
- }, (_steps = steps[currentStep - 1]) === null || _steps === void 0 ? void 0 : _steps.element));
191
+ })), steps.map(function (step, index) {
192
+ return /*#__PURE__*/React__default.createElement("div", {
193
+ key: index,
194
+ className: classnames("neeto-molecules-onboarding__content", {
195
+ "neeto-molecules-onboarding__content--forward overflow-x-hidden": isAnimated && direction === "forward",
196
+ "neeto-molecules-onboarding__content--backward overflow-x-hidden": isAnimated && direction === "backward",
197
+ hidden: currentStep - 1 !== index
198
+ })
199
+ }, step === null || step === void 0 ? void 0 : step.element);
200
+ }));
186
201
  };
187
202
 
188
203
  export { Onboarding as default };
@@ -1 +1 @@
1
- {"version":3,"file":"Onboarding.js","sources":["../src/components/Onboarding/CompletedScreen.jsx","../src/components/Onboarding/HelpScreen.jsx","../src/components/Onboarding/utils.jsx","../src/components/Onboarding/WelcomeScreen.jsx","../src/components/Onboarding/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\n\nconst CompletedScreen = withT(({ t, completeButtonProps }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {t(\"neetoMolecules.onboarding.readyToUse\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })}\n {...completeButtonProps}\n />\n </div>\n));\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst HelpScreen = ({ setCurrentStep, currentStep, helpScreenClassName }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div\n className={classNames(\n \"mx-auto w-full max-w-2xl space-y-6 p-4\",\n helpScreenClassName\n )}\n >\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n icon={RightArrow}\n iconPosition=\"right\"\n label={t(\"neetoMolecules.onboarding.helpScreen.continueButton\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n );\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\n\nimport HelpScreen from \"./HelpScreen\";\n\nexport const createSteps = (\n onboardingSteps,\n setCurrentStep,\n currentStep,\n helpScreenClassName\n) => {\n const helpStep = {\n label: t(\"neetoMolecules.onboarding.helpLabel\"),\n element: (\n <HelpScreen {...{ currentStep, helpScreenClassName, setCurrentStep }} />\n ),\n };\n\n return onboardingSteps\n .concat(helpStep)\n .map((step, idx) => ({ ...step, id: idx + 1 }));\n};\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\n\nconst WelcomeScreen = withT(({ t, setCurrentStep, currentStep }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.letUsCustomize\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n));\n\nexport default WelcomeScreen;\n","import React, { useMemo } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Stepper } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport CompletedScreen from \"./CompletedScreen\";\nimport \"./onboarding.scss\";\nimport { createSteps } from \"./utils\";\nimport WelcomeScreen from \"./WelcomeScreen\";\n\nconst Onboarding = ({\n currentStep = 0,\n setCurrentStep = noop,\n onboardingSteps = [],\n completeButtonProps = {},\n helpScreenClassName = \"\",\n}) => {\n const steps = useMemo(\n () =>\n createSteps(\n onboardingSteps,\n setCurrentStep,\n currentStep,\n helpScreenClassName\n ),\n [onboardingSteps]\n );\n\n if (currentStep === 0) {\n return <WelcomeScreen {...{ currentStep, setCurrentStep }} />;\n }\n\n if (currentStep === steps.length + 1) {\n return <CompletedScreen {...{ completeButtonProps }} />;\n }\n\n const handleStepChange = index => setCurrentStep(index + 1);\n\n const isStepperVisible = steps.length > 1;\n\n return (\n <div\n className={classNames(\"neeto-molecules-onboarding__container\", {\n \"neeto-molecules-onboarding__wrapper\": !isStepperVisible,\n })}\n >\n {isStepperVisible && (\n <div className=\"neeto-molecules-onboarding__stepper-wrapper\">\n <Stepper\n {...{ steps }}\n activeIndex={currentStep - 1}\n setActiveIndex={handleStepChange}\n />\n </div>\n )}\n <div className=\"neeto-molecules-onboarding__content\">\n {steps[currentStep - 1]?.element}\n </div>\n </div>\n );\n};\n\nOnboarding.propTypes = {\n /**\n * To specify the current step of the onboarding\n */\n currentStep: PropTypes.number,\n /**\n * List of Custom components for the onboarding\n */\n onboardingSteps: PropTypes.array,\n /**\n * Props for the complete button\n */\n completeButtonProps: PropTypes.object,\n /**\n * To set the step of the onboarding\n */\n setCurrentStep: PropTypes.func,\n /**\n * To pass additional classes to the help screen\n */\n helpScreenClassName: PropTypes.string,\n};\n\nexport default Onboarding;\n"],"names":["CompletedScreen","withT","_ref","t","completeButtonProps","React","createElement","className","Typography","style","appName","globalProps","Button","_extends","label","HelpScreen","setCurrentStep","currentStep","helpScreenClassName","_useTranslation","useTranslation","_useBreakpoints","useBreakpoints","isSize","classNames","component","lineHeight","alt","src","icon","RightArrow","iconPosition","onClick","createSteps","onboardingSteps","helpStep","element","concat","map","step","idx","_objectSpread","id","WelcomeScreen","Onboarding","_steps","_ref$currentStep","_ref$setCurrentStep","noop","_ref$onboardingSteps","_ref$completeButtonPr","_ref$helpScreenClassN","steps","useMemo","length","handleStepChange","index","isStepperVisible","Stepper","activeIndex","setActiveIndex"],"mappings":";;;;;;;;;;;;;;AAMA,IAAMA,eAAe,GAAGC,KAAK,CAAC,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,mBAAmB,GAAAF,IAAA,CAAnBE,mBAAmB,CAAA;EAAA,oBACrDC,cAAA,CAA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,IAAA,oBAAOjD,cAAA,CAAAC,aAAA,CAACN,eAAe,EAAA;AAAOI,MAAAA,mBAAmB,EAAnBA,mBAAAA;AAAmB,KAAK,CAAC,CAAA;AACzD,GAAA;AAEA,EAAA,IAAMmD,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAGC,KAAK,EAAA;AAAA,IAAA,OAAIxC,cAAc,CAACwC,KAAK,GAAG,CAAC,CAAC,CAAA;AAAA,GAAA,CAAA;AAE3D,EAAA,IAAMC,gBAAgB,GAAGL,KAAK,CAACE,MAAM,GAAG,CAAC,CAAA;EAEzC,oBACEjD,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAEiB,UAAU,CAAC,uCAAuC,EAAE;AAC7D,MAAA,qCAAqC,EAAE,CAACiC,gBAAAA;KACzC,CAAA;AAAE,GAAA,EAEFA,gBAAgB,iBACfpD,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,6CAAA;AAA6C,GAAA,eAC1DF,cAAA,CAAAC,aAAA,CAACoD,OAAO,EAAA;AACAN,IAAAA,KAAK,EAALA,KAAK;IACXO,WAAW,EAAE1C,WAAW,GAAG,CAAE;AAC7B2C,IAAAA,cAAc,EAAEL,gBAAAA;AAAiB,GAClC,CACE,CACN,eACDlD,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,qCAAA;AAAqC,GAAA,EAAA,CAAAsC,MAAA,GACjDO,KAAK,CAACnC,WAAW,GAAG,CAAC,CAAC,MAAA,IAAA,IAAA4B,MAAA,KAAtBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAA,CAAwBT,OACtB,CACF,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Onboarding.js","sources":["../src/components/Onboarding/CompletedScreen.jsx","../src/components/Onboarding/HelpScreen.jsx","../src/components/Onboarding/utils.jsx","../src/components/Onboarding/WelcomeScreen.jsx","../src/components/Onboarding/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\n\nconst CompletedScreen = withT(({ t, completeButtonProps }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {t(\"neetoMolecules.onboarding.readyToUse\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })}\n {...completeButtonProps}\n />\n </div>\n));\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst HelpScreen = ({ setCurrentStep, currentStep, helpScreenClassName }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div\n className={classNames(\n \"mx-auto w-full max-w-2xl space-y-6 p-4\",\n helpScreenClassName\n )}\n >\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n icon={RightArrow}\n iconPosition=\"right\"\n label={t(\"neetoMolecules.onboarding.helpScreen.continueButton\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n );\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\n\nimport HelpScreen from \"./HelpScreen\";\n\nexport const createSteps = (\n onboardingSteps,\n setCurrentStep,\n currentStep,\n helpScreenClassName\n) => {\n const helpStep = {\n label: t(\"neetoMolecules.onboarding.helpLabel\"),\n element: (\n <HelpScreen {...{ currentStep, helpScreenClassName, setCurrentStep }} />\n ),\n };\n\n return onboardingSteps\n .concat(helpStep)\n .map((step, idx) => ({ ...step, id: idx + 1 }));\n};\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\n\nconst WelcomeScreen = withT(({ t, setCurrentStep, currentStep }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.letUsCustomize\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n));\n\nexport default WelcomeScreen;\n","import React, { useMemo, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Stepper } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport CompletedScreen from \"./CompletedScreen\";\nimport \"./onboarding.scss\";\nimport { createSteps } from \"./utils\";\nimport WelcomeScreen from \"./WelcomeScreen\";\n\nconst Onboarding = ({\n currentStep = 0,\n setCurrentStep = noop,\n onboardingSteps = [],\n completeButtonProps = {},\n helpScreenClassName = \"\",\n isAnimated = true,\n}) => {\n const steps = useMemo(\n () =>\n createSteps(\n onboardingSteps,\n setCurrentStep,\n currentStep,\n helpScreenClassName\n ),\n [onboardingSteps]\n );\n const [direction, setDirection] = useState(\"\");\n\n if (currentStep === 0) {\n return <WelcomeScreen {...{ currentStep, setCurrentStep }} />;\n }\n\n if (currentStep === steps.length + 1) {\n return <CompletedScreen {...{ completeButtonProps }} />;\n }\n\n const handleStepChange = index => {\n const nextStep = index + 1;\n setDirection(currentStep > nextStep ? \"backward\" : \"forward\");\n setCurrentStep(nextStep);\n };\n\n const isStepperVisible = steps.length > 1;\n\n return (\n <div\n className={classNames(\"neeto-molecules-onboarding__container\", {\n \"neeto-molecules-onboarding__wrapper\": !isStepperVisible,\n })}\n >\n {isStepperVisible && (\n <div className=\"neeto-molecules-onboarding__stepper-wrapper\">\n <Stepper\n {...{ steps }}\n activeIndex={currentStep - 1}\n setActiveIndex={handleStepChange}\n />\n </div>\n )}\n {steps.map((step, index) => (\n <div\n key={index}\n className={classNames(\"neeto-molecules-onboarding__content\", {\n \"neeto-molecules-onboarding__content--forward overflow-x-hidden\":\n isAnimated && direction === \"forward\",\n \"neeto-molecules-onboarding__content--backward overflow-x-hidden\":\n isAnimated && direction === \"backward\",\n hidden: currentStep - 1 !== index,\n })}\n >\n {step?.element}\n </div>\n ))}\n </div>\n );\n};\n\nOnboarding.propTypes = {\n /**\n * To specify the current step of the onboarding\n */\n currentStep: PropTypes.number,\n /**\n * List of Custom components for the onboarding\n */\n onboardingSteps: PropTypes.array,\n /**\n * Props for the complete button\n */\n completeButtonProps: PropTypes.object,\n /**\n * To set the step of the onboarding\n */\n setCurrentStep: PropTypes.func,\n /**\n * To pass additional classes to the help screen\n */\n helpScreenClassName: PropTypes.string,\n /**\n * A boolean value to enable or disable the animation for the stepper.\n */\n isAnimated: PropTypes.bool,\n};\n\nexport default Onboarding;\n"],"names":["CompletedScreen","withT","_ref","t","completeButtonProps","React","createElement","className","Typography","style","appName","globalProps","Button","_extends","label","HelpScreen","setCurrentStep","currentStep","helpScreenClassName","_useTranslation","useTranslation","_useBreakpoints","useBreakpoints","isSize","classNames","component","lineHeight","alt","src","icon","RightArrow","iconPosition","onClick","createSteps","onboardingSteps","helpStep","element","concat","map","step","idx","_objectSpread","id","WelcomeScreen","Onboarding","_ref$currentStep","_ref$setCurrentStep","noop","_ref$onboardingSteps","_ref$completeButtonPr","_ref$helpScreenClassN","_ref$isAnimated","isAnimated","steps","useMemo","_useState","useState","_useState2","_slicedToArray","direction","setDirection","length","handleStepChange","index","nextStep","isStepperVisible","Stepper","activeIndex","setActiveIndex","key","hidden"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAMA,eAAe,GAAGC,KAAK,CAAC,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,mBAAmB,GAAAF,IAAA,CAAnBE,mBA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AA,cAAc,EAAEN,gBAAAA;GACjB,CACE,CACN,EACAT,KAAK,CAACf,GAAG,CAAC,UAACC,IAAI,EAAEwB,KAAK,EAAA;IAAA,oBACrB1D,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE+D,MAAAA,GAAG,EAAEN,KAAM;AACXxD,MAAAA,SAAS,EAAEiB,UAAU,CAAC,qCAAqC,EAAE;AAC3D,QAAA,gEAAgE,EAC9D4B,UAAU,IAAIO,SAAS,KAAK,SAAS;AACvC,QAAA,iEAAiE,EAC/DP,UAAU,IAAIO,SAAS,KAAK,UAAU;AACxCW,QAAAA,MAAM,EAAErD,WAAW,GAAG,CAAC,KAAK8C,KAAAA;OAC7B,CAAA;AAAE,KAAA,EAEFxB,IAAI,KAAJA,IAAAA,IAAAA,IAAI,uBAAJA,IAAI,CAAEH,OACJ,CAAC,CAAA;AAAA,GACP,CACE,CAAC,CAAA;AAEV;;;;"}
@@ -0,0 +1,78 @@
1
+ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
+ import React__default from 'react';
4
+ import { useLocalStorage } from '@bigbinary/neeto-commons-frontend/react-utils';
5
+ import { EditorContent } from '@bigbinary/neeto-editor';
6
+ import { Tag } from '@bigbinary/neetoui';
7
+ import { pluck } from 'ramda';
8
+ import { n } from './inject-css-c86de496.js';
9
+ import { useQuery } from 'react-query';
10
+ import axios from 'axios';
11
+ import { BASE_API_V1_URL } from '@bigbinary/neeto-commons-frontend/constants';
12
+
13
+ var QUERY_KEYS = {
14
+ APP_STICKY_RIBBONS_LIST: "APP_STICKY_RIBBONS_LIST"
15
+ };
16
+ var STICKY_RIBBON_KIND_TO_STYLE = {
17
+ info: "info",
18
+ warning: "warning",
19
+ error: "danger"
20
+ };
21
+ var STICKY_RIBBONS_LOCAL_STORAGE_KEY = "dismissedStickyRibbons";
22
+
23
+ var css = ".neeto-molecules-sticky-ribbon{border-radius:0}";
24
+ n(css,{});
25
+
26
+ var fetchStickyRibbons = function fetchStickyRibbons() {
27
+ return axios.get("".concat(BASE_API_V1_URL, "/sticky_ribbons"));
28
+ };
29
+ var stickyRibbonsApi = {
30
+ fetchStickyRibbons: fetchStickyRibbons
31
+ };
32
+
33
+ var APP_STICKY_RIBBONS_LIST = QUERY_KEYS.APP_STICKY_RIBBONS_LIST;
34
+ var useFetchStickyRibbons = function useFetchStickyRibbons() {
35
+ return useQuery([APP_STICKY_RIBBONS_LIST], stickyRibbonsApi.fetchStickyRibbons);
36
+ };
37
+
38
+ var StickyRibbonsContainer = function StickyRibbonsContainer() {
39
+ var _useLocalStorage = useLocalStorage(STICKY_RIBBONS_LOCAL_STORAGE_KEY, []),
40
+ _useLocalStorage2 = _slicedToArray(_useLocalStorage, 2),
41
+ dismissedRibbons = _useLocalStorage2[0],
42
+ setDismissedRibbons = _useLocalStorage2[1];
43
+ var _useFetchStickyRibbon = useFetchStickyRibbons(),
44
+ _useFetchStickyRibbon2 = _useFetchStickyRibbon.data,
45
+ _useFetchStickyRibbon3 = _useFetchStickyRibbon2 === void 0 ? {} : _useFetchStickyRibbon2,
46
+ _useFetchStickyRibbon4 = _useFetchStickyRibbon3.stickyRibbons,
47
+ stickyRibbons = _useFetchStickyRibbon4 === void 0 ? [] : _useFetchStickyRibbon4;
48
+ var handleDismiss = function handleDismiss(ribbonId) {
49
+ var validRibbonIds = pluck("id", stickyRibbons);
50
+ var updatedDismissedRibbons = dismissedRibbons.filter(function (id) {
51
+ return validRibbonIds.includes(id);
52
+ });
53
+ setDismissedRibbons([].concat(_toConsumableArray(updatedDismissedRibbons), [ribbonId]));
54
+ };
55
+ var visibleRibbons = stickyRibbons.filter(function (ribbon) {
56
+ return !dismissedRibbons.includes(ribbon.id);
57
+ });
58
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, visibleRibbons.map(function (_ref) {
59
+ var id = _ref.id,
60
+ kind = _ref.kind,
61
+ message = _ref.message;
62
+ return /*#__PURE__*/React__default.createElement(Tag, {
63
+ className: "neeto-molecules-sticky-ribbon w-full p-2.5 text-center",
64
+ key: id,
65
+ size: "large",
66
+ style: STICKY_RIBBON_KIND_TO_STYLE[kind],
67
+ onClose: function onClose() {
68
+ return handleDismiss(id);
69
+ }
70
+ }, /*#__PURE__*/React__default.createElement(EditorContent, {
71
+ className: "w-full",
72
+ content: message
73
+ }));
74
+ }));
75
+ };
76
+
77
+ export { StickyRibbonsContainer as default };
78
+ //# sourceMappingURL=StickyRibbonsContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StickyRibbonsContainer.js","sources":["../src/components/StickyRibbonsContainer/constants.js","../src/components/StickyRibbonsContainer/api.js","../src/components/StickyRibbonsContainer/useStickyRibbonsApi.js","../src/components/StickyRibbonsContainer/index.jsx"],"sourcesContent":["export const QUERY_KEYS = {\n APP_STICKY_RIBBONS_LIST: \"APP_STICKY_RIBBONS_LIST\",\n};\n\nexport const STICKY_RIBBON_KIND_TO_STYLE = {\n info: \"info\",\n warning: \"warning\",\n error: \"danger\",\n};\n\nexport const STICKY_RIBBONS_LOCAL_STORAGE_KEY = \"dismissedStickyRibbons\";\n","import axios from \"axios\";\nimport { BASE_API_V1_URL } from \"neetocommons/constants\";\n\nconst fetchStickyRibbons = () => axios.get(`${BASE_API_V1_URL}/sticky_ribbons`);\n\nconst stickyRibbonsApi = { fetchStickyRibbons };\n\nexport default stickyRibbonsApi;\n","import { useQuery } from \"react-query\";\n\nimport stickyRibbonsApi from \"./api\";\nimport { QUERY_KEYS } from \"./constants\";\n\nconst { APP_STICKY_RIBBONS_LIST } = QUERY_KEYS;\n\nconst useFetchStickyRibbons = () =>\n useQuery([APP_STICKY_RIBBONS_LIST], stickyRibbonsApi.fetchStickyRibbons);\n\nexport { useFetchStickyRibbons };\n","import React from \"react\";\n\nimport { useLocalStorage } from \"neetocommons/react-utils\";\nimport { EditorContent } from \"neetoeditor\";\nimport { Tag } from \"neetoui\";\nimport { pluck } from \"ramda\";\n\nimport {\n STICKY_RIBBONS_LOCAL_STORAGE_KEY,\n STICKY_RIBBON_KIND_TO_STYLE,\n} from \"./constants\";\nimport \"./sticky-ribbons.scss\";\nimport { useFetchStickyRibbons } from \"./useStickyRibbonsApi\";\n\nconst StickyRibbonsContainer = () => {\n const [dismissedRibbons, setDismissedRibbons] = useLocalStorage(\n STICKY_RIBBONS_LOCAL_STORAGE_KEY,\n []\n );\n\n const { data: { stickyRibbons = [] } = {} } = useFetchStickyRibbons();\n\n const handleDismiss = ribbonId => {\n const validRibbonIds = pluck(\"id\", stickyRibbons);\n const updatedDismissedRibbons = dismissedRibbons.filter(id =>\n validRibbonIds.includes(id)\n );\n\n setDismissedRibbons([...updatedDismissedRibbons, ribbonId]);\n };\n\n const visibleRibbons = stickyRibbons.filter(\n ribbon => !dismissedRibbons.includes(ribbon.id)\n );\n\n return (\n <>\n {visibleRibbons.map(({ id, kind, message }) => (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n key={id}\n size=\"large\"\n style={STICKY_RIBBON_KIND_TO_STYLE[kind]}\n onClose={() => handleDismiss(id)}\n >\n <EditorContent className=\"w-full\" content={message} />\n </Tag>\n ))}\n </>\n );\n};\n\nexport default StickyRibbonsContainer;\n"],"names":["QUERY_KEYS","APP_STICKY_RIBBONS_LIST","STICKY_RIBBON_KIND_TO_STYLE","info","warning","error","STICKY_RIBBONS_LOCAL_STORAGE_KEY","fetchStickyRibbons","axios","get","concat","BASE_API_V1_URL","stickyRibbonsApi","useFetchStickyRibbons","useQuery","StickyRibbonsContainer","_useLocalStorage","useLocalStorage","_useLocalStorage2","_slicedToArray","dismissedRibbons","setDismissedRibbons","_useFetchStickyRibbon","_useFetchStickyRibbon2","data","_useFetchStickyRibbon3","_useFetchStickyRibbon4","stickyRibbons","handleDismiss","ribbonId","validRibbonIds","pluck","updatedDismissedRibbons","filter","id","includes","_toConsumableArray","visibleRibbons","ribbon","React","createElement","Fragment","map","_ref","kind","message","Tag","className","key","size","style","on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AAE;MACzCO,OAAO,EAAE,SAAAA,OAAA,GAAA;QAAA,OAAMvB,aAAa,CAACM,EAAE,CAAC,CAAA;AAAA,OAAA;AAAC,KAAA,eAEjCK,cAAA,CAAAC,aAAA,CAACY,aAAa,EAAA;AAACL,MAAAA,SAAS,EAAC,QAAQ;AAACM,MAAAA,OAAO,EAAER,OAAAA;AAAQ,KAAE,CAClD,CAAC,CAAA;AAAA,GACP,CACD,CAAC,CAAA;AAEP;;;;"}
@@ -30,7 +30,7 @@ var DEFAULT_EDITOR_PROPS = {
30
30
  addons: []
31
31
  };
32
32
 
33
- var css = "@media screen and (max-width:768px){.neeto-molecules-document__wrapper{width:100%}}.neeto-molecules-document__wrapper .neeto-molecules-document__container{margin:0 auto;max-width:768px!important}.neeto-molecules-document__wrapper .neeto-molecules-document-editor__menubar{position:sticky;top:0;width:100%;z-index:20}.neeto-molecules-document__wrapper .neeto-molecules-document__title{margin:24px 0 0;width:100%}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input{padding:0!important}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{color:rgb(var(--neeto-ui-black));font-size:42px;font-weight:700;line-height:48px;max-height:none;resize:none}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::-moz-placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::placeholder{color:rgb(var(--neeto-ui-gray-300))}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{font-size:36px}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:12px auto}.neeto-molecules-document__wrapper .ProseMirror{max-height:none;overflow-y:hidden}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu{border:thin solid rgb(var(--neeto-ui-gray-200));border-left:none;border-right:none}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu button.neeto-editor-fixed-menu__item{padding:6px}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:868px;padding:0 8px}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{overflow-x:auto;padding:0 16px}}.neeto-molecules-document__wrapper .editor-content__wrapper{border:none!important;padding:12px 16px 0!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:12px auto 0;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .editor-content-attachments--no-attachments{display:none!important}.neeto-molecules-document__wrapper .neeto-editor-character-count{margin:0 auto;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.editor-content__wrapper.neeto-editor{padding:0 16px}.editor-content__wrapper.neeto-editor h1{font-size:var(--neeto-ui-text-h1);margin:2rem 0 .25rem}.editor-content__wrapper.neeto-editor h2{font-size:var(--neeto-ui-text-h2);margin:1.5rem 0 .25rem}.editor-content__wrapper.neeto-editor h3{font-size:var(--neeto-ui-text-h3);margin:1rem 0 .25rem}.editor-content__wrapper.neeto-editor h4{font-size:var(--neeto-ui-text-h4);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h5{font-size:var(--neeto-ui-text-h5);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h6{font-size:var(--neeto-ui-text-h6);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h1,.editor-content__wrapper.neeto-editor h2,.editor-content__wrapper.neeto-editor h3,.editor-content__wrapper.neeto-editor h4,.editor-content__wrapper.neeto-editor h5,.editor-content__wrapper.neeto-editor h6{font-weight:var(--neeto-ui-font-semibold)}.editor-content__wrapper.neeto-editor p{font-size:var(--neeto-ui-text-body1);line-height:var(--neeto-ui-leading-normal)}.editor-content__wrapper.neeto-editor ol,.editor-content__wrapper.neeto-editor ul{margin-bottom:1rem;padding-left:24px}.editor-content__wrapper.neeto-editor ol li,.editor-content__wrapper.neeto-editor ul li{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor ol li p,.editor-content__wrapper.neeto-editor ul li p{margin-bottom:0}.editor-content__wrapper.neeto-editor ol li:last-child,.editor-content__wrapper.neeto-editor ul li:last-child{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor .neeto-editor-table{margin:8px 0 0}.editor-content__wrapper.neeto-editor .neeto-editor-table table{border-radius:0}.editor-content__wrapper.neeto-editor .neeto-editor-table p{margin-bottom:0}.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-row{visibility:hidden}.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-row{visibility:visible}ins{background-color:#c1f4cb!important;text-decoration:none!important}del{background-color:#faa!important}";
33
+ var css = "@media screen and (max-width:768px){.neeto-molecules-document__wrapper{width:100%}}.neeto-molecules-document__wrapper .neeto-molecules-document__container{margin:0 auto;max-width:768px!important}.neeto-molecules-document__wrapper .neeto-molecules-document-editor__menubar{position:sticky;top:0;width:100%;z-index:20}.neeto-molecules-document__wrapper .neeto-molecules-document__title{margin:24px 0 0;width:100%}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input{padding:0!important}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{color:rgb(var(--neeto-ui-black));font-size:42px;font-weight:700;line-height:48px;max-height:none;resize:none}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::-moz-placeholder{color:rgb(var(--neeto-ui-gray-300))}.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea::placeholder{color:rgb(var(--neeto-ui-gray-300))}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-molecules-document__title .neeto-ui-input textarea{font-size:36px}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:12px auto}.neeto-molecules-document__wrapper .ProseMirror{max-height:none;overflow-y:hidden}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu{border:thin solid rgb(var(--neeto-ui-gray-200));border-left:none;border-right:none}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu button.neeto-editor-fixed-menu__item{padding:6px}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:868px}@media screen and (max-width:768px){.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{overflow-x:auto}}.neeto-molecules-document__wrapper .editor-content__wrapper{border:none!important;padding:12px 16px 0!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:12px auto 0;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .editor-content-attachments--no-attachments{display:none!important}.neeto-molecules-document__wrapper .neeto-editor-character-count{margin:0 auto;max-width:768px!important;padding-left:16px;padding-right:16px}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.editor-content__wrapper.neeto-editor{padding:0 16px}.editor-content__wrapper.neeto-editor h1{font-size:var(--neeto-ui-text-h1);margin:2rem 0 .25rem}.editor-content__wrapper.neeto-editor h2{font-size:var(--neeto-ui-text-h2);margin:1.5rem 0 .25rem}.editor-content__wrapper.neeto-editor h3{font-size:var(--neeto-ui-text-h3);margin:1rem 0 .25rem}.editor-content__wrapper.neeto-editor h4{font-size:var(--neeto-ui-text-h4);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h5{font-size:var(--neeto-ui-text-h5);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h6{font-size:var(--neeto-ui-text-h6);margin:.75rem 0 .25rem}.editor-content__wrapper.neeto-editor h1,.editor-content__wrapper.neeto-editor h2,.editor-content__wrapper.neeto-editor h3,.editor-content__wrapper.neeto-editor h4,.editor-content__wrapper.neeto-editor h5,.editor-content__wrapper.neeto-editor h6{font-weight:var(--neeto-ui-font-semibold)}.editor-content__wrapper.neeto-editor p{font-size:var(--neeto-ui-text-body1);line-height:var(--neeto-ui-leading-normal)}.editor-content__wrapper.neeto-editor ol,.editor-content__wrapper.neeto-editor ul{margin-bottom:1rem;padding-left:24px}.editor-content__wrapper.neeto-editor ol li,.editor-content__wrapper.neeto-editor ul li{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor ol li p,.editor-content__wrapper.neeto-editor ul li p{margin-bottom:0}.editor-content__wrapper.neeto-editor ol li:last-child,.editor-content__wrapper.neeto-editor ul li:last-child{margin-bottom:.5rem}.editor-content__wrapper.neeto-editor .neeto-editor-table{margin:8px 0 0}.editor-content__wrapper.neeto-editor .neeto-editor-table table{border-radius:0}.editor-content__wrapper.neeto-editor .neeto-editor-table p{margin-bottom:0}.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table .neeto-editor-table__add-row{visibility:hidden}.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-column,.editor-content__wrapper.neeto-editor .neeto-editor-table:hover .neeto-editor-table__add-row{visibility:visible}ins{background-color:#c1f4cb!important;text-decoration:none!important}del{background-color:#faa!important}";
34
34
  injectCss.n(css,{});
35
35
 
36
36
  var useEditor = function useEditor(_ref) {
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
3
4
  var React = require('react');
4
5
  var classnames = require('classnames');
5
6
  var neetoCist = require('@bigbinary/neeto-cist');
@@ -16,6 +17,7 @@ var reactI18next = require('react-i18next');
16
17
 
17
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
19
 
20
+ var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
19
21
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
20
22
  var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
21
23
  var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
@@ -53,7 +55,7 @@ var CompletedScreen = withT__default["default"](function (_ref) {
53
55
  }, completeButtonProps)));
54
56
  });
55
57
 
56
- var css = ".neeto-molecules-onboarding__wrapper{align-items:center;display:flex;flex-direction:column;flex-grow:1;height:100vh;overflow-y:auto;padding:15vh 32px 32px;width:100%}.neeto-molecules-onboarding__container{display:flex;flex-direction:column;height:100vh;overflow-y:auto;position:relative;width:100%}.neeto-molecules-onboarding__stepper-wrapper{background-color:rgb(var(--neeto-ui-white));border-bottom:1px solid rgb(var(--neeto-ui-gray-200));display:flex;flex-shrink:0;padding:8px 16px;width:100%}@media (min-width:1024px){.neeto-molecules-onboarding__stepper-wrapper{justify-content:center}}.neeto-molecules-onboarding__content{flex-grow:1;min-height:0;overflow-y:auto;width:100%}";
58
+ var css = ".neeto-molecules-onboarding__wrapper{align-items:center;display:flex;flex-direction:column;flex-grow:1;height:100vh;overflow-y:auto;padding:15vh 32px 32px;width:100%}.neeto-molecules-onboarding__container{display:flex;flex-direction:column;height:100vh;overflow-y:auto;position:relative;width:100%}.neeto-molecules-onboarding__stepper-wrapper{background-color:rgb(var(--neeto-ui-white));border-bottom:1px solid rgb(var(--neeto-ui-gray-200));display:flex;flex-shrink:0;padding:8px 16px;width:100%}@media (min-width:1024px){.neeto-molecules-onboarding__stepper-wrapper{justify-content:center}}.neeto-molecules-onboarding__content{flex-grow:1;min-height:0;overflow-y:auto;width:100%}.neeto-molecules-onboarding__content--forward{animation:slideInRight .4s ease backwards}.neeto-molecules-onboarding__content--backward{animation:slideInLeft .4s ease backwards}@keyframes slideInRight{0%{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}@keyframes slideInLeft{0%{opacity:0;transform:translateX(-100%)}to{opacity:1;transform:translateX(0)}}";
57
59
  injectCss.n(css,{});
58
60
 
59
61
  var HelpScreen = function HelpScreen(_ref) {
@@ -152,7 +154,6 @@ var WelcomeScreen = withT__default["default"](function (_ref) {
152
154
  });
153
155
 
154
156
  var Onboarding = function Onboarding(_ref) {
155
- var _steps;
156
157
  var _ref$currentStep = _ref.currentStep,
157
158
  currentStep = _ref$currentStep === void 0 ? 0 : _ref$currentStep,
158
159
  _ref$setCurrentStep = _ref.setCurrentStep,
@@ -162,10 +163,16 @@ var Onboarding = function Onboarding(_ref) {
162
163
  _ref$completeButtonPr = _ref.completeButtonProps,
163
164
  completeButtonProps = _ref$completeButtonPr === void 0 ? {} : _ref$completeButtonPr,
164
165
  _ref$helpScreenClassN = _ref.helpScreenClassName,
165
- helpScreenClassName = _ref$helpScreenClassN === void 0 ? "" : _ref$helpScreenClassN;
166
+ helpScreenClassName = _ref$helpScreenClassN === void 0 ? "" : _ref$helpScreenClassN,
167
+ _ref$isAnimated = _ref.isAnimated,
168
+ isAnimated = _ref$isAnimated === void 0 ? true : _ref$isAnimated;
166
169
  var steps = React.useMemo(function () {
167
170
  return createSteps(onboardingSteps, setCurrentStep, currentStep, helpScreenClassName);
168
171
  }, [onboardingSteps]);
172
+ var _useState = React.useState(""),
173
+ _useState2 = _slicedToArray__default["default"](_useState, 2),
174
+ direction = _useState2[0],
175
+ setDirection = _useState2[1];
169
176
  if (currentStep === 0) {
170
177
  return /*#__PURE__*/React__default["default"].createElement(WelcomeScreen, {
171
178
  currentStep: currentStep,
@@ -178,7 +185,9 @@ var Onboarding = function Onboarding(_ref) {
178
185
  });
179
186
  }
180
187
  var handleStepChange = function handleStepChange(index) {
181
- return setCurrentStep(index + 1);
188
+ var nextStep = index + 1;
189
+ setDirection(currentStep > nextStep ? "backward" : "forward");
190
+ setCurrentStep(nextStep);
182
191
  };
183
192
  var isStepperVisible = steps.length > 1;
184
193
  return /*#__PURE__*/React__default["default"].createElement("div", {
@@ -191,9 +200,16 @@ var Onboarding = function Onboarding(_ref) {
191
200
  steps: steps,
192
201
  activeIndex: currentStep - 1,
193
202
  setActiveIndex: handleStepChange
194
- })), /*#__PURE__*/React__default["default"].createElement("div", {
195
- className: "neeto-molecules-onboarding__content"
196
- }, (_steps = steps[currentStep - 1]) === null || _steps === void 0 ? void 0 : _steps.element));
203
+ })), steps.map(function (step, index) {
204
+ return /*#__PURE__*/React__default["default"].createElement("div", {
205
+ key: index,
206
+ className: classnames__default["default"]("neeto-molecules-onboarding__content", {
207
+ "neeto-molecules-onboarding__content--forward overflow-x-hidden": isAnimated && direction === "forward",
208
+ "neeto-molecules-onboarding__content--backward overflow-x-hidden": isAnimated && direction === "backward",
209
+ hidden: currentStep - 1 !== index
210
+ })
211
+ }, step === null || step === void 0 ? void 0 : step.element);
212
+ }));
197
213
  };
198
214
 
199
215
  module.exports = Onboarding;
@@ -1 +1 @@
1
- {"version":3,"file":"Onboarding.js","sources":["../../src/components/Onboarding/CompletedScreen.jsx","../../src/components/Onboarding/HelpScreen.jsx","../../src/components/Onboarding/utils.jsx","../../src/components/Onboarding/WelcomeScreen.jsx","../../src/components/Onboarding/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\n\nconst CompletedScreen = withT(({ t, completeButtonProps }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {t(\"neetoMolecules.onboarding.readyToUse\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })}\n {...completeButtonProps}\n />\n </div>\n));\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst HelpScreen = ({ setCurrentStep, currentStep, helpScreenClassName }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div\n className={classNames(\n \"mx-auto w-full max-w-2xl space-y-6 p-4\",\n helpScreenClassName\n )}\n >\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n icon={RightArrow}\n iconPosition=\"right\"\n label={t(\"neetoMolecules.onboarding.helpScreen.continueButton\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n );\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\n\nimport HelpScreen from \"./HelpScreen\";\n\nexport const createSteps = (\n onboardingSteps,\n setCurrentStep,\n currentStep,\n helpScreenClassName\n) => {\n const helpStep = {\n label: t(\"neetoMolecules.onboarding.helpLabel\"),\n element: (\n <HelpScreen {...{ currentStep, helpScreenClassName, setCurrentStep }} />\n ),\n };\n\n return onboardingSteps\n .concat(helpStep)\n .map((step, idx) => ({ ...step, id: idx + 1 }));\n};\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\n\nconst WelcomeScreen = withT(({ t, setCurrentStep, currentStep }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.letUsCustomize\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n));\n\nexport default WelcomeScreen;\n","import React, { useMemo } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Stepper } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport CompletedScreen from \"./CompletedScreen\";\nimport \"./onboarding.scss\";\nimport { createSteps } from \"./utils\";\nimport WelcomeScreen from \"./WelcomeScreen\";\n\nconst Onboarding = ({\n currentStep = 0,\n setCurrentStep = noop,\n onboardingSteps = [],\n completeButtonProps = {},\n helpScreenClassName = \"\",\n}) => {\n const steps = useMemo(\n () =>\n createSteps(\n onboardingSteps,\n setCurrentStep,\n currentStep,\n helpScreenClassName\n ),\n [onboardingSteps]\n );\n\n if (currentStep === 0) {\n return <WelcomeScreen {...{ currentStep, setCurrentStep }} />;\n }\n\n if (currentStep === steps.length + 1) {\n return <CompletedScreen {...{ completeButtonProps }} />;\n }\n\n const handleStepChange = index => setCurrentStep(index + 1);\n\n const isStepperVisible = steps.length > 1;\n\n return (\n <div\n className={classNames(\"neeto-molecules-onboarding__container\", {\n \"neeto-molecules-onboarding__wrapper\": !isStepperVisible,\n })}\n >\n {isStepperVisible && (\n <div className=\"neeto-molecules-onboarding__stepper-wrapper\">\n <Stepper\n {...{ steps }}\n activeIndex={currentStep - 1}\n setActiveIndex={handleStepChange}\n />\n </div>\n )}\n <div className=\"neeto-molecules-onboarding__content\">\n {steps[currentStep - 1]?.element}\n </div>\n </div>\n );\n};\n\nOnboarding.propTypes = {\n /**\n * To specify the current step of the onboarding\n */\n currentStep: PropTypes.number,\n /**\n * List of Custom components for the onboarding\n */\n onboardingSteps: PropTypes.array,\n /**\n * Props for the complete button\n */\n completeButtonProps: PropTypes.object,\n /**\n * To set the step of the onboarding\n */\n setCurrentStep: PropTypes.func,\n /**\n * To pass additional classes to the help screen\n */\n helpScreenClassName: PropTypes.string,\n};\n\nexport default Onboarding;\n"],"names":["CompletedScreen","withT","_ref","t","completeButtonProps","React","createElement","className","Typography","style","appName","globalProps","Button","_extends","label","HelpScreen","setCurrentStep","currentStep","helpScreenClassName","_useTranslation","useTranslation","_useBreakpoints","useBreakpoints","isSize","classNames","component","lineHeight","alt","src","icon","RightArrow","iconPosition","onClick","createSteps","onboardingSteps","helpStep","element","concat","map","step","idx","_objectSpread","id","WelcomeScreen","Onboarding","_steps","_ref$currentStep","_ref$setCurrentStep","noop","_ref$onboardingSteps","_ref$completeButtonPr","_ref$helpScreenClassN","steps","useMemo","length","handleStepChange","index","isStepperVisible","Stepper","activeIndex","setActiveIndex"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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AA4B,MAAA,KAAtBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAA,CAAwBT,OACtB,CACF,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Onboarding.js","sources":["../../src/components/Onboarding/CompletedScreen.jsx","../../src/components/Onboarding/HelpScreen.jsx","../../src/components/Onboarding/utils.jsx","../../src/components/Onboarding/WelcomeScreen.jsx","../../src/components/Onboarding/index.jsx"],"sourcesContent":["import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { Button, Typography } from \"neetoui\";\n\nconst CompletedScreen = withT(({ t, completeButtonProps }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-congratulations-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-emoji\"\n style=\"h1\"\n >\n 🎉\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-congratulations-title\"\n data-testid=\"onboarding-congratulations-title\"\n style=\"h1\"\n >\n <span className=\"neeto-ui-text-success-500\">\n {t(\"neetoMolecules.onboarding.congratulations\")}\n </span>\n <br />\n {t(\"neetoMolecules.onboarding.readyToUse\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-congratulations-button\"\n data-testid=\"onboarding-congratulations-button\"\n label={t(\"neetoMolecules.onboarding.helpScreen.startUsingButton\", {\n appName: globalProps.appName,\n })}\n {...completeButtonProps}\n />\n </div>\n));\n\nexport default CompletedScreen;\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nconst HelpScreen = ({ setCurrentStep, currentStep, helpScreenClassName }) => {\n const { t } = useTranslation();\n const { isSize } = useBreakpoints();\n\n return (\n <div\n className={classNames(\n \"mx-auto w-full max-w-2xl space-y-6 p-4\",\n helpScreenClassName\n )}\n >\n <div className=\"space-y-3\">\n <Typography\n component=\"h1\"\n data-cy=\"onboarding-help-title\"\n data-testid=\"onboarding-help-title\"\n style=\"h2\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.title\")}\n </Typography>\n <Typography\n data-cy=\"onboarding-help-description\"\n data-testid=\"onboarding-help-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.description\")}\n </Typography>\n <div className=\"w-full\">\n {isSize(\"mobile\") ? (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-mobile_FpB8LKYj4.svg\"\n />\n ) : (\n <img\n alt=\"\"\n src=\"https://ik.imagekit.io/d9mvewbju/Commons/help-desktop_aVe6ENdX97.svg\"\n />\n )}\n </div>\n </div>\n <Button\n data-cy=\"onboarding-help-button\"\n data-testid=\"onboarding-help-button\"\n icon={RightArrow}\n iconPosition=\"right\"\n label={t(\"neetoMolecules.onboarding.helpScreen.continueButton\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n );\n};\n\nexport default HelpScreen;\n","import React from \"react\";\n\nimport { t } from \"i18next\";\n\nimport HelpScreen from \"./HelpScreen\";\n\nexport const createSteps = (\n onboardingSteps,\n setCurrentStep,\n currentStep,\n helpScreenClassName\n) => {\n const helpStep = {\n label: t(\"neetoMolecules.onboarding.helpLabel\"),\n element: (\n <HelpScreen {...{ currentStep, helpScreenClassName, setCurrentStep }} />\n ),\n };\n\n return onboardingSteps\n .concat(helpStep)\n .map((step, idx) => ({ ...step, id: idx + 1 }));\n};\n","import React from \"react\";\n\nimport { globalProps } from \"neetocommons/initializers\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { RightArrow } from \"neetoicons\";\nimport { Button, Typography } from \"neetoui\";\n\nconst WelcomeScreen = withT(({ t, setCurrentStep, currentStep }) => (\n <div\n className=\"neeto-molecules-onboarding__wrapper\"\n data-testid=\"onboarding-welcome-wrapper\"\n >\n <div className=\"mx-auto mb-6 w-full max-w-2xl space-y-2\">\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-title\"\n data-testid=\"onboarding-welcome-title\"\n style=\"h1\"\n >\n {t(\"neetoMolecules.onboarding.helpScreen.welcomeToTitle\", {\n appName: globalProps.appName,\n })}\n </Typography>\n <Typography\n className=\"text-center\"\n data-cy=\"onboarding-welcome-description\"\n data-testid=\"onboarding-welcome-description\"\n lineHeight=\"normal\"\n style=\"body1\"\n >\n {t(\"neetoMolecules.onboarding.letUsCustomize\", {\n appName: globalProps.appName,\n })}\n </Typography>\n </div>\n <Button\n data-cy=\"onboarding-welcome-button\"\n data-testid=\"onboarding-welcome-button\"\n icon={RightArrow}\n label={t(\"neetoMolecules.onboarding.getStarted\")}\n onClick={() => setCurrentStep(currentStep + 1)}\n />\n </div>\n));\n\nexport default WelcomeScreen;\n","import React, { useMemo, useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { Stepper } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nimport CompletedScreen from \"./CompletedScreen\";\nimport \"./onboarding.scss\";\nimport { createSteps } from \"./utils\";\nimport WelcomeScreen from \"./WelcomeScreen\";\n\nconst Onboarding = ({\n currentStep = 0,\n setCurrentStep = noop,\n onboardingSteps = [],\n completeButtonProps = {},\n helpScreenClassName = \"\",\n isAnimated = true,\n}) => {\n const steps = useMemo(\n () =>\n createSteps(\n onboardingSteps,\n setCurrentStep,\n currentStep,\n helpScreenClassName\n ),\n [onboardingSteps]\n );\n const [direction, setDirection] = useState(\"\");\n\n if (currentStep === 0) {\n return <WelcomeScreen {...{ currentStep, setCurrentStep }} />;\n }\n\n if (currentStep === steps.length + 1) {\n return <CompletedScreen {...{ completeButtonProps }} />;\n }\n\n const handleStepChange = index => {\n const nextStep = index + 1;\n setDirection(currentStep > nextStep ? \"backward\" : \"forward\");\n setCurrentStep(nextStep);\n };\n\n const isStepperVisible = steps.length > 1;\n\n return (\n <div\n className={classNames(\"neeto-molecules-onboarding__container\", {\n \"neeto-molecules-onboarding__wrapper\": !isStepperVisible,\n })}\n >\n {isStepperVisible && (\n <div className=\"neeto-molecules-onboarding__stepper-wrapper\">\n <Stepper\n {...{ steps }}\n activeIndex={currentStep - 1}\n setActiveIndex={handleStepChange}\n />\n </div>\n )}\n {steps.map((step, index) => (\n <div\n key={index}\n className={classNames(\"neeto-molecules-onboarding__content\", {\n \"neeto-molecules-onboarding__content--forward overflow-x-hidden\":\n isAnimated && direction === \"forward\",\n \"neeto-molecules-onboarding__content--backward overflow-x-hidden\":\n isAnimated && direction === \"backward\",\n hidden: currentStep - 1 !== index,\n })}\n >\n {step?.element}\n </div>\n ))}\n </div>\n );\n};\n\nOnboarding.propTypes = {\n /**\n * To specify the current step of the onboarding\n */\n currentStep: PropTypes.number,\n /**\n * List of Custom components for the onboarding\n */\n onboardingSteps: PropTypes.array,\n /**\n * Props for the complete button\n */\n completeButtonProps: PropTypes.object,\n /**\n * To set the step of the onboarding\n */\n setCurrentStep: PropTypes.func,\n /**\n * To pass additional classes to the help screen\n */\n helpScreenClassName: PropTypes.string,\n /**\n * A boolean value to enable or disable the animation for the stepper.\n */\n isAnimated: PropTypes.bool,\n};\n\nexport default Onboarding;\n"],"names":["CompletedScreen","withT","_ref","t","completeButtonProps","React","createElement","className","Typography","style","appName","globalProps","Button","_extends","label","HelpScreen","setCurrentStep","currentStep","helpScreenClassName","_useTranslation","useTranslation","_useBreakpoints","useBreakpoints","isSize","classNames","component","lineHeight","alt","src","icon","RightArrow","iconPosition","onClick","createSteps","onboardingSteps","helpStep","element","concat","map","step","idx","_objectSpread","id","WelcomeScreen","Onboarding","_ref$currentStep","_ref$setCurrentStep","noop","_ref$onboardingSteps","_ref$completeButtonPr","_ref$helpScreenClassN","_ref$isAnimated","isAnimated","steps","useMemo","_useState","useState","_useState2","_slicedToArray","direction","setDirection","length","handleStepChange","index","nextStep","isStepperVisible","Stepper","activeIndex","setActiveIndex","key","hidden"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAMA,eAAe,GAAGC,yBAAK,CAAC,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,mBAAmB,GAAAF,IAAA,CAAnBE,mBAAmB,CAAA;EAAA,oBACrDC,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,qCAAqC;IAC/C,aAAY,EAAA,oCAAA;GAEZF,eAAAA,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,yCAAA;AAAyC,GAAA,eACtDF,yBAAA,CAAAC,aAAA,CAACE,kBAAU,EAAA;AACTD,IAAAA,SAAS,EAAC,aAAa;AACvB,IAAA,SAAA,EAAQ,kCAAkC;AAC1CE,IAAAA,KAAK,EAAC,IAAA;AAAI,GAAA,EACX,cAEW,CAAC,eACbJ,yBAAA,CAAAC,aAAA,CAACE,kBAAU,EAAA;AACTD,IAAAA,SAAS,EAAC,aAAa;AACvB,IAAA,SAAA,EAAQ,kCAAkC;AAC1C,IAAA,aAAA,EAAY,kCAAkC;AAC9CE,IAAAA,KAAK,EAAC,IAAA;GAENJ,eAAAA,yBAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMC,IAAAA,SAAS,EAAC,2BAAA;AAA2B,GAAA,EACxCJ,CAAC,CAAC,2CAA2C,CAC1C,CAAC,eACPE,yBAAA,CAAAC,aAAA,WAAK,CAAC,EACLH,CAAC,CAAC,sCAAsC,EAAE;IACzCO,OAAO,EAAEC,wBAAW,CAACD,OAAAA;GACtB,CACS,CACT,CAAC,eACNL,yBAAA,CAAAC,aAAA,CAACM,cAAM,EAAAC,4BAAA,CAAA;AACL,IAAA,SAAA,EAAQ,mCAAmC;AAC3C,IAAA,aAAA,EAA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AuC,EAAE;AAC7D,MAAA,qCAAqC,EAAE,CAACyC,gBAAAA;KACzC,CAAA;AAAE,GAAA,EAEFA,gBAAgB,iBACf5D,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,6CAAA;AAA6C,GAAA,eAC1DF,yBAAA,CAAAC,aAAA,CAAC4D,eAAO,EAAA;AACAb,IAAAA,KAAK,EAALA,KAAK;IACXc,WAAW,EAAElD,WAAW,GAAG,CAAE;AAC7BmD,IAAAA,cAAc,EAAEN,gBAAAA;GACjB,CACE,CACN,EACAT,KAAK,CAACf,GAAG,CAAC,UAACC,IAAI,EAAEwB,KAAK,EAAA;IAAA,oBACrB1D,yBAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE+D,MAAAA,GAAG,EAAEN,KAAM;AACXxD,MAAAA,SAAS,EAAEiB,8BAAU,CAAC,qCAAqC,EAAE;AAC3D,QAAA,gEAAgE,EAC9D4B,UAAU,IAAIO,SAAS,KAAK,SAAS;AACvC,QAAA,iEAAiE,EAC/DP,UAAU,IAAIO,SAAS,KAAK,UAAU;AACxCW,QAAAA,MAAM,EAAErD,WAAW,GAAG,CAAC,KAAK8C,KAAAA;OAC7B,CAAA;AAAE,KAAA,EAEFxB,IAAI,KAAJA,IAAAA,IAAAA,IAAI,uBAAJA,IAAI,CAAEH,OACJ,CAAC,CAAA;AAAA,GACP,CACE,CAAC,CAAA;AAEV;;;;"}
@@ -0,0 +1,87 @@
1
+ 'use strict';
2
+
3
+ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
4
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
5
+ var React = require('react');
6
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
7
+ var neetoEditor = require('@bigbinary/neeto-editor');
8
+ var neetoui = require('@bigbinary/neetoui');
9
+ var ramda = require('ramda');
10
+ var injectCss = require('./inject-css-80a5faa3.js');
11
+ var reactQuery = require('react-query');
12
+ var axios = require('axios');
13
+ var constants = require('@bigbinary/neeto-commons-frontend/constants');
14
+
15
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
+
17
+ var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
18
+ var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
19
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
20
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
21
+
22
+ var QUERY_KEYS = {
23
+ APP_STICKY_RIBBONS_LIST: "APP_STICKY_RIBBONS_LIST"
24
+ };
25
+ var STICKY_RIBBON_KIND_TO_STYLE = {
26
+ info: "info",
27
+ warning: "warning",
28
+ error: "danger"
29
+ };
30
+ var STICKY_RIBBONS_LOCAL_STORAGE_KEY = "dismissedStickyRibbons";
31
+
32
+ var css = ".neeto-molecules-sticky-ribbon{border-radius:0}";
33
+ injectCss.n(css,{});
34
+
35
+ var fetchStickyRibbons = function fetchStickyRibbons() {
36
+ return axios__default["default"].get("".concat(constants.BASE_API_V1_URL, "/sticky_ribbons"));
37
+ };
38
+ var stickyRibbonsApi = {
39
+ fetchStickyRibbons: fetchStickyRibbons
40
+ };
41
+
42
+ var APP_STICKY_RIBBONS_LIST = QUERY_KEYS.APP_STICKY_RIBBONS_LIST;
43
+ var useFetchStickyRibbons = function useFetchStickyRibbons() {
44
+ return reactQuery.useQuery([APP_STICKY_RIBBONS_LIST], stickyRibbonsApi.fetchStickyRibbons);
45
+ };
46
+
47
+ var StickyRibbonsContainer = function StickyRibbonsContainer() {
48
+ var _useLocalStorage = reactUtils.useLocalStorage(STICKY_RIBBONS_LOCAL_STORAGE_KEY, []),
49
+ _useLocalStorage2 = _slicedToArray__default["default"](_useLocalStorage, 2),
50
+ dismissedRibbons = _useLocalStorage2[0],
51
+ setDismissedRibbons = _useLocalStorage2[1];
52
+ var _useFetchStickyRibbon = useFetchStickyRibbons(),
53
+ _useFetchStickyRibbon2 = _useFetchStickyRibbon.data,
54
+ _useFetchStickyRibbon3 = _useFetchStickyRibbon2 === void 0 ? {} : _useFetchStickyRibbon2,
55
+ _useFetchStickyRibbon4 = _useFetchStickyRibbon3.stickyRibbons,
56
+ stickyRibbons = _useFetchStickyRibbon4 === void 0 ? [] : _useFetchStickyRibbon4;
57
+ var handleDismiss = function handleDismiss(ribbonId) {
58
+ var validRibbonIds = ramda.pluck("id", stickyRibbons);
59
+ var updatedDismissedRibbons = dismissedRibbons.filter(function (id) {
60
+ return validRibbonIds.includes(id);
61
+ });
62
+ setDismissedRibbons([].concat(_toConsumableArray__default["default"](updatedDismissedRibbons), [ribbonId]));
63
+ };
64
+ var visibleRibbons = stickyRibbons.filter(function (ribbon) {
65
+ return !dismissedRibbons.includes(ribbon.id);
66
+ });
67
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, visibleRibbons.map(function (_ref) {
68
+ var id = _ref.id,
69
+ kind = _ref.kind,
70
+ message = _ref.message;
71
+ return /*#__PURE__*/React__default["default"].createElement(neetoui.Tag, {
72
+ className: "neeto-molecules-sticky-ribbon w-full p-2.5 text-center",
73
+ key: id,
74
+ size: "large",
75
+ style: STICKY_RIBBON_KIND_TO_STYLE[kind],
76
+ onClose: function onClose() {
77
+ return handleDismiss(id);
78
+ }
79
+ }, /*#__PURE__*/React__default["default"].createElement(neetoEditor.EditorContent, {
80
+ className: "w-full",
81
+ content: message
82
+ }));
83
+ }));
84
+ };
85
+
86
+ module.exports = StickyRibbonsContainer;
87
+ //# sourceMappingURL=StickyRibbonsContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StickyRibbonsContainer.js","sources":["../../src/components/StickyRibbonsContainer/constants.js","../../src/components/StickyRibbonsContainer/api.js","../../src/components/StickyRibbonsContainer/useStickyRibbonsApi.js","../../src/components/StickyRibbonsContainer/index.jsx"],"sourcesContent":["export const QUERY_KEYS = {\n APP_STICKY_RIBBONS_LIST: \"APP_STICKY_RIBBONS_LIST\",\n};\n\nexport const STICKY_RIBBON_KIND_TO_STYLE = {\n info: \"info\",\n warning: \"warning\",\n error: \"danger\",\n};\n\nexport const STICKY_RIBBONS_LOCAL_STORAGE_KEY = \"dismissedStickyRibbons\";\n","import axios from \"axios\";\nimport { BASE_API_V1_URL } from \"neetocommons/constants\";\n\nconst fetchStickyRibbons = () => axios.get(`${BASE_API_V1_URL}/sticky_ribbons`);\n\nconst stickyRibbonsApi = { fetchStickyRibbons };\n\nexport default stickyRibbonsApi;\n","import { useQuery } from \"react-query\";\n\nimport stickyRibbonsApi from \"./api\";\nimport { QUERY_KEYS } from \"./constants\";\n\nconst { APP_STICKY_RIBBONS_LIST } = QUERY_KEYS;\n\nconst useFetchStickyRibbons = () =>\n useQuery([APP_STICKY_RIBBONS_LIST], stickyRibbonsApi.fetchStickyRibbons);\n\nexport { useFetchStickyRibbons };\n","import React from \"react\";\n\nimport { useLocalStorage } from \"neetocommons/react-utils\";\nimport { EditorContent } from \"neetoeditor\";\nimport { Tag } from \"neetoui\";\nimport { pluck } from \"ramda\";\n\nimport {\n STICKY_RIBBONS_LOCAL_STORAGE_KEY,\n STICKY_RIBBON_KIND_TO_STYLE,\n} from \"./constants\";\nimport \"./sticky-ribbons.scss\";\nimport { useFetchStickyRibbons } from \"./useStickyRibbonsApi\";\n\nconst StickyRibbonsContainer = () => {\n const [dismissedRibbons, setDismissedRibbons] = useLocalStorage(\n STICKY_RIBBONS_LOCAL_STORAGE_KEY,\n []\n );\n\n const { data: { stickyRibbons = [] } = {} } = useFetchStickyRibbons();\n\n const handleDismiss = ribbonId => {\n const validRibbonIds = pluck(\"id\", stickyRibbons);\n const updatedDismissedRibbons = dismissedRibbons.filter(id =>\n validRibbonIds.includes(id)\n );\n\n setDismissedRibbons([...updatedDismissedRibbons, ribbonId]);\n };\n\n const visibleRibbons = stickyRibbons.filter(\n ribbon => !dismissedRibbons.includes(ribbon.id)\n );\n\n return (\n <>\n {visibleRibbons.map(({ id, kind, message }) => (\n <Tag\n className=\"neeto-molecules-sticky-ribbon w-full p-2.5 text-center\"\n key={id}\n size=\"large\"\n style={STICKY_RIBBON_KIND_TO_STYLE[kind]}\n onClose={() => handleDismiss(id)}\n >\n <EditorContent className=\"w-full\" content={message} />\n </Tag>\n ))}\n </>\n );\n};\n\nexport default StickyRibbonsContainer;\n"],"names":["QUERY_KEYS","APP_STICKY_RIBBONS_LIST","STICKY_RIBBON_KIND_TO_STYLE","info","warning","error","STICKY_RIBBONS_LOCAL_STORAGE_KEY","fetchStickyRibbons","axios","get","concat","BASE_API_V1_URL","stickyRibbonsApi","useFetchStickyRibbons","useQuery","StickyRibbonsContainer","_useLocalStorage","useLocalStorage","_useLocalStorage2","_slicedToArray","dismissedRibbons","setDismissedRibbons","_useFetchStickyRibbon","_useFetchStickyRibbon2","data","_useFetchStickyRibbon3","_useFetchStickyRibbon4","stickyRibbons","handleDismiss","ribbonId","validRibbonIds","pluck","updatedDismissedRibbons","filter","id","includes","_toConsumableArray","visibleRibbons","ribbon","React","createElement","Fragment","map","_ref","kind","message","Tag","className","key","size","style","onClose","EditorContent","content"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,UAAU,GAAG;AACxBC,EAAAA,uBAAuB,EAAE,yBAAA;AAC3B,CAAC,CAAA;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,KAAK,EAAE,QAAA;AACT,CAAC,CAAA;AAEM,IAAMC,gCAAgC,GAAG,wBAAwB;;;;;ACPxE,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,GAAA;EAAA,OAASC,yBAAK,CAACC,GAAG,CAAA,EAAA,CAAAC,MAAA,CAAIC,yBAAe,oBAAiB,CAAC,CAAA;AAAA,CAAA,CAAA;AAE/E,IAAMC,gBAAgB,GAAG;AAAEL,EAAAA,kBAAkB,EAAlBA,kBAAAA;AAAmB,CAAC;;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,QAAQ,CAAA,CAAC,CAAC,CAAA;GAC5D,CAAA;AAED,EAAA,IAAMQ,cAAc,GAAGV,aAAa,CAACM,MAAM,CACzC,UAAAK,MAAM,EAAA;IAAA,OAAI,CAAClB,gBAAgB,CAACe,QAAQ,CAACG,MAAM,CAACJ,EAAE,CAAC,CAAA;AAAA,GACjD,CAAC,CAAA;AAED,EAAA,oBACEK,yBAAA,CAAAC,aAAA,CAAAD,yBAAA,CAAAE,QAAA,EAAA,IAAA,EACGJ,cAAc,CAACK,GAAG,CAAC,UAAAC,IAAA,EAAA;AAAA,IAAA,IAAGT,EAAE,GAAAS,IAAA,CAAFT,EAAE;MAAEU,IAAI,GAAAD,IAAA,CAAJC,IAAI;MAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO,CAAA;AAAA,IAAA,oBACtCN,yBAAA,CAAAC,aAAA,CAACM,WAAG,EAAA;AACFC,MAAAA,SAAS,EAAC,wDAAwD;AAClEC,MAAAA,GAAG,EAAEd,EAAG;AACRe,MAAAA,IAAI,EAAC,OAAO;AACZC,MAAAA,KAAK,EAAEhD,2BAA2B,CAAC0C,IAAI,CAAE;MACzCO,OAAO,EAAE,SAAAA,OAAA,GAAA;QAAA,OAAMvB,aAAa,CAACM,EAAE,CAAC,CAAA;AAAA,OAAA;AAAC,KAAA,eAEjCK,yBAAA,CAAAC,aAAA,CAACY,yBAAa,EAAA;AAACL,MAAAA,SAAS,EAAC,QAAQ;AAACM,MAAAA,OAAO,EAAER,OAAAA;AAAQ,KAAE,CAClD,CAAC,CAAA;AAAA,GACP,CACD,CAAC,CAAA;AAEP;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-molecules",
3
- "version": "1.19.5",
3
+ "version": "1.19.7",
4
4
  "description": "A package of reusable molecular components for neeto products.",
5
5
  "repository": "git@github.com:bigbinary/neeto-molecules.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -60,5 +60,6 @@ const Onboarding: React.FC<{
60
60
  setCurrentStep: React.Dispatch<React.SetStateAction<number>>;
61
61
  onboardingSteps?: OnboardingComponent[];
62
62
  helpScreenClassName?: string;
63
+ isAnimated?: boolean;
63
64
  }>;
64
65
  export default Onboarding;
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ /**
3
+ *
4
+ * A container that displays the sticky ribbons configured for the current neeto
5
+ *
6
+ * application in neetoTower, if any. The sticky ribbons will be automatically
7
+ *
8
+ * fetched from neetoTower and displayed within the container.
9
+ *
10
+ * @example
11
+ *
12
+ * import StickyRibbonsContainer from "@bigbinary/neeto-molecules/StickyRibbonsContainer";
13
+ *
14
+ * const Main = () => (
15
+ * <>
16
+ * <ToastContainer />
17
+ * <StickyRibbonsContainer />
18
+ * <Switch>
19
+ * <Route />
20
+ * </Switch>
21
+ * </>
22
+ * );
23
+ * @endexample
24
+ */
25
+ const StickyRibbonsContainer: React.FC<{}>;
26
+ export default StickyRibbonsContainer;