solace-ui-components 17.0.8 → 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/charts.js +1 -1
- package/dist/charts.modern.mjs +1 -1
- package/dist/{chunk-NNUFUUDL.modern.mjs → chunk-2RTZL4CF.modern.mjs} +3 -3
- package/dist/chunk-2RTZL4CF.modern.mjs.map +1 -0
- package/dist/chunk-4XH33OL7.js +384 -0
- package/dist/chunk-4XH33OL7.js.map +1 -0
- package/dist/chunk-7SKICMGL.js +2 -0
- package/dist/{chunk-3NKPHQNZ.js.map → chunk-7SKICMGL.js.map} +1 -1
- package/dist/{chunk-KQ4FCALU.js → chunk-AOKITPX2.js} +2 -2
- package/dist/{chunk-KQ4FCALU.js.map → chunk-AOKITPX2.js.map} +1 -1
- package/dist/chunk-GDZZVHFP.js +2 -0
- package/dist/{chunk-MIW6EPF2.js.map → chunk-GDZZVHFP.js.map} +1 -1
- package/dist/chunk-HLXBN2OE.modern.mjs +2 -0
- package/dist/{chunk-BRCNJ6YU.modern.mjs.map → chunk-HLXBN2OE.modern.mjs.map} +1 -1
- package/dist/chunk-IHSXSGCC.modern.mjs +384 -0
- package/dist/chunk-IHSXSGCC.modern.mjs.map +1 -0
- package/dist/{chunk-VEVQME3E.modern.mjs → chunk-QV564WAK.modern.mjs} +2 -2
- package/dist/{chunk-VEVQME3E.modern.mjs.map → chunk-QV564WAK.modern.mjs.map} +1 -1
- package/dist/{chunk-3EP6QO5T.modern.mjs → chunk-ROSPS5NM.modern.mjs} +2 -2
- package/dist/{chunk-3EP6QO5T.modern.mjs.map → chunk-ROSPS5NM.modern.mjs.map} +1 -1
- package/dist/{chunk-37IHMN4Z.js → chunk-TSSPQLS6.js} +3 -3
- package/dist/chunk-TSSPQLS6.js.map +1 -0
- package/dist/{chunk-ER6Q72GN.js → chunk-UFDVHFXE.js} +2 -2
- package/dist/{chunk-ER6Q72GN.js.map → chunk-UFDVHFXE.js.map} +1 -1
- package/dist/chunk-ULYCLLUO.modern.mjs +2 -0
- package/dist/{chunk-OIYJ7CVG.modern.mjs.map → chunk-ULYCLLUO.modern.mjs.map} +1 -1
- package/dist/code-editor.d.mts +7 -2
- package/dist/code-editor.d.ts +7 -2
- package/dist/code-editor.js +2 -2
- package/dist/code-editor.js.map +1 -1
- package/dist/code-editor.modern.mjs +2 -2
- package/dist/code-editor.modern.mjs.map +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/datepicker.modern.mjs +1 -1
- package/dist/drag-drop.js +1 -1
- package/dist/drag-drop.modern.mjs +1 -1
- package/dist/index.js +56 -56
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +56 -56
- package/dist/index.modern.mjs.map +1 -1
- package/dist/json-schema-form.js +1 -1
- package/dist/json-schema-form.modern.mjs +1 -1
- package/dist/textDiff.js +2 -2
- package/dist/textDiff.modern.mjs +1 -1
- package/migrate-imports.js +85 -75
- package/package.json +37 -46
- package/dist/chunk-37IHMN4Z.js.map +0 -1
- package/dist/chunk-3NKPHQNZ.js +0 -2
- package/dist/chunk-3R3N5YG6.js +0 -365
- package/dist/chunk-3R3N5YG6.js.map +0 -1
- package/dist/chunk-BRCNJ6YU.modern.mjs +0 -2
- package/dist/chunk-GQTRWH6F.modern.mjs +0 -365
- package/dist/chunk-GQTRWH6F.modern.mjs.map +0 -1
- package/dist/chunk-MIW6EPF2.js +0 -2
- package/dist/chunk-NNUFUUDL.modern.mjs.map +0 -1
- package/dist/chunk-OIYJ7CVG.modern.mjs +0 -2
package/dist/json-schema-form.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkTSSPQLS6_js=require('./chunk-TSSPQLS6.js'),chunkAOKITPX2_js=require('./chunk-AOKITPX2.js'),chunkUFDVHFXE_js=require('./chunk-UFDVHFXE.js');require('./chunk-7SKICMGL.js'),require('./chunk-GDZZVHFP.js');var chunk4XH33OL7_js=require('./chunk-4XH33OL7.js'),mui=require('@rjsf/mui'),lodash=require('lodash'),react=require('react'),jsxRuntime=require('react/jsx-runtime'),validatorAjv8=require('@rjsf/validator-ajv8'),de=require('ajv/dist/2020');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var de__default=/*#__PURE__*/_interopDefault(de);var _=({size:e=24,fill:r=""})=>{let o=chunk4XH33OL7_js.ua();return jsxRuntime.jsxs(chunk4XH33OL7_js.Na,{sx:{width:`${e}px`,height:`${e}px`},viewBox:"0 0 24 24",children:[jsxRuntime.jsx("g",{clipPath:"url(#clip0_3496_34902)",children:jsxRuntime.jsx("path",{d:"M16.34 12.28C15.94 10.78 14.73 9.55999 13.22 9.15999C12.74 9.02999 12.26 8.97999 11.8 9.00999L16.49 13.7C16.52 13.24 16.47 12.76 16.34 12.28ZM15.82 15.85L8.62999 8.65999L7.10999 7.13999L3.69999 3.72999C3.54999 3.57999 3.28999 3.57999 3.13999 3.72999L2.28999 4.58999C2.13999 4.73999 2.13999 4.99999 2.28999 5.14999L5.37999 8.23999C3.99999 9.32999 2.86999 10.76 2.03999 12.43C1.90999 12.69 2.10999 13 2.39999 13H3.76999C3.90999 13 4.03999 12.92 4.10999 12.8C4.84999 11.54 5.75999 10.49 6.82999 9.68999L8.21999 11.08C7.56999 12.09 7.30999 13.38 7.65999 14.72C8.05999 16.22 9.27999 17.44 10.78 17.84C12.12 18.2 13.41 17.93 14.42 17.28L19.46 22.32C19.61 22.47 19.87 22.47 20.02 22.32L20.87 21.47C21.02 21.32 21.02 21.06 20.87 20.91L15.82 15.85ZM21.96 12.43C20.05 8.60999 16.59 5.99999 12 5.99999C11 5.99999 10.05 6.12999 9.15999 6.36999L10.87 8.06999C11.23 8.01999 11.61 7.99999 12 7.99999C15.52 7.99999 18.16 9.83999 19.89 12.8C19.96 12.92 20.08 13 20.22 13H21.48C21.89 13 22.09 12.69 21.96 12.43Z",fill:r||o.palette.ux.secondary.wMain})}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_3496_34902",children:jsxRuntime.jsx("rect",{width:e,height:e,fill:o.palette.ux.background.w10})})})]})};var Z=({size:e=24,fill:r=""})=>{let o=chunk4XH33OL7_js.ua();return jsxRuntime.jsxs(chunk4XH33OL7_js.Na,{sx:{width:`${e}px`,height:`${e}px`},viewBox:"0 0 24 24",children:[jsxRuntime.jsx("g",{clipPath:"url(#clip0_3496_34944)",children:jsxRuntime.jsx("path",{d:"M13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162ZM13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162ZM12.001 6C7.41597 6 3.94897 8.608 2.04097 12.428C1.90997 12.69 2.10997 13 2.40197 13H3.77397C3.91497 13 4.04397 12.923 4.11497 12.801C5.83797 9.837 8.47897 8 12.001 8C15.523 8 18.164 9.838 19.888 12.802C19.958 12.923 20.083 13 20.223 13H21.476C21.892 13 22.091 12.689 21.96 12.426C20.052 8.607 16.585 6 12.001 6ZM13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162ZM13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162ZM13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162Z",fill:r||o.palette.ux.secondary.wMain})}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:"clip0_3496_34944",children:jsxRuntime.jsx("rect",{width:e,height:e,fill:o.palette.ux.background.w10})})})]})};var $="-",z="**********",B=(e,r)=>{let o=r.value;lodash.isEmpty(lodash.toString(o))?e.onChange(void 0):e.onChange(o);},ee=e=>e.options?.format==="password"||e.format==="password",oe=(e,r,o=false)=>o&&e.maxLength?r.length:e.maxLength,q=function(e,r,o){let i=r?r(e):e,{disabled:t,label:g,name:f,readonly:n,required:h,schema:a,value:m}=i,y=i["x-custom-error"]??"",S=n?"":y||a.description,s=ee(a),[d,c]=react.useState(false),x=react.useMemo(()=>n&&s&&!m&&o?.(a,i),[s,i,n,a,o,m]),F=react.useMemo(()=>{let l=m??"";return n?s?x?l=$:l=d?l:z:l=l||$:a.const&&(l=a.const),l},[m,n,a.const,s,d,x]),b=react.useMemo(()=>{if(s&&!x)return [jsxRuntime.jsx(chunkAOKITPX2_js.b,{variant:"icon",onClick:()=>c(!d),dataQa:d?"showPasswordButton":"hidePasswordButton",children:d?jsxRuntime.jsx(_,{}):jsxRuntime.jsx(Z,{})},d?"eyeIcon":"hideEyeIcon")]},[s,d,x]),C=oe(a,F,n);return jsxRuntime.jsxs(chunk4XH33OL7_js.Ic,{sx:{display:s?"grid":"block",gridTemplateColumns:"1fr auto",alignItems:"flex-end",overflow:"hidden"},children:[C&&C>100?jsxRuntime.jsx(chunkTSSPQLS6_js.o,{name:f,label:g,onChange:l=>B(i,l),value:F,readOnly:n,required:h&&!n,disabled:t,width:"100%",maxLength:C+1,hasErrors:!!y,helperText:S,placeholder:a.placeholder??"",dataQa:`${g}-form-textArea`}):jsxRuntime.jsx(chunkUFDVHFXE_js.d,{type:s&&!d?"password":"text",label:g,name:f,onChange:l=>B(i,l),value:F,readOnly:n,required:h&&!n,disabled:t,endAdornment:n?void 0:b,hasErrors:!!y,helperText:S,placeholder:a.placeholder??"",dataQa:`${g}-form-textField`}),n&&b?jsxRuntime.jsx(chunk4XH33OL7_js.Ic,{ml:1,children:b}):null]})},re=function(e,r){let o=r?r(e):e,{disabled:i,id:t,label:g,name:f,options:n,readonly:h,required:a,schema:m,title:y,value:S}=o,s=o["x-custom-error"]??"",d=h?"":s||m.description;return n.enumOptions!==void 0?jsxRuntime.jsx(chunk4XH33OL7_js.Ic,{mb:o.id.includes("oneof")?2:0,children:jsxRuntime.jsx(chunkTSSPQLS6_js.n,{label:g,name:f,onChange:c=>B(o,c),value:S,readOnly:h,required:a&&!h,disabled:i,title:y,id:t,hasErrors:!!s,helperText:d,dataQa:`${t}-form-select`,children:n.enumOptions.map(c=>jsxRuntime.jsx(chunk4XH33OL7_js.yf,{value:c.value,children:c.label},c.label))})}):jsxRuntime.jsx(jsxRuntime.Fragment,{})},te=function(e,r){let o=r?r(e):e,{disabled:i,label:t,name:g,readonly:f,required:n,schema:h,value:a}=o,m=o["x-custom-error"]??"",y=f?"":m||h.description;return jsxRuntime.jsx(chunkTSSPQLS6_js.l,{name:g,label:t,onChange:S=>o.onChange(S.value),readOnly:f,required:n&&!f,disabled:i,checked:a,hasErrors:!!m,helperText:y,dataQa:`${t}-form-checkbox`})};function ie(e,r){let o=r?r(e):e,{description:i,id:t}=o;return i==="x-custom-hidden"?null:jsxRuntime.jsx(chunkTSSPQLS6_js.m,{id:t,children:i})}function ne(e,r){let o=r?r(e):e,{id:i,title:t}=o;return t==="x-custom-hidden"?null:jsxRuntime.jsx(chunkTSSPQLS6_js.m,{id:i,variant:"h5",children:t})}var j=(e,r)=>({DescriptionFieldTemplate:o=>ie(o,e),TitleFieldTemplate:o=>ne(o,r)}),N=(e,r)=>({CheckboxWidget:o=>te(o,e),SelectWidget:o=>re(o,e),TextWidget:o=>q(o,e,r),PasswordWidget:o=>q(o,e,r)});var ce=chunk4XH33OL7_js.wa(mui.Form)(({theme:e})=>({".solaceJsonSchemaForm":{maxWidth:"585px",".MuiTypography-root":{padding:e.spacing(3,0),"&.MuiTypography-caption":{display:"none"}},".MuiFormControl-root":{".MuiGrid-root":{padding:0,margin:"0 16px 0 0 !important"},".form-group.field":{paddingBottom:e.spacing(2),"&.field-error ul":{display:"none"},".MuiBox-root":{"label .MuiFormLabel-asterisk":{display:"none"},"label[for] .MuiFormLabel-asterisk":{display:"inline"}}},".form-group.field-array":{".MuiPaper-root":{boxShadow:"none",border:`1px solid ${e.palette.ux.secondary.w20}`,padding:0,margin:e.spacing(1,0,0,0)},".MuiTypography-root":{padding:e.spacing(1,0)},".form-group.field":{paddingBottom:e.spacing(2),"&.field-object":{paddingBottom:0}}}}}})),me=e=>{let r;return e?.length>0&&(e.includes("*")||e.push("*"),r=e),r},J=(e,r,o)=>{if(!o)return;let i=o.properties;if(i)for(let t in i)r[t]={"ui:hideError":true},e("property",t,i[t])?r[t]["ui:widget"]="hidden":e("description",t,i[t])&&(r[t]["ui:description"]="x-custom-hidden"),i[t]&&typeof i[t]=="object"&&(r[t]||(r[t]={}),J(e,r[t],i[t]));else if(typeof o=="object")for(let t in o)J(e,r,o[t]);};function ue({formItem:e,formData:r={},formOptions:o={},readOnly:i=false,disabled:t=false,formRef:g,liveValidate:f=true,onChange:n,transformDescription:h,transformError:a,transformWidget:m,transformTitle:y,ajvClass:S}){let s=e.schema,{order:d,isHidden:c,shouldShowEmptyValueForSensitiveField:x,tagName:F}=o,b=validatorAjv8.customizeValidator({AjvClass:S??de__default.default}),C={"ui:classNames":"solaceJsonSchemaForm"};C["ui:order"]=me(d),c&&(c("submitButton")&&(C["ui:submitButtonOptions"]={norender:true}),c("title")&&(C["ui:options"]={label:false}),J(c,C,s));function l(u){let P=m?.(u)??{...u};return u.rawErrors&&u.rawErrors.length>0&&(P["x-custom-error"]=Array.from(new Set(u.rawErrors)).join(", ")),P}function H(u){return a?u.map(P=>a?.(P)??P):u}function Q(u){n?.(u.formData,u.errors);}return jsxRuntime.jsx(ce,{tagName:F,idPrefix:e.id,schema:s,uiSchema:C,validator:b,widgets:N(l,x),templates:j(h,y),formData:r,onChange:Q,readonly:i,disabled:t,liveValidate:f,showErrorList:false,transformErrors:H,"data-qa":e.id,ref:g},e.id)}var ge=ue;exports.SolaceJsonSchemaForm=ge;//# sourceMappingURL=json-schema-form.js.map
|
|
2
2
|
//# sourceMappingURL=json-schema-form.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {m,o,n,l}from'./chunk-
|
|
1
|
+
import {m,o,n,l}from'./chunk-2RTZL4CF.modern.mjs';import {b}from'./chunk-HLXBN2OE.modern.mjs';import {d}from'./chunk-QV564WAK.modern.mjs';import'./chunk-ULYCLLUO.modern.mjs';import'./chunk-ROSPS5NM.modern.mjs';import {wa,Ic,yf,ua,Na}from'./chunk-IHSXSGCC.modern.mjs';import {Form}from'@rjsf/mui';import {isEmpty,toString}from'lodash';import {useState,useMemo}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {customizeValidator}from'@rjsf/validator-ajv8';import de from'ajv/dist/2020';var _=({size:e=24,fill:r=""})=>{let o=ua();return jsxs(Na,{sx:{width:`${e}px`,height:`${e}px`},viewBox:"0 0 24 24",children:[jsx("g",{clipPath:"url(#clip0_3496_34902)",children:jsx("path",{d:"M16.34 12.28C15.94 10.78 14.73 9.55999 13.22 9.15999C12.74 9.02999 12.26 8.97999 11.8 9.00999L16.49 13.7C16.52 13.24 16.47 12.76 16.34 12.28ZM15.82 15.85L8.62999 8.65999L7.10999 7.13999L3.69999 3.72999C3.54999 3.57999 3.28999 3.57999 3.13999 3.72999L2.28999 4.58999C2.13999 4.73999 2.13999 4.99999 2.28999 5.14999L5.37999 8.23999C3.99999 9.32999 2.86999 10.76 2.03999 12.43C1.90999 12.69 2.10999 13 2.39999 13H3.76999C3.90999 13 4.03999 12.92 4.10999 12.8C4.84999 11.54 5.75999 10.49 6.82999 9.68999L8.21999 11.08C7.56999 12.09 7.30999 13.38 7.65999 14.72C8.05999 16.22 9.27999 17.44 10.78 17.84C12.12 18.2 13.41 17.93 14.42 17.28L19.46 22.32C19.61 22.47 19.87 22.47 20.02 22.32L20.87 21.47C21.02 21.32 21.02 21.06 20.87 20.91L15.82 15.85ZM21.96 12.43C20.05 8.60999 16.59 5.99999 12 5.99999C11 5.99999 10.05 6.12999 9.15999 6.36999L10.87 8.06999C11.23 8.01999 11.61 7.99999 12 7.99999C15.52 7.99999 18.16 9.83999 19.89 12.8C19.96 12.92 20.08 13 20.22 13H21.48C21.89 13 22.09 12.69 21.96 12.43Z",fill:r||o.palette.ux.secondary.wMain})}),jsx("defs",{children:jsx("clipPath",{id:"clip0_3496_34902",children:jsx("rect",{width:e,height:e,fill:o.palette.ux.background.w10})})})]})};var Z=({size:e=24,fill:r=""})=>{let o=ua();return jsxs(Na,{sx:{width:`${e}px`,height:`${e}px`},viewBox:"0 0 24 24",children:[jsx("g",{clipPath:"url(#clip0_3496_34944)",children:jsx("path",{d:"M13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162ZM13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162ZM12.001 6C7.41597 6 3.94897 8.608 2.04097 12.428C1.90997 12.69 2.10997 13 2.40197 13H3.77397C3.91497 13 4.04397 12.923 4.11497 12.801C5.83797 9.837 8.47897 8 12.001 8C15.523 8 18.164 9.838 19.888 12.802C19.958 12.923 20.083 13 20.223 13H21.476C21.892 13 22.091 12.689 21.96 12.426C20.052 8.607 16.585 6 12.001 6ZM13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162ZM13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162ZM13.224 9.162C9.80697 8.253 6.75497 11.305 7.66397 14.722C8.06297 16.223 9.27797 17.438 10.779 17.837C14.196 18.746 17.248 15.694 16.339 12.277C15.939 10.776 14.725 9.562 13.224 9.162Z",fill:r||o.palette.ux.secondary.wMain})}),jsx("defs",{children:jsx("clipPath",{id:"clip0_3496_34944",children:jsx("rect",{width:e,height:e,fill:o.palette.ux.background.w10})})})]})};var $="-",z="**********",B=(e,r)=>{let o=r.value;isEmpty(toString(o))?e.onChange(void 0):e.onChange(o);},ee=e=>e.options?.format==="password"||e.format==="password",oe=(e,r,o=false)=>o&&e.maxLength?r.length:e.maxLength,q=function(e,r,o$1){let i=r?r(e):e,{disabled:t,label:g,name:f,readonly:n,required:h,schema:a,value:m}=i,y=i["x-custom-error"]??"",S=n?"":y||a.description,s=ee(a),[d$1,c]=useState(false),x=useMemo(()=>n&&s&&!m&&o$1?.(a,i),[s,i,n,a,o$1,m]),F=useMemo(()=>{let l=m??"";return n?s?x?l=$:l=d$1?l:z:l=l||$:a.const&&(l=a.const),l},[m,n,a.const,s,d$1,x]),b$1=useMemo(()=>{if(s&&!x)return [jsx(b,{variant:"icon",onClick:()=>c(!d$1),dataQa:d$1?"showPasswordButton":"hidePasswordButton",children:d$1?jsx(_,{}):jsx(Z,{})},d$1?"eyeIcon":"hideEyeIcon")]},[s,d$1,x]),C=oe(a,F,n);return jsxs(Ic,{sx:{display:s?"grid":"block",gridTemplateColumns:"1fr auto",alignItems:"flex-end",overflow:"hidden"},children:[C&&C>100?jsx(o,{name:f,label:g,onChange:l=>B(i,l),value:F,readOnly:n,required:h&&!n,disabled:t,width:"100%",maxLength:C+1,hasErrors:!!y,helperText:S,placeholder:a.placeholder??"",dataQa:`${g}-form-textArea`}):jsx(d,{type:s&&!d$1?"password":"text",label:g,name:f,onChange:l=>B(i,l),value:F,readOnly:n,required:h&&!n,disabled:t,endAdornment:n?void 0:b$1,hasErrors:!!y,helperText:S,placeholder:a.placeholder??"",dataQa:`${g}-form-textField`}),n&&b$1?jsx(Ic,{ml:1,children:b$1}):null]})},re=function(e,r){let o=r?r(e):e,{disabled:i,id:t,label:g,name:f,options:n$1,readonly:h,required:a,schema:m,title:y,value:S}=o,s=o["x-custom-error"]??"",d=h?"":s||m.description;return n$1.enumOptions!==void 0?jsx(Ic,{mb:o.id.includes("oneof")?2:0,children:jsx(n,{label:g,name:f,onChange:c=>B(o,c),value:S,readOnly:h,required:a&&!h,disabled:i,title:y,id:t,hasErrors:!!s,helperText:d,dataQa:`${t}-form-select`,children:n$1.enumOptions.map(c=>jsx(yf,{value:c.value,children:c.label},c.label))})}):jsx(Fragment,{})},te=function(e,r){let o=r?r(e):e,{disabled:i,label:t,name:g,readonly:f,required:n,schema:h,value:a}=o,m=o["x-custom-error"]??"",y=f?"":m||h.description;return jsx(l,{name:g,label:t,onChange:S=>o.onChange(S.value),readOnly:f,required:n&&!f,disabled:i,checked:a,hasErrors:!!m,helperText:y,dataQa:`${t}-form-checkbox`})};function ie(e,r){let o=r?r(e):e,{description:i,id:t}=o;return i==="x-custom-hidden"?null:jsx(m,{id:t,children:i})}function ne(e,r){let o=r?r(e):e,{id:i,title:t}=o;return t==="x-custom-hidden"?null:jsx(m,{id:i,variant:"h5",children:t})}var j=(e,r)=>({DescriptionFieldTemplate:o=>ie(o,e),TitleFieldTemplate:o=>ne(o,r)}),N=(e,r)=>({CheckboxWidget:o=>te(o,e),SelectWidget:o=>re(o,e),TextWidget:o=>q(o,e,r),PasswordWidget:o=>q(o,e,r)});var ce=wa(Form)(({theme:e})=>({".solaceJsonSchemaForm":{maxWidth:"585px",".MuiTypography-root":{padding:e.spacing(3,0),"&.MuiTypography-caption":{display:"none"}},".MuiFormControl-root":{".MuiGrid-root":{padding:0,margin:"0 16px 0 0 !important"},".form-group.field":{paddingBottom:e.spacing(2),"&.field-error ul":{display:"none"},".MuiBox-root":{"label .MuiFormLabel-asterisk":{display:"none"},"label[for] .MuiFormLabel-asterisk":{display:"inline"}}},".form-group.field-array":{".MuiPaper-root":{boxShadow:"none",border:`1px solid ${e.palette.ux.secondary.w20}`,padding:0,margin:e.spacing(1,0,0,0)},".MuiTypography-root":{padding:e.spacing(1,0)},".form-group.field":{paddingBottom:e.spacing(2),"&.field-object":{paddingBottom:0}}}}}})),me=e=>{let r;return e?.length>0&&(e.includes("*")||e.push("*"),r=e),r},J=(e,r,o)=>{if(!o)return;let i=o.properties;if(i)for(let t in i)r[t]={"ui:hideError":true},e("property",t,i[t])?r[t]["ui:widget"]="hidden":e("description",t,i[t])&&(r[t]["ui:description"]="x-custom-hidden"),i[t]&&typeof i[t]=="object"&&(r[t]||(r[t]={}),J(e,r[t],i[t]));else if(typeof o=="object")for(let t in o)J(e,r,o[t]);};function ue({formItem:e,formData:r={},formOptions:o={},readOnly:i=false,disabled:t=false,formRef:g,liveValidate:f=true,onChange:n,transformDescription:h,transformError:a,transformWidget:m,transformTitle:y,ajvClass:S}){let s=e.schema,{order:d,isHidden:c,shouldShowEmptyValueForSensitiveField:x,tagName:F}=o,b=customizeValidator({AjvClass:S??de}),C={"ui:classNames":"solaceJsonSchemaForm"};C["ui:order"]=me(d),c&&(c("submitButton")&&(C["ui:submitButtonOptions"]={norender:true}),c("title")&&(C["ui:options"]={label:false}),J(c,C,s));function l(u){let P=m?.(u)??{...u};return u.rawErrors&&u.rawErrors.length>0&&(P["x-custom-error"]=Array.from(new Set(u.rawErrors)).join(", ")),P}function H(u){return a?u.map(P=>a?.(P)??P):u}function Q(u){n?.(u.formData,u.errors);}return jsx(ce,{tagName:F,idPrefix:e.id,schema:s,uiSchema:C,validator:b,widgets:N(l,x),templates:j(h,y),formData:r,onChange:Q,readonly:i,disabled:t,liveValidate:f,showErrorList:false,transformErrors:H,"data-qa":e.id,ref:g},e.id)}var ge=ue;export{ge as SolaceJsonSchemaForm};//# sourceMappingURL=json-schema-form.modern.mjs.map
|
|
2
2
|
//# sourceMappingURL=json-schema-form.modern.mjs.map
|
package/dist/textDiff.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
`);return n.length>0&&n[n.length-1]===""&&n.pop(),n};function P(e){let{id:n,text1:l,text2:d,text1Header:c,text2Header:D,noContentText:a="No content to compare",noDifferencesText:o="No Differences",hideWhenNoDifferences:$=false}=e,h=y__default.default.useMemo(()=>{let t=T__namespace.diffLines(l,d),r=[],p=1,m=1;for(let u of t){let s=G(u);if(s.length===0)continue;let M=E(u,s,p,m),W={content:"",oldStart:p,newStart:m,oldLines:u.added?0:s.length,newLines:u.removed?0:s.length,changes:M};r.push(W),u.added||(p+=s.length),u.removed||(m+=s.length);}return r},[l,d]),x=y__default.default.useMemo(()=>h.flatMap(t=>t.changes),[h]),w=(t,r,p)=>{let m=r==="old"?t.oldLineNumber:t.newLineNumber;if(!(r==="old"?!t.isInsert:!t.isDelete))return jsxRuntime.jsxs(L,{lineType:"empty",children:[jsxRuntime.jsx(k,{children:"\xA0"}),jsxRuntime.jsx(v,{children:"\xA0"})]},`${r}-empty-${p}`);let s=t.isInsert?"insert":t.isDelete?"delete":"normal";return jsxRuntime.jsxs(L,{lineType:s,children:[jsxRuntime.jsx(k,{children:m||""}),jsxRuntime.jsx(v,{children:t.content})]},`${r}-${m||p}`)};return !l&&!d?jsxRuntime.jsx(C,{id:`code-diff-${n}`,children:jsxRuntime.jsx(H,{children:a})}):$&&x.every(t=>t.isNormal)?jsxRuntime.jsx(C,{id:`code-diff-${n}`,children:jsxRuntime.jsx(H,{children:o})}):jsxRuntime.jsxs(A,{children:[(c||D)&&jsxRuntime.jsxs(I,{children:[jsxRuntime.jsx(S,{children:c&&jsxRuntime.jsx(
|
|
1
|
+
'use strict';var chunkGDZZVHFP_js=require('./chunk-GDZZVHFP.js'),chunk4XH33OL7_js=require('./chunk-4XH33OL7.js'),T=require('diff'),y=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var T__namespace=/*#__PURE__*/_interopNamespace(T);var y__default=/*#__PURE__*/_interopDefault(y);var A=chunk4XH33OL7_js.wa("div")({display:"flex",flexDirection:"column",width:"100%"}),I=chunk4XH33OL7_js.wa("div")({display:"flex",width:"100%"}),S=chunk4XH33OL7_js.wa("div")(({theme:e})=>({flex:1,minWidth:0,padding:e.spacing(1,2,.5,0)})),C=chunk4XH33OL7_js.wa("div")(({theme:e})=>({border:`1px solid ${e.palette.ux.secondary.w40}`,borderRadius:e.shape.borderRadius,fontFamily:"monospace",fontSize:"14px",overflow:"hidden"})),R=chunk4XH33OL7_js.wa("div")({display:"flex",width:"100%"}),N=chunk4XH33OL7_js.wa("div")({flex:1,minWidth:0}),L=chunk4XH33OL7_js.wa("div")(({theme:e,lineType:n})=>({display:"flex",minHeight:"1.2em",lineHeight:"1.2em",...n==="insert"&&{backgroundColor:e.palette.ux.success.w10},...n==="delete"&&{backgroundColor:e.palette.ux.warning.w10,mixBlendMode:"multiply"},...n==="empty"&&{backgroundColor:e.palette.ux.error.wMain,opacity:.1}})),k=chunk4XH33OL7_js.wa("div")(({theme:e})=>({color:e.palette.ux.secondary.text.wMain,backgroundColor:e.palette.ux.background.w20,textAlign:"center",minWidth:e.spacing(3),padding:e.spacing(0,.5),borderRight:`1px solid ${e.palette.ux.secondary.w40}`,userSelect:"none",flexShrink:0})),v=chunk4XH33OL7_js.wa("div")(({theme:e})=>({padding:e.spacing(0,1),whiteSpace:"pre-wrap",overflow:"hidden",wordWrap:"break-word",flex:1})),H=chunk4XH33OL7_js.wa("div")(({theme:e})=>({padding:e.spacing(2),textAlign:"center",color:e.palette.ux.secondary.text.wMain})),E=(e,n,l,d)=>{let c=e.added?"insert":e.removed?"delete":"normal";return n.map((D,a)=>{let o={type:c,content:D};return c==="insert"?(o.isInsert=true,o.newLineNumber=d+a,o.lineNumber=d+a):c==="delete"?(o.isDelete=true,o.oldLineNumber=l+a,o.lineNumber=l+a):(o.isNormal=true,o.oldLineNumber=l+a,o.newLineNumber=d+a),o})},G=e=>{if(!e.value)return [];let n=e.value.split(`
|
|
2
|
+
`);return n.length>0&&n[n.length-1]===""&&n.pop(),n};function P(e){let{id:n,text1:l,text2:d,text1Header:c,text2Header:D,noContentText:a="No content to compare",noDifferencesText:o="No Differences",hideWhenNoDifferences:$=false}=e,h=y__default.default.useMemo(()=>{let t=T__namespace.diffLines(l,d),r=[],p=1,m=1;for(let u of t){let s=G(u);if(s.length===0)continue;let M=E(u,s,p,m),W={content:"",oldStart:p,newStart:m,oldLines:u.added?0:s.length,newLines:u.removed?0:s.length,changes:M};r.push(W),u.added||(p+=s.length),u.removed||(m+=s.length);}return r},[l,d]),x=y__default.default.useMemo(()=>h.flatMap(t=>t.changes),[h]),w=(t,r,p)=>{let m=r==="old"?t.oldLineNumber:t.newLineNumber;if(!(r==="old"?!t.isInsert:!t.isDelete))return jsxRuntime.jsxs(L,{lineType:"empty",children:[jsxRuntime.jsx(k,{children:"\xA0"}),jsxRuntime.jsx(v,{children:"\xA0"})]},`${r}-empty-${p}`);let s=t.isInsert?"insert":t.isDelete?"delete":"normal";return jsxRuntime.jsxs(L,{lineType:s,children:[jsxRuntime.jsx(k,{children:m||""}),jsxRuntime.jsx(v,{children:t.content})]},`${r}-${m||p}`)};return !l&&!d?jsxRuntime.jsx(C,{id:`code-diff-${n}`,children:jsxRuntime.jsx(H,{children:a})}):$&&x.every(t=>t.isNormal)?jsxRuntime.jsx(C,{id:`code-diff-${n}`,children:jsxRuntime.jsx(H,{children:o})}):jsxRuntime.jsxs(A,{children:[(c||D)&&jsxRuntime.jsxs(I,{children:[jsxRuntime.jsx(S,{children:c&&jsxRuntime.jsx(chunkGDZZVHFP_js.a,{id:`diff-text1Header-${n}`,children:c})}),jsxRuntime.jsx(S,{children:D&&jsxRuntime.jsx(chunkGDZZVHFP_js.a,{id:`diff-text2Header-${n}`,children:D})})]}),jsxRuntime.jsx(C,{id:`code-diff-${n}`,children:jsxRuntime.jsxs(R,{children:[jsxRuntime.jsx(N,{children:x.map((t,r)=>w(t,"old",r))}),jsxRuntime.jsx(N,{children:x.map((t,r)=>w(t,"new",r))})]})})]})}exports.SolaceTextDiff=P;//# sourceMappingURL=textDiff.js.map
|
|
3
3
|
//# sourceMappingURL=textDiff.js.map
|
package/dist/textDiff.modern.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-ROSPS5NM.modern.mjs';import {wa}from'./chunk-IHSXSGCC.modern.mjs';import*as T from'diff';import y from'react';import {jsx,jsxs}from'react/jsx-runtime';var A=wa("div")({display:"flex",flexDirection:"column",width:"100%"}),I=wa("div")({display:"flex",width:"100%"}),S=wa("div")(({theme:e})=>({flex:1,minWidth:0,padding:e.spacing(1,2,.5,0)})),C=wa("div")(({theme:e})=>({border:`1px solid ${e.palette.ux.secondary.w40}`,borderRadius:e.shape.borderRadius,fontFamily:"monospace",fontSize:"14px",overflow:"hidden"})),R=wa("div")({display:"flex",width:"100%"}),N=wa("div")({flex:1,minWidth:0}),L=wa("div")(({theme:e,lineType:n})=>({display:"flex",minHeight:"1.2em",lineHeight:"1.2em",...n==="insert"&&{backgroundColor:e.palette.ux.success.w10},...n==="delete"&&{backgroundColor:e.palette.ux.warning.w10,mixBlendMode:"multiply"},...n==="empty"&&{backgroundColor:e.palette.ux.error.wMain,opacity:.1}})),k=wa("div")(({theme:e})=>({color:e.palette.ux.secondary.text.wMain,backgroundColor:e.palette.ux.background.w20,textAlign:"center",minWidth:e.spacing(3),padding:e.spacing(0,.5),borderRight:`1px solid ${e.palette.ux.secondary.w40}`,userSelect:"none",flexShrink:0})),v=wa("div")(({theme:e})=>({padding:e.spacing(0,1),whiteSpace:"pre-wrap",overflow:"hidden",wordWrap:"break-word",flex:1})),H=wa("div")(({theme:e})=>({padding:e.spacing(2),textAlign:"center",color:e.palette.ux.secondary.text.wMain})),E=(e,n,l,d)=>{let c=e.added?"insert":e.removed?"delete":"normal";return n.map((D,a)=>{let o={type:c,content:D};return c==="insert"?(o.isInsert=true,o.newLineNumber=d+a,o.lineNumber=d+a):c==="delete"?(o.isDelete=true,o.oldLineNumber=l+a,o.lineNumber=l+a):(o.isNormal=true,o.oldLineNumber=l+a,o.newLineNumber=d+a),o})},G=e=>{if(!e.value)return [];let n=e.value.split(`
|
|
2
2
|
`);return n.length>0&&n[n.length-1]===""&&n.pop(),n};function P(e){let{id:n,text1:l,text2:d,text1Header:c,text2Header:D,noContentText:a$1="No content to compare",noDifferencesText:o="No Differences",hideWhenNoDifferences:$=false}=e,h=y.useMemo(()=>{let t=T.diffLines(l,d),r=[],p=1,m=1;for(let u of t){let s=G(u);if(s.length===0)continue;let M=E(u,s,p,m),W={content:"",oldStart:p,newStart:m,oldLines:u.added?0:s.length,newLines:u.removed?0:s.length,changes:M};r.push(W),u.added||(p+=s.length),u.removed||(m+=s.length);}return r},[l,d]),x=y.useMemo(()=>h.flatMap(t=>t.changes),[h]),w=(t,r,p)=>{let m=r==="old"?t.oldLineNumber:t.newLineNumber;if(!(r==="old"?!t.isInsert:!t.isDelete))return jsxs(L,{lineType:"empty",children:[jsx(k,{children:"\xA0"}),jsx(v,{children:"\xA0"})]},`${r}-empty-${p}`);let s=t.isInsert?"insert":t.isDelete?"delete":"normal";return jsxs(L,{lineType:s,children:[jsx(k,{children:m||""}),jsx(v,{children:t.content})]},`${r}-${m||p}`)};return !l&&!d?jsx(C,{id:`code-diff-${n}`,children:jsx(H,{children:a$1})}):$&&x.every(t=>t.isNormal)?jsx(C,{id:`code-diff-${n}`,children:jsx(H,{children:o})}):jsxs(A,{children:[(c||D)&&jsxs(I,{children:[jsx(S,{children:c&&jsx(a,{id:`diff-text1Header-${n}`,children:c})}),jsx(S,{children:D&&jsx(a,{id:`diff-text2Header-${n}`,children:D})})]}),jsx(C,{id:`code-diff-${n}`,children:jsxs(R,{children:[jsx(N,{children:x.map((t,r)=>w(t,"old",r))}),jsx(N,{children:x.map((t,r)=>w(t,"new",r))})]})})]})}export{P as SolaceTextDiff};//# sourceMappingURL=textDiff.modern.mjs.map
|
|
3
3
|
//# sourceMappingURL=textDiff.modern.mjs.map
|
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": "
|
|
3
|
+
"version": "18.0.1",
|
|
4
4
|
"description": "React component library designed for Solace.",
|
|
5
5
|
"author": "Solace",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,40 +49,22 @@
|
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">=14"
|
|
51
51
|
},
|
|
52
|
-
"scripts": {
|
|
53
|
-
"install:dev": "npm ci && cd storybook/ && npm ci",
|
|
54
|
-
"dev:link": "npm link && cd storybook && npm link @SolaceDev/maas-react-components",
|
|
55
|
-
"build": "tsup",
|
|
56
|
-
"build:dev": "tsup --watch --no-dts --env.NODE_ENV development",
|
|
57
|
-
"start": "./scripts/start.sh",
|
|
58
|
-
"prepare": "husky install && run-s build",
|
|
59
|
-
"test": "cross-env CI=1 react-scripts test --env=jsdom",
|
|
60
|
-
"test:build": "run-s build",
|
|
61
|
-
"test:lint": "eslint .",
|
|
62
|
-
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
|
|
63
|
-
"test:watch": "react-scripts test --env=jsdom",
|
|
64
|
-
"predeploy": "cd example && npm ci && npm run build",
|
|
65
|
-
"deploy": "gh-pages -d example/build",
|
|
66
|
-
"types": "tsc",
|
|
67
|
-
"prettier:fix": "prettier --write .",
|
|
68
|
-
"lint:fix": "eslint ./src --fix",
|
|
69
|
-
"lint-storybook:fix": "eslint ./storybook/src/stories --fix",
|
|
70
|
-
"coverage:merge": "lcov-result-merger 'coverage/lcov*.info' 'coverage/lcov-final.info'"
|
|
71
|
-
},
|
|
72
52
|
"peerDependencies": {
|
|
73
53
|
"@codemirror/lang-json": "^6.0.2",
|
|
74
54
|
"@codemirror/lang-xml": "^6.1.0",
|
|
55
|
+
"@codemirror/lang-yaml": "^6.1.2",
|
|
75
56
|
"@codemirror/language": "^6.11.3",
|
|
57
|
+
"@codemirror/state": "^6.0.0",
|
|
76
58
|
"@codemirror/view": "^6.38.1",
|
|
77
59
|
"@hello-pangea/dnd": "^16.6.0",
|
|
78
60
|
"@lezer/highlight": "^1.2.1",
|
|
79
|
-
"diff": "^8.0.2",
|
|
80
61
|
"@mui/x-date-pickers": "^7.29.4",
|
|
81
62
|
"@rjsf/core": "5.24.13",
|
|
82
63
|
"@rjsf/mui": "5.24.13",
|
|
83
64
|
"@rjsf/utils": "5.24.13",
|
|
84
65
|
"@rjsf/validator-ajv8": "5.24.13",
|
|
85
66
|
"@uiw/react-codemirror": "^4.25.1",
|
|
67
|
+
"diff": "^8.0.2",
|
|
86
68
|
"lodash": "^4.17.21",
|
|
87
69
|
"moment": "^2.30.1",
|
|
88
70
|
"moment-timezone": "0.5.48",
|
|
@@ -101,9 +83,15 @@
|
|
|
101
83
|
"@codemirror/lang-xml": {
|
|
102
84
|
"optional": true
|
|
103
85
|
},
|
|
86
|
+
"@codemirror/lang-yaml": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
104
89
|
"@codemirror/language": {
|
|
105
90
|
"optional": true
|
|
106
91
|
},
|
|
92
|
+
"@codemirror/state": {
|
|
93
|
+
"optional": true
|
|
94
|
+
},
|
|
107
95
|
"@codemirror/view": {
|
|
108
96
|
"optional": true
|
|
109
97
|
},
|
|
@@ -157,12 +145,17 @@
|
|
|
157
145
|
}
|
|
158
146
|
},
|
|
159
147
|
"devDependencies": {
|
|
148
|
+
"@codemirror/commands": "^6.10.2",
|
|
160
149
|
"@codemirror/lang-json": "^6.0.2",
|
|
161
150
|
"@codemirror/lang-xml": "^6.1.0",
|
|
151
|
+
"@codemirror/lang-yaml": "^6.1.2",
|
|
162
152
|
"@codemirror/language": "^6.11.3",
|
|
153
|
+
"@codemirror/state": "^6.5.4",
|
|
163
154
|
"@codemirror/view": "^6.38.1",
|
|
164
155
|
"@hello-pangea/dnd": "^16.6.0",
|
|
165
156
|
"@lezer/highlight": "^1.2.1",
|
|
157
|
+
"@mui/styled-engine": "^7.3.8",
|
|
158
|
+
"@mui/system": "^7.3.8",
|
|
166
159
|
"@mui/x-date-pickers": "^7.29.4",
|
|
167
160
|
"@rjsf/core": "5.24.13",
|
|
168
161
|
"@rjsf/mui": "5.24.13",
|
|
@@ -184,6 +177,7 @@
|
|
|
184
177
|
"@uiw/react-codemirror": "^4.25.1",
|
|
185
178
|
"attr-accept": "^2.2.2",
|
|
186
179
|
"babel-eslint": "^10.1.0",
|
|
180
|
+
"clsx": "^2.1.1",
|
|
187
181
|
"cross-env": "^7.0.3",
|
|
188
182
|
"diff": "8.0.2",
|
|
189
183
|
"eslint": "^8.53.0",
|
|
@@ -215,12 +209,12 @@
|
|
|
215
209
|
"typescript": "5.3.3"
|
|
216
210
|
},
|
|
217
211
|
"dependencies": {
|
|
212
|
+
"@SolaceDev/maas-icons": "^0.2.154",
|
|
218
213
|
"@emotion/react": "11.13.5",
|
|
219
214
|
"@emotion/styled": "11.13.5",
|
|
220
215
|
"@mui/base": "^5.0.0-beta.70",
|
|
221
216
|
"@mui/icons-material": "^6.1.9",
|
|
222
217
|
"@mui/material": "^6.1.9",
|
|
223
|
-
"@SolaceDev/maas-icons": "^0.2.154",
|
|
224
218
|
"ajv": "^8.12.0"
|
|
225
219
|
},
|
|
226
220
|
"files": [
|
|
@@ -230,32 +224,29 @@
|
|
|
230
224
|
"THIRD_PARTY_LICENSES.txt",
|
|
231
225
|
"migrate-imports.js"
|
|
232
226
|
],
|
|
233
|
-
"overrides": {
|
|
234
|
-
"redux": "^5.0.1",
|
|
235
|
-
"@rjsf/core": {
|
|
236
|
-
"react": "$react",
|
|
237
|
-
"react-dom": "$react-dom"
|
|
238
|
-
},
|
|
239
|
-
"@rjsf/mui": {
|
|
240
|
-
"react": "$react",
|
|
241
|
-
"react-dom": "$react-dom",
|
|
242
|
-
"@mui/material": "$@mui/material",
|
|
243
|
-
"@mui/icons-material": "$@mui/icons-material"
|
|
244
|
-
},
|
|
245
|
-
"@rjsf/utils": {
|
|
246
|
-
"react": "$react",
|
|
247
|
-
"react-dom": "$react-dom"
|
|
248
|
-
},
|
|
249
|
-
"@rjsf/validator-ajv8": {
|
|
250
|
-
"react": "$react",
|
|
251
|
-
"react-dom": "$react-dom"
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
227
|
"lint-staged": {
|
|
255
228
|
"*.{tsx,ts}": [
|
|
256
229
|
"eslint --cache --fix"
|
|
257
230
|
],
|
|
258
231
|
"*.{ts,tsx,css,md}": "prettier --write"
|
|
259
232
|
},
|
|
260
|
-
"homepage": "https://solace.dev"
|
|
261
|
-
|
|
233
|
+
"homepage": "https://solace.dev",
|
|
234
|
+
"scripts": {
|
|
235
|
+
"preinstall": "npx only-allow pnpm",
|
|
236
|
+
"install:dev": "pnpm install && cd storybook/ && pnpm install",
|
|
237
|
+
"dev:link": "pnpm link -g && cd storybook && pnpm link -g @SolaceDev/maas-react-components",
|
|
238
|
+
"build": "tsup",
|
|
239
|
+
"build:dev": "tsup --watch --no-dts --env.NODE_ENV development",
|
|
240
|
+
"start": "./scripts/start.sh",
|
|
241
|
+
"test": "cross-env CI=1 react-scripts test --env=jsdom",
|
|
242
|
+
"test:build": "run-s build",
|
|
243
|
+
"test:lint": "eslint .",
|
|
244
|
+
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
|
|
245
|
+
"test:watch": "react-scripts test --env=jsdom",
|
|
246
|
+
"types": "tsc",
|
|
247
|
+
"prettier:fix": "prettier --write .",
|
|
248
|
+
"lint:fix": "eslint ./src --fix",
|
|
249
|
+
"lint-storybook:fix": "eslint ./storybook/src/stories --fix",
|
|
250
|
+
"coverage:merge": "lcov-result-merger 'coverage/lcov*.info' 'coverage/lcov-final.info'"
|
|
251
|
+
}
|
|
252
|
+
}
|