@bigbinary/neeto-molecules 3.15.30 → 3.15.32

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
@@ -24,8 +24,6 @@ https://neeto-molecules.neeto.com/
24
24
  - [Container](./docs/components/Container.md)
25
25
  - [CopyToClipboardButton](./docs/components/CopyToClipboardButton.md)
26
26
  - [Currency](./docs/components/Currency.md)
27
- - [CustomDomain](./docs/components/CustomDomain.md)
28
- - [CustomDomainDashboard](./docs/components/CustomDomainDashboard.md)
29
27
  - [DateFormat/TimeFormat](./docs/components/DateFormatTimeFormat.md)
30
28
  - [DateRangeFilter](./docs/components/DateRangeFilter.md)
31
29
  - [DeleteArchiveModal](./docs/components/DeleteArchiveModal.md)
package/dist/Codeblock.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
- import { PrismLight } from 'react-syntax-highlighter';
2
+ import CodeBlock from 'react-syntax-highlighter/dist/cjs/prism-light.js';
3
3
  import { dracula } from 'react-syntax-highlighter/dist/esm/styles/prism';
4
4
  import CopyToClipboardButton from './CopyToClipboardButton.js';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -29,7 +29,7 @@ var Codeblock = function Codeblock(_ref) {
29
29
  var isLargerScreen = window.innerWidth > 768;
30
30
  return /*#__PURE__*/jsxs("div", {
31
31
  className: "relative",
32
- children: [/*#__PURE__*/jsx(PrismLight, _objectSpread(_objectSpread({
32
+ children: [/*#__PURE__*/jsx(CodeBlock, _objectSpread(_objectSpread({
33
33
  wrapLines: true,
34
34
  className: "neeto-molecules-code-block p-4 pr-12 md:pr-4",
35
35
  codeTagProps: {
@@ -1 +1 @@
1
- {"version":3,"file":"Codeblock.js","sources":["../src/components/Codeblock.jsx"],"sourcesContent":["import PropTypes from \"prop-types\";\nimport { PrismLight as CodeBlock } from \"react-syntax-highlighter\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"neeto-molecules-code-block p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute right-2 top-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","_jsxs","className","children","_jsx","CodeBlock","_objectSpread","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,mBAAA,GAAAF,IAAA,CACJG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,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CACF,CAAA;AAAA,GACE,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Codeblock.js","sources":["../src/components/Codeblock.jsx"],"sourcesContent":["import PropTypes from \"prop-types\";\nimport CodeBlock from \"react-syntax-highlighter/dist/cjs/prism-light.js\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"neeto-molecules-code-block p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute right-2 top-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","_jsxs","className","children","_jsx","CodeBlock","_objectSpread","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;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OAAO;AACZH,MAAAA,KAAK,EAAC,WAAW;AACjBI,MAAAA,KAAK,EAAEvB,IAAAA;AAAK,KAAA,EACRK,eAAe,CAAA,EAAA,EAAA,EAAA;AACnBC,MAAAA,KAAK,EAAEC,cAAc,GAAGF,eAAe,CAACC,KAAK,GAAG,EAAA;AAAG,KAAA,CACpD,CACF,CAAA;AAAA,GACE,CAAC,CAAA;AAEV;;;;"}
@@ -27,7 +27,7 @@ import Radio from '@bigbinary/neetoui/Radio';
27
27
  import Spinner from '@bigbinary/neetoui/Spinner';
28
28
  import BrowserPreview from './BrowserPreview.js';
29
29
  import { n } from './inject-css-DmrvuTKK.js';
30
- import 'react-syntax-highlighter';
30
+ import 'react-syntax-highlighter/dist/cjs/prism-light.js';
31
31
  import 'react-syntax-highlighter/dist/esm/styles/prism';
32
32
  import './CopyToClipboardButton.js';
33
33
  import '@bigbinary/neeto-commons-frontend/utils/general';
@@ -0,0 +1,77 @@
1
+ import { filterBy } from '@bigbinary/neeto-cist';
2
+ import { dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
3
+ import Callout from '@bigbinary/neetoui/Callout';
4
+ import Typography from '@bigbinary/neetoui/Typography';
5
+ import Button from '@bigbinary/neetoui/Button';
6
+ import { Trans } from 'react-i18next';
7
+ import { n } from './inject-css-DmrvuTKK.js';
8
+ import { useQuery } from '@tanstack/react-query';
9
+ import axios from 'axios';
10
+ import { jsx, Fragment } from 'react/jsx-runtime';
11
+
12
+ var QUERY_KEYS = {
13
+ SUBSCRIPTIONS_LIST: "SUBSCRIPTIONS_LIST"
14
+ };
15
+ var SUBSCRIPTION_STATUS = {
16
+ past_due: "past_due"
17
+ };
18
+
19
+ var css = ".neeto-molecules-subscription-notifications{border-radius:0}";
20
+ n(css,{});
21
+
22
+ var fetchSubscriptions = function fetchSubscriptions() {
23
+ return axios.get("neeto_sso/api/v1/server/subscriptions");
24
+ };
25
+ var subscriptionsApi = {
26
+ fetchSubscriptions: fetchSubscriptions
27
+ };
28
+
29
+ var SUBSCRIPTIONS_LIST = QUERY_KEYS.SUBSCRIPTIONS_LIST;
30
+ var useFetchSubscriptions = function useFetchSubscriptions() {
31
+ return useQuery({
32
+ queryKey: [SUBSCRIPTIONS_LIST],
33
+ queryFn: subscriptionsApi.fetchSubscriptions
34
+ });
35
+ };
36
+
37
+ var SubscriptionNotificationsContainer = function SubscriptionNotificationsContainer() {
38
+ var _useFetchSubscription = useFetchSubscriptions(),
39
+ _useFetchSubscription2 = _useFetchSubscription.data,
40
+ _useFetchSubscription3 = _useFetchSubscription2 === void 0 ? {} : _useFetchSubscription2,
41
+ _useFetchSubscription4 = _useFetchSubscription3.clientAppSubscriptions,
42
+ clientAppSubscriptions = _useFetchSubscription4 === void 0 ? [] : _useFetchSubscription4;
43
+ var visibleNotifications = filterBy({
44
+ status: SUBSCRIPTION_STATUS.past_due
45
+ }, clientAppSubscriptions);
46
+ return /*#__PURE__*/jsx(Fragment, {
47
+ children: visibleNotifications.map(function (_ref, index) {
48
+ var downgradeScheduledAt = _ref.downgradeScheduledAt,
49
+ customerPortalUrl = _ref.customerPortalUrl;
50
+ return /*#__PURE__*/jsx(Callout, {
51
+ className: "neeto-molecules-subscription-notifications w-full p-2.5",
52
+ "data-testid": "subscription-notifications",
53
+ style: "warning",
54
+ children: /*#__PURE__*/jsx(Typography, {
55
+ style: "body2",
56
+ children: /*#__PURE__*/jsx(Trans, {
57
+ i18nKey: "neetoMolecules.subscription.paymentFailedNotification",
58
+ components: {
59
+ a: /*#__PURE__*/jsx(Button, {
60
+ href: customerPortalUrl,
61
+ rel: "noreferrer",
62
+ style: "link",
63
+ target: "_blank"
64
+ })
65
+ },
66
+ values: {
67
+ downgradeScheduledAt: dateFormat.date(downgradeScheduledAt)
68
+ }
69
+ })
70
+ })
71
+ }, index);
72
+ })
73
+ });
74
+ };
75
+
76
+ export { SubscriptionNotificationsContainer as default };
77
+ //# sourceMappingURL=SubscriptionNotificationsContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionNotificationsContainer.js","sources":["../src/components/SubscriptionNotificationsContainer/constants.js","../src/components/SubscriptionNotificationsContainer/api.js","../src/components/SubscriptionNotificationsContainer/useSubscriptionsApi.js","../src/components/SubscriptionNotificationsContainer/index.jsx"],"sourcesContent":["export const QUERY_KEYS = {\n SUBSCRIPTIONS_LIST: \"SUBSCRIPTIONS_LIST\",\n};\n\nexport const SUBSCRIPTION_STATUS = { past_due: \"past_due\" };\n","import axios from \"axios\";\n\nconst fetchSubscriptions = () =>\n axios.get(\"neeto_sso/api/v1/server/subscriptions\");\n\nconst subscriptionsApi = { fetchSubscriptions };\n\nexport default subscriptionsApi;\n","import { useQuery } from \"@tanstack/react-query\";\n\nimport subscriptionsApi from \"./api\";\nimport { QUERY_KEYS } from \"./constants\";\n\nconst { SUBSCRIPTIONS_LIST } = QUERY_KEYS;\n\nconst useFetchSubscriptions = () =>\n useQuery({\n queryKey: [SUBSCRIPTIONS_LIST],\n queryFn: subscriptionsApi.fetchSubscriptions,\n });\n\nexport { useFetchSubscriptions };\n","import { filterBy } from \"neetocist\";\nimport { dateFormat } from \"neetocommons/utils\";\nimport { Callout, Typography, Button } from \"neetoui\";\nimport { Trans } from \"react-i18next\";\n\nimport { SUBSCRIPTION_STATUS } from \"./constants\";\nimport \"./subscription-notifications.scss\";\nimport { useFetchSubscriptions } from \"./useSubscriptionsApi\";\n\nconst SubscriptionNotificationsContainer = () => {\n const { data: { clientAppSubscriptions = [] } = {} } =\n useFetchSubscriptions();\n\n const visibleNotifications = filterBy(\n { status: SUBSCRIPTION_STATUS.past_due },\n clientAppSubscriptions\n );\n\n return (\n <>\n {visibleNotifications.map(\n ({ downgradeScheduledAt, customerPortalUrl }, index) => (\n <Callout\n className=\"neeto-molecules-subscription-notifications w-full p-2.5\"\n data-testid=\"subscription-notifications\"\n key={index}\n style=\"warning\"\n >\n <Typography style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.subscription.paymentFailedNotification\"\n components={{\n a: (\n <Button\n href={customerPortalUrl}\n rel=\"noreferrer\"\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n values={{\n downgradeScheduledAt: dateFormat.date(downgradeScheduledAt),\n }}\n />\n </Typography>\n </Callout>\n )\n )}\n </>\n );\n};\n\nexport default SubscriptionNotificationsContainer;\n"],"names":["QUERY_KEYS","SUBSCRIPTIONS_LIST","SUBSCRIPTION_STATUS","past_due","fetchSubscriptions","axios","get","subscriptionsApi","useFetchSubscriptions","useQuery","queryKey","queryFn","SubscriptionNotificationsContainer","_useFetchSubscription","_useFetchSubscription2","data","_useFetchSubscription3","_useFetchSubscription4","clientAppSubscriptions","visibleNotifications","filterBy","status","_jsx","_Fragment","children","map","_ref","index","downgradeScheduledAt","customerPortalUrl","Callout","className","style","Typography","Trans","i18nKey","components","a","Button","href","rel","target","values","dateFormat","date"],"mappings":";;;;;;;;;;;AAAO,IAAMA,UAAU,GAAG;AACxBC,EAAAA,kBAAkB,EAAE,oBAAA;AACtB,CAAC,CAAA;AAEM,IAAMC,mBAAmB,GAAG;AAAEC,EAAAA,QAAQ,EAAE,UAAA;AAAW,CAAC;;;;;ACF3D,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,GAAA;AAAA,EAAA,OACtBC,KAAK,CAACC,GAAG,CAAC,uCAAuC,CAAC,CAAA;AAAA,CAAA,CAAA;AAEpD,IAAMC,gBAAgB,GAAG;AAAEH,EAAAA,kBAAkB,EAAlBA,kBAAAA;AAAmB,CAAC;;ACA/C,IAAQH,kBAAkB,GAAKD,UAAU,CAAjCC,kBAAkB,CAAA;AAE1B,IAAMO,qBAAqB,GAAG,SAAxBA,qBAAqBA,GAAA;AAAA,EAAA,OACzBC,QAAQ,CAAC;IACPC,QAAQ,EAAE,CAACT,kBAAkB,CAAC;IAC9BU,OAAO,EAAEJ,gBAAgB,CAACH,kBAAAA;AAC5B,GAAC,CAAC,CAAA;AAAA,CAAA;;ACFJ,IAAMQ,kCAAkC,GAAG,SAArCA,kCAAkCA,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CAACC,IAAI,CAAChB,oBAAoB,CAAA;AAC5D,aAAA;WACD,CAAA;SACS,CAAA;AAAC,OAAA,EApBRD,KAqBE,CAAC,CAAA;KAEd,CAAA;AAAC,GACD,CAAC,CAAA;AAEP;;;;"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
- var reactSyntaxHighlighter = require('react-syntax-highlighter');
4
+ var CodeBlock = require('react-syntax-highlighter/dist/cjs/prism-light.js');
5
5
  var prism = require('react-syntax-highlighter/dist/esm/styles/prism');
6
6
  var CopyToClipboardButton = require('./CopyToClipboardButton.js');
7
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -31,7 +31,7 @@ var Codeblock = function Codeblock(_ref) {
31
31
  var isLargerScreen = window.innerWidth > 768;
32
32
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
33
33
  className: "relative",
34
- children: [/*#__PURE__*/jsxRuntime.jsx(reactSyntaxHighlighter.PrismLight, _objectSpread(_objectSpread({
34
+ children: [/*#__PURE__*/jsxRuntime.jsx(CodeBlock, _objectSpread(_objectSpread({
35
35
  wrapLines: true,
36
36
  className: "neeto-molecules-code-block p-4 pr-12 md:pr-4",
37
37
  codeTagProps: {
@@ -1 +1 @@
1
- {"version":3,"file":"Codeblock.js","sources":["../../src/components/Codeblock.jsx"],"sourcesContent":["import PropTypes from \"prop-types\";\nimport { PrismLight as CodeBlock } from \"react-syntax-highlighter\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"neeto-molecules-code-block p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute right-2 top-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","_jsxs","className","children","_jsx","CodeBlock","_objectSpread","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,mBAAA,GAAAF,IAAA,CACJG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;IACrBE,cAAc,GAAAJ,IAAA,CAAdI,cAAc;IAAAC,oBAAA,GAAAL,IAAA,CACdM,eAAe;IAAfA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA;AAAEE,MAAAA,KAAK,EAAE,MAAA;AAAO,KAAC,GAAAF,oBAAA,CAAA;AAEnC,EAAA,IAAMG,cAAc,GAAGC,MAAM,CAACC,UAAU,GAAG,GAAG,CAAA;AAE9C,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,UAAU;AAAAC,IAAAA,QAAA,gBACvBC,cAAA,CAACC,iCAAS,EAAAC,aAAA,CAAAA,aAAA,CAAA;MACRC,SAAS,EAAA,IAAA;AACTL,MAAAA,SAAS,EAAC,8CAA8C;AACxDM,MAAAA,YAAY,EAAE;AAAE,QAAA,SAAS,EAAE,oBAAA;OAAuB;AAClD,MAAA,SAAA,EAAQ,YAAY;AACpB,MAAA,aAAA,EAAY,6BAA6B;AACzCC,MAAAA,QAAQ,EAAC,YAAY;AACrBC,MAAAA,KAAK,EAAEC,aAAAA;AAAQ,KAAA,EACXjB,cAAc,CAAA,EAAA,EAAA,EAAA;AAAAS,MAAAA,QAAA,EAEjBZ,IAAAA;KACQ,CAAA,CAAC,EACXE,cAAc,iBACbW,cAAA,CAACQ,qBAAQ,EAAAN,aAAA,CAAAA,aAAA,CAAA;AACPJ,MAAAA,SAAS,EAAC,wBAAwB;AAClC,MAAA,SAAA,EAAQ,aAAa;AACrB,MAAA,aAAA,EAAY,uBAAuB;AACnCW,MAAAA,IAAI,EAAC,OAAO;AACZH,MAAAA,KAAK,EAAC,WAAW;AACjBI,MAAAA,KAAK,EAAEvB,IAAAA;AAAK,KAAA,EACRK,eAAe,CAAA,EAAA,EAAA,EAAA;AACnBC,MAAAA,KAAK,EAAEC,cAAc,GAAGF,eAAe,CAACC,KAAK,GAAG,EAAA;AAAG,KAAA,CACpD,CACF,CAAA;AAAA,GACE,CAAC,CAAA;AAEV;;;;"}
1
+ {"version":3,"file":"Codeblock.js","sources":["../../src/components/Codeblock.jsx"],"sourcesContent":["import PropTypes from \"prop-types\";\nimport CodeBlock from \"react-syntax-highlighter/dist/cjs/prism-light.js\";\nimport { dracula } from \"react-syntax-highlighter/dist/esm/styles/prism\";\n\nimport CopyCode from \"components/CopyToClipboardButton\";\n\nconst Codeblock = ({\n code,\n showCopyButton = true,\n codeblockProps,\n copyButtonProps = { label: \"Copy\" },\n}) => {\n const isLargerScreen = window.innerWidth > 768;\n\n return (\n <div className=\"relative\">\n <CodeBlock\n wrapLines\n className=\"neeto-molecules-code-block p-4 pr-12 md:pr-4\"\n codeTagProps={{ \"data-cy\": \"code-block-content\" }}\n data-cy=\"code-block\"\n data-testid=\"codeblock-react-highlighter\"\n language=\"javascript\"\n style={dracula}\n {...codeblockProps}\n >\n {code}\n </CodeBlock>\n {showCopyButton && (\n <CopyCode\n className=\"absolute right-2 top-2\"\n data-cy=\"copy-button\"\n data-testid=\"codeblock-copy-button\"\n size=\"small\"\n style=\"secondary\"\n value={code}\n {...copyButtonProps}\n label={isLargerScreen ? copyButtonProps.label : \"\"}\n />\n )}\n </div>\n );\n};\n\nCodeblock.propTypes = {\n /**\n * The code to be displayed.\n */\n code: PropTypes.string,\n /**\n * Flag to determine whether the 'Copy' button is displayed.\n */\n showCopyButton: PropTypes.bool,\n /**\n * Additional props that can be passed on to the 'PrismLight' component from 'react-syntax-highlighter'.\n */\n codeblockProps: PropTypes.object,\n /**\n * Additional props that can be passed on to the 'CopyToClipboardButton' component from 'neeto-molecules'.\n */\n copyButtonProps: PropTypes.object,\n};\n\nexport default Codeblock;\n"],"names":["Codeblock","_ref","code","_ref$showCopyButton","showCopyButton","codeblockProps","_ref$copyButtonProps","copyButtonProps","label","isLargerScreen","window","innerWidth","_jsxs","className","children","_jsx","CodeBlock","_objectSpread","wrapLines","codeTagProps","language","style","dracula","CopyCode","size","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,mBAAA,GAAAF,IAAA,CACJG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA;IACrBE,cAAc,GAAAJ,IAAA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 var Radio = require('@bigbinary/neetoui/Radio');
29
29
  var Spinner = require('@bigbinary/neetoui/Spinner');
30
30
  var BrowserPreview = require('./BrowserPreview.js');
31
31
  var injectCss = require('./inject-css-vQvjPR2x.js');
32
- require('react-syntax-highlighter');
32
+ require('react-syntax-highlighter/dist/cjs/prism-light.js');
33
33
  require('react-syntax-highlighter/dist/esm/styles/prism');
34
34
  require('./CopyToClipboardButton.js');
35
35
  require('@bigbinary/neeto-commons-frontend/utils/general');
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ var neetoCist = require('@bigbinary/neeto-cist');
4
+ var utils = require('@bigbinary/neeto-commons-frontend/utils');
5
+ var Callout = require('@bigbinary/neetoui/Callout');
6
+ var Typography = require('@bigbinary/neetoui/Typography');
7
+ var Button = require('@bigbinary/neetoui/Button');
8
+ var reactI18next = require('react-i18next');
9
+ var injectCss = require('./inject-css-vQvjPR2x.js');
10
+ var reactQuery = require('@tanstack/react-query');
11
+ var axios = require('axios');
12
+ var jsxRuntime = require('react/jsx-runtime');
13
+
14
+ var QUERY_KEYS = {
15
+ SUBSCRIPTIONS_LIST: "SUBSCRIPTIONS_LIST"
16
+ };
17
+ var SUBSCRIPTION_STATUS = {
18
+ past_due: "past_due"
19
+ };
20
+
21
+ var css = ".neeto-molecules-subscription-notifications{border-radius:0}";
22
+ injectCss.n(css,{});
23
+
24
+ var fetchSubscriptions = function fetchSubscriptions() {
25
+ return axios.get("neeto_sso/api/v1/server/subscriptions");
26
+ };
27
+ var subscriptionsApi = {
28
+ fetchSubscriptions: fetchSubscriptions
29
+ };
30
+
31
+ var SUBSCRIPTIONS_LIST = QUERY_KEYS.SUBSCRIPTIONS_LIST;
32
+ var useFetchSubscriptions = function useFetchSubscriptions() {
33
+ return reactQuery.useQuery({
34
+ queryKey: [SUBSCRIPTIONS_LIST],
35
+ queryFn: subscriptionsApi.fetchSubscriptions
36
+ });
37
+ };
38
+
39
+ var SubscriptionNotificationsContainer = function SubscriptionNotificationsContainer() {
40
+ var _useFetchSubscription = useFetchSubscriptions(),
41
+ _useFetchSubscription2 = _useFetchSubscription.data,
42
+ _useFetchSubscription3 = _useFetchSubscription2 === void 0 ? {} : _useFetchSubscription2,
43
+ _useFetchSubscription4 = _useFetchSubscription3.clientAppSubscriptions,
44
+ clientAppSubscriptions = _useFetchSubscription4 === void 0 ? [] : _useFetchSubscription4;
45
+ var visibleNotifications = neetoCist.filterBy({
46
+ status: SUBSCRIPTION_STATUS.past_due
47
+ }, clientAppSubscriptions);
48
+ return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
49
+ children: visibleNotifications.map(function (_ref, index) {
50
+ var downgradeScheduledAt = _ref.downgradeScheduledAt,
51
+ customerPortalUrl = _ref.customerPortalUrl;
52
+ return /*#__PURE__*/jsxRuntime.jsx(Callout, {
53
+ className: "neeto-molecules-subscription-notifications w-full p-2.5",
54
+ "data-testid": "subscription-notifications",
55
+ style: "warning",
56
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
57
+ style: "body2",
58
+ children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
59
+ i18nKey: "neetoMolecules.subscription.paymentFailedNotification",
60
+ components: {
61
+ a: /*#__PURE__*/jsxRuntime.jsx(Button, {
62
+ href: customerPortalUrl,
63
+ rel: "noreferrer",
64
+ style: "link",
65
+ target: "_blank"
66
+ })
67
+ },
68
+ values: {
69
+ downgradeScheduledAt: utils.dateFormat.date(downgradeScheduledAt)
70
+ }
71
+ })
72
+ })
73
+ }, index);
74
+ })
75
+ });
76
+ };
77
+
78
+ module.exports = SubscriptionNotificationsContainer;
79
+ //# sourceMappingURL=SubscriptionNotificationsContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionNotificationsContainer.js","sources":["../../src/components/SubscriptionNotificationsContainer/constants.js","../../src/components/SubscriptionNotificationsContainer/api.js","../../src/components/SubscriptionNotificationsContainer/useSubscriptionsApi.js","../../src/components/SubscriptionNotificationsContainer/index.jsx"],"sourcesContent":["export const QUERY_KEYS = {\n SUBSCRIPTIONS_LIST: \"SUBSCRIPTIONS_LIST\",\n};\n\nexport const SUBSCRIPTION_STATUS = { past_due: \"past_due\" };\n","import axios from \"axios\";\n\nconst fetchSubscriptions = () =>\n axios.get(\"neeto_sso/api/v1/server/subscriptions\");\n\nconst subscriptionsApi = { fetchSubscriptions };\n\nexport default subscriptionsApi;\n","import { useQuery } from \"@tanstack/react-query\";\n\nimport subscriptionsApi from \"./api\";\nimport { QUERY_KEYS } from \"./constants\";\n\nconst { SUBSCRIPTIONS_LIST } = QUERY_KEYS;\n\nconst useFetchSubscriptions = () =>\n useQuery({\n queryKey: [SUBSCRIPTIONS_LIST],\n queryFn: subscriptionsApi.fetchSubscriptions,\n });\n\nexport { useFetchSubscriptions };\n","import { filterBy } from \"neetocist\";\nimport { dateFormat } from \"neetocommons/utils\";\nimport { Callout, Typography, Button } from \"neetoui\";\nimport { Trans } from \"react-i18next\";\n\nimport { SUBSCRIPTION_STATUS } from \"./constants\";\nimport \"./subscription-notifications.scss\";\nimport { useFetchSubscriptions } from \"./useSubscriptionsApi\";\n\nconst SubscriptionNotificationsContainer = () => {\n const { data: { clientAppSubscriptions = [] } = {} } =\n useFetchSubscriptions();\n\n const visibleNotifications = filterBy(\n { status: SUBSCRIPTION_STATUS.past_due },\n clientAppSubscriptions\n );\n\n return (\n <>\n {visibleNotifications.map(\n ({ downgradeScheduledAt, customerPortalUrl }, index) => (\n <Callout\n className=\"neeto-molecules-subscription-notifications w-full p-2.5\"\n data-testid=\"subscription-notifications\"\n key={index}\n style=\"warning\"\n >\n <Typography style=\"body2\">\n <Trans\n i18nKey=\"neetoMolecules.subscription.paymentFailedNotification\"\n components={{\n a: (\n <Button\n href={customerPortalUrl}\n rel=\"noreferrer\"\n style=\"link\"\n target=\"_blank\"\n />\n ),\n }}\n values={{\n downgradeScheduledAt: dateFormat.date(downgradeScheduledAt),\n }}\n />\n </Typography>\n </Callout>\n )\n )}\n </>\n );\n};\n\nexport default SubscriptionNotificationsContainer;\n"],"names":["QUERY_KEYS","SUBSCRIPTIONS_LIST","SUBSCRIPTION_STATUS","past_due","fetchSubscriptions","axios","get","subscriptionsApi","useFetchSubscriptions","useQuery","queryKey","queryFn","SubscriptionNotificationsContainer","_useFetchSubscription","_useFetchSubscription2","data","_useFetchSubscription3","_useFetchSubscription4","clientAppSubscriptions","visibleNotifications","filterBy","status","_jsx","_Fragment","children","map","_ref","index","downgradeScheduledAt","customerPortalUrl","Callout","className","style","Typography","Trans","i18nKey","components","a","Button","href","rel","target","values","dateFormat","date"],"mappings":";;;;;;;;;;;;;AAAO,IAAMA,UAAU,GAAG;AACxBC,EAAAA,kBAAkB,EAAE,oBAAA;AACtB,CAAC,CAAA;AAEM,IAAMC,mBAAmB,GAAG;AAAEC,EAAAA,QAAQ,EAAE,UAAA;AAAW,CAAC;;;;;ACF3D,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,GAAA;AAAA,EAAA,OACtBC,KAAK,CAACC,GAAG,CAAC,uCAAuC,CAAC,CAAA;AAAA,CAAA,CAAA;AAEpD,IAAMC,gBAAgB,GAAG;AAAEH,EAAAA,kBAAkB,EAAlBA,kBAAAA;AAAmB,CAAC;;ACA/C,IAAQH,kBAAkB,GAAKD,UAAU,CAAjCC,kBAAkB,CAAA;AAE1B,IAAMO,qBAAqB,GAAG,SAAxBA,qBAAqBA,GAAA;AAAA,EAAA,OACzBC,mBAAQ,CAAC;IACPC,QAAQ,EAAE,CAACT,kBAAkB,CAAC;IAC9BU,OAAO,EAAEJ,gBAAgB,CAACH,kBAAAA;AAC5B,GAAC,CAAC,CAAA;AAAA,CAAA;;ACFJ,IAAMQ,kCAAkC,GAAG,SAArCA,kCAAkCA,GAAS;AAC/C,EAAA,IAAAC,qBAAA,GACEL,qBAAqB,EAAE;IAAAM,sBAAA,GAAAD,qBAAA,CADjBE,IAAI;AAAAC,IAAAA,sBAAA,GAAAF,sBAAA,KAAA,KAAA,CAAA,GAA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;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-molecules",
3
- "version": "3.15.30",
3
+ "version": "3.15.32",
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>",
@@ -209,53 +209,6 @@
209
209
  "productIsDisabled": "The product '{{productName, anyCase}}' is disabled for this workspace. Please enable the product to enable this widget."
210
210
  }
211
211
  },
212
- "customDomain": {
213
- "customDomain_one": "Custom domain",
214
- "customDomain_other": "Custom domains",
215
- "customDomainWithCount_one": "{{count}} custom domain",
216
- "customDomainWithCount_other": "{{count}} custom domains",
217
- "settings": "Custom domain settings",
218
- "yourDomain": "Your domain",
219
- "addNew": "Add new custom domain",
220
- "delete": "Delete custom domain?",
221
- "search": "Search custom domains",
222
- "notFound": "There are no custom domains to show.",
223
- "placeholder": "help.neeto.com",
224
- "cname": "CNAME",
225
- "label": "Enter domain",
226
- "domainValidation": "Domain validation",
227
- "domainRedirection": "Domain redirection",
228
- "cnameRecordInfo": "Go to your domain host's DNS settings to add the following CNAME record.{{proxyMessage, anyCase}} <Link>View help article</Link> for more information.",
229
- "proxyMessage": " Do not enable proxy for the record.",
230
- "domainRedirectionInfo": "It can take up to 2-24 hours for your custom domain to start working. Please visit your site in 24 hours from now and if after 24 hours <strong>{{hostname}}</strong> is not working then please view <Link>help article</Link> for more information and contact us.",
231
- "domainValidationInfo": "CNAME record not found, if you added CNAME record in last 24 hours then please wait sometime and try it again. Verifying your domain usually only takes a few hours, but in some cases can take up to 24-48 hours. View <Link>help article</Link> for more information.",
232
- "learnMoreMessage": "Learn about <button>how to setup custom domains</button>",
233
- "cnameAdded": "I have added redirection CNAME record",
234
- "description": "Add domain of your choice in case you do not prefer to use the default neeto domain.",
235
- "validation": {
236
- "successMessage": "Custom domain successfully validated.",
237
- "buttonLabel": {
238
- "domain": "Validate"
239
- }
240
- },
241
- "status": {
242
- "domain": {
243
- "active": "Domain validated",
244
- "pendingCnameValidation": "Domain validated",
245
- "pendingDomainValidation": "Domain validation pending"
246
- },
247
- "cname": {
248
- "active": "Domain redirected",
249
- "pendingCnameValidation": "Domain redirection pending"
250
- },
251
- "failed": "Failed"
252
- },
253
- "alertMessage": "You are permanently deleting the custom domain <strong>{{hostname}}</strong> and will no longer point to your default domain. This can't be undone.",
254
- "formikValidation": {
255
- "required": "Domain is required",
256
- "valid": "Please add valid domain or URL"
257
- }
258
- },
259
212
  "downloadMobileAppCallout": {
260
213
  "message": "Noticed that you're on a mobile device. For the best experience, <a>download our mobile app</a>."
261
214
  },
@@ -845,6 +798,9 @@
845
798
  "advancedSearch": "Advanced search",
846
799
  "noDataTitle": "No matches found.",
847
800
  "noDataDesc": "Try refining your keywords."
801
+ },
802
+ "subscription": {
803
+ "paymentFailedNotification": "<strong>Action required: </strong> Your subscription payment has failed. <a>Click here</a> for details. If no action is taken, your subscription will be downgraded by {{downgradeScheduledAt, anyCase}}."
848
804
  }
849
805
  }
850
806
  }
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+
3
+ /**
4
+ *
5
+ * A container that shows subscription notifications for the current workspace, if available.
6
+ *
7
+ * Notifications are automatically fetched from NeetoAuth and displayed within the container.
8
+ *
9
+ * @example
10
+ *
11
+ * import SubscriptionNotificationsContainer from "@bigbinary/neeto-molecules/SubscriptionNotificationsContainer";
12
+ *
13
+ * const Main = () => (
14
+ * <>
15
+ * <ToastContainer />
16
+ * <SubscriptionNotificationsContainer />
17
+ * <Switch>
18
+ * <Route />
19
+ * </Switch>
20
+ * </>
21
+ * );
22
+ * @endexample
23
+ */
24
+ declare const SubscriptionNotificationsContainer: React.FC<{}>;
25
+
26
+ export { SubscriptionNotificationsContainer as default };
@@ -1,137 +0,0 @@
1
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
- import { useState } from 'react';
3
- import { isNotEmpty, noop } from '@bigbinary/neeto-cist';
4
- import { SINGULAR } from '@bigbinary/neeto-commons-frontend/constants';
5
- import { hyphenize } from '@bigbinary/neeto-commons-frontend/utils/general';
6
- import NeetoUICustomDomainIcon from '@bigbinary/neeto-icons/CustomDomain';
7
- import Button from '@bigbinary/neetoui/Button';
8
- import Tag from '@bigbinary/neetoui/Tag';
9
- import Spinner from '@bigbinary/neetoui/Spinner';
10
- import { useTranslation } from 'react-i18next';
11
- import { u as useFetchCustomDomains, a as useDeleteCustomDomain, M as Manage, D as DeleteAlert } from './index-7O-LlcxR.js';
12
- import MoreDropdown from './MoreDropdown.js';
13
- import { jsx, jsxs } from 'react/jsx-runtime';
14
- import '@bigbinary/neeto-commons-frontend/react-utils';
15
- import '@bigbinary/neetoui/Alert';
16
- import '@bigbinary/neetoui/Pane';
17
- import './inject-css-DmrvuTKK.js';
18
- import '@bigbinary/neetoui/Typography';
19
- import '@bigbinary/neetoui/formik/ActionBlock';
20
- import '@bigbinary/neetoui/formik/Input';
21
- import '@bigbinary/neetoui/formik/Form';
22
- import 'i18next';
23
- import 'yup';
24
- import '@babel/runtime/helpers/defineProperty';
25
- import '@tanstack/react-query';
26
- import '@bigbinary/neeto-commons-frontend/react-utils/useMutationWithInvalidation';
27
- import 'axios';
28
- import '@bigbinary/neetoui/Table';
29
- import '@bigbinary/neetoui/Checkbox';
30
- import '@bigbinary/neetoui/Callout';
31
- import './TableWrapper.js';
32
- import 'classnames';
33
- import '@bigbinary/neetoui/Stepper';
34
- import './CopyToClipboardButton.js';
35
- import '@babel/runtime/helpers/objectWithoutProperties';
36
- import '@bigbinary/neeto-icons/Copy';
37
- import '@bigbinary/neeto-icons/Check';
38
- import 'ramda';
39
- import '@bigbinary/neetoui/Toastr';
40
- import '@bigbinary/neeto-icons/MenuHorizontal';
41
- import '@bigbinary/neeto-icons/MenuVertical';
42
- import '@bigbinary/neetoui/Dropdown';
43
- import '@bigbinary/neetoui/Tooltip';
44
-
45
- var CustomDomain = function CustomDomain(_ref) {
46
- var url = _ref.url,
47
- iconOnly = _ref.iconOnly,
48
- onCreate = _ref.onCreate;
49
- var _useState = useState(false),
50
- _useState2 = _slicedToArray(_useState, 2),
51
- isPaneOpen = _useState2[0],
52
- setIsPaneOpen = _useState2[1];
53
- var _useState3 = useState(false),
54
- _useState4 = _slicedToArray(_useState3, 2),
55
- isAlertOpen = _useState4[0],
56
- setIsAlertOpen = _useState4[1];
57
- var _useTranslation = useTranslation(),
58
- t = _useTranslation.t;
59
- var _useFetchCustomDomain = useFetchCustomDomains({
60
- url: url
61
- }),
62
- customDomain = _useFetchCustomDomain.data,
63
- isLoading = _useFetchCustomDomain.isLoading;
64
- var _useDeleteCustomDomai = useDeleteCustomDomain(url, {
65
- onSettled: function onSettled() {
66
- return setIsAlertOpen(false);
67
- }
68
- }),
69
- deleteCustomDomain = _useDeleteCustomDomai.mutate,
70
- isDeleting = _useDeleteCustomDomai.isPending;
71
- var actions = [{
72
- key: "edit",
73
- label: t("neetoMolecules.common.actions.edit"),
74
- onClick: function onClick() {
75
- return setIsPaneOpen(true);
76
- }
77
- }, {
78
- key: "delete",
79
- label: t("neetoMolecules.common.actions.delete"),
80
- onClick: function onClick() {
81
- return setIsAlertOpen(true);
82
- }
83
- }];
84
- if (isLoading) return /*#__PURE__*/jsx(Spinner, {});
85
- return /*#__PURE__*/jsxs("div", {
86
- children: [isNotEmpty(customDomain) ? /*#__PURE__*/jsxs("div", {
87
- className: "flex flex-row items-center",
88
- children: [/*#__PURE__*/jsx(Tag, {
89
- "data-cy": "".concat(hyphenize(customDomain.status), "-tag-container"),
90
- label: customDomain === null || customDomain === void 0 ? void 0 : customDomain.hostname,
91
- style: customDomain.status === "active" ? "success" : "warning"
92
- }), /*#__PURE__*/jsx(MoreDropdown, {
93
- menuItems: actions,
94
- dropdownButtonProps: {
95
- "data-testid": "nui-dropdown-icon",
96
- strategy: "fixed",
97
- "data-cy": "custom-domain-menu-button"
98
- }
99
- })]
100
- }) : /*#__PURE__*/jsx(Button, {
101
- icon: iconOnly && NeetoUICustomDomainIcon,
102
- style: "text",
103
- label: iconOnly ? "" : t("neetoMolecules.common.actions.add", {
104
- entity: t("neetoMolecules.customDomain.customDomain", SINGULAR)
105
- }),
106
- tooltipProps: iconOnly && {
107
- content: t("neetoMolecules.customDomain.customDomain", SINGULAR)
108
- },
109
- onClick: function onClick() {
110
- return setIsPaneOpen(true);
111
- }
112
- }), /*#__PURE__*/jsx(Manage, {
113
- customDomain: customDomain,
114
- onCreate: onCreate,
115
- url: url,
116
- hasOne: true,
117
- isOpen: isPaneOpen,
118
- setCustomDomain: noop,
119
- onClose: function onClose() {
120
- return setIsPaneOpen(false);
121
- }
122
- }), /*#__PURE__*/jsx(DeleteAlert, {
123
- hostname: customDomain === null || customDomain === void 0 ? void 0 : customDomain.hostname,
124
- isOpen: isAlertOpen,
125
- isSubmitting: isDeleting,
126
- onClose: function onClose() {
127
- return setIsAlertOpen(false);
128
- },
129
- onSubmit: function onSubmit() {
130
- return deleteCustomDomain();
131
- }
132
- })]
133
- });
134
- };
135
-
136
- export { CustomDomain as default };
137
- //# sourceMappingURL=CustomDomain.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CustomDomain.js","sources":["../src/components/CustomDomain/index.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { isNotEmpty, noop } from \"neetocist\";\nimport { SINGULAR } from \"neetocommons/constants\";\nimport { hyphenize } from \"neetocommons/utils/general\";\nimport { CustomDomain as NeetoUICustomDomainIcon } from \"neetoicons\";\nimport { Button, Tag, Spinner } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport DeleteAlert from \"components/CustomDomainDashboard/DeleteAlert\";\nimport ManageDomain from \"components/CustomDomainDashboard/Manage\";\nimport {\n useFetchCustomDomains,\n useDeleteCustomDomain,\n} from \"components/CustomDomainDashboard/useCustomDomainApi\";\nimport MoreDropdown from \"components/MoreDropdown\";\n\nconst CustomDomain = ({ url, iconOnly, onCreate }) => {\n const [isPaneOpen, setIsPaneOpen] = useState(false);\n const [isAlertOpen, setIsAlertOpen] = useState(false);\n const { t } = useTranslation();\n\n const { data: customDomain, isLoading } = useFetchCustomDomains({ url });\n\n const { mutate: deleteCustomDomain, isPending: isDeleting } =\n useDeleteCustomDomain(url, { onSettled: () => setIsAlertOpen(false) });\n\n const actions = [\n {\n key: \"edit\",\n label: t(\"neetoMolecules.common.actions.edit\"),\n onClick: () => setIsPaneOpen(true),\n },\n {\n key: \"delete\",\n label: t(\"neetoMolecules.common.actions.delete\"),\n onClick: () => setIsAlertOpen(true),\n },\n ];\n\n if (isLoading) return <Spinner />;\n\n return (\n <div>\n {isNotEmpty(customDomain) ? (\n <div className=\"flex flex-row items-center\">\n <Tag\n data-cy={`${hyphenize(customDomain.status)}-tag-container`}\n label={customDomain?.hostname}\n style={customDomain.status === \"active\" ? \"success\" : \"warning\"}\n />\n <MoreDropdown\n menuItems={actions}\n dropdownButtonProps={{\n \"data-testid\": \"nui-dropdown-icon\",\n strategy: \"fixed\",\n \"data-cy\": \"custom-domain-menu-button\",\n }}\n />\n </div>\n ) : (\n <Button\n icon={iconOnly && NeetoUICustomDomainIcon}\n style=\"text\"\n label={\n iconOnly\n ? \"\"\n : t(\"neetoMolecules.common.actions.add\", {\n entity: t(\n \"neetoMolecules.customDomain.customDomain\",\n SINGULAR\n ),\n })\n }\n tooltipProps={\n iconOnly && {\n content: t(\"neetoMolecules.customDomain.customDomain\", SINGULAR),\n }\n }\n onClick={() => setIsPaneOpen(true)}\n />\n )}\n <ManageDomain\n {...{ customDomain, onCreate, url }}\n hasOne\n isOpen={isPaneOpen}\n setCustomDomain={noop}\n onClose={() => setIsPaneOpen(false)}\n />\n <DeleteAlert\n hostname={customDomain?.hostname}\n isOpen={isAlertOpen}\n isSubmitting={isDeleting}\n onClose={() => setIsAlertOpen(false)}\n onSubmit={() => deleteCustomDomain()}\n />\n </div>\n );\n};\n\nCustomDomain.propTypes = {\n /**\n * API path to manage custom domain records.\n */\n url: PropTypes.string,\n /**\n * Pass this prop if you need a icon button without label.\n */\n iconOnly: PropTypes.bool,\n /**\n * Callback function will be invoked with new domain values after successfully creating the domain.\n */\n onCreate: PropTypes.func,\n};\n\nexport default CustomDomain;\n"],"names":["CustomDomain","_ref","url","iconOnly","onCreate","_useState","useState","_useState2","_slicedToArray","isPaneOpen","setIsPaneOpen","_useState3","_useState4","isAlertOpen","setIsAlertOpen","_useTranslation","useTranslation","t","_useFetchCustomDomain","useFetchCustomDomains","customDomain","data","isLoading","_useDeleteCustomDomai","useDeleteCustomDomain","onSettled","deleteCustomDomain","mutate","isDeleting","isPending","actions","key","label","onClick","_jsx","Spinner","_jsxs","children","isNotEmpty","className","Tag","concat","hyphenize","status","hostname","style","MoreDropdown","menuItems","dropdownButtonProps","strategy","Button","icon","NeetoUICustomDomainIcon","entity","SINGULAR","tooltipProps","content","ManageDomain","hasOne","isOpen","setCustomDomain","noop","onClose","DeleteAlert","isSubmitting","onSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAoC;AAAA,EAAA,IAA9BC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ,CAAA;AAC7C,EAAA,IAAAC,SAAA,GAAoCC,QAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAA5CI,IAAAA,UAAU,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,aAAa,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAChC,EAAA,IAAAI,UAAA,GAAsCL,QAAQ,CAAC,KAAK,CAAC;IAAAM,UAAA,GAAAJ,cAAA,CAAAG,UAAA,EAAA,CAAA,CAAA;AAA9CE,IAAAA,WAAW,GAAAD,UAAA,CAAA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