@ansible/ansible-ui-framework 2.4.2584 → 2.4.2585

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -41721,7 +41721,11 @@ function dve(e) {
41721
41721
  alwaysConsumeMouseWheel: !1
41722
41722
  }
41723
41723
  });
41724
- return g.current.editor = b, () => b.dispose();
41724
+ return g.current.editor = b, () => {
41725
+ setTimeout(() => {
41726
+ b.dispose();
41727
+ }, 1e3);
41728
+ };
41725
41729
  }
41726
41730
  }, [e.lineNumbers]), be(() => {
41727
41731
  var C;
package/index.umd.cjs CHANGED
@@ -476,7 +476,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Mu]+=1);const Iu=Pe.button`
476
476
  ${e.value}
477
477
  \`\`\``}}function Dge(e){return typeof e=="string"||"language"in e?[t3(e)]:Array.isArray(e)?e.map(t3):[QT(e)]}function Pge(e){const t={contents:Dge(e.contents)};return e.range&&(t.range=vn(e.range)),t}function Yc(e){return{character:e.column-1,line:e.lineNumber-1}}function jge(e){const t={range:vn(e.range)};return e.tooltip!=null&&(t.tooltip=e.tooltip),e.target!=null&&(t.url=Gi.parse(e.target)),t}function Mge(e){const t={range:vn(e.targetRange),targetSelectionRange:vn(e.targetSelectionRange),uri:Gi.parse(e.targetUri)};return e.originSelectionRange&&(t.originSelectionRange=vn(e.originSelectionRange)),t}function Ige(e){const t=[];let n=e;for(;n;)t.push({range:vn(n.range)}),n=n.parent;return t}function $ge(e,t,n){const r=new Map,i=d=>{const f=d.getLanguageId();return Array.isArray(t)?t.includes(f):t===f},o=async d=>{const f=d.getVersionId(),h=await n.provideMarkerData(d);!d.isDisposed()&&f===d.getVersionId()&&i(d)&&e.editor.setModelMarkers(d,n.owner,h??[])},a=d=>{if(!i(d))return;let f;const h=d.onDidChangeContent(()=>{clearTimeout(f),f=setTimeout(()=>{o(d)},500)});r.set(d,{dispose(){clearTimeout(f),h.dispose()}}),o(d)},s=d=>{e.editor.setModelMarkers(d,n.owner,[]);const f=r.get(d);f&&(f.dispose(),r.delete(d))},l=e.editor.onDidCreateModel(a),c=e.editor.onWillDisposeModel(d=>{var f;s(d),(f=n.doReset)==null||f.call(n,d)}),u=e.editor.onDidChangeModelLanguage(({model:d})=>{var f;s(d),a(d),(f=n.doReset)==null||f.call(n,d)});for(const d of e.editor.getModels())a(d);return{dispose(){for(const d of r.keys())s(d);l.dispose(),c.dispose(),u.dispose()},async revalidate(){await Promise.all(e.editor.getModels().map(o))}}}function Lge(e,t){let{createData:n,interval:r=3e4,label:i,moduleId:o,stopWhenIdleFor:a=12e4}=t,s,l=0,c=!1;const u=()=>{s&&(s.dispose(),s=void 0)},d=setInterval(()=>{if(!s)return;Date.now()-l>a&&u()},r);return{dispose(){c=!0,clearInterval(d),u()},getWorker(...f){if(c)throw new Error("Worker manager has been disposed");return l=Date.now(),s||(s=e.editor.createWebWorker({createData:n,label:i,moduleId:o})),s.withSyncedResources(f)},updateCreateData(f){n=f,u()}}}function Fge(e,t){const n={completion:!0,customTags:[],enableSchemaRequest:!1,format:!0,isKubernetes:!1,hover:!0,schemas:[],validate:!0,yamlVersion:"1.2",...t};e.languages.register({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml"]});const r=Lge(e,{label:"yaml",moduleId:"monaco-yaml/yaml.worker",createData:n}),i=$ge(e,"yaml",{owner:"yaml",async provideMarkerData(a){const l=await(await r.getWorker(a.uri)).doValidation(String(a.uri));return l==null?void 0:l.map(XT)},async doReset(a){await(await r.getWorker(a.uri)).resetSchema(String(a.uri))}}),o=[r,i,e.languages.registerCompletionItemProvider("yaml",{triggerCharacters:[" ",":"],async provideCompletionItems(a,s){const l=a.getWordUntilPosition(s),u=await(await r.getWorker(a.uri)).doComplete(String(a.uri),Yc(s));if(u)return Ege(u,{range:{startLineNumber:s.lineNumber,startColumn:l.startColumn,endLineNumber:s.lineNumber,endColumn:l.endColumn}})}}),e.languages.registerHoverProvider("yaml",{async provideHover(a,s){const c=await(await r.getWorker(a.uri)).doHover(String(a.uri),Yc(s));if(c)return Pge(c)}}),e.languages.registerDefinitionProvider("yaml",{async provideDefinition(a,s){const c=await(await r.getWorker(a.uri)).doDefinition(String(a.uri),Yc(s));return c==null?void 0:c.map(Mge)}}),e.languages.registerDocumentSymbolProvider("yaml",{displayName:"yaml",async provideDocumentSymbols(a){const l=await(await r.getWorker(a.uri)).findDocumentSymbols(String(a.uri));return l==null?void 0:l.map(e3)}}),e.languages.registerDocumentFormattingEditProvider("yaml",{displayName:"yaml",async provideDocumentFormattingEdits(a){const l=await(await r.getWorker(a.uri)).format(String(a.uri));return l==null?void 0:l.map(sv)}}),e.languages.registerLinkProvider("yaml",{async provideLinks(a){const l=await(await r.getWorker(a.uri)).findLinks(String(a.uri));if(l)return{links:l.map(jge)}}}),e.languages.registerCodeActionProvider("yaml",{async provideCodeActions(a,s,l){const u=await(await r.getWorker(a.uri)).getCodeAction(String(a.uri),av(s),vge(l));if(u)return{actions:u.map(yge),dispose(){}}}}),e.languages.registerFoldingRangeProvider("yaml",{async provideFoldingRanges(a){const l=await(await r.getWorker(a.uri)).getFoldingRanges(String(a.uri));return l==null?void 0:l.map(Tge)}}),e.languages.setLanguageConfiguration("yaml",{comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]}),e.languages.registerOnTypeFormattingEditProvider("yaml",{autoFormatTriggerCharacters:[`
478
478
  `],async provideOnTypeFormattingEdits(a,s,l,c){const d=await(await r.getWorker(a.uri)).doDocumentOnTypeFormatting(String(a.uri),Yc(s),l,Age(c));return d==null?void 0:d.map(sv)}}),e.languages.registerSelectionRangeProvider("yaml",{async provideSelectionRanges(a,s){const c=await(await r.getWorker(a.uri)).getSelectionRanges(String(a.uri),s.map(Yc));return c==null?void 0:c.map(Ige)}})];return{dispose(){for(const a of o)a.dispose()},async update(a){r.updateCreateData(Object.assign(n,a)),await i.revalidate()}}}function Nge(e){const t=bi(e),{onFocus:n,onBlur:r,language:i,value:o,onChange:a,setError:s,isReadOnly:l}=e,[c,u]=v.useState(!1),d=v.useRef(null),f=v.useRef(null),h=v.useCallback(x=>{if(!d.current)return;d.current.style.minHeight=`${n3+o3}px`;const S=x.split(`
479
- `).length;d.current.style.height=`${S*n3+o3}px`},[]),m=v.useRef({});v.useEffect(()=>{if(f.current){const x=Qi.editor.create(f.current,{lineNumbers:e.lineNumbers?"on":"off",lineDecorationsWidth:e.lineNumbers?void 0:0,theme:"data-editor-dark",padding:{top:r3,bottom:i3},fontSize:14,fontFamily:"RedHatMono",scrollBeyondLastLine:!1,minimap:{enabled:!1},renderLineHighlightOnlyWhenFocus:!0,scrollbar:{alwaysConsumeMouseWheel:!1}});return m.current.editor=x,()=>x.dispose()}},[e.lineNumbers]),v.useEffect(()=>{var S;const x=(S=m==null?void 0:m.current)==null?void 0:S.editor;x&&(x.onDidFocusEditorText(()=>n==null?void 0:n()),x.onDidBlurEditorText(()=>r==null?void 0:r()))},[n,r]),v.useEffect(()=>{var _;const x=(_=m==null?void 0:m.current)==null?void 0:_.editor;if(!x)return;const S=x.getModel();if(!S)return;const C=S.onDidChangeContent(()=>{const w=x.getValue()??"";a(w),h(w)});return()=>C.dispose()},[a,h]),v.useEffect(()=>{var S;const x=(S=m==null?void 0:m.current)==null?void 0:S.editor;x&&x.getValue()!==o&&(x.setValue(o),h(o))},[o,h]),v.useEffect(()=>{var S;const x=(S=m==null?void 0:m.current)==null?void 0:S.editor;x&&x.updateOptions({readOnly:l})},[l]);const[p,y]=v.useState(!1);v.useEffect(()=>{var _;const x=(_=m==null?void 0:m.current)==null?void 0:_.editor;if(!x)return;const S=x.getModel();if(!S)return;Qi.editor.setModelLanguage(S,i);const C=Qi.editor.onDidChangeMarkers(()=>{const w=Qi.editor.getModelMarkers({owner:S.getLanguageId(),resource:S.uri});y(w.length>0),s(w.length>0?w.map(k=>k.message).join(`
479
+ `).length;d.current.style.height=`${S*n3+o3}px`},[]),m=v.useRef({});v.useEffect(()=>{if(f.current){const x=Qi.editor.create(f.current,{lineNumbers:e.lineNumbers?"on":"off",lineDecorationsWidth:e.lineNumbers?void 0:0,theme:"data-editor-dark",padding:{top:r3,bottom:i3},fontSize:14,fontFamily:"RedHatMono",scrollBeyondLastLine:!1,minimap:{enabled:!1},renderLineHighlightOnlyWhenFocus:!0,scrollbar:{alwaysConsumeMouseWheel:!1}});return m.current.editor=x,()=>{setTimeout(()=>{x.dispose()},1e3)}}},[e.lineNumbers]),v.useEffect(()=>{var S;const x=(S=m==null?void 0:m.current)==null?void 0:S.editor;x&&(x.onDidFocusEditorText(()=>n==null?void 0:n()),x.onDidBlurEditorText(()=>r==null?void 0:r()))},[n,r]),v.useEffect(()=>{var _;const x=(_=m==null?void 0:m.current)==null?void 0:_.editor;if(!x)return;const S=x.getModel();if(!S)return;const C=S.onDidChangeContent(()=>{const w=x.getValue()??"";a(w),h(w)});return()=>C.dispose()},[a,h]),v.useEffect(()=>{var S;const x=(S=m==null?void 0:m.current)==null?void 0:S.editor;x&&x.getValue()!==o&&(x.setValue(o),h(o))},[o,h]),v.useEffect(()=>{var S;const x=(S=m==null?void 0:m.current)==null?void 0:S.editor;x&&x.updateOptions({readOnly:l})},[l]);const[p,y]=v.useState(!1);v.useEffect(()=>{var _;const x=(_=m==null?void 0:m.current)==null?void 0:_.editor;if(!x)return;const S=x.getModel();if(!S)return;Qi.editor.setModelLanguage(S,i);const C=Qi.editor.onDidChangeMarkers(()=>{const w=Qi.editor.getModelMarkers({owner:S.getLanguageId(),resource:S.uri});y(w.length>0),s(w.length>0?w.map(k=>k.message).join(`
480
480
  `):void 0)});return()=>C.dispose()},[i,s]),Ra(f,()=>{var S;const x=(S=m==null?void 0:m.current)==null?void 0:S.editor;x&&(x.layout(),u(!0))});const b=Xo();return v.useEffect(()=>{var S;const x=(S=m==null?void 0:m.current)==null?void 0:S.editor;x&&x.updateOptions({theme:b.activeTheme==="dark"?"data-editor-dark":"data-editor-light"})},[b.activeTheme]),g.jsx(Wge,{className:e.className,"aria-invalid":p?"true":void 0,ref:d,children:g.jsx(Rge,{id:t,"data-cy":t,ref:f,className:"data-editor","aria-disabled":c?"false":"true"})})}const Wge=Pe.div`
481
481
  position: relative;
482
482
  min-height: 33px;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ansible/ansible-ui-framework",
3
3
  "description": "A framework for building applications using PatternFly.",
4
- "version": "2.4.2584",
4
+ "version": "2.4.2585",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",