solace-ui-components 17.0.8 → 18.0.0
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/charts.js +1 -1
- package/dist/charts.modern.mjs +1 -1
- package/dist/{chunk-NNUFUUDL.modern.mjs → chunk-2RTZL4CF.modern.mjs} +3 -3
- package/dist/chunk-2RTZL4CF.modern.mjs.map +1 -0
- package/dist/chunk-4XH33OL7.js +384 -0
- package/dist/chunk-4XH33OL7.js.map +1 -0
- package/dist/chunk-7SKICMGL.js +2 -0
- package/dist/{chunk-3NKPHQNZ.js.map → chunk-7SKICMGL.js.map} +1 -1
- package/dist/{chunk-KQ4FCALU.js → chunk-AOKITPX2.js} +2 -2
- package/dist/{chunk-KQ4FCALU.js.map → chunk-AOKITPX2.js.map} +1 -1
- package/dist/chunk-GDZZVHFP.js +2 -0
- package/dist/{chunk-MIW6EPF2.js.map → chunk-GDZZVHFP.js.map} +1 -1
- package/dist/chunk-HLXBN2OE.modern.mjs +2 -0
- package/dist/{chunk-BRCNJ6YU.modern.mjs.map → chunk-HLXBN2OE.modern.mjs.map} +1 -1
- package/dist/chunk-IHSXSGCC.modern.mjs +384 -0
- package/dist/chunk-IHSXSGCC.modern.mjs.map +1 -0
- package/dist/{chunk-VEVQME3E.modern.mjs → chunk-QV564WAK.modern.mjs} +2 -2
- package/dist/{chunk-VEVQME3E.modern.mjs.map → chunk-QV564WAK.modern.mjs.map} +1 -1
- package/dist/{chunk-3EP6QO5T.modern.mjs → chunk-ROSPS5NM.modern.mjs} +2 -2
- package/dist/{chunk-3EP6QO5T.modern.mjs.map → chunk-ROSPS5NM.modern.mjs.map} +1 -1
- package/dist/{chunk-37IHMN4Z.js → chunk-TSSPQLS6.js} +3 -3
- package/dist/chunk-TSSPQLS6.js.map +1 -0
- package/dist/{chunk-ER6Q72GN.js → chunk-UFDVHFXE.js} +2 -2
- package/dist/{chunk-ER6Q72GN.js.map → chunk-UFDVHFXE.js.map} +1 -1
- package/dist/chunk-ULYCLLUO.modern.mjs +2 -0
- package/dist/{chunk-OIYJ7CVG.modern.mjs.map → chunk-ULYCLLUO.modern.mjs.map} +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/code-editor.js.map +1 -1
- package/dist/code-editor.modern.mjs +1 -1
- package/dist/code-editor.modern.mjs.map +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/datepicker.modern.mjs +1 -1
- package/dist/drag-drop.js +1 -1
- package/dist/drag-drop.modern.mjs +1 -1
- package/dist/index.js +56 -56
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +56 -56
- package/dist/index.modern.mjs.map +1 -1
- package/dist/json-schema-form.js +1 -1
- package/dist/json-schema-form.modern.mjs +1 -1
- package/dist/textDiff.js +2 -2
- package/dist/textDiff.modern.mjs +1 -1
- package/migrate-imports.js +2 -2
- package/package.json +32 -46
- package/dist/chunk-37IHMN4Z.js.map +0 -1
- package/dist/chunk-3NKPHQNZ.js +0 -2
- package/dist/chunk-3R3N5YG6.js +0 -365
- package/dist/chunk-3R3N5YG6.js.map +0 -1
- package/dist/chunk-BRCNJ6YU.modern.mjs +0 -2
- package/dist/chunk-GQTRWH6F.modern.mjs +0 -365
- package/dist/chunk-GQTRWH6F.modern.mjs.map +0 -1
- package/dist/chunk-MIW6EPF2.js +0 -2
- package/dist/chunk-NNUFUUDL.modern.mjs.map +0 -1
- package/dist/chunk-OIYJ7CVG.modern.mjs +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/solaceTooltip.ts","../src/components/SolaceToolTip.tsx","../src/components/form/HelperText.tsx","../src/resources/icons/ErrorIcon.tsx","../src/components/form/ErrorText.tsx","../src/resources/icons/WarnIcon.tsx","../src/components/form/WarningText.tsx"],"names":["text","overflow","rich","html","TooltipVariant","OverflowDiv","styled_default","SolaceTooltip","id","title","variant","children","placement","maxWidth","disableFocusListener","disableHoverListener","enterDelay","enterNextDelay","leaveDelay","open","onOpen","onClose","dataQa","dataTags","internalOpen","setInternalOpen","useState","textElementRef","useRef","handleOpen","useCallback","event","isEmpty","shouldOpen","handleClose","jsx","Tooltip_default","Fade_default","SolaceToolTip_default","HelperText","theme","useTheme","FormLabel_default","HelperText_default","ErrorIcon","size","fill","jsxs","SvgIcon_default","ErrorTextContainer","Box_default","ErrorTextLabel","ErrorText","BASE_FONT_PX_SIZES","ErrorText_default","WarnIcon","WarningTextContainer","WarningTextLabel","WarningText","WarningText_default"],"mappings":"uLAgBA,IAAMA,CAAAA,CAAO,MAAA,CACPC,CAAAA,CAAW,UAAA,CACXC,EAAO,MAAA,CAEPC,CAAAA,CAAO,MAAA,CAEAC,CAAAA,CAAiB,CAC7B,IAAA,CAAMJ,CAAAA,CACN,QAAA,CAAUC,EACV,IAAA,CAAMC,CAAAA,CAEN,IAAA,CAAMC,CACP,ECkEA,IAAME,CAAAA,CAAcC,EAAAA,CAAO,KAAK,CAAA,CAAE,KAAO,CACxC,WAAY,QAAA,CACZ,QAAA,CAAU,QAAA,CACV,YAAA,CAAc,WACd,QAAA,CAAU,UAAA,CAEV,UAAA,CAAY,CACX,QAAS,IAAA,CACT,OAAA,CAAS,OACV,CACD,CAAA,CAAE,CAAA,CAEF,SAASC,CAAAA,CAAc,CACtB,EAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,QAAAC,CAAAA,CAAUN,CAAAA,CAAe,IAAA,CACzB,QAAA,CAAAO,EACA,SAAA,CAAAC,CAAAA,CAAY,QAAA,CACZ,QAAA,CAAAC,CAAAA,CAAW,OAAA,CACX,oBAAA,CAAAC,CAAAA,CAAuB,MACvB,oBAAA,CAAAC,CAAAA,CAAuB,KAAA,CACvB,UAAA,CAAAC,EAAa,GAAA,CACb,cAAA,CAAAC,CAAAA,CAAiB,CAAA,CACjB,WAAAC,CAAAA,CAAa,CAAA,CACb,IAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,OAAAC,CAA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A,CAAG,OAAA,CAAQ,KAAM,CAAA,CACpGL,GAAAA,CAACsB,EAAAA,CAAA,CAAkB,SAAA9C,CAAAA,CAAS,CAAA,CAAA,CAC7B,CAEF,KAEOgD,EAAAA,CAAQD","file":"chunk-OIYJ7CVG.modern.mjs","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst text = \"text\";\nconst overflow = \"overflow\";\nconst rich = \"rich\";\n/** @deprecated - as of Nov 12, 2024 the 'html variant is being deprecated in favour of using the rich variant**/\nconst html = \"html\";\n\nexport const TooltipVariant = {\n\ttext: text,\n\toverflow: overflow,\n\trich: rich,\n\t/** @deprecated [Nov 2024] the \"html\" variant for SolaceTooltip has been deprecated, please use rich variant instead */\n\thtml: html\n};\n\nexport type TooltipVariantTypes = (typeof TooltipVariant)[keyof typeof TooltipVariant];\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { styled, Tooltip } from \"@mui/material\";\nimport { Fade } from \"@mui/material\";\nimport SolaceComponentProps from \"./SolaceComponentProps\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { isEmpty } from \"lodash\";\nimport { TooltipVariant, TooltipVariantTypes } from \"../types/solaceTooltip\";\n\nexport interface SolaceTooltipProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier ... if `id` is not specified, a randomly generated value will be used in order to make it accessible for screen readers\n\t */\n\tid?: string;\n\t/**\n\t * Tooltip title\n\t */\n\ttitle?: string | JSX.Element;\n\t/**\n\t * Different type of tooltip, default to `text`\n\t */\n\tvariant?: TooltipVariantTypes;\n\t/**\n\t * Tooltip referenced element.\n\t */\n\tchildren: string | JSX.Element;\n\t/**\n\t * Tooltip placement, default to `bottom`\n\t */\n\tplacement?:\n\t\t| \"bottom-end\"\n\t\t| \"bottom-start\"\n\t\t| \"bottom\"\n\t\t| \"left-end\"\n\t\t| \"left-start\"\n\t\t| \"left\"\n\t\t| \"right-end\"\n\t\t| \"right-start\"\n\t\t| \"right\"\n\t\t| \"top-end\"\n\t\t| \"top-start\"\n\t\t| \"top\";\n\t/**\n\t * Tooltip maximum width, default to small\n\t */\n\tmaxWidth?: \"small\" | \"medium\" | \"full\";\n\t/**\n\t * Disable listener to show tooltip when referenced element is focused, default to false\n\t */\n\tdisableFocusListener?: boolean;\n\t/**\n\t * Disable listener to show tooltip when referenced element is hovered, default to false\n\t */\n\tdisableHoverListener?: boolean;\n\t/**\n\t * The number of milliseconds to wait before showing the tooltip. Default is 500ms\n\t */\n\tenterDelay?: number;\n\t/**\n\t * The number of milliseconds to wait before showing the tooltip when one was already recently opened. Default is 0ms\n\t */\n\tenterNextDelay?: number;\n\t/**\n\t * The number of milliseconds to wait before hiding the tooltip. Default is 0ms\n\t */\n\tleaveDelay?: number;\n\t/**\n\t * Controlled open state for tooltip. If `true`, the component is shown\n\t */\n\topen?: boolean;\n\t/**\n\t * Callback fired when the component requests to be open. Used in conjunction with `open` and `onClose`\n\t */\n\tonOpen?: (event: React.SyntheticEvent) => void;\n\t/**\n\t * Callback fired when the component requests to be closed. Used in conjunction with `open` and `onOpen`\n\t */\n\tonClose?: (event: Event | React.SyntheticEvent<Element, Event>) => void;\n}\n\nconst OverflowDiv = styled(\"div\")(() => ({\n\twhiteSpace: \"nowrap\",\n\toverflow: \"hidden\",\n\ttextOverflow: \"ellipsis\",\n\tposition: \"relative\",\n\t// adding this empty block to prevent showing tooltip twice on Safari\n\t\"&::after\": {\n\t\tcontent: '\"\"',\n\t\tdisplay: \"block\"\n\t}\n}));\n\nfunction SolaceTooltip({\n\tid,\n\ttitle,\n\tvariant = TooltipVariant.text,\n\tchildren,\n\tplacement = \"bottom\",\n\tmaxWidth = \"small\",\n\tdisableFocusListener = false,\n\tdisableHoverListener = false,\n\tenterDelay = 500,\n\tenterNextDelay = 0,\n\tleaveDelay = 0,\n\topen,\n\tonOpen,\n\tonClose,\n\tdataQa,\n\tdataTags\n}: SolaceTooltipProps) {\n\tconst [internalOpen, setInternalOpen] = useState(false);\n\tconst textElementRef = useRef<HTMLDivElement>(null);\n\n\tconst handleOpen = useCallback(\n\t\t(event: React.SyntheticEvent) => {\n\t\t\t// if empty, don't open the tooltip.\n\t\t\tif (isEmpty(title)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet shouldOpen = true;\n\t\t\tif (\n\t\t\t\tvariant === \"overflow\" &&\n\t\t\t\ttextElementRef.current &&\n\t\t\t\ttextElementRef.current.scrollWidth <= textElementRef.current.clientWidth\n\t\t\t) {\n\t\t\t\tshouldOpen = false;\n\t\t\t}\n\t\t\tif (shouldOpen) {\n\t\t\t\tsetInternalOpen(true);\n\t\t\t\tif (onOpen) {\n\t\t\t\t\tonOpen(event);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[onOpen, title, variant]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(event: Event | React.SyntheticEvent<Element, Event>) => {\n\t\t\tsetInternalOpen(false);\n\t\t\tif (onClose) {\n\t\t\t\tonClose(event);\n\t\t\t}\n\t\t},\n\t\t[onClose]\n\t);\n\n\treturn (\n\t\t<Tooltip\n\t\t\tid={id}\n\t\t\ttitle={title ?? \"\"}\n\t\t\tclasses={{\n\t\t\t\ttooltip: `${variant === TooltipVariant.html || variant === TooltipVariant.rich ? \"htmlContent\" : \"\"} ${\n\t\t\t\t\tmaxWidth ? maxWidth + \"Width\" : \"\"\n\t\t\t\t}`\n\t\t\t}}\n\t\t\tplacement={placement}\n\t\t\tdata-qa={dataQa}\n\t\t\tdata-tags={dataTags}\n\t\t\tdisableFocusListener={disableFocusListener}\n\t\t\tdisableHoverListener={disableHoverListener}\n\t\t\tenterDelay={enterDelay}\n\t\t\tenterNextDelay={enterNextDelay}\n\t\t\tleaveDelay={leaveDelay}\n\t\t\tTransitionComponent={Fade}\n\t\t\tTransitionProps={{ timeout: { enter: 150, exit: 200 } }}\n\t\t\topen={open ?? internalOpen}\n\t\t\tonOpen={handleOpen}\n\t\t\tonClose={handleClose}\n\t\t>\n\t\t\t{variant === \"overflow\" ? (\n\t\t\t\t<OverflowDiv ref={textElementRef}>{children}</OverflowDiv>\n\t\t\t) : typeof children === \"string\" ? (\n\t\t\t\t<span>{children}</span>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t</Tooltip>\n\t);\n}\n\nexport default SolaceTooltip;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormLabel, useTheme } from \"@mui/material\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\n\nexport interface HelperTextProps extends SolaceComponentProps {\n\tchildren: string | JSX.Element;\n}\n\nfunction HelperText({ children }: HelperTextProps): JSX.Element {\n\tconst theme = useTheme();\n\treturn (\n\t\t<FormLabel\n\t\t\tsx={{\n\t\t\t\tcolor: theme.palette.ux.secondary.text.wMain,\n\t\t\t\tfontSize: theme.typography.caption.fontSize,\n\t\t\t\tmarginTop: \"2px\"\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</FormLabel>\n\t);\n}\n\nexport default HelperText;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nexport function ErrorIcon({ size, fill }: IconProps): JSX.Element {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px` }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M11.208 14.784C11.2827 14.8587 11.3733 14.896 11.48 14.896H12.776C12.8933 14.896 12.984 14.8587 13.048 14.784C13.1227 14.7093 13.16 14.6187 13.16 14.512V7.184C13.16 7.06667 13.1227 6.976 13.048 6.912C12.984 6.83733 12.8933 6.8 12.776 6.8H11.48C11.3733 6.8 11.2827 6.83733 11.208 6.912C11.1333 6.98667 11.096 7.07733 11.096 7.184V14.512C11.096 14.6187 11.1333 14.7093 11.208 14.784Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M11.112 17.888C11.1867 17.9627 11.2773 18 11.384 18H12.872C12.9893 18 13.0853 17.9627 13.16 17.888C13.2347 17.8133 13.272 17.7227 13.272 17.616V16.128C13.272 16.0107 13.2347 15.9147 13.16 15.84C13.0853 15.7653 12.9893 15.728 12.872 15.728H11.384C11.2773 15.728 11.1867 15.7653 11.112 15.84C11.0373 15.9147 11 16.0107 11 16.128V17.616C11 17.7227 11.0373 17.8133 11.112 17.888Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormLabel, useTheme, styled } from \"@mui/material\";\nimport { Box } from \"@mui/system\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { ErrorIcon } from \"../../resources/icons/ErrorIcon\";\nimport { BASE_FONT_PX_SIZES } from \"../../resources/typography\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\nconst ErrorTextContainer = styled(Box)(({ theme }) => ({\n\t...(theme.mixins.formComponent_ErrorText.container as CSSProperties)\n}));\n\nconst ErrorTextLabel = styled(FormLabel)(({ theme }) => ({\n\t...(theme.mixins.formComponent_ErrorText.label as CSSProperties)\n}));\n\nexport interface ErrorTextProps extends SolaceComponentProps {\n\tchildren: string | JSX.Element;\n}\n\nfunction ErrorText({ children }: ErrorTextProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst size = theme.typography.subtitle1.fontSize?.toString();\n\treturn (\n\t\t<ErrorTextContainer>\n\t\t\t<ErrorIcon size={size ? parseInt(size) : BASE_FONT_PX_SIZES.md} fill={theme.palette.ux.error.wMain} />\n\t\t\t<ErrorTextLabel>{children}</ErrorTextLabel>\n\t\t</ErrorTextContainer>\n\t);\n}\n\nexport default ErrorText;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nexport function WarnIcon({ size, fill }: IconProps): JSX.Element {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px` }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M11.8746 14.996C11.9493 15.0706 12.04 15.108 12.1466 15.108H13.4426C13.56 15.108 13.6506 15.0706 13.7146 14.996C13.7893 14.9213 13.8266 14.8306 13.8266 14.724V10.396C13.8266 10.2786 13.7893 10.188 13.7146 10.124C13.6506 10.0493 13.56 10.012 13.4426 10.012H12.1466C12.04 10.012 11.9493 10.0493 11.8746 10.124C11.8 10.1986 11.7626 10.2893 11.7626 10.396V14.724C11.7626 14.8306 11.8 14.9213 11.8746 14.996Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M11.7786 18.1C11.8533 18.1746 11.944 18.212 12.0506 18.212H13.5386C13.656 18.212 13.752 18.1746 13.8266 18.1C13.9013 18.0253 13.9386 17.9346 13.9386 17.828V16.34C13.9386 16.2226 13.9013 16.1266 13.8266 16.052C13.752 15.9773 13.656 15.94 13.5386 15.94H12.0506C11.944 15.94 11.8533 15.9773 11.7786 16.052C11.704 16.1266 11.6666 16.2226 11.6666 16.34V17.828C11.6666 17.9346 11.704 18.0253 11.7786 18.1Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M11.7919 3.79001C12.1726 3.10304 13.1604 3.10304 13.5411 3.79001L22.2358 19.4772C22.6053 20.1437 22.1233 20.962 21.3612 20.962H3.97177C3.20973 20.962 2.72771 20.1437 3.09713 19.4772L11.7919 3.79001ZM5.66936 18.962L12.6665 6.3376L19.6636 18.962H5.66936Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormLabel, useTheme, styled } from \"@mui/material\";\nimport { Box } from \"@mui/system\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { WarnIcon } from \"../../resources/icons/WarnIcon\";\nimport { BASE_FONT_PX_SIZES } from \"../../resources/typography\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\nconst WarningTextContainer = styled(Box)(({ theme }) => ({\n\t...(theme.mixins.formComponent_WarningText.container as CSSProperties)\n}));\n\nconst WarningTextLabel = styled(FormLabel)(({ theme }) => ({\n\t...(theme.mixins.formComponent_WarningText.label as CSSProperties)\n}));\n\nexport interface WarningTextProps extends SolaceComponentProps {\n\tchildren: string | JSX.Element;\n}\n\nfunction WarningText({ children }: WarningTextProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst size = theme.typography.subtitle1.fontSize?.toString();\n\treturn (\n\t\t<WarningTextContainer>\n\t\t\t<WarnIcon size={size ? parseInt(size) : BASE_FONT_PX_SIZES.md} fill={theme.palette.ux.warning.w100}></WarnIcon>\n\t\t\t<WarningTextLabel>{children}</WarningTextLabel>\n\t\t</WarningTextContainer>\n\t);\n}\n\nexport default WarningText;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/solaceTooltip.ts","../src/components/SolaceToolTip.tsx","../src/components/form/HelperText.tsx","../src/resources/icons/ErrorIcon.tsx","../src/components/form/ErrorText.tsx","../src/resources/icons/WarnIcon.tsx","../src/components/form/WarningText.tsx"],"names":["text","overflow","rich","html","TooltipVariant","OverflowDiv","styled_default","SolaceTooltip","id","title","variant","children","placement","maxWidth","disableFocusListener","disableHoverListener","enterDelay","enterNextDelay","leaveDelay","open","onOpen","onClose","dataQa","dataTags","internalOpen","setInternalOpen","useState","textElementRef","useRef","handleOpen","useCallback","event","isEmpty","shouldOpen","handleClose","jsx","Tooltip_default","Fade_default","SolaceToolTip_default","HelperText","theme","useTheme","FormLabel_default","HelperText_default","ErrorIcon","size","fill","jsxs","SvgIcon_default","ErrorTextContainer","Box_default","ErrorTextLabel","ErrorText","BASE_FONT_PX_SIZES","ErrorText_default","WarnIcon","WarningTextContainer","WarningTextLabel","WarningText","WarningText_default"],"mappings":"wLAgBA,IAAMA,CAAAA,CAAO,MAAA,CACPC,CAAAA,CAAW,UAAA,CACXC,EAAO,MAAA,CAEPC,CAAAA,CAAO,MAAA,CAEAC,CAAAA,CAAiB,CAC7B,IAAA,CAAMJ,CAAAA,CACN,QAAA,CAAUC,EACV,IAAA,CAAMC,CAAAA,CAEN,IAAA,CAAMC,CACP,ECkEA,IAAME,CAAAA,CAAcC,EAAAA,CAAO,KAAK,CAAA,CAAE,KAAO,CACxC,WAAY,QAAA,CACZ,QAAA,CAAU,QAAA,CACV,YAAA,CAAc,WACd,QAAA,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AC5C,EAAE,CAAA,CAEIiB,EAAAA,CAAmBnD,EAAAA,CAAOoC,EAAS,EAAE,CAAC,CAAE,KAAA,CAAAF,CAAM,KAAO,CAC1D,GAAIA,CAAAA,CAAM,MAAA,CAAO,yBAAA,CAA0B,KAC5C,CAAA,CAAE,CAAA,CAMF,SAASkB,EAAAA,CAAY,CAAE,QAAA,CAAA/C,CAAS,EAAkC,CACjE,IAAM6B,CAAAA,CAAQC,EAAAA,GACRI,CAAAA,CAAOL,CAAAA,CAAM,UAAA,CAAW,SAAA,CAAU,QAAA,EAAU,QAAA,EAAS,CAC3D,OACCO,KAACS,EAAAA,CAAA,CACA,QAAA,CAAA,CAAArB,GAAAA,CAACoB,EAAA,CAAS,IAAA,CAAMV,CAAAA,CAAO,QAAA,CAASA,CAAI,CAAA,CAAIQ,EAAAA,CAAmB,EAAA,CAAI,IAAA,CAAMb,CAAAA,CAAM,OAAA,CAAQ,EAAA,CAAG,OAAA,CAAQ,KAAM,CAAA,CACpGL,GAAAA,CAACsB,EAAAA,CAAA,CAAkB,SAAA9C,CAAAA,CAAS,CAAA,CAAA,CAC7B,CAEF,KAEOgD,EAAAA,CAAQD","file":"chunk-ULYCLLUO.modern.mjs","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst text = \"text\";\nconst overflow = \"overflow\";\nconst rich = \"rich\";\n/** @deprecated - as of Nov 12, 2024 the 'html variant is being deprecated in favour of using the rich variant**/\nconst html = \"html\";\n\nexport const TooltipVariant = {\n\ttext: text,\n\toverflow: overflow,\n\trich: rich,\n\t/** @deprecated [Nov 2024] the \"html\" variant for SolaceTooltip has been deprecated, please use rich variant instead */\n\thtml: html\n};\n\nexport type TooltipVariantTypes = (typeof TooltipVariant)[keyof typeof TooltipVariant];\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { styled, Tooltip } from \"@mui/material\";\nimport { Fade } from \"@mui/material\";\nimport SolaceComponentProps from \"./SolaceComponentProps\";\nimport { useCallback, useRef, useState } from \"react\";\nimport { isEmpty } from \"lodash\";\nimport { TooltipVariant, TooltipVariantTypes } from \"../types/solaceTooltip\";\n\nexport interface SolaceTooltipProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier ... if `id` is not specified, a randomly generated value will be used in order to make it accessible for screen readers\n\t */\n\tid?: string;\n\t/**\n\t * Tooltip title\n\t */\n\ttitle?: string | JSX.Element;\n\t/**\n\t * Different type of tooltip, default to `text`\n\t */\n\tvariant?: TooltipVariantTypes;\n\t/**\n\t * Tooltip referenced element.\n\t */\n\tchildren: string | JSX.Element;\n\t/**\n\t * Tooltip placement, default to `bottom`\n\t */\n\tplacement?:\n\t\t| \"bottom-end\"\n\t\t| \"bottom-start\"\n\t\t| \"bottom\"\n\t\t| \"left-end\"\n\t\t| \"left-start\"\n\t\t| \"left\"\n\t\t| \"right-end\"\n\t\t| \"right-start\"\n\t\t| \"right\"\n\t\t| \"top-end\"\n\t\t| \"top-start\"\n\t\t| \"top\";\n\t/**\n\t * Tooltip maximum width, default to small\n\t */\n\tmaxWidth?: \"small\" | \"medium\" | \"full\";\n\t/**\n\t * Disable listener to show tooltip when referenced element is focused, default to false\n\t */\n\tdisableFocusListener?: boolean;\n\t/**\n\t * Disable listener to show tooltip when referenced element is hovered, default to false\n\t */\n\tdisableHoverListener?: boolean;\n\t/**\n\t * The number of milliseconds to wait before showing the tooltip. Default is 500ms\n\t */\n\tenterDelay?: number;\n\t/**\n\t * The number of milliseconds to wait before showing the tooltip when one was already recently opened. Default is 0ms\n\t */\n\tenterNextDelay?: number;\n\t/**\n\t * The number of milliseconds to wait before hiding the tooltip. Default is 0ms\n\t */\n\tleaveDelay?: number;\n\t/**\n\t * Controlled open state for tooltip. If `true`, the component is shown\n\t */\n\topen?: boolean;\n\t/**\n\t * Callback fired when the component requests to be open. Used in conjunction with `open` and `onClose`\n\t */\n\tonOpen?: (event: React.SyntheticEvent) => void;\n\t/**\n\t * Callback fired when the component requests to be closed. Used in conjunction with `open` and `onOpen`\n\t */\n\tonClose?: (event: Event | React.SyntheticEvent<Element, Event>) => void;\n}\n\nconst OverflowDiv = styled(\"div\")(() => ({\n\twhiteSpace: \"nowrap\",\n\toverflow: \"hidden\",\n\ttextOverflow: \"ellipsis\",\n\tposition: \"relative\",\n\t// adding this empty block to prevent showing tooltip twice on Safari\n\t\"&::after\": {\n\t\tcontent: '\"\"',\n\t\tdisplay: \"block\"\n\t}\n}));\n\nfunction SolaceTooltip({\n\tid,\n\ttitle,\n\tvariant = TooltipVariant.text,\n\tchildren,\n\tplacement = \"bottom\",\n\tmaxWidth = \"small\",\n\tdisableFocusListener = false,\n\tdisableHoverListener = false,\n\tenterDelay = 500,\n\tenterNextDelay = 0,\n\tleaveDelay = 0,\n\topen,\n\tonOpen,\n\tonClose,\n\tdataQa,\n\tdataTags\n}: SolaceTooltipProps) {\n\tconst [internalOpen, setInternalOpen] = useState(false);\n\tconst textElementRef = useRef<HTMLDivElement>(null);\n\n\tconst handleOpen = useCallback(\n\t\t(event: React.SyntheticEvent) => {\n\t\t\t// if empty, don't open the tooltip.\n\t\t\tif (isEmpty(title)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet shouldOpen = true;\n\t\t\tif (\n\t\t\t\tvariant === \"overflow\" &&\n\t\t\t\ttextElementRef.current &&\n\t\t\t\ttextElementRef.current.scrollWidth <= textElementRef.current.clientWidth\n\t\t\t) {\n\t\t\t\tshouldOpen = false;\n\t\t\t}\n\t\t\tif (shouldOpen) {\n\t\t\t\tsetInternalOpen(true);\n\t\t\t\tif (onOpen) {\n\t\t\t\t\tonOpen(event);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[onOpen, title, variant]\n\t);\n\n\tconst handleClose = useCallback(\n\t\t(event: Event | React.SyntheticEvent<Element, Event>) => {\n\t\t\tsetInternalOpen(false);\n\t\t\tif (onClose) {\n\t\t\t\tonClose(event);\n\t\t\t}\n\t\t},\n\t\t[onClose]\n\t);\n\n\treturn (\n\t\t<Tooltip\n\t\t\tid={id}\n\t\t\ttitle={title ?? \"\"}\n\t\t\tclasses={{\n\t\t\t\ttooltip: `${variant === TooltipVariant.html || variant === TooltipVariant.rich ? \"htmlContent\" : \"\"} ${\n\t\t\t\t\tmaxWidth ? maxWidth + \"Width\" : \"\"\n\t\t\t\t}`\n\t\t\t}}\n\t\t\tplacement={placement}\n\t\t\tdata-qa={dataQa}\n\t\t\tdata-tags={dataTags}\n\t\t\tdisableFocusListener={disableFocusListener}\n\t\t\tdisableHoverListener={disableHoverListener}\n\t\t\tenterDelay={enterDelay}\n\t\t\tenterNextDelay={enterNextDelay}\n\t\t\tleaveDelay={leaveDelay}\n\t\t\tTransitionComponent={Fade}\n\t\t\tTransitionProps={{ timeout: { enter: 150, exit: 200 } }}\n\t\t\topen={open ?? internalOpen}\n\t\t\tonOpen={handleOpen}\n\t\t\tonClose={handleClose}\n\t\t>\n\t\t\t{variant === \"overflow\" ? (\n\t\t\t\t<OverflowDiv ref={textElementRef}>{children}</OverflowDiv>\n\t\t\t) : typeof children === \"string\" ? (\n\t\t\t\t<span>{children}</span>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t</Tooltip>\n\t);\n}\n\nexport default SolaceTooltip;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormLabel, useTheme } from \"@mui/material\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\n\nexport interface HelperTextProps extends SolaceComponentProps {\n\tchildren: string | JSX.Element;\n}\n\nfunction HelperText({ children }: HelperTextProps): JSX.Element {\n\tconst theme = useTheme();\n\treturn (\n\t\t<FormLabel\n\t\t\tsx={{\n\t\t\t\tcolor: theme.palette.ux.secondary.text.wMain,\n\t\t\t\tfontSize: theme.typography.caption.fontSize,\n\t\t\t\tmarginTop: \"2px\"\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</FormLabel>\n\t);\n}\n\nexport default HelperText;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nexport function ErrorIcon({ size, fill }: IconProps): JSX.Element {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px` }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M11.208 14.784C11.2827 14.8587 11.3733 14.896 11.48 14.896H12.776C12.8933 14.896 12.984 14.8587 13.048 14.784C13.1227 14.7093 13.16 14.6187 13.16 14.512V7.184C13.16 7.06667 13.1227 6.976 13.048 6.912C12.984 6.83733 12.8933 6.8 12.776 6.8H11.48C11.3733 6.8 11.2827 6.83733 11.208 6.912C11.1333 6.98667 11.096 7.07733 11.096 7.184V14.512C11.096 14.6187 11.1333 14.7093 11.208 14.784Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M11.112 17.888C11.1867 17.9627 11.2773 18 11.384 18H12.872C12.9893 18 13.0853 17.9627 13.16 17.888C13.2347 17.8133 13.272 17.7227 13.272 17.616V16.128C13.272 16.0107 13.2347 15.9147 13.16 15.84C13.0853 15.7653 12.9893 15.728 12.872 15.728H11.384C11.2773 15.728 11.1867 15.7653 11.112 15.84C11.0373 15.9147 11 16.0107 11 16.128V17.616C11 17.7227 11.0373 17.8133 11.112 17.888Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormLabel, useTheme, styled } from \"@mui/material\";\nimport { Box } from \"@mui/system\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { ErrorIcon } from \"../../resources/icons/ErrorIcon\";\nimport { BASE_FONT_PX_SIZES } from \"../../resources/typography\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\nconst ErrorTextContainer = styled(Box)(({ theme }) => ({\n\t...(theme.mixins.formComponent_ErrorText.container as CSSProperties)\n}));\n\nconst ErrorTextLabel = styled(FormLabel)(({ theme }) => ({\n\t...(theme.mixins.formComponent_ErrorText.label as CSSProperties)\n}));\n\nexport interface ErrorTextProps extends SolaceComponentProps {\n\tchildren: string | JSX.Element;\n}\n\nfunction ErrorText({ children }: ErrorTextProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst size = theme.typography.subtitle1.fontSize?.toString();\n\treturn (\n\t\t<ErrorTextContainer>\n\t\t\t<ErrorIcon size={size ? parseInt(size) : BASE_FONT_PX_SIZES.md} fill={theme.palette.ux.error.wMain} />\n\t\t\t<ErrorTextLabel>{children}</ErrorTextLabel>\n\t\t</ErrorTextContainer>\n\t);\n}\n\nexport default ErrorText;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nexport function WarnIcon({ size, fill }: IconProps): JSX.Element {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px` }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M11.8746 14.996C11.9493 15.0706 12.04 15.108 12.1466 15.108H13.4426C13.56 15.108 13.6506 15.0706 13.7146 14.996C13.7893 14.9213 13.8266 14.8306 13.8266 14.724V10.396C13.8266 10.2786 13.7893 10.188 13.7146 10.124C13.6506 10.0493 13.56 10.012 13.4426 10.012H12.1466C12.04 10.012 11.9493 10.0493 11.8746 10.124C11.8 10.1986 11.7626 10.2893 11.7626 10.396V14.724C11.7626 14.8306 11.8 14.9213 11.8746 14.996Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M11.7786 18.1C11.8533 18.1746 11.944 18.212 12.0506 18.212H13.5386C13.656 18.212 13.752 18.1746 13.8266 18.1C13.9013 18.0253 13.9386 17.9346 13.9386 17.828V16.34C13.9386 16.2226 13.9013 16.1266 13.8266 16.052C13.752 15.9773 13.656 15.94 13.5386 15.94H12.0506C11.944 15.94 11.8533 15.9773 11.7786 16.052C11.704 16.1266 11.6666 16.2226 11.6666 16.34V17.828C11.6666 17.9346 11.704 18.0253 11.7786 18.1Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M11.7919 3.79001C12.1726 3.10304 13.1604 3.10304 13.5411 3.79001L22.2358 19.4772C22.6053 20.1437 22.1233 20.962 21.3612 20.962H3.97177C3.20973 20.962 2.72771 20.1437 3.09713 19.4772L11.7919 3.79001ZM5.66936 18.962L12.6665 6.3376L19.6636 18.962H5.66936Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormLabel, useTheme, styled } from \"@mui/material\";\nimport { Box } from \"@mui/system\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { WarnIcon } from \"../../resources/icons/WarnIcon\";\nimport { BASE_FONT_PX_SIZES } from \"../../resources/typography\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\nconst WarningTextContainer = styled(Box)(({ theme }) => ({\n\t...(theme.mixins.formComponent_WarningText.container as CSSProperties)\n}));\n\nconst WarningTextLabel = styled(FormLabel)(({ theme }) => ({\n\t...(theme.mixins.formComponent_WarningText.label as CSSProperties)\n}));\n\nexport interface WarningTextProps extends SolaceComponentProps {\n\tchildren: string | JSX.Element;\n}\n\nfunction WarningText({ children }: WarningTextProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst size = theme.typography.subtitle1.fontSize?.toString();\n\treturn (\n\t\t<WarningTextContainer>\n\t\t\t<WarnIcon size={size ? parseInt(size) : BASE_FONT_PX_SIZES.md} fill={theme.palette.ux.warning.w100}></WarnIcon>\n\t\t\t<WarningTextLabel>{children}</WarningTextLabel>\n\t\t</WarningTextContainer>\n\t);\n}\n\nexport default WarningText;\n"]}
|
package/dist/code-editor.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkAOKITPX2_js=require('./chunk-AOKITPX2.js'),chunk7SKICMGL_js=require('./chunk-7SKICMGL.js'),chunk4XH33OL7_js=require('./chunk-4XH33OL7.js'),react=require('react'),F=require('@uiw/react-codemirror'),view=require('@codemirror/view'),commands=require('@codemirror/commands'),language=require('@codemirror/language'),highlight=require('@lezer/highlight'),langJson=require('@codemirror/lang-json'),langXml=require('@codemirror/lang-xml'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var F__default=/*#__PURE__*/_interopDefault(F);function B(o){let e="rgb(119, 0, 136)",a=language.HighlightStyle.define([{tag:highlight.tags.string,color:o.palette.error.w100},{tag:highlight.tags.special(highlight.tags.string),color:o.palette.error.w100},{tag:highlight.tags.character,color:o.palette.error.w100},{tag:highlight.tags.regexp,color:o.palette.error.w100},{tag:highlight.tags.number,color:o.palette.success.w100},{tag:highlight.tags.integer,color:o.palette.success.w100},{tag:highlight.tags.float,color:o.palette.success.w100},{tag:highlight.tags.bool,color:o.palette.info.w100},{tag:highlight.tags.null,color:o.palette.info.w100},{tag:highlight.tags.atom,color:o.palette.info.w100},{tag:highlight.tags.propertyName,color:o.palette.secondary.text.wMain},{tag:highlight.tags.attributeName,color:o.palette.info.w100},{tag:highlight.tags.attributeValue,color:o.palette.error.w100},{tag:highlight.tags.tagName,color:o.palette.success.w100},{tag:highlight.tags.angleBracket,color:o.palette.success.w100},{tag:highlight.tags.keyword,color:e},{tag:highlight.tags.definitionKeyword,color:e},{tag:highlight.tags.modifier,color:e},{tag:highlight.tags.controlKeyword,color:e},{tag:highlight.tags.operator,color:o.palette.secondary.text.wMain},{tag:highlight.tags.punctuation,color:o.palette.secondary.text.wMain},{tag:highlight.tags.bracket,color:o.palette.secondary.text.wMain},{tag:highlight.tags.brace,color:o.palette.secondary.text.wMain},{tag:highlight.tags.paren,color:o.palette.secondary.text.wMain},{tag:highlight.tags.comment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:highlight.tags.lineComment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:highlight.tags.blockComment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:highlight.tags.typeName,color:e},{tag:highlight.tags.className,color:o.palette.secondary.text.wMain},{tag:highlight.tags.namespace,color:o.palette.secondary.text.wMain},{tag:highlight.tags.variableName,color:o.palette.secondary.text.wMain},{tag:highlight.tags.function(highlight.tags.variableName),color:o.palette.secondary.text.wMain},{tag:highlight.tags.definition(highlight.tags.variableName),color:o.palette.secondary.text.wMain},{tag:highlight.tags.name,color:o.palette.secondary.text.wMain}]),c=view.EditorView.theme({"&":{fontSize:`${chunk4XH33OL7_js.ni.sm}px`,fontFamily:"Consolas, 'Liberation Mono', Menlo, Courier, monospace",lineHeight:"normal"},".cm-content":{padding:"4px 2px",lineHeight:"normal"},".cm-focused":{outline:"none"},".cm-gutters":{backgroundColor:o.palette.background.w20,borderRight:`1px solid ${o.palette.secondary.w40}`,color:o.palette.secondary.text.wMain,fontSize:`${chunk4XH33OL7_js.ni.sm}px`,lineHeight:"normal"},".cm-activeLineGutter":{backgroundColor:"transparent"},".cm-cursor":{borderLeftColor:o.palette.secondary.wMain},".cm-selectionBackground":{backgroundColor:`${o.palette.brand.wMain}30`},"&.cm-focused .cm-selectionBackground":{backgroundColor:`${o.palette.brand.wMain}30`},".cm-matchingBracket":{color:o.palette.success.w100,backgroundColor:"transparent",fontWeight:"bold"}});return [language.syntaxHighlighting(a),c]}var q=language.StreamLanguage.define({name:"protobuf",token(o){return o.match(/message|service|rpc|enum|option|import|package/)?"keyword":o.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)?"type":o.match(/"[^"]*"/)?"string":o.match(/\d+/)?"number":(o.next(),null)}}),$=o=>{switch(o){case "json":return langJson.json();case "xml":return langXml.xml();case "protobuf":return q;default:return langJson.json()}};var D=({size:o,fill:e})=>jsxRuntime.jsx(chunk4XH33OL7_js.Na,{sx:{width:`${o}px`,height:`${o}px`,fill:"none"},viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z",fill:e})}),_=D;var Y=({size:o,fill:e})=>jsxRuntime.jsxs(chunk4XH33OL7_js.Na,{sx:{width:`${o}px`,height:`${o}px`,fill:"none"},viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z",fill:e}),jsxRuntime.jsx("path",{d:"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z",fill:e})]}),J=Y;var ao=chunk4XH33OL7_js.wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.OuterWrapper})),no=chunk4XH33OL7_js.wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.InnerWrapper})),G=chunk4XH33OL7_js.wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.EditorWrapper})),lo=chunk4XH33OL7_js.wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.IconWrapper})),R=(o,e,a)=>e?jsxRuntime.jsx(chunk7SKICMGL_js.e,{children:o}):a?jsxRuntime.jsx(chunk7SKICMGL_js.g,{children:o}):jsxRuntime.jsx(chunk7SKICMGL_js.c,{children:o});function co({mode:o="json",value:e,readOnly:a=false,expandable:c=false,fullScreen:d=false,helperText:i="",hasErrors:f=false,hasWarnings:g=false,onChange:C}){let x=chunk4XH33OL7_js.ua(),S=chunk4XH33OL7_js.qi(),[b,w]=react.useState(e||""),[n,y]=react.useState(d||false);react.useEffect(()=>{e!==void 0&&w(e);},[e]),react.useEffect(()=>{y(d);},[d]);let E=react.useMemo(()=>B(S),[S]),L=react.useMemo(()=>[$(o),view.EditorView.lineWrapping,view.keymap.of(commands.defaultKeymap)],[o]),k=h=>{w(h),C&&C(null,null,h);},v=()=>{y(!n);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c&&jsxRuntime.jsx(ao,{className:n?"codeEditor-expanded--backdrop":"",children:jsxRuntime.jsxs(no,{className:n?"codeEditor-expanded--main":"",children:[jsxRuntime.jsx(lo,{className:n?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:n?jsxRuntime.jsx(chunkAOKITPX2_js.b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:v,title:"Collapse",children:jsxRuntime.jsx(J,{fill:x.palette.ux.secondary.wMain,size:24})}):jsxRuntime.jsx(chunkAOKITPX2_js.b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:v,title:"Expand",children:jsxRuntime.jsx(_,{fill:x.palette.ux.secondary.wMain,size:24})})}),jsxRuntime.jsx(G,{className:`${n?"":"codeEditor-border"} ${a?"codeEditor-readonly":""}`,children:jsxRuntime.jsx(F__default.default,{value:b,onChange:k,extensions:L,theme:E,editable:!a,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})}),i&&R(i,f,g)]})}),!c&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(G,{className:`${n?"":"codeEditor-border"} ${a?"codeEditor-readonly":""}`,children:jsxRuntime.jsx(F__default.default,{value:b,onChange:k,extensions:L,theme:E,editable:!a,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})}),i&&R(i,f,g)]})]})}var io=co;
|
|
2
2
|
exports.SolaceCodeEditor=io;//# sourceMappingURL=code-editor.js.map
|
|
3
3
|
//# sourceMappingURL=code-editor.js.map
|
package/dist/code-editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"8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,CAAAA,CACP,QAAA,CAAUW,CAAAA,CACV,UAAA,CAAYH,CAAAA,CACZ,MAAOF,CAAAA,CACP,QAAA,CAAU,CAACZ,CAAAA,CACX,UAAA,CAAY,CACX,WAAA,CAAa,IAAA,CACb,UAAA,CAAY,IAAA,CACZ,eAAA,CAAiB,IAAA,CACjB,aAAA,CAAe,IAAA,CACf,cAAA,CAAgB,IAAA,CAChB,qBAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,YAAA,CAAc,IACf,CAAA,CACD,CAAA,CACD,CAAA,CACCR,GAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO6B,EAAAA,CAAQzB","file":"code-editor.js","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping) {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties)\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"8lBAuBO,SAASA,CAAAA,CAAuBC,CAAAA,CAAyC,CAE/E,IAAMC,CAAAA,CAAkB,kBAAA,CAGlBC,CAAAA,CAAiBC,uBAAAA,CAAe,MAAA,CAAO,CAE5C,CAAE,GAAA,CAAKC,cAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACxD,CAAE,GAAA,CAAKI,cAAA,CAAE,OAAA,CAAQA,cAAA,CAAE,MAAM,CAAA,CAAG,MAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACnE,CAAE,GAAA,CAAKI,cAAA,CAAE,SAAA,CAAW,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CAC3D,CAAE,IAAKI,cAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CAGxD,CAAE,GAAA,CAAKI,cAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,EAC1D,CAAE,GAAA,CAAKI,cAAA,CAAE,OAAA,CAAS,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAC3D,CAAE,GAAA,CAAKI,cAAA,CAAE,KAAA,CAAO,KAAA,CAAOJ,CAAAA,CAAa,QAAQ,OAAA,CAAQ,IAAK,CAAA,CAGzD,CAAE,GAAA,CAAKI,cAAA,CAA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,CAAA,CACC,QAAA,CAAA,CAAAzC,cAAAA,CAACU,CAAAA,CAAA,CACA,SAAA,CAAW,CAAA,EAAIoB,EAAuC,EAAA,CAAtB,mBAAwB,CAAA,CAAA,EAAIT,CAAAA,CAAW,qBAAA,CAAwB,EAAE,CAAA,CAAA,CAEjG,QAAA,CAAArB,eAAC2C,kBAAAA,CAAA,CACA,KAAA,CAAOhB,CAAAA,CACP,QAAA,CAAUW,CAAAA,CACV,UAAA,CAAYH,CAAAA,CACZ,MAAOF,CAAAA,CACP,QAAA,CAAU,CAACZ,CAAAA,CACX,UAAA,CAAY,CACX,WAAA,CAAa,IAAA,CACb,UAAA,CAAY,IAAA,CACZ,eAAA,CAAiB,IAAA,CACjB,aAAA,CAAe,IAAA,CACf,cAAA,CAAgB,IAAA,CAChB,qBAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,YAAA,CAAc,IACf,CAAA,CACD,CAAA,CACD,CAAA,CACCR,GAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO6B,EAAAA,CAAQzB","file":"code-editor.js","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping): Extension[] {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties)\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-HLXBN2OE.modern.mjs';import {e,g,c}from'./chunk-ULYCLLUO.modern.mjs';import {wa,ua,qi,ni,Na}from'./chunk-IHSXSGCC.modern.mjs';import {useState,useEffect,useMemo}from'react';import F from'@uiw/react-codemirror';import {EditorView,keymap}from'@codemirror/view';import {defaultKeymap}from'@codemirror/commands';import {StreamLanguage,HighlightStyle,syntaxHighlighting}from'@codemirror/language';import {tags}from'@lezer/highlight';import {json}from'@codemirror/lang-json';import {xml}from'@codemirror/lang-xml';import {jsxs,Fragment,jsx}from'react/jsx-runtime';function B(o){let e="rgb(119, 0, 136)",a=HighlightStyle.define([{tag:tags.string,color:o.palette.error.w100},{tag:tags.special(tags.string),color:o.palette.error.w100},{tag:tags.character,color:o.palette.error.w100},{tag:tags.regexp,color:o.palette.error.w100},{tag:tags.number,color:o.palette.success.w100},{tag:tags.integer,color:o.palette.success.w100},{tag:tags.float,color:o.palette.success.w100},{tag:tags.bool,color:o.palette.info.w100},{tag:tags.null,color:o.palette.info.w100},{tag:tags.atom,color:o.palette.info.w100},{tag:tags.propertyName,color:o.palette.secondary.text.wMain},{tag:tags.attributeName,color:o.palette.info.w100},{tag:tags.attributeValue,color:o.palette.error.w100},{tag:tags.tagName,color:o.palette.success.w100},{tag:tags.angleBracket,color:o.palette.success.w100},{tag:tags.keyword,color:e},{tag:tags.definitionKeyword,color:e},{tag:tags.modifier,color:e},{tag:tags.controlKeyword,color:e},{tag:tags.operator,color:o.palette.secondary.text.wMain},{tag:tags.punctuation,color:o.palette.secondary.text.wMain},{tag:tags.bracket,color:o.palette.secondary.text.wMain},{tag:tags.brace,color:o.palette.secondary.text.wMain},{tag:tags.paren,color:o.palette.secondary.text.wMain},{tag:tags.comment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:tags.lineComment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:tags.blockComment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:tags.typeName,color:e},{tag:tags.className,color:o.palette.secondary.text.wMain},{tag:tags.namespace,color:o.palette.secondary.text.wMain},{tag:tags.variableName,color:o.palette.secondary.text.wMain},{tag:tags.function(tags.variableName),color:o.palette.secondary.text.wMain},{tag:tags.definition(tags.variableName),color:o.palette.secondary.text.wMain},{tag:tags.name,color:o.palette.secondary.text.wMain}]),c=EditorView.theme({"&":{fontSize:`${ni.sm}px`,fontFamily:"Consolas, 'Liberation Mono', Menlo, Courier, monospace",lineHeight:"normal"},".cm-content":{padding:"4px 2px",lineHeight:"normal"},".cm-focused":{outline:"none"},".cm-gutters":{backgroundColor:o.palette.background.w20,borderRight:`1px solid ${o.palette.secondary.w40}`,color:o.palette.secondary.text.wMain,fontSize:`${ni.sm}px`,lineHeight:"normal"},".cm-activeLineGutter":{backgroundColor:"transparent"},".cm-cursor":{borderLeftColor:o.palette.secondary.wMain},".cm-selectionBackground":{backgroundColor:`${o.palette.brand.wMain}30`},"&.cm-focused .cm-selectionBackground":{backgroundColor:`${o.palette.brand.wMain}30`},".cm-matchingBracket":{color:o.palette.success.w100,backgroundColor:"transparent",fontWeight:"bold"}});return [syntaxHighlighting(a),c]}var q=StreamLanguage.define({name:"protobuf",token(o){return o.match(/message|service|rpc|enum|option|import|package/)?"keyword":o.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)?"type":o.match(/"[^"]*"/)?"string":o.match(/\d+/)?"number":(o.next(),null)}}),$=o=>{switch(o){case "json":return json();case "xml":return xml();case "protobuf":return q;default:return json()}};var D=({size:o,fill:e})=>jsx(Na,{sx:{width:`${o}px`,height:`${o}px`,fill:"none"},viewBox:"0 0 24 24",children:jsx("path",{d:"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z",fill:e})}),_=D;var Y=({size:o,fill:e})=>jsxs(Na,{sx:{width:`${o}px`,height:`${o}px`,fill:"none"},viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z",fill:e}),jsx("path",{d:"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z",fill:e})]}),J=Y;var ao=wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.OuterWrapper})),no=wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.InnerWrapper})),G=wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.EditorWrapper})),lo=wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.IconWrapper})),R=(o,e$1,a)=>e$1?jsx(e,{children:o}):a?jsx(g,{children:o}):jsx(c,{children:o});function co({mode:o="json",value:e,readOnly:a=false,expandable:c=false,fullScreen:d=false,helperText:i="",hasErrors:f=false,hasWarnings:g=false,onChange:C}){let x=ua(),S=qi(),[b$1,w]=useState(e||""),[n,y]=useState(d||false);useEffect(()=>{e!==void 0&&w(e);},[e]),useEffect(()=>{y(d);},[d]);let E=useMemo(()=>B(S),[S]),L=useMemo(()=>[$(o),EditorView.lineWrapping,keymap.of(defaultKeymap)],[o]),k=h=>{w(h),C&&C(null,null,h);},v=()=>{y(!n);};return jsxs(Fragment,{children:[c&&jsx(ao,{className:n?"codeEditor-expanded--backdrop":"",children:jsxs(no,{className:n?"codeEditor-expanded--main":"",children:[jsx(lo,{className:n?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:n?jsx(b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:v,title:"Collapse",children:jsx(J,{fill:x.palette.ux.secondary.wMain,size:24})}):jsx(b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:v,title:"Expand",children:jsx(_,{fill:x.palette.ux.secondary.wMain,size:24})})}),jsx(G,{className:`${n?"":"codeEditor-border"} ${a?"codeEditor-readonly":""}`,children:jsx(F,{value:b$1,onChange:k,extensions:L,theme:E,editable:!a,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})}),i&&R(i,f,g)]})}),!c&&jsxs(Fragment,{children:[jsx(G,{className:`${n?"":"codeEditor-border"} ${a?"codeEditor-readonly":""}`,children:jsx(F,{value:b$1,onChange:k,extensions:L,theme:E,editable:!a,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})}),i&&R(i,f,g)]})]})}var io=co;
|
|
2
2
|
export{io as SolaceCodeEditor};//# sourceMappingURL=code-editor.modern.mjs.map
|
|
3
3
|
//# sourceMappingURL=code-editor.modern.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"qkBAsBO,SAASA,CAAAA,CAAuBC,CAAAA,CAA4B,CAElE,IAAMC,CAAAA,CAAkB,kBAAA,CAGlBC,CAAAA,CAAiBC,cAAAA,CAAe,MAAA,CAAO,CAE5C,CAAE,GAAA,CAAKC,IAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACxD,CAAE,GAAA,CAAKI,IAAA,CAAE,OAAA,CAAQA,IAAA,CAAE,MAAM,CAAA,CAAG,MAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACnE,CAAE,GAAA,CAAKI,IAAA,CAAE,SAAA,CAAW,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,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["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping) {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties)\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"qkBAuBO,SAASA,CAAAA,CAAuBC,CAAAA,CAAyC,CAE/E,IAAMC,CAAAA,CAAkB,kBAAA,CAGlBC,CAAAA,CAAiBC,cAAAA,CAAe,MAAA,CAAO,CAE5C,CAAE,GAAA,CAAKC,IAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACxD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AA,CAA2B,KAAA,CAC3B,YAAA,CAAc,IACf,CAAA,CACD,CAAA,CACD,CAAA,CACCR,GAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO6B,EAAAA,CAAQzB","file":"code-editor.modern.mjs","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping): Extension[] {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties)\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
package/dist/datepicker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkDKWU3WVA_js=require('./chunk-DKWU3WVA.js'),
|
|
1
|
+
'use strict';var chunkDKWU3WVA_js=require('./chunk-DKWU3WVA.js'),chunk4XH33OL7_js=require('./chunk-4XH33OL7.js'),DatePicker=require('@mui/x-date-pickers/DatePicker'),LocalizationProvider=require('@mui/x-date-pickers/LocalizationProvider'),AdapterMoment=require('@mui/x-date-pickers/AdapterMoment'),d=require('moment-timezone'),react=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var i=(r,n)=>r?n?d__default.default.tz(r,n):d__default.default(r):null;function h({id:r,name:n,value:s=null,onChange:a,onClear:m,dataQa:p,variant:D="yearMonthDay",disabled:M=false,timezone:t=void 0,disableFuture:x=false,disablePast:k=false,onMonthChange:u,isDateAvailable:l,loading:v=false}){let[C,f]=react.useState(i(s,t)),{views:O,openTo:R,format:T}=chunkDKWU3WVA_js.b[D];react.useEffect(()=>{f(i(s,t));},[s,t]);let w=e=>{if(f(e),a&&e){let o=i(e.format(),t);a(o?o.toISOString():null);}else a&&a(null);},A=e=>{if(u){let o=e.clone().startOf("month").hour(12);u(o.toISOString());}},I=e=>{if(!l)return false;let o=i(e.format(),t),F=o?o.toISOString():e.toISOString();return !l(F)},c=chunk4XH33OL7_js.ua().palette.ux.accent.n2.wMain,y={".MuiPickersCalendarHeader-switchViewButton:focus-visible":{border:`1px solid ${c}`,padding:"3px",borderRadius:"3px"},".MuiPickersArrowSwitcher-button:focus-visible":{border:`1px solid ${c}`,padding:"3px",borderRadius:"3px"},".MuiPickersDay-root:focus-visible":{border:`1px solid ${c}`,borderRadius:"50%"}};return jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterMoment.AdapterMoment,dateLibInstance:d__default.default,children:jsxRuntime.jsx(DatePicker.DatePicker,{className:"SolaceDatePicker",value:C,onChange:w,onMonthChange:A,shouldDisableDate:l?I:void 0,loading:v,"data-qa":p,slotProps:{field:{clearable:true,onClear:()=>m&&m()},popper:{sx:y},textField:{inputProps:{"data-qa":p,id:r,name:n}}},disabled:M,views:O,openTo:R,format:T,disableFuture:x,disablePast:k,timezone:t??"system"})})}Object.defineProperty(exports,"SolaceDatePickerVariant",{enumerable:true,get:function(){return chunkDKWU3WVA_js.a}});exports.SolaceDatePicker=h;//# sourceMappingURL=datepicker.js.map
|
|
2
2
|
//# sourceMappingURL=datepicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b}from'./chunk-NWTC7FRW.modern.mjs';export{a as SolaceDatePickerVariant}from'./chunk-NWTC7FRW.modern.mjs';import {
|
|
1
|
+
import {b}from'./chunk-NWTC7FRW.modern.mjs';export{a as SolaceDatePickerVariant}from'./chunk-NWTC7FRW.modern.mjs';import {ua}from'./chunk-IHSXSGCC.modern.mjs';import {DatePicker}from'@mui/x-date-pickers/DatePicker';import {LocalizationProvider}from'@mui/x-date-pickers/LocalizationProvider';import {AdapterMoment}from'@mui/x-date-pickers/AdapterMoment';import d from'moment-timezone';import {useState,useEffect}from'react';import {jsx}from'react/jsx-runtime';var i=(r,n)=>r?n?d.tz(r,n):d(r):null;function h({id:r,name:n,value:s=null,onChange:a,onClear:m,dataQa:p,variant:D="yearMonthDay",disabled:M=false,timezone:t=void 0,disableFuture:x=false,disablePast:k=false,onMonthChange:u,isDateAvailable:l,loading:v=false}){let[C,f]=useState(i(s,t)),{views:O,openTo:R,format:T}=b[D];useEffect(()=>{f(i(s,t));},[s,t]);let w=e=>{if(f(e),a&&e){let o=i(e.format(),t);a(o?o.toISOString():null);}else a&&a(null);},A=e=>{if(u){let o=e.clone().startOf("month").hour(12);u(o.toISOString());}},I=e=>{if(!l)return false;let o=i(e.format(),t),F=o?o.toISOString():e.toISOString();return !l(F)},c=ua().palette.ux.accent.n2.wMain,y={".MuiPickersCalendarHeader-switchViewButton:focus-visible":{border:`1px solid ${c}`,padding:"3px",borderRadius:"3px"},".MuiPickersArrowSwitcher-button:focus-visible":{border:`1px solid ${c}`,padding:"3px",borderRadius:"3px"},".MuiPickersDay-root:focus-visible":{border:`1px solid ${c}`,borderRadius:"50%"}};return jsx(LocalizationProvider,{dateAdapter:AdapterMoment,dateLibInstance:d,children:jsx(DatePicker,{className:"SolaceDatePicker",value:C,onChange:w,onMonthChange:A,shouldDisableDate:l?I:void 0,loading:v,"data-qa":p,slotProps:{field:{clearable:true,onClear:()=>m&&m()},popper:{sx:y},textField:{inputProps:{"data-qa":p,id:r,name:n}}},disabled:M,views:O,openTo:R,format:T,disableFuture:x,disablePast:k,timezone:t??"system"})})}export{h as SolaceDatePicker};//# sourceMappingURL=datepicker.modern.mjs.map
|
|
2
2
|
//# sourceMappingURL=datepicker.modern.mjs.map
|