solace-ui-components 18.0.17 → 18.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/{chunk-266AAHHO.js → chunk-2CMPFNW2.js} +2 -2
  2. package/dist/{chunk-266AAHHO.js.map → chunk-2CMPFNW2.js.map} +1 -1
  3. package/dist/chunk-6BHLTTV3.modern.mjs +2 -0
  4. package/dist/chunk-6BHLTTV3.modern.mjs.map +1 -0
  5. package/dist/{chunk-LWCJ2SGT.modern.mjs → chunk-GHPNUEMK.modern.mjs} +2 -2
  6. package/dist/{chunk-LWCJ2SGT.modern.mjs.map → chunk-GHPNUEMK.modern.mjs.map} +1 -1
  7. package/dist/{chunk-IGOY34XU.js → chunk-IXGR5EW7.js} +2 -2
  8. package/dist/{chunk-IGOY34XU.js.map → chunk-IXGR5EW7.js.map} +1 -1
  9. package/dist/chunk-NT45IFR2.js +2 -0
  10. package/dist/chunk-NT45IFR2.js.map +1 -0
  11. package/dist/{chunk-NANSEALM.modern.mjs → chunk-OUM6OKBT.modern.mjs} +3 -3
  12. package/dist/{chunk-NANSEALM.modern.mjs.map → chunk-OUM6OKBT.modern.mjs.map} +1 -1
  13. package/dist/{chunk-AU2K45F2.js → chunk-X45FYPVF.js} +3 -3
  14. package/dist/{chunk-AU2K45F2.js.map → chunk-X45FYPVF.js.map} +1 -1
  15. package/dist/chunk-YJENEMV2.modern.mjs +2 -0
  16. package/dist/{chunk-IA5QZKDN.modern.mjs.map → chunk-YJENEMV2.modern.mjs.map} +1 -1
  17. package/dist/code-editor.js +2 -2
  18. package/dist/code-editor.modern.mjs +2 -2
  19. package/dist/code-editor.modern.mjs.map +1 -1
  20. package/dist/drag-drop.js +1 -1
  21. package/dist/drag-drop.modern.mjs +1 -1
  22. package/dist/drag-drop.modern.mjs.map +1 -1
  23. package/dist/index.d.mts +40 -1
  24. package/dist/index.d.ts +40 -1
  25. package/dist/index.js +53 -53
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.modern.mjs +53 -53
  28. package/dist/index.modern.mjs.map +1 -1
  29. package/dist/json-schema-form.js +1 -1
  30. package/dist/json-schema-form.modern.mjs +1 -1
  31. package/package.json +5 -1
  32. package/src/resources/MRC_Autopilot/component-props.json +5914 -0
  33. package/src/resources/MRC_Autopilot/component-usage-guide.json +1276 -0
  34. package/dist/chunk-HHKIWPP5.js +0 -2
  35. package/dist/chunk-HHKIWPP5.js.map +0 -1
  36. package/dist/chunk-IA5QZKDN.modern.mjs +0 -2
  37. package/dist/chunk-Q6DR3MQK.modern.mjs +0 -2
  38. package/dist/chunk-Q6DR3MQK.modern.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/form/SolaceLabel.tsx","../src/constants.ts","../src/components/form/FormChildBase.tsx","../src/components/form/SolaceTextField.tsx"],"names":["SolaceLabel","id","htmlForId","required","disabled","readOnly","noWrap","children","jsx","FormLabel_default","clsx_default","SolaceLabel_default","constants","ChildrenContainer","styled_default","prop","theme","inlineLabel","FormChildBase","label","stackLabel","large","bold","centerInlineLabel","helperText","errorText","warningText","sx","jsxs","Box_default","SolaceStackLabel_default","HelperText_default","WarningText_default","ErrorText_default","FormChildBase_default","SolaceTextField","name","value","placeholder","maxLength","type","size","title","autoFocus","hasErrors","hasWarnings","customIcon","onChange","onBlur","onKeyDown","onKeyUp","onFocus","dataQa","dataTags","fullWidth","width","endAdornment","minWidth","inputRef","useTheme","endIconProps","IconButton_default","inputEndAdornment","InputAdornment_default","inputStartAdornment","defaultInputProps","handleChange","event","getId","TooltipContainer","textField","SolaceToolTip_default","TextField_default","SolaceTextField_default"],"mappings":"wMAkDA,SAASA,EAAAA,CAAY,CACpB,GAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EAAW,KAAA,CACX,QAAA,CAAAC,EAAW,KAAA,CACX,QAAA,CAAAC,EAAW,KAAA,CACX,MAAA,CAAAC,CAAAA,CAAS,KAAA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CAAAA,CACP,SAAU6B,EAAAA,CACV,MAAA,CAAQlB,EACR,SAAA,CAAWC,CAAAA,CACX,OAAA,CAASC,CAAAA,CACT,QAASC,CAAAA,CACT,SAAA,CAAWG,EACX,EAAA,CAAI,CAAE,SAAUG,CAAS,CAAA,CAC1B,CAAA,CAKH,OACCjD,IAAC0B,CAAAA,CAAA,CACA,EAAA,CAAIkC,CAAAA,GACJ,KAAA,CAAOjD,CAAAA,CACP,UAAA,CAAYK,CAAAA,CACZ,UAAWoB,CAAAA,CAAYpB,CAAAA,CAAa,OACpC,WAAA,CAAaqB,CAAAA,CAAcrB,EAAa,MAAA,CACxC,QAAA,CAAUpB,CAAAA,CACV,QAAA,CAAUC,EACV,QAAA,CAAUF,CAAAA,CACV,YAAac,CAAAA,CACb,iBAAA,CAAmBA,EACnB,EAAA,CAAI,CAAE,KAAA,CAAAsC,CAAM,EAEX,QAAA,CAAAe,EAAAA,GACF,CAEF,KAEOG,EAAAA,CAAQtC","file":"chunk-IA5QZKDN.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 { FormLabel } from \"@mui/material\";\nimport clsx from \"clsx\";\n\nexport interface SolaceLabelProps {\n\t/**\n\t * Unique identifier of the label\n\t */\n\tid: string;\n\t/**\n\t * identifier used for specifying which form element this label is bound to\n\t */\n\thtmlForId?: string;\n\t/**\n\t * Boolean flag used to display an indicator of whether or not this `input` is mandatory\n\t */\n\trequired?: boolean;\n\t/**\n\t * Boolean flag to disable the `input`\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Boolean flag for readOnly labels, changes font color to 55% black\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * Boolean flag to suppress line breaks (text wrapping) within the label\n\t */\n\tnoWrap?: boolean;\n\t/**\n\t *\n\t */\n\tchildren?: React.ReactNode;\n}\n\nfunction SolaceLabel({\n\tid,\n\thtmlForId,\n\trequired = false,\n\tdisabled = false,\n\treadOnly = false,\n\tnoWrap = false,\n\tchildren\n}: SolaceLabelProps): JSX.Element {\n\treturn (\n\t\t<FormLabel\n\t\t\tid={id}\n\t\t\thtmlFor={htmlForId}\n\t\t\trequired={required}\n\t\t\tdisabled={disabled}\n\t\t\tsx={{\n\t\t\t\tdisplay: \"block\",\n\t\t\t\twhiteSpace: noWrap ? \"nowrap\" : \"normal\"\n\t\t\t}}\n\t\t\tclassName={clsx({ \"read-only\": readOnly })}\n\t\t>\n\t\t\t{children}\n\t\t</FormLabel>\n\t);\n}\n\nexport default SolaceLabel;\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\nexport const constants = {\n\tmaxLength: 255,\n\tmenuItemHeight: 38,\n\tmenuItemHeightMultiline: 58,\n\tGridListItemHeight: 53,\n\tDEFAULT_NUM_OF_MENUITEM_DISPLAYED: 9,\n\tcloseButtonAriaLabel: \"Close\",\n\tactionMenuAriaLabel: \"More Actions\",\n\tclearButtonAriaLabel: \"Clear\"\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 { Box, styled } from \"@mui/material\";\nimport SolaceLabel from \"./SolaceLabel\";\nimport SolaceStackLabel from \"./SolaceStackLabel\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { SX } from \"../../types/sx\";\n\ninterface ChildrenContainerProps {\n\tinlineLabel: boolean;\n}\n\nconst ChildrenContainer = styled(\"div\", {\n\tshouldForwardProp: (prop) => prop !== \"inlineLabel\"\n})<ChildrenContainerProps>(({ theme, inlineLabel }) => ({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\tflexGrow: 1,\n\tmaxWidth: \"100%\",\n\tpaddingLeft: inlineLabel ? \"36px\" : \"0px\",\n\t\"&.hasWarnings\": {\n\t\t\"fieldset.MuiOutlinedInput-notchedOutline, fieldset.MuiInputBase-inputMultiline\": {\n\t\t\tborderColor: `${theme.palette.ux.warning.w100}`\n\t\t}\n\t}\n}));\n\nexport interface FormChildBaseProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier ... if `id` is not specified, `name` value will be used in order to make `label` and `helperText` accessible for screen readers\n\t */\n\tid: string;\n\t/**\n\t * the label content to display on the screen\n\t */\n\tlabel?: string | JSX.Element;\n\t/**\n\t * Boolean flag to allow labels to be rendered as SolaceStackLabel component, which provides more props, such as large, bold\n\t */\n\tstackLabel?: boolean;\n\t/**\n\t * Boolean flag to allow StackSolaceLabel component to be rendered with larger font size of 16px (default to 14px)\n\t */\n\tlarge?: boolean;\n\t/**\n\t * Boolean flag to allow StackSolaceLabel component to be rendered with font weight of medium (default to regular)\n\t */\n\tbold?: boolean;\n\t/**\n\t * The value of the `input` element, required for controlled component\n\t */\n\tvalue?: string;\n\t/**\n\t * Content to display as supportive/explanatory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * HelperText when the `input` in error state\n\t */\n\terrorText?: string | JSX.Element;\n\t/**\n\t * HelperText when the `input` in warning state\n\t */\n\twarningText?: string | JSX.Element;\n\t/**\n\t * Boolean flag used to display an indicator of whether or not this `input` is mandatory\n\t */\n\trequired: boolean;\n\t/**\n\t * Boolean flag to disable the `input`\n\t */\n\tdisabled: boolean;\n\t/**\n\t * Boolean flag to set the `input` in a read-only state\n\t */\n\treadOnly: boolean;\n\t/**\n\t * Display the label horizontally\n\t */\n\tinlineLabel: boolean;\n\t/**\n\t * Center align the inline label, this will e used only for single line field label\n\t */\n\tcenterInlineLabel?: boolean;\n\n\tchildren: JSX.Element;\n\t/**\n\t * The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details.\n\t */\n\tsx?: SX;\n}\n\nfunction FormChildBase({\n\tid,\n\tlabel,\n\tstackLabel,\n\tlarge,\n\tbold,\n\trequired,\n\tdisabled,\n\treadOnly,\n\tinlineLabel,\n\tcenterInlineLabel,\n\thelperText,\n\terrorText,\n\twarningText,\n\tchildren,\n\tsx\n}: FormChildBaseProps): JSX.Element {\n\treturn (\n\t\t<Box\n\t\t\tdisplay=\"flex\"\n\t\t\tflexDirection={inlineLabel ? \"row\" : \"column\"}\n\t\t\tjustifyContent=\"space-between\"\n\t\t\talignItems={centerInlineLabel ? \"flex-start\" : \"\"}\n\t\t\tsx={sx}\n\t\t>\n\t\t\t{stackLabel && label && (\n\t\t\t\t<div style={{ marginTop: centerInlineLabel ? \"5.5px\" : \"\" }}>\n\t\t\t\t\t<SolaceStackLabel\n\t\t\t\t\t\tid={`${id}-label`}\n\t\t\t\t\t\thtmlForId={`${id}`}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tlarge={large}\n\t\t\t\t\t\tbold={bold}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</SolaceStackLabel>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{!stackLabel && label && (\n\t\t\t\t<div style={{ marginTop: centerInlineLabel ? \"5.5px\" : \"\" }}>\n\t\t\t\t\t<SolaceLabel\n\t\t\t\t\t\tid={`${id}-label`}\n\t\t\t\t\t\thtmlForId={`${id}`}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\tnoWrap={inlineLabel}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</SolaceLabel>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<ChildrenContainer inlineLabel={inlineLabel} className={warningText ? \"hasWarnings\" : \"\"}>\n\t\t\t\t{children}\n\t\t\t\t{helperText && !errorText && !warningText && <HelperText>{helperText}</HelperText>}\n\t\t\t\t{warningText && !errorText && <WarningText>{warningText}</WarningText>}\n\t\t\t\t{errorText && <ErrorText>{errorText}</ErrorText>}\n\t\t\t</ChildrenContainer>\n\t\t</Box>\n\t);\n}\n\nexport default FormChildBase;\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 { InputAdornment, IconButton, TextField, useTheme } from \"@mui/material\";\nimport React from \"react\";\nimport { constants } from \"../../constants\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport FormChildBase from \"./FormChildBase\";\nimport SolaceTooltip from \"../SolaceToolTip\";\nimport { styled } from \"@mui/material\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\nexport interface SolaceTextFieldChangeEvent {\n\tname: string;\n\tvalue: string;\n}\n\nexport interface SolaceTextFieldProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier ... if `id` is not specified, `name` value will be used in order to make `label` and `helperText` accessible for screen readers\n\t */\n\tid?: string;\n\t/**\n\t * Name attribute to assign to the `input` element\n\t */\n\tname: string;\n\t/**\n\t * the label content to display on the screen\n\t */\n\tlabel?: string | JSX.Element;\n\t/**\n\t * The value of the `input` element, required for controlled component\n\t */\n\tvalue?: string | number;\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Short hint displayed in the `input` before user enters a value\n\t */\n\tplaceholder?: string;\n\t/**\n\t * The maximum number of characters which can be typed as the `input` value\n\t */\n\tmaxLength?: number;\n\t/**\n\t * The type of `input` element to render\n\t */\n\ttype?: \"text\" | \"number\" | \"password\" | \"email\" | \"url\";\n\t/**\n\t * The size/width of the `input` measured in characters\n\t */\n\tsize?: number;\n\t/**\n\t * The text to display as the tooltip hint\n\t */\n\ttitle?: string;\n\t/**\n\t * Boolean flag to control whether the `input` element is focused during first mount\n\t */\n\tautoFocus?: boolean;\n\t/**\n\t * Boolean flag to mark the `input` in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the `input` in warn state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * Boolean flag used to display an indicator of whether or not this `input` is mandatory\n\t */\n\trequired?: boolean;\n\t/**\n\t * Boolean flag to control whether to stack the label on top of the `input` element (false) or place them inline to one another (true)\n\t */\n\tinlineLabel?: boolean;\n\t/**\n\t * Allows custom icon to be set at the beginning/end of the field.\n\t */\n\tcustomIcon?: {\n\t\ticon: React.ReactNode;\n\t\tposition: \"end\" | \"start\";\n\t\thandleClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n\t\tariaLabel?: string;\n\t};\n\t/**\n\t * Boolean flag to disable the `input`\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Boolean flag to set the `input` in a read-only state\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\tonChange?: (event: SolaceTextFieldChangeEvent) => void;\n\t/**\n\t * Callback function to trigger whenever the element of the `input` loses focus\n\t */\n\tonBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * Callback function to trigger whenever the element of the `input` receives key down event\n\t */\n\tonKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n\t/**\n\t * Callback function to trigger whenever the element of the `input` receives key up event\n\t */\n\tonKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n\t/**\n\t * Callback function to trigger whenever the element of the `input` is focused\n\t */\n\tonFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * Custom Width of the component.\n\t */\n\twidth?: string;\n\t/**\n\t * If true, the input will take up the full width of its container.\n\t */\n\tfullWidth?: boolean;\n\t/**\n\t * optional prop to pass an array of icon or button at the end of textfield\n\t */\n\tendAdornment?: (React.ReactNode | JSX.Element)[];\n\t/**\n\t * minimum width of the component\n\t */\n\tminWidth?: string;\n\t/**\n\t * pass a ref to the input element.\n\t */\n\tinputRef?: (input: HTMLInputElement) => void;\n}\n\nfunction SolaceTextField({\n\tid,\n\tname,\n\tlabel,\n\tvalue,\n\thelperText,\n\tplaceholder,\n\tmaxLength = constants.maxLength,\n\ttype = \"text\",\n\tsize = 50,\n\ttitle,\n\tautoFocus = false,\n\thasErrors = false,\n\thasWarnings = false,\n\trequired = false,\n\tinlineLabel = false,\n\tcustomIcon,\n\tdisabled = false,\n\treadOnly = false,\n\tonChange,\n\tonBlur,\n\tonKeyDown,\n\tonKeyUp,\n\tonFocus,\n\tdataQa,\n\tdataTags,\n\tfullWidth = false,\n\twidth,\n\tendAdornment,\n\tminWidth,\n\tinputRef\n}: SolaceTextFieldProps): JSX.Element {\n\tconst theme = useTheme();\n\n\tconst endIconProps =\n\t\tcustomIcon && customIcon.position === \"end\" ? (\n\t\t\t<IconButton onClick={customIcon.handleClick} aria-label={customIcon.ariaLabel}>\n\t\t\t\t{customIcon.icon}\n\t\t\t</IconButton>\n\t\t) : null;\n\n\tconst inputEndAdornment =\n\t\tendIconProps || endAdornment\n\t\t\t? {\n\t\t\t\t\tendAdornment: (\n\t\t\t\t\t\t<InputAdornment position=\"end\">\n\t\t\t\t\t\t\t{endAdornment}\n\t\t\t\t\t\t\t{endIconProps}\n\t\t\t\t\t\t</InputAdornment>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t: {};\n\tconst inputStartAdornment =\n\t\tcustomIcon && customIcon.position === \"start\"\n\t\t\t? {\n\t\t\t\t\tstartAdornment: (\n\t\t\t\t\t\t<InputAdornment position={customIcon.position}>\n\t\t\t\t\t\t\t<IconButton onClick={customIcon.handleClick} aria-label={customIcon.ariaLabel}>\n\t\t\t\t\t\t\t\t{customIcon.icon}\n\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t</InputAdornment>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t: {};\n\n\tconst defaultInputProps = {\n\t\tsx: { height: theme.spacing(4) },\n\t\tdisabled: disabled,\n\t\trequired: required\n\t};\n\n\tconst handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n\t\tif (onChange) {\n\t\t\tonChange({\n\t\t\t\tname: name,\n\t\t\t\tvalue: event.target.value\n\t\t\t});\n\t\t}\n\t};\n\n\tconst getId = () => {\n\t\treturn id ? id : name;\n\t};\n\n\tconst TooltipContainer = styled(\"div\")(({ theme }) => ({\n\t\t...(theme.mixins.formComponent_ReadOnlyToolTipContainer.container as CSSProperties)\n\t}));\n\n\tconst textField = () => {\n\t\t/* read-only behaviour */\n\t\tif (readOnly) {\n\t\t\treturn (\n\t\t\t\t<TooltipContainer>\n\t\t\t\t\t<SolaceTooltip\n\t\t\t\t\t\tvariant=\"overflow\"\n\t\t\t\t\t\ttitle={typeof value !== \"undefined\" && value !== null ? value + \"\" : \"\"}\n\t\t\t\t\t\tdataQa={dataQa}\n\t\t\t\t\t>\n\t\t\t\t\t\t{typeof value !== \"undefined\" && value !== null ? value + \"\" : \"\"}\n\t\t\t\t\t</SolaceTooltip>\n\t\t\t\t</TooltipContainer>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<TextField\n\t\t\t\t\tid={`${getId()}`}\n\t\t\t\t\tname={name}\n\t\t\t\t\tinputProps={{\n\t\t\t\t\t\tmaxLength: maxLength,\n\t\t\t\t\t\tsize: size,\n\t\t\t\t\t\t\"data-qa\": dataQa,\n\t\t\t\t\t\t\"data-tags\": dataTags,\n\t\t\t\t\t\t\"data-testid\": dataQa,\n\t\t\t\t\t\t\"data-lpignore\": true,\n\t\t\t\t\t\treadOnly: readOnly,\n\t\t\t\t\t\t...(helperText ? { \"aria-describedby\": `${getId()}-textfield-helper-text` } : {}),\n\t\t\t\t\t\t...(label ? { \"aria-labelledby\": `${getId()}-label` } : {}),\n\t\t\t\t\t\t\"aria-readonly\": readOnly,\n\t\t\t\t\t\ttitle: title,\n\t\t\t\t\t\tmin: 0\n\t\t\t\t\t}}\n\t\t\t\t\tinputRef={inputRef}\n\t\t\t\t\ttype={type}\n\t\t\t\t\terror={hasErrors}\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tautoFocus={autoFocus}\n\t\t\t\t\tInputProps={{ ...defaultInputProps, ...inputEndAdornment, ...inputStartAdornment }}\n\t\t\t\t\tmargin=\"dense\"\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tfullWidth={fullWidth}\n\t\t\t\t\tsx={{ minWidth: minWidth }}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t};\n\n\treturn (\n\t\t<FormChildBase\n\t\t\tid={getId()}\n\t\t\tlabel={label}\n\t\t\thelperText={helperText}\n\t\t\terrorText={hasErrors ? helperText : undefined}\n\t\t\twarningText={hasWarnings ? helperText : undefined}\n\t\t\tdisabled={disabled}\n\t\t\treadOnly={readOnly}\n\t\t\trequired={required}\n\t\t\tinlineLabel={inlineLabel}\n\t\t\tcenterInlineLabel={inlineLabel}\n\t\t\tsx={{ width }}\n\t\t>\n\t\t\t{textField()}\n\t\t</FormChildBase>\n\t);\n}\n\nexport default SolaceTextField;\n"]}
