@bigbinary/neeto-molecules 3.16.24 → 3.16.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/DocumentEditor.js
CHANGED
|
@@ -20,7 +20,7 @@ var DEFAULT_EDITOR_PROPS = {
|
|
|
20
20
|
size: "medium"
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
var css = ".neeto-molecules-document__wrapper{height:100%}@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:48rem!important;width:100%}.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:1.5rem 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:2.625rem;font-weight:700;line-height:3rem;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:2.25rem}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:.75rem auto}.neeto-molecules-document__wrapper .ProseMirror{flex-grow:1;height:auto;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:.375rem}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:46.875rem;padding-left:0!important;padding-right:0!important}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper button.neeto-editor-fixed-menu__item{flex-shrink:0}@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:.75rem 1rem
|
|
23
|
+
var css = ".neeto-molecules-document__wrapper{height:100%}@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:48rem!important;width:100%}.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:1.5rem 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:2.625rem;font-weight:700;line-height:3rem;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:2.25rem}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:.75rem auto}.neeto-molecules-document__wrapper .ProseMirror{flex-grow:1;height:auto;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:.375rem}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:46.875rem;padding-left:0!important;padding-right:0!important}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper button.neeto-editor-fixed-menu__item{flex-shrink:0}@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:.75rem 1rem 2rem!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:.75rem auto 0;max-width:48rem!important;padding-left:1rem;padding-right:1rem}.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:48rem!important;padding-left:1rem;padding-right:1rem}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.neeto-molecules-document__wrapper ins{background-color:#c1f4cb!important;text-decoration:none!important}.neeto-molecules-document__wrapper del{background-color:#faa!important}";
|
|
24
24
|
n(css,{});
|
|
25
25
|
|
|
26
26
|
var useEditor = function useEditor(_ref) {
|
package/dist/DynamicVariables.js
CHANGED
|
@@ -93,7 +93,7 @@ var DynamicVariables = function DynamicVariables(_ref) {
|
|
|
93
93
|
children: label
|
|
94
94
|
}), /*#__PURE__*/jsx("div", {
|
|
95
95
|
className: "neeto-molecules-dynamic-variables__list",
|
|
96
|
-
"data-cy": "dynamic-variables-list",
|
|
96
|
+
"data-cy": joinHyphenCase("dynamic-variables-list", label),
|
|
97
97
|
children: variables.map(function (item) {
|
|
98
98
|
return /*#__PURE__*/jsx("button", {
|
|
99
99
|
"data-cy": joinHyphenCase("dynamic-variables-list-item", item.label),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicVariables.js","sources":["../src/components/DynamicVariables/utils.js","../src/components/DynamicVariables/index.jsx"],"sourcesContent":["import { findBy } from \"neetocist\";\nimport { prop, isEmpty, uniqBy, mergeLeft } from \"ramda\";\n\nexport const parseVariables = (variableArr = []) => {\n const uncategorized = [];\n const groupedVariables = [];\n const categorySet = new Set();\n\n variableArr.forEach(variable => {\n const { category, label, variables } = variable;\n if (category && variables) {\n const parsedVariables = variables.map(\n mergeLeft({ category, categoryLabel: label })\n );\n\n if (!categorySet.has(category)) {\n categorySet.add(category);\n groupedVariables.push({ label, variables: parsedVariables });\n } else {\n const existingGroup = findBy({ label }, groupedVariables);\n\n existingGroup.variables = uniqBy(\n prop(\"key\"),\n existingGroup.variables.concat(parsedVariables)\n );\n }\n } else {\n uncategorized.push(variable);\n }\n });\n\n if (!isEmpty(uncategorized)) {\n groupedVariables.push({\n label: !isEmpty(groupedVariables) ? \"Others\" : null,\n variables: uncategorized,\n });\n }\n\n return groupedVariables;\n};\n","import { Fragment } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Braces } from \"neetoicons\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport \"./dynamic-variables.scss\";\nimport { parseVariables } from \"./utils\";\n\nconst { Menu } = Dropdown;\n\nconst DynamicVariables = ({\n onVariableClick = noop,\n variables = [],\n buttonProps,\n ...dropdownProps\n}) => {\n if (isEmpty(variables)) {\n return null;\n }\n\n const parsedVariables = parseVariables(variables);\n\n return (\n <Dropdown\n appendTo={() => document.body}\n buttonStyle=\"secondary\"\n icon={Braces}\n strategy=\"fixed\"\n zIndex={99999}\n buttonProps={{\n \"data-testid\": \"variables-dropdown\",\n \"data-cy\": \"dynamic-variables-button\",\n ...buttonProps,\n }}\n {...dropdownProps}\n >\n <Menu>\n <div\n className=\"neeto-molecules-dynamic-variables\"\n data-testid=\"variables-list\"\n >\n {parsedVariables.map(({ label, variables }) => (\n <Fragment key={label}>\n {label && <Typography style=\"h6\">{label}</Typography>}\n <div\n className=\"neeto-molecules-dynamic-variables__list\"\n data-cy
|
|
1
|
+
{"version":3,"file":"DynamicVariables.js","sources":["../src/components/DynamicVariables/utils.js","../src/components/DynamicVariables/index.jsx"],"sourcesContent":["import { findBy } from \"neetocist\";\nimport { prop, isEmpty, uniqBy, mergeLeft } from \"ramda\";\n\nexport const parseVariables = (variableArr = []) => {\n const uncategorized = [];\n const groupedVariables = [];\n const categorySet = new Set();\n\n variableArr.forEach(variable => {\n const { category, label, variables } = variable;\n if (category && variables) {\n const parsedVariables = variables.map(\n mergeLeft({ category, categoryLabel: label })\n );\n\n if (!categorySet.has(category)) {\n categorySet.add(category);\n groupedVariables.push({ label, variables: parsedVariables });\n } else {\n const existingGroup = findBy({ label }, groupedVariables);\n\n existingGroup.variables = uniqBy(\n prop(\"key\"),\n existingGroup.variables.concat(parsedVariables)\n );\n }\n } else {\n uncategorized.push(variable);\n }\n });\n\n if (!isEmpty(uncategorized)) {\n groupedVariables.push({\n label: !isEmpty(groupedVariables) ? \"Others\" : null,\n variables: uncategorized,\n });\n }\n\n return groupedVariables;\n};\n","import { Fragment } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Braces } from \"neetoicons\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport \"./dynamic-variables.scss\";\nimport { parseVariables } from \"./utils\";\n\nconst { Menu } = Dropdown;\n\nconst DynamicVariables = ({\n onVariableClick = noop,\n variables = [],\n buttonProps,\n ...dropdownProps\n}) => {\n if (isEmpty(variables)) {\n return null;\n }\n\n const parsedVariables = parseVariables(variables);\n\n return (\n <Dropdown\n appendTo={() => document.body}\n buttonStyle=\"secondary\"\n icon={Braces}\n strategy=\"fixed\"\n zIndex={99999}\n buttonProps={{\n \"data-testid\": \"variables-dropdown\",\n \"data-cy\": \"dynamic-variables-button\",\n ...buttonProps,\n }}\n {...dropdownProps}\n >\n <Menu>\n <div\n className=\"neeto-molecules-dynamic-variables\"\n data-testid=\"variables-list\"\n >\n {parsedVariables.map(({ label, variables }) => (\n <Fragment key={label}>\n {label && <Typography style=\"h6\">{label}</Typography>}\n <div\n className=\"neeto-molecules-dynamic-variables__list\"\n data-cy={joinHyphenCase(\"dynamic-variables-list\", label)}\n >\n {variables.map(item => (\n <button\n key={item.label}\n data-cy={joinHyphenCase(\n \"dynamic-variables-list-item\",\n item.label\n )}\n onClick={() => onVariableClick(item)}\n >\n {item.label}\n </button>\n ))}\n </div>\n </Fragment>\n ))}\n </div>\n </Menu>\n </Dropdown>\n );\n};\n\nDynamicVariables.propTypes = {\n /**\n * A function that is triggered when a dynamic variable button is clicked. It receives an object containing information about the clicked variable.\n */\n onVariableClick: PropTypes.func,\n /**\n * An array of objects, each representing a category or standalone variable, with the ability to define a label, key, and default value for each variable.\n */\n variables: PropTypes.arrayOf(\n PropTypes.shape({ label: PropTypes.string, key: PropTypes.string })\n ),\n};\n\nexport default DynamicVariables;\n"],"names":["parseVariables","variableArr","arguments","length","undefined","uncategorized","groupedVariables","categorySet","Set","forEach","variable","category","label","variables","parsedVariables","map","mergeLeft","categoryLabel","has","add","push","existingGroup","findBy","uniqBy","prop","concat","isEmpty","Menu","Dropdown","DynamicVariables","_ref","_ref$onVariableClick","onVariableClick","noop","_ref$variables","buttonProps","dropdownProps","_objectWithoutProperties","_excluded","_jsx","_objectSpread","appendTo","document","body","buttonStyle","icon","Braces","strategy","zIndex","children","className","_ref2","_jsxs","Fragment","Typography","style","joinHyphenCase","item","onClick"],"mappings":";;;;;;;;;;;;;;;AAGO,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,GAAyB;AAAA,EAAA,IAArBC,WAAW,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;EAC7C,IAAMG,aAAa,GAAG,EAAE,CAAA;EACxB,IAAMC,gBAAgB,GAAG,EAAE,CAAA;AAC3B,EAAA,IAAMC,WAAW,GAAG,IAAIC,GAAG,EAAE,CAAA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+22,7 @@ var DEFAULT_EDITOR_PROPS = {
|
|
|
22
22
|
size: "medium"
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
var css = ".neeto-molecules-document__wrapper{height:100%}@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:48rem!important;width:100%}.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:1.5rem 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:2.625rem;font-weight:700;line-height:3rem;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:2.25rem}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:.75rem auto}.neeto-molecules-document__wrapper .ProseMirror{flex-grow:1;height:auto;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:.375rem}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:46.875rem;padding-left:0!important;padding-right:0!important}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper button.neeto-editor-fixed-menu__item{flex-shrink:0}@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:.75rem 1rem
|
|
25
|
+
var css = ".neeto-molecules-document__wrapper{height:100%}@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:48rem!important;width:100%}.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:1.5rem 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:2.625rem;font-weight:700;line-height:3rem;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:2.25rem}}.neeto-molecules-document__wrapper .neeto-molecules-editor-content__error{margin:.75rem auto}.neeto-molecules-document__wrapper .ProseMirror{flex-grow:1;height:auto;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:.375rem}}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper{margin:0 auto;max-width:46.875rem;padding-left:0!important;padding-right:0!important}.neeto-molecules-document__wrapper .neeto-editor-fixed-menu__wrapper button.neeto-editor-fixed-menu__item{flex-shrink:0}@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:.75rem 1rem 2rem!important;width:100%!important}.neeto-molecules-document__wrapper .editor-content-attachments{border:none;margin:.75rem auto 0;max-width:48rem!important;padding-left:1rem;padding-right:1rem}.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:48rem!important;padding-left:1rem;padding-right:1rem}.neeto-molecules-document__wrapper .ne-attachments__wrapper{width:100%}.neeto-molecules-document__wrapper ins{background-color:#c1f4cb!important;text-decoration:none!important}.neeto-molecules-document__wrapper del{background-color:#faa!important}";
|
|
26
26
|
injectCss.n(css,{});
|
|
27
27
|
|
|
28
28
|
var useEditor = function useEditor(_ref) {
|
|
@@ -95,7 +95,7 @@ var DynamicVariables = function DynamicVariables(_ref) {
|
|
|
95
95
|
children: label
|
|
96
96
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
97
97
|
className: "neeto-molecules-dynamic-variables__list",
|
|
98
|
-
"data-cy": "dynamic-variables-list",
|
|
98
|
+
"data-cy": general.joinHyphenCase("dynamic-variables-list", label),
|
|
99
99
|
children: variables.map(function (item) {
|
|
100
100
|
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
101
101
|
"data-cy": general.joinHyphenCase("dynamic-variables-list-item", item.label),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicVariables.js","sources":["../../src/components/DynamicVariables/utils.js","../../src/components/DynamicVariables/index.jsx"],"sourcesContent":["import { findBy } from \"neetocist\";\nimport { prop, isEmpty, uniqBy, mergeLeft } from \"ramda\";\n\nexport const parseVariables = (variableArr = []) => {\n const uncategorized = [];\n const groupedVariables = [];\n const categorySet = new Set();\n\n variableArr.forEach(variable => {\n const { category, label, variables } = variable;\n if (category && variables) {\n const parsedVariables = variables.map(\n mergeLeft({ category, categoryLabel: label })\n );\n\n if (!categorySet.has(category)) {\n categorySet.add(category);\n groupedVariables.push({ label, variables: parsedVariables });\n } else {\n const existingGroup = findBy({ label }, groupedVariables);\n\n existingGroup.variables = uniqBy(\n prop(\"key\"),\n existingGroup.variables.concat(parsedVariables)\n );\n }\n } else {\n uncategorized.push(variable);\n }\n });\n\n if (!isEmpty(uncategorized)) {\n groupedVariables.push({\n label: !isEmpty(groupedVariables) ? \"Others\" : null,\n variables: uncategorized,\n });\n }\n\n return groupedVariables;\n};\n","import { Fragment } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Braces } from \"neetoicons\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport \"./dynamic-variables.scss\";\nimport { parseVariables } from \"./utils\";\n\nconst { Menu } = Dropdown;\n\nconst DynamicVariables = ({\n onVariableClick = noop,\n variables = [],\n buttonProps,\n ...dropdownProps\n}) => {\n if (isEmpty(variables)) {\n return null;\n }\n\n const parsedVariables = parseVariables(variables);\n\n return (\n <Dropdown\n appendTo={() => document.body}\n buttonStyle=\"secondary\"\n icon={Braces}\n strategy=\"fixed\"\n zIndex={99999}\n buttonProps={{\n \"data-testid\": \"variables-dropdown\",\n \"data-cy\": \"dynamic-variables-button\",\n ...buttonProps,\n }}\n {...dropdownProps}\n >\n <Menu>\n <div\n className=\"neeto-molecules-dynamic-variables\"\n data-testid=\"variables-list\"\n >\n {parsedVariables.map(({ label, variables }) => (\n <Fragment key={label}>\n {label && <Typography style=\"h6\">{label}</Typography>}\n <div\n className=\"neeto-molecules-dynamic-variables__list\"\n data-cy
|
|
1
|
+
{"version":3,"file":"DynamicVariables.js","sources":["../../src/components/DynamicVariables/utils.js","../../src/components/DynamicVariables/index.jsx"],"sourcesContent":["import { findBy } from \"neetocist\";\nimport { prop, isEmpty, uniqBy, mergeLeft } from \"ramda\";\n\nexport const parseVariables = (variableArr = []) => {\n const uncategorized = [];\n const groupedVariables = [];\n const categorySet = new Set();\n\n variableArr.forEach(variable => {\n const { category, label, variables } = variable;\n if (category && variables) {\n const parsedVariables = variables.map(\n mergeLeft({ category, categoryLabel: label })\n );\n\n if (!categorySet.has(category)) {\n categorySet.add(category);\n groupedVariables.push({ label, variables: parsedVariables });\n } else {\n const existingGroup = findBy({ label }, groupedVariables);\n\n existingGroup.variables = uniqBy(\n prop(\"key\"),\n existingGroup.variables.concat(parsedVariables)\n );\n }\n } else {\n uncategorized.push(variable);\n }\n });\n\n if (!isEmpty(uncategorized)) {\n groupedVariables.push({\n label: !isEmpty(groupedVariables) ? \"Others\" : null,\n variables: uncategorized,\n });\n }\n\n return groupedVariables;\n};\n","import { Fragment } from \"react\";\n\nimport { noop } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Braces } from \"neetoicons\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { isEmpty } from \"ramda\";\n\nimport \"./dynamic-variables.scss\";\nimport { parseVariables } from \"./utils\";\n\nconst { Menu } = Dropdown;\n\nconst DynamicVariables = ({\n onVariableClick = noop,\n variables = [],\n buttonProps,\n ...dropdownProps\n}) => {\n if (isEmpty(variables)) {\n return null;\n }\n\n const parsedVariables = parseVariables(variables);\n\n return (\n <Dropdown\n appendTo={() => document.body}\n buttonStyle=\"secondary\"\n icon={Braces}\n strategy=\"fixed\"\n zIndex={99999}\n buttonProps={{\n \"data-testid\": \"variables-dropdown\",\n \"data-cy\": \"dynamic-variables-button\",\n ...buttonProps,\n }}\n {...dropdownProps}\n >\n <Menu>\n <div\n className=\"neeto-molecules-dynamic-variables\"\n data-testid=\"variables-list\"\n >\n {parsedVariables.map(({ label, variables }) => (\n <Fragment key={label}>\n {label && <Typography style=\"h6\">{label}</Typography>}\n <div\n className=\"neeto-molecules-dynamic-variables__list\"\n data-cy={joinHyphenCase(\"dynamic-variables-list\", label)}\n >\n {variables.map(item => (\n <button\n key={item.label}\n data-cy={joinHyphenCase(\n \"dynamic-variables-list-item\",\n item.label\n )}\n onClick={() => onVariableClick(item)}\n >\n {item.label}\n </button>\n ))}\n </div>\n </Fragment>\n ))}\n </div>\n </Menu>\n </Dropdown>\n );\n};\n\nDynamicVariables.propTypes = {\n /**\n * A function that is triggered when a dynamic variable button is clicked. It receives an object containing information about the clicked variable.\n */\n onVariableClick: PropTypes.func,\n /**\n * An array of objects, each representing a category or standalone variable, with the ability to define a label, key, and default value for each variable.\n */\n variables: PropTypes.arrayOf(\n PropTypes.shape({ label: PropTypes.string, key: PropTypes.string })\n ),\n};\n\nexport default DynamicVariables;\n"],"names":["parseVariables","variableArr","arguments","length","undefined","uncategorized","groupedVariables","categorySet","Set","forEach","variable","category","label","variables","parsedVariables","map","mergeLeft","categoryLabel","has","add","push","existingGroup","findBy","uniqBy","prop","concat","isEmpty","Menu","Dropdown","DynamicVariables","_ref","_ref$onVariableClick","onVariableClick","noop","_ref$variables","buttonProps","dropdownProps","_objectWithoutProperties","_excluded","_jsx","_objectSpread","appendTo","document","body","buttonStyle","icon","Braces","strategy","zIndex","children","className","_ref2","_jsxs","Fragment","Typography","style","joinHyphenCase","item","onClick"],"mappings":";;;;;;;;;;;;;;;;;AAGO,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,GAAyB;AAAA,EAAA,IAArBC,WAAW,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,EAAE,CAAA;EAC7C,IAAMG,aAAa,GAAG,EAAE,CAAA;EACxB,IAAMC,gBAAgB,GAAG,EAAE,CAAA;AAC3B,EAAA,IAAMC,WAAW,GAAG,IAAIC,GAAG,EAAE,CAAA;AAE7BP,EAAAA,WAAW,CAACQ,OAAO,CAAC,UAAAC,QAAQ,EAAI;AAC9B,IAAA,IAAQC,QAAQ,GAAuBD,QAAQ,CAAvCC,QAAQ;MAAEC,KAAK,GAAgBF,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": "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>",
|