ece-docs-components 1.0.104 → 1.0.105

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.
Files changed (30) hide show
  1. package/dist/cjs/components/Modal.js +66 -29
  2. package/dist/cjs/components/Modal.js.map +1 -1
  3. package/dist/cjs/components/NoteBox.js +83 -74
  4. package/dist/cjs/components/NoteBox.js.map +1 -1
  5. package/dist/cjs/helpers/variableProcessing.js +2 -0
  6. package/dist/cjs/helpers/variableProcessing.js.map +1 -1
  7. package/dist/cjs/types/variable.js +11 -5
  8. package/dist/cjs/types/variable.js.map +1 -1
  9. package/dist/esm/_virtual/index8.js +2 -2
  10. package/dist/esm/_virtual/index9.js +2 -2
  11. package/dist/esm/components/Modal.d.ts +5 -11
  12. package/dist/esm/components/Modal.js +67 -30
  13. package/dist/esm/components/Modal.js.map +1 -1
  14. package/dist/esm/components/NoteBox.d.ts +1 -1
  15. package/dist/esm/components/NoteBox.js +83 -74
  16. package/dist/esm/components/NoteBox.js.map +1 -1
  17. package/dist/esm/helpers/variableProcessing.js +2 -0
  18. package/dist/esm/helpers/variableProcessing.js.map +1 -1
  19. package/dist/esm/node_modules/domhandler/lib/index.js +1 -1
  20. package/dist/esm/node_modules/domutils/lib/index.js +1 -1
  21. package/dist/esm/node_modules/entities/lib/generated/decode-data-html.js +1 -1
  22. package/dist/esm/node_modules/entities/lib/generated/decode-data-xml.js +1 -1
  23. package/dist/esm/node_modules/html-dom-parser/lib/index.js +1 -1
  24. package/dist/esm/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js +1 -1
  25. package/dist/esm/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +1 -1
  26. package/dist/esm/node_modules/style-to-object/cjs/index.js +1 -1
  27. package/dist/esm/types/variable.d.ts +39 -4
  28. package/dist/esm/types/variable.js +12 -6
  29. package/dist/esm/types/variable.js.map +1 -1
  30. package/package.json +3 -2
@@ -9,91 +9,97 @@ import { mapStatusToVariableState, mapRequirementTypeToState } from '../helpers/
9
9
  // Status based color configs (from Modal)
