solace-ui-components 18.0.0 → 18.0.1
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
|
@@ -22,7 +22,7 @@ interface SolaceCodeEditorProps extends SolaceComponentProps {
|
|
|
22
22
|
/**
|
|
23
23
|
* The formatting style to render the content as
|
|
24
24
|
*/
|
|
25
|
-
mode?: "json" | "xml" | "protobuf";
|
|
25
|
+
mode?: "json" | "xml" | "protobuf" | "yaml";
|
|
26
26
|
/**
|
|
27
27
|
* Content to display as supportive/explanitory text
|
|
28
28
|
*/
|
|
@@ -39,11 +39,16 @@ interface SolaceCodeEditorProps extends SolaceComponentProps {
|
|
|
39
39
|
* whether to allow CodeEditor to be expandable
|
|
40
40
|
*/
|
|
41
41
|
expandable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Height of the code editor. Can be a number (in pixels) or a string (e.g., '300px', '100%')
|
|
44
|
+
* @default '300px'
|
|
45
|
+
*/
|
|
46
|
+
height?: string | number;
|
|
42
47
|
/**
|
|
43
48
|
* Callback function to trigger whenever the value of the `input` is changed
|
|
44
49
|
*/
|
|
45
50
|
onChange?: (editor: any, data: any, value: string) => void;
|
|
46
51
|
}
|
|
47
|
-
declare function SolaceCodeEditor({ mode, value, readOnly, expandable, fullScreen, helperText, hasErrors, hasWarnings, onChange }: SolaceCodeEditorProps): JSX.Element;
|
|
52
|
+
declare function SolaceCodeEditor({ mode, value, readOnly, expandable, fullScreen, helperText, hasErrors, hasWarnings, height, onChange }: SolaceCodeEditorProps): JSX.Element;
|
|
48
53
|
|
|
49
54
|
export { SolaceCodeEditor };
|
package/dist/code-editor.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ interface SolaceCodeEditorProps extends SolaceComponentProps {
|
|
|
22
22
|
/**
|
|
23
23
|
* The formatting style to render the content as
|
|
24
24
|
*/
|
|
25
|
-
mode?: "json" | "xml" | "protobuf";
|
|
25
|
+
mode?: "json" | "xml" | "protobuf" | "yaml";
|
|
26
26
|
/**
|
|
27
27
|
* Content to display as supportive/explanitory text
|
|
28
28
|
*/
|
|
@@ -39,11 +39,16 @@ interface SolaceCodeEditorProps extends SolaceComponentProps {
|
|
|
39
39
|
* whether to allow CodeEditor to be expandable
|
|
40
40
|
*/
|
|
41
41
|
expandable?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Height of the code editor. Can be a number (in pixels) or a string (e.g., '300px', '100%')
|
|
44
|
+
* @default '300px'
|
|
45
|
+
*/
|
|
46
|
+
height?: string | number;
|
|
42
47
|
/**
|
|
43
48
|
* Callback function to trigger whenever the value of the `input` is changed
|
|
44
49
|
*/
|
|
45
50
|
onChange?: (editor: any, data: any, value: string) => void;
|
|
46
51
|
}
|
|
47
|
-
declare function SolaceCodeEditor({ mode, value, readOnly, expandable, fullScreen, helperText, hasErrors, hasWarnings, onChange }: SolaceCodeEditorProps): JSX.Element;
|
|
52
|
+
declare function SolaceCodeEditor({ mode, value, readOnly, expandable, fullScreen, helperText, hasErrors, hasWarnings, height, onChange }: SolaceCodeEditorProps): JSX.Element;
|
|
48
53
|
|
|
49
54
|
export { SolaceCodeEditor };
|
package/dist/code-editor.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var chunkAOKITPX2_js=require('./chunk-AOKITPX2.js'),chunk7SKICMGL_js=require('./chunk-7SKICMGL.js'),chunk4XH33OL7_js=require('./chunk-4XH33OL7.js'),react=require('react'),
|
|
2
|
-
exports.SolaceCodeEditor=
|
|
1
|
+
'use strict';var chunkAOKITPX2_js=require('./chunk-AOKITPX2.js'),chunk7SKICMGL_js=require('./chunk-7SKICMGL.js'),chunk4XH33OL7_js=require('./chunk-4XH33OL7.js'),react=require('react'),R=require('@uiw/react-codemirror'),view=require('@codemirror/view'),commands=require('@codemirror/commands'),language=require('@codemirror/language'),highlight=require('@lezer/highlight'),langJson=require('@codemirror/lang-json'),langXml=require('@codemirror/lang-xml'),langYaml=require('@codemirror/lang-yaml'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var R__default=/*#__PURE__*/_interopDefault(R);function T(o){let e="rgb(119, 0, 136)",a=language.HighlightStyle.define([{tag:highlight.tags.string,color:o.palette.error.w100},{tag:highlight.tags.special(highlight.tags.string),color:o.palette.error.w100},{tag:highlight.tags.character,color:o.palette.error.w100},{tag:highlight.tags.regexp,color:o.palette.error.w100},{tag:highlight.tags.number,color:o.palette.success.w100},{tag:highlight.tags.integer,color:o.palette.success.w100},{tag:highlight.tags.float,color:o.palette.success.w100},{tag:highlight.tags.bool,color:o.palette.info.w100},{tag:highlight.tags.null,color:o.palette.info.w100},{tag:highlight.tags.atom,color:o.palette.info.w100},{tag:highlight.tags.propertyName,color:o.palette.secondary.text.wMain},{tag:highlight.tags.attributeName,color:o.palette.info.w100},{tag:highlight.tags.attributeValue,color:o.palette.error.w100},{tag:highlight.tags.tagName,color:o.palette.success.w100},{tag:highlight.tags.angleBracket,color:o.palette.success.w100},{tag:highlight.tags.keyword,color:e},{tag:highlight.tags.definitionKeyword,color:e},{tag:highlight.tags.modifier,color:e},{tag:highlight.tags.controlKeyword,color:e},{tag:highlight.tags.operator,color:o.palette.secondary.text.wMain},{tag:highlight.tags.punctuation,color:o.palette.secondary.text.wMain},{tag:highlight.tags.bracket,color:o.palette.secondary.text.wMain},{tag:highlight.tags.brace,color:o.palette.secondary.text.wMain},{tag:highlight.tags.paren,color:o.palette.secondary.text.wMain},{tag:highlight.tags.comment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:highlight.tags.lineComment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:highlight.tags.blockComment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:highlight.tags.typeName,color:e},{tag:highlight.tags.className,color:o.palette.secondary.text.wMain},{tag:highlight.tags.namespace,color:o.palette.secondary.text.wMain},{tag:highlight.tags.variableName,color:o.palette.secondary.text.wMain},{tag:highlight.tags.function(highlight.tags.variableName),color:o.palette.secondary.text.wMain},{tag:highlight.tags.definition(highlight.tags.variableName),color:o.palette.secondary.text.wMain},{tag:highlight.tags.name,color:o.palette.secondary.text.wMain}]),i=view.EditorView.theme({"&":{fontSize:`${chunk4XH33OL7_js.ni.sm}px`,fontFamily:"Consolas, 'Liberation Mono', Menlo, Courier, monospace",lineHeight:"normal"},".cm-content":{padding:"4px 2px",lineHeight:"normal"},".cm-focused":{outline:"none"},".cm-gutters":{backgroundColor:o.palette.background.w20,borderRight:`1px solid ${o.palette.secondary.w40}`,color:o.palette.secondary.text.wMain,fontSize:`${chunk4XH33OL7_js.ni.sm}px`,lineHeight:"normal"},".cm-activeLineGutter":{backgroundColor:"transparent"},".cm-cursor":{borderLeftColor:o.palette.secondary.wMain},".cm-selectionBackground":{backgroundColor:`${o.palette.brand.wMain}30`},"&.cm-focused .cm-selectionBackground":{backgroundColor:`${o.palette.brand.wMain}30`},".cm-matchingBracket":{color:o.palette.success.w100,backgroundColor:"transparent",fontWeight:"bold"}});return [language.syntaxHighlighting(a),i]}var oo=language.StreamLanguage.define({name:"protobuf",token(o){return o.match(/message|service|rpc|enum|option|import|package/)?"keyword":o.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)?"type":o.match(/"[^"]*"/)?"string":o.match(/\d+/)?"number":(o.next(),null)}}),_=o=>{switch(o){case "json":return langJson.json();case "xml":return langXml.xml();case "yaml":return langYaml.yaml();case "protobuf":return oo;default:return langJson.json()}};var to=({size:o,fill:e})=>jsxRuntime.jsx(chunk4XH33OL7_js.Na,{sx:{width:`${o}px`,height:`${o}px`,fill:"none"},viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z",fill:e})}),J=to;var eo=({size:o,fill:e})=>jsxRuntime.jsxs(chunk4XH33OL7_js.Na,{sx:{width:`${o}px`,height:`${o}px`,fill:"none"},viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z",fill:e}),jsxRuntime.jsx("path",{d:"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z",fill:e})]}),Z=eo;var io=chunk4XH33OL7_js.wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.OuterWrapper})),co=chunk4XH33OL7_js.wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.InnerWrapper})),j=chunk4XH33OL7_js.wa("div")(({theme:o,customHeight:e})=>({...o.mixins.formComponent_CodeEditor.EditorWrapper,...e&&{height:`${e} !important`,"& .cm-theme":{height:`${e} !important`},"& .cm-editor":{height:`${e} !important`},"& .cm-editor .cm-scroller":{maxHeight:`${e} !important`}}})),so=chunk4XH33OL7_js.wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.IconWrapper})),z=(o,e,a)=>e?jsxRuntime.jsx(chunk7SKICMGL_js.e,{children:o}):a?jsxRuntime.jsx(chunk7SKICMGL_js.g,{children:o}):jsxRuntime.jsx(chunk7SKICMGL_js.c,{children:o});function mo({mode:o="json",value:e,readOnly:a=false,expandable:i=false,fullScreen:m=false,helperText:c="",hasErrors:C=false,hasWarnings:x=false,height:s,onChange:y}){let b=chunk4XH33OL7_js.ua(),S=chunk4XH33OL7_js.qi(),[w,E]=react.useState(e||""),[n,L]=react.useState(m||false);react.useEffect(()=>{e!==void 0&&E(e);},[e]),react.useEffect(()=>{L(m);},[m]);let h=react.useMemo(()=>T(S),[S]),k=react.useMemo(()=>[_(o),view.EditorView.lineWrapping,view.keymap.of(commands.defaultKeymap)],[o]),v=I=>{E(I),y&&y(null,null,I);},p=s?typeof s=="number"?`${s}px`:s:"300px",H=()=>{L(!n);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i&&jsxRuntime.jsx(io,{className:n?"codeEditor-expanded--backdrop":"",children:jsxRuntime.jsxs(co,{className:n?"codeEditor-expanded--main":"",children:[jsxRuntime.jsx(so,{className:n?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:n?jsxRuntime.jsx(chunkAOKITPX2_js.b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:H,title:"Collapse",children:jsxRuntime.jsx(Z,{fill:b.palette.ux.secondary.wMain,size:24})}):jsxRuntime.jsx(chunkAOKITPX2_js.b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:H,title:"Expand",children:jsxRuntime.jsx(J,{fill:b.palette.ux.secondary.wMain,size:24})})}),jsxRuntime.jsx(j,{customHeight:p,className:`${n?"":"codeEditor-border"} ${a?"codeEditor-readonly":""}`,children:jsxRuntime.jsx(R__default.default,{value:w,onChange:v,extensions:k,theme:h,height:p,editable:!a,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})}),c&&z(c,C,x)]})}),!i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(j,{customHeight:p,className:`${n?"":"codeEditor-border"} ${a?"codeEditor-readonly":""}`,children:jsxRuntime.jsx(R__default.default,{value:w,onChange:v,extensions:k,theme:h,editable:!a,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})}),c&&z(c,C,x)]})]})}var po=mo;
|
|
2
|
+
exports.SolaceCodeEditor=po;//# sourceMappingURL=code-editor.js.map
|
|
3
3
|
//# sourceMappingURL=code-editor.js.map
|
package/dist/code-editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"8lBAuBO,SAASA,CAAAA,CAAuBC,CAAAA,CAAyC,CAE/E,IAAMC,CAAAA,CAAkB,kBAAA,CAGlBC,CAAAA,CAAiBC,uBAAAA,CAAe,MAAA,CAAO,CAE5C,CAAE,GAAA,CAAKC,cAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACxD,CAAE,GAAA,CAAKI,cAAA,CAAE,OAAA,CAAQA,cAAA,CAAE,MAAM,CAAA,CAAG,MAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CACnE,CAAE,GAAA,CAAKI,cAAA,CAAE,SAAA,CAAW,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CAC3D,CAAE,IAAKI,cAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,KAAA,CAAM,IAAK,CAAA,CAGxD,CAAE,GAAA,CAAKI,cAAA,CAAE,MAAA,CAAQ,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,EAC1D,CAAE,GAAA,CAAKI,cAAA,CAAE,OAAA,CAAS,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAC3D,CAAE,GAAA,CAAKI,cAAA,CAAE,KAAA,CAAO,KAAA,CAAOJ,CAAAA,CAAa,QAAQ,OAAA,CAAQ,IAAK,CAAA,CAGzD,CAAE,GAAA,C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CAAAqC,mBAAAA,CAAA,CACC,QAAA,CAAA,CAAAzC,cAAAA,CAACU,CAAAA,CAAA,CACA,SAAA,CAAW,CAAA,EAAIoB,EAAuC,EAAA,CAAtB,mBAAwB,CAAA,CAAA,EAAIT,CAAAA,CAAW,qBAAA,CAAwB,EAAE,CAAA,CAAA,CAEjG,QAAA,CAAArB,eAAC2C,kBAAAA,CAAA,CACA,KAAA,CAAOhB,CAAAA,CACP,QAAA,CAAUW,CAAAA,CACV,UAAA,CAAYH,CAAAA,CACZ,MAAOF,CAAAA,CACP,QAAA,CAAU,CAACZ,CAAAA,CACX,UAAA,CAAY,CACX,WAAA,CAAa,IAAA,CACb,UAAA,CAAY,IAAA,CACZ,eAAA,CAAiB,IAAA,CACjB,aAAA,CAAe,IAAA,CACf,cAAA,CAAgB,IAAA,CAChB,qBAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,YAAA,CAAc,IACf,CAAA,CACD,CAAA,CACD,CAAA,CACCR,GAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO6B,EAAAA,CAAQzB","file":"code-editor.js","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping): Extension[] {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties)\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
1
|
+
{"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,CA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ACD,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,3 +1,3 @@
|
|
|
1
|
-
import {b}from'./chunk-HLXBN2OE.modern.mjs';import {e,g,c}from'./chunk-ULYCLLUO.modern.mjs';import {wa,ua,qi,ni,Na}from'./chunk-IHSXSGCC.modern.mjs';import {useState,useEffect,useMemo}from'react';import
|
|
2
|
-
export{
|
|
1
|
+
import {b}from'./chunk-HLXBN2OE.modern.mjs';import {e,g,c}from'./chunk-ULYCLLUO.modern.mjs';import {wa,ua,qi,ni,Na}from'./chunk-IHSXSGCC.modern.mjs';import {useState,useEffect,useMemo}from'react';import R from'@uiw/react-codemirror';import {EditorView,keymap}from'@codemirror/view';import {defaultKeymap}from'@codemirror/commands';import {StreamLanguage,HighlightStyle,syntaxHighlighting}from'@codemirror/language';import {tags}from'@lezer/highlight';import {json}from'@codemirror/lang-json';import {xml}from'@codemirror/lang-xml';import {yaml}from'@codemirror/lang-yaml';import {jsxs,Fragment,jsx}from'react/jsx-runtime';function T(o){let e="rgb(119, 0, 136)",a=HighlightStyle.define([{tag:tags.string,color:o.palette.error.w100},{tag:tags.special(tags.string),color:o.palette.error.w100},{tag:tags.character,color:o.palette.error.w100},{tag:tags.regexp,color:o.palette.error.w100},{tag:tags.number,color:o.palette.success.w100},{tag:tags.integer,color:o.palette.success.w100},{tag:tags.float,color:o.palette.success.w100},{tag:tags.bool,color:o.palette.info.w100},{tag:tags.null,color:o.palette.info.w100},{tag:tags.atom,color:o.palette.info.w100},{tag:tags.propertyName,color:o.palette.secondary.text.wMain},{tag:tags.attributeName,color:o.palette.info.w100},{tag:tags.attributeValue,color:o.palette.error.w100},{tag:tags.tagName,color:o.palette.success.w100},{tag:tags.angleBracket,color:o.palette.success.w100},{tag:tags.keyword,color:e},{tag:tags.definitionKeyword,color:e},{tag:tags.modifier,color:e},{tag:tags.controlKeyword,color:e},{tag:tags.operator,color:o.palette.secondary.text.wMain},{tag:tags.punctuation,color:o.palette.secondary.text.wMain},{tag:tags.bracket,color:o.palette.secondary.text.wMain},{tag:tags.brace,color:o.palette.secondary.text.wMain},{tag:tags.paren,color:o.palette.secondary.text.wMain},{tag:tags.comment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:tags.lineComment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:tags.blockComment,color:o.palette.secondary.w70,fontStyle:"italic"},{tag:tags.typeName,color:e},{tag:tags.className,color:o.palette.secondary.text.wMain},{tag:tags.namespace,color:o.palette.secondary.text.wMain},{tag:tags.variableName,color:o.palette.secondary.text.wMain},{tag:tags.function(tags.variableName),color:o.palette.secondary.text.wMain},{tag:tags.definition(tags.variableName),color:o.palette.secondary.text.wMain},{tag:tags.name,color:o.palette.secondary.text.wMain}]),i=EditorView.theme({"&":{fontSize:`${ni.sm}px`,fontFamily:"Consolas, 'Liberation Mono', Menlo, Courier, monospace",lineHeight:"normal"},".cm-content":{padding:"4px 2px",lineHeight:"normal"},".cm-focused":{outline:"none"},".cm-gutters":{backgroundColor:o.palette.background.w20,borderRight:`1px solid ${o.palette.secondary.w40}`,color:o.palette.secondary.text.wMain,fontSize:`${ni.sm}px`,lineHeight:"normal"},".cm-activeLineGutter":{backgroundColor:"transparent"},".cm-cursor":{borderLeftColor:o.palette.secondary.wMain},".cm-selectionBackground":{backgroundColor:`${o.palette.brand.wMain}30`},"&.cm-focused .cm-selectionBackground":{backgroundColor:`${o.palette.brand.wMain}30`},".cm-matchingBracket":{color:o.palette.success.w100,backgroundColor:"transparent",fontWeight:"bold"}});return [syntaxHighlighting(a),i]}var oo=StreamLanguage.define({name:"protobuf",token(o){return o.match(/message|service|rpc|enum|option|import|package/)?"keyword":o.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)?"type":o.match(/"[^"]*"/)?"string":o.match(/\d+/)?"number":(o.next(),null)}}),_=o=>{switch(o){case "json":return json();case "xml":return xml();case "yaml":return yaml();case "protobuf":return oo;default:return json()}};var to=({size:o,fill:e})=>jsx(Na,{sx:{width:`${o}px`,height:`${o}px`,fill:"none"},viewBox:"0 0 24 24",children:jsx("path",{d:"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z",fill:e})}),J=to;var eo=({size:o,fill:e})=>jsxs(Na,{sx:{width:`${o}px`,height:`${o}px`,fill:"none"},viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z",fill:e}),jsx("path",{d:"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z",fill:e})]}),Z=eo;var io=wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.OuterWrapper})),co=wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.InnerWrapper})),j=wa("div")(({theme:o,customHeight:e})=>({...o.mixins.formComponent_CodeEditor.EditorWrapper,...e&&{height:`${e} !important`,"& .cm-theme":{height:`${e} !important`},"& .cm-editor":{height:`${e} !important`},"& .cm-editor .cm-scroller":{maxHeight:`${e} !important`}}})),so=wa("div")(({theme:o})=>({...o.mixins.formComponent_CodeEditor.IconWrapper})),z=(o,e$1,a)=>e$1?jsx(e,{children:o}):a?jsx(g,{children:o}):jsx(c,{children:o});function mo({mode:o="json",value:e,readOnly:a=false,expandable:i=false,fullScreen:m=false,helperText:c="",hasErrors:C=false,hasWarnings:x=false,height:s,onChange:y}){let b$1=ua(),S=qi(),[w,E]=useState(e||""),[n,L]=useState(m||false);useEffect(()=>{e!==void 0&&E(e);},[e]),useEffect(()=>{L(m);},[m]);let h=useMemo(()=>T(S),[S]),k=useMemo(()=>[_(o),EditorView.lineWrapping,keymap.of(defaultKeymap)],[o]),v=I=>{E(I),y&&y(null,null,I);},p=s?typeof s=="number"?`${s}px`:s:"300px",H=()=>{L(!n);};return jsxs(Fragment,{children:[i&&jsx(io,{className:n?"codeEditor-expanded--backdrop":"",children:jsxs(co,{className:n?"codeEditor-expanded--main":"",children:[jsx(so,{className:n?"codeEditor-expanded--icon":"codeEditor-collapsed--icon",children:n?jsx(b,{variant:"icon",dataQa:"buttonCollapseCodeEditor",onClick:H,title:"Collapse",children:jsx(Z,{fill:b$1.palette.ux.secondary.wMain,size:24})}):jsx(b,{variant:"icon",dataQa:"buttonExpandCodeEditor",onClick:H,title:"Expand",children:jsx(J,{fill:b$1.palette.ux.secondary.wMain,size:24})})}),jsx(j,{customHeight:p,className:`${n?"":"codeEditor-border"} ${a?"codeEditor-readonly":""}`,children:jsx(R,{value:w,onChange:v,extensions:k,theme:h,height:p,editable:!a,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})}),c&&z(c,C,x)]})}),!i&&jsxs(Fragment,{children:[jsx(j,{customHeight:p,className:`${n?"":"codeEditor-border"} ${a?"codeEditor-readonly":""}`,children:jsx(R,{value:w,onChange:v,extensions:k,theme:h,editable:!a,basicSetup:{lineNumbers:true,foldGutter:true,bracketMatching:true,closeBrackets:true,autocompletion:true,rectangularSelection:false,highlightSelectionMatches:false,searchKeymap:true}})}),c&&z(c,C,x)]})]})}var po=mo;
|
|
2
|
+
export{po as SolaceCodeEditor};//# sourceMappingURL=code-editor.modern.mjs.map
|
|
3
3
|
//# sourceMappingURL=code-editor.modern.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/createCodeMirror6Theme.ts","../src/utils/codeMirrorLanguages.ts","../src/resources/icons/ExpandIcon.tsx","../src/resources/icons/CollapseIcon.tsx","../src/components/form/SolaceCodeEditor.tsx"],"names":["createCodeMirror6Theme","themeMapping","PROTOBUF_PURPLE","highlightStyle","HighlightStyle","t","editorTheme","EditorView","BASE_FONT_PX_SIZES","syntaxHighlighting","protobufLanguage","StreamLanguage","stream","getLanguageExtension","mode","json","xml","ExpandIcon","size","fill","jsx","SvgIcon_default","ExpandIcon_default","CollapseIcon","jsxs","CollapseIcon_default","StyledOuterWrapper","styled_default","theme","StyledInnerWrapper","StyledEditorWrapper","IconWrapper","renderHelperText","helperText","hasErrors","hasWarnings","ErrorText_default","WarningText_default","HelperText_default","SolaceCodeEditor","value","readOnly","expandable","fullScreen","onChange","useTheme","themeUtils_default","val","setVal","useState","editorExpanded","setEditorExpanded","useEffect","cm6Theme","useMemo","extensions","keymap","defaultKeymap","handleChange","newValue","toggleExpandedMode","Fragment","SolaceButton_default","CodeMirror","SolaceCodeEditor_default"],"mappings":"qkBAuBO,SAASA,CAAAA,CAAuBC,CAAAA,CAAyC,CAE/E,IAAMC,CAAAA,CAAkB,kBAAA,CAGl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CACX,UAAA,CAAY,CACX,WAAA,CAAa,IAAA,CACb,UAAA,CAAY,IAAA,CACZ,eAAA,CAAiB,IAAA,CACjB,aAAA,CAAe,IAAA,CACf,cAAA,CAAgB,IAAA,CAChB,qBAAsB,KAAA,CACtB,yBAAA,CAA2B,KAAA,CAC3B,YAAA,CAAc,IACf,CAAA,CACD,CAAA,CACD,CAAA,CACCR,GAAcD,CAAAA,CAAiBC,CAAAA,CAAYC,CAAAA,CAAWC,CAAW,CAAA,CAAA,CACnE,CAAA,CAAA,CAEF,CAEF,KAEO6B,EAAAA,CAAQzB","file":"code-editor.modern.mjs","sourcesContent":["/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EditorView } from \"@codemirror/view\";\nimport { syntaxHighlighting, HighlightStyle } from \"@codemirror/language\";\nimport { tags as t } from \"@lezer/highlight\";\nimport type { Extension } from \"@codemirror/state\";\nimport { ThemeMapping } from \"../types/ThemeMapping\";\nimport { BASE_FONT_PX_SIZES } from \"../resources/typography\";\n\nexport function createCodeMirror6Theme(themeMapping: ThemeMapping): Extension[] {\n\t// Purple color for protobuf keywords and types\n\tconst PROTOBUF_PURPLE = \"rgb(119, 0, 136)\";\n\n\t// Create syntax highlighting that matches your theme colors\n\tconst highlightStyle = HighlightStyle.define([\n\t\t// Strings - Red\n\t\t{ tag: t.string, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.special(t.string), color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.character, color: themeMapping.palette.error.w100 },\n\t\t{ tag: t.regexp, color: themeMapping.palette.error.w100 },\n\n\t\t// Numbers - Teal\n\t\t{ tag: t.number, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.integer, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.float, color: themeMapping.palette.success.w100 },\n\n\t\t// Booleans/Atoms - Blue\n\t\t{ tag: t.bool, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.null, color: themeMapping.palette.info.w100 },\n\t\t{ tag: t.atom, color: themeMapping.palette.info.w100 },\n\n\t\t// Properties/Attributes - Blue for XML attributes, default for JSON properties\n\t\t{ tag: t.propertyName, color: themeMapping.palette.secondary.text.wMain }, // JSON properties stay default\n\t\t{ tag: t.attributeName, color: themeMapping.palette.info.w100 }, // XML attributes blue like original\n\t\t{ tag: t.attributeValue, color: themeMapping.palette.error.w100 }, // XML attribute values red\n\n\t\t// Tags - Teal\n\t\t{ tag: t.tagName, color: themeMapping.palette.success.w100 },\n\t\t{ tag: t.angleBracket, color: themeMapping.palette.success.w100 },\n\n\t\t// Keywords/Operators - Purple for protobuf keywords like original\n\t\t{ tag: t.keyword, color: PROTOBUF_PURPLE }, // Purple for protobuf keywords: syntax, package, import, message, string\n\t\t{ tag: t.definitionKeyword, color: PROTOBUF_PURPLE }, // Purple for 'message', 'syntax', etc\n\t\t{ tag: t.modifier, color: PROTOBUF_PURPLE }, // Purple modifiers\n\t\t{ tag: t.controlKeyword, color: PROTOBUF_PURPLE }, // Purple control keywords\n\t\t{ tag: t.operator, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.punctuation, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.bracket, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.brace, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.paren, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Comments\n\t\t{ tag: t.comment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.lineComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\t\t{ tag: t.blockComment, color: themeMapping.palette.secondary.w70, fontStyle: \"italic\" },\n\n\t\t// Types and definitions - purple for built-in protobuf types like 'string'\n\t\t{ tag: t.typeName, color: PROTOBUF_PURPLE }, // Purple for built-in types like 'string'\n\t\t{ tag: t.className, color: themeMapping.palette.secondary.text.wMain }, // Default for user-defined types like 'OtherRecord'\n\t\t{ tag: t.namespace, color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Variables and other text elements - default color\n\t\t{ tag: t.variableName, color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.function(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\t\t{ tag: t.definition(t.variableName), color: themeMapping.palette.secondary.text.wMain },\n\n\t\t// Default/fallback for any unspecified tokens\n\t\t{ tag: t.name, color: themeMapping.palette.secondary.text.wMain }\n\t]);\n\n\t// Create editor theme for structural elements\n\tconst editorTheme = EditorView.theme({\n\t\t\"&\": {\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tfontFamily: \"Consolas, 'Liberation Mono', Menlo, Courier, monospace\", // Match original font stack\n\t\t\tlineHeight: \"normal\" // Match original line height\n\t\t},\n\t\t\".cm-content\": {\n\t\t\tpadding: \"4px 2px\", // Match original padding\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-focused\": {\n\t\t\toutline: \"none\"\n\t\t},\n\t\t\".cm-gutters\": {\n\t\t\tbackgroundColor: themeMapping.palette.background.w20,\n\t\t\tborderRight: `1px solid ${themeMapping.palette.secondary.w40}`,\n\t\t\tcolor: themeMapping.palette.secondary.text.wMain,\n\t\t\tfontSize: `${BASE_FONT_PX_SIZES.sm}px`, // Use theme constant for 14px\n\t\t\tlineHeight: \"normal\"\n\t\t},\n\t\t\".cm-activeLineGutter\": {\n\t\t\tbackgroundColor: \"transparent\"\n\t\t},\n\t\t\".cm-cursor\": {\n\t\t\tborderLeftColor: themeMapping.palette.secondary.wMain\n\t\t},\n\t\t\".cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\"&.cm-focused .cm-selectionBackground\": {\n\t\t\tbackgroundColor: `${themeMapping.palette.brand.wMain}30`\n\t\t},\n\t\t\".cm-matchingBracket\": {\n\t\t\tcolor: themeMapping.palette.success.w100,\n\t\t\tbackgroundColor: \"transparent\",\n\t\t\tfontWeight: \"bold\"\n\t\t}\n\t});\n\n\treturn [syntaxHighlighting(highlightStyle), editorTheme];\n}\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { json } from \"@codemirror/lang-json\";\nimport { xml } from \"@codemirror/lang-xml\";\nimport { StreamLanguage } from \"@codemirror/language\";\n\n// Custom protobuf support (simplified)\nconst protobufLanguage = StreamLanguage.define({\n\tname: \"protobuf\",\n\ttoken(stream) {\n\t\tif (stream.match(/message|service|rpc|enum|option|import|package/)) {\n\t\t\treturn \"keyword\";\n\t\t}\n\t\tif (stream.match(/int32|int64|uint32|uint64|sint32|sint64|bool|string|bytes|float|double/)) {\n\t\t\treturn \"type\";\n\t\t}\n\t\tif (stream.match(/\"[^\"]*\"/)) {\n\t\t\treturn \"string\";\n\t\t}\n\t\tif (stream.match(/\\d+/)) {\n\t\t\treturn \"number\";\n\t\t}\n\t\tstream.next();\n\t\treturn null;\n\t}\n});\n\nexport const getLanguageExtension = (mode: \"json\" | \"xml\" | \"protobuf\") => {\n\tswitch (mode) {\n\t\tcase \"json\":\n\t\t\treturn json();\n\t\tcase \"xml\":\n\t\t\treturn xml();\n\t\tcase \"protobuf\":\n\t\t\treturn protobufLanguage;\n\t\tdefault:\n\t\t\treturn json();\n\t}\n};\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconProps } from \"./IconProps\";\nimport { SvgIcon } from \"@mui/material\";\n\nconst ExpandIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon sx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }} viewBox=\"0 0 24 24\">\n\t\t\t<path\n\t\t\t\td=\"M3.25 21C3.11193 21 3 20.8881 3 20.75V15.25C3 15.1119 3.11193 15 3.25 15H5V17.6L9.32322 13.2768C9.42085 13.1791 9.57915 13.1791 9.67678 13.2768L10.7232 14.3232C10.8209 14.4209 10.8209 14.5791 10.7232 14.6768L6.4 19H8.75C8.88807 19 9 19.1119 9 19.25V20.75C9 20.8881 8.88807 21 8.75 21H3.25ZM14.6768 10.7232C14.5791 10.8209 14.4209 10.8209 14.3232 10.7232L13.8 10.2L13.2768 9.67678C13.1791 9.57915 13.1791 9.42085 13.2768 9.32322L17.6 5H15.25C15.1119 5 15 4.88807 15 4.75V3.25C15 3.11193 15.1119 3 15.25 3H20.75C20.8881 3 21 3.11193 21 3.25V8.75C21 8.88807 20.8881 9 20.75 9H19.25C19.1119 9 19 8.88807 19 8.75V6.4L14.6768 10.7232Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default ExpandIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SvgIcon } from \"@mui/material\";\nimport { IconProps } from \"./IconProps\";\n\nconst CollapseIcon = ({ size, fill }: IconProps): JSX.Element => {\n\treturn (\n\t\t<SvgIcon\n\t\t\tsx={{ width: `${size}px`, height: `${size}px`, fill: \"none\" }}\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M11.25 13C11.388 13 11.5 13.1119 11.5 13.25L11.5 18.75C11.5 18.8881 11.388 19 11.25 19H9.74996C9.61189 19 9.49996 18.8881 9.49996 18.75L9.49996 16.4L5.07674 20.8232C4.97911 20.9209 4.82082 20.9209 4.72319 20.8232L3.67674 19.7768C3.57911 19.6791 3.57911 19.5209 3.67674 19.4232L8.09996 15H5.74996C5.61189 15 5.49996 14.8881 5.49996 14.75L5.49996 13.25C5.49996 13.1119 5.61189 13 5.74996 13H11.25Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M19.8231 3.27678C19.9207 3.17914 20.079 3.17914 20.1766 3.27678L21.2231 4.32322C21.3207 4.42085 21.3207 4.57914 21.2231 4.67678L16.3999 9.5H18.7499C18.8879 9.5 18.9999 9.61193 18.9999 9.75V11.25C18.9999 11.3881 18.8879 11.5 18.7499 11.5H13.2499C13.1118 11.5 12.9999 11.3881 12.9999 11.25L12.9999 5.75C12.9999 5.61193 13.1118 5.5 13.2499 5.5L14.7499 5.5C14.8879 5.5 14.9999 5.61193 14.9999 5.75V8.1L19.8231 3.27678Z\"\n\t\t\t\tfill={fill}\n\t\t\t/>\n\t\t</SvgIcon>\n\t);\n};\n\nexport default CollapseIcon;\n","/*\n * Copyright 2023-2025 Solace Systems. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useState, useEffect, useMemo } from \"react\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport { EditorView } from \"@codemirror/view\";\nimport { keymap } from \"@codemirror/view\";\nimport { defaultKeymap } from \"@codemirror/commands\";\nimport { useTheme, styled } from \"@mui/material\";\nimport { createCodeMirror6Theme } from \"../../utils/createCodeMirror6Theme\";\nimport { getLanguageExtension } from \"../../utils/codeMirrorLanguages\";\nimport getThemeMappings from \"../../theming/themeUtils\";\nimport SolaceButton from \"./SolaceButton\";\nimport HelperText from \"./HelperText\";\nimport ErrorText from \"./ErrorText\";\nimport WarningText from \"./WarningText\";\nimport ExpandIcon from \"../../resources/icons/ExpandIcon\";\nimport CollapseIcon from \"../../resources/icons/CollapseIcon\";\n\nimport SolaceComponentProps from \"../SolaceComponentProps\";\nimport { CSSProperties } from \"@mui/styled-engine\";\n\n// KEEP ALL EXISTING STYLED COMPONENTS\nconst StyledOuterWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.OuterWrapper as CSSProperties)\n}));\nconst StyledInnerWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.InnerWrapper as CSSProperties)\n}));\nconst StyledEditorWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.EditorWrapper as CSSProperties)\n}));\nconst IconWrapper = styled(\"div\")(({ theme }) => ({\n\t...(theme.mixins.formComponent_CodeEditor.IconWrapper as CSSProperties)\n}));\n\nexport interface SolaceCodeEditorProps extends SolaceComponentProps {\n\t/**\n\t * Unique identifier for the button\n\t */\n\tid?: string;\n\t/**\n\t * The value to initialize the content with\n\t */\n\tvalue?: string;\n\t/**\n\t * Renders the button disabled\n\t */\n\treadOnly?: boolean;\n\t/**\n\t * render SolaceCodeEditor in fullscreen state\n\t */\n\tfullScreen?: boolean;\n\t/**\n\t * The formatting style to render the content as\n\t */\n\tmode?: \"json\" | \"xml\" | \"protobuf\";\n\t/**\n\t * Content to display as supportive/explanitory text\n\t */\n\thelperText?: string | JSX.Element;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in error state\n\t */\n\thasErrors?: boolean;\n\t/**\n\t * Boolean flag to mark the SolaceCodeEditor in warning state\n\t */\n\thasWarnings?: boolean;\n\t/**\n\t * whether to allow CodeEditor to be expandable\n\t */\n\texpandable?: boolean;\n\t/**\n\t * Callback function to trigger whenever the value of the `input` is changed\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tonChange?: (editor: any, data: any, value: string) => void;\n}\n\nconst renderHelperText = (helperText: string | JSX.Element, hasErrors: boolean, hasWarnings: boolean): JSX.Element => {\n\treturn hasErrors ? (\n\t\t<ErrorText>{helperText}</ErrorText>\n\t) : hasWarnings ? (\n\t\t<WarningText>{helperText}</WarningText>\n\t) : (\n\t\t<HelperText>{helperText}</HelperText>\n\t);\n};\n\nfunction SolaceCodeEditor({\n\tmode = \"json\",\n\tvalue,\n\treadOnly = false,\n\texpandable = false,\n\tfullScreen = false,\n\thelperText = \"\",\n\thasErrors = false,\n\thasWarnings = false,\n\tonChange\n}: SolaceCodeEditorProps): JSX.Element {\n\tconst theme = useTheme();\n\tconst themeMapping = getThemeMappings();\n\n\tconst [val, setVal] = useState(value || \"\");\n\tconst [editorExpanded, setEditorExpanded] = useState(fullScreen || false);\n\n\tuseEffect(() => {\n\t\tif (value !== undefined) setVal(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetEditorExpanded(fullScreen);\n\t}, [fullScreen]);\n\n\t// Create CM6 theme from your theme mapping\n\tconst cm6Theme = useMemo(() => createCodeMirror6Theme(themeMapping), [themeMapping]);\n\n\t// Build extensions array\n\tconst extensions = useMemo(\n\t\t() => [getLanguageExtension(mode), EditorView.lineWrapping, keymap.of(defaultKeymap)],\n\t\t[mode]\n\t);\n\n\t// Map onChange to match old API for backward compatibility\n\tconst handleChange = (newValue: string) => {\n\t\tsetVal(newValue);\n\t\tif (onChange) {\n\t\t\t// Maintain old API: (editor, data, value)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\tonChange(null as any, null, newValue);\n\t\t}\n\t};\n\n\tconst toggleExpandedMode = () => {\n\t\tsetEditorExpanded(!editorExpanded);\n\t};\n\n\t// KEEP EXACT SAME JSX STRUCTURE!\n\treturn (\n\t\t<>\n\t\t\t{expandable && (\n\t\t\t\t<StyledOuterWrapper className={editorExpanded ? \"codeEditor-expanded--backdrop\" : \"\"}>\n\t\t\t\t\t<StyledInnerWrapper className={editorExpanded ? \"codeEditor-expanded--main\" : \"\"}>\n\t\t\t\t\t\t<IconWrapper className={editorExpanded ? \"codeEditor-expanded--icon\" : \"codeEditor-collapsed--icon\"}>\n\t\t\t\t\t\t\t{editorExpanded ? (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonCollapseCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Collapse\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CollapseIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<SolaceButton\n\t\t\t\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t\t\t\tdataQa=\"buttonExpandCodeEditor\"\n\t\t\t\t\t\t\t\t\tonClick={toggleExpandedMode}\n\t\t\t\t\t\t\t\t\ttitle=\"Expand\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ExpandIcon fill={theme.palette.ux.secondary.wMain} size={24} />\n\t\t\t\t\t\t\t\t</SolaceButton>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</IconWrapper>\n\t\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t\t</StyledInnerWrapper>\n\t\t\t\t</StyledOuterWrapper>\n\t\t\t)}\n\t\t\t{!expandable && (\n\t\t\t\t<>\n\t\t\t\t\t<StyledEditorWrapper\n\t\t\t\t\t\tclassName={`${!editorExpanded ? \"codeEditor-border\" : \"\"} ${readOnly ? \"codeEditor-readonly\" : \"\"}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CodeMirror\n\t\t\t\t\t\t\tvalue={val}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t\textensions={extensions}\n\t\t\t\t\t\t\ttheme={cm6Theme}\n\t\t\t\t\t\t\teditable={!readOnly}\n\t\t\t\t\t\t\tbasicSetup={{\n\t\t\t\t\t\t\t\tlineNumbers: true,\n\t\t\t\t\t\t\t\tfoldGutter: true,\n\t\t\t\t\t\t\t\tbracketMatching: true,\n\t\t\t\t\t\t\t\tcloseBrackets: true,\n\t\t\t\t\t\t\t\tautocompletion: true,\n\t\t\t\t\t\t\t\trectangularSelection: false,\n\t\t\t\t\t\t\t\thighlightSelectionMatches: false,\n\t\t\t\t\t\t\t\tsearchKeymap: true\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</StyledEditorWrapper>\n\t\t\t\t\t{helperText && renderHelperText(helperText, hasErrors, hasWarnings)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</>\n\t);\n}\n\nexport default SolaceCodeEditor;\n"]}
|
|
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,CAAQ,OAAA,CAAQ,IAAK,CAAA,CAGzD,CAAE,GAAA,CAAKI,IAAA,CAAE,KAAM,KAAA,CAAOJ,CAAAA,CAAa,OAAA,CAAQ,IAAA,CAAK,IAAK,CAAA,CACrD,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AAgB,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"]}
|
package/migrate-imports.js
CHANGED
|
@@ -13,64 +13,74 @@
|
|
|
13
13
|
* node migrate-imports.js ./storybook/src
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const fs = require(
|
|
17
|
-
const path = require(
|
|
16
|
+
const fs = require("fs");
|
|
17
|
+
const path = require("path");
|
|
18
18
|
|
|
19
19
|
// Map of component names to their new entry points
|
|
20
20
|
const componentMigrations = {
|
|
21
21
|
// Date Picker components
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
SolaceDatePicker: "@SolaceDev/maas-react-components/datepicker",
|
|
23
|
+
SolaceDatePickerProps: "@SolaceDev/maas-react-components/datepicker",
|
|
24
|
+
SolaceDatePickerVariant: "@SolaceDev/maas-react-components/datepicker",
|
|
25
25
|
|
|
26
26
|
// Chart components
|
|
27
|
-
|
|
27
|
+
SolaceDonutChart: "@SolaceDev/maas-react-components/charts",
|
|
28
28
|
|
|
29
29
|
// Code Editor components
|
|
30
|
-
|
|
30
|
+
SolaceCodeEditor: "@SolaceDev/maas-react-components/code-editor",
|
|
31
31
|
|
|
32
32
|
// JSON Schema Form components
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
SolaceJsonSchemaForm: "@SolaceDev/maas-react-components/json-schema-form",
|
|
34
|
+
SolaceJsonSchemaFormProps: "@SolaceDev/maas-react-components/json-schema-form",
|
|
35
35
|
|
|
36
36
|
// Drag and Drop components
|
|
37
|
-
|
|
37
|
+
SolaceAttributeValuePairForm: "@SolaceDev/maas-react-components/drag-drop",
|
|
38
38
|
|
|
39
39
|
// Text Diff components
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
SolaceTextDiff: "@SolaceDev/maas-react-components/textDiff",
|
|
41
|
+
SolaceTextDiffProps: "@SolaceDev/maas-react-components/textDiff"
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
// Map of entry points to their required peer dependencies with exact versions
|
|
45
45
|
const peerDependencies = {
|
|
46
|
-
|
|
47
|
-
packages: [
|
|
48
|
-
installCmd:
|
|
46
|
+
"@SolaceDev/maas-react-components/datepicker": {
|
|
47
|
+
packages: ["@mui/x-date-pickers@7.29.4", "moment@2.30.1", "moment-timezone@0.5.48"],
|
|
48
|
+
installCmd: "npm install @mui/x-date-pickers@7.29.4 moment@2.30.1 moment-timezone@0.5.48"
|
|
49
49
|
},
|
|
50
|
-
|
|
51
|
-
packages: [
|
|
52
|
-
installCmd:
|
|
50
|
+
"@SolaceDev/maas-react-components/charts": {
|
|
51
|
+
packages: ["recharts@3.6.0"],
|
|
52
|
+
installCmd: "npm install recharts@3.6.0"
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
packages: [
|
|
56
|
-
|
|
54
|
+
"@SolaceDev/maas-react-components/code-editor": {
|
|
55
|
+
packages: [
|
|
56
|
+
"@uiw/react-codemirror@4.25.1",
|
|
57
|
+
"@codemirror/lang-json@6.0.2",
|
|
58
|
+
"@codemirror/lang-xml@6.1.0",
|
|
59
|
+
"@codemirror/lang-yaml@6.1.2",
|
|
60
|
+
"@codemirror/language@6.11.3",
|
|
61
|
+
"@codemirror/view@6.38.1",
|
|
62
|
+
"@codemirror/state@6.5.4",
|
|
63
|
+
"@lezer/highlight@1.2.1"
|
|
64
|
+
],
|
|
65
|
+
installCmd:
|
|
66
|
+
"npm install @uiw/react-codemirror@4.25.1 @codemirror/lang-json@6.0.2 @codemirror/lang-xml@6.1.0 @codemirror/lang-yaml@6.1.2 @codemirror/language@6.11.3 @codemirror/view@6.38.1 @codemirror/state@6.5.4 @lezer/highlight@1.2.1"
|
|
57
67
|
},
|
|
58
|
-
|
|
59
|
-
packages: [
|
|
60
|
-
installCmd:
|
|
68
|
+
"@SolaceDev/maas-react-components/json-schema-form": {
|
|
69
|
+
packages: ["@rjsf/core@5.24.13", "@rjsf/mui@5.24.13", "@rjsf/utils@5.24.13", "@rjsf/validator-ajv8@5.24.13"],
|
|
70
|
+
installCmd: "npm install @rjsf/core@5.24.13 @rjsf/mui@5.24.13 @rjsf/utils@5.24.13 @rjsf/validator-ajv8@5.24.13"
|
|
61
71
|
},
|
|
62
|
-
|
|
63
|
-
packages: [
|
|
64
|
-
installCmd:
|
|
72
|
+
"@SolaceDev/maas-react-components/drag-drop": {
|
|
73
|
+
packages: ["@hello-pangea/dnd@16.6.0"],
|
|
74
|
+
installCmd: "npm install @hello-pangea/dnd@16.6.0"
|
|
65
75
|
},
|
|
66
|
-
|
|
67
|
-
packages: [
|
|
68
|
-
installCmd:
|
|
76
|
+
"@SolaceDev/maas-react-components/textDiff": {
|
|
77
|
+
packages: ["diff@8.0.2"],
|
|
78
|
+
installCmd: "npm install diff@8.0.2"
|
|
69
79
|
}
|
|
70
80
|
};
|
|
71
81
|
|
|
72
82
|
function migrateFile(filePath, usedEntryPoints) {
|
|
73
|
-
let content = fs.readFileSync(filePath,
|
|
83
|
+
let content = fs.readFileSync(filePath, "utf8");
|
|
74
84
|
let modified = false;
|
|
75
85
|
|
|
76
86
|
// Find all import statements from @SolaceDev/maas-react-components (main package only, not sub-paths)
|
|
@@ -87,19 +97,19 @@ function migrateFile(filePath, usedEntryPoints) {
|
|
|
87
97
|
const remainingComponents = [];
|
|
88
98
|
const importsToRemove = [];
|
|
89
99
|
|
|
90
|
-
matches.forEach(match => {
|
|
100
|
+
matches.forEach((match) => {
|
|
91
101
|
const fullImport = match[0];
|
|
92
102
|
const componentsList = match[1];
|
|
93
103
|
|
|
94
104
|
// Parse the components from the import
|
|
95
105
|
const components = componentsList
|
|
96
|
-
.split(
|
|
97
|
-
.map(c => c.trim())
|
|
98
|
-
.filter(c => c.length > 0);
|
|
106
|
+
.split(",")
|
|
107
|
+
.map((c) => c.trim())
|
|
108
|
+
.filter((c) => c.length > 0);
|
|
99
109
|
|
|
100
|
-
components.forEach(component => {
|
|
110
|
+
components.forEach((component) => {
|
|
101
111
|
// Handle type imports
|
|
102
|
-
const isTypeImport = component.startsWith(
|
|
112
|
+
const isTypeImport = component.startsWith("type ");
|
|
103
113
|
const componentName = isTypeImport ? component.substring(5).trim() : component;
|
|
104
114
|
|
|
105
115
|
const newEntryPoint = componentMigrations[componentName];
|
|
@@ -126,22 +136,22 @@ function migrateFile(filePath, usedEntryPoints) {
|
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
// Remove all old imports that had components to migrate
|
|
129
|
-
importsToRemove.forEach(importStatement => {
|
|
130
|
-
content = content.replace(importStatement,
|
|
139
|
+
importsToRemove.forEach((importStatement) => {
|
|
140
|
+
content = content.replace(importStatement, "");
|
|
131
141
|
});
|
|
132
142
|
|
|
133
143
|
// Build new import statements
|
|
134
|
-
let newImportStatements =
|
|
144
|
+
let newImportStatements = "";
|
|
135
145
|
|
|
136
146
|
// Add remaining components to main import (deduplicate)
|
|
137
147
|
if (remainingComponents.length > 0) {
|
|
138
148
|
const uniqueRemaining = [...new Set(remainingComponents)];
|
|
139
|
-
newImportStatements += `import { ${uniqueRemaining.join(
|
|
149
|
+
newImportStatements += `import { ${uniqueRemaining.join(", ")} } from '@SolaceDev/maas-react-components';\n`;
|
|
140
150
|
}
|
|
141
151
|
|
|
142
152
|
// Add new entry point imports
|
|
143
153
|
Object.entries(newImports).forEach(([entryPoint, components]) => {
|
|
144
|
-
newImportStatements += `import { ${components.join(
|
|
154
|
+
newImportStatements += `import { ${components.join(", ")} } from '${entryPoint}';\n`;
|
|
145
155
|
});
|
|
146
156
|
|
|
147
157
|
// Insert new imports where the first old import was
|
|
@@ -152,30 +162,30 @@ function migrateFile(filePath, usedEntryPoints) {
|
|
|
152
162
|
content = content.slice(0, insertPos) + newImportStatements + content.slice(insertPos);
|
|
153
163
|
} else {
|
|
154
164
|
// No imports found, add at the beginning (after any leading comments/whitespace)
|
|
155
|
-
const afterComments = content.match(/^\s*(\/\*[\s\S]*?\*\/\s*)?(\/\/.*\n\s*)*/) || [
|
|
165
|
+
const afterComments = content.match(/^\s*(\/\*[\s\S]*?\*\/\s*)?(\/\/.*\n\s*)*/) || [""];
|
|
156
166
|
const insertPos = afterComments[0].length;
|
|
157
|
-
content = content.slice(0, insertPos) + newImportStatements +
|
|
167
|
+
content = content.slice(0, insertPos) + newImportStatements + "\n" + content.slice(insertPos);
|
|
158
168
|
}
|
|
159
169
|
|
|
160
170
|
// Clean up multiple consecutive newlines
|
|
161
|
-
content = content.replace(/\n{3,}/g,
|
|
171
|
+
content = content.replace(/\n{3,}/g, "\n\n");
|
|
162
172
|
|
|
163
|
-
fs.writeFileSync(filePath, content,
|
|
173
|
+
fs.writeFileSync(filePath, content, "utf8");
|
|
164
174
|
return true;
|
|
165
175
|
}
|
|
166
176
|
|
|
167
177
|
function walkDirectory(dir, callback) {
|
|
168
178
|
const files = fs.readdirSync(dir);
|
|
169
179
|
|
|
170
|
-
files.forEach(file => {
|
|
180
|
+
files.forEach((file) => {
|
|
171
181
|
const filePath = path.join(dir, file);
|
|
172
182
|
const stat = fs.statSync(filePath);
|
|
173
183
|
|
|
174
184
|
if (stat.isDirectory()) {
|
|
175
|
-
if (file !==
|
|
185
|
+
if (file !== "node_modules" && file !== ".git" && file !== "dist") {
|
|
176
186
|
walkDirectory(filePath, callback);
|
|
177
187
|
}
|
|
178
|
-
} else if (file.endsWith(
|
|
188
|
+
} else if (file.endsWith(".ts") || file.endsWith(".tsx") || file.endsWith(".js") || file.endsWith(".jsx")) {
|
|
179
189
|
callback(filePath);
|
|
180
190
|
}
|
|
181
191
|
});
|
|
@@ -184,14 +194,14 @@ function walkDirectory(dir, callback) {
|
|
|
184
194
|
// Main
|
|
185
195
|
const targetDir = process.argv[2];
|
|
186
196
|
|
|
187
|
-
if (!targetDir || targetDir ===
|
|
188
|
-
console.log(
|
|
189
|
-
console.log(
|
|
190
|
-
console.log(
|
|
191
|
-
console.log(
|
|
192
|
-
console.log(
|
|
193
|
-
console.log(
|
|
194
|
-
console.log(
|
|
197
|
+
if (!targetDir || targetDir === "--help" || targetDir === "-h") {
|
|
198
|
+
console.log("Usage: node migrate-imports.js <directory>");
|
|
199
|
+
console.log("");
|
|
200
|
+
console.log("Migrates imports from v16 to v17 format");
|
|
201
|
+
console.log("");
|
|
202
|
+
console.log("Example:");
|
|
203
|
+
console.log(" node migrate-imports.js ./src");
|
|
204
|
+
console.log(" npx @SolaceDev/maas-react-components migrate-imports ./src");
|
|
195
205
|
process.exit(targetDir ? 0 : 1);
|
|
196
206
|
}
|
|
197
207
|
|
|
@@ -201,7 +211,7 @@ if (!fs.existsSync(targetDir)) {
|
|
|
201
211
|
}
|
|
202
212
|
|
|
203
213
|
console.log(`Migrating imports in: ${targetDir}`);
|
|
204
|
-
console.log(
|
|
214
|
+
console.log("");
|
|
205
215
|
|
|
206
216
|
let filesModified = 0;
|
|
207
217
|
let filesScanned = 0;
|
|
@@ -215,43 +225,43 @@ walkDirectory(targetDir, (filePath) => {
|
|
|
215
225
|
}
|
|
216
226
|
});
|
|
217
227
|
|
|
218
|
-
console.log(
|
|
228
|
+
console.log("");
|
|
219
229
|
console.log(`Migration complete!`);
|
|
220
230
|
console.log(`Files scanned: ${filesScanned}`);
|
|
221
231
|
console.log(`Files modified: ${filesModified}`);
|
|
222
232
|
|
|
223
233
|
if (filesModified > 0 && usedEntryPoints.size > 0) {
|
|
224
|
-
console.log(
|
|
225
|
-
console.log(
|
|
226
|
-
console.log(
|
|
227
|
-
console.log(
|
|
228
|
-
console.log(
|
|
234
|
+
console.log("");
|
|
235
|
+
console.log("📦 Required peer dependencies");
|
|
236
|
+
console.log("");
|
|
237
|
+
console.log("Based on the components you're using, you need to install:");
|
|
238
|
+
console.log("");
|
|
229
239
|
|
|
230
240
|
// Collect all packages that need to be installed
|
|
231
241
|
const allPackages = new Set();
|
|
232
242
|
const installCommands = [];
|
|
233
243
|
|
|
234
|
-
usedEntryPoints.forEach(entryPoint => {
|
|
244
|
+
usedEntryPoints.forEach((entryPoint) => {
|
|
235
245
|
const deps = peerDependencies[entryPoint];
|
|
236
246
|
if (deps) {
|
|
237
|
-
deps.packages.forEach(pkg => allPackages.add(pkg));
|
|
247
|
+
deps.packages.forEach((pkg) => allPackages.add(pkg));
|
|
238
248
|
installCommands.push(deps.installCmd);
|
|
239
249
|
}
|
|
240
250
|
});
|
|
241
251
|
|
|
242
252
|
// Show a single combined install command
|
|
243
253
|
if (allPackages.size > 0) {
|
|
244
|
-
console.log(`npm install ${Array.from(allPackages).join(
|
|
245
|
-
console.log(
|
|
246
|
-
console.log(
|
|
247
|
-
installCommands.forEach(cmd => {
|
|
254
|
+
console.log(`npm install ${Array.from(allPackages).join(" ")}`);
|
|
255
|
+
console.log("");
|
|
256
|
+
console.log("Or install individually:");
|
|
257
|
+
installCommands.forEach((cmd) => {
|
|
248
258
|
console.log(` ${cmd}`);
|
|
249
259
|
});
|
|
250
|
-
console.log(
|
|
260
|
+
console.log("");
|
|
251
261
|
}
|
|
252
262
|
|
|
253
|
-
console.log(
|
|
254
|
-
console.log(
|
|
255
|
-
console.log(
|
|
256
|
-
console.log(
|
|
263
|
+
console.log("Next steps:");
|
|
264
|
+
console.log("1. Review the changes in your code");
|
|
265
|
+
console.log("2. Run the install command above");
|
|
266
|
+
console.log("3. Test your application");
|
|
257
267
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solace-ui-components",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.1",
|
|
4
4
|
"description": "React component library designed for Solace.",
|
|
5
5
|
"author": "Solace",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@codemirror/lang-json": "^6.0.2",
|
|
54
54
|
"@codemirror/lang-xml": "^6.1.0",
|
|
55
|
+
"@codemirror/lang-yaml": "^6.1.2",
|
|
55
56
|
"@codemirror/language": "^6.11.3",
|
|
56
57
|
"@codemirror/state": "^6.0.0",
|
|
57
58
|
"@codemirror/view": "^6.38.1",
|
|
@@ -82,6 +83,9 @@
|
|
|
82
83
|
"@codemirror/lang-xml": {
|
|
83
84
|
"optional": true
|
|
84
85
|
},
|
|
86
|
+
"@codemirror/lang-yaml": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
85
89
|
"@codemirror/language": {
|
|
86
90
|
"optional": true
|
|
87
91
|
},
|
|
@@ -144,6 +148,7 @@
|
|
|
144
148
|
"@codemirror/commands": "^6.10.2",
|
|
145
149
|
"@codemirror/lang-json": "^6.0.2",
|
|
146
150
|
"@codemirror/lang-xml": "^6.1.0",
|
|
151
|
+
"@codemirror/lang-yaml": "^6.1.2",
|
|
147
152
|
"@codemirror/language": "^6.11.3",
|
|
148
153
|
"@codemirror/state": "^6.5.4",
|
|
149
154
|
"@codemirror/view": "^6.38.1",
|