solace-ui-components 18.0.11 → 18.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/code-editor.d.mts
CHANGED
|
@@ -2,6 +2,17 @@ import './theme-CrhIVJVV.mjs';
|
|
|
2
2
|
import { S as SolaceComponentProps } from './SolaceComponentProps-B8ee8pk3.mjs';
|
|
3
3
|
import '@mui/material';
|
|
4
4
|
|
|
5
|
+
interface ValidationMessage {
|
|
6
|
+
/** Character offset of the start of the problematic range in the document */
|
|
7
|
+
from: number;
|
|
8
|
+
/** Character offset of the end of the problematic range in the document */
|
|
9
|
+
to: number;
|
|
10
|
+
/** Human-readable description of the issue */
|
|
11
|
+
message: string;
|
|
12
|
+
/** Severity level — renders red dot/squiggly for error, yellow dot for warning */
|
|
13
|
+
severity: "error" | "warning";
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
interface SolaceCodeEditorProps extends SolaceComponentProps {
|
|
6
17
|
/**
|
|
7
18
|
* Unique identifier for the button
|
|
@@ -44,11 +55,25 @@ interface SolaceCodeEditorProps extends SolaceComponentProps {
|
|
|
44
55
|
* @default '300px'
|
|
45
56
|
*/
|
|
46
57
|
height?: string | number;
|
|
58
|
+
/**
|
|
59
|
+
* Inline validation messages shown as squiggly underlines on the affected range
|
|
60
|
+
* and as colored dots in the gutter (red = error, yellow/orange = warning).
|
|
61
|
+
* Hovering a gutter dot shows the message as a tooltip.
|
|
62
|
+
* A banner is shown above the editor when error or warning messages are present.
|
|
63
|
+
* Each message requires character offsets (from/to) within the document string.
|
|
64
|
+
*/
|
|
65
|
+
validationMessages?: ValidationMessage[];
|
|
66
|
+
/**
|
|
67
|
+
* Callback fired whenever the set of validationMessages changes.
|
|
68
|
+
* Notifies parent components of the current validation state so they can
|
|
69
|
+
* update tab indicators, form submit buttons, or other external UI.
|
|
70
|
+
*/
|
|
71
|
+
onValidationChange?: (hasErrors: boolean, hasWarnings: boolean) => void;
|
|
47
72
|
/**
|
|
48
73
|
* Callback function to trigger whenever the value of the `input` is changed
|
|
49
74
|
*/
|
|
50
75
|
onChange?: (editor: any, data: any, value: string) => void;
|
|
51
76
|
}
|
|
52
|
-
declare function SolaceCodeEditor({ mode, value, readOnly, expandable, fullScreen, helperText, hasErrors, hasWarnings, height, onChange }: SolaceCodeEditorProps): JSX.Element;
|
|
77
|
+
declare function SolaceCodeEditor({ mode, value, readOnly, expandable, fullScreen, helperText, hasErrors, hasWarnings, height, validationMessages, onValidationChange, onChange }: SolaceCodeEditorProps): JSX.Element;
|
|
53
78
|
|
|
54
|
-
export { SolaceCodeEditor };
|
|
79
|
+
export { SolaceCodeEditor, type ValidationMessage };
|
package/dist/code-editor.d.ts
CHANGED
|
@@ -2,6 +2,17 @@ import './theme-CrhIVJVV.js';
|
|
|
2
2
|
import { S as SolaceComponentProps } from './SolaceComponentProps-B8ee8pk3.js';
|
|
3
3
|
import '@mui/material';
|
|
4
4
|
|
|
5
|
+
interface ValidationMessage {
|
|
6
|
+
/** Character offset of the start of the problematic range in the document */
|
|
7
|
+
from: number;
|
|
8
|
+
/** Character offset of the end of the problematic range in the document */
|
|
9
|
+
to: number;
|
|
10
|
+
/** Human-readable description of the issue */
|
|
11
|
+
message: string;
|
|
12
|
+
/** Severity level — renders red dot/squiggly for error, yellow dot for warning */
|
|
13
|
+
severity: "error" | "warning";
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
interface SolaceCodeEditorProps extends SolaceComponentProps {
|
|
6
17
|
/**
|
|
7
18
|
* Unique identifier for the button
|
|
@@ -44,11 +55,25 @@ interface SolaceCodeEditorProps extends SolaceComponentProps {
|
|
|
44
55
|
* @default '300px'
|
|
45
56
|
*/
|
|
46
57
|
height?: string | number;
|
|
58
|
+
/**
|
|
59
|
+
* Inline validation messages shown as squiggly underlines on the affected range
|
|
60
|
+
* and as colored dots in the gutter (red = error, yellow/orange = warning).
|
|
61
|
+
* Hovering a gutter dot shows the message as a tooltip.
|
|
62
|
+
* A banner is shown above the editor when error or warning messages are present.
|
|
63
|
+
* Each message requires character offsets (from/to) within the document string.
|
|
64
|
+
*/
|
|
65
|
+
validationMessages?: ValidationMessage[];
|
|
66
|
+
/**
|
|
67
|
+
* Callback fired whenever the set of validationMessages changes.
|
|
68
|
+
* Notifies parent components of the current validation state so they can
|
|
69
|
+
* update tab indicators, form submit buttons, or other external UI.
|
|
70
|
+
*/
|
|
71
|
+
onValidationChange?: (hasErrors: boolean, hasWarnings: boolean) => void;
|
|
47
72
|
/**
|
|
48
73
|
* Callback function to trigger whenever the value of the `input` is changed
|
|
49
74
|
*/
|
|
50
75
|
onChange?: (editor: any, data: any, value: string) => void;
|
|
51
76
|
}
|
|
52
|
-
declare function SolaceCodeEditor({ mode, value, readOnly, expandable, fullScreen, helperText, hasErrors, hasWarnings, height, onChange }: SolaceCodeEditorProps): JSX.Element;
|
|
77
|
+
declare function SolaceCodeEditor({ mode, value, readOnly, expandable, fullScreen, helperText, hasErrors, hasWarnings, height, validationMessages, onValidationChange, onChange }: SolaceCodeEditorProps): JSX.Element;
|
|
53
78
|
|
|
54
|
-
export { SolaceCodeEditor };
|
|
79
|
+
export { SolaceCodeEditor, type ValidationMessage };
|
package/dist/code-editor.js
CHANGED
|
@@ -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'),
|
|
2
|
-
exports.SolaceCodeEditor=
|
|
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'),De=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 De__default=/*#__PURE__*/_interopDefault(De);var be=/^-?(\d+(\.\d+)?([eE][+-]?\d+)?|\.\d+)$/,we=/^(true|false|yes|no|on|off)$/i;function ye(e,o){let t=view.Decoration.mark({class:"cm-yaml-number"}),m=view.Decoration.mark({class:"cm-yaml-bool"}),i=view.EditorView.theme({".cm-yaml-number span":{color:`${e} !important`},".cm-yaml-bool span":{color:`${o} !important`},".cm-yaml-number":{color:e},".cm-yaml-bool":{color:o}});function s(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(a){if(a.name!=="Literal"||a.node.parent?.name==="Key")return;let l=n.state.doc.sliceString(a.from,a.to);be.test(l)?f.add(a.from,a.to,t):we.test(l)&&f.add(a.from,a.to,m);}});return f.finish()}return [view.ViewPlugin.fromClass(class{constructor(n){this.decorations=s(n);}update(n){(n.docChanged||n.viewportChanged||language.syntaxTree(n.startState)!==language.syntaxTree(n.state))&&(this.decorations=s(n.view));}},{decorations:n=>n.decorations}),i]}function $(e,o=false){let t=e.palette,m=codemirrorThemes.createTheme({theme:o?"dark":"light",settings:{background:t.background.w10,foreground:t.secondary.text.wMain,caret:t.secondary.wMain,selection:`${t.brand.wMain}30`,selectionMatch:`${t.brand.wMain}20`,lineHighlight:t.background.w20,gutterBackground:t.background.w20,gutterForeground:t.secondary.text.wMain,gutterBorder:t.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:t.accent.n9.w100},{tag:[highlight.tags.number,highlight.tags.integer,highlight.tags.float],color:t.accent.n2.w100},{tag:[highlight.tags.bool,highlight.tags.null,highlight.tags.atom],color:t.info.w100},{tag:[highlight.tags.propertyName,highlight.tags.variableName],color:t.accent.n1.w100},{tag:highlight.tags.attributeName,color:t.accent.n1.w100},{tag:highlight.tags.tagName,color:t.accent.n0.w100},{tag:[highlight.tags.keyword,highlight.tags.definitionKeyword,highlight.tags.modifier,highlight.tags.controlKeyword],color:t.info.w100},{tag:[highlight.tags.function(highlight.tags.variableName),highlight.tags.function(highlight.tags.propertyName)],color:t.accent.n5.w100},{tag:[highlight.tags.typeName,highlight.tags.className],color:t.accent.n0.w100},{tag:highlight.tags.standard(highlight.tags.variableName),color:t.accent.n5.w100},{tag:highlight.tags.namespace,color:t.accent.n2.w100},{tag:highlight.tags.content,color:t.accent.n9.w100},{tag:highlight.tags.processingInstruction,color:t.accent.n5.w100},{tag:[highlight.tags.comment,highlight.tags.lineComment,highlight.tags.blockComment],color:t.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:t.secondary.w100}]}),i=view.EditorView.theme({".cm-keyword":{color:t.info.w100},".cm-type":{color:t.accent.n0.w100},".cm-string":{color:t.accent.n9.w100},".cm-number":{color:t.accent.n2.w100},".cm-atom":{color:t.info.w100},".cm-comment":{color:t.secondary.text.wMain,fontStyle:"italic"},".cm-punctuation":{color:t.secondary.w100},".cm-builtin":{color:t.accent.n5.w100},".cm-variable":{color:t.accent.n1.w100}},{dark:o}),s=ye(t.accent.n2.w100,t.info.w100);return [m,i,s]}var Ee=/\b(syntax|rpc|option|import|repeated|optional|required)\b/,ke=/\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 Ne(e,o){return e.match(/\b(message|enum|service)\b/)||e.match(/\breturns\b/)?(y(o),o.expectTypeName=true,"keyword"):e.match(Ee)?(y(o),"keyword"):e.match(/\bpackage\b/)?(y(o),o.expectPackageName=true,"keyword"):null}function Me(e,o){if(e.match(/\b[A-Z][A-Za-z0-9_]*\b/)){let t=o.expectTypeName;return y(o),t?"type":"builtin"}return o.expectPackageName&&e.match(/\b[a-z][a-zA-Z0-9_.]*\b/)?(o.expectPackageName=false,"string"):e.match(/\b[a-z_][a-zA-Z0-9_]*\b/)&&o.expectFieldName?(o.expectFieldName=false,"variable"):null}function ve(e,o){if(o.inBlockComment){for(;!e.eol();){if(e.match("*/")){o.inBlockComment=false;break}e.next();}return "comment"}if(e.match("//"))return e.skipToEnd(),o.expectFieldName=false,"comment";if(e.match("/*")){for(;!e.eol();){if(e.match("*/"))return "comment";e.next();}return o.inBlockComment=true,o.expectFieldName=false,"comment"}return null}function Pe(e,o){return e.match(/"(?:[^"\\]|\\.)*"/)?(o.expectFieldName=false,"string"):e.match(ke)?(o.expectFieldName=true,o.expectTypeName=false,"type"):e.match(/\b(true|false)\b/)?(o.expectFieldName=false,"atom"):e.match(/^\d+(?!\w)/)?(o.expectFieldName=false,"number"):e.match(/[{}();,=[\]]/)?(e.current()===";"&&(o.expectFieldName=false),"punctuation"):null}var $e=language.StreamLanguage.define({name:"protobuf",startState:()=>({expectFieldName:false,expectPackageName:false,expectTypeName:false,inBlockComment:false}),token(e,o){return e.eatSpace()?null:ve(e,o)??Pe(e,o)??Ne(e,o)??Me(e,o)??(e.next(),null)},copyState:e=>({...e})}),Y=e=>{switch(e){case "json":return langJson.json();case "xml":return langXml.xml();case "yaml":return langYaml.yaml();case "protobuf":return $e;default:return langJson.json()}};function j(e,o){let t=o.palette,m=lint.linter(()=>e.map(u=>({from:u.from,to:u.to,severity:u.severity,message:u.message}))),i=lint.lintGutter(),s=view.EditorView.theme({".cm-gutter-lint":{width:"16px",backgroundColor:t.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:t.error.w100},".cm-lint-marker-warning":{content:"none",background:t.warning.w100},".cm-lintRange-error":{backgroundImage:"none",textDecoration:`underline wavy ${t.error.w100}`,textUnderlineOffset:"2px"},".cm-lintRange-warning":{backgroundImage:"none",textDecoration:`underline wavy ${t.warning.w100}`,textUnderlineOffset:"2px"},".cm-tooltip:has(.cm-tooltip-lint)":{border:"none",backgroundColor:"transparent",boxShadow:"none"},".cm-tooltip-lint":{backgroundColor:t.background.w10,border:`1px solid ${t.secondary.w40}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",color:t.secondary.text.wMain,boxShadow:`0 2px 8px ${t.secondary.w20}`}});return [m,i,s]}var Ie=({size:e,fill:o})=>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:o})}),Q=Ie;var Be=({size:e,fill:o})=>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:o}),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:o})]}),ee=Be;var oe=chunkKALFXZNR_js.wa("div",{shouldForwardProp:e=>e!=="severity"})(({theme:e,severity:o})=>({display:"flex",alignItems:"flex-start",gap:e.spacing(1),padding:e.spacing(1,1.5),fontSize:e.typography.body1.fontSize,lineHeight:e.typography.body1.lineHeight,backgroundColor:o==="error"?e.palette.ux.error.w10:e.palette.ux.warning.w10,borderBottom:o==="error"?`1px solid ${e.palette.ux.error.w30}`:`1px solid ${e.palette.ux.warning.w30}`,color:o==="error"?e.palette.ux.error.w100:e.palette.ux.warning.w100})),_e=e=>{let o=e[e.length-1],t=e.slice(0,-1);return t.length===1?`${t[0]} and ${o}`:`${t.join(", ")}, and ${o}`},te=(e,o,t)=>{let m=e.filter(c=>c.severity===t);if(m.length===0)return "";let i=[];for(let c=0;c<o.length;c++)o[c]===`
|
|
2
|
+
`&&i.push(c);let s=c=>{let a=0,l=i.length;for(;a<l;){let w=a+l>>1;i[w]<c?a=w+1:l=w;}return a+1},u=new Set;m.forEach(c=>{u.add(s(c.from));});let n=Array.from(u).sort((c,a)=>c-a),f=t==="error"?"error":"warning",d=m.length>1?"s":"",g=t==="error"?"Invalid syntax.":"Invalid schema.";return n.length===1?`${g} Fix ${f}${d} on line ${n[0]}.`:`${g} Fix ${f}${d} in lines ${_e(n)}.`},ze=({validationMessages:e,doc:o})=>{let t=e.some(i=>i.severity==="error"),m=e.some(i=>i.severity==="warning");return t?jsxRuntime.jsxs(oe,{severity:"error",role:"alert","aria-live":"assertive",children:[jsxRuntime.jsx(maasIcons.Error16Icon,{sx:{flexShrink:0}}),jsxRuntime.jsx("span",{children:te(e,o,"error")})]}):m?jsxRuntime.jsxs(oe,{severity:"warning",role:"status","aria-live":"polite",children:[jsxRuntime.jsx(maasIcons.Warning16Icon,{sx:{flexShrink:0}}),jsxRuntime.jsx("span",{children:te(e,o,"warning")})]}):null},ne=ze;var Ze=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.OuterWrapper})),Ae=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.InnerWrapper})),le=chunkKALFXZNR_js.wa("div")(({theme:e,customHeight:o})=>({...e.mixins.formComponent_CodeEditor.EditorWrapper,...o&&{height:o==="auto"?"auto":`${o} !important`,display:"flex",flexDirection:"column","& .cm-theme":{flex:o==="auto"?"unset":"1 1 0",minHeight:o==="auto"?"unset":"0",...o==="auto"&&{height:"auto"}},"& .cm-editor":{height:o==="auto"?"auto !important":"100% !important"},"& .cm-editor .cm-scroller":{...o==="auto"?{maxHeight:"none !important"}:{}}}})),Re=chunkKALFXZNR_js.wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.IconWrapper})),me=(e,o,t)=>o?jsxRuntime.jsx(chunkHHKIWPP5_js.e,{children:e}):t?jsxRuntime.jsx(chunkHHKIWPP5_js.g,{children:e}):jsxRuntime.jsx(chunkHHKIWPP5_js.c,{children:e});function Xe({mode:e="json",value:o,readOnly:t=false,expandable:m=false,fullScreen:i=false,helperText:s="",hasErrors:u=false,hasWarnings:n=false,height:f,validationMessages:d=[],onValidationChange:g,onChange:c}){let a=chunkKALFXZNR_js.ua(),l=chunkKALFXZNR_js.qi(),[w,B]=react.useState(o||""),[x,W]=react.useState(i||false);react.useEffect(()=>{o!==void 0&&B(o);},[o]),react.useEffect(()=>{W(i);},[i]),react.useEffect(()=>{if(g){let h=d.some(M=>M.severity==="error"),ue=d.some(M=>M.severity==="warning");g(h,ue);}},[d,g]);let k=chunkKALFXZNR_js.pi==="solace-dark",F=react.useMemo(()=>view.EditorView.theme({"&":{color:l.palette.secondary.text.wMain},"& .cm-content *":{color:`${l.palette.secondary.text.wMain} !important`}}),[l]),se=react.useMemo(()=>t?[...$(l,k),F]:$(l,k),[l,k,t,F]),pe=react.useMemo(()=>t?[view.EditorView.lineWrapping,view.keymap.of(commands.defaultKeymap)]:[Y(e),view.EditorView.lineWrapping,view.keymap.of(commands.defaultKeymap),...d.length>0?j(d,l):[]],[e,t,d,l]),de=h=>{B(h),c&&c(null,null,h);},N=f?typeof f=="number"?`${f}px`:f:"300px",H=()=>{W(!x);},_=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ne,{validationMessages:d,doc:w}),jsxRuntime.jsx(De__default.default,{value:w,onChange:de,extensions:pe,theme:se,height:N,editable:!t,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[m&&jsxRuntime.jsx(Ze,{className:x?"codeEditor-expanded--backdrop":"",children:jsxRuntime.jsxs(Ae,{className:x?"codeEditor-expanded--main":"",children:[jsxRuntime.jsx(Re,{className:x?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:x?jsxRuntime.jsx(chunk266AAHHO_js.b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:H,title:"Collapse",children:jsxRuntime.jsx(ee,{fill:a.palette.ux.secondary.wMain,size:24})}):jsxRuntime.jsx(chunk266AAHHO_js.b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:H,title:"Expand",children:jsxRuntime.jsx(Q,{fill:a.palette.ux.secondary.wMain,size:24})})}),jsxRuntime.jsx(le,{customHeight:N,className:`${x?"":"codeEditor-border"} ${t?"codeEditor-readonly":""}`,children:_}),s&&me(s,u,n)]})}),!m&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(le,{customHeight:N,className:`${x?"":"codeEditor-border"} ${t?"codeEditor-readonly":""}`,children:_}),s&&me(s,u,n)]})]})}var Je=Xe;exports.SolaceCodeEditor=Je;//# sourceMappingURL=code-editor.js.map
|
|
3
3
|
//# sourceMappingURL=code-editor.js.map
|
package/dist/code-editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","yaml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","customHeight","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","height","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","cmHeight","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"woBAuBO,SAASA,CAAAA,CAAuBC,CAAAA,CAAyC,CAE/E,IAAMC,CAAAA,CAAkB,kBAAA,CAGlBC,CAAAA,CAAiBC,uBAAAA,CAAe,MAAA,CAAO,CAE5C,CAAE,GAAA,CAAKC,eAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACxD,CAAE,IAAKI,cAAA,CAAE,OAAA,CAAQA,cAAA,CAAE,MAAM,EAAG,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACnE,CAAE,GAAA,CAAKI,cAAA,CAAE,SAAA,CAAW,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,MAAM,IAAK,CAAA,CAC3D,CAAE,GAAA,CAAKI,cAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,QAAQ,KAAA,CAAM,IAAK,CAAA,CAGxD,CAAE,GAAA,CAAKI,cAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,EAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAC1D,CAAE,GAAA,CAAKI,cAAA,CAAE,OAAA,CAAS,KAAA,CAAOJ,EAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAC3D,CAAE,GAAA,CAAKI,cAAA,CAAE,KAAA,CAAO,MAAOJ,CAAAA,CAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAGzD,CAAE,GAAA,CAAKI,cAAA,CAAE,KAAM,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,IAAK,CAAA,CACrD,CAAE,GAAA,CA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f,cAAA,CAAgB,KAChB,oBAAA,CAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,aAAc,IACf,CAAA,CACD,CAAA,CACD,CAAA,CACCR,GAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CACD,CAAA,CAEA,CAACO,GACDnB,eAAAA,CAAAwC,mBAAAA,CAAA,CACC,QAAA,CAAA,CAAA5C,cAAAA,CAACU,CAAAA,CAAA,CACA,YAAA,CAAcgC,EACd,SAAA,CAAW,CAAA,EAAIV,CAAAA,CAAuC,EAAA,CAAtB,mBAAwB,CAAA,CAAA,EAAIV,CAAAA,CAAW,qBAAA,CAAwB,EAAE,CAAA,CAAA,CAEjG,QAAA,CAAAtB,cAAAA,CAAC8C,kBAAAA,CAAA,CACA,KAAA,CAAOjB,CAAAA,CACP,QAAA,CAAUW,CAAAA,CACV,WAAYH,CAAAA,CACZ,KAAA,CAAOF,CAAAA,CACP,QAAA,CAAU,CAACb,CAAAA,CACX,UAAA,CAAY,CACX,YAAa,IAAA,CACb,UAAA,CAAY,IAAA,CACZ,eAAA,CAAiB,IAAA,CACjB,aAAA,CAAe,IAAA,CACf,cAAA,CAAgB,KAChB,oBAAA,CAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,YAAA,CAAc,IACf,CAAA,CACD,CAAA,CACD,EACCR,CAAAA,EAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO+B,EAAAA,CAAQ3B","file":"code-editor.js","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping): Extension[] {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { yaml } from \"@codemirror/lang-yaml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\" | \"yaml\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"yaml\":\n\t\t\treturn yaml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")<{ customHeight?: string }>(({ theme, customHeight }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties),\n\t...(customHeight && {\n\t\theight: `${customHeight} !important`,\n\t\t\"& .cm-theme\": {\n\t\t\theight: `${customHeight} !important`\n\t\t},\n\t\t\"& .cm-editor\": {\n\t\t\theight: `${customHeight} !important`\n\t\t},\n\t\t\"& .cm-editor .cm-scroller\": {\n\t\t\tmaxHeight: `${customHeight} !important`\n\t\t}\n\t})\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\" | \"yaml\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Height of the code editor. Can be a number (in pixels) or a string (e.g., '300px', '100%')\n\t * @default '300px'\n\t */\n\theight?: string | number;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\theight,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\t// Convert height prop to string format for CodeMirror\n\tconst cmHeight = height ? (typeof height === \"number\" ? `${height}px` : height) : \"300px\";\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\theight={cmHeight}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/utils/codeMirrorLinting.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/CodeEditorValidationBanner.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["YAML_NUMBER","YAML_BOOL","buildYamlScalarPlugin","numberColor","boolColor","numberMark","Decoration","boolMark","overrideTheme","EditorView","buildDecorations","view","builder","RangeSetBuilder","tree","syntaxTree","from","to","node","text","ViewPlugin","update","v","createCodeMirror6Theme","themeMapping","isDark","p","cm6Theme","createTheme","BASE_FONT_PX_SIZES","t","streamLanguageTheme","yamlScalarPlugin","KEYWORDS","BUILTIN_TYPES","resetState","state","tokenizeKeyword","stream","tokenizeIdentifier","isType","tokenizeComment","tokenizePrimitive","protobufLanguage","StreamLanguage","getLanguageExtension","mode","json","xml","yaml","createLintExtension","diagnostics","linterExt","linter","d","gutterExt","lintGutter","lintTheme","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledValidationBanner","styled_default","prop","theme","severity","joinLineNumbers","sorted","last","rest","buildBannerMessage","messages","doc","filtered","m","newlines","i","offsetToLine","offset","lo","hi","mid","lines","sortedLines","a","b","label","plural","prefix","CodeEditorValidationBanner","validationMessages","hasErrors","hasWarnings","Error16Icon","Warning16Icon","CodeEditorValidationBanner_default","StyledOuterWrapper","StyledInnerWrapper","StyledEditorWrapper","customHeight","IconWrapper","renderHelperText","helperText","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","height","onValidationChange","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","hasErr","hasWarn","appTheme","readOnlyOverride","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","cmHeight","toggleExpandedMode","editorContent","Fragment","CodeMirror","SolaceButton_default","SolaceCodeEditor_default"],"mappings":"6yBAyBA,IAAMA,GAAc,wCAAA,CACdC,EAAAA,CAAY,gCAQlB,SAASC,EAAAA,CAAsBC,CAAAA,CAAqBC,CAAAA,CAA8B,CACjF,IAAMC,CAAAA,CAAaC,gBAAW,IAAA,CAAK,CAAE,MAAO,gBAAiB,CAAC,CAAA,CACxDC,CAAAA,CAAWD,gBAAW,IAAA,CAAK,CAAE,MAAO,cAAe,CAAC,EAEpDE,CAAAA,CAAgBC,eAAAA,CAAW,MAAM,CACtC,sBAAA,CAAwB,CAAE,KAAA,CAAO,CAAA,EAAGN,CAAW,CAAA,WAAA,CAAc,CAAA,CAC7D,qBAAsB,CAAE,KAAA,CAAO,CAAA,EAAGC,CAAS,aAAc,CAAA,CAEzD,iBAAA,CAAmB,CAAE,KAAA,CAAOD,CAAY,EACxC,eAAA,CA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ourcesContent":["/*\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 { createTheme } from \"@uiw/codemirror-themes\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { Decoration, DecorationSet, EditorView, ViewPlugin, ViewUpdate } from \"@codemirror/view\";\nimport { syntaxTree } from \"@codemirror/language\";\nimport { RangeSetBuilder } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nconst YAML_NUMBER = /^-?(\\d+(\\.\\d+)?([eE][+-]?\\d+)?|\\.\\d+)$/;\nconst YAML_BOOL = /^(true|false|yes|no|on|off)$/i;\n\n/**\n * ViewPlugin that post-processes YAML Literal nodes (plain scalars).\n * @lezer/yaml maps all plain scalars to t.content — no distinction between\n * strings, numbers, and booleans. This plugin walks the syntax tree and\n * applies decoration marks to override colors for numbers and booleans.\n */\nfunction buildYamlScalarPlugin(numberColor: string, boolColor: string): Extension {\n\tconst numberMark = Decoration.mark({ class: \"cm-yaml-number\" });\n\tconst boolMark = Decoration.mark({ class: \"cm-yaml-bool\" });\n\t// Target child spans inside our decoration class to override Lezer highlight spans\n\tconst overrideTheme = EditorView.theme({\n\t\t\".cm-yaml-number span\": { color: `${numberColor} !important` },\n\t\t\".cm-yaml-bool span\": { color: `${boolColor} !important` },\n\t\t// Also target the mark itself in case there's no child span\n\t\t\".cm-yaml-number\": { color: numberColor },\n\t\t\".cm-yaml-bool\": { color: boolColor }\n\t});\n\n\tfunction buildDecorations(view: EditorView): DecorationSet {\n\t\tconst builder = new RangeSetBuilder<Decoration>();\n\t\tconst tree = syntaxTree(view.state);\n\n\t\tfor (const { from, to } of view.visibleRanges) {\n\t\t\ttree.iterate({\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t\tenter(node) {\n\t\t\t\t\tif (node.name !== \"Literal\") return;\n\t\t\t\t\t// Skip key literals — only color value literals\n\t\t\t\t\tif (node.node.parent?.name === \"Key\") return;\n\t\t\t\t\tconst text = view.state.doc.sliceString(node.from, node.to);\n\t\t\t\t\tif (YAML_NUMBER.test(text)) {\n\t\t\t\t\t\tbuilder.add(node.from, node.to, numberMark);\n\t\t\t\t\t} else if (YAML_BOOL.test(text)) {\n\t\t\t\t\t\tbuilder.add(node.from, node.to, boolMark);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn builder.finish();\n\t}\n\n\tconst plugin = ViewPlugin.fromClass(\n\t\tclass {\n\t\t\tdecorations: DecorationSet;\n\t\t\tconstructor(view: EditorView) {\n\t\t\t\tthis.decorations = buildDecorations(view);\n\t\t\t}\n\t\t\tupdate(update: ViewUpdate) {\n\t\t\t\tif (update.docChanged || update.viewportChanged || syntaxTree(update.startState) !== syntaxTree(update.state)) {\n\t\t\t\t\tthis.decorations = buildDecorations(update.view);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{ decorations: (v) => v.decorations }\n\t);\n\n\treturn [plugin, overrideTheme];\n}\n\n/**\n * Creates a CodeMirror 6 theme using the official @uiw/codemirror-themes API.\n * All colors sourced from themeMapping tokens per UX Figma spec:\n * - Property/Variable → accent.n1.w100\n * - Strings → accent.n9.w100\n * - Boolean/Constant → info.w100\n * - Numbers → accent.n2.w100\n * - Comments → secondary.text.wMain (italic)\n * - Keyword → info.w100\n * - Function → accent.n5.w100\n * - Type → accent.n0.w100\n * - Operators/Delims → secondary.w100\n * - XML Namespace → accent.n2.w100\n * - Content (YAML plain scalars + XML text) → accent.n9.w100\n * - XML Processing → accent.n5.w100\n *\n * Also returns a StreamLanguage CSS class override theme so that the custom\n * protobuf StreamLanguage (which emits string class names, not Lezer tags)\n * receives the same token colors as JSON/YAML/XML.\n */\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping, isDark = false): Extension[] {\n\tconst p = themeMapping.palette;\n\n\tconst cm6Theme = createTheme({\n\t\ttheme: isDark ? \"dark\" : \"light\",\n\t\tsettings: {\n\t\t\tbackground: p.background.w10,\n\t\t\tforeground: p.secondary.text.wMain,\n\t\t\tcaret: p.secondary.wMain,\n\t\t\tselection: `${p.brand.wMain}30`,\n\t\t\tselectionMatch: `${p.brand.wMain}20`,\n\t\t\tlineHighlight: p.background.w20,\n\t\t\tgutterBackground: p.background.w20,\n\t\t\tgutterForeground: p.secondary.text.wMain,\n\t\t\tgutterBorder: p.secondary.w40,\n\t\t\tfontFamily: `Consolas, 'Liberation Mono', Menlo, Courier, monospace`,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`\n\t\t},\n\t\tstyles: [\n\t\t\t// Strings → accent.n9.w100 (dark red per Figma)\n\t\t\t{ tag: [t.string, t.special(t.string), t.character, t.regexp, t.attributeValue], color: p.accent.n9.w100 },\n\n\t\t\t// Numbers → accent.n2.w100 (teal)\n\t\t\t{ tag: [t.number, t.integer, t.float], color: p.accent.n2.w100 },\n\n\t\t\t// Booleans / null / atoms / constants → info.w100 (blue)\n\t\t\t{ tag: [t.bool, t.null, t.atom], color: p.info.w100 },\n\n\t\t\t// Property names, variable names → accent.n1.w100\n\t\t\t{ tag: [t.propertyName, t.variableName], color: p.accent.n1.w100 },\n\n\t\t\t// XML/HTML attribute names → accent.n1.w100\n\t\t\t{ tag: t.attributeName, color: p.accent.n1.w100 },\n\n\t\t\t// XML/HTML tag names → accent.n0.w100 (type color)\n\t\t\t{ tag: t.tagName, color: p.accent.n0.w100 },\n\n\t\t\t// Keywords (syntax, message, import, etc.) → info.w100\n\t\t\t{ tag: [t.keyword, t.definitionKeyword, t.modifier, t.controlKeyword], color: p.info.w100 },\n\n\t\t\t// Function names → accent.n5.w100\n\t\t\t{ tag: [t.function(t.variableName), t.function(t.propertyName)], color: p.accent.n5.w100 },\n\n\t\t\t// Type names, class names → accent.n0.w100\n\t\t\t{ tag: [t.typeName, t.className], color: p.accent.n0.w100 },\n\n\t\t\t// Standard variables (protobuf \"builtin\" token: enum values, service/rpc names) → accent.n5.w100\n\t\t\t{ tag: t.standard(t.variableName), color: p.accent.n5.w100 },\n\n\t\t\t// XML Namespace (xmlns:) → accent.n2.w100 (structural qualifier, same as Number)\n\t\t\t{ tag: t.namespace, color: p.accent.n2.w100 },\n\n\t\t\t// Plain text content (YAML unquoted scalars + XML text between tags) → accent.n9.w100\n\t\t\t// Both YAML Literal and XML Text nodes emit t.content.\n\t\t\t// PDF designer mockup shows some scalars in different colors but parser cannot distinguish them.\n\t\t\t{ tag: t.content, color: p.accent.n9.w100 },\n\n\t\t\t// XML DOCTYPE / processing instructions (<?xml ...?>) → accent.n5.w100 (same as Function)\n\t\t\t{ tag: t.processingInstruction, color: p.accent.n5.w100 },\n\n\t\t\t// Comments → secondary.text.wMain, italic\n\t\t\t{ tag: [t.comment, t.lineComment, t.blockComment], color: p.secondary.text.wMain, fontStyle: \"italic\" },\n\n\t\t\t// Operators, punctuation, angle brackets, delimiters → secondary.w100\n\t\t\t{\n\t\t\t\ttag: [t.operator, t.punctuation, t.angleBracket, t.bracket, t.brace, t.paren, t.separator],\n\t\t\t\tcolor: p.secondary.w100\n\t\t\t}\n\t\t]\n\t});\n\n\t// StreamLanguage (used by the custom protobuf grammar) emits plain CSS class\n\t// names (.cm-keyword, .cm-type, etc.) rather than Lezer highlight tags.\n\t// The createTheme() styles array only handles Lezer tags, so we need a\n\t// separate EditorView.theme() to apply the same token colors to protobuf.\n\t// Pass { dark: isDark } so CM applies this theme in the correct color scheme.\n\tconst streamLanguageTheme = EditorView.theme(\n\t\t{\n\t\t\t\".cm-keyword\": { color: p.info.w100 },\n\t\t\t\".cm-type\": { color: p.accent.n0.w100 },\n\t\t\t\".cm-string\": { color: p.accent.n9.w100 },\n\t\t\t\".cm-number\": { color: p.accent.n2.w100 },\n\t\t\t\".cm-atom\": { color: p.info.w100 },\n\t\t\t\".cm-comment\": { color: p.secondary.text.wMain, fontStyle: \"italic\" },\n\t\t\t\".cm-punctuation\": { color: p.secondary.w100 },\n\t\t\t\".cm-builtin\": { color: p.accent.n5.w100 },\n\t\t\t\".cm-variable\": { color: p.accent.n1.w100 }\n\t\t},\n\t\t{ dark: isDark }\n\t);\n\n\tconst yamlScalarPlugin = buildYamlScalarPlugin(p.accent.n2.w100, p.info.w100);\n\treturn [cm6Theme, streamLanguageTheme, yamlScalarPlugin];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { yaml } from \"@codemirror/lang-yaml\";\nimport { StreamLanguage, StringStream } from \"@codemirror/language\";\n\ntype ProtobufState = {\n\texpectFieldName: boolean;\n\texpectPackageName: boolean;\n\texpectTypeName: boolean;\n\tinBlockComment: boolean;\n};\n\nconst KEYWORDS = /\\b(syntax|rpc|option|import|repeated|optional|required)\\b/;\nconst BUILTIN_TYPES = /\\b(int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double)\\b/;\n\nfunction resetState(state: ProtobufState) {\n\tstate.expectFieldName = false;\n\tstate.expectPackageName = false;\n\tstate.expectTypeName = false;\n}\n\nfunction tokenizeKeyword(stream: StringStream, state: ProtobufState): string | null {\n\tif (stream.match(/\\b(message|enum|service)\\b/)) {\n\t\tresetState(state);\n\t\tstate.expectTypeName = true;\n\t\treturn \"keyword\";\n\t}\n\tif (stream.match(/\\breturns\\b/)) {\n\t\tresetState(state);\n\t\tstate.expectTypeName = true;\n\t\treturn \"keyword\";\n\t}\n\tif (stream.match(KEYWORDS)) {\n\t\tresetState(state);\n\t\treturn \"keyword\";\n\t}\n\tif (stream.match(/\\bpackage\\b/)) {\n\t\tresetState(state);\n\t\tstate.expectPackageName = true;\n\t\treturn \"keyword\";\n\t}\n\treturn null;\n}\n\nfunction tokenizeIdentifier(stream: StringStream, state: ProtobufState): string | null {\n\tif (stream.match(/\\b[A-Z][A-Za-z0-9_]*\\b/)) {\n\t\tconst isType = state.expectTypeName;\n\t\tresetState(state);\n\t\treturn isType ? \"type\" : \"builtin\";\n\t}\n\tif (state.expectPackageName && stream.match(/\\b[a-z][a-zA-Z0-9_.]*\\b/)) {\n\t\tstate.expectPackageName = false;\n\t\treturn \"string\";\n\t}\n\tif (stream.match(/\\b[a-z_][a-zA-Z0-9_]*\\b/)) {\n\t\tif (state.expectFieldName) {\n\t\t\tstate.expectFieldName = false;\n\t\t\treturn \"variable\";\n\t\t}\n\t\treturn null;\n\t}\n\treturn null;\n}\n\nfunction tokenizeComment(stream: StringStream, state: ProtobufState): string | null {\n\tif (state.inBlockComment) {\n\t\twhile (!stream.eol()) {\n\t\t\tif (stream.match(\"*/\")) {\n\t\t\t\tstate.inBlockComment = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstream.next();\n\t\t}\n\t\treturn \"comment\";\n\t}\n\tif (stream.match(\"//\")) {\n\t\tstream.skipToEnd();\n\t\tstate.expectFieldName = false;\n\t\treturn \"comment\";\n\t}\n\tif (stream.match(\"/*\")) {\n\t\twhile (!stream.eol()) {\n\t\t\tif (stream.match(\"*/\")) return \"comment\";\n\t\t\tstream.next();\n\t\t}\n\t\tstate.inBlockComment = true;\n\t\tstate.expectFieldName = false;\n\t\treturn \"comment\";\n\t}\n\treturn null;\n}\n\nfunction tokenizePrimitive(stream: StringStream, state: ProtobufState): string | null {\n\tif (stream.match(/\"(?:[^\"\\\\]|\\\\.)*\"/)) {\n\t\tstate.expectFieldName = false;\n\t\treturn \"string\";\n\t}\n\tif (stream.match(BUILTIN_TYPES)) {\n\t\tstate.expectFieldName = true;\n\t\tstate.expectTypeName = false;\n\t\treturn \"type\";\n\t}\n\tif (stream.match(/\\b(true|false)\\b/)) {\n\t\tstate.expectFieldName = false;\n\t\treturn \"atom\";\n\t}\n\tif (stream.match(/^\\d+(?!\\w)/)) {\n\t\tstate.expectFieldName = false;\n\t\treturn \"number\";\n\t}\n\tif (stream.match(/[{}();,=[\\]]/)) {\n\t\tif (stream.current() === \";\") state.expectFieldName = false;\n\t\treturn \"punctuation\";\n\t}\n\treturn null;\n}\n\n// Custom protobuf support via StreamLanguage (emits CSS class names, not Lezer tags).\n// Colors map via EditorView.theme() in createCodeMirror6Theme.ts.\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\tstartState: (): ProtobufState => ({\n\t\texpectFieldName: false,\n\t\texpectPackageName: false,\n\t\texpectTypeName: false,\n\t\tinBlockComment: false\n\t}),\n\ttoken(stream, state: ProtobufState) {\n\t\tif (stream.eatSpace()) return null;\n\t\treturn (\n\t\t\ttokenizeComment(stream, state) ??\n\t\t\ttokenizePrimitive(stream, state) ??\n\t\t\ttokenizeKeyword(stream, state) ??\n\t\t\ttokenizeIdentifier(stream, state) ??\n\t\t\t(stream.next(), null)\n\t\t);\n\t},\n\tcopyState: (state: ProtobufState) => ({ ...state })\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\" | \"yaml\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"yaml\":\n\t\t\treturn yaml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { linter, lintGutter } from \"@codemirror/lint\";\nimport type { Diagnostic } from \"@codemirror/lint\";\nimport { EditorView } from \"@codemirror/view\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\n\nexport interface ValidationMessage {\n\t/** Character offset of the start of the problematic range in the document */\n\tfrom: number;\n\t/** Character offset of the end of the problematic range in the document */\n\tto: number;\n\t/** Human-readable description of the issue */\n\tmessage: string;\n\t/** Severity level — renders red dot/squiggly for error, yellow dot for warning */\n\tseverity: \"error\" | \"warning\";\n}\n\n/**\n * Creates CodeMirror extensions for inline validation display.\n * Uses @codemirror/lint's linter() + lintGutter() APIs.\n *\n * Gutter column appears after fold gutter:\n * - error → solid red circle dot\n * - warning → solid yellow/orange circle dot\n *\n * Squiggly underlines appear on the problematic character range.\n * Hovering a gutter dot shows the message as a tooltip.\n *\n * @param diagnostics - Pre-computed validation messages with document offsets\n * @param themeMapping - Current theme mapping for colors (no hardcoded values)\n */\nexport function createLintExtension(diagnostics: ValidationMessage[], themeMapping: ThemeMapping): Extension[] {\n\tconst p = themeMapping.palette;\n\n\tconst linterExt = linter((): Diagnostic[] =>\n\t\tdiagnostics.map((d) => ({\n\t\t\tfrom: d.from,\n\t\t\tto: d.to,\n\t\t\tseverity: d.severity,\n\t\t\tmessage: d.message\n\t\t}))\n\t);\n\n\tconst gutterExt = lintGutter();\n\n\t// Override default SVG marker icons with colored circle dots from themeMapping.\n\t// @codemirror/lint sets background-image on .cm-lint-marker-* by default —\n\t// we unset it and replace with a background-color circle.\n\tconst lintTheme = EditorView.theme({\n\t\t// Gutter column background matches other gutters\n\t\t\".cm-gutter-lint\": {\n\t\t\twidth: \"16px\",\n\t\t\tbackgroundColor: p.background.w20,\n\t\t\toverflow: \"hidden\"\n\t\t},\n\t\t// Each gutter cell — flex center the dot both axes\n\t\t\".cm-gutter-lint .cm-gutterElement\": {\n\t\t\tdisplay: \"flex\",\n\t\t\talignItems: \"center\",\n\t\t\tjustifyContent: \"center\",\n\t\t\tpadding: \"0\"\n\t\t},\n\t\t// CM injects its base stylesheet first in <head> — EditorView.theme() injects after,\n\t\t// so equal-specificity rules here win without !important.\n\t\t// Override the default content: url(SVG) with a solid colored circle.\n\t\t\".cm-lint-marker\": {\n\t\t\tcontent: \"none\",\n\t\t\tdisplay: \"block\",\n\t\t\twidth: \"8px\",\n\t\t\theight: \"8px\",\n\t\t\tborderRadius: \"50%\",\n\t\t\tmargin: \"auto\"\n\t\t},\n\t\t\".cm-lint-marker-error\": {\n\t\t\tcontent: \"none\",\n\t\t\tbackground: p.error.w100\n\t\t},\n\t\t\".cm-lint-marker-warning\": {\n\t\t\tcontent: \"none\",\n\t\t\tbackground: p.warning.w100\n\t\t},\n\t\t// Squiggly underline on error range — text-decoration only, no background\n\t\t\".cm-lintRange-error\": {\n\t\t\tbackgroundImage: \"none\",\n\t\t\ttextDecoration: `underline wavy ${p.error.w100}`,\n\t\t\ttextUnderlineOffset: \"2px\"\n\t\t},\n\t\t// Squiggly underline on warning range\n\t\t\".cm-lintRange-warning\": {\n\t\t\tbackgroundImage: \"none\",\n\t\t\ttextDecoration: `underline wavy ${p.warning.w100}`,\n\t\t\ttextUnderlineOffset: \"2px\"\n\t\t},\n\t\t// Hide the outer .cm-tooltip frame when it wraps a lint tooltip — avoids double border/bg.\n\t\t// :has() scopes the reset to lint tooltips only, leaving autocomplete/hover tooltips intact.\n\t\t\".cm-tooltip:has(.cm-tooltip-lint)\": {\n\t\t\tborder: \"none\",\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tboxShadow: \"none\"\n\t\t},\n\t\t// Styled lint tooltip shell — the inner <ul class=\"cm-tooltip-lint\">\n\t\t\".cm-tooltip-lint\": {\n\t\t\tbackgroundColor: p.background.w10,\n\t\t\tborder: `1px solid ${p.secondary.w40}`,\n\t\t\tborderRadius: \"4px\",\n\t\t\tpadding: \"4px 8px\",\n\t\t\tfontSize: \"12px\",\n\t\t\tcolor: p.secondary.text.wMain,\n\t\t\tboxShadow: `0 2px 8px ${p.secondary.w20}`\n\t\t}\n\t});\n\n\treturn [linterExt, gutterExt, lintTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { styled } from \"@mui/material\";\nimport { Error16Icon, Warning16Icon } from \"@SolaceDev/maas-icons\";\nimport { ValidationMessage } from \"../../utils/codeMirrorLinting\";\n\nconst StyledValidationBanner = styled(\"div\", {\n\tshouldForwardProp: (prop) => prop !== \"severity\"\n})<{ severity: \"error\" | \"warning\" }>(({ theme, severity }) => ({\n\tdisplay: \"flex\",\n\talignItems: \"flex-start\",\n\tgap: theme.spacing(1),\n\tpadding: theme.spacing(1, 1.5),\n\tfontSize: theme.typography.body1.fontSize,\n\tlineHeight: theme.typography.body1.lineHeight,\n\tbackgroundColor: severity === \"error\" ? theme.palette.ux.error.w10 : theme.palette.ux.warning.w10,\n\tborderBottom:\n\t\tseverity === \"error\" ? `1px solid ${theme.palette.ux.error.w30}` : `1px solid ${theme.palette.ux.warning.w30}`,\n\tcolor: severity === \"error\" ? theme.palette.ux.error.w100 : theme.palette.ux.warning.w100\n}));\n\nexport interface CodeEditorValidationBannerProps {\n\tvalidationMessages: ValidationMessage[];\n\tdoc: string;\n}\n\nconst joinLineNumbers = (sorted: number[]): string => {\n\tconst last = sorted[sorted.length - 1];\n\tconst rest = sorted.slice(0, -1);\n\tif (rest.length === 1) return `${rest[0]} and ${last}`;\n\treturn `${rest.join(\", \")}, and ${last}`;\n};\n\nconst buildBannerMessage = (messages: ValidationMessage[], doc: string, severity: \"error\" | \"warning\"): string => {\n\tconst filtered = messages.filter((m) => m.severity === severity);\n\tif (filtered.length === 0) return \"\";\n\n\t// Precompute newline offsets once, then binary-search per message — O(n + m log n)\n\t// instead of O(n*m) from repeated doc.substring().split(\"\\n\").\n\tconst newlines: number[] = [];\n\tfor (let i = 0; i < doc.length; i++) {\n\t\tif (doc[i] === \"\\n\") newlines.push(i);\n\t}\n\tconst offsetToLine = (offset: number): number => {\n\t\tlet lo = 0,\n\t\t\thi = newlines.length;\n\t\twhile (lo < hi) {\n\t\t\tconst mid = (lo + hi) >> 1;\n\t\t\tif (newlines[mid] < offset) lo = mid + 1;\n\t\t\telse hi = mid;\n\t\t}\n\t\treturn lo + 1; // 1-based line number\n\t};\n\n\tconst lines = new Set<number>();\n\tfiltered.forEach((m) => {\n\t\tlines.add(offsetToLine(m.from));\n\t});\n\n\tconst sortedLines = Array.from(lines).sort((a, b) => a - b);\n\tconst label = severity === \"error\" ? \"error\" : \"warning\";\n\tconst plural = filtered.length > 1 ? \"s\" : \"\";\n\tconst prefix = severity === \"error\" ? \"Invalid syntax.\" : \"Invalid schema.\";\n\n\tif (sortedLines.length === 1) {\n\t\treturn `${prefix} Fix ${label}${plural} on line ${sortedLines[0]}.`;\n\t}\n\treturn `${prefix} Fix ${label}${plural} in lines ${joinLineNumbers(sortedLines)}.`;\n};\n\nconst CodeEditorValidationBanner = ({\n\tvalidationMessages,\n\tdoc\n}: CodeEditorValidationBannerProps): JSX.Element | null => {\n\tconst hasErrors = validationMessages.some((m) => m.severity === \"error\");\n\tconst hasWarnings = validationMessages.some((m) => m.severity === \"warning\");\n\tif (hasErrors) {\n\t\treturn (\n\t\t\t<StyledValidationBanner severity=\"error\" role=\"alert\" aria-live=\"assertive\">\n\t\t\t\t<Error16Icon sx={{ flexShrink: 0 }} />\n\t\t\t\t<span>{buildBannerMessage(validationMessages, doc, \"error\")}</span>\n\t\t\t</StyledValidationBanner>\n\t\t);\n\t}\n\tif (hasWarnings) {\n\t\treturn (\n\t\t\t<StyledValidationBanner severity=\"warning\" role=\"status\" aria-live=\"polite\">\n\t\t\t\t<Warning16Icon sx={{ flexShrink: 0 }} />\n\t\t\t\t<span>{buildBannerMessage(validationMessages, doc, \"warning\")}</span>\n\t\t\t</StyledValidationBanner>\n\t\t);\n\t}\n\treturn null;\n};\n\nexport default CodeEditorValidationBanner;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport { createLintExtension, ValidationMessage } from \"../../utils/codeMirrorLinting\";\nimport getThemeMappings, { appTheme } from \"../../theming/themeUtils\";\nimport { SupportedThemes } from \"../../types/supportedThemes\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\nimport CodeEditorValidationBanner from \"./CodeEditorValidationBanner\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\nexport type { ValidationMessage };\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")<{ customHeight?: string }>(({ theme, customHeight }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties),\n\t...(customHeight && {\n\t\t// Flex column: banner takes natural height, .cm-theme fills the remaining space.\n\t\theight: customHeight === \"auto\" ? \"auto\" : `${customHeight} !important`,\n\t\tdisplay: \"flex\",\n\t\tflexDirection: \"column\",\n\t\t\"& .cm-theme\": {\n\t\t\tflex: customHeight === \"auto\" ? \"unset\" : \"1 1 0\",\n\t\t\tminHeight: customHeight === \"auto\" ? \"unset\" : \"0\",\n\t\t\t...(customHeight === \"auto\" && { height: \"auto\" })\n\t\t},\n\t\t\"& .cm-editor\": {\n\t\t\theight: customHeight === \"auto\" ? \"auto !important\" : \"100% !important\"\n\t\t},\n\t\t\"& .cm-editor .cm-scroller\": {\n\t\t\t...(customHeight === \"auto\" ? { maxHeight: \"none !important\" } : {})\n\t\t}\n\t})\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\" | \"yaml\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Height of the code editor. Can be a number (in pixels) or a string (e.g., '300px', '100%')\n\t * @default '300px'\n\t */\n\theight?: string | number;\n\t/**\n\t * Inline validation messages shown as squiggly underlines on the affected range\n\t * and as colored dots in the gutter (red = error, yellow/orange = warning).\n\t * Hovering a gutter dot shows the message as a tooltip.\n\t * A banner is shown above the editor when error or warning messages are present.\n\t * Each message requires character offsets (from/to) within the document string.\n\t */\n\tvalidationMessages?: ValidationMessage[];\n\t/**\n\t * Callback fired whenever the set of validationMessages changes.\n\t * Notifies parent components of the current validation state so they can\n\t * update tab indicators, form submit buttons, or other external UI.\n\t */\n\tonValidationChange?: (hasErrors: boolean, hasWarnings: boolean) => void;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\theight,\n\tvalidationMessages = [],\n\tonValidationChange,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Notify parent whenever validationMessages change\n\tuseEffect(() => {\n\t\tif (onValidationChange) {\n\t\t\tconst hasErr = validationMessages.some((m) => m.severity === \"error\");\n\t\t\tconst hasWarn = validationMessages.some((m) => m.severity === \"warning\");\n\t\t\tonValidationChange(hasErr, hasWarn);\n\t\t}\n\t}, [validationMessages, onValidationChange]);\n\n\tconst isDark = appTheme === SupportedThemes.solaceDark;\n\n\t// Full structural theme always applied (background, font, gutter, selection).\n\t// In read-only mode an extra override forces all text to secondary.text.wMain (grey, no syntax colors per UX spec).\n\t// In editable mode: full syntax theme with colors.\n\tconst readOnlyOverride = useMemo(\n\t\t() =>\n\t\t\tEditorView.theme({\n\t\t\t\t\"&\": { color: themeMapping.palette.secondary.text.wMain },\n\t\t\t\t\"& .cm-content *\": { color: `${themeMapping.palette.secondary.text.wMain} !important` }\n\t\t\t}),\n\t\t[themeMapping]\n\t);\n\tconst cm6Theme = useMemo(\n\t\t() =>\n\t\t\treadOnly\n\t\t\t\t? [...createCodeMirror6Theme(themeMapping, isDark), readOnlyOverride]\n\t\t\t\t: createCodeMirror6Theme(themeMapping, isDark),\n\t\t[themeMapping, isDark, readOnly, readOnlyOverride]\n\t);\n\n\t// In read-only mode: no language extension (no syntax parsing/highlighting per UX spec — plain grey text).\n\t// Lint extensions are only added in editable mode when validationMessages are provided.\n\t// In read-only mode the validation banner still renders, but inline underlines/gutter dots are suppressed.\n\tconst extensions = useMemo(\n\t\t() =>\n\t\t\treadOnly\n\t\t\t\t? [EditorView.lineWrapping, keymap.of(defaultKeymap)]\n\t\t\t\t: [\n\t\t\t\t\t\tgetLanguageExtension(mode),\n\t\t\t\t\t\tEditorView.lineWrapping,\n\t\t\t\t\t\tkeymap.of(defaultKeymap),\n\t\t\t\t\t\t...(validationMessages.length > 0 ? createLintExtension(validationMessages, themeMapping) : [])\n\t\t\t\t\t],\n\t\t[mode, readOnly, validationMessages, themeMapping]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\t// Convert height prop to string format for CodeMirror\n\tconst cmHeight = height ? (typeof height === \"number\" ? `${height}px` : height) : \"300px\";\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// Validation banner — shown above editor when error or warning messages exist\n\tconst validationBanner = <CodeEditorValidationBanner validationMessages={validationMessages} doc={val} />;\n\n\tconst editorContent = (\n\t\t<>\n\t\t\t{validationBanner}\n\t\t\t<CodeMirror\n\t\t\t\tvalue={val}\n\t\t\t\tonChange={handleChange}\n\t\t\t\textensions={extensions}\n\t\t\t\ttheme={cm6Theme}\n\t\t\t\theight={cmHeight}\n\t\t\t\teditable={!readOnly}\n\t\t\t\tbasicSetup={{\n\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\tautocompletion: true,\n\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\tsearchKeymap: true\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{editorContent}\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{editorContent}\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {b}from'./chunk-LWCJ2SGT.modern.mjs';import {e,g,c}from'./chunk-Q6DR3MQK.modern.mjs';import {wa,ua,qi,ni,Na}from'./chunk-PWYVYHTJ.modern.mjs';import {useState,useEffect,useMemo}from'react';import
|
|
2
|
-
export{
|
|
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 De 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 be=/^-?(\d+(\.\d+)?([eE][+-]?\d+)?|\.\d+)$/,we=/^(true|false|yes|no|on|off)$/i;function ye(e,o){let t=Decoration.mark({class:"cm-yaml-number"}),m=Decoration.mark({class:"cm-yaml-bool"}),i=EditorView.theme({".cm-yaml-number span":{color:`${e} !important`},".cm-yaml-bool span":{color:`${o} !important`},".cm-yaml-number":{color:e},".cm-yaml-bool":{color:o}});function s(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(a){if(a.name!=="Literal"||a.node.parent?.name==="Key")return;let l=n.state.doc.sliceString(a.from,a.to);be.test(l)?f.add(a.from,a.to,t):we.test(l)&&f.add(a.from,a.to,m);}});return f.finish()}return [ViewPlugin.fromClass(class{constructor(n){this.decorations=s(n);}update(n){(n.docChanged||n.viewportChanged||syntaxTree(n.startState)!==syntaxTree(n.state))&&(this.decorations=s(n.view));}},{decorations:n=>n.decorations}),i]}function $(e,o=false){let t=e.palette,m=createTheme({theme:o?"dark":"light",settings:{background:t.background.w10,foreground:t.secondary.text.wMain,caret:t.secondary.wMain,selection:`${t.brand.wMain}30`,selectionMatch:`${t.brand.wMain}20`,lineHighlight:t.background.w20,gutterBackground:t.background.w20,gutterForeground:t.secondary.text.wMain,gutterBorder:t.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:t.accent.n9.w100},{tag:[tags.number,tags.integer,tags.float],color:t.accent.n2.w100},{tag:[tags.bool,tags.null,tags.atom],color:t.info.w100},{tag:[tags.propertyName,tags.variableName],color:t.accent.n1.w100},{tag:tags.attributeName,color:t.accent.n1.w100},{tag:tags.tagName,color:t.accent.n0.w100},{tag:[tags.keyword,tags.definitionKeyword,tags.modifier,tags.controlKeyword],color:t.info.w100},{tag:[tags.function(tags.variableName),tags.function(tags.propertyName)],color:t.accent.n5.w100},{tag:[tags.typeName,tags.className],color:t.accent.n0.w100},{tag:tags.standard(tags.variableName),color:t.accent.n5.w100},{tag:tags.namespace,color:t.accent.n2.w100},{tag:tags.content,color:t.accent.n9.w100},{tag:tags.processingInstruction,color:t.accent.n5.w100},{tag:[tags.comment,tags.lineComment,tags.blockComment],color:t.secondary.text.wMain,fontStyle:"italic"},{tag:[tags.operator,tags.punctuation,tags.angleBracket,tags.bracket,tags.brace,tags.paren,tags.separator],color:t.secondary.w100}]}),i=EditorView.theme({".cm-keyword":{color:t.info.w100},".cm-type":{color:t.accent.n0.w100},".cm-string":{color:t.accent.n9.w100},".cm-number":{color:t.accent.n2.w100},".cm-atom":{color:t.info.w100},".cm-comment":{color:t.secondary.text.wMain,fontStyle:"italic"},".cm-punctuation":{color:t.secondary.w100},".cm-builtin":{color:t.accent.n5.w100},".cm-variable":{color:t.accent.n1.w100}},{dark:o}),s=ye(t.accent.n2.w100,t.info.w100);return [m,i,s]}var Ee=/\b(syntax|rpc|option|import|repeated|optional|required)\b/,ke=/\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 Ne(e,o){return e.match(/\b(message|enum|service)\b/)||e.match(/\breturns\b/)?(y(o),o.expectTypeName=true,"keyword"):e.match(Ee)?(y(o),"keyword"):e.match(/\bpackage\b/)?(y(o),o.expectPackageName=true,"keyword"):null}function Me(e,o){if(e.match(/\b[A-Z][A-Za-z0-9_]*\b/)){let t=o.expectTypeName;return y(o),t?"type":"builtin"}return o.expectPackageName&&e.match(/\b[a-z][a-zA-Z0-9_.]*\b/)?(o.expectPackageName=false,"string"):e.match(/\b[a-z_][a-zA-Z0-9_]*\b/)&&o.expectFieldName?(o.expectFieldName=false,"variable"):null}function ve(e,o){if(o.inBlockComment){for(;!e.eol();){if(e.match("*/")){o.inBlockComment=false;break}e.next();}return "comment"}if(e.match("//"))return e.skipToEnd(),o.expectFieldName=false,"comment";if(e.match("/*")){for(;!e.eol();){if(e.match("*/"))return "comment";e.next();}return o.inBlockComment=true,o.expectFieldName=false,"comment"}return null}function Pe(e,o){return e.match(/"(?:[^"\\]|\\.)*"/)?(o.expectFieldName=false,"string"):e.match(ke)?(o.expectFieldName=true,o.expectTypeName=false,"type"):e.match(/\b(true|false)\b/)?(o.expectFieldName=false,"atom"):e.match(/^\d+(?!\w)/)?(o.expectFieldName=false,"number"):e.match(/[{}();,=[\]]/)?(e.current()===";"&&(o.expectFieldName=false),"punctuation"):null}var $e=StreamLanguage.define({name:"protobuf",startState:()=>({expectFieldName:false,expectPackageName:false,expectTypeName:false,inBlockComment:false}),token(e,o){return e.eatSpace()?null:ve(e,o)??Pe(e,o)??Ne(e,o)??Me(e,o)??(e.next(),null)},copyState:e=>({...e})}),Y=e=>{switch(e){case "json":return json();case "xml":return xml();case "yaml":return yaml();case "protobuf":return $e;default:return json()}};function j(e,o){let t=o.palette,m=linter(()=>e.map(u=>({from:u.from,to:u.to,severity:u.severity,message:u.message}))),i=lintGutter(),s=EditorView.theme({".cm-gutter-lint":{width:"16px",backgroundColor:t.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:t.error.w100},".cm-lint-marker-warning":{content:"none",background:t.warning.w100},".cm-lintRange-error":{backgroundImage:"none",textDecoration:`underline wavy ${t.error.w100}`,textUnderlineOffset:"2px"},".cm-lintRange-warning":{backgroundImage:"none",textDecoration:`underline wavy ${t.warning.w100}`,textUnderlineOffset:"2px"},".cm-tooltip:has(.cm-tooltip-lint)":{border:"none",backgroundColor:"transparent",boxShadow:"none"},".cm-tooltip-lint":{backgroundColor:t.background.w10,border:`1px solid ${t.secondary.w40}`,borderRadius:"4px",padding:"4px 8px",fontSize:"12px",color:t.secondary.text.wMain,boxShadow:`0 2px 8px ${t.secondary.w20}`}});return [m,i,s]}var Ie=({size:e,fill:o})=>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:o})}),Q=Ie;var Be=({size:e,fill:o})=>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:o}),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:o})]}),ee=Be;var oe=wa("div",{shouldForwardProp:e=>e!=="severity"})(({theme:e,severity:o})=>({display:"flex",alignItems:"flex-start",gap:e.spacing(1),padding:e.spacing(1,1.5),fontSize:e.typography.body1.fontSize,lineHeight:e.typography.body1.lineHeight,backgroundColor:o==="error"?e.palette.ux.error.w10:e.palette.ux.warning.w10,borderBottom:o==="error"?`1px solid ${e.palette.ux.error.w30}`:`1px solid ${e.palette.ux.warning.w30}`,color:o==="error"?e.palette.ux.error.w100:e.palette.ux.warning.w100})),_e=e=>{let o=e[e.length-1],t=e.slice(0,-1);return t.length===1?`${t[0]} and ${o}`:`${t.join(", ")}, and ${o}`},te=(e,o,t)=>{let m=e.filter(c=>c.severity===t);if(m.length===0)return "";let i=[];for(let c=0;c<o.length;c++)o[c]===`
|
|
2
|
+
`&&i.push(c);let s=c=>{let a=0,l=i.length;for(;a<l;){let w=a+l>>1;i[w]<c?a=w+1:l=w;}return a+1},u=new Set;m.forEach(c=>{u.add(s(c.from));});let n=Array.from(u).sort((c,a)=>c-a),f=t==="error"?"error":"warning",d=m.length>1?"s":"",g=t==="error"?"Invalid syntax.":"Invalid schema.";return n.length===1?`${g} Fix ${f}${d} on line ${n[0]}.`:`${g} Fix ${f}${d} in lines ${_e(n)}.`},ze=({validationMessages:e,doc:o})=>{let t=e.some(i=>i.severity==="error"),m=e.some(i=>i.severity==="warning");return t?jsxs(oe,{severity:"error",role:"alert","aria-live":"assertive",children:[jsx(Error16Icon,{sx:{flexShrink:0}}),jsx("span",{children:te(e,o,"error")})]}):m?jsxs(oe,{severity:"warning",role:"status","aria-live":"polite",children:[jsx(Warning16Icon,{sx:{flexShrink:0}}),jsx("span",{children:te(e,o,"warning")})]}):null},ne=ze;var Ze=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.OuterWrapper})),Ae=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.InnerWrapper})),le=wa("div")(({theme:e,customHeight:o})=>({...e.mixins.formComponent_CodeEditor.EditorWrapper,...o&&{height:o==="auto"?"auto":`${o} !important`,display:"flex",flexDirection:"column","& .cm-theme":{flex:o==="auto"?"unset":"1 1 0",minHeight:o==="auto"?"unset":"0",...o==="auto"&&{height:"auto"}},"& .cm-editor":{height:o==="auto"?"auto !important":"100% !important"},"& .cm-editor .cm-scroller":{...o==="auto"?{maxHeight:"none !important"}:{}}}})),Re=wa("div")(({theme:e})=>({...e.mixins.formComponent_CodeEditor.IconWrapper})),me=(e$1,o,t)=>o?jsx(e,{children:e$1}):t?jsx(g,{children:e$1}):jsx(c,{children:e$1});function Xe({mode:e="json",value:o,readOnly:t=false,expandable:m=false,fullScreen:i=false,helperText:s="",hasErrors:u=false,hasWarnings:n=false,height:f,validationMessages:d=[],onValidationChange:g,onChange:c}){let a=ua(),l=qi(),[w,B]=useState(o||""),[x,W]=useState(i||false);useEffect(()=>{o!==void 0&&B(o);},[o]),useEffect(()=>{W(i);},[i]),useEffect(()=>{if(g){let h=d.some(M=>M.severity==="error"),ue=d.some(M=>M.severity==="warning");g(h,ue);}},[d,g]);let k=pi==="solace-dark",F=useMemo(()=>EditorView.theme({"&":{color:l.palette.secondary.text.wMain},"& .cm-content *":{color:`${l.palette.secondary.text.wMain} !important`}}),[l]),se=useMemo(()=>t?[...$(l,k),F]:$(l,k),[l,k,t,F]),pe=useMemo(()=>t?[EditorView.lineWrapping,keymap.of(defaultKeymap)]:[Y(e),EditorView.lineWrapping,keymap.of(defaultKeymap),...d.length>0?j(d,l):[]],[e,t,d,l]),de=h=>{B(h),c&&c(null,null,h);},N=f?typeof f=="number"?`${f}px`:f:"300px",H=()=>{W(!x);},_=jsxs(Fragment,{children:[jsx(ne,{validationMessages:d,doc:w}),jsx(De,{value:w,onChange:de,extensions:pe,theme:se,height:N,editable:!t,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})]});return jsxs(Fragment,{children:[m&&jsx(Ze,{className:x?"codeEditor-expanded--backdrop":"",children:jsxs(Ae,{className:x?"codeEditor-expanded--main":"",children:[jsx(Re,{className:x?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:x?jsx(b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:H,title:"Collapse",children:jsx(ee,{fill:a.palette.ux.secondary.wMain,size:24})}):jsx(b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:H,title:"Expand",children:jsx(Q,{fill:a.palette.ux.secondary.wMain,size:24})})}),jsx(le,{customHeight:N,className:`${x?"":"codeEditor-border"} ${t?"codeEditor-readonly":""}`,children:_}),s&&me(s,u,n)]})}),!m&&jsxs(Fragment,{children:[jsx(le,{customHeight:N,className:`${x?"":"codeEditor-border"} ${t?"codeEditor-readonly":""}`,children:_}),s&&me(s,u,n)]})]})}var Je=Xe;export{Je as SolaceCodeEditor};//# sourceMappingURL=code-editor.modern.mjs.map
|
|
3
3
|
//# sourceMappingURL=code-editor.modern.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","yaml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","customHeight","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","height","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","cmHeight","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"8mBAuBO,SAASA,CAAAA,CAAuBC,CAAAA,CAAyC,CAE/E,IAAMC,CAAAA,CAAkB,kBAAA,CAGlBC,CAAAA,CAAiBC,cAAAA,CAAe,MAAA,CAAO,CAE5C,CAAE,GAAA,CAAKC,KAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACxD,CAAE,IAAKI,IAAA,CAAE,OAAA,CAAQA,IAAA,CAAE,MAAM,EAAG,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACnE,CAAE,GAAA,CAAKI,IAAA,CAAE,SAAA,CAAW,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,MAAM,IAAK,CAAA,CAC3D,CAAE,GAAA,CAAKI,IAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,QAAQ,KAAA,CAAM,IAAK,CAAA,CAGxD,CAAE,GAAA,CAAKI,IAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,EAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAC1D,CAAE,GAAA,CAAKI,IAAA,CAAE,OAAA,CAAS,KAAA,CAAOJ,EAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAC3D,CAAE,GAAA,CAAKI,IAAA,CAAE,KAAA,CAAO,MAAOJ,CAAAA,CAAa,OAAA,CAA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QAAA,CAAU,CAACpB,CAAAA,CACX,UAAA,CAAY,CACX,YAAa,IAAA,CACb,UAAA,CAAY,IAAA,CACZ,eAAA,CAAiB,IAAA,CACjB,aAAA,CAAe,IAAA,CACf,cAAA,CAAgB,KAChB,oBAAA,CAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,aAAc,IACf,CAAA,CACD,CAAA,CACD,CAAA,CACCR,GAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CACD,CAAA,CAEA,CAACO,GACDnB,IAAAA,CAAAwC,QAAAA,CAAA,CACC,QAAA,CAAA,CAAA5C,GAAAA,CAACU,CAAAA,CAAA,CACA,YAAA,CAAcgC,EACd,SAAA,CAAW,CAAA,EAAIV,CAAAA,CAAuC,EAAA,CAAtB,mBAAwB,CAAA,CAAA,EAAIV,CAAAA,CAAW,qBAAA,CAAwB,EAAE,CAAA,CAAA,CAEjG,QAAA,CAAAtB,GAAAA,CAAC8C,CAAAA,CAAA,CACA,KAAA,CAAOjB,CAAAA,CACP,QAAA,CAAUW,CAAAA,CACV,WAAYH,CAAAA,CACZ,KAAA,CAAOF,CAAAA,CACP,QAAA,CAAU,CAACb,CAAAA,CACX,UAAA,CAAY,CACX,YAAa,IAAA,CACb,UAAA,CAAY,IAAA,CACZ,eAAA,CAAiB,IAAA,CACjB,aAAA,CAAe,IAAA,CACf,cAAA,CAAgB,KAChB,oBAAA,CAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,YAAA,CAAc,IACf,CAAA,CACD,CAAA,CACD,EACCR,CAAAA,EAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO+B,EAAAA,CAAQ3B","file":"code-editor.modern.mjs","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping): Extension[] {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { yaml } from \"@codemirror/lang-yaml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\" | \"yaml\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"yaml\":\n\t\t\treturn yaml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")<{ customHeight?: string }>(({ theme, customHeight }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties),\n\t...(customHeight && {\n\t\theight: `${customHeight} !important`,\n\t\t\"& .cm-theme\": {\n\t\t\theight: `${customHeight} !important`\n\t\t},\n\t\t\"& .cm-editor\": {\n\t\t\theight: `${customHeight} !important`\n\t\t},\n\t\t\"& .cm-editor .cm-scroller\": {\n\t\t\tmaxHeight: `${customHeight} !important`\n\t\t}\n\t})\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\" | \"yaml\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Height of the code editor. Can be a number (in pixels) or a string (e.g., '300px', '100%')\n\t * @default '300px'\n\t */\n\theight?: string | number;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\theight,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\t// Convert height prop to string format for CodeMirror\n\tconst cmHeight = height ? (typeof height === \"number\" ? `${height}px` : height) : \"300px\";\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\theight={cmHeight}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/utils/codeMirrorLinting.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/CodeEditorValidationBanner.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["YAML_NUMBER","YAML_BOOL","buildYamlScalarPlugin","numberColor","boolColor","numberMark","Decoration","boolMark","overrideTheme","EditorView","buildDecorations","view","builder","RangeSetBuilder","tree","syntaxTree","from","to","node","text","ViewPlugin","update","v","createCodeMirror6Theme","themeMapping","isDark","p","cm6Theme","createTheme","BASE_FONT_PX_SIZES","t","streamLanguageTheme","yamlScalarPlugin","KEYWORDS","BUILTIN_TYPES","resetState","state","tokenizeKeyword","stream","tokenizeIdentifier","isType","tokenizeComment","tokenizePrimitive","protobufLanguage","StreamLanguage","getLanguageExtension","mode","json","xml","yaml","createLintExtension","diagnostics","linterExt","linter","d","gutterExt","lintGutter","lintTheme","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledValidationBanner","styled_default","prop","theme","severity","joinLineNumbers","sorted","last","rest","buildBannerMessage","messages","doc","filtered","m","newlines","i","offsetToLine","offset","lo","hi","mid","lines","sortedLines","a","b","label","plural","prefix","CodeEditorValidationBanner","validationMessages","hasErrors","hasWarnings","Error16Icon","Warning16Icon","CodeEditorValidationBanner_default","StyledOuterWrapper","StyledInnerWrapper","StyledEditorWrapper","customHeight","IconWrapper","renderHelperText","helperText","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","height","onValidationChange","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","hasErr","hasWarn","appTheme","readOnlyOverride","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","cmHeight","toggleExpandedMode","editorContent","Fragment","CodeMirror","SolaceButton_default","SolaceCodeEditor_default"],"mappings":"i0BAyBA,IAAMA,GAAc,wCAAA,CACdC,EAAAA,CAAY,gCAQlB,SAASC,EAAAA,CAAsBC,CAAAA,CAAqBC,CAAAA,CAA8B,CACjF,IAAMC,CAAAA,CAAaC,WAAW,IAAA,CAAK,CAAE,MAAO,gBAAiB,CAAC,CAAA,CACxDC,CAAAA,CAAWD,WAAW,IAAA,CAAK,CAAE,MAAO,cAAe,CAAC,EAEpDE,CAAAA,CAAgBC,UAAAA,CAAW,MAAM,CACtC,sBAAA,CAAwB,CAAE,KAAA,CAAO,CAAA,EAAGN,CAAW,CAAA,WAAA,CA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X,CAAAA,CAAWC,CAAW,GACnE,CAAA,CAAA,CAEF,CAEF,CAEA,IAAO8C,EAAAA,CAAQhC","file":"code-editor.modern.mjs","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTheme } from \"@uiw/codemirror-themes\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { Decoration, DecorationSet, EditorView, ViewPlugin, ViewUpdate } from \"@codemirror/view\";\nimport { syntaxTree } from \"@codemirror/language\";\nimport { RangeSetBuilder } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nconst YAML_NUMBER = /^-?(\\d+(\\.\\d+)?([eE][+-]?\\d+)?|\\.\\d+)$/;\nconst YAML_BOOL = /^(true|false|yes|no|on|off)$/i;\n\n/**\n * ViewPlugin that post-processes YAML Literal nodes (plain scalars).\n * @lezer/yaml maps all plain scalars to t.content — no distinction between\n * strings, numbers, and booleans. This plugin walks the syntax tree and\n * applies decoration marks to override colors for numbers and booleans.\n */\nfunction buildYamlScalarPlugin(numberColor: string, boolColor: string): Extension {\n\tconst numberMark = Decoration.mark({ class: \"cm-yaml-number\" });\n\tconst boolMark = Decoration.mark({ class: \"cm-yaml-bool\" });\n\t// Target child spans inside our decoration class to override Lezer highlight spans\n\tconst overrideTheme = EditorView.theme({\n\t\t\".cm-yaml-number span\": { color: `${numberColor} !important` },\n\t\t\".cm-yaml-bool span\": { color: `${boolColor} !important` },\n\t\t// Also target the mark itself in case there's no child span\n\t\t\".cm-yaml-number\": { color: numberColor },\n\t\t\".cm-yaml-bool\": { color: boolColor }\n\t});\n\n\tfunction buildDecorations(view: EditorView): DecorationSet {\n\t\tconst builder = new RangeSetBuilder<Decoration>();\n\t\tconst tree = syntaxTree(view.state);\n\n\t\tfor (const { from, to } of view.visibleRanges) {\n\t\t\ttree.iterate({\n\t\t\t\tfrom,\n\t\t\t\tto,\n\t\t\t\tenter(node) {\n\t\t\t\t\tif (node.name !== \"Literal\") return;\n\t\t\t\t\t// Skip key literals — only color value literals\n\t\t\t\t\tif (node.node.parent?.name === \"Key\") return;\n\t\t\t\t\tconst text = view.state.doc.sliceString(node.from, node.to);\n\t\t\t\t\tif (YAML_NUMBER.test(text)) {\n\t\t\t\t\t\tbuilder.add(node.from, node.to, numberMark);\n\t\t\t\t\t} else if (YAML_BOOL.test(text)) {\n\t\t\t\t\t\tbuilder.add(node.from, node.to, boolMark);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn builder.finish();\n\t}\n\n\tconst plugin = ViewPlugin.fromClass(\n\t\tclass {\n\t\t\tdecorations: DecorationSet;\n\t\t\tconstructor(view: EditorView) {\n\t\t\t\tthis.decorations = buildDecorations(view);\n\t\t\t}\n\t\t\tupdate(update: ViewUpdate) {\n\t\t\t\tif (update.docChanged || update.viewportChanged || syntaxTree(update.startState) !== syntaxTree(update.state)) {\n\t\t\t\t\tthis.decorations = buildDecorations(update.view);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{ decorations: (v) => v.decorations }\n\t);\n\n\treturn [plugin, overrideTheme];\n}\n\n/**\n * Creates a CodeMirror 6 theme using the official @uiw/codemirror-themes API.\n * All colors sourced from themeMapping tokens per UX Figma spec:\n * - Property/Variable → accent.n1.w100\n * - Strings → accent.n9.w100\n * - Boolean/Constant → info.w100\n * - Numbers → accent.n2.w100\n * - Comments → secondary.text.wMain (italic)\n * - Keyword → info.w100\n * - Function → accent.n5.w100\n * - Type → accent.n0.w100\n * - Operators/Delims → secondary.w100\n * - XML Namespace → accent.n2.w100\n * - Content (YAML plain scalars + XML text) → accent.n9.w100\n * - XML Processing → accent.n5.w100\n *\n * Also returns a StreamLanguage CSS class override theme so that the custom\n * protobuf StreamLanguage (which emits string class names, not Lezer tags)\n * receives the same token colors as JSON/YAML/XML.\n */\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping, isDark = false): Extension[] {\n\tconst p = themeMapping.palette;\n\n\tconst cm6Theme = createTheme({\n\t\ttheme: isDark ? \"dark\" : \"light\",\n\t\tsettings: {\n\t\t\tbackground: p.background.w10,\n\t\t\tforeground: p.secondary.text.wMain,\n\t\t\tcaret: p.secondary.wMain,\n\t\t\tselection: `${p.brand.wMain}30`,\n\t\t\tselectionMatch: `${p.brand.wMain}20`,\n\t\t\tlineHighlight: p.background.w20,\n\t\t\tgutterBackground: p.background.w20,\n\t\t\tgutterForeground: p.secondary.text.wMain,\n\t\t\tgutterBorder: p.secondary.w40,\n\t\t\tfontFamily: `Consolas, 'Liberation Mono', Menlo, Courier, monospace`,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`\n\t\t},\n\t\tstyles: [\n\t\t\t// Strings → accent.n9.w100 (dark red per Figma)\n\t\t\t{ tag: [t.string, t.special(t.string), t.character, t.regexp, t.attributeValue], color: p.accent.n9.w100 },\n\n\t\t\t// Numbers → accent.n2.w100 (teal)\n\t\t\t{ tag: [t.number, t.integer, t.float], color: p.accent.n2.w100 },\n\n\t\t\t// Booleans / null / atoms / constants → info.w100 (blue)\n\t\t\t{ tag: [t.bool, t.null, t.atom], color: p.info.w100 },\n\n\t\t\t// Property names, variable names → accent.n1.w100\n\t\t\t{ tag: [t.propertyName, t.variableName], color: p.accent.n1.w100 },\n\n\t\t\t// XML/HTML attribute names → accent.n1.w100\n\t\t\t{ tag: t.attributeName, color: p.accent.n1.w100 },\n\n\t\t\t// XML/HTML tag names → accent.n0.w100 (type color)\n\t\t\t{ tag: t.tagName, color: p.accent.n0.w100 },\n\n\t\t\t// Keywords (syntax, message, import, etc.) → info.w100\n\t\t\t{ tag: [t.keyword, t.definitionKeyword, t.modifier, t.controlKeyword], color: p.info.w100 },\n\n\t\t\t// Function names → accent.n5.w100\n\t\t\t{ tag: [t.function(t.variableName), t.function(t.propertyName)], color: p.accent.n5.w100 },\n\n\t\t\t// Type names, class names → accent.n0.w100\n\t\t\t{ tag: [t.typeName, t.className], color: p.accent.n0.w100 },\n\n\t\t\t// Standard variables (protobuf \"builtin\" token: enum values, service/rpc names) → accent.n5.w100\n\t\t\t{ tag: t.standard(t.variableName), color: p.accent.n5.w100 },\n\n\t\t\t// XML Namespace (xmlns:) → accent.n2.w100 (structural qualifier, same as Number)\n\t\t\t{ tag: t.namespace, color: p.accent.n2.w100 },\n\n\t\t\t// Plain text content (YAML unquoted scalars + XML text between tags) → accent.n9.w100\n\t\t\t// Both YAML Literal and XML Text nodes emit t.content.\n\t\t\t// PDF designer mockup shows some scalars in different colors but parser cannot distinguish them.\n\t\t\t{ tag: t.content, color: p.accent.n9.w100 },\n\n\t\t\t// XML DOCTYPE / processing instructions (<?xml ...?>) → accent.n5.w100 (same as Function)\n\t\t\t{ tag: t.processingInstruction, color: p.accent.n5.w100 },\n\n\t\t\t// Comments → secondary.text.wMain, italic\n\t\t\t{ tag: [t.comment, t.lineComment, t.blockComment], color: p.secondary.text.wMain, fontStyle: \"italic\" },\n\n\t\t\t// Operators, punctuation, angle brackets, delimiters → secondary.w100\n\t\t\t{\n\t\t\t\ttag: [t.operator, t.punctuation, t.angleBracket, t.bracket, t.brace, t.paren, t.separator],\n\t\t\t\tcolor: p.secondary.w100\n\t\t\t}\n\t\t]\n\t});\n\n\t// StreamLanguage (used by the custom protobuf grammar) emits plain CSS class\n\t// names (.cm-keyword, .cm-type, etc.) rather than Lezer highlight tags.\n\t// The createTheme() styles array only handles Lezer tags, so we need a\n\t// separate EditorView.theme() to apply the same token colors to protobuf.\n\t// Pass { dark: isDark } so CM applies this theme in the correct color scheme.\n\tconst streamLanguageTheme = EditorView.theme(\n\t\t{\n\t\t\t\".cm-keyword\": { color: p.info.w100 },\n\t\t\t\".cm-type\": { color: p.accent.n0.w100 },\n\t\t\t\".cm-string\": { color: p.accent.n9.w100 },\n\t\t\t\".cm-number\": { color: p.accent.n2.w100 },\n\t\t\t\".cm-atom\": { color: p.info.w100 },\n\t\t\t\".cm-comment\": { color: p.secondary.text.wMain, fontStyle: \"italic\" },\n\t\t\t\".cm-punctuation\": { color: p.secondary.w100 },\n\t\t\t\".cm-builtin\": { color: p.accent.n5.w100 },\n\t\t\t\".cm-variable\": { color: p.accent.n1.w100 }\n\t\t},\n\t\t{ dark: isDark }\n\t);\n\n\tconst yamlScalarPlugin = buildYamlScalarPlugin(p.accent.n2.w100, p.info.w100);\n\treturn [cm6Theme, streamLanguageTheme, yamlScalarPlugin];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { yaml } from \"@codemirror/lang-yaml\";\nimport { StreamLanguage, StringStream } from \"@codemirror/language\";\n\ntype ProtobufState = {\n\texpectFieldName: boolean;\n\texpectPackageName: boolean;\n\texpectTypeName: boolean;\n\tinBlockComment: boolean;\n};\n\nconst KEYWORDS = /\\b(syntax|rpc|option|import|repeated|optional|required)\\b/;\nconst BUILTIN_TYPES = /\\b(int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double)\\b/;\n\nfunction resetState(state: ProtobufState) {\n\tstate.expectFieldName = false;\n\tstate.expectPackageName = false;\n\tstate.expectTypeName = false;\n}\n\nfunction tokenizeKeyword(stream: StringStream, state: ProtobufState): string | null {\n\tif (stream.match(/\\b(message|enum|service)\\b/)) {\n\t\tresetState(state);\n\t\tstate.expectTypeName = true;\n\t\treturn \"keyword\";\n\t}\n\tif (stream.match(/\\breturns\\b/)) {\n\t\tresetState(state);\n\t\tstate.expectTypeName = true;\n\t\treturn \"keyword\";\n\t}\n\tif (stream.match(KEYWORDS)) {\n\t\tresetState(state);\n\t\treturn \"keyword\";\n\t}\n\tif (stream.match(/\\bpackage\\b/)) {\n\t\tresetState(state);\n\t\tstate.expectPackageName = true;\n\t\treturn \"keyword\";\n\t}\n\treturn null;\n}\n\nfunction tokenizeIdentifier(stream: StringStream, state: ProtobufState): string | null {\n\tif (stream.match(/\\b[A-Z][A-Za-z0-9_]*\\b/)) {\n\t\tconst isType = state.expectTypeName;\n\t\tresetState(state);\n\t\treturn isType ? \"type\" : \"builtin\";\n\t}\n\tif (state.expectPackageName && stream.match(/\\b[a-z][a-zA-Z0-9_.]*\\b/)) {\n\t\tstate.expectPackageName = false;\n\t\treturn \"string\";\n\t}\n\tif (stream.match(/\\b[a-z_][a-zA-Z0-9_]*\\b/)) {\n\t\tif (state.expectFieldName) {\n\t\t\tstate.expectFieldName = false;\n\t\t\treturn \"variable\";\n\t\t}\n\t\treturn null;\n\t}\n\treturn null;\n}\n\nfunction tokenizeComment(stream: StringStream, state: ProtobufState): string | null {\n\tif (state.inBlockComment) {\n\t\twhile (!stream.eol()) {\n\t\t\tif (stream.match(\"*/\")) {\n\t\t\t\tstate.inBlockComment = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstream.next();\n\t\t}\n\t\treturn \"comment\";\n\t}\n\tif (stream.match(\"//\")) {\n\t\tstream.skipToEnd();\n\t\tstate.expectFieldName = false;\n\t\treturn \"comment\";\n\t}\n\tif (stream.match(\"/*\")) {\n\t\twhile (!stream.eol()) {\n\t\t\tif (stream.match(\"*/\")) return \"comment\";\n\t\t\tstream.next();\n\t\t}\n\t\tstate.inBlockComment = true;\n\t\tstate.expectFieldName = false;\n\t\treturn \"comment\";\n\t}\n\treturn null;\n}\n\nfunction tokenizePrimitive(stream: StringStream, state: ProtobufState): string | null {\n\tif (stream.match(/\"(?:[^\"\\\\]|\\\\.)*\"/)) {\n\t\tstate.expectFieldName = false;\n\t\treturn \"string\";\n\t}\n\tif (stream.match(BUILTIN_TYPES)) {\n\t\tstate.expectFieldName = true;\n\t\tstate.expectTypeName = false;\n\t\treturn \"type\";\n\t}\n\tif (stream.match(/\\b(true|false)\\b/)) {\n\t\tstate.expectFieldName = false;\n\t\treturn \"atom\";\n\t}\n\tif (stream.match(/^\\d+(?!\\w)/)) {\n\t\tstate.expectFieldName = false;\n\t\treturn \"number\";\n\t}\n\tif (stream.match(/[{}();,=[\\]]/)) {\n\t\tif (stream.current() === \";\") state.expectFieldName = false;\n\t\treturn \"punctuation\";\n\t}\n\treturn null;\n}\n\n// Custom protobuf support via StreamLanguage (emits CSS class names, not Lezer tags).\n// Colors map via EditorView.theme() in createCodeMirror6Theme.ts.\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\tstartState: (): ProtobufState => ({\n\t\texpectFieldName: false,\n\t\texpectPackageName: false,\n\t\texpectTypeName: false,\n\t\tinBlockComment: false\n\t}),\n\ttoken(stream, state: ProtobufState) {\n\t\tif (stream.eatSpace()) return null;\n\t\treturn (\n\t\t\ttokenizeComment(stream, state) ??\n\t\t\ttokenizePrimitive(stream, state) ??\n\t\t\ttokenizeKeyword(stream, state) ??\n\t\t\ttokenizeIdentifier(stream, state) ??\n\t\t\t(stream.next(), null)\n\t\t);\n\t},\n\tcopyState: (state: ProtobufState) => ({ ...state })\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\" | \"yaml\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"yaml\":\n\t\t\treturn yaml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { linter, lintGutter } from \"@codemirror/lint\";\nimport type { Diagnostic } from \"@codemirror/lint\";\nimport { EditorView } from \"@codemirror/view\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\n\nexport interface ValidationMessage {\n\t/** Character offset of the start of the problematic range in the document */\n\tfrom: number;\n\t/** Character offset of the end of the problematic range in the document */\n\tto: number;\n\t/** Human-readable description of the issue */\n\tmessage: string;\n\t/** Severity level — renders red dot/squiggly for error, yellow dot for warning */\n\tseverity: \"error\" | \"warning\";\n}\n\n/**\n * Creates CodeMirror extensions for inline validation display.\n * Uses @codemirror/lint's linter() + lintGutter() APIs.\n *\n * Gutter column appears after fold gutter:\n * - error → solid red circle dot\n * - warning → solid yellow/orange circle dot\n *\n * Squiggly underlines appear on the problematic character range.\n * Hovering a gutter dot shows the message as a tooltip.\n *\n * @param diagnostics - Pre-computed validation messages with document offsets\n * @param themeMapping - Current theme mapping for colors (no hardcoded values)\n */\nexport function createLintExtension(diagnostics: ValidationMessage[], themeMapping: ThemeMapping): Extension[] {\n\tconst p = themeMapping.palette;\n\n\tconst linterExt = linter((): Diagnostic[] =>\n\t\tdiagnostics.map((d) => ({\n\t\t\tfrom: d.from,\n\t\t\tto: d.to,\n\t\t\tseverity: d.severity,\n\t\t\tmessage: d.message\n\t\t}))\n\t);\n\n\tconst gutterExt = lintGutter();\n\n\t// Override default SVG marker icons with colored circle dots from themeMapping.\n\t// @codemirror/lint sets background-image on .cm-lint-marker-* by default —\n\t// we unset it and replace with a background-color circle.\n\tconst lintTheme = EditorView.theme({\n\t\t// Gutter column background matches other gutters\n\t\t\".cm-gutter-lint\": {\n\t\t\twidth: \"16px\",\n\t\t\tbackgroundColor: p.background.w20,\n\t\t\toverflow: \"hidden\"\n\t\t},\n\t\t// Each gutter cell — flex center the dot both axes\n\t\t\".cm-gutter-lint .cm-gutterElement\": {\n\t\t\tdisplay: \"flex\",\n\t\t\talignItems: \"center\",\n\t\t\tjustifyContent: \"center\",\n\t\t\tpadding: \"0\"\n\t\t},\n\t\t// CM injects its base stylesheet first in <head> — EditorView.theme() injects after,\n\t\t// so equal-specificity rules here win without !important.\n\t\t// Override the default content: url(SVG) with a solid colored circle.\n\t\t\".cm-lint-marker\": {\n\t\t\tcontent: \"none\",\n\t\t\tdisplay: \"block\",\n\t\t\twidth: \"8px\",\n\t\t\theight: \"8px\",\n\t\t\tborderRadius: \"50%\",\n\t\t\tmargin: \"auto\"\n\t\t},\n\t\t\".cm-lint-marker-error\": {\n\t\t\tcontent: \"none\",\n\t\t\tbackground: p.error.w100\n\t\t},\n\t\t\".cm-lint-marker-warning\": {\n\t\t\tcontent: \"none\",\n\t\t\tbackground: p.warning.w100\n\t\t},\n\t\t// Squiggly underline on error range — text-decoration only, no background\n\t\t\".cm-lintRange-error\": {\n\t\t\tbackgroundImage: \"none\",\n\t\t\ttextDecoration: `underline wavy ${p.error.w100}`,\n\t\t\ttextUnderlineOffset: \"2px\"\n\t\t},\n\t\t// Squiggly underline on warning range\n\t\t\".cm-lintRange-warning\": {\n\t\t\tbackgroundImage: \"none\",\n\t\t\ttextDecoration: `underline wavy ${p.warning.w100}`,\n\t\t\ttextUnderlineOffset: \"2px\"\n\t\t},\n\t\t// Hide the outer .cm-tooltip frame when it wraps a lint tooltip — avoids double border/bg.\n\t\t// :has() scopes the reset to lint tooltips only, leaving autocomplete/hover tooltips intact.\n\t\t\".cm-tooltip:has(.cm-tooltip-lint)\": {\n\t\t\tborder: \"none\",\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tboxShadow: \"none\"\n\t\t},\n\t\t// Styled lint tooltip shell — the inner <ul class=\"cm-tooltip-lint\">\n\t\t\".cm-tooltip-lint\": {\n\t\t\tbackgroundColor: p.background.w10,\n\t\t\tborder: `1px solid ${p.secondary.w40}`,\n\t\t\tborderRadius: \"4px\",\n\t\t\tpadding: \"4px 8px\",\n\t\t\tfontSize: \"12px\",\n\t\t\tcolor: p.secondary.text.wMain,\n\t\t\tboxShadow: `0 2px 8px ${p.secondary.w20}`\n\t\t}\n\t});\n\n\treturn [linterExt, gutterExt, lintTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { styled } from \"@mui/material\";\nimport { Error16Icon, Warning16Icon } from \"@SolaceDev/maas-icons\";\nimport { ValidationMessage } from \"../../utils/codeMirrorLinting\";\n\nconst StyledValidationBanner = styled(\"div\", {\n\tshouldForwardProp: (prop) => prop !== \"severity\"\n})<{ severity: \"error\" | \"warning\" }>(({ theme, severity }) => ({\n\tdisplay: \"flex\",\n\talignItems: \"flex-start\",\n\tgap: theme.spacing(1),\n\tpadding: theme.spacing(1, 1.5),\n\tfontSize: theme.typography.body1.fontSize,\n\tlineHeight: theme.typography.body1.lineHeight,\n\tbackgroundColor: severity === \"error\" ? theme.palette.ux.error.w10 : theme.palette.ux.warning.w10,\n\tborderBottom:\n\t\tseverity === \"error\" ? `1px solid ${theme.palette.ux.error.w30}` : `1px solid ${theme.palette.ux.warning.w30}`,\n\tcolor: severity === \"error\" ? theme.palette.ux.error.w100 : theme.palette.ux.warning.w100\n}));\n\nexport interface CodeEditorValidationBannerProps {\n\tvalidationMessages: ValidationMessage[];\n\tdoc: string;\n}\n\nconst joinLineNumbers = (sorted: number[]): string => {\n\tconst last = sorted[sorted.length - 1];\n\tconst rest = sorted.slice(0, -1);\n\tif (rest.length === 1) return `${rest[0]} and ${last}`;\n\treturn `${rest.join(\", \")}, and ${last}`;\n};\n\nconst buildBannerMessage = (messages: ValidationMessage[], doc: string, severity: \"error\" | \"warning\"): string => {\n\tconst filtered = messages.filter((m) => m.severity === severity);\n\tif (filtered.length === 0) return \"\";\n\n\t// Precompute newline offsets once, then binary-search per message — O(n + m log n)\n\t// instead of O(n*m) from repeated doc.substring().split(\"\\n\").\n\tconst newlines: number[] = [];\n\tfor (let i = 0; i < doc.length; i++) {\n\t\tif (doc[i] === \"\\n\") newlines.push(i);\n\t}\n\tconst offsetToLine = (offset: number): number => {\n\t\tlet lo = 0,\n\t\t\thi = newlines.length;\n\t\twhile (lo < hi) {\n\t\t\tconst mid = (lo + hi) >> 1;\n\t\t\tif (newlines[mid] < offset) lo = mid + 1;\n\t\t\telse hi = mid;\n\t\t}\n\t\treturn lo + 1; // 1-based line number\n\t};\n\n\tconst lines = new Set<number>();\n\tfiltered.forEach((m) => {\n\t\tlines.add(offsetToLine(m.from));\n\t});\n\n\tconst sortedLines = Array.from(lines).sort((a, b) => a - b);\n\tconst label = severity === \"error\" ? \"error\" : \"warning\";\n\tconst plural = filtered.length > 1 ? \"s\" : \"\";\n\tconst prefix = severity === \"error\" ? \"Invalid syntax.\" : \"Invalid schema.\";\n\n\tif (sortedLines.length === 1) {\n\t\treturn `${prefix} Fix ${label}${plural} on line ${sortedLines[0]}.`;\n\t}\n\treturn `${prefix} Fix ${label}${plural} in lines ${joinLineNumbers(sortedLines)}.`;\n};\n\nconst CodeEditorValidationBanner = ({\n\tvalidationMessages,\n\tdoc\n}: CodeEditorValidationBannerProps): JSX.Element | null => {\n\tconst hasErrors = validationMessages.some((m) => m.severity === \"error\");\n\tconst hasWarnings = validationMessages.some((m) => m.severity === \"warning\");\n\tif (hasErrors) {\n\t\treturn (\n\t\t\t<StyledValidationBanner severity=\"error\" role=\"alert\" aria-live=\"assertive\">\n\t\t\t\t<Error16Icon sx={{ flexShrink: 0 }} />\n\t\t\t\t<span>{buildBannerMessage(validationMessages, doc, \"error\")}</span>\n\t\t\t</StyledValidationBanner>\n\t\t);\n\t}\n\tif (hasWarnings) {\n\t\treturn (\n\t\t\t<StyledValidationBanner severity=\"warning\" role=\"status\" aria-live=\"polite\">\n\t\t\t\t<Warning16Icon sx={{ flexShrink: 0 }} />\n\t\t\t\t<span>{buildBannerMessage(validationMessages, doc, \"warning\")}</span>\n\t\t\t</StyledValidationBanner>\n\t\t);\n\t}\n\treturn null;\n};\n\nexport default CodeEditorValidationBanner;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport { createLintExtension, ValidationMessage } from \"../../utils/codeMirrorLinting\";\nimport getThemeMappings, { appTheme } from \"../../theming/themeUtils\";\nimport { SupportedThemes } from \"../../types/supportedThemes\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\nimport CodeEditorValidationBanner from \"./CodeEditorValidationBanner\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\nexport type { ValidationMessage };\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")<{ customHeight?: string }>(({ theme, customHeight }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties),\n\t...(customHeight && {\n\t\t// Flex column: banner takes natural height, .cm-theme fills the remaining space.\n\t\theight: customHeight === \"auto\" ? \"auto\" : `${customHeight} !important`,\n\t\tdisplay: \"flex\",\n\t\tflexDirection: \"column\",\n\t\t\"& .cm-theme\": {\n\t\t\tflex: customHeight === \"auto\" ? \"unset\" : \"1 1 0\",\n\t\t\tminHeight: customHeight === \"auto\" ? \"unset\" : \"0\",\n\t\t\t...(customHeight === \"auto\" && { height: \"auto\" })\n\t\t},\n\t\t\"& .cm-editor\": {\n\t\t\theight: customHeight === \"auto\" ? \"auto !important\" : \"100% !important\"\n\t\t},\n\t\t\"& .cm-editor .cm-scroller\": {\n\t\t\t...(customHeight === \"auto\" ? { maxHeight: \"none !important\" } : {})\n\t\t}\n\t})\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\" | \"yaml\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Height of the code editor. Can be a number (in pixels) or a string (e.g., '300px', '100%')\n\t * @default '300px'\n\t */\n\theight?: string | number;\n\t/**\n\t * Inline validation messages shown as squiggly underlines on the affected range\n\t * and as colored dots in the gutter (red = error, yellow/orange = warning).\n\t * Hovering a gutter dot shows the message as a tooltip.\n\t * A banner is shown above the editor when error or warning messages are present.\n\t * Each message requires character offsets (from/to) within the document string.\n\t */\n\tvalidationMessages?: ValidationMessage[];\n\t/**\n\t * Callback fired whenever the set of validationMessages changes.\n\t * Notifies parent components of the current validation state so they can\n\t * update tab indicators, form submit buttons, or other external UI.\n\t */\n\tonValidationChange?: (hasErrors: boolean, hasWarnings: boolean) => void;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\theight,\n\tvalidationMessages = [],\n\tonValidationChange,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Notify parent whenever validationMessages change\n\tuseEffect(() => {\n\t\tif (onValidationChange) {\n\t\t\tconst hasErr = validationMessages.some((m) => m.severity === \"error\");\n\t\t\tconst hasWarn = validationMessages.some((m) => m.severity === \"warning\");\n\t\t\tonValidationChange(hasErr, hasWarn);\n\t\t}\n\t}, [validationMessages, onValidationChange]);\n\n\tconst isDark = appTheme === SupportedThemes.solaceDark;\n\n\t// Full structural theme always applied (background, font, gutter, selection).\n\t// In read-only mode an extra override forces all text to secondary.text.wMain (grey, no syntax colors per UX spec).\n\t// In editable mode: full syntax theme with colors.\n\tconst readOnlyOverride = useMemo(\n\t\t() =>\n\t\t\tEditorView.theme({\n\t\t\t\t\"&\": { color: themeMapping.palette.secondary.text.wMain },\n\t\t\t\t\"& .cm-content *\": { color: `${themeMapping.palette.secondary.text.wMain} !important` }\n\t\t\t}),\n\t\t[themeMapping]\n\t);\n\tconst cm6Theme = useMemo(\n\t\t() =>\n\t\t\treadOnly\n\t\t\t\t? [...createCodeMirror6Theme(themeMapping, isDark), readOnlyOverride]\n\t\t\t\t: createCodeMirror6Theme(themeMapping, isDark),\n\t\t[themeMapping, isDark, readOnly, readOnlyOverride]\n\t);\n\n\t// In read-only mode: no language extension (no syntax parsing/highlighting per UX spec — plain grey text).\n\t// Lint extensions are only added in editable mode when validationMessages are provided.\n\t// In read-only mode the validation banner still renders, but inline underlines/gutter dots are suppressed.\n\tconst extensions = useMemo(\n\t\t() =>\n\t\t\treadOnly\n\t\t\t\t? [EditorView.lineWrapping, keymap.of(defaultKeymap)]\n\t\t\t\t: [\n\t\t\t\t\t\tgetLanguageExtension(mode),\n\t\t\t\t\t\tEditorView.lineWrapping,\n\t\t\t\t\t\tkeymap.of(defaultKeymap),\n\t\t\t\t\t\t...(validationMessages.length > 0 ? createLintExtension(validationMessages, themeMapping) : [])\n\t\t\t\t\t],\n\t\t[mode, readOnly, validationMessages, themeMapping]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\t// Convert height prop to string format for CodeMirror\n\tconst cmHeight = height ? (typeof height === \"number\" ? `${height}px` : height) : \"300px\";\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// Validation banner — shown above editor when error or warning messages exist\n\tconst validationBanner = <CodeEditorValidationBanner validationMessages={validationMessages} doc={val} />;\n\n\tconst editorContent = (\n\t\t<>\n\t\t\t{validationBanner}\n\t\t\t<CodeMirror\n\t\t\t\tvalue={val}\n\t\t\t\tonChange={handleChange}\n\t\t\t\textensions={extensions}\n\t\t\t\ttheme={cm6Theme}\n\t\t\t\theight={cmHeight}\n\t\t\t\teditable={!readOnly}\n\t\t\t\tbasicSetup={{\n\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\tautocompletion: true,\n\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\tsearchKeymap: true\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{editorContent}\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tcustomHeight={cmHeight}\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{editorContent}\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solace-ui-components",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.14",
|
|
4
4
|
"description": "React component library designed for Solace.",
|
|
5
5
|
"author": "Solace",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@codemirror/lang-xml": "^6.1.0",
|
|
58
58
|
"@codemirror/lang-yaml": "^6.1.2",
|
|
59
59
|
"@codemirror/language": "^6.11.3",
|
|
60
|
+
"@codemirror/lint": "^6.9.5",
|
|
60
61
|
"@codemirror/state": "^6.0.0",
|
|
61
62
|
"@codemirror/view": "^6.38.1",
|
|
62
63
|
"@hello-pangea/dnd": "^16.6.0",
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
"@rjsf/mui": "5.24.13",
|
|
67
68
|
"@rjsf/utils": "5.24.13",
|
|
68
69
|
"@rjsf/validator-ajv8": "5.24.13",
|
|
70
|
+
"@uiw/codemirror-themes": "^4.25.9",
|
|
69
71
|
"@uiw/react-codemirror": "^4.25.1",
|
|
70
72
|
"diff": "^8.0.2",
|
|
71
73
|
"lodash": "^4.17.21",
|
|
@@ -92,6 +94,9 @@
|
|
|
92
94
|
"@codemirror/language": {
|
|
93
95
|
"optional": true
|
|
94
96
|
},
|
|
97
|
+
"@codemirror/lint": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
95
100
|
"@codemirror/state": {
|
|
96
101
|
"optional": true
|
|
97
102
|
},
|
|
@@ -104,6 +109,9 @@
|
|
|
104
109
|
"@lezer/highlight": {
|
|
105
110
|
"optional": true
|
|
106
111
|
},
|
|
112
|
+
"@uiw/codemirror-themes": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
107
115
|
"diff": {
|
|
108
116
|
"optional": true
|
|
109
117
|
},
|
|
@@ -153,6 +161,7 @@
|
|
|
153
161
|
"@codemirror/lang-xml": "^6.1.0",
|
|
154
162
|
"@codemirror/lang-yaml": "^6.1.2",
|
|
155
163
|
"@codemirror/language": "^6.11.3",
|
|
164
|
+
"@codemirror/lint": "^6.9.5",
|
|
156
165
|
"@codemirror/state": "^6.5.4",
|
|
157
166
|
"@codemirror/view": "^6.38.1",
|
|
158
167
|
"@hello-pangea/dnd": "^16.6.0",
|
|
@@ -177,6 +186,7 @@
|
|
|
177
186
|
"@types/react-window": "^1.8.5",
|
|
178
187
|
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
179
188
|
"@typescript-eslint/parser": "^6.9.1",
|
|
189
|
+
"@uiw/codemirror-themes": "^4.25.9",
|
|
180
190
|
"@uiw/react-codemirror": "^4.25.1",
|
|
181
191
|
"attr-accept": "^2.2.2",
|
|
182
192
|
"babel-eslint": "^10.1.0",
|