10
10
  const statusConfig = {
11
11
  Accepted: {
12
- highlight: '#EDF9CD',
13
- highlightSelected: '#DBF59A',
14
- label: 'Accepted',
12
+ highlight: "#EDF9CD",
13
+ highlightSelected: "#DBF59A",
14
+ label: "Accepted",
15
15
  },
16
16
  Pending: {
17
- highlight: '#F5E2FF',
18
- highlightSelected: '#EBC7FF',
19
- label: 'Pending',
20
- alertVariant: 'info',
17
+ highlight: "#F5E2FF",
18
+ highlightSelected: "#EBC7FF",
19
+ label: "Pending",
20
+ alertVariant: "info",
21
21
  },
22
- 'Action Required': {
23
- highlight: '#FBEEEE',
24
- highlightSelected: '#FFBCB3',
25
- label: 'ActionRequired',
26
- alertVariant: 'error',
22
+ "Action Required": {
23
+ highlight: "#FBEEEE",
24
+ highlightSelected: "#FFBCB3",
25
+ label: "ActionRequired",
26
+ alertVariant: "error",
27
27
  },
28
- 'Declined': {
29
- highlight: '#FFF6D1',
30
- highlightSelected: '#FDE58E',
31
- label: 'Declined',
28
+ Declined: {
29
+ highlight: "#FFF6D1",
30
+ highlightSelected: "#FDE58E",
31
+ label: "Declined",
32
32
  },
33
- 'Not Started': {
34
- highlight: '#f8c97cff',
35
- highlightSelected: '#F5A623',
36
- label: 'Not Started',
33
+ "Not Started": {
34
+ highlight: "#f8c97cff",
35
+ highlightSelected: "#F5A623",
36
+ label: "Not Started",
37
+ },
38
+ Rejected: {
39
+ highlight: "#FBEEEE",
40
+ highlightSelected: "#FFBCB3",
41
+ label: "ActionRequired",
42
+ alertVariant: "error",
37
43
  },
38
44
  Draft: {
39
- highlight: '#FFEACD',
40
- highlightSelected: '#FFC365',
41
- label: 'Draft',
45
+ highlight: "#FFEACD",
46
+ highlightSelected: "#FFC365",
47
+ label: "Draft",
42
48
  },
43
49
  };
44
50
  const NoteContainer = styled(Box)({
45
- position: 'relative',
46
- display: 'inline',
47
- maxWidth: '100%',
51
+ position: "relative",
52
+ display: "inline",
53
+ maxWidth: "100%",
48
54
  });
49
55
  // Uses highlight colors driven by status exclusively
50
56
  const HighlightWrapper = styled(Box, {
51
- shouldForwardProp: (prop) => prop !== 'isHovered' &&
52
- prop !== 'highlightColor' &&
53
- prop !== 'highlightSelectedColor'
57
+ shouldForwardProp: (prop) => prop !== "isHovered" &&
58
+ prop !== "highlightColor" &&
59
+ prop !== "highlightSelectedColor",
54
60
  })(({ isHovered, highlightColor, highlightSelectedColor }) => ({
55
- position: 'relative',
56
- display: 'inline',
57
- maxWidth: '100%',
58
- '&:hover .edit-button': {
61
+ position: "relative",
62
+ display: "inline",
63
+ maxWidth: "100%",
64
+ "&:hover .edit-button": {
59
65
  opacity: 1,
60
66
  },
61
- '& .highlight-span': {
67
+ "& .highlight-span": {
62
68
  background: isHovered ? highlightSelectedColor : highlightColor,
63
- padding: '2px 4px',
64
- borderBottom: '2px solid rgba(77, 48, 25, 0.3)',
65
- boxDecorationBreak: 'clone',
66
- WebkitBoxDecorationBreak: 'clone',
67
- transition: 'background 0.2s ease',
68
- cursor: 'pointer',
69
- fontSize: '1rem',
70
- wordWrap: 'break-word',
71
- overflowWrap: 'break-word',
72
- display: 'inline',
73
- color: '#4D3019',
69
+ padding: "2px 4px",
70
+ borderBottom: "2px solid rgba(77, 48, 25, 0.3)",
71
+ boxDecorationBreak: "clone",
72
+ WebkitBoxDecorationBreak: "clone",
73
+ transition: "background 0.2s ease",
74
+ cursor: "pointer",
75
+ fontSize: "1rem",
76
+ wordWrap: "break-word",
77
+ overflowWrap: "break-word",
78
+ display: "inline",
79
+ color: "#4D3019",
74
80
  },
75
81
  }));
76
82
  const EditButton = styled(IconButton)(({ theme }) => ({
77
83
  top: 0,
78
84
  right: 0,
79
- transform: 'translate(-50%, -50%)',
80
- position: 'relative',
85
+ transform: "translate(-50%, -50%)",
86
+ position: "relative",
81
87
  width: 20,
82
88
  height: 20,
83
89
  marginRight: -20,
84
- borderRadius: (typeof theme.shape.borderRadius === 'string'
90
+ borderRadius: (typeof theme.shape.borderRadius === "string"
85
91
  ? parseInt(theme.shape.borderRadius, 10)
86
92
  : theme.shape.borderRadius || 4) * 2,
87
- backgroundColor: '#4D3019',
93
+ backgroundColor: "#4D3019",
88
94
  opacity: 0,
89
- transition: 'all 0.2s ease',
90
- boxShadow: '0 1px 3px rgba(0,0,0,0.12)',
91
- '&:hover': {
92
- backgroundColor: '#4D3019',
93
- transform: 'translate(-50%, -50%) scale(1.1)',
95
+ transition: "all 0.2s ease",
96
+ boxShadow: "0 1px 3px rgba(0,0,0,0.12)",
97
+ "&:hover": {
98
+ backgroundColor: "#4D3019",
99
+ transform: "translate(-50%, -50%) scale(1.1)",
94
100
  },
95
101
  }));
96
- const NoteBox = ({ status, requirementType, label, note, children, className = '', onEditClick, }) => {
102
+ const NoteBox = ({ status, requirementType, label, note, children, className = "", onEditClick, }) => {
97
103
  const [isHovered, setIsHovered] = useState(false);
98
104
  // Map current status
99
105
  const variableState = mapStatusToVariableState(status);
@@ -101,39 +107,42 @@ const NoteBox = ({ status, requirementType, label, note, children, className = '
101
107
  const style = variableState
102
108
  ? statusConfig[variableState]
103
109
  : {
104
- highlight: '#EEE',
105
- highlightSelected: '#DDD'};
110
+ highlight: "#EEE",
111
+ highlightSelected: "#DDD"};
106
112
  const reqTypeConfig = {
107
113
  Default: {
108
- color: '#F5A623',
109
- highlight: '#f3bf6bff',
110
- highlightSelected: '#F5A623',
111
- label: 'Mandatory',
114
+ color: "#F5A623",
115
+ highlight: "#f3bf6bff",
116
+ highlightSelected: "#F5A623",
117
+ label: "Mandatory",
112
118
  },
113
119
  Optional: {
114
- color: '#F5D76E',
115
- highlight: '#f3e2a5ff',
116
- highlightSelected: '#F5D76E',
117
- label: 'Optional',
120
+ color: "#F5D76E",
121
+ highlight: "#f3e2a5ff",
122
+ highlightSelected: "#F5D76E",
123
+ label: "Optional",
118
124
  },
119
125
  };
120
- const requirementTypeStyle = requirementTypeState ? reqTypeConfig[requirementTypeState] :
121
- {
122
- highlight: '#EEE',
123
- highlightSelected: '#DDD'};
124
- return (jsxs(NoteContainer, { className: className, children: [variableState && style.alertVariant && note && (jsx(Alert, { variant: style.alertVariant, sx: { mb: 1 }, children: note })), jsxs(HighlightWrapper, { isHovered: isHovered, highlightColor: variableState === VariableState.NotStarted ? requirementTypeStyle.highlight : style.highlight, highlightSelectedColor: variableState === VariableState.NotStarted ? requirementTypeStyle.highlightSelected : style.highlightSelected, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: (e) => {
126
+ const requirementTypeStyle = requirementTypeState
127
+ ? reqTypeConfig[requirementTypeState]
128
+ : {
129
+ highlight: "#EEE",
130
+ highlightSelected: "#DDD"};
131
+ return (jsxs(NoteContainer, { className: className, children: [variableState && style.alertVariant && note && (jsx(Alert, { variant: style.alertVariant, sx: { mb: 1 }, children: note })), jsxs(HighlightWrapper, { isHovered: isHovered, highlightColor: variableState === VariableState.NotStarted
132
+ ? requirementTypeStyle.highlight
133
+ : style.highlight, highlightSelectedColor: variableState === VariableState.NotStarted
134
+ ? requirementTypeStyle.highlightSelected
135
+ : style.highlightSelected, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: (e) => {
125
136
  e.stopPropagation();
126
137
  if (onEditClick) {
127
138
  onEditClick();
128
139
  }
129
- }, children: [jsx("span", { className: "highlight-span", style: { display: 'inline' }, children: children }), jsx(EditButton, { className: "edit-button", onClick: (e) => {
140
+ }, children: [jsx("span", { className: "highlight-span", style: { display: "inline" }, children: children }), jsx(EditButton, { className: "edit-button", onClick: (e) => {
130
141
  e.stopPropagation();
131
142
  if (onEditClick) {
132
143
  onEditClick();
133
144
  }
134
- }, size: "small", children: variableState === VariableState.Accepted
135
- ? jsx(CheckRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } })
136
- : jsx(EditRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } }) })] })] }));
145
+ }, size: "small", children: variableState === VariableState.Accepted ? (jsx(CheckRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } })) : (jsx(EditRounded, { sx: { fontSize: 14, color: "#FFFFFF", strokeWidth: 2 } })) })] })] }));
137
146
  };
138
147
 
139
148
  export { NoteBox };
@@ -1 +1 @@
1
- {"version":3,"file":"NoteBox.js","sources":["../../../../src/components/NoteBox.tsx"],"sourcesContent":["import React, { useState } from 'react';\r\nimport { Box, Typography, IconButton, styled, Chip } from '@mui/material';\r\nimport { CheckRounded, EditRounded } from '@mui/icons-material';\r\nimport { Alert } from './Alert';\r\nimport { RequirementType, VariableState } from '../types/variable';\r\nimport { mapRequirementTypeToState, mapStatusToVariableState } from '../helpers/variableProcessing';\r\n\r\ninterface NoteBoxProps {\r\n status?: string; // Use only status now\r\n requirementType?: string;\r\n label?: string;\r\n note?: string;\r\n children: React.ReactNode;\r\n className?: string;\r\n onEditClick?: () => void;\r\n}\r\n\r\n// Status based color configs (from Modal)\r\nconst statusConfig: {\r\n [key in VariableState]: {\r\n highlight: string;\r\n highlightSelected: string;\r\n label: string;\r\n alertVariant?: \"error\" | \"info\";\r\n }\r\n} = {\r\n Accepted: {\r\n highlight: '#EDF9CD',\r\n highlightSelected: '#DBF59A',\r\n label: 'Accepted',\r\n },\r\n Pending: {\r\n highlight: '#F5E2FF',\r\n highlightSelected: '#EBC7FF',\r\n label: 'Pending',\r\n alertVariant: 'info',\r\n },\r\n 'Action Required': {\r\n highlight: '#FBEEEE',\r\n highlightSelected: '#FFBCB3',\r\n label: 'ActionRequired',\r\n alertVariant: 'error',\r\n },\r\n 'Declined': {\r\n highlight: '#FFF6D1',\r\n highlightSelected: '#FDE58E',\r\n label: 'Declined',\r\n },\r\n 'Not Started': {\r\n highlight: '#f8c97cff',\r\n highlightSelected: '#F5A623',\r\n label: 'Not Started',\r\n },\r\n Draft: {\r\n highlight: '#FFEACD',\r\n highlightSelected: '#FFC365',\r\n label: 'Draft',\r\n },\r\n};\r\n\r\nconst NoteContainer = styled(Box)({\r\n position: 'relative',\r\n display: 'inline',\r\n maxWidth: '100%',\r\n});\r\n\r\n// Uses highlight colors driven by status exclusively\r\nconst HighlightWrapper = styled(Box, {\r\n shouldForwardProp: (prop) =>\r\n prop !== 'isHovered' &&\r\n prop !== 'highlightColor' &&\r\n prop !== 'highlightSelectedColor'\r\n})<{\r\n isHovered: boolean;\r\n highlightColor: string;\r\n highlightSelectedColor: string;\r\n}>(({ isHovered, highlightColor, highlightSelectedColor }) => ({\r\n position: 'relative',\r\n display: 'inline',\r\n maxWidth: '100%',\r\n '&:hover .edit-button': {\r\n opacity: 1,\r\n },\r\n '& .highlight-span': {\r\n background: isHovered ? highlightSelectedColor : highlightColor,\r\n padding: '2px 4px',\r\n borderBottom: '2px solid rgba(77, 48, 25, 0.3)',\r\n boxDecorationBreak: 'clone',\r\n WebkitBoxDecorationBreak: 'clone',\r\n transition: 'background 0.2s ease',\r\n cursor: 'pointer',\r\n fontSize: '1rem',\r\n wordWrap: 'break-word',\r\n overflowWrap: 'break-word',\r\n display: 'inline',\r\n color: '#4D3019',\r\n },\r\n}));\r\n\r\nconst EditButton = styled(IconButton)(({ theme }) => ({\r\n top: 0,\r\n right: 0,\r\n transform: 'translate(-50%, -50%)',\r\n position: 'relative',\r\n width: 20,\r\n height: 20,\r\n marginRight: -20,\r\n borderRadius: (typeof theme.shape.borderRadius === 'string'\r\n ? parseInt(theme.shape.borderRadius, 10)\r\n : theme.shape.borderRadius || 4) * 2,\r\n backgroundColor: '#4D3019',\r\n opacity: 0,\r\n transition: 'all 0.2s ease',\r\n boxShadow: '0 1px 3px rgba(0,0,0,0.12)',\r\n '&:hover': {\r\n backgroundColor: '#4D3019',\r\n transform: 'translate(-50%, -50%) scale(1.1)',\r\n },\r\n}));\r\n\r\nexport const NoteBox: React.FC<NoteBoxProps> = ({\r\n status,\r\n requirementType,\r\n label,\r\n note,\r\n children,\r\n className = '',\r\n onEditClick,\r\n}) => {\r\n const [isHovered, setIsHovered] = useState(false);\r\n\r\n // Map current status\r\n const variableState = mapStatusToVariableState(status!!);\r\n const requirementTypeState = mapRequirementTypeToState(requirementType!!)\r\n\r\n const style = variableState\r\n ? statusConfig[variableState]\r\n : {\r\n highlight: '#EEE',\r\n highlightSelected: '#DDD',\r\n label: label || '',\r\n };\r\n\r\n\r\n const reqTypeConfig = {\r\n Default: {\r\n color: '#F5A623',\r\n highlight: '#f3bf6bff',\r\n highlightSelected: '#F5A623',\r\n label: 'Mandatory',\r\n },\r\n Optional: {\r\n color: '#F5D76E',\r\n highlight: '#f3e2a5ff',\r\n highlightSelected: '#F5D76E',\r\n label: 'Optional',\r\n },\r\n };\r\n\r\n\r\n const requirementTypeStyle = requirementTypeState ? reqTypeConfig[requirementTypeState] :\r\n {\r\n highlight: '#EEE',\r\n highlightSelected: '#DDD',\r\n label: label || '',\r\n };;\r\n\r\n \r\n return (\r\n <NoteContainer className={className}>\r\n {/* Alert for note when status matches and note available */}\r\n {variableState && style.alertVariant && note && (\r\n <Alert variant={style.alertVariant} sx={{ mb: 1 }}>\r\n {note}\r\n </Alert>\r\n )}\r\n\r\n {/* Highlighted content box */}\r\n <HighlightWrapper\r\n isHovered={isHovered}\r\n highlightColor={variableState === VariableState.NotStarted? requirementTypeStyle.highlight : style.highlight}\r\n highlightSelectedColor={variableState === VariableState.NotStarted? requirementTypeStyle.highlightSelected : style.highlightSelected}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n if (onEditClick) {\r\n onEditClick();\r\n }\r\n }}\r\n >\r\n <span className=\"highlight-span\" style={{display:'inline'}}>{children}</span>\r\n <EditButton\r\n className=\"edit-button\"\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n if (onEditClick) {\r\n onEditClick();\r\n }\r\n }}\r\n size=\"small\"\r\n >\r\n {variableState === VariableState.Accepted\r\n ? <CheckRounded sx={{ fontSize: 14, color: \"#FFFFFF\", strokeWidth: 2 }} />\r\n : <EditRounded sx={{ fontSize: 14, color: \"#FFFFFF\", strokeWidth: 2 }} /> }\r\n </EditButton>\r\n </HighlightWrapper>\r\n </NoteContainer>\r\n );\r\n};\r\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAiBA;AACA,MAAM,YAAY,GAOd;AACF,IAAA,QAAQ,EAAE;AACR,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,UAAU;AAClB,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,YAAY,EAAE,MAAM;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;AACjB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,gBAAgB;AACvB,QAAA,YAAY,EAAE,OAAO;AACtB,KAAA;AACD,IAAA,UAAU,EAAE;AACV,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,UAAU;AAClB,KAAA;AACD,IAAA,aAAa,EAAE;AACb,QAAA,SAAS,EAAE,WAAW;AACtB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,aAAa;AACrB,KAAA;AACD,IAAA,KAAK,EAAE;AACL,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,OAAO;AACf,KAAA;CACF;AAED,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAChC,IAAA,QAAQ,EAAE,UAAU;AACpB,IAAA,OAAO,EAAE,QAAQ;AACjB,IAAA,QAAQ,EAAE,MAAM;AACjB,CAAA,CAAC;AAEF;AACA,MAAM,gBAAgB,GAAG,MAAM,CA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AAY,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE,EAAA;8BACpEA,GAAA,CAAC,WAAW,EAAA,EAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE,GAAI,EAAA,CAChE,CAAA,EAAA,CACI,CAAA,EAAA,CACL;AAEpB;;;;"}
1
+ {"version":3,"file":"NoteBox.js","sources":["../../../../src/components/NoteBox.tsx"],"sourcesContent":["import React, { useState } from \"react\";\r\nimport { Box, Typography, IconButton, styled, Chip } from \"@mui/material\";\r\nimport { CheckRounded, EditRounded } from \"@mui/icons-material\";\r\nimport { Alert } from \"./Alert\";\r\nimport { RequirementType, VariableState } from \"../types/variable\";\r\nimport {\r\n mapRequirementTypeToState,\r\n mapStatusToVariableState,\r\n} from \"../helpers/variableProcessing\";\r\n\r\ninterface NoteBoxProps {\r\n status?: string; // Use only status now\r\n requirementType?: string;\r\n label?: string;\r\n note?: string;\r\n children: React.ReactNode;\r\n className?: string;\r\n onEditClick?: () => void;\r\n}\r\n\r\n// Status based color configs (from Modal)\r\nconst statusConfig: {\r\n [key in VariableState]: {\r\n highlight: string;\r\n highlightSelected: string;\r\n label: string;\r\n alertVariant?: \"error\" | \"info\";\r\n };\r\n} = {\r\n Accepted: {\r\n highlight: \"#EDF9CD\",\r\n highlightSelected: \"#DBF59A\",\r\n label: \"Accepted\",\r\n },\r\n Pending: {\r\n highlight: \"#F5E2FF\",\r\n highlightSelected: \"#EBC7FF\",\r\n label: \"Pending\",\r\n alertVariant: \"info\",\r\n },\r\n \"Action Required\": {\r\n highlight: \"#FBEEEE\",\r\n highlightSelected: \"#FFBCB3\",\r\n label: \"ActionRequired\",\r\n alertVariant: \"error\",\r\n },\r\n Declined: {\r\n highlight: \"#FFF6D1\",\r\n highlightSelected: \"#FDE58E\",\r\n label: \"Declined\",\r\n },\r\n \"Not Started\": {\r\n highlight: \"#f8c97cff\",\r\n highlightSelected: \"#F5A623\",\r\n label: \"Not Started\",\r\n },\r\n Rejected: {\r\n highlight: \"#FBEEEE\",\r\n highlightSelected: \"#FFBCB3\",\r\n label: \"ActionRequired\",\r\n alertVariant: \"error\",\r\n },\r\n Draft: {\r\n highlight: \"#FFEACD\",\r\n highlightSelected: \"#FFC365\",\r\n label: \"Draft\",\r\n },\r\n};\r\n\r\nconst NoteContainer = styled(Box)({\r\n position: \"relative\",\r\n display: \"inline\",\r\n maxWidth: \"100%\",\r\n});\r\n\r\n// Uses highlight colors driven by status exclusively\r\nconst HighlightWrapper = styled(Box, {\r\n shouldForwardProp: (prop) =>\r\n prop !== \"isHovered\" &&\r\n prop !== \"highlightColor\" &&\r\n prop !== \"highlightSelectedColor\",\r\n})<{\r\n isHovered: boolean;\r\n highlightColor: string;\r\n highlightSelectedColor: string;\r\n}>(({ isHovered, highlightColor, highlightSelectedColor }) => ({\r\n position: \"relative\",\r\n display: \"inline\",\r\n maxWidth: \"100%\",\r\n \"&:hover .edit-button\": {\r\n opacity: 1,\r\n },\r\n \"& .highlight-span\": {\r\n background: isHovered ? highlightSelectedColor : highlightColor,\r\n padding: \"2px 4px\",\r\n borderBottom: \"2px solid rgba(77, 48, 25, 0.3)\",\r\n boxDecorationBreak: \"clone\",\r\n WebkitBoxDecorationBreak: \"clone\",\r\n transition: \"background 0.2s ease\",\r\n cursor: \"pointer\",\r\n fontSize: \"1rem\",\r\n wordWrap: \"break-word\",\r\n overflowWrap: \"break-word\",\r\n display: \"inline\",\r\n color: \"#4D3019\",\r\n },\r\n}));\r\n\r\nconst EditButton = styled(IconButton)(({ theme }) => ({\r\n top: 0,\r\n right: 0,\r\n transform: \"translate(-50%, -50%)\",\r\n position: \"relative\",\r\n width: 20,\r\n height: 20,\r\n marginRight: -20,\r\n borderRadius:\r\n (typeof theme.shape.borderRadius === \"string\"\r\n ? parseInt(theme.shape.borderRadius, 10)\r\n : theme.shape.borderRadius || 4) * 2,\r\n backgroundColor: \"#4D3019\",\r\n opacity: 0,\r\n transition: \"all 0.2s ease\",\r\n boxShadow: \"0 1px 3px rgba(0,0,0,0.12)\",\r\n \"&:hover\": {\r\n backgroundColor: \"#4D3019\",\r\n transform: \"translate(-50%, -50%) scale(1.1)\",\r\n },\r\n}));\r\n\r\nexport const NoteBox: React.FC<NoteBoxProps> = ({\r\n status,\r\n requirementType,\r\n label,\r\n note,\r\n children,\r\n className = \"\",\r\n onEditClick,\r\n}) => {\r\n const [isHovered, setIsHovered] = useState(false);\r\n\r\n // Map current status\r\n const variableState = mapStatusToVariableState(status!!);\r\n const requirementTypeState = mapRequirementTypeToState(requirementType!!);\r\n\r\n const style = variableState\r\n ? statusConfig[variableState]\r\n : {\r\n highlight: \"#EEE\",\r\n highlightSelected: \"#DDD\",\r\n label: label || \"\",\r\n };\r\n\r\n const reqTypeConfig = {\r\n Default: {\r\n color: \"#F5A623\",\r\n highlight: \"#f3bf6bff\",\r\n highlightSelected: \"#F5A623\",\r\n label: \"Mandatory\",\r\n },\r\n Optional: {\r\n color: \"#F5D76E\",\r\n highlight: \"#f3e2a5ff\",\r\n highlightSelected: \"#F5D76E\",\r\n label: \"Optional\",\r\n },\r\n };\r\n\r\n const requirementTypeStyle = requirementTypeState\r\n ? reqTypeConfig[requirementTypeState]\r\n : {\r\n highlight: \"#EEE\",\r\n highlightSelected: \"#DDD\",\r\n label: label || \"\",\r\n };\r\n\r\n return (\r\n <NoteContainer className={className}>\r\n {/* Alert for note when status matches and note available */}\r\n {variableState && style.alertVariant && note && (\r\n <Alert variant={style.alertVariant} sx={{ mb: 1 }}>\r\n {note}\r\n </Alert>\r\n )}\r\n\r\n {/* Highlighted content box */}\r\n <HighlightWrapper\r\n isHovered={isHovered}\r\n highlightColor={\r\n variableState === VariableState.NotStarted\r\n ? requirementTypeStyle.highlight\r\n : style.highlight\r\n }\r\n highlightSelectedColor={\r\n variableState === VariableState.NotStarted\r\n ? requirementTypeStyle.highlightSelected\r\n : style.highlightSelected\r\n }\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n if (onEditClick) {\r\n onEditClick();\r\n }\r\n }}\r\n >\r\n <span className=\"highlight-span\" style={{ display: \"inline\" }}>\r\n {children}\r\n </span>\r\n <EditButton\r\n className=\"edit-button\"\r\n onClick={(e) => {\r\n e.stopPropagation();\r\n if (onEditClick) {\r\n onEditClick();\r\n }\r\n }}\r\n size=\"small\"\r\n >\r\n {variableState === VariableState.Accepted ? (\r\n <CheckRounded\r\n sx={{ fontSize: 14, color: \"#FFFFFF\", strokeWidth: 2 }}\r\n />\r\n ) : (\r\n <EditRounded\r\n sx={{ fontSize: 14, color: \"#FFFFFF\", strokeWidth: 2 }}\r\n />\r\n )}\r\n </EditButton>\r\n </HighlightWrapper>\r\n </NoteContainer>\r\n );\r\n};\r\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAoBA;AACA,MAAM,YAAY,GAOd;AACF,IAAA,QAAQ,EAAE;AACR,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,UAAU;AAClB,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,YAAY,EAAE,MAAM;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;AACjB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,gBAAgB;AACvB,QAAA,YAAY,EAAE,OAAO;AACtB,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,iBAAiB,EAAE,SAAS;AAC5B,QAAA,KAAK,EAAE,UAAU;AAClB,KAAA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CAAC,EACtC,YAAY,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,EACvC,OAAO,EAAE,CAAC,CAAC,KAAI;oBACb,CAAC,CAAC,eAAe,EAAE;oBACnB,IAAI,WAAW,EAAE;AACf,wBAAA,WAAW,EAAE;oBACf;AACF,gBAAA,CAAC,EAAA,QAAA,EAAA,CAEDC,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAA,QAAA,EAC1D,QAAQ,EAAA,CACJ,EACPA,GAAA,CAAC,UAAU,EAAA,EACT,SAAS,EAAC,aAAa,EACvB,OAAO,EAAE,CAAC,CAAC,KAAI;4BACb,CAAC,CAAC,eAAe,EAAE;4BACnB,IAAI,WAAW,EAAE;AACf,gCAAA,WAAW,EAAE;4BACf;AACF,wBAAA,CAAC,EACD,IAAI,EAAC,OAAO,EAAA,QAAA,EAEX,aAAa,KAAK,aAAa,CAAC,QAAQ,IACvCA,GAAA,CAAC,YAAY,EAAA,EACX,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE,EAAA,CACtD,KAEFA,GAAA,CAAC,WAAW,EAAA,EACV,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAAE,EAAA,CACtD,CACH,EAAA,CACU,CAAA,EAAA,CACI,CAAA,EAAA,CACL;AAEpB;;;;"}
@@ -8,6 +8,8 @@ function mapStatusToVariableState(status) {
8
8
  return VariableState.Pending;
9
9
  case "Action Required":
10
10
  return VariableState.ActionRequired;
11
+ case "Rejected":
12
+ return VariableState.Rejected;
11
13
  case "Declined":
12
14
  return VariableState.Declined;
13
15
  case "Draft":
@@ -1 +1 @@
1
- {"version":3,"file":"variableProcessing.js","sources":["../../../../src/helpers/variableProcessing.ts"],"sourcesContent":["import { VariableState, RequirementType } from \"../types/variable\";\r\n\r\nfunction mapStatusToVariableState(status: string): VariableState | undefined {\r\n switch (status) {\r\n case \"Accepted\":\r\n return VariableState.Accepted;\r\n case \"Pending\":\r\n return VariableState.Pending;\r\n case \"Action Required\":\r\n return VariableState.ActionRequired;\r\n case \"Declined\":\r\n return VariableState.Declined;\r\n case \"Draft\":\r\n return VariableState.Draft;\r\n case \"Not Started\":\r\n return VariableState.NotStarted;\r\n default:\r\n return undefined;\r\n }\r\n}\r\n\r\n\r\nfunction mapRequirementTypeToState(reqType: string): RequirementType | undefined {\r\n switch (reqType) {\r\n case \"Default\":\r\n return RequirementType.Default;\r\n case \"Optional\":\r\n return RequirementType.Optional;\r\n default:\r\n return undefined;\r\n }\r\n}\r\n\r\nexport { mapStatusToVariableState, mapRequirementTypeToState };"],"names":[],"mappings":";;AAEA,SAAS,wBAAwB,CAAC,MAAc,EAAA;IAC9C,QAAQ,MAAM;AACZ,QAAA,KAAK,UAAU;YACb,OAAO,aAAa,CAAC,QAAQ;AAC/B,QAAA,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC,OAAO;AAC9B,QAAA,KAAK,iBAAiB;YACpB,OAAO,aAAa,CAAC,cAAc;AACrC,QAAA,KAAK,UAAU;YACb,OAAO,aAAa,CAAC,QAAQ;AAC/B,QAAA,KAAK,OAAO;YACV,OAAO,aAAa,CAAC,KAAK;AAC5B,QAAA,KAAK,aAAa;YAChB,OAAO,aAAa,CAAC,UAAU;AACjC,QAAA;AACE,YAAA,OAAO,SAAS;;AAEtB;AAGA,SAAS,yBAAyB,CAAC,OAAe,EAAA;IAChD,QAAQ,OAAO;AACb,QAAA,KAAK,SAAS;YACZ,OAAO,eAAe,CAAC,OAAO;AAChC,QAAA,KAAK,UAAU;YACb,OAAO,eAAe,CAAC,QAAQ;AACjC,QAAA;AACE,YAAA,OAAO,SAAS;;AAEtB;;;;"}
1
+ {"version":3,"file":"variableProcessing.js","sources":["../../../../src/helpers/variableProcessing.ts"],"sourcesContent":["import { VariableState, RequirementType } from \"../types/variable\";\r\n\r\nfunction mapStatusToVariableState(status: string): VariableState | undefined {\r\n switch (status) {\r\n case \"Accepted\":\r\n return VariableState.Accepted;\r\n case \"Pending\":\r\n return VariableState.Pending;\r\n case \"Action Required\":\r\n return VariableState.ActionRequired;\r\n case \"Rejected\":\r\n return VariableState.Rejected;\r\n case \"Declined\":\r\n return VariableState.Declined;\r\n case \"Draft\":\r\n return VariableState.Draft;\r\n case \"Not Started\":\r\n return VariableState.NotStarted;\r\n default:\r\n return undefined;\r\n }\r\n}\r\n\r\nfunction mapRequirementTypeToState(\r\n reqType: string,\r\n): RequirementType | undefined {\r\n switch (reqType) {\r\n case \"Default\":\r\n return RequirementType.Default;\r\n case \"Optional\":\r\n return RequirementType.Optional;\r\n default:\r\n return undefined;\r\n }\r\n}\r\n\r\nexport { mapStatusToVariableState, mapRequirementTypeToState };\r\n"],"names":[],"mappings":";;AAEA,SAAS,wBAAwB,CAAC,MAAc,EAAA;IAC9C,QAAQ,MAAM;AACZ,QAAA,KAAK,UAAU;YACb,OAAO,aAAa,CAAC,QAAQ;AAC/B,QAAA,KAAK,SAAS;YACZ,OAAO,aAAa,CAAC,OAAO;AAC9B,QAAA,KAAK,iBAAiB;YACpB,OAAO,aAAa,CAAC,cAAc;AACrC,QAAA,KAAK,UAAU;YACb,OAAO,aAAa,CAAC,QAAQ;AAC/B,QAAA,KAAK,UAAU;YACb,OAAO,aAAa,CAAC,QAAQ;AAC/B,QAAA,KAAK,OAAO;YACV,OAAO,aAAa,CAAC,KAAK;AAC5B,QAAA,KAAK,aAAa;YAChB,OAAO,aAAa,CAAC,UAAU;AACjC,QAAA;AACE,YAAA,OAAO,SAAS;;AAEtB;AAEA,SAAS,yBAAyB,CAChC,OAAe,EAAA;IAEf,QAAQ,OAAO;AACb,QAAA,KAAK,SAAS;YACZ,OAAO,eAAe,CAAC,OAAO;AAChC,QAAA,KAAK,UAAU;YACb,OAAO,eAAe,CAAC,QAAQ;AACjC,QAAA;AACE,YAAA,OAAO,SAAS;;AAEtB;;;;"}
@@ -1,4 +1,4 @@
1
- import { __exports as lib } from '../../../_virtual/index3.js';
1
+ import { __exports as lib } from '../../../_virtual/index4.js';
2
2
  import { __require as requireLib$1 } from '../../domelementtype/lib/index.js';
3
3
  import { __require as requireNode } from './node.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { __exports as lib } from '../../../_virtual/index8.js';
1
+ import { __exports as lib } from '../../../_virtual/index9.js';
2
2
  import { __require as requireStringify } from './stringify.js';
3
3
  import { __require as requireTraversal } from './traversal.js';
4
4
  import { __require as requireManipulation } from './manipulation.js';
@@ -1,4 +1,4 @@
1
- import { __exports as decodeDataHtml } from '../../../../_virtual/decode-data-html.js';
1
+ import { __exports as decodeDataHtml } from '../../../../_virtual/decode-data-html2.js';
2
2
 
3
3
  var hasRequiredDecodeDataHtml;
4
4
 
@@ -1,4 +1,4 @@
1
- import { __exports as decodeDataXml } from '../../../../_virtual/decode-data-xml.js';
1
+ import { __exports as decodeDataXml } from '../../../../_virtual/decode-data-xml2.js';
2
2
 
3
3
  var hasRequiredDecodeDataXml;
4
4
 
@@ -1,4 +1,4 @@
1
- import { __exports as lib } from '../../../_virtual/index4.js';
1
+ import { __exports as lib } from '../../../_virtual/index3.js';
2
2
  import { __require as requireHtmlToDom } from './server/html-to-dom.js';
3
3
  import { __require as requireTypes } from './types.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { __exports as decodeDataHtml } from '../../../../../../../_virtual/decode-data-html2.js';
1
+ import { __exports as decodeDataHtml } from '../../../../../../../_virtual/decode-data-html.js';
2
2
 
3
3
  var hasRequiredDecodeDataHtml;
4
4
 
@@ -1,4 +1,4 @@
1
- import { __exports as decodeDataXml } from '../../../../../../../_virtual/decode-data-xml2.js';
1
+ import { __exports as decodeDataXml } from '../../../../../../../_virtual/decode-data-xml.js';
2
2
 
3
3
  var hasRequiredDecodeDataXml;
4
4
 
@@ -1,4 +1,4 @@
1
- import { __exports as cjs } from '../../../_virtual/index9.js';
1
+ import { __exports as cjs } from '../../../_virtual/index8.js';
2
2
  import { __require as requireCjs$1 } from '../../inline-style-parser/cjs/index.js';
3
3
 
4
4
  var hasRequiredCjs;
@@ -1,12 +1,47 @@
1
+ import { ObjectId } from "mongodb";
2
+ export type Variable = {
3
+ _id: ObjectId;
4
+ name: string;
5
+ value: string;
6
+ defaultValue?: string;
7
+ pluralValue: string;
8
+ validFrom: Date;
9
+ feedback?: string;
10
+ history?: VariableHistoryEntry[];
11
+ customerHelpText: string;
12
+ writerHelpText: string;
13
+ state: VariableState;
14
+ hidden: boolean;
15
+ canBeBlank: boolean;
16
+ vertical: string;
17
+ requirementType: RequirementType;
18
+ useDefault?: boolean;
19
+ depth?: number;
20
+ scope?: VariableScope;
21
+ isChildEditable?: boolean;
22
+ };
23
+ export declare enum VariableScope {
24
+ Network = "Network",
25
+ Organisation = "Organisation"
26
+ }
27
+ export declare enum RequirementType {
28
+ Default = "Default",
29
+ Optional = "Optional"
30
+ }
1
31
  export declare enum VariableState {
2
32
  Accepted = "Accepted",
3
33
  Pending = "Pending",
4
34
  ActionRequired = "Action Required",
35
+ Rejected = "Rejected",
5
36
  Declined = "Declined",
6
37
  Draft = "Draft",
7
38
  NotStarted = "Not Started"
8
39
  }
9
- export declare enum RequirementType {
10
- Default = "Default",
11
- Optional = "Optional"
12
- }
40
+ export type VariableHistoryEntry = {
41
+ value?: string;
42
+ useDefault?: boolean;
43
+ state: VariableState;
44
+ validFrom: Date;
45
+ validTo: Date;
46
+ };
47
+ export default Variable;
@@ -1,17 +1,23 @@
1
+ var VariableScope;
2
+ (function (VariableScope) {
3
+ VariableScope["Network"] = "Network";
4
+ VariableScope["Organisation"] = "Organisation";
5
+ })(VariableScope || (VariableScope = {}));
6
+ var RequirementType;
7
+ (function (RequirementType) {
8
+ RequirementType["Default"] = "Default";
9
+ RequirementType["Optional"] = "Optional";
10
+ })(RequirementType || (RequirementType = {}));
1
11
  var VariableState;
2
12
  (function (VariableState) {
3
13
  VariableState["Accepted"] = "Accepted";
4
14
  VariableState["Pending"] = "Pending";
5
15
  VariableState["ActionRequired"] = "Action Required";
16
+ VariableState["Rejected"] = "Rejected";
6
17
  VariableState["Declined"] = "Declined";
7
18
  VariableState["Draft"] = "Draft";
8
19
  VariableState["NotStarted"] = "Not Started";
9
20
  })(VariableState || (VariableState = {}));
10
- var RequirementType;
11
- (function (RequirementType) {
12
- RequirementType["Default"] = "Default";
13
- RequirementType["Optional"] = "Optional";
14
- })(RequirementType || (RequirementType = {}));
15
21
 
16
- export { RequirementType, VariableState };
22
+ export { RequirementType, VariableScope, VariableState };
17
23
  //# sourceMappingURL=variable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"variable.js","sources":["../../../../src/types/variable.ts"],"sourcesContent":["export enum VariableState {\r\n Accepted = \"Accepted\",\r\n Pending = \"Pending\",\r\n ActionRequired = \"Action Required\",\r\n Declined = \"Declined\",\r\n Draft = \"Draft\",\r\n NotStarted = \"Not Started\",\r\n}\r\n\r\nexport enum RequirementType {\r\n Default = \"Default\",\r\n Optional = \"Optional\",\r\n}\r\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,aAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;AAClC,IAAA,aAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,aAAA,CAAA,YAAA,CAAA,GAAA,aAA0B;AAC5B,CAAC,EAPW,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;IASb;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EAHW,eAAe,KAAf,eAAe,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"variable.js","sources":["../../../../src/types/variable.ts"],"sourcesContent":["import { ObjectId } from \"mongodb\";\r\n\r\nexport type Variable = {\r\n _id: ObjectId;\r\n name: string;\r\n value: string;\r\n defaultValue?: string;\r\n pluralValue: string;\r\n validFrom: Date;\r\n feedback?: string;\r\n history?: VariableHistoryEntry[];\r\n customerHelpText: string;\r\n writerHelpText: string;\r\n state: VariableState;\r\n hidden: boolean;\r\n canBeBlank: boolean;\r\n vertical: string;\r\n requirementType: RequirementType;\r\n useDefault?: boolean;\r\n depth?: number;\r\n scope?: VariableScope;\r\n isChildEditable?: boolean;\r\n};\r\n\r\nexport enum VariableScope {\r\n Network = \"Network\",\r\n Organisation = \"Organisation\",\r\n}\r\n\r\nexport enum RequirementType {\r\n Default = \"Default\",\r\n Optional = \"Optional\",\r\n}\r\n\r\nexport enum VariableState {\r\n Accepted = \"Accepted\",\r\n Pending = \"Pending\",\r\n ActionRequired = \"Action Required\",\r\n Rejected = \"Rejected\",\r\n Declined = \"Declined\",\r\n Draft = \"Draft\",\r\n NotStarted = \"Not Started\",\r\n}\r\n\r\nexport type VariableHistoryEntry = {\r\n value?: string;\r\n useDefault?: boolean;\r\n state: VariableState;\r\n validFrom: Date;\r\n validTo: Date;\r\n};\r\n\r\nexport default Variable;\r\n"],"names":[],"mappings":"IAwBY;AAAZ,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,aAAA,CAAA,cAAA,CAAA,GAAA,cAA6B;AAC/B,CAAC,EAHW,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;IAKb;AAAZ,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,eAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EAHW,eAAe,KAAf,eAAe,GAAA,EAAA,CAAA,CAAA;IAKf;AAAZ,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,aAAA,CAAA,gBAAA,CAAA,GAAA,iBAAkC;AAClC,IAAA,aAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,aAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,aAAA,CAAA,YAAA,CAAA,GAAA,aAA0B;AAC5B,CAAC,EARW,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ece-docs-components",
3
- "version": "1.0.104",
3
+ "version": "1.0.105",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -58,6 +58,7 @@
58
58
  "dependencies": {
59
59
  "@mui/utils": "^7.3.3",
60
60
  "@rollup/plugin-url": "^8.0.2",
61
- "html-react-parser": "^5.2.10"
61
+ "html-react-parser": "^5.2.10",
62
+ "mongodb": "^7.4.0"
62
63
  }
63
64
  }