1
+ {"version":3,"sources":["../src/components/form/SolaceLabel.tsx","../src/constants.ts","../src/components/form/FormChildBase.tsx","../src/components/form/SolaceTextField.tsx"],"names":["SolaceLabel","id","htmlForId","required","disabled","readOnly","noWrap","children","jsx","FormLabel_default","clsx_default","SolaceLabel_default","constants","ChildrenContainer","styled_default","prop","theme","inlineLabel","FormChildBase","label","stackLabel","large","bold","centerInlineLabel","helperText","errorText","warningText","sx","jsxs","Box_default","SolaceStackLabel_default","HelperText_default","WarningText_default","ErrorText_default","FormChildBase_default","SolaceTextField","name","value","placeholder","maxLength","type","size","title","autoFocus","hasErrors","hasWarnings","customIcon","onChange","onBlur","onKeyDown","onKeyUp","onFocus","dataQa","dataTags","fullWidth","width","endAdornment","minWidth","inputRef","useTheme","endIconProps","IconButton_default","inputEndAdornment","InputAdornment_default","inputStartAdornment","defaultInputProps","handleChange","event","getId","TooltipContainer","textField","SolaceToolTip_default","TextField_default","SolaceTextField_default"],"mappings":"wMAkDA,SAASA,EAAAA,CAAY,CACpB,GAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EAAW,KAAA,CACX,QAAA,CAAAC,EAAW,KAAA,CACX,QAAA,CAAAC,EAAW,KAAA,CACX,MAAA,CAAAC,CAAAA,CAAS,KAAA,CACT,SAAAC,CACD,CAAA,CAAkC,CACjC,OACCC,IAACC,EAAAA,CAAA,CACA,EAAA,CAA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OAAA,CAASC,CAAAA,CACT,QAASC,CAAAA,CACT,SAAA,CAAWG,EACX,EAAA,CAAI,CAAE,SAAUG,CAAS,CAAA,CAC1B,CAAA,CAKH,OACCjD,IAAC0B,CAAAA,CAAA,CACA,EAAA,CAAIkC,CAAAA,GACJ,KAAA,CAAOjD,CAAAA,CACP,UAAA,CAAYK,CAAAA,CACZ,UAAWoB,CAAAA,CAAYpB,CAAAA,CAAa,OACpC,WAAA,CAAaqB,CAAAA,CAAcrB,EAAa,MAAA,CACxC,QAAA,CAAUpB,CAAAA,CACV,QAAA,CAAUC,EACV,QAAA,CAAUF,CAAAA,CACV,YAAac,CAAAA,CACb,iBAAA,CAAmBA,EACnB,EAAA,CAAI,CAAE,KAAA,CAAAsC,CAAM,EAEX,QAAA,CAAAe,EAAAA,GACF,CAEF,KAEOG,EAAAA,CAAQtC","file":"chunk-YJENEMV2.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 { FormLabel } from \"@mui/material\";\nimport clsx from \"clsx\";\n\nexport interface SolaceLabelProps {\n\t/**\n\t * Unique identifier of the label\n\t */\n\tid: string;\n\t/**\n\t * identifier used for specifying which form element this label is bound to\n\t */\n\thtmlForId?: string;\n\t/**\n\t * Boolean flag used to display an indicator of whether or not this `input` is mandatory\n\t */\n\trequired?: boolean;\n\t/**\n\t * Boolean flag to disable the `input`\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Boolean flag for readOnly labels, changes font color to 55% black\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * Boolean flag to suppress line breaks (text wrapping) within the label\n\t */\n\tnoWrap?: boolean;\n\t/**\n\t *\n\t */\n\tchildren?: React.ReactNode;\n}\n\nfunction SolaceLabel({\n\tid,\n\thtmlForId,\n\trequired = false,\n\tdisabled = false,\n\treadOnly = false,\n\tnoWrap = false,\n\tchildren\n}: SolaceLabelProps): JSX.Element {\n\treturn (\n\t\t<FormLabel\n\t\t\tid={id}\n\t\t\thtmlFor={htmlForId}\n\t\t\trequired={required}\n\t\t\tdisabled={disabled}\n\t\t\tsx={{\n\t\t\t\tdisplay: \"block\",\n\t\t\t\twhiteSpace: noWrap ? \"nowrap\" : \"normal\"\n\t\t\t}}\n\t\t\tclassName={clsx({ \"read-only\": readOnly })}\n\t\t>\n\t\t\t{children}\n\t\t</FormLabel>\n\t);\n}\n\nexport default SolaceLabel;\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\nexport const constants = {\n\tmaxLength: 255,\n\tmenuItemHeight: 38,\n\tmenuItemHeightMultiline: 58,\n\tGridListItemHeight: 53,\n\tDEFAULT_NUM_OF_MENUITEM_DISPLAYED: 9,\n\tcloseButtonAriaLabel: \"Close\",\n\tactionMenuAriaLabel: \"More Actions\",\n\tclearButtonAriaLabel: \"Clear\"\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 { Box, styled } from \"@mui/material\";\nimport SolaceLabel from \"./SolaceLabel\";\nimport SolaceStackLabel from \"./SolaceStackLabel\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { SX } from \"../../types/sx\";\n\ninterface ChildrenContainerProps {\n\tinlineLabel: boolean;\n}\n\nconst ChildrenContainer = styled(\"div\", {\n\tshouldForwardProp: (prop) => prop !== \"inlineLabel\"\n})<ChildrenContainerProps>(({ theme, inlineLabel }) => ({\n\tdisplay: \"flex\",\n\tflexDirection: \"column\",\n\tflexGrow: 1,\n\tmaxWidth: \"100%\",\n\tpaddingLeft: inlineLabel ? \"36px\" : \"0px\",\n\t\"&.hasWarnings\": {\n\t\t\"fieldset.MuiOutlinedInput-notchedOutline, fieldset.MuiInputBase-inputMultiline\": {\n\t\t\tborderColor: `${theme.palette.ux.warning.w100}`\n\t\t}\n\t}\n}));\n\nexport interface FormChildBaseProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier ... if `id` is not specified, `name` value will be used in order to make `label` and `helperText` accessible for screen readers\n\t */\n\tid: string;\n\t/**\n\t * the label content to display on the screen\n\t */\n\tlabel?: string | JSX.Element;\n\t/**\n\t * Boolean flag to allow labels to be rendered as SolaceStackLabel component, which provides more props, such as large, bold\n\t */\n\tstackLabel?: boolean;\n\t/**\n\t * Boolean flag to allow StackSolaceLabel component to be rendered with larger font size of 16px (default to 14px)\n\t */\n\tlarge?: boolean;\n\t/**\n\t * Boolean flag to allow StackSolaceLabel component to be rendered with font weight of medium (default to regular)\n\t */\n\tbold?: boolean;\n\t/**\n\t * The value of the `input` element, required for controlled component\n\t */\n\tvalue?: string;\n\t/**\n\t * Content to display as supportive/explanatory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * HelperText when the `input` in error state\n\t */\n\terrorText?: string | JSX.Element;\n\t/**\n\t * HelperText when the `input` in warning state\n\t */\n\twarningText?: string | JSX.Element;\n\t/**\n\t * Boolean flag used to display an indicator of whether or not this `input` is mandatory\n\t */\n\trequired: boolean;\n\t/**\n\t * Boolean flag to disable the `input`\n\t */\n\tdisabled: boolean;\n\t/**\n\t * Boolean flag to set the `input` in a read-only state\n\t */\n\treadOnly: boolean;\n\t/**\n\t * Display the label horizontally\n\t */\n\tinlineLabel: boolean;\n\t/**\n\t * Center align the inline label, this will e used only for single line field label\n\t */\n\tcenterInlineLabel?: boolean;\n\n\tchildren: JSX.Element;\n\t/**\n\t * The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details.\n\t */\n\tsx?: SX;\n}\n\nfunction FormChildBase({\n\tid,\n\tlabel,\n\tstackLabel,\n\tlarge,\n\tbold,\n\trequired,\n\tdisabled,\n\treadOnly,\n\tinlineLabel,\n\tcenterInlineLabel,\n\thelperText,\n\terrorText,\n\twarningText,\n\tchildren,\n\tsx\n}: FormChildBaseProps): JSX.Element {\n\treturn (\n\t\t<Box\n\t\t\tdisplay=\"flex\"\n\t\t\tflexDirection={inlineLabel ? \"row\" : \"column\"}\n\t\t\tjustifyContent=\"space-between\"\n\t\t\talignItems={centerInlineLabel ? \"flex-start\" : \"\"}\n\t\t\tsx={sx}\n\t\t>\n\t\t\t{stackLabel && label && (\n\t\t\t\t<div style={{ marginTop: centerInlineLabel ? \"5.5px\" : \"\" }}>\n\t\t\t\t\t<SolaceStackLabel\n\t\t\t\t\t\tid={`${id}-label`}\n\t\t\t\t\t\thtmlForId={`${id}`}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tlarge={large}\n\t\t\t\t\t\tbold={bold}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</SolaceStackLabel>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{!stackLabel && label && (\n\t\t\t\t<div style={{ marginTop: centerInlineLabel ? \"5.5px\" : \"\" }}>\n\t\t\t\t\t<SolaceLabel\n\t\t\t\t\t\tid={`${id}-label`}\n\t\t\t\t\t\thtmlForId={`${id}`}\n\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\tnoWrap={inlineLabel}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</SolaceLabel>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<ChildrenContainer inlineLabel={inlineLabel} className={warningText ? \"hasWarnings\" : \"\"}>\n\t\t\t\t{children}\n\t\t\t\t{helperText && !errorText && !warningText && <HelperText>{helperText}</HelperText>}\n\t\t\t\t{warningText && !errorText && <WarningText>{warningText}</WarningText>}\n\t\t\t\t{errorText && <ErrorText>{errorText}</ErrorText>}\n\t\t\t</ChildrenContainer>\n\t\t</Box>\n\t);\n}\n\nexport default FormChildBase;\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 { InputAdornment, IconButton, TextField, useTheme } from \"@mui/material\";\nimport React from \"react\";\nimport { constants } from \"../../constants\";\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport FormChildBase from \"./FormChildBase\";\nimport SolaceTooltip from \"../SolaceToolTip\";\nimport { styled } from \"@mui/material\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\nexport interface SolaceTextFieldChangeEvent {\n\tname: string;\n\tvalue: string;\n}\n\nexport interface SolaceTextFieldProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier ... if `id` is not specified, `name` value will be used in order to make `label` and `helperText` accessible for screen readers\n\t */\n\tid?: string;\n\t/**\n\t * Name attribute to assign to the `input` element\n\t */\n\tname: string;\n\t/**\n\t * the label content to display on the screen\n\t */\n\tlabel?: string | JSX.Element;\n\t/**\n\t * The value of the `input` element, required for controlled component\n\t */\n\tvalue?: string | number;\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Short hint displayed in the `input` before user enters a value\n\t */\n\tplaceholder?: string;\n\t/**\n\t * The maximum number of characters which can be typed as the `input` value\n\t */\n\tmaxLength?: number;\n\t/**\n\t * The type of `input` element to render\n\t */\n\ttype?: \"text\" | \"number\" | \"password\" | \"email\" | \"url\";\n\t/**\n\t * The size/width of the `input` measured in characters\n\t */\n\tsize?: number;\n\t/**\n\t * The text to display as the tooltip hint\n\t */\n\ttitle?: string;\n\t/**\n\t * Boolean flag to control whether the `input` element is focused during first mount\n\t */\n\tautoFocus?: boolean;\n\t/**\n\t * Boolean flag to mark the `input` in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the `input` in warn state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * Boolean flag used to display an indicator of whether or not this `input` is mandatory\n\t */\n\trequired?: boolean;\n\t/**\n\t * Boolean flag to control whether to stack the label on top of the `input` element (false) or place them inline to one another (true)\n\t */\n\tinlineLabel?: boolean;\n\t/**\n\t * Allows custom icon to be set at the beginning/end of the field.\n\t */\n\tcustomIcon?: {\n\t\ticon: React.ReactNode;\n\t\tposition: \"end\" | \"start\";\n\t\thandleClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n\t\tariaLabel?: string;\n\t};\n\t/**\n\t * Boolean flag to disable the `input`\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Boolean flag to set the `input` in a read-only state\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\tonChange?: (event: SolaceTextFieldChangeEvent) => void;\n\t/**\n\t * Callback function to trigger whenever the element of the `input` loses focus\n\t */\n\tonBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * Callback function to trigger whenever the element of the `input` receives key down event\n\t */\n\tonKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n\t/**\n\t * Callback function to trigger whenever the element of the `input` receives key up event\n\t */\n\tonKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n\t/**\n\t * Callback function to trigger whenever the element of the `input` is focused\n\t */\n\tonFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;\n\t/**\n\t * Custom Width of the component.\n\t */\n\twidth?: string;\n\t/**\n\t * If true, the input will take up the full width of its container.\n\t */\n\tfullWidth?: boolean;\n\t/**\n\t * optional prop to pass an array of icon or button at the end of textfield\n\t */\n\tendAdornment?: (React.ReactNode | JSX.Element)[];\n\t/**\n\t * minimum width of the component\n\t */\n\tminWidth?: string;\n\t/**\n\t * pass a ref to the input element.\n\t */\n\tinputRef?: (input: HTMLInputElement) => void;\n}\n\nfunction SolaceTextField({\n\tid,\n\tname,\n\tlabel,\n\tvalue,\n\thelperText,\n\tplaceholder,\n\tmaxLength = constants.maxLength,\n\ttype = \"text\",\n\tsize = 50,\n\ttitle,\n\tautoFocus = false,\n\thasErrors = false,\n\thasWarnings = false,\n\trequired = false,\n\tinlineLabel = false,\n\tcustomIcon,\n\tdisabled = false,\n\treadOnly = false,\n\tonChange,\n\tonBlur,\n\tonKeyDown,\n\tonKeyUp,\n\tonFocus,\n\tdataQa,\n\tdataTags,\n\tfullWidth = false,\n\twidth,\n\tendAdornment,\n\tminWidth,\n\tinputRef\n}: SolaceTextFieldProps): JSX.Element {\n\tconst theme = useTheme();\n\n\tconst endIconProps =\n\t\tcustomIcon && customIcon.position === \"end\" ? (\n\t\t\t<IconButton onClick={customIcon.handleClick} aria-label={customIcon.ariaLabel}>\n\t\t\t\t{customIcon.icon}\n\t\t\t</IconButton>\n\t\t) : null;\n\n\tconst inputEndAdornment =\n\t\tendIconProps || endAdornment\n\t\t\t? {\n\t\t\t\t\tendAdornment: (\n\t\t\t\t\t\t<InputAdornment position=\"end\">\n\t\t\t\t\t\t\t{endAdornment}\n\t\t\t\t\t\t\t{endIconProps}\n\t\t\t\t\t\t</InputAdornment>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t: {};\n\tconst inputStartAdornment =\n\t\tcustomIcon && customIcon.position === \"start\"\n\t\t\t? {\n\t\t\t\t\tstartAdornment: (\n\t\t\t\t\t\t<InputAdornment position={customIcon.position}>\n\t\t\t\t\t\t\t<IconButton onClick={customIcon.handleClick} aria-label={customIcon.ariaLabel}>\n\t\t\t\t\t\t\t\t{customIcon.icon}\n\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t</InputAdornment>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t: {};\n\n\tconst defaultInputProps = {\n\t\tsx: { height: theme.spacing(4) },\n\t\tdisabled: disabled,\n\t\trequired: required\n\t};\n\n\tconst handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n\t\tif (onChange) {\n\t\t\tonChange({\n\t\t\t\tname: name,\n\t\t\t\tvalue: event.target.value\n\t\t\t});\n\t\t}\n\t};\n\n\tconst getId = () => {\n\t\treturn id ? id : name;\n\t};\n\n\tconst TooltipContainer = styled(\"div\")(({ theme }) => ({\n\t\t...(theme.mixins.formComponent_ReadOnlyToolTipContainer.container as CSSProperties)\n\t}));\n\n\tconst textField = () => {\n\t\t/* read-only behaviour */\n\t\tif (readOnly) {\n\t\t\treturn (\n\t\t\t\t<TooltipContainer>\n\t\t\t\t\t<SolaceTooltip\n\t\t\t\t\t\tvariant=\"overflow\"\n\t\t\t\t\t\ttitle={typeof value !== \"undefined\" && value !== null ? value + \"\" : \"\"}\n\t\t\t\t\t\tdataQa={dataQa}\n\t\t\t\t\t>\n\t\t\t\t\t\t{typeof value !== \"undefined\" && value !== null ? value + \"\" : \"\"}\n\t\t\t\t\t</SolaceTooltip>\n\t\t\t\t</TooltipContainer>\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t<TextField\n\t\t\t\t\tid={`${getId()}`}\n\t\t\t\t\tname={name}\n\t\t\t\t\tinputProps={{\n\t\t\t\t\t\tmaxLength: maxLength,\n\t\t\t\t\t\tsize: size,\n\t\t\t\t\t\t\"data-qa\": dataQa,\n\t\t\t\t\t\t\"data-tags\": dataTags,\n\t\t\t\t\t\t\"data-testid\": dataQa,\n\t\t\t\t\t\t\"data-lpignore\": true,\n\t\t\t\t\t\treadOnly: readOnly,\n\t\t\t\t\t\t...(helperText ? { \"aria-describedby\": `${getId()}-textfield-helper-text` } : {}),\n\t\t\t\t\t\t...(label ? { \"aria-labelledby\": `${getId()}-label` } : {}),\n\t\t\t\t\t\t\"aria-readonly\": readOnly,\n\t\t\t\t\t\ttitle: title,\n\t\t\t\t\t\tmin: 0\n\t\t\t\t\t}}\n\t\t\t\t\tinputRef={inputRef}\n\t\t\t\t\ttype={type}\n\t\t\t\t\terror={hasErrors}\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tautoFocus={autoFocus}\n\t\t\t\t\tInputProps={{ ...defaultInputProps, ...inputEndAdornment, ...inputStartAdornment }}\n\t\t\t\t\tmargin=\"dense\"\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tfullWidth={fullWidth}\n\t\t\t\t\tsx={{ minWidth: minWidth }}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t};\n\n\treturn (\n\t\t<FormChildBase\n\t\t\tid={getId()}\n\t\t\tlabel={label}\n\t\t\thelperText={helperText}\n\t\t\terrorText={hasErrors ? helperText : undefined}\n\t\t\twarningText={hasWarnings ? helperText : undefined}\n\t\t\tdisabled={disabled}\n\t\t\treadOnly={readOnly}\n\t\t\trequired={required}\n\t\t\tinlineLabel={inlineLabel}\n\t\t\tcenterInlineLabel={inlineLabel}\n\t\t\tsx={{ width }}\n\t\t>\n\t\t\t{textField()}\n\t\t</FormChildBase>\n\t);\n}\n\nexport default SolaceTextField;\n"]}
@@ -1,3 +1,3 @@
1
- 'use strict';var chunk266AAHHO_js=require('./chunk-266AAHHO.js'),chunkHHKIWPP5_js=require('./chunk-HHKIWPP5.js'),chunkKALFXZNR_js=require('./chunk-KALFXZNR.js'),react=require('react'),Oe=require('@uiw/react-codemirror'),view=require('@codemirror/view'),commands=require('@codemirror/commands'),codemirrorThemes=require('@uiw/codemirror-themes'),highlight=require('@lezer/highlight'),language=require('@codemirror/language'),state=require('@codemirror/state'),langJson=require('@codemirror/lang-json'),langXml=require('@codemirror/lang-xml'),langYaml=require('@codemirror/lang-yaml'),lint=require('@codemirror/lint'),jsxRuntime=require('react/jsx-runtime'),maasIcons=require('@SolaceDev/maas-icons');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Oe__default=/*#__PURE__*/_interopDefault(Oe);var ye=/^-?(\d+(\.\d+)?([eE][+-]?\d+)?|\.\d+)$/,Se=/^(true|false|yes|no|on|off)$/i;function Ce(e,t){let o=view.Decoration.mark({class:"cm-yaml-number"}),s=view.Decoration.mark({class:"cm-yaml-bool"}),l=view.EditorView.theme({".cm-yaml-number span":{color:`${e} !important`},".cm-yaml-bool span":{color:`${t} !important`},".cm-yaml-number":{color:e},".cm-yaml-bool":{color:t}});function a(n){let f=new state.RangeSetBuilder,d=language.syntaxTree(n.state);for(let{from:g,to:c}of n.visibleRanges)d.iterate({from:g,to:c,enter(i){if(i.name!=="Literal"||i.node.parent?.name==="Key")return;let m=n.state.doc.sliceString(i.from,i.to);ye.test(m)?f.add(i.from,i.to,o):Se.test(m)&&f.add(i.from,i.to,s);}});return f.finish()}return [view.ViewPlugin.fromClass(class{constructor(n){this.decorations=a(n);}update(n){(n.docChanged||n.viewportChanged||language.syntaxTree(n.startState)!==language.syntaxTree(n.state))&&(this.decorations=a(n.view));}},{decorations:n=>n.decorations}),l]}function $(e,t=false){let o=e.palette,s=codemirrorThemes.createTheme({theme:t?"dark":"light",settings:{background:o.background.w10,foreground:o.secondary.text.wMain,caret:o.secondary.wMain,selection:`${o.brand.wMain}30`,selectionMatch:`${o.brand.wMain}20`,lineHighlight:o.background.w20,gutterBackground:o.background.w20,gutterForeground:o.secondary.text.wMain,gutterBorder:o.secondary.w40,fontFamily:"Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:`${chunkKALFXZNR_js.ni.sm}px`},styles:[{tag:[highlight.tags.string,highlight.tags.special(highlight.tags.string),highlight.tags.character,highlight.tags.regexp,highlight.tags.attributeValue],color:o.accent.n9.w100},{tag:[highlight.tags.number,highlight.tags.integer,highlight.tags.float],color:o.accent.n2.w100},{tag:[highlight.tags.bool,highlight.tags.null,highlight.tags.atom],color:o.info.w100},{tag:[highlight.tags.propertyName,highlight.tags.variableName],color:o.accent.n1.w100},{tag:highlight.tags.attributeName,color:o.accent.n1.w100},{tag:highlight.tags.tagName,color:o.accent.n0.w100},{tag:[highlight.tags.keyword,highlight.tags.definitionKeyword,highlight.tags.modifier,highlight.tags.controlKeyword],color:o.info.w100},{tag:[highlight.tags.function(highlight.tags.variableName),highlight.tags.function(highlight.tags.propertyName)],color:o.accent.n5.w100},{tag:[highlight.tags.typeName,highlight.tags.className],color:o.accent.n0.w100},{tag:highlight.tags.standard(highlight.tags.variableName),color:o.accent.n5.w100},{tag:highlight.tags.namespace,color:o.accent.n2.w100},{tag:highlight.tags.content,color:o.accent.n9.w100},{tag:highlight.tags.processingInstruction,color:o.accent.n5.w100},{tag:[highlight.tags.comment,highlight.tags.lineComment,highlight.tags.blockComment],color:o.secondary.text.wMain,fontStyle:"italic"},{tag:[highlight.tags.operator,highlight.tags.punctuation,highlight.tags.angleBracket,highlight.tags.bracket,highlight.tags.brace,highlight.tags.paren,highlight.tags.separator],color:o.secondary.w100}]}),l=view.EditorView.theme({".cm-keyword":{color:o.info.w100},".cm-type":{color:o.accent.n0.w100},".cm-string":{color:o.accent.n9.w100},".cm-number":{color:o.accent.n2.w100},".cm-atom":{color:o.info.w100},".cm-comment":{color:o.secondary.text.wMain,fontStyle:"italic"},".cm-punctuation":{color:o.secondary.w100},".cm-builtin":{color:o.accent.n5.w100},".cm-variable":{color:o.accent.n1.w100}},{dark:t}),a=Ce(o.accent.n2.w100,o.info.w100);return [s,l,a]}var Me=/\b(syntax|rpc|option|import|repeated|optional|required)\b/,Pe=/\b(int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double)\b/;function y(e){e.expectFieldName=false,e.expectPackageName=false,e.expectTypeName=false;}function Te(e,t){return e.match(/\b(message|enum|service)\b/)||e.match(/\breturns\b/)?(y(t),t.expectTypeName=true,"keyword"):e.match(Me)?(y(t),"keyword"):e.match(/\bpackage\b/)?(y(t),t.expectPackageName=true,"keyword"):null}function ve(e,t){if(e.match(/\b[A-Z][A-Za-z0-9_]*\b/)){let o=t.expectTypeName;return y(t),o?"type":"builtin"}return t.expectPackageName&&e.match(/\b[a-z][a-zA-Z0-9_.]*\b/)?(t.expectPackageName=false,"string"):e.match(/\b[a-z_][a-zA-Z0-9_]*\b/)&&t.expectFieldName?(t.expectFieldName=false,"variable"):null}function Le(e,t){if(t.inBlockComment){for(;!e.eol();){if(e.match("*/")){t.inBlockComment=false;break}e.next();}return "comment"}if(e.match("//"))return e.skipToEnd(),t.expectFieldName=false,"comment";if(e.match("/*")){for(;!e.eol();){if(e.match("*/"))return "comment";e.next();}return t.inBlockComment=true,t.expectFieldName=false,"comment"}return null}function $e(e,t){return e.match(/"(?:[^"\\]|\\.)*"/)?(t.expectFieldName=false,"string"):e.match(Pe)?(t.expectFieldName=true,t.expectTypeName=false,"type"):e.match(/\b(true|false)\b/)?(t.expectFieldName=false,"atom"):e.match(/^\d+(?!\w)/)?(t.expectFieldName=false,"number"):e.match(/[{}();,=[\]]/)?(e.current()===";"&&(t.expectFieldName=false),"punctuation"):null}var Ie=language.StreamLanguage.define({name:"protobuf",startState:()=>({expectFieldName:false,expectPackageName:false,expectTypeName:false,inBlockComment:false}),token(e,t){return e.eatSpace()?null:Le(e,t)??$e(e,t)??Te(e,t)??ve(e,t)??(e.next(),null)},copyState:e=>({...e})}),Q=e=>{switch(e){case "json":return langJson.json();case "xml":return langXml.xml();case "yaml":return langYaml.yaml();case "protobuf":return Ie;default:return langJson.json()}};function q(e,t){let o=t.palette,s=lint.linter(()=>e.map(u=>({from:u.from,to:u.to,severity:u.severity,message:u.message}))),l=lint.lintGutter(),a=view.EditorView.theme({".cm-gutter-lint":{width:"16px",backgroundColor:o.background.w20,overflow:"hidden"},".cm-gutter-lint .cm-gutterElement":{display:"flex",alignItems:"center",justifyContent:"center",padding:"0"},".cm-lint-marker":{content:"none",display:"block",width:"8px",height:"8px",borderRadius:"50%",margin:"auto"},".cm-lint-marker-error":{content:"none",background:o.error.w100},".cm-lint-marker-warning":{content:"none",background:o.warning.w100},".cm-lintRange-error":{backgroundImage:"none",textDecoration:`underline wavy ${o.error.w100}`,textUnderlineOffset:"2px"},".cm-lintRange-warning":{backgroundImage:"none",textDecoration:`underline wavy ${o.warning.w100}`,textUnderlineOffset:"2px"},".cm-tooltip:has(.cm-tooltip-lint)":{border:"none",backgroundColor:"transparent",boxShadow:"none"},".cm-tooltip-lint":{backgroundColor:o.background.w10,border:`1px solid ${o.secondary.w40}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",color:o.secondary.text.wMain,boxShadow:`0 2px 8px ${o.secondary.w20}`}});return [s,l,a]}var We=({size:e,fill:t})=>jsxRuntime.jsx(chunkKALFXZNR_js.Na,{sx:{width:`${e}px`,height:`${e}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:t})}),oe=We;var Fe=({size:e,fill:t})=>jsxRuntime.jsxs(chunkKALFXZNR_js.Na,{sx:{width:`${e}px`,height:`${e}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:t}),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:t})]}),re=Fe;var ne=chunkKALFXZNR_js.wa("div",{shouldForwardProp:e=>e!=="severity"})(({theme:e,severity:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(1,1.5),fontSize:e.typography.body1.fontSize,lineHeight:e.typography.body1.lineHeight,backgroundColor:t==="error"?e.palette.ux.error.w10:e.palette.ux.warning.w10,borderBottom:t==="error"?`1px solid ${e.palette.ux.error.w30}`:`1px solid ${e.palette.ux.warning.w30}`,color:t==="error"?e.palette.ux.error.w100:e.palette.ux.warning.w100})),Ae=e=>{let t=e[e.length-1],o=e.slice(0,-1);return o.length===1?`${o[0]} and ${t}`:`${o.join(", ")}, and ${t}`},ie=(e,t,o)=>{let s=e.filter(c=>c.severity===o);if(s.length===0)return "";let l=[];for(let c=0;c<t.length;c++)t[c]===`
2
- `&&l.push(c);let a=c=>{let i=0,m=l.length;for(;i<m;){let w=i+m>>1;l[w]<c?i=w+1:m=w;}return i+1},u=new Set;s.forEach(c=>{u.add(a(c.from));});let n=Array.from(u).sort((c,i)=>c-i),f=o==="error"?"error":"warning",d=s.length>1?"s":"",g=o==="error"?"Invalid syntax.":"Invalid schema.";return n.length===1?`${g} Fix ${f}${d} on line ${n[0]}.`:`${g} Fix ${f}${d} in lines ${Ae(n)}.`},Re=({validationMessages:e,doc:t})=>{let o=chunkKALFXZNR_js.ua(),s=e.some(a=>a.severity==="error"),l=e.some(a=>a.severity==="warning");return s?jsxRuntime.jsxs(ne,{severity:"error",role:"alert","aria-live":"assertive",children:[jsxRuntime.jsx(maasIcons.Error16Icon,{sx:{flexShrink:0,fontSize:20},fill:o.palette.ux.error.w100}),jsxRuntime.jsx("span",{children:ie(e,t,"error")})]}):l?jsxRuntime.jsxs(ne,{severity:"warning",role:"status","aria-live":"polite",children:[jsxRuntime.jsx(maasIcons.Warning16Icon,{sx:{flexShrink:0,fontSize:20},fill:o.palette.ux.warning.w100}),jsxRuntime.jsx("span",{children:ie(e,t,"warning")})]}):null},ce=Re;var Ze=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.OuterWrapper})),Ue=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.InnerWrapper})),H="auto !important",x="100% !important",W="none !important",pe=chunkKALFXZNR_js.wa("div")(({theme:e,customHeight:t})=>{let o=e.mixins.formComponent_CodeEditor.EditorWrapper[".codeEditor-expanded--main &"];return {...e.mixins.formComponent_CodeEditor.EditorWrapper,...t==="auto"&&{height:H,"& .cm-theme":{height:H},"& .cm-editor":{height:H},"& .cm-editor .cm-scroller":{maxHeight:W},".codeEditor-expanded--main &":{...o,height:x,"& .cm-theme":{height:x},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:W}}},...t&&t!=="auto"&&{height:`${t} !important`,display:"flex",flexDirection:"column","& .cm-theme":{flex:"1 1 0",minHeight:"0"},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:x},".codeEditor-expanded--main &":{...o,height:x,"& .cm-theme":{height:x},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:W}}}}}),Xe=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.IconWrapper})),de=(e,t,o)=>t?jsxRuntime.jsx(chunkHHKIWPP5_js.e,{children:e}):o?jsxRuntime.jsx(chunkHHKIWPP5_js.g,{children:e}):jsxRuntime.jsx(chunkHHKIWPP5_js.c,{children:e});function Je({mode:e="json",value:t,readOnly:o=false,expandable:s=false,fullScreen:l=false,helperText:a="",hasErrors:u=false,hasWarnings:n=false,height:f,validationMessages:d=[],onValidationChange:g,onChange:c}){let i=chunkKALFXZNR_js.ua(),m=chunkKALFXZNR_js.qi(),[w,_]=react.useState(t||""),[b,z]=react.useState(l||false);react.useEffect(()=>{t!==void 0&&_(t);},[t]),react.useEffect(()=>{z(l);},[l]),react.useEffect(()=>{if(g){let S=d.some(T=>T.severity==="error"),xe=d.some(T=>T.severity==="warning");g(S,xe);}},[d,g]);let M=chunkKALFXZNR_js.pi==="solace-dark",D=react.useMemo(()=>view.EditorView.theme({"&":{color:m.palette.secondary.text.wMain},"& .cm-content *":{color:`${m.palette.secondary.text.wMain} !important`}}),[m]),ue=react.useMemo(()=>o?[...$(m,M),D]:$(m,M),[m,M,o,D]),fe=react.useMemo(()=>o?[view.EditorView.lineWrapping,view.keymap.of(commands.defaultKeymap)]:[Q(e),view.EditorView.lineWrapping,view.keymap.of(commands.defaultKeymap),...d.length>0?q(d,m):[]],[e,o,d,m]),ge=S=>{_(S),c&&c(null,null,S);},P=f?typeof f=="number"?`${f}px`:f:"300px",A=()=>{z(!b);},R=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ce,{validationMessages:d,doc:w}),jsxRuntime.jsx(Oe__default.default,{value:w,onChange:ge,extensions:fe,theme:ue,height:P,editable:!o,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(Ze,{className:b?"codeEditor-expanded--backdrop":"",children:jsxRuntime.jsxs(Ue,{className:b?"codeEditor-expanded--main":"",children:[jsxRuntime.jsx(Xe,{className:b?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:b?jsxRuntime.jsx(chunk266AAHHO_js.b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:A,title:"Collapse",children:jsxRuntime.jsx(re,{fill:i.palette.ux.secondary.wMain,size:24})}):jsxRuntime.jsx(chunk266AAHHO_js.b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:A,title:"Expand",children:jsxRuntime.jsx(oe,{fill:i.palette.ux.secondary.wMain,size:24})})}),jsxRuntime.jsx(pe,{customHeight:P,className:`${b?"":"codeEditor-border"} ${o?"codeEditor-readonly":""}`,children:R}),a&&de(a,u,n)]})}),!s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(pe,{customHeight:P,className:`${b?"":"codeEditor-border"} ${o?"codeEditor-readonly":""}`,children:R}),a&&de(a,u,n)]})]})}var Ke=Je;exports.SolaceCodeEditor=Ke;//# sourceMappingURL=code-editor.js.map
1
+ 'use strict';var chunk2CMPFNW2_js=require('./chunk-2CMPFNW2.js'),chunkNT45IFR2_js=require('./chunk-NT45IFR2.js'),chunkKALFXZNR_js=require('./chunk-KALFXZNR.js'),react=require('react'),Oe=require('@uiw/react-codemirror'),view=require('@codemirror/view'),commands=require('@codemirror/commands'),codemirrorThemes=require('@uiw/codemirror-themes'),highlight=require('@lezer/highlight'),language=require('@codemirror/language'),state=require('@codemirror/state'),langJson=require('@codemirror/lang-json'),langXml=require('@codemirror/lang-xml'),langYaml=require('@codemirror/lang-yaml'),lint=require('@codemirror/lint'),jsxRuntime=require('react/jsx-runtime'),maasIcons=require('@SolaceDev/maas-icons');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Oe__default=/*#__PURE__*/_interopDefault(Oe);var ye=/^-?(\d+(\.\d+)?([eE][+-]?\d+)?|\.\d+)$/,Se=/^(true|false|yes|no|on|off)$/i;function Ce(e,t){let o=view.Decoration.mark({class:"cm-yaml-number"}),s=view.Decoration.mark({class:"cm-yaml-bool"}),l=view.EditorView.theme({".cm-yaml-number span":{color:`${e} !important`},".cm-yaml-bool span":{color:`${t} !important`},".cm-yaml-number":{color:e},".cm-yaml-bool":{color:t}});function a(n){let f=new state.RangeSetBuilder,d=language.syntaxTree(n.state);for(let{from:g,to:c}of n.visibleRanges)d.iterate({from:g,to:c,enter(i){if(i.name!=="Literal"||i.node.parent?.name==="Key")return;let m=n.state.doc.sliceString(i.from,i.to);ye.test(m)?f.add(i.from,i.to,o):Se.test(m)&&f.add(i.from,i.to,s);}});return f.finish()}return [view.ViewPlugin.fromClass(class{constructor(n){this.decorations=a(n);}update(n){(n.docChanged||n.viewportChanged||language.syntaxTree(n.startState)!==language.syntaxTree(n.state))&&(this.decorations=a(n.view));}},{decorations:n=>n.decorations}),l]}function $(e,t=false){let o=e.palette,s=codemirrorThemes.createTheme({theme:t?"dark":"light",settings:{background:o.background.w10,foreground:o.secondary.text.wMain,caret:o.secondary.wMain,selection:`${o.brand.wMain}30`,selectionMatch:`${o.brand.wMain}20`,lineHighlight:o.background.w20,gutterBackground:o.background.w20,gutterForeground:o.secondary.text.wMain,gutterBorder:o.secondary.w40,fontFamily:"Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:`${chunkKALFXZNR_js.ni.sm}px`},styles:[{tag:[highlight.tags.string,highlight.tags.special(highlight.tags.string),highlight.tags.character,highlight.tags.regexp,highlight.tags.attributeValue],color:o.accent.n9.w100},{tag:[highlight.tags.number,highlight.tags.integer,highlight.tags.float],color:o.accent.n2.w100},{tag:[highlight.tags.bool,highlight.tags.null,highlight.tags.atom],color:o.info.w100},{tag:[highlight.tags.propertyName,highlight.tags.variableName],color:o.accent.n1.w100},{tag:highlight.tags.attributeName,color:o.accent.n1.w100},{tag:highlight.tags.tagName,color:o.accent.n0.w100},{tag:[highlight.tags.keyword,highlight.tags.definitionKeyword,highlight.tags.modifier,highlight.tags.controlKeyword],color:o.info.w100},{tag:[highlight.tags.function(highlight.tags.variableName),highlight.tags.function(highlight.tags.propertyName)],color:o.accent.n5.w100},{tag:[highlight.tags.typeName,highlight.tags.className],color:o.accent.n0.w100},{tag:highlight.tags.standard(highlight.tags.variableName),color:o.accent.n5.w100},{tag:highlight.tags.namespace,color:o.accent.n2.w100},{tag:highlight.tags.content,color:o.accent.n9.w100},{tag:highlight.tags.processingInstruction,color:o.accent.n5.w100},{tag:[highlight.tags.comment,highlight.tags.lineComment,highlight.tags.blockComment],color:o.secondary.text.wMain,fontStyle:"italic"},{tag:[highlight.tags.operator,highlight.tags.punctuation,highlight.tags.angleBracket,highlight.tags.bracket,highlight.tags.brace,highlight.tags.paren,highlight.tags.separator],color:o.secondary.w100}]}),l=view.EditorView.theme({".cm-keyword":{color:o.info.w100},".cm-type":{color:o.accent.n0.w100},".cm-string":{color:o.accent.n9.w100},".cm-number":{color:o.accent.n2.w100},".cm-atom":{color:o.info.w100},".cm-comment":{color:o.secondary.text.wMain,fontStyle:"italic"},".cm-punctuation":{color:o.secondary.w100},".cm-builtin":{color:o.accent.n5.w100},".cm-variable":{color:o.accent.n1.w100}},{dark:t}),a=Ce(o.accent.n2.w100,o.info.w100);return [s,l,a]}var Me=/\b(syntax|rpc|option|import|repeated|optional|required)\b/,Pe=/\b(int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double)\b/;function y(e){e.expectFieldName=false,e.expectPackageName=false,e.expectTypeName=false;}function Te(e,t){return e.match(/\b(message|enum|service)\b/)||e.match(/\breturns\b/)?(y(t),t.expectTypeName=true,"keyword"):e.match(Me)?(y(t),"keyword"):e.match(/\bpackage\b/)?(y(t),t.expectPackageName=true,"keyword"):null}function ve(e,t){if(e.match(/\b[A-Z][A-Za-z0-9_]*\b/)){let o=t.expectTypeName;return y(t),o?"type":"builtin"}return t.expectPackageName&&e.match(/\b[a-z][a-zA-Z0-9_.]*\b/)?(t.expectPackageName=false,"string"):e.match(/\b[a-z_][a-zA-Z0-9_]*\b/)&&t.expectFieldName?(t.expectFieldName=false,"variable"):null}function Le(e,t){if(t.inBlockComment){for(;!e.eol();){if(e.match("*/")){t.inBlockComment=false;break}e.next();}return "comment"}if(e.match("//"))return e.skipToEnd(),t.expectFieldName=false,"comment";if(e.match("/*")){for(;!e.eol();){if(e.match("*/"))return "comment";e.next();}return t.inBlockComment=true,t.expectFieldName=false,"comment"}return null}function $e(e,t){return e.match(/"(?:[^"\\]|\\.)*"/)?(t.expectFieldName=false,"string"):e.match(Pe)?(t.expectFieldName=true,t.expectTypeName=false,"type"):e.match(/\b(true|false)\b/)?(t.expectFieldName=false,"atom"):e.match(/^\d+(?!\w)/)?(t.expectFieldName=false,"number"):e.match(/[{}();,=[\]]/)?(e.current()===";"&&(t.expectFieldName=false),"punctuation"):null}var Ie=language.StreamLanguage.define({name:"protobuf",startState:()=>({expectFieldName:false,expectPackageName:false,expectTypeName:false,inBlockComment:false}),token(e,t){return e.eatSpace()?null:Le(e,t)??$e(e,t)??Te(e,t)??ve(e,t)??(e.next(),null)},copyState:e=>({...e})}),Q=e=>{switch(e){case "json":return langJson.json();case "xml":return langXml.xml();case "yaml":return langYaml.yaml();case "protobuf":return Ie;default:return langJson.json()}};function q(e,t){let o=t.palette,s=lint.linter(()=>e.map(u=>({from:u.from,to:u.to,severity:u.severity,message:u.message}))),l=lint.lintGutter(),a=view.EditorView.theme({".cm-gutter-lint":{width:"16px",backgroundColor:o.background.w20,overflow:"hidden"},".cm-gutter-lint .cm-gutterElement":{display:"flex",alignItems:"center",justifyContent:"center",padding:"0"},".cm-lint-marker":{content:"none",display:"block",width:"8px",height:"8px",borderRadius:"50%",margin:"auto"},".cm-lint-marker-error":{content:"none",background:o.error.w100},".cm-lint-marker-warning":{content:"none",background:o.warning.w100},".cm-lintRange-error":{backgroundImage:"none",textDecoration:`underline wavy ${o.error.w100}`,textUnderlineOffset:"2px"},".cm-lintRange-warning":{backgroundImage:"none",textDecoration:`underline wavy ${o.warning.w100}`,textUnderlineOffset:"2px"},".cm-tooltip:has(.cm-tooltip-lint)":{border:"none",backgroundColor:"transparent",boxShadow:"none"},".cm-tooltip-lint":{backgroundColor:o.background.w10,border:`1px solid ${o.secondary.w40}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",color:o.secondary.text.wMain,boxShadow:`0 2px 8px ${o.secondary.w20}`}});return [s,l,a]}var We=({size:e,fill:t})=>jsxRuntime.jsx(chunkKALFXZNR_js.Na,{sx:{width:`${e}px`,height:`${e}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:t})}),oe=We;var Fe=({size:e,fill:t})=>jsxRuntime.jsxs(chunkKALFXZNR_js.Na,{sx:{width:`${e}px`,height:`${e}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:t}),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:t})]}),re=Fe;var ne=chunkKALFXZNR_js.wa("div",{shouldForwardProp:e=>e!=="severity"})(({theme:e,severity:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(1,1.5),fontSize:e.typography.body1.fontSize,lineHeight:e.typography.body1.lineHeight,backgroundColor:t==="error"?e.palette.ux.error.w10:e.palette.ux.warning.w10,borderBottom:t==="error"?`1px solid ${e.palette.ux.error.w30}`:`1px solid ${e.palette.ux.warning.w30}`,color:t==="error"?e.palette.ux.error.w100:e.palette.ux.warning.w100})),Ae=e=>{let t=e[e.length-1],o=e.slice(0,-1);return o.length===1?`${o[0]} and ${t}`:`${o.join(", ")}, and ${t}`},ie=(e,t,o)=>{let s=e.filter(c=>c.severity===o);if(s.length===0)return "";let l=[];for(let c=0;c<t.length;c++)t[c]===`
2
+ `&&l.push(c);let a=c=>{let i=0,m=l.length;for(;i<m;){let w=i+m>>1;l[w]<c?i=w+1:m=w;}return i+1},u=new Set;s.forEach(c=>{u.add(a(c.from));});let n=Array.from(u).sort((c,i)=>c-i),f=o==="error"?"error":"warning",d=s.length>1?"s":"",g=o==="error"?"Invalid syntax.":"Invalid schema.";return n.length===1?`${g} Fix ${f}${d} on line ${n[0]}.`:`${g} Fix ${f}${d} in lines ${Ae(n)}.`},Re=({validationMessages:e,doc:t})=>{let o=chunkKALFXZNR_js.ua(),s=e.some(a=>a.severity==="error"),l=e.some(a=>a.severity==="warning");return s?jsxRuntime.jsxs(ne,{severity:"error",role:"alert","aria-live":"assertive",children:[jsxRuntime.jsx(maasIcons.Error16Icon,{sx:{flexShrink:0,fontSize:20},fill:o.palette.ux.error.w100}),jsxRuntime.jsx("span",{children:ie(e,t,"error")})]}):l?jsxRuntime.jsxs(ne,{severity:"warning",role:"status","aria-live":"polite",children:[jsxRuntime.jsx(maasIcons.Warning16Icon,{sx:{flexShrink:0,fontSize:20},fill:o.palette.ux.warning.w100}),jsxRuntime.jsx("span",{children:ie(e,t,"warning")})]}):null},ce=Re;var Ze=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.OuterWrapper})),Ue=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.InnerWrapper})),H="auto !important",x="100% !important",W="none !important",pe=chunkKALFXZNR_js.wa("div")(({theme:e,customHeight:t})=>{let o=e.mixins.formComponent_CodeEditor.EditorWrapper[".codeEditor-expanded--main &"];return {...e.mixins.formComponent_CodeEditor.EditorWrapper,...t==="auto"&&{height:H,"& .cm-theme":{height:H},"& .cm-editor":{height:H},"& .cm-editor .cm-scroller":{maxHeight:W},".codeEditor-expanded--main &":{...o,height:x,"& .cm-theme":{height:x},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:W}}},...t&&t!=="auto"&&{height:`${t} !important`,display:"flex",flexDirection:"column","& .cm-theme":{flex:"1 1 0",minHeight:"0"},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:x},".codeEditor-expanded--main &":{...o,height:x,"& .cm-theme":{height:x},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:W}}}}}),Xe=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.IconWrapper})),de=(e,t,o)=>t?jsxRuntime.jsx(chunkNT45IFR2_js.d,{children:e}):o?jsxRuntime.jsx(chunkNT45IFR2_js.f,{children:e}):jsxRuntime.jsx(chunkNT45IFR2_js.c,{children:e});function Je({mode:e="json",value:t,readOnly:o=false,expandable:s=false,fullScreen:l=false,helperText:a="",hasErrors:u=false,hasWarnings:n=false,height:f,validationMessages:d=[],onValidationChange:g,onChange:c}){let i=chunkKALFXZNR_js.ua(),m=chunkKALFXZNR_js.qi(),[w,_]=react.useState(t||""),[b,z]=react.useState(l||false);react.useEffect(()=>{t!==void 0&&_(t);},[t]),react.useEffect(()=>{z(l);},[l]),react.useEffect(()=>{if(g){let S=d.some(T=>T.severity==="error"),xe=d.some(T=>T.severity==="warning");g(S,xe);}},[d,g]);let M=chunkKALFXZNR_js.pi==="solace-dark",D=react.useMemo(()=>view.EditorView.theme({"&":{color:m.palette.secondary.text.wMain},"& .cm-content *":{color:`${m.palette.secondary.text.wMain} !important`}}),[m]),ue=react.useMemo(()=>o?[...$(m,M),D]:$(m,M),[m,M,o,D]),fe=react.useMemo(()=>o?[view.EditorView.lineWrapping,view.keymap.of(commands.defaultKeymap)]:[Q(e),view.EditorView.lineWrapping,view.keymap.of(commands.defaultKeymap),...d.length>0?q(d,m):[]],[e,o,d,m]),ge=S=>{_(S),c&&c(null,null,S);},P=f?typeof f=="number"?`${f}px`:f:"300px",A=()=>{z(!b);},R=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ce,{validationMessages:d,doc:w}),jsxRuntime.jsx(Oe__default.default,{value:w,onChange:ge,extensions:fe,theme:ue,height:P,editable:!o,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[s&&jsxRuntime.jsx(Ze,{className:b?"codeEditor-expanded--backdrop":"",children:jsxRuntime.jsxs(Ue,{className:b?"codeEditor-expanded--main":"",children:[jsxRuntime.jsx(Xe,{className:b?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:b?jsxRuntime.jsx(chunk2CMPFNW2_js.b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:A,title:"Collapse",children:jsxRuntime.jsx(re,{fill:i.palette.ux.secondary.wMain,size:24})}):jsxRuntime.jsx(chunk2CMPFNW2_js.b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:A,title:"Expand",children:jsxRuntime.jsx(oe,{fill:i.palette.ux.secondary.wMain,size:24})})}),jsxRuntime.jsx(pe,{customHeight:P,className:`${b?"":"codeEditor-border"} ${o?"codeEditor-readonly":""}`,children:R}),a&&de(a,u,n)]})}),!s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(pe,{customHeight:P,className:`${b?"":"codeEditor-border"} ${o?"codeEditor-readonly":""}`,children:R}),a&&de(a,u,n)]})]})}var Ke=Je;exports.SolaceCodeEditor=Ke;//# sourceMappingURL=code-editor.js.map
3
3
  //# sourceMappingURL=code-editor.js.map
@@ -1,3 +1,3 @@
1
- import {b}from'./chunk-LWCJ2SGT.modern.mjs';import {e,g,c}from'./chunk-Q6DR3MQK.modern.mjs';import {wa,ua,qi,pi,ni,Na}from'./chunk-PWYVYHTJ.modern.mjs';import {useState,useEffect,useMemo}from'react';import Oe from'@uiw/react-codemirror';import {EditorView,keymap,Decoration,ViewPlugin}from'@codemirror/view';import {defaultKeymap}from'@codemirror/commands';import {createTheme}from'@uiw/codemirror-themes';import {tags}from'@lezer/highlight';import {StreamLanguage,syntaxTree}from'@codemirror/language';import {RangeSetBuilder}from'@codemirror/state';import {json}from'@codemirror/lang-json';import {xml}from'@codemirror/lang-xml';import {yaml}from'@codemirror/lang-yaml';import {linter,lintGutter}from'@codemirror/lint';import {jsxs,Fragment,jsx}from'react/jsx-runtime';import {Error16Icon,Warning16Icon}from'@SolaceDev/maas-icons';var ye=/^-?(\d+(\.\d+)?([eE][+-]?\d+)?|\.\d+)$/,Se=/^(true|false|yes|no|on|off)$/i;function Ce(e,t){let o=Decoration.mark({class:"cm-yaml-number"}),s=Decoration.mark({class:"cm-yaml-bool"}),l=EditorView.theme({".cm-yaml-number span":{color:`${e} !important`},".cm-yaml-bool span":{color:`${t} !important`},".cm-yaml-number":{color:e},".cm-yaml-bool":{color:t}});function a(n){let f=new RangeSetBuilder,d=syntaxTree(n.state);for(let{from:g,to:c}of n.visibleRanges)d.iterate({from:g,to:c,enter(i){if(i.name!=="Literal"||i.node.parent?.name==="Key")return;let m=n.state.doc.sliceString(i.from,i.to);ye.test(m)?f.add(i.from,i.to,o):Se.test(m)&&f.add(i.from,i.to,s);}});return f.finish()}return [ViewPlugin.fromClass(class{constructor(n){this.decorations=a(n);}update(n){(n.docChanged||n.viewportChanged||syntaxTree(n.startState)!==syntaxTree(n.state))&&(this.decorations=a(n.view));}},{decorations:n=>n.decorations}),l]}function $(e,t=false){let o=e.palette,s=createTheme({theme:t?"dark":"light",settings:{background:o.background.w10,foreground:o.secondary.text.wMain,caret:o.secondary.wMain,selection:`${o.brand.wMain}30`,selectionMatch:`${o.brand.wMain}20`,lineHighlight:o.background.w20,gutterBackground:o.background.w20,gutterForeground:o.secondary.text.wMain,gutterBorder:o.secondary.w40,fontFamily:"Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:`${ni.sm}px`},styles:[{tag:[tags.string,tags.special(tags.string),tags.character,tags.regexp,tags.attributeValue],color:o.accent.n9.w100},{tag:[tags.number,tags.integer,tags.float],color:o.accent.n2.w100},{tag:[tags.bool,tags.null,tags.atom],color:o.info.w100},{tag:[tags.propertyName,tags.variableName],color:o.accent.n1.w100},{tag:tags.attributeName,color:o.accent.n1.w100},{tag:tags.tagName,color:o.accent.n0.w100},{tag:[tags.keyword,tags.definitionKeyword,tags.modifier,tags.controlKeyword],color:o.info.w100},{tag:[tags.function(tags.variableName),tags.function(tags.propertyName)],color:o.accent.n5.w100},{tag:[tags.typeName,tags.className],color:o.accent.n0.w100},{tag:tags.standard(tags.variableName),color:o.accent.n5.w100},{tag:tags.namespace,color:o.accent.n2.w100},{tag:tags.content,color:o.accent.n9.w100},{tag:tags.processingInstruction,color:o.accent.n5.w100},{tag:[tags.comment,tags.lineComment,tags.blockComment],color:o.secondary.text.wMain,fontStyle:"italic"},{tag:[tags.operator,tags.punctuation,tags.angleBracket,tags.bracket,tags.brace,tags.paren,tags.separator],color:o.secondary.w100}]}),l=EditorView.theme({".cm-keyword":{color:o.info.w100},".cm-type":{color:o.accent.n0.w100},".cm-string":{color:o.accent.n9.w100},".cm-number":{color:o.accent.n2.w100},".cm-atom":{color:o.info.w100},".cm-comment":{color:o.secondary.text.wMain,fontStyle:"italic"},".cm-punctuation":{color:o.secondary.w100},".cm-builtin":{color:o.accent.n5.w100},".cm-variable":{color:o.accent.n1.w100}},{dark:t}),a=Ce(o.accent.n2.w100,o.info.w100);return [s,l,a]}var Me=/\b(syntax|rpc|option|import|repeated|optional|required)\b/,Pe=/\b(int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double)\b/;function y(e){e.expectFieldName=false,e.expectPackageName=false,e.expectTypeName=false;}function Te(e,t){return e.match(/\b(message|enum|service)\b/)||e.match(/\breturns\b/)?(y(t),t.expectTypeName=true,"keyword"):e.match(Me)?(y(t),"keyword"):e.match(/\bpackage\b/)?(y(t),t.expectPackageName=true,"keyword"):null}function ve(e,t){if(e.match(/\b[A-Z][A-Za-z0-9_]*\b/)){let o=t.expectTypeName;return y(t),o?"type":"builtin"}return t.expectPackageName&&e.match(/\b[a-z][a-zA-Z0-9_.]*\b/)?(t.expectPackageName=false,"string"):e.match(/\b[a-z_][a-zA-Z0-9_]*\b/)&&t.expectFieldName?(t.expectFieldName=false,"variable"):null}function Le(e,t){if(t.inBlockComment){for(;!e.eol();){if(e.match("*/")){t.inBlockComment=false;break}e.next();}return "comment"}if(e.match("//"))return e.skipToEnd(),t.expectFieldName=false,"comment";if(e.match("/*")){for(;!e.eol();){if(e.match("*/"))return "comment";e.next();}return t.inBlockComment=true,t.expectFieldName=false,"comment"}return null}function $e(e,t){return e.match(/"(?:[^"\\]|\\.)*"/)?(t.expectFieldName=false,"string"):e.match(Pe)?(t.expectFieldName=true,t.expectTypeName=false,"type"):e.match(/\b(true|false)\b/)?(t.expectFieldName=false,"atom"):e.match(/^\d+(?!\w)/)?(t.expectFieldName=false,"number"):e.match(/[{}();,=[\]]/)?(e.current()===";"&&(t.expectFieldName=false),"punctuation"):null}var Ie=StreamLanguage.define({name:"protobuf",startState:()=>({expectFieldName:false,expectPackageName:false,expectTypeName:false,inBlockComment:false}),token(e,t){return e.eatSpace()?null:Le(e,t)??$e(e,t)??Te(e,t)??ve(e,t)??(e.next(),null)},copyState:e=>({...e})}),Q=e=>{switch(e){case "json":return json();case "xml":return xml();case "yaml":return yaml();case "protobuf":return Ie;default:return json()}};function q(e,t){let o=t.palette,s=linter(()=>e.map(u=>({from:u.from,to:u.to,severity:u.severity,message:u.message}))),l=lintGutter(),a=EditorView.theme({".cm-gutter-lint":{width:"16px",backgroundColor:o.background.w20,overflow:"hidden"},".cm-gutter-lint .cm-gutterElement":{display:"flex",alignItems:"center",justifyContent:"center",padding:"0"},".cm-lint-marker":{content:"none",display:"block",width:"8px",height:"8px",borderRadius:"50%",margin:"auto"},".cm-lint-marker-error":{content:"none",background:o.error.w100},".cm-lint-marker-warning":{content:"none",background:o.warning.w100},".cm-lintRange-error":{backgroundImage:"none",textDecoration:`underline wavy ${o.error.w100}`,textUnderlineOffset:"2px"},".cm-lintRange-warning":{backgroundImage:"none",textDecoration:`underline wavy ${o.warning.w100}`,textUnderlineOffset:"2px"},".cm-tooltip:has(.cm-tooltip-lint)":{border:"none",backgroundColor:"transparent",boxShadow:"none"},".cm-tooltip-lint":{backgroundColor:o.background.w10,border:`1px solid ${o.secondary.w40}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",color:o.secondary.text.wMain,boxShadow:`0 2px 8px ${o.secondary.w20}`}});return [s,l,a]}var We=({size:e,fill:t})=>jsx(Na,{sx:{width:`${e}px`,height:`${e}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:t})}),oe=We;var Fe=({size:e,fill:t})=>jsxs(Na,{sx:{width:`${e}px`,height:`${e}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:t}),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:t})]}),re=Fe;var ne=wa("div",{shouldForwardProp:e=>e!=="severity"})(({theme:e,severity:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(1,1.5),fontSize:e.typography.body1.fontSize,lineHeight:e.typography.body1.lineHeight,backgroundColor:t==="error"?e.palette.ux.error.w10:e.palette.ux.warning.w10,borderBottom:t==="error"?`1px solid ${e.palette.ux.error.w30}`:`1px solid ${e.palette.ux.warning.w30}`,color:t==="error"?e.palette.ux.error.w100:e.palette.ux.warning.w100})),Ae=e=>{let t=e[e.length-1],o=e.slice(0,-1);return o.length===1?`${o[0]} and ${t}`:`${o.join(", ")}, and ${t}`},ie=(e,t,o)=>{let s=e.filter(c=>c.severity===o);if(s.length===0)return "";let l=[];for(let c=0;c<t.length;c++)t[c]===`
2
- `&&l.push(c);let a=c=>{let i=0,m=l.length;for(;i<m;){let w=i+m>>1;l[w]<c?i=w+1:m=w;}return i+1},u=new Set;s.forEach(c=>{u.add(a(c.from));});let n=Array.from(u).sort((c,i)=>c-i),f=o==="error"?"error":"warning",d=s.length>1?"s":"",g=o==="error"?"Invalid syntax.":"Invalid schema.";return n.length===1?`${g} Fix ${f}${d} on line ${n[0]}.`:`${g} Fix ${f}${d} in lines ${Ae(n)}.`},Re=({validationMessages:e,doc:t})=>{let o=ua(),s=e.some(a=>a.severity==="error"),l=e.some(a=>a.severity==="warning");return s?jsxs(ne,{severity:"error",role:"alert","aria-live":"assertive",children:[jsx(Error16Icon,{sx:{flexShrink:0,fontSize:20},fill:o.palette.ux.error.w100}),jsx("span",{children:ie(e,t,"error")})]}):l?jsxs(ne,{severity:"warning",role:"status","aria-live":"polite",children:[jsx(Warning16Icon,{sx:{flexShrink:0,fontSize:20},fill:o.palette.ux.warning.w100}),jsx("span",{children:ie(e,t,"warning")})]}):null},ce=Re;var Ze=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.OuterWrapper})),Ue=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.InnerWrapper})),H="auto !important",x="100% !important",W="none !important",pe=wa("div")(({theme:e,customHeight:t})=>{let o=e.mixins.formComponent_CodeEditor.EditorWrapper[".codeEditor-expanded--main &"];return {...e.mixins.formComponent_CodeEditor.EditorWrapper,...t==="auto"&&{height:H,"& .cm-theme":{height:H},"& .cm-editor":{height:H},"& .cm-editor .cm-scroller":{maxHeight:W},".codeEditor-expanded--main &":{...o,height:x,"& .cm-theme":{height:x},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:W}}},...t&&t!=="auto"&&{height:`${t} !important`,display:"flex",flexDirection:"column","& .cm-theme":{flex:"1 1 0",minHeight:"0"},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:x},".codeEditor-expanded--main &":{...o,height:x,"& .cm-theme":{height:x},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:W}}}}}),Xe=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.IconWrapper})),de=(e$1,t,o)=>t?jsx(e,{children:e$1}):o?jsx(g,{children:e$1}):jsx(c,{children:e$1});function Je({mode:e="json",value:t,readOnly:o=false,expandable:s=false,fullScreen:l=false,helperText:a="",hasErrors:u=false,hasWarnings:n=false,height:f,validationMessages:d=[],onValidationChange:g,onChange:c}){let i=ua(),m=qi(),[w,_]=useState(t||""),[b$1,z]=useState(l||false);useEffect(()=>{t!==void 0&&_(t);},[t]),useEffect(()=>{z(l);},[l]),useEffect(()=>{if(g){let S=d.some(T=>T.severity==="error"),xe=d.some(T=>T.severity==="warning");g(S,xe);}},[d,g]);let M=pi==="solace-dark",D=useMemo(()=>EditorView.theme({"&":{color:m.palette.secondary.text.wMain},"& .cm-content *":{color:`${m.palette.secondary.text.wMain} !important`}}),[m]),ue=useMemo(()=>o?[...$(m,M),D]:$(m,M),[m,M,o,D]),fe=useMemo(()=>o?[EditorView.lineWrapping,keymap.of(defaultKeymap)]:[Q(e),EditorView.lineWrapping,keymap.of(defaultKeymap),...d.length>0?q(d,m):[]],[e,o,d,m]),ge=S=>{_(S),c&&c(null,null,S);},P=f?typeof f=="number"?`${f}px`:f:"300px",A=()=>{z(!b$1);},R=jsxs(Fragment,{children:[jsx(ce,{validationMessages:d,doc:w}),jsx(Oe,{value:w,onChange:ge,extensions:fe,theme:ue,height:P,editable:!o,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})]});return jsxs(Fragment,{children:[s&&jsx(Ze,{className:b$1?"codeEditor-expanded--backdrop":"",children:jsxs(Ue,{className:b$1?"codeEditor-expanded--main":"",children:[jsx(Xe,{className:b$1?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:b$1?jsx(b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:A,title:"Collapse",children:jsx(re,{fill:i.palette.ux.secondary.wMain,size:24})}):jsx(b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:A,title:"Expand",children:jsx(oe,{fill:i.palette.ux.secondary.wMain,size:24})})}),jsx(pe,{customHeight:P,className:`${b$1?"":"codeEditor-border"} ${o?"codeEditor-readonly":""}`,children:R}),a&&de(a,u,n)]})}),!s&&jsxs(Fragment,{children:[jsx(pe,{customHeight:P,className:`${b$1?"":"codeEditor-border"} ${o?"codeEditor-readonly":""}`,children:R}),a&&de(a,u,n)]})]})}var Ke=Je;export{Ke as SolaceCodeEditor};//# sourceMappingURL=code-editor.modern.mjs.map
1
+ import {b}from'./chunk-GHPNUEMK.modern.mjs';import {d,f,c}from'./chunk-6BHLTTV3.modern.mjs';import {wa,ua,qi,pi,ni,Na}from'./chunk-PWYVYHTJ.modern.mjs';import {useState,useEffect,useMemo}from'react';import Oe from'@uiw/react-codemirror';import {EditorView,keymap,Decoration,ViewPlugin}from'@codemirror/view';import {defaultKeymap}from'@codemirror/commands';import {createTheme}from'@uiw/codemirror-themes';import {tags}from'@lezer/highlight';import {StreamLanguage,syntaxTree}from'@codemirror/language';import {RangeSetBuilder}from'@codemirror/state';import {json}from'@codemirror/lang-json';import {xml}from'@codemirror/lang-xml';import {yaml}from'@codemirror/lang-yaml';import {linter,lintGutter}from'@codemirror/lint';import {jsxs,Fragment,jsx}from'react/jsx-runtime';import {Error16Icon,Warning16Icon}from'@SolaceDev/maas-icons';var ye=/^-?(\d+(\.\d+)?([eE][+-]?\d+)?|\.\d+)$/,Se=/^(true|false|yes|no|on|off)$/i;function Ce(e,t){let o=Decoration.mark({class:"cm-yaml-number"}),s=Decoration.mark({class:"cm-yaml-bool"}),l=EditorView.theme({".cm-yaml-number span":{color:`${e} !important`},".cm-yaml-bool span":{color:`${t} !important`},".cm-yaml-number":{color:e},".cm-yaml-bool":{color:t}});function a(n){let f=new RangeSetBuilder,d=syntaxTree(n.state);for(let{from:g,to:c}of n.visibleRanges)d.iterate({from:g,to:c,enter(i){if(i.name!=="Literal"||i.node.parent?.name==="Key")return;let m=n.state.doc.sliceString(i.from,i.to);ye.test(m)?f.add(i.from,i.to,o):Se.test(m)&&f.add(i.from,i.to,s);}});return f.finish()}return [ViewPlugin.fromClass(class{constructor(n){this.decorations=a(n);}update(n){(n.docChanged||n.viewportChanged||syntaxTree(n.startState)!==syntaxTree(n.state))&&(this.decorations=a(n.view));}},{decorations:n=>n.decorations}),l]}function $(e,t=false){let o=e.palette,s=createTheme({theme:t?"dark":"light",settings:{background:o.background.w10,foreground:o.secondary.text.wMain,caret:o.secondary.wMain,selection:`${o.brand.wMain}30`,selectionMatch:`${o.brand.wMain}20`,lineHighlight:o.background.w20,gutterBackground:o.background.w20,gutterForeground:o.secondary.text.wMain,gutterBorder:o.secondary.w40,fontFamily:"Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:`${ni.sm}px`},styles:[{tag:[tags.string,tags.special(tags.string),tags.character,tags.regexp,tags.attributeValue],color:o.accent.n9.w100},{tag:[tags.number,tags.integer,tags.float],color:o.accent.n2.w100},{tag:[tags.bool,tags.null,tags.atom],color:o.info.w100},{tag:[tags.propertyName,tags.variableName],color:o.accent.n1.w100},{tag:tags.attributeName,color:o.accent.n1.w100},{tag:tags.tagName,color:o.accent.n0.w100},{tag:[tags.keyword,tags.definitionKeyword,tags.modifier,tags.controlKeyword],color:o.info.w100},{tag:[tags.function(tags.variableName),tags.function(tags.propertyName)],color:o.accent.n5.w100},{tag:[tags.typeName,tags.className],color:o.accent.n0.w100},{tag:tags.standard(tags.variableName),color:o.accent.n5.w100},{tag:tags.namespace,color:o.accent.n2.w100},{tag:tags.content,color:o.accent.n9.w100},{tag:tags.processingInstruction,color:o.accent.n5.w100},{tag:[tags.comment,tags.lineComment,tags.blockComment],color:o.secondary.text.wMain,fontStyle:"italic"},{tag:[tags.operator,tags.punctuation,tags.angleBracket,tags.bracket,tags.brace,tags.paren,tags.separator],color:o.secondary.w100}]}),l=EditorView.theme({".cm-keyword":{color:o.info.w100},".cm-type":{color:o.accent.n0.w100},".cm-string":{color:o.accent.n9.w100},".cm-number":{color:o.accent.n2.w100},".cm-atom":{color:o.info.w100},".cm-comment":{color:o.secondary.text.wMain,fontStyle:"italic"},".cm-punctuation":{color:o.secondary.w100},".cm-builtin":{color:o.accent.n5.w100},".cm-variable":{color:o.accent.n1.w100}},{dark:t}),a=Ce(o.accent.n2.w100,o.info.w100);return [s,l,a]}var Me=/\b(syntax|rpc|option|import|repeated|optional|required)\b/,Pe=/\b(int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double)\b/;function y(e){e.expectFieldName=false,e.expectPackageName=false,e.expectTypeName=false;}function Te(e,t){return e.match(/\b(message|enum|service)\b/)||e.match(/\breturns\b/)?(y(t),t.expectTypeName=true,"keyword"):e.match(Me)?(y(t),"keyword"):e.match(/\bpackage\b/)?(y(t),t.expectPackageName=true,"keyword"):null}function ve(e,t){if(e.match(/\b[A-Z][A-Za-z0-9_]*\b/)){let o=t.expectTypeName;return y(t),o?"type":"builtin"}return t.expectPackageName&&e.match(/\b[a-z][a-zA-Z0-9_.]*\b/)?(t.expectPackageName=false,"string"):e.match(/\b[a-z_][a-zA-Z0-9_]*\b/)&&t.expectFieldName?(t.expectFieldName=false,"variable"):null}function Le(e,t){if(t.inBlockComment){for(;!e.eol();){if(e.match("*/")){t.inBlockComment=false;break}e.next();}return "comment"}if(e.match("//"))return e.skipToEnd(),t.expectFieldName=false,"comment";if(e.match("/*")){for(;!e.eol();){if(e.match("*/"))return "comment";e.next();}return t.inBlockComment=true,t.expectFieldName=false,"comment"}return null}function $e(e,t){return e.match(/"(?:[^"\\]|\\.)*"/)?(t.expectFieldName=false,"string"):e.match(Pe)?(t.expectFieldName=true,t.expectTypeName=false,"type"):e.match(/\b(true|false)\b/)?(t.expectFieldName=false,"atom"):e.match(/^\d+(?!\w)/)?(t.expectFieldName=false,"number"):e.match(/[{}();,=[\]]/)?(e.current()===";"&&(t.expectFieldName=false),"punctuation"):null}var Ie=StreamLanguage.define({name:"protobuf",startState:()=>({expectFieldName:false,expectPackageName:false,expectTypeName:false,inBlockComment:false}),token(e,t){return e.eatSpace()?null:Le(e,t)??$e(e,t)??Te(e,t)??ve(e,t)??(e.next(),null)},copyState:e=>({...e})}),Q=e=>{switch(e){case "json":return json();case "xml":return xml();case "yaml":return yaml();case "protobuf":return Ie;default:return json()}};function q(e,t){let o=t.palette,s=linter(()=>e.map(u=>({from:u.from,to:u.to,severity:u.severity,message:u.message}))),l=lintGutter(),a=EditorView.theme({".cm-gutter-lint":{width:"16px",backgroundColor:o.background.w20,overflow:"hidden"},".cm-gutter-lint .cm-gutterElement":{display:"flex",alignItems:"center",justifyContent:"center",padding:"0"},".cm-lint-marker":{content:"none",display:"block",width:"8px",height:"8px",borderRadius:"50%",margin:"auto"},".cm-lint-marker-error":{content:"none",background:o.error.w100},".cm-lint-marker-warning":{content:"none",background:o.warning.w100},".cm-lintRange-error":{backgroundImage:"none",textDecoration:`underline wavy ${o.error.w100}`,textUnderlineOffset:"2px"},".cm-lintRange-warning":{backgroundImage:"none",textDecoration:`underline wavy ${o.warning.w100}`,textUnderlineOffset:"2px"},".cm-tooltip:has(.cm-tooltip-lint)":{border:"none",backgroundColor:"transparent",boxShadow:"none"},".cm-tooltip-lint":{backgroundColor:o.background.w10,border:`1px solid ${o.secondary.w40}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",color:o.secondary.text.wMain,boxShadow:`0 2px 8px ${o.secondary.w20}`}});return [s,l,a]}var We=({size:e,fill:t})=>jsx(Na,{sx:{width:`${e}px`,height:`${e}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:t})}),oe=We;var Fe=({size:e,fill:t})=>jsxs(Na,{sx:{width:`${e}px`,height:`${e}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:t}),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:t})]}),re=Fe;var ne=wa("div",{shouldForwardProp:e=>e!=="severity"})(({theme:e,severity:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(1,1.5),fontSize:e.typography.body1.fontSize,lineHeight:e.typography.body1.lineHeight,backgroundColor:t==="error"?e.palette.ux.error.w10:e.palette.ux.warning.w10,borderBottom:t==="error"?`1px solid ${e.palette.ux.error.w30}`:`1px solid ${e.palette.ux.warning.w30}`,color:t==="error"?e.palette.ux.error.w100:e.palette.ux.warning.w100})),Ae=e=>{let t=e[e.length-1],o=e.slice(0,-1);return o.length===1?`${o[0]} and ${t}`:`${o.join(", ")}, and ${t}`},ie=(e,t,o)=>{let s=e.filter(c=>c.severity===o);if(s.length===0)return "";let l=[];for(let c=0;c<t.length;c++)t[c]===`
2
+ `&&l.push(c);let a=c=>{let i=0,m=l.length;for(;i<m;){let w=i+m>>1;l[w]<c?i=w+1:m=w;}return i+1},u=new Set;s.forEach(c=>{u.add(a(c.from));});let n=Array.from(u).sort((c,i)=>c-i),f=o==="error"?"error":"warning",d=s.length>1?"s":"",g=o==="error"?"Invalid syntax.":"Invalid schema.";return n.length===1?`${g} Fix ${f}${d} on line ${n[0]}.`:`${g} Fix ${f}${d} in lines ${Ae(n)}.`},Re=({validationMessages:e,doc:t})=>{let o=ua(),s=e.some(a=>a.severity==="error"),l=e.some(a=>a.severity==="warning");return s?jsxs(ne,{severity:"error",role:"alert","aria-live":"assertive",children:[jsx(Error16Icon,{sx:{flexShrink:0,fontSize:20},fill:o.palette.ux.error.w100}),jsx("span",{children:ie(e,t,"error")})]}):l?jsxs(ne,{severity:"warning",role:"status","aria-live":"polite",children:[jsx(Warning16Icon,{sx:{flexShrink:0,fontSize:20},fill:o.palette.ux.warning.w100}),jsx("span",{children:ie(e,t,"warning")})]}):null},ce=Re;var Ze=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.OuterWrapper})),Ue=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.InnerWrapper})),H="auto !important",x="100% !important",W="none !important",pe=wa("div")(({theme:e,customHeight:t})=>{let o=e.mixins.formComponent_CodeEditor.EditorWrapper[".codeEditor-expanded--main &"];return {...e.mixins.formComponent_CodeEditor.EditorWrapper,...t==="auto"&&{height:H,"& .cm-theme":{height:H},"& .cm-editor":{height:H},"& .cm-editor .cm-scroller":{maxHeight:W},".codeEditor-expanded--main &":{...o,height:x,"& .cm-theme":{height:x},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:W}}},...t&&t!=="auto"&&{height:`${t} !important`,display:"flex",flexDirection:"column","& .cm-theme":{flex:"1 1 0",minHeight:"0"},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:x},".codeEditor-expanded--main &":{...o,height:x,"& .cm-theme":{height:x},"& .cm-editor":{height:x},"& .cm-editor .cm-scroller":{maxHeight:W}}}}}),Xe=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.IconWrapper})),de=(e,t,o)=>t?jsx(d,{children:e}):o?jsx(f,{children:e}):jsx(c,{children:e});function Je({mode:e="json",value:t,readOnly:o=false,expandable:s=false,fullScreen:l=false,helperText:a="",hasErrors:u=false,hasWarnings:n=false,height:f,validationMessages:d=[],onValidationChange:g,onChange:c}){let i=ua(),m=qi(),[w,_]=useState(t||""),[b$1,z]=useState(l||false);useEffect(()=>{t!==void 0&&_(t);},[t]),useEffect(()=>{z(l);},[l]),useEffect(()=>{if(g){let S=d.some(T=>T.severity==="error"),xe=d.some(T=>T.severity==="warning");g(S,xe);}},[d,g]);let M=pi==="solace-dark",D=useMemo(()=>EditorView.theme({"&":{color:m.palette.secondary.text.wMain},"& .cm-content *":{color:`${m.palette.secondary.text.wMain} !important`}}),[m]),ue=useMemo(()=>o?[...$(m,M),D]:$(m,M),[m,M,o,D]),fe=useMemo(()=>o?[EditorView.lineWrapping,keymap.of(defaultKeymap)]:[Q(e),EditorView.lineWrapping,keymap.of(defaultKeymap),...d.length>0?q(d,m):[]],[e,o,d,m]),ge=S=>{_(S),c&&c(null,null,S);},P=f?typeof f=="number"?`${f}px`:f:"300px",A=()=>{z(!b$1);},R=jsxs(Fragment,{children:[jsx(ce,{validationMessages:d,doc:w}),jsx(Oe,{value:w,onChange:ge,extensions:fe,theme:ue,height:P,editable:!o,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})]});return jsxs(Fragment,{children:[s&&jsx(Ze,{className:b$1?"codeEditor-expanded--backdrop":"",children:jsxs(Ue,{className:b$1?"codeEditor-expanded--main":"",children:[jsx(Xe,{className:b$1?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:b$1?jsx(b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:A,title:"Collapse",children:jsx(re,{fill:i.palette.ux.secondary.wMain,size:24})}):jsx(b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:A,title:"Expand",children:jsx(oe,{fill:i.palette.ux.secondary.wMain,size:24})})}),jsx(pe,{customHeight:P,className:`${b$1?"":"codeEditor-border"} ${o?"codeEditor-readonly":""}`,children:R}),a&&de(a,u,n)]})}),!s&&jsxs(Fragment,{children:[jsx(pe,{customHeight:P,className:`${b$1?"":"codeEditor-border"} ${o?"codeEditor-readonly":""}`,children:R}),a&&de(a,u,n)]})]})}var Ke=Je;export{Ke as SolaceCodeEditor};//# sourceMappingURL=code-editor.modern.mjs.map
3
3
  //# sourceMappingURL=code-editor.modern.mjs.map