@mohsinonxrm/pptb-commandbar-studio 0.8.0 → 0.9.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/CHANGELOG.md +578 -0
  2. package/README.md +82 -61
  3. package/dist/assets/BulkPublishModal-DjdSDcWe.js +36 -0
  4. package/dist/assets/CommandEditorPanel-DYsxUTOk.js +1 -0
  5. package/dist/assets/CommandPalette-DihgRpHI.js +1 -0
  6. package/dist/assets/CompareView-CdQo0D6e.js +7 -0
  7. package/dist/assets/CrmParameterEditor-DO6Rt764.js +1 -0
  8. package/dist/assets/EditorDrawer-Cid60F3b.js +2 -0
  9. package/dist/assets/HideInsteadOfDeleteModal-Bk_foggy.js +1 -0
  10. package/dist/assets/IconPickerModal-CW_pvpVS.js +1 -0
  11. package/dist/assets/ImportXmlModal-BcszuTi-.js +1 -0
  12. package/dist/assets/MonacoEditor-DweI16yt.js +2 -0
  13. package/dist/assets/NewButtonModal-C2fAUuZI.js +1 -0
  14. package/dist/assets/NewGroupModal-BDr4DPBs.js +1 -0
  15. package/dist/assets/NewTabModal-CYc1fc2A.js +1 -0
  16. package/dist/assets/RuleEditorPanel-BxGrJYo4.js +1 -0
  17. package/dist/assets/ScriptView-tkdIK4sg.js +1 -0
  18. package/dist/assets/TabDisplayRulesPanel-S_AxUWfB.js +1 -0
  19. package/dist/assets/TranslationsView-DZIGE2pC.js +1 -0
  20. package/dist/assets/WebResourceBrowser-Dc3kBMvH.js +1 -0
  21. package/dist/assets/XmlView-B0weY9hR.js +2 -0
  22. package/dist/assets/dnd-iy5K5XAJ.js +5 -0
  23. package/dist/assets/fluent-ui-CQyNN9H3.js +59 -0
  24. package/dist/assets/index-D5GCH8nj.css +1 -0
  25. package/dist/assets/index-DRTwBo4g.js +136 -0
  26. package/dist/assets/monaco-DQA8g3bM.css +1 -0
  27. package/dist/assets/monaco-cQE5XS3B.js +1010 -0
  28. package/dist/assets/monacoSetup-BIq1zGyP.js +1 -0
  29. package/dist/assets/preload-helper-PPVm8Dsz.js +1 -0
  30. package/dist/assets/ruleKinds-BKTUiZ1-.js +1 -0
  31. package/dist/assets/{server.browser-xEJRzS2D.js → server.browser-DTeSoizu.js} +1 -1
  32. package/dist/assets/useReplaceWebResourceConfirm-BhU1AM5L.js +1 -0
  33. package/dist/assets/useStableKeys-49o4VnxU.js +1 -0
  34. package/dist/assets/{xmlValidator-BkeotXuB.js → xmlValidator-CnbyWxHe.js} +2 -2
  35. package/dist/icons/icon.svg +11 -4
  36. package/dist/index.html +15 -11
  37. package/index.html +10 -4
  38. package/package.json +3 -1
  39. package/dist/assets/BulkPublishModal-mJ41AWew.js +0 -36
  40. package/dist/assets/CommandEditorPanel-BiP1kPHY.js +0 -1
  41. package/dist/assets/CommandPalette-q51_0qRZ.js +0 -1
  42. package/dist/assets/ConflictDrawer-CdWv_PbN.js +0 -1
  43. package/dist/assets/DiffViewer-BQP5f73U.js +0 -7
  44. package/dist/assets/HideInsteadOfDeleteModal-C9r6ah5p.js +0 -1
  45. package/dist/assets/IconPickerModal-B81Tnf5i.js +0 -1
  46. package/dist/assets/ImportXmlModal-C0cMaS59.js +0 -1
  47. package/dist/assets/LocalizationEditor-DniDtrZV.js +0 -1
  48. package/dist/assets/MonacoEditor-uzfuRCpJ.js +0 -2
  49. package/dist/assets/NewButtonModal-BXpX1Ld5.js +0 -1
  50. package/dist/assets/NewGroupModal-Bh7lXq52.js +0 -1
  51. package/dist/assets/NewTabModal-Pntdk3in.js +0 -1
  52. package/dist/assets/RuleEditorPanel-BUGKgc0N.js +0 -1
  53. package/dist/assets/ScalingEditorPanel-p3-Yw3CO.js +0 -1
  54. package/dist/assets/TabDisplayRulesPanel-CSNshwaw.js +0 -1
  55. package/dist/assets/UrlComposerModal-WKSTwUcW.js +0 -1
  56. package/dist/assets/WebResourceBrowser-BK-gVU2g.js +0 -1
  57. package/dist/assets/XmlDrawer-CQJElnD1.js +0 -2
  58. package/dist/assets/abap-DLDM7-KI.js +0 -1
  59. package/dist/assets/apex-DNDY2TF8.js +0 -1
  60. package/dist/assets/azcli-Y6nb8tq_.js +0 -1
  61. package/dist/assets/bat-BwHxbl9M.js +0 -1
  62. package/dist/assets/bicep-CFznDFnq.js +0 -2
  63. package/dist/assets/cameligo-Bf6VGUru.js +0 -1
  64. package/dist/assets/clojure-Dnu-v4kV.js +0 -1
  65. package/dist/assets/coffee-Bd8akH9Z.js +0 -1
  66. package/dist/assets/cpp-BbWJElDN.js +0 -1
  67. package/dist/assets/csharp-Co3qMtFm.js +0 -1
  68. package/dist/assets/csp-D-4FJmMZ.js +0 -1
  69. package/dist/assets/css-DdJfP1eB.js +0 -3
  70. package/dist/assets/css.worker-C_6RgliQ.js +0 -97
  71. package/dist/assets/cssMode-yNaVDuBb.js +0 -1
  72. package/dist/assets/cypher-cTPe9QuQ.js +0 -1
  73. package/dist/assets/dart-BOtBlQCF.js +0 -1
  74. package/dist/assets/dnd-Cq8OftAq.js +0 -5
  75. package/dist/assets/dockerfile-BG73LgW2.js +0 -1
  76. package/dist/assets/ecl-BEgZUVRK.js +0 -1
  77. package/dist/assets/elixir-BkW5O-1t.js +0 -1
  78. package/dist/assets/flow9-BeJ5waoc.js +0 -1
  79. package/dist/assets/fluent-icons-BqJj6rDi.js +0 -1
  80. package/dist/assets/fluent-ui-QADO660t.js +0 -43
  81. package/dist/assets/freemarker2-CzWSO7cF.js +0 -3
  82. package/dist/assets/fsharp-PahG7c26.js +0 -1
  83. package/dist/assets/go-acbASCJo.js +0 -1
  84. package/dist/assets/graphql-BxJiqAUM.js +0 -1
  85. package/dist/assets/handlebars-BpG2O9CH.js +0 -1
  86. package/dist/assets/hcl-DtV1sZF8.js +0 -1
  87. package/dist/assets/html-Bm7ESfBq.js +0 -1
  88. package/dist/assets/html.worker-CLyYFd_g.js +0 -474
  89. package/dist/assets/htmlMode--CmpAV7s.js +0 -1
  90. package/dist/assets/index-D9lerlVA.css +0 -1
  91. package/dist/assets/index-Di2_5czx.js +0 -136
  92. package/dist/assets/ini-Kd9XrMLS.js +0 -1
  93. package/dist/assets/java-CXBNlu9o.js +0 -1
  94. package/dist/assets/javascript-DYy3TIq5.js +0 -1
  95. package/dist/assets/json.worker-BggoxaER.js +0 -62
  96. package/dist/assets/jsonMode-DwsyQ3o1.js +0 -7
  97. package/dist/assets/julia-cl7-CwDS.js +0 -1
  98. package/dist/assets/kotlin-s7OhZKlX.js +0 -1
  99. package/dist/assets/less-9HpZscsL.js +0 -2
  100. package/dist/assets/lexon-OrD6JF1K.js +0 -1
  101. package/dist/assets/liquid-qkuWCPaY.js +0 -1
  102. package/dist/assets/lspLanguageFeatures-Cgd9CNvq.js +0 -4
  103. package/dist/assets/lua-Cyyb5UIc.js +0 -1
  104. package/dist/assets/m3-B8OfTtLu.js +0 -1
  105. package/dist/assets/markdown-BFxVWTOG.js +0 -1
  106. package/dist/assets/mdx-CtHfOclF.js +0 -1
  107. package/dist/assets/mips-CiqrrVzr.js +0 -1
  108. package/dist/assets/monaco-BIO15LCS.js +0 -1005
  109. package/dist/assets/monaco-DdLsZAcA.css +0 -1
  110. package/dist/assets/msdax-DmeGPVcC.js +0 -1
  111. package/dist/assets/mysql-C_tMU-Nz.js +0 -1
  112. package/dist/assets/objective-c-BDtDVThU.js +0 -1
  113. package/dist/assets/pascal-vHIfCaH5.js +0 -1
  114. package/dist/assets/pascaligo-DtZ0uQbO.js +0 -1
  115. package/dist/assets/perl-Ub6l9XKa.js +0 -1
  116. package/dist/assets/pgsql-BlNEE0v7.js +0 -1
  117. package/dist/assets/php-BBUBE1dy.js +0 -1
  118. package/dist/assets/pla-DSh2-awV.js +0 -1
  119. package/dist/assets/postiats-CocnycG-.js +0 -1
  120. package/dist/assets/powerquery-tScXyioY.js +0 -1
  121. package/dist/assets/powershell-COWaemsV.js +0 -1
  122. package/dist/assets/protobuf-Brw8urJB.js +0 -2
  123. package/dist/assets/pug-8SOpv6rk.js +0 -1
  124. package/dist/assets/python-CazlH6B-.js +0 -1
  125. package/dist/assets/qsharp-Bw9ernYp.js +0 -1
  126. package/dist/assets/r-j7ic8hl3.js +0 -1
  127. package/dist/assets/razor-BfGfB6aB.js +0 -1
  128. package/dist/assets/redis-Bu5POkcn.js +0 -1
  129. package/dist/assets/redshift-Bs9aos_-.js +0 -1
  130. package/dist/assets/restructuredtext-CqXO7rUv.js +0 -1
  131. package/dist/assets/ruby-zBfavPgS.js +0 -1
  132. package/dist/assets/ruleKinds-B9hACGaq.js +0 -1
  133. package/dist/assets/rust-BzKRNQWT.js +0 -1
  134. package/dist/assets/sb-BBc9UKZt.js +0 -1
  135. package/dist/assets/scala-D9hQfWCl.js +0 -1
  136. package/dist/assets/scheme-BPhDTwHR.js +0 -1
  137. package/dist/assets/scss-CBJaRo0y.js +0 -3
  138. package/dist/assets/shell-DiJ1NA_G.js +0 -1
  139. package/dist/assets/solidity-Db0IVjzk.js +0 -1
  140. package/dist/assets/sophia-CnS9iZB_.js +0 -1
  141. package/dist/assets/sparql-CJmd_6j2.js +0 -1
  142. package/dist/assets/sql-ClhHkBeG.js +0 -1
  143. package/dist/assets/st-CHwy0fLd.js +0 -1
  144. package/dist/assets/swift-CnmFD0ga.js +0 -1
  145. package/dist/assets/systemverilog-Bs9z6M-B.js +0 -1
  146. package/dist/assets/tcl-Dm6ycUr_.js +0 -1
  147. package/dist/assets/tsMode-BZv6gTt6.js +0 -11
  148. package/dist/assets/twig-Csy3S7wG.js +0 -1
  149. package/dist/assets/typescript-BgDL1fzP.js +0 -1
  150. package/dist/assets/typespec-Btyra-wh.js +0 -1
  151. package/dist/assets/useReplaceWebResourceConfirm-BUWBVNSC.js +0 -1
  152. package/dist/assets/useStableKeys-p2OkzZWO.js +0 -1
  153. package/dist/assets/vb-Db0cS2oM.js +0 -1
  154. package/dist/assets/wgsl-BTesnYfV.js +0 -298
  155. package/dist/assets/workers-BZ4mXA5s.js +0 -1
  156. package/dist/assets/xml-Cl6spsD4.js +0 -1
  157. package/dist/assets/yaml-El-x4GhS.js +0 -1
@@ -1 +0,0 @@
1
- import{y as c}from"./fluent-icons-BqJj6rDi.js";import{a as s,u as n,an as b,aH as p,aI as m,ap as f}from"./index-Di2_5czx.js";import"./monaco-BIO15LCS.js";import"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const R=()=>{const o=s(e=>e.hideInsteadOfDelete),a=s(e=>e.closeHideInsteadOfDelete),i=s(e=>e.announce),t=n(e=>o?f(e.ribbons[o.location].tabs.find(d=>d.id===o.tabId)?.groups.find(d=>d.id===o.groupId),o.buttonId):void 0),l=n(e=>o?e.baseline[o.location]:void 0),r=n(e=>e.locLabels),u=b();return!o||!t||!l?null:c.jsx(p,{open:!0,buttonLabel:u(t.label,r,void 0,t.source?.labelToken),commandId:t.commandId,deleteBlockedReason:m(t,l),onConfirmHide:()=>{n.getState().hideOobButton(o.location,o.tabId,o.groupId,o.buttonId),i("Button hidden"),a()},onConfirmDisplayRule:()=>{n.getState().hideWithDisplayRules(t.commandId)&&i("Button hidden"),a()},onCancel:a})};export{R as HideInsteadOfDeleteModal,R as default};
@@ -1 +0,0 @@
1
- import{y as o,h as pe,E as Y,J as me,z as he}from"./fluent-icons-BqJj6rDi.js";import{u as be}from"./useReplaceWebResourceConfirm-BUWBVNSC.js";import{a as Q,u as fe,ab as I,Z as J,l as K,au as ye,av as ee,aw as we,E as Se,j as xe,ax as ke,P as L,ay as Ce,az as ve,aA as Re,aB as je,k as W}from"./index-Di2_5czx.js";import{a as l,R as oe}from"./monaco-BIO15LCS.js";import{D as Be,i as Ie,k as Ae,j as Pe,aa as Ne,d as A,l as $e,ac as Te,ad as M,I as H,C as Ee,O as ze,a1 as Fe,t as r,b as p,B as De,m as Le}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const We=[{category:"Actions",keywords:["Add","Delete","Edit","Save","Copy","Paste","Undo","Redo","Send","Print","Refresh"]},{category:"Communication",keywords:["Mail","Chat","Phone","Call","Message"]},{category:"Navigation",keywords:["Arrow","Chevron","Navigation","Home","Back","Forward"]},{category:"System",keywords:["Settings","Info","Warning","Dismiss","Question","Checkmark","Error"]},{category:"Security",keywords:["Lock","Shield","Key","Fingerprint"]},{category:"People",keywords:["Person","People","Contact","User"]},{category:"Business",keywords:["Building","Briefcase","Money","Credit","Cart","Tag","Receipt"]},{category:"Files",keywords:["Document","Folder","Attach","Upload","Download","File"]},{category:"Web",keywords:["Globe","Link","Open","Browser","World"]},{category:"Time",keywords:["Calendar","Clock","Timer","History"]},{category:"Rating",keywords:["Star","Heart","Thumb"]},{category:"View",keywords:["Eye","Zoom","View","Window","Preview"]},{category:"Layout",keywords:["Grid","List","Table","Panel","Column","Row"]},{category:"Development",keywords:["Code","Bug","Branch","Wrench","Tool","Terminal"]},{category:"Media",keywords:["Play","Pause","Stop","Video","Audio","Camera"]},{category:"Analytics",keywords:["Chart","Data","Poll","Graph","Trend"]}],Me=["Add","Delete","Edit","Save","Copy","Cut","ClipboardPaste","Share","Mail","Chat","Phone","Search","Filter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","ChevronDown","ChevronUp","Navigation","Home","Settings","Info","Warning","Checkmark","Dismiss","QuestionCircle","LockClosed","LockOpen","Shield","Person","People","PersonAdd","Building","Briefcase","Money","CreditCard","Cart","Tag","Document","DocumentBulletList","Folder","FolderOpen","Attach","ArrowDownload","ArrowUpload","Globe","Link","Open","Calendar","Clock","Timer","Star","Heart","ThumbLike","ThumbDislike","Eye","EyeOff","ZoomIn","ZoomOut","Maximize","Minimize","Grid","List","Table","TableSimple","Code","Bug","Play","Pause","Stop","Refresh","ArrowSync","ArrowUndo","ArrowRedo","Printer","Send","Rocket","Sparkle","Trophy","Lightbulb","Bot","DataBar","ChartMultiple","Poll"];function He(n){for(const y of We)if(y.keywords.some(m=>n.includes(m)))return y.category;return"General"}const re=Me.map(n=>({name:n,category:He(n)})),Ue=["All",...Array.from(new Set(re.map(n=>n.category))).sort()],Ge=he({surface:{width:"720px",maxWidth:"95vw",height:"min(580px, 90vh)",maxHeight:"90vh",overflow:"hidden"},dialogBody:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},body:{display:"flex",flexDirection:"column",flex:1,minHeight:0,overflow:"hidden",gap:r.spacingHorizontalS},toolbar:{display:"flex",alignItems:"center",gap:r.spacingHorizontalS,flexWrap:"wrap",flexShrink:0},categoryPicker:{minWidth:"180px",maxWidth:"220px"},iconGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(72px, 1fr))",gap:r.spacingHorizontalXS,overflowY:"auto",flex:1,minHeight:0,padding:r.spacingHorizontalXS},iconTile:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"4px",padding:r.spacingHorizontalXS,borderRadius:r.borderRadiusMedium,border:"1px solid transparent",cursor:"pointer",minHeight:"64px",":hover":{backgroundColor:r.colorNeutralBackground3,border:`1px solid ${r.colorNeutralStroke1}`}},iconTileSelected:{backgroundColor:r.colorBrandBackground2,border:`1px solid ${r.colorBrandStroke1}`},iconLabel:{fontSize:r.fontSizeBase100,textAlign:"center",lineHeight:1.2,wordBreak:"break-word",color:r.colorNeutralForeground2},webResourceList:{flex:1,overflowY:"auto"},webResourceRow:{display:"flex",alignItems:"center",gap:r.spacingHorizontalS,padding:`${r.spacingHorizontalXS} ${r.spacingHorizontalS}`,cursor:"pointer",borderRadius:r.borderRadiusMedium,":hover":{backgroundColor:r.colorNeutralBackground3}},uploadArea:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:r.spacingHorizontalM,border:`2px dashed ${r.colorNeutralStroke2}`,borderRadius:r.borderRadiusMedium,color:r.colorNeutralForeground3}}),Ye=()=>{const n=Ge(),y=be(),m=Q(e=>e.iconPickerOpen),w=Q(e=>e.closeIconPicker),U=fe(e=>e.setButtonProp),v=I(e=>e.selectedButtonId),R=I(e=>e.selectedGroupId),G=I(e=>e.tabId),O=I(e=>e.location),P=J(e=>e.publisherPrefix),S=J(e=>e.activeSolution),[V,c]=l.useState(null),[_,j]=l.useState(null),[u,q]=l.useState("fluent"),[N,ae]=l.useState(""),[B,se]=l.useState("All"),[x,ne]=l.useState("regular"),[i,te]=l.useState(null),[k,$]=l.useState(""),[T,E]=l.useState([]),[X,Z]=l.useState(!1),[z,le]=l.useState(""),[b,f]=l.useState(!1);oe.useEffect(()=>{m||(c(null),j(null))},[m]),oe.useEffect(()=>{!m||u!=="webresource"||(Z(!0),K("svg").then(e=>E(e)).catch(()=>E([])).finally(()=>Z(!1)))},[m,u]);const ie=l.useMemo(()=>{const e=z.toLowerCase();return T.filter(a=>!e||a.name.toLowerCase().includes(e))},[z,T]),ce=l.useMemo(()=>{const e=N.toLowerCase();return re.filter(a=>(B==="All"||a.category===B)&&(e===""||a.name.toLowerCase().includes(e)))},[N,B]),de=async()=>{if(!i||!v||!R)return;const e=W(),a=L.getState();if(c(null),!S||S.isManaged){c("Select an unmanaged solution first — the icon is added to it as an SVG web resource.");return}f(!0);try{const s=await Ce(i,x,P,ve,{busy:{onProgress:t=>a.logInfo("webresource",t)},guard:e});s.publishError&&a.logWarn("webresource",`Publishing icon web resource ${s.name} failed: ${s.publishError}. Pick the icon again or publish customizations before using the button.`),U(O,G,R,v,{icon:ee(i),image16:`$webresource:${s.name}`,image32:`$webresource:${s.name}`}),a.logInfo("webresource",`${s.created?"Uploaded":"Reusing"} icon web resource ${s.name} (solution ${S.uniqueName}).`),w()}catch(s){const t=s instanceof Error?s.message:String(s);a.logError("webresource",`Fluent icon "${i}" could not be added as a web resource: ${t}`),c(`Could not add the icon as a web resource: ${t}`)}finally{f(!1)}},ue=async()=>{if(!k||!v||!R)return;const e=Re(k),a=W(),s=L.getState();c(null),j(null);const t=e.startsWith("$webresource:")?e.slice(13).trim():null;let g=null;if(t){f(!0);try{const h=T.find(F=>F.name===t),d=await je(t,h,a);d.solutionUniqueName&&s.logInfo("webresource",`Added web resource ${t} to solution ${d.solutionUniqueName}.`),g=d.solutionWarning??null}catch(h){const d=h instanceof Error?h.message:String(h);if(/^No web resource named /.test(d)){c(d);return}g=`The icon was set, but ${t} could not be added to the solution: ${d}`,s.logError("webresource",g)}finally{f(!1)}}if(U(O,G,R,v,{image16:e,image32:e}),g){j(g);return}w()},ge=async e=>{const a=W();if(!S||S.isManaged){c("Select an unmanaged solution first — the SVG is added to it as a web resource.");return}c(null),f(!0);try{const s=await new Promise((d,F)=>{const C=new FileReader;C.onerror=()=>F(C.error??new Error("Failed to read SVG")),C.onload=()=>{const D=String(C.result??"");d(D.includes(",")?D.split(",")[1]??"":D)},C.readAsDataURL(e)}),t=`${P||"new"}_/icons/${e.name}`,g=await xe(t,s,11,{displayName:e.name,guard:a,onExisting:y.onExisting});j([g.solutionWarning,g.publishWarning].filter(Boolean).join(" ")||null),$(`$webresource:${t}`),q("webresource");const h=await K("svg");E(h)}catch(s){if(s instanceof ke)return;const t=s instanceof Error?s.message:String(s);L.getState().logError("webresource",`SVG upload failed: ${t}`),c(`Upload failed: ${t}`)}finally{f(!1)}};return o.jsxs(o.Fragment,{children:[y.dialog,o.jsx(Be,{open:m,onOpenChange:(e,a)=>!a.open&&w(),children:o.jsx(Ie,{className:n.surface,children:o.jsxs(Ae,{className:n.dialogBody,children:[o.jsx(Pe,{action:o.jsx(A,{appearance:"subtle",icon:o.jsx(pe,{}),onClick:w,"aria-label":"Close"}),children:o.jsx(Ne,{children:"Choose Icon"})}),o.jsxs($e,{className:n.body,children:[o.jsxs(Te,{selectedValue:u,onTabSelect:(e,a)=>q(a.value),size:"small",children:[o.jsx(M,{value:"fluent",children:"Fluent icons"}),o.jsx(M,{value:"webresource",children:"Web resources"}),o.jsx(M,{value:"upload",children:"Upload SVG"})]}),u==="fluent"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:n.toolbar,children:[o.jsx(H,{contentBefore:o.jsx(Y,{}),placeholder:"Search icons…",value:N,onChange:(e,a)=>ae(a.value),size:"small",style:{flex:1}}),o.jsx(Ee,{className:n.categoryPicker,placeholder:"Category",value:B,onOptionSelect:(e,a)=>se(String(a.optionValue??"All")),children:Ue.map(e=>o.jsx(ze,{value:e,text:e,children:e},e))}),o.jsx(Fe,{label:x==="regular"?"Regular":"Filled",checked:x==="filled",onChange:(e,a)=>ne(a.checked?"filled":"regular")})]}),o.jsx("div",{className:n.iconGrid,children:ce.map(e=>o.jsxs("div",{className:`${n.iconTile} ${i===e.name?n.iconTileSelected:""}`,onClick:()=>te(e.name),role:"option","aria-selected":i===e.name,title:`${e.name} — ${e.category}`,children:[o.jsx(ye,{name:ee(e.name),size:24,variant:x}),o.jsx("span",{className:n.iconLabel,children:e.name})]},e.name))}),i&&o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:r.spacingHorizontalS,padding:r.spacingHorizontalXS,backgroundColor:r.colorNeutralBackground3,borderRadius:r.borderRadiusMedium,flexShrink:0},children:[o.jsxs(p,{size:200,style:{fontFamily:r.fontFamilyMonospace},children:['ModernImage="$webresource:',we(P||"new",i,x),'"']}),o.jsx(De,{appearance:"tint",color:"success",children:"Selected"})]})]}),u==="webresource"&&o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:r.spacingHorizontalS,flex:1},children:[o.jsx(H,{contentBefore:o.jsx(Y,{}),placeholder:"Search SVG web resources...",value:z,onChange:(e,a)=>le(a.value),size:"small"}),o.jsxs("div",{className:n.webResourceList,children:[X&&o.jsx(p,{size:200,style:{color:r.colorNeutralForeground3},children:"Loading web resources..."}),!X&&ie.slice(0,200).map(e=>{const a=`$webresource:${e.name}`,s=k===a;return o.jsx("div",{className:n.webResourceRow,onClick:()=>$(a),style:{backgroundColor:s?r.colorBrandBackground2:void 0},children:o.jsx(p,{size:200,style:{fontFamily:r.fontFamilyMonospace},children:a})},e.id)})]}),o.jsx(H,{placeholder:"$webresource:publisher_/icons/…",value:k,onChange:(e,a)=>$(a.value)}),o.jsx(p,{size:100,style:{color:r.colorNeutralForeground3},children:"Both image16 and image32 will be set to this path. Use SVG for best results across all DPI levels."})]}),u==="upload"&&o.jsxs("div",{className:n.uploadArea,children:[o.jsx(me,{fontSize:48,style:{opacity:.4}}),o.jsx(p,{children:"Drag an SVG file here, or click to browse"}),o.jsx(p,{size:200,style:{color:r.colorNeutralForeground3},children:"The file will be uploaded as a web resource in the active solution."}),o.jsx("input",{type:"file",accept:".svg",style:{display:"none"},id:"icon-upload-input",disabled:b,onChange:e=>{const a=e.target.files?.[0];e.target.value="",a&&ge(a)}}),o.jsx("label",{htmlFor:"icon-upload-input",style:{display:"inline-block",cursor:"pointer",padding:"6px 12px",background:r.colorBrandBackground,color:r.colorNeutralForegroundOnBrand,borderRadius:r.borderRadiusMedium,fontSize:r.fontSizeBase300},children:b?"Uploading...":"Browse for SVG"})]}),V&&o.jsx(p,{role:"alert",size:200,style:{color:r.colorPaletteRedForeground1,flexShrink:0},children:V}),_&&o.jsxs(p,{role:"status",size:200,style:{color:r.colorPaletteMarigoldForeground1,flexShrink:0},children:["Icon applied. ",_]})]}),o.jsxs(Le,{children:[o.jsx(Se,{prefix:"Saves to"}),o.jsx("div",{style:{flex:1}}),o.jsx(A,{appearance:"secondary",onClick:w,children:"Cancel"}),u==="fluent"&&o.jsx(A,{appearance:"primary",disabled:!i||b,onClick:()=>{de()},children:b?"Adding icon…":`Use ${i??"icon"}`}),u==="webresource"&&o.jsx(A,{appearance:"primary",disabled:!k||b,onClick:()=>{ue()},children:b?"Adding icon…":"Use web resource"})]})]})})})]})};export{Ye as IconPickerModal,Ye as default};
@@ -1 +0,0 @@
1
- import{y as a}from"./fluent-icons-BqJj6rDi.js";import{a as k}from"./monaco-BIO15LCS.js";import{ah as Te,D as Be,ai as He,aj as ze,ak as Fe,al as _e,am as Pe,a as Q,u as Ue,ab as We,Z as Je}from"./index-Di2_5czx.js";import{a as Ye}from"./xmlValidator-BkeotXuB.js";import{M as Ke}from"./MonacoEditor-uzfuRCpJ.js";import{D as Ve,i as Ze,j as Qe,k as et,l as tt,b as De,M as G,f as X,ae as le,m as ot,d as ee}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";import"./ruleKinds-B9hACGaq.js";import"./crmParameters-rgfZhhzN.js";const fe=["HomepageGrid","SubGrid","Form"],ce=[...fe,"Application"],de=new Set(["Button","FlyoutAnchor","SplitButton","TextBox","ComboBox","CheckBox"]),ue=new Set(["flyout","splitButton"]),pe=/^Mscrm\.(HomepageGrid|SubGrid|Form)\.([^.]+)\./,Ie="._children",nt=/<(EnableRule|DisplayRule)\b[^>]*?\sId="([^"]+)"/,me=/\$LocLabels:([^"'\s<]+)/g,Le="cbs.import.Tab",st="cbs.import.Group",ve=(l,y)=>JSON.stringify(l)===JSON.stringify(y);function M(l){return l?Array.from(l.children):[]}function it(l){return Object.fromEntries(Array.from(l.attributes).map(y=>[y.name,y.value]))}function rt(l,y,c){const f=l.documentElement;if(f.tagName==="RibbonDiffXml")return f;const $=Array.from(l.getElementsByTagName("RibbonDiffXml")),S=Array.from(l.querySelectorAll("Entities > Entity")).flatMap(r=>{const A=M(r),v=A.find(D=>D.tagName==="RibbonDiffXml"),R=A.find(D=>D.tagName==="Name")?.textContent?.trim()??"";return v?[{name:R,rdx:v}]:[]}),w=$.find(r=>r.parentElement===f);if(S.length===0&&!w){if($.length===1)return $[0];throw new Error($.length===0?"No <RibbonDiffXml> element found.":`The XML has ${$.length} <RibbonDiffXml> elements and none belongs to a table or the application ribbon — paste just one.`)}const L=[...S.map(r=>r.name||"(unnamed table)"),...w?["the application ribbon"]:[]].join(", ");if(c){if(w)return w;throw new Error(`The XML has no application ribbon RibbonDiffXml (it has: ${L}). Open that table's ribbon to import its customizations.`)}const x=S.find(r=>r.name.toLowerCase()===y.toLowerCase());if(x)return x.rdx;throw new Error(`The XML has no RibbonDiffXml for ${y||"the loaded table"} (it has: ${L}). Load that table, or open the application ribbon for the application ribbon's customizations.`)}function at(l){switch(l){case"HomePageGrid":return"HomepageGrid";case"Form":return"Form";case"SubGridStandard":case"SubGridAssociated":return"SubGrid";default:return}}function lt(l){const y=l.languageCode??1033,c=l.entityLogicalName,f=new DOMParser().parseFromString(l.xml,"application/xml");if(f.querySelector("parsererror"))throw new Error("The XML is not well-formed.");const $=l.activeLocation==="Application",S=rt(f,c,$),w=new XMLSerializer,L=w.serializeToString(S),x=[],r=[],A=[],v=!!c&&new RegExp(`Mscrm\\.(HomepageGrid|SubGrid|Form)\\.${c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\.`,"i").test(L),R=$&&!(S===f.documentElement&&v);S!==f.documentElement?A.push(`Imported the RibbonDiffXml of ${R?"the application ribbon":c} from the document.`):$&&!R&&A.push(`The XML's Locations name the ${c} table, so it was imported as that table's customizations, not the application ribbon's.`);const D=R?"Application":fe.includes(l.activeLocation)?l.activeLocation:"HomepageGrid",j=Te(L,l.activeLocation,c),I=(e,t,o)=>{const s=new Map,n=new Map;for(const b of t)s.set(b.id,b),n.set(b.id,(n.get(b.id)??0)+1);for(const[b,g]of n)g>1&&A.push(`${o} ${b} is defined ${g} times in the XML — the last one was used.`);const u=Array.from(s.values()),i=[...e],p=[];let h=0;for(const b of u){const g=i.findIndex(T=>T.id===b.id);if(g>=0&&ve(i[g],b)){h++;continue}x.push(`${o} ${b.id} ${g>=0?"updated":"added"}`),g>=0?i[g]=b:i.push(b),p.push(b.id)}return{out:i,changedIds:p,unchanged:h}},m=I(l.commands,j.commands,"Command"),d=I(l.enableRules,j.enableRules,"Enable rule"),C=I(l.displayRules,j.displayRules,"Display rule"),B=I(l.locLabels,j.locLabels,"Label"),H=B.out,be=m.unchanged+d.unchanged+C.unchanged+B.unchanged,q=(e,t)=>e&&Pe(e,H,y)||t,N=JSON.parse(JSON.stringify(l.ribbons));let E=!1,z=0;const te=new Set,oe=e=>{if(R)return ce.slice().reverse();const t=pe.exec(e),o=t&&t[2]!=="{!EntityLogicalName}"?t[1]:D;return[o,...fe.filter(s=>s!==o),"Application"]},F=(e,t)=>{R&&e!=="Application"?A.push(`${t} is on the table's ribbon (${e}), not the application ribbon: the change is published with the table.`):!R&&e==="Application"&&A.push(`${t} was found only on the application ribbon: the change is published to the application ribbon and affects every table.`)},ne=[],O=(e,t)=>{e&&e!==t&&ne.push(e)},_=e=>{for(const t of oe(e))for(const o of N[t].tabs){const s=o.groups.find(n=>n.id===e);if(s)return{location:t,tab:o,group:s}}},P=e=>{for(const t of oe(e)){const o=N[t].tabs.find(s=>s.id===e);if(o)return{location:t,tab:o}}},U=e=>{for(const t of oe(e)){const o=[];for(const s of N[t].tabs)for(const n of s.groups)for(const u of n.buttons)u.id===e&&o.push({group:n,button:u});if(o.length>0)return{location:t,found:o}}},W=(e,t)=>{const o=pe.exec(t);let s="it isn't in the loaded ribbon";o&&o[2]!=="{!EntityLogicalName}"&&c&&o[2]!==c?s=`it belongs to the ${o[2]} table, but ${c} is loaded`:(o?.[2]==="{!EntityLogicalName}"||t.startsWith("Mscrm.Global"))&&(s="it belongs to the application ribbon, which isn't loaded with it"),r.push(`${e}: Location "${t}" not found — ${s}.`)},je=M(S.querySelector(":scope > RuleDefinitions > TabDisplayRules")).map(e=>w.serializeToString(e)).join(""),se=e=>Te(`<RibbonDiffXml><UI><Ribbon><Tabs>${e}</Tabs></Ribbon></UI><RuleDefinitions><TabDisplayRules>${je}</TabDisplayRules></RuleDefinitions></RibbonDiffXml>`,l.activeLocation,c,H).ribbon.tabs[0],J=e=>w.serializeToString(e),ge=e=>se(`<Tab Id="${Le}"><Groups><Group Id="${st}"><Controls>${J(e)}</Controls></Group></Groups></Tab>`)?.groups[0]?.buttons.find(t=>t.id===e.getAttribute("Id")),ye=e=>{const t=e.source;t&&(e.label=q(t.labelToken,e.id),t.tooltipTitleToken&&(e.tooltipTitle=q(t.tooltipTitleToken,"")),t.tooltipBodyToken&&(e.tooltipBody=q(t.tooltipBodyToken,"")))},Y=e=>{for(const t of e.source?.xml?[e.source.xml]:Object.values(e.source?.attributes??{}))for(const[,o]of t.matchAll(me))H.some(s=>s.id===o)||r.push(`${e.id}: references label ${o}, which neither the XML nor the loaded ribbon defines — add its <LocLabel>, or its text won't show unless another solution defines it (the pre-publish check warns).`)},$e=e=>({titleToken:e.getAttribute("Title")??void 0,attributes:it(e)}),xe=(e,t)=>(_e(e,{origin:"unmanaged"}),e.hidden=!1,t!==void 0&&!e.source?.attributes.Sequence&&(e.sequence=t),ye(e),Y(e),e),ie=e=>r.push(`${e}: flyout / split buttons and their menus can't be imported yet (#27).`),Ne=(e,t)=>{const o=new Set(Array.from(e.querySelectorAll("Menu *")).map(n=>n.getAttribute("Id")).filter(n=>!!n)),s=[];for(const n of t?.buttons??[])o.has(n.id)||(ue.has(n.kind)?ie(n.id):s.push(xe(n)));return s},K=(e,t)=>{const o=e.findIndex(s=>s.sequence>t.sequence);e.splice(o<0?e.length:o,0,t)},Ae=(e,t,o)=>{const s=U(e),n=ge(t);if(!s||!n)return!1;ye(n),Y(n),F(s.location,e);for(const{group:u,button:i}of s.found){if(n.kind!==i.kind)return r.push(`${e}: changing a <${t.tagName}> into another kind of control isn't supported.`),!0;if(ue.has(i.kind))return ie(e),!0;const p=JSON.parse(JSON.stringify(i));Object.assign(i,{label:n.label,tooltipTitle:n.tooltipTitle,tooltipBody:n.tooltipBody,icon:n.icon,image16:n.image16,image32:n.image32,commandId:n.commandId,templateAlias:n.templateAlias||i.templateAlias,source:structuredClone(n.source)});const h=n.source?.attributes.Sequence?n.sequence:o;h!==void 0&&h!==i.sequence&&(i.origin==="unmanaged"?(u.buttons.splice(u.buttons.indexOf(i),1),i.sequence=h,K(u.buttons,i)):r.push(`${e}: Sequence ${h} not applied — only your own buttons can be re-ordered.`)),Fe(p,i)||p.sequence!==i.sequence?(E=!0,x.push(`Updated ${i.label} (${e}) on ${s.location}`),n.templateAlias||A.push(`${e}: the override has no TemplateAlias — ${i.templateAlias} from the loaded control is kept.`)):(Object.assign(i,p),ve(p.source?.attributes,n.source?.attributes)?z++:r.push(`${e}: the override only changes attributes CBS doesn't publish yet (label, tooltip, icon, command and template alias are).`))}return!0},Se=(e,t,o,s)=>{const n=t.getAttribute("Id");if(!n)return r.push(`CustomAction ${e.getAttribute("Id")}: the control has no Id.`);const u=U(n);if(u){u.found.some(h=>h.group.id===o)||r.push(`${n}: already in group ${u.found[0].group.id} — updated there, not moved to ${o}.`),Ae(n,t,s)&&O(e.getAttribute("Id"),`${n}.Override.CustomAction`);return}const i=_(o);if(!i)return W(`${n}`,e.getAttribute("Location")??"");const p=ge(t);if(!p)return r.push(`${n}: couldn't read the <${t.tagName}>.`);if(ue.has(p.kind))return ie(n);K(i.group.buttons,xe(p,s)),F(i.location,n),O(e.getAttribute("Id"),`${n}.CustomAction`),E=!0,x.push(`Added ${p.label} (${n}) to ${i.group.id} on ${i.location}`)},Ce=(e,t)=>{const o=se(`<Tab Id="${Le}"><Groups>${J(e)}</Groups></Tab>`)?.groups[0];if(!o)return;const s=$e(e);return Y({id:o.id,source:s}),{...o,label:q(s.titleToken,o.id),source:s,sequence:e.getAttribute("Sequence")===null?t??o.sequence:o.sequence,buttons:Ne(e,o)}},Ee=(e,t,o,s)=>{const n=t.getAttribute("Id");if(!n)return r.push(`CustomAction ${e.getAttribute("Id")}: the group has no Id.`);if(_(n)){r.push(`Group ${n} already exists — it was left as is (re-titling groups isn't supported).`);for(const h of M(t.querySelector(":scope > Controls")))de.has(h.tagName)?Se(e,h,n,void 0):He(ze[h.tagName])&&r.push(`${h.getAttribute("Id")??"(no Id)"}: adding a <${h.tagName}> to an existing group isn't supported — Command Bar Studio shows it read-only.`);return}const i=P(o);if(!i)return W(`Group ${n}`,e.getAttribute("Location")??"");const p=Ce(t,s);if(!p)return r.push(`Group ${n}: couldn't read the <Group>.`);K(i.tab.groups,p),F(i.location,n),O(e.getAttribute("Id"),`${n}.CustomAction`),E=!0,x.push(`Added group ${p.label} (${n}) with ${p.buttons.length} control(s) to ${o} on ${i.location}`)},Oe=(e,t,o)=>{const s=t.getAttribute("Id");if(!s)return r.push(`CustomAction ${e.getAttribute("Id")}: the tab has no Id.`);if(P(s))return r.push(`Tab ${s} already exists — it was left as is.`);const n=se(J(t));if(!n)return r.push(`Tab ${s}: couldn't read the <Tab>.`);const u=n.tabDisplayRules.flatMap(T=>T.rules.map(Re=>Re.kind==="EntityRule"?at(Re.context):void 0)),i=R?"Application":u.find(T=>!!T)??pe.exec(s)?.[1]??D,h=Array.from(t.querySelectorAll(":scope > Groups > Group")).map(T=>Ce(T,void 0)).filter(T=>!!T),b=$e(t);Y({id:s,source:b});const g={...n,label:q(b.titleToken,s),source:b,sequence:t.getAttribute("Sequence")===null?o??n.sequence:n.sequence,groups:h};K(N[i].tabs,g),O(e.getAttribute("Id"),`${s}.CustomAction`),g.commandId&&(te.add(g.commandId),m.out.some(T=>T.id===g.commandId)||(m.out.push({id:g.commandId,enableRules:[],displayRules:[],actions:[]}),m.changedIds.push(g.commandId),A.push(`Tab ${s}: its Command ${g.commandId} has no CommandDefinition in the XML — an empty one was added.`))),E=!0,x.push(`Added tab ${g.label} (${s}) with ${h.length} group(s) to ${i}`),t.querySelector(":scope > Scaling > Scale")&&r.push(`Tab ${s}: its <Scale> steps weren't imported — CBS writes a default MaxSize for each group.`)},Ge=e=>{const t=e.getAttribute("Location")??"",o=U(t);if(o){const s=o.found.filter(n=>!n.button.hidden);for(const n of s)n.button.hidden=!0;s.length>0?(F(o.location,t),O(e.getAttribute("HideActionId"),`${t}.HideAction`),E=!0,x.push(`Hid ${s[0].button.label} (${t}) on ${o.location}`)):z++;return}if(_(t)||P(t))return r.push(`Hiding ${t}: hiding whole groups or tabs isn't supported yet — hide their buttons.`);r.push(`Hiding ${t}: not found in the loaded ribbon (it may belong to another table, or already be hidden by your customizations).`)},Xe=e=>{const t=e.getAttribute("Id")??"(no Id)",o=e.getAttribute("Location")??"",s=e.getAttribute("Sequence"),n=s===null?void 0:parseInt(s,10),u=M(e.querySelector(":scope > CommandUIDefinition"))[0];if(!u)return r.push(`CustomAction ${t}: no <CommandUIDefinition> content.`);const i=u.tagName;if(o.endsWith(Ie)){const p=o.slice(0,-Ie.length);return p.endsWith(".Controls")&&de.has(i)?Se(e,u,p.slice(0,-9),n):p.endsWith(".Groups")&&i==="Group"?Ee(e,u,p.slice(0,-7),n):p==="Mscrm.Tabs"&&i==="Tab"?Oe(e,u,n):p.endsWith(".Scaling")&&(i==="MaxSize"||i==="Scale")?r.push(`CustomAction ${t}: <${i}> scaling isn't imported — CBS writes a default MaxSize for each new group.`):r.push(`CustomAction ${t}: a <${i}> at "${o}" isn't supported.`)}if(de.has(i)&&u.getAttribute("Id")===o){if(Ae(o,u,n)){O(t,`${o}.Override.CustomAction`);return}return W(`Override ${t}`,o)}return U(o)||_(o)||P(o)?r.push(`CustomAction ${t}: replacing ${o} with a <${i}> isn't supported — only overriding a control with the same Id is.`):W(`CustomAction ${t}`,o)},Me=M(S.querySelector(":scope > CustomActions"));for(const e of Me)e.tagName==="CustomAction"?Xe(e):e.tagName==="HideCustomAction"?Ge(e):r.push(`<${e.tagName}> in CustomActions isn't supported.`);const V=new Set;for(const e of ce)for(const t of N[e].tabs)for(const o of t.groups)for(const s of o.buttons)for(const n of Be(s))V.add(n);for(const e of te)V.add(e);const re=new Set,ae=new Set;for(const e of m.out)if(V.has(e.id)){e.enableRules.forEach(t=>re.add(t)),e.displayRules.forEach(t=>ae.add(t));for(const t of e.rawRuleRefs??[]){const o=nt.exec(t.xml);o&&(o[1]==="EnableRule"?re:ae).add(o[2])}}const Z=(e,t,o,s)=>{for(const n of e)t.has(n)||r.push(`${o} ${n} was imported but ${s}, so it won't be published.`)};Z(m.changedIds,V,"Command","no button on the loaded ribbon uses it"),Z(d.changedIds,re,"Enable rule","no command a button uses references it"),Z(C.changedIds,ae,"Display rule","no command a button uses references it");const we=new Set(Array.from(J(S).matchAll(me),e=>e[1]));for(const e of ce)for(const t of N[e].tabs)for(const o of t.groups)for(const s of o.buttons)for(const n of Object.values(s.source?.attributes??{}))for(const u of n.matchAll(me))we.add(u[1]);Z(B.changedIds,we,"Label","nothing references it");const qe=Array.from(S.querySelectorAll(":scope > RuleDefinitions > TabDisplayRules > TabDisplayRule"));for(const e of qe){const t=e.getAttribute("TabCommand")??"";te.has(t)||r.push(`TabDisplayRule for ${t}: only the display rules of tabs this import adds are imported.`);const o=M(e).filter(s=>s.tagName!=="EntityRule"&&s.tagName!=="PageRule");o.length>0&&r.push(`TabDisplayRule for ${t}: ${o.map(s=>`<${s.tagName}>`).join(", ")} not imported — only EntityRule and PageRule are supported.`)}ne.length>0&&A.push(`Ids normalised: CBS publishes CustomAction / HideCustomAction ids as {control}.CustomAction, {control}.Override.CustomAction and {control}.HideAction, so ${ne.join(", ")} will be written under those ids.`),be+z>0&&x.push(`${be+z} control(s) / definition(s) were already up to date`);const ke=E||m.changedIds.length+d.changedIds.length+C.changedIds.length+B.changedIds.length>0;return{ribbons:E?N:l.ribbons,commands:m.out,enableRules:d.out,displayRules:C.out,locLabels:H,applied:x,notApplied:r,notes:A,changed:ke}}function ct(l,y){const c=Ue.getState(),f=lt({xml:l,ribbons:c.ribbons,commands:c.commands,enableRules:c.enableRules,displayRules:c.displayRules,locLabels:c.locLabels,entityLogicalName:Je.getState().activeEntity?.logicalName??c.ribbons.HomepageGrid.entityLogicalName,activeLocation:We.getState().location,languageCode:c.baseLanguageCode});return y&&f.changed&&c.applyImport(f,`${f.applied.length} change(s)`),f}const he=({items:l})=>a.jsx("ul",{style:{margin:"4px 0 0",paddingLeft:"20px",maxHeight:"160px",overflowY:"auto"},children:l.map((y,c)=>a.jsx("li",{children:a.jsx(De,{size:200,children:y})},c))}),$t=()=>{const l=Q(d=>d.importXmlOpen),y=Q(d=>d.importXmlSeed),c=Q(d=>d.importXmlNote),f=Q(d=>d.closeImportXml),[$,S]=k.useState(""),[w,L]=k.useState([]),[x,r]=k.useState(null),[A,v]=k.useState("");k.useEffect(()=>{l&&(S(y),L([]),r(null),v(""))},[l,y]);const R=d=>{S(d),x?.imported||r(null)},D=()=>{const d=Ye($);return L(d),d.every(C=>C.severity==="warning")},j=d=>{if(D()){v("");try{r({result:ct($,d),imported:d})}catch(C){r(null),v(C instanceof Error?C.message:String(C))}}},I=x?.imported===!0,m=x?.result;return a.jsx(Ve,{open:l,onOpenChange:()=>f(),children:a.jsxs(Ze,{style:{maxWidth:"960px",width:"92vw",height:"80vh",maxHeight:"860px"},children:[a.jsx(Qe,{children:"Import RibbonDiffXml"}),a.jsxs(et,{style:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsxs(tt,{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:"8px"},children:[a.jsx(De,{size:200,children:"Paste a RibbonDiffXml (for example from Ribbon Workbench or a solution's customizations.xml — the loaded table's part is used, or the application ribbon's when that is on screen). Commands, rules and labels are added or replaced by id; new buttons, groups and tabs are added to the loaded ribbon; overrides and hides edit the existing controls. Everything imported becomes one unpublished change, which Undo takes back as a whole."}),c&&!$&&a.jsx(G,{intent:"info",children:a.jsx(X,{children:c})}),a.jsx("div",{style:{flex:1,minHeight:0},children:a.jsx(Ke,{language:"xml",value:$,onChange:R,readOnly:I,height:"100%",options:{wordWrap:"on",lineNumbers:"on",padding:{top:8}}})}),w.length>0&&a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:w.map((d,C)=>a.jsx(G,{intent:d.severity==="warning"?"warning":"error",children:a.jsxs(X,{children:[d.message,d.lineHint?` (${d.lineHint})`:""]})},C))}),A&&a.jsx(G,{intent:"error",children:a.jsx(X,{children:A})}),m&&a.jsx(G,{intent:m.changed?"success":"info",layout:"multiline",children:a.jsxs(X,{children:[a.jsx(le,{children:I?m.changed?"Imported — review the changes, then publish":"Nothing to import — the session already has all of it":"Preview — nothing has changed yet"}),m.applied.length>0&&a.jsx(he,{items:m.applied})]})}),m&&m.notes.length>0&&a.jsx(G,{intent:"info",layout:"multiline",children:a.jsxs(X,{children:[a.jsx(le,{children:"Good to know"}),a.jsx(he,{items:m.notes})]})}),m&&m.notApplied.length>0&&a.jsx(G,{intent:"warning",layout:"multiline",children:a.jsxs(X,{children:[a.jsx(le,{children:I?"Not imported / won't be published":"Can't be imported / won't be published"}),a.jsx(he,{items:m.notApplied})]})})]}),a.jsx(ot,{children:I?a.jsx(ee,{appearance:"primary",onClick:f,children:"Close"}):a.jsxs(a.Fragment,{children:[a.jsx(ee,{appearance:"secondary",onClick:f,children:"Cancel"}),a.jsx(ee,{appearance:"secondary",onClick:()=>j(!1),disabled:!$.trim(),children:"Preview"}),a.jsx(ee,{appearance:"primary",onClick:()=>j(!0),disabled:!$.trim(),children:"Import"})]})})]})]})})};export{$t as ImportXmlModal,$t as default};
@@ -1 +0,0 @@
1
- import{y as t,h as J,cq as V,co as Y,z as Q,d6 as Z}from"./fluent-icons-BqJj6rDi.js";import{R,a as L}from"./monaco-BIO15LCS.js";import{a as N,u as S,d as ee,aq as w,ar as te,as as oe,at as le}from"./index-Di2_5czx.js";import{D as ae,i as ie,k as ne,j as se,aa as re,B as W,d as z,l as de,I as ce,b as X,t as s,T as U,m as pe}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const y={1033:{name:"English (US)",flag:"🇺🇸"},1031:{name:"German",flag:"🇩🇪"},1034:{name:"Spanish",flag:"🇪🇸"},1036:{name:"French",flag:"🇫🇷"},1040:{name:"Italian",flag:"🇮🇹"},1041:{name:"Japanese",flag:"🇯🇵"},1042:{name:"Korean",flag:"🇰🇷"},1043:{name:"Dutch",flag:"🇳🇱"},1044:{name:"Norwegian",flag:"🇳🇴"},1045:{name:"Polish",flag:"🇵🇱"},1046:{name:"Portuguese (Brazil)",flag:"🇧🇷"},1049:{name:"Russian",flag:"🇷🇺"},1053:{name:"Swedish",flag:"🇸🇪"},1054:{name:"Thai",flag:"🇹🇭"},1055:{name:"Turkish",flag:"🇹🇷"},1057:{name:"Indonesian",flag:"🇮🇩"},1058:{name:"Ukrainian",flag:"🇺🇦"},1066:{name:"Vietnamese",flag:"🇻🇳"},2052:{name:"Chinese (Simplified)",flag:"🇨🇳"},3082:{name:"Spanish (Spain)",flag:"🇪🇸"}},ge=Object.keys(y).map(Number),ue=Q({surface:{width:"760px",maxWidth:"95vw",maxHeight:"80vh"},body:{display:"flex",flexDirection:"column",gap:s.spacingHorizontalM,overflowY:"auto"},chipRow:{display:"flex",flexWrap:"wrap",gap:s.spacingHorizontalXS,alignItems:"center"},chip:{cursor:"pointer",userSelect:"none"},table:{width:"100%",borderCollapse:"collapse"},th:{textAlign:"left",fontSize:s.fontSizeBase100,fontWeight:s.fontWeightSemibold,color:s.colorNeutralForeground3,paddingBottom:s.spacingHorizontalXS,borderBottom:`1px solid ${s.colorNeutralStroke2}`},td:{verticalAlign:"top",paddingTop:s.spacingHorizontalXS,paddingBottom:s.spacingHorizontalXS,paddingRight:s.spacingHorizontalS,borderBottom:`1px solid ${s.colorNeutralStroke3}`},langCell:{whiteSpace:"nowrap",width:"160px"},actionCell:{width:"40px"},insertBreakBtn:{fontSize:s.fontSizeBase100,height:"20px",minWidth:"unset",padding:`0 ${s.spacingHorizontalXS}`},noteBar:{backgroundColor:s.colorNeutralBackground3,borderRadius:s.borderRadiusMedium,padding:`${s.spacingHorizontalXS} ${s.spacingHorizontalS}`,fontSize:s.fontSizeBase100,color:s.colorNeutralForeground3}}),Se=()=>{const i=ue(),u=N(e=>e.localizationEditorOpen),h=N(e=>e.localizationEditorButtonId),f=N(e=>e.closeLocalizationEditor),p=S(e=>e.locLabels),B=S(e=>e.upsertLocLabel),_=S(e=>e.batch),K=S(e=>e.setButtonProp),D=S(e=>e.ribbons),d=S(e=>e.baseLanguageCode),C=R.useMemo(()=>{if(h){for(const[e,o]of Object.entries(D))for(const a of o.tabs)for(const c of a.groups)for(const l of ee(c))if(l.id===h)return{button:l,location:e,tabId:a.id,groupId:c.id}}},[D,h]),n=C?.button,j=n?.source,b=n?w(j?.labelToken,te(n.id),n.label,p,d):null,m=n?w(j?.tooltipTitleToken,oe(n.id),n.tooltipTitle,p,d):null,x=n?w(j?.tooltipBodyToken,le(n.id),n.tooltipBody,p,d):null,T=n?[[b,j?.labelToken],[m,j?.tooltipTitleToken],[x,j?.tooltipBodyToken]].filter(([e,o])=>e===null&&o).map(([,e])=>e.slice(11)).filter((e,o,a)=>a.indexOf(e)===o):[],E=L.useCallback(()=>{const e=p.find(l=>l.id===b),o=p.find(l=>l.id===m),a=p.find(l=>l.id===x),c=new Set([d]);return e?.titles.forEach(l=>c.add(l.languageCode)),o?.titles.forEach(l=>c.add(l.languageCode)),a?.titles.forEach(l=>c.add(l.languageCode)),Array.from(c).sort((l,r)=>l===d?-1:r===d?1:l-r).map(l=>l===d?{lcid:l,label:n?.label??"",tooltipTitle:n?.tooltipTitle??"",tooltipBody:n?.tooltipBody??""}:{lcid:l,label:e?.titles.find(r=>r.languageCode===l)?.description??"",tooltipTitle:o?.titles.find(r=>r.languageCode===l)?.description??"",tooltipBody:a?.titles.find(r=>r.languageCode===l)?.description??""})},[p,b,m,x,d,n]),[g,k]=L.useState([]),[$,H]=L.useState("");R.useEffect(()=>{u&&k(E())},[u,E]);const I=(e,o,a)=>{k(c=>c.map(l=>l.lcid===e?{...l,[o]:a}:l))},A=(e,o,a)=>{if(!a)return;const c=a.selectionStart??a.value.length,l=a.selectionEnd??a.value.length,r=g.find(G=>G.lcid===e)?.[o]??"",v=r.slice(0,c)+"​​"+r.slice(l);I(e,o,v)},F=()=>{const e=parseInt($,10);!e||g.find(o=>o.lcid===e)||(k(o=>[...o,{lcid:e,label:"",tooltipTitle:"",tooltipBody:""}]),H(""))},O=e=>{e!==d&&k(o=>o.filter(a=>a.lcid!==e))},M=()=>{if(!n)return;const e=l=>g.filter(r=>r[l]).map(r=>({languageCode:r.lcid,description:r[l]})),o=g.find(l=>l.lcid===d),a={};o&&b&&o.label&&o.label!==n.label&&(a.label=o.label),o&&m&&o.tooltipTitle!==(n.tooltipTitle??"")&&(a.tooltipTitle=o.tooltipTitle||void 0),o&&x&&o.tooltipBody!==(n.tooltipBody??"")&&(a.tooltipBody=o.tooltipBody||void 0);const c=(l,r)=>!!l&&(p.some(v=>v.id===l)||e(r).some(v=>v.languageCode!==d));_(()=>{C&&Object.keys(a).length>0&&K(C.location,C.tabId,C.groupId,n.id,a),b&&c(b,"label")&&e("label").length>0&&B({id:b,titles:e("label")}),m&&c(m,"tooltipTitle")&&e("tooltipTitle").length>0&&B({id:m,titles:e("tooltipTitle")}),x&&c(x,"tooltipBody")&&e("tooltipBody").length>0&&B({id:x,titles:e("tooltipBody")})}),f()},q=g.find(e=>e.lcid===d);return t.jsx(ae,{open:u,onOpenChange:(e,o)=>!o.open&&f(),children:t.jsx(ie,{className:i.surface,children:t.jsxs(ne,{children:[t.jsxs(se,{action:t.jsx(z,{appearance:"subtle",icon:t.jsx(J,{}),onClick:f,"aria-label":"Close"}),children:[t.jsxs(re,{children:["Translations — ",q?.label||h||"Button"]}),t.jsxs(W,{appearance:"tint",size:"small",style:{marginLeft:8},children:[g.length," language",g.length!==1?"s":""]})]}),t.jsxs(de,{className:i.body,children:[t.jsxs("div",{className:i.chipRow,children:[g.map(e=>{const o=y[e.lcid];return t.jsxs(W,{className:i.chip,appearance:e.label?"filled":"outline",color:e.label?"brand":"informative",size:"medium",children:[o?.flag??"🌐"," ",o?.name??`LCID ${e.lcid}`,e.lcid!==d&&t.jsx("span",{style:{marginLeft:4,cursor:"pointer",opacity:.7},onClick:()=>O(e.lcid),"aria-label":`Remove ${o?.name}`,children:"×"})]},e.lcid)}),t.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[t.jsx(ce,{size:"small",style:{width:"180px"},placeholder:"LCID or language…",value:$,onChange:(e,o)=>H(o.value),list:"lcid-list",onKeyDown:e=>e.key==="Enter"&&F()}),t.jsx("datalist",{id:"lcid-list",children:ge.filter(e=>!g.find(o=>o.lcid===e)).map(e=>t.jsxs("option",{value:String(e),children:[y[e]?.flag," ",y[e]?.name," (",e,")"]},e))}),t.jsx(z,{size:"small",appearance:"subtle",icon:t.jsx(V,{}),onClick:F,"aria-label":"Add language"})]})]}),t.jsxs("div",{className:i.noteBar,children:["💡 LCID ",d," (",y[d]?.name??"base language",`) is the organisation's base language and cannot be removed. Use "Insert ​​" to force a line break in long labels.`]}),T.length>0&&t.jsxs("div",{className:i.noteBar,children:[T.join(", ")," ",T.length===1?"is a label":"are labels"," of another solution, shared with the controls that use ",T.length===1?"it":"them",", so ",T.length===1?"it isn't":"they aren't"," edited here. Change the text in Properties to give this button a label of its own, then add translations."]}),t.jsxs("table",{className:i.table,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{className:i.th,style:{width:"160px"},children:"Language"}),t.jsx("th",{className:i.th,children:"Label"}),t.jsx("th",{className:i.th,children:"Tooltip title"}),t.jsx("th",{className:i.th,children:"Tooltip body"}),t.jsx("th",{className:i.th,style:{width:"40px"}})]})}),t.jsx("tbody",{children:g.map(e=>{const o=y[e.lcid];return t.jsxs("tr",{children:[t.jsxs("td",{className:`${i.td} ${i.langCell}`,children:[t.jsxs(X,{size:200,children:[o?.flag??"🌐"," ",o?.name??`LCID ${e.lcid}`]}),t.jsx("br",{}),t.jsx(X,{size:100,style:{color:s.colorNeutralForeground3},children:e.lcid})]}),t.jsx("td",{className:i.td,children:t.jsx(P,{value:e.label,disabled:!b,onChange:a=>I(e.lcid,"label",a),onInsertBreak:a=>A(e.lcid,"label",a)})}),t.jsx("td",{className:i.td,children:t.jsx(P,{value:e.tooltipTitle,disabled:!m,onChange:a=>I(e.lcid,"tooltipTitle",a),onInsertBreak:a=>A(e.lcid,"tooltipTitle",a)})}),t.jsx("td",{className:i.td,children:t.jsx(he,{value:e.tooltipBody,disabled:!x,onChange:a=>I(e.lcid,"tooltipBody",a)})}),t.jsx("td",{className:`${i.td} ${i.actionCell}`,children:e.lcid!==d&&t.jsx(U,{content:"Remove this language",relationship:"label",children:t.jsx(z,{appearance:"subtle",size:"small",icon:t.jsx(Y,{}),onClick:()=>O(e.lcid),"aria-label":"Remove language"})})})]},e.lcid)})})]})]}),t.jsxs(pe,{children:[t.jsx(z,{appearance:"secondary",onClick:f,children:"Cancel"}),t.jsx(z,{appearance:"primary",onClick:M,children:"Save translations"})]})]})})})};function P({value:i,disabled:u,onChange:h,onInsertBreak:f}){const p=R.useRef(null);return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[t.jsx("input",{ref:p,style:{width:"100%",fontFamily:"inherit",fontSize:13,padding:"3px 6px",border:"1px solid var(--colorNeutralStroke1)",borderRadius:4,boxSizing:"border-box"},value:i,disabled:u,onChange:B=>h(B.target.value)}),t.jsx(U,{content:"Insert Dataverse line break (​​)",relationship:"label",children:t.jsxs("button",{type:"button",disabled:u,onClick:()=>f(p.current),style:{fontSize:11,border:"none",background:"none",color:"var(--colorNeutralForeground3)",cursor:"pointer",padding:0,textAlign:"left",display:"flex",alignItems:"center",gap:2},children:[t.jsx(Z,{fontSize:12})," Insert ⏎"]})})]})}function he({value:i,disabled:u,onChange:h}){return t.jsx("textarea",{style:{width:"100%",fontFamily:"inherit",fontSize:13,padding:"3px 6px",border:"1px solid var(--colorNeutralStroke1)",borderRadius:4,boxSizing:"border-box",resize:"vertical",minHeight:"42px"},value:i,disabled:u,onChange:f=>h(f.target.value),rows:2})}export{Se as LocalizationEditor,Se as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./monaco-BIO15LCS.js","./monaco-DdLsZAcA.css"])))=>i.map(i=>d[i]);
2
- import{a as l,R as f,_ as h}from"./monaco-BIO15LCS.js";import{y as t}from"./fluent-icons-BqJj6rDi.js";import{a as u}from"./index-Di2_5czx.js";import{a5 as x}from"./fluent-ui-QADO660t.js";const _=f.lazy(()=>h(()=>import("./monaco-BIO15LCS.js").then(o=>o.i),__vite__mapDeps([0,1]),import.meta.url)),v=({language:o,value:r,onChange:a,readOnly:s=!1,height:i="100%",options:m={},onMount:n})=>{const d=u(e=>e.themeMode)==="dark"?"vs-dark":"vs",c={readOnly:s,minimap:{enabled:!1},wordWrap:o==="xml"?"on":"off",scrollBeyondLastLine:!1,automaticLayout:!0,...m},p=e=>{a&&e!==void 0&&a(e)};return t.jsx(l.Suspense,{fallback:t.jsx(x,{size:"medium",label:"Loading editor…"}),children:t.jsx(_,{height:i,language:o,value:r,theme:d,options:c,onChange:p,onMount:n})})};export{v as M};
@@ -1 +0,0 @@
1
- import{y as e}from"./fluent-icons-BqJj6rDi.js";import{a as S}from"./monaco-BIO15LCS.js";import{a as B,u as i,ab as b,Z as m,d as O,ac as G,P as K}from"./index-Di2_5czx.js";import{D as _,i as q,j as z,k as M,l as U,F as C,I as Y,S as Z,b as $,m as H,d as I}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const tt=()=>{const n=B(t=>t.newButtonGroupId),l=B(t=>t.closeNewButton),v=i(t=>t.createButton),w=i(t=>t.upsertCommand),y=i(t=>t.batch),N=b(t=>t.selectButtonInContext),D=m(t=>t.publisherPrefix),E=m(t=>t.activeSolution),s=b(t=>t.location),k=b(t=>t.tabId),P=m(t=>t.activeEntity),R=n!==null,[r,p]=S.useState("New Button"),[x,h]=S.useState("button"),T=()=>{if(!n||!s)return;const t=E?.publisherPrefix?.trim()||D?.trim()||"new",a=P?.logicalName??"global",c=i.getState().ribbons,F=i.getState().commands,f=new Set(F.map(o=>o.id));for(const o of Object.values(c))for(const d of o.tabs)for(const L of d.groups)for(const A of O(L))f.add(A.id);const{id:g,commandId:j}=G(t,a,s,r,f),u=c[s].tabs.find(o=>o.groups.some(d=>d.id===n))?.id??k;if(!c[s].tabs.some(o=>o.id===u)){K.getState().logError("canvas",`Could not add the button: group ${n} was not found.`),l();return}y(()=>{v({location:s,tabId:u,groupId:n,button:{id:g,label:r,kind:x,templateAlias:"o1",commandId:j,hidden:!1,oob:!1,custom:!0,managed:!1}}),w({id:j,enableRules:[],displayRules:[],actions:[]})}),N(s,u,n,g),p("New Button"),h("button"),l()};return e.jsx(_,{open:R,onOpenChange:()=>l(),children:e.jsxs(q,{children:[e.jsx(z,{children:"New button"}),e.jsxs(M,{children:[e.jsxs(U,{children:[e.jsx(C,{label:"Label",required:!0,children:e.jsx(Y,{value:r,onChange:(t,a)=>p(a.value),autoFocus:!0})}),e.jsx(C,{label:"Kind",children:e.jsxs(Z,{value:x,onChange:(t,a)=>h(a.value),children:[e.jsx("option",{value:"button",children:"Button"}),e.jsx("option",{value:"flyout",children:"Flyout anchor"}),e.jsx("option",{value:"splitButton",children:"Split button"})]})}),e.jsx($,{size:200,style:{display:"block",marginTop:"8px"},children:"A command definition will be created automatically. You can edit it in the Command Editor."})]}),e.jsxs(H,{children:[e.jsx(I,{appearance:"secondary",onClick:l,children:"Cancel"}),e.jsx(I,{appearance:"primary",onClick:T,disabled:!r.trim(),children:"Create button"})]})]})]})})};export{tt as NewButtonModal,tt as default};
@@ -1 +0,0 @@
1
- import{y as e}from"./fluent-icons-BqJj6rDi.js";import{a as u}from"./monaco-BIO15LCS.js";import{a as p,u as g,ab as d}from"./index-Di2_5czx.js";import{D as y,i as v,j as w,k as G,l as C,F as x,I as F,S as L,b as S,m as f,d as h}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const O=()=>{const b=p(o=>o.newGroupOpen),a=p(o=>o.closeNewGroup),j=g(o=>o.createGroup),s=d(o=>o.location),n=d(o=>o.tabId),[t,r]=u.useState("New Group"),[i,c]=u.useState("Flexible2"),m=()=>{!s||!n||(j({location:s,tabId:n,group:{label:t,template:i,buttons:[]}}),r("New Group"),c("Flexible2"),a())};return e.jsx(y,{open:b,onOpenChange:()=>a(),children:e.jsxs(v,{children:[e.jsx(w,{children:"New group"}),e.jsxs(G,{children:[e.jsxs(C,{children:[e.jsx(x,{label:"Label",required:!0,children:e.jsx(F,{value:t,onChange:(o,l)=>r(l.value),autoFocus:!0})}),e.jsx(x,{label:"Group template",children:e.jsxs(L,{value:i,onChange:(o,l)=>c(l.value),children:[e.jsx("option",{value:"Flexible2",children:"Flexible2 (recommended)"}),e.jsx("option",{value:"Flexible",children:"Flexible"}),e.jsx("option",{value:"Layout2",children:"Layout2"}),e.jsx("option",{value:"Layout3",children:"Layout3"}),e.jsx("option",{value:"Layout4",children:"Layout4"})]})}),e.jsx(S,{size:200,style:{display:"block",marginTop:"8px"},children:"The group template defines how buttons scale when the ribbon is resized."})]}),e.jsxs(f,{children:[e.jsx(h,{appearance:"secondary",onClick:a,children:"Cancel"}),e.jsx(h,{appearance:"primary",onClick:m,disabled:!t.trim(),children:"Create group"})]})]})]})})};export{O as NewGroupModal,O as default};
@@ -1 +0,0 @@
1
- import{y as e,h as B,z as F}from"./fluent-icons-BqJj6rDi.js";import{a as S,R as E}from"./monaco-BIO15LCS.js";import{ab as _,u as c,Z as N,a as C,ad as O,ae as L,af as $,ag as H}from"./index-Di2_5czx.js";import{D as G,i as U,k as Z,j as q,aa as P,d as p,l as W,M as D,f as I,b as d,F as v,I as w,t as s,m as X}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const Y={HomepageGrid:"home grid",Form:"form",SubGrid:"sub-grid",Application:""},J=F({surface:{width:"480px",maxWidth:"95vw"},body:{display:"flex",flexDirection:"column",gap:s.spacingHorizontalM},hint:{fontFamily:s.fontFamilyMonospace,fontSize:s.fontSizeBase100,color:s.colorNeutralForeground3,backgroundColor:s.colorNeutralBackground3,padding:`${s.spacingHorizontalXS} ${s.spacingHorizontalS}`,borderRadius:s.borderRadiusMedium}}),se=()=>{const b=J(),[t,h]=S.useState("New Tab"),[g,x]=S.useState(""),o=_(a=>a.location),R=c(a=>a.createTab),u=c(a=>a.ribbons),m=c(a=>a.baseline),j=c(a=>a.layers),z=N(a=>a.activeEntity);N(a=>a.publisherPrefix);const A=C(a=>a.newTabOpen),l=C(a=>a.closeNewTab),y=E.useMemo(()=>O({baseline:m,layers:j},u),[m,j,u]),M=o==="Application"?"global":z?.logicalName??u[o].entityLogicalName,f=L(M,`${o}.${t}`,"Tab",y),n=g.trim(),r=n?$(n)??(/[^a-zA-Z0-9._]/.test(n)?"Use letters, digits, dots and underscores only":y.has(n)?"This ID is already used":null):null,T=n||f,k=()=>{r||(R(o,{id:T,label:t,tabDisplayRules:[],groups:[]}),h("New Tab"),x(""),l())};return e.jsx(G,{open:A,onOpenChange:(a,i)=>!i.open&&l(),children:e.jsx(U,{className:b.surface,children:e.jsxs(Z,{children:[e.jsx(q,{action:e.jsx(p,{appearance:"subtle",icon:e.jsx(B,{}),onClick:l,"aria-label":"Close"}),children:e.jsx(P,{children:"Add Tab"})}),e.jsxs(W,{className:b.body,children:[e.jsx(D,{intent:"info",children:e.jsx(I,{children:e.jsx(d,{size:200,children:o==="Application"?"A tab is shown only where a Tab Display Rule allows it. Add one in Tab rules before publishing.":`The tab gets a Tab Display Rule for this table's ${Y[o]}. You can change it in Tab rules.`})})}),e.jsx(D,{intent:"info",children:e.jsx(I,{children:e.jsx(d,{size:200,children:H})})}),e.jsx(v,{label:"Tab label",required:!0,children:e.jsx(w,{value:t,onChange:(a,i)=>h(i.value),placeholder:"My Tab"})}),e.jsx(v,{label:"Tab ID",hint:"Leave blank to auto-generate from label",validationState:r?"error":"none",validationMessage:r??void 0,children:e.jsx(w,{value:g,onChange:(a,i)=>x(i.value),placeholder:f})}),e.jsxs("div",{children:[e.jsx(d,{size:100,style:{color:s.colorNeutralForeground3},children:"Generated ID:"}),e.jsx("div",{className:b.hint,children:T})]}),e.jsxs(d,{size:200,style:{color:s.colorNeutralForeground3},children:["Location: ",e.jsx("strong",{children:o})]})]}),e.jsxs(X,{children:[e.jsx(p,{appearance:"secondary",onClick:l,children:"Cancel"}),e.jsx(p,{appearance:"primary",disabled:!t.trim()||!!r,onClick:k,children:"Create tab"})]})]})})})};export{se as NewTabModal,se as default};
@@ -1 +0,0 @@
1
- import{y as e,z as L,h as U,cq as X}from"./fluent-icons-BqJj6rDi.js";import{a as F,R as re}from"./monaco-BIO15LCS.js";import{a as P,u as O}from"./index-Di2_5czx.js";import{R as ie,i as te,a as V}from"./ruleKinds-B9hACGaq.js";import{b as f,t as s,I as m,d as k,B as K,F as t,S as p,an as w,P as q,c as Q,e as Y,ai as se,aj as oe,ak as ce,al as ue,M as de,f as pe,a7 as H}from"./fluent-ui-QADO660t.js";import{C as he,u as me}from"./useStableKeys-p2OkzZWO.js";import{D as xe,c as ye,S as ve,v as je,f as ge,g as Re,C as be}from"./dnd-Cq8OftAq.js";import"./crmParameters-rgfZhhzN.js";const fe=L({root:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS},search:{marginBottom:s.spacingVerticalXS},group:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXXS},groupLabel:{color:s.colorNeutralForeground3,paddingTop:s.spacingVerticalXS},kindButton:{justifyContent:"flex-start",textAlign:"left"}});function Ce(l){switch(l){case"CommandClientTypeRule":return{kind:l,type:"Modern"};case"CrmClientTypeRule":return{kind:l,type:"Web"};case"FormStateRule":return{kind:l,state:"Existing"};case"FormTypeRule":return{kind:l,type:"Main"};case"SelectionCountRule":return{kind:l,minimum:1};case"EntityRule":return{kind:l};case"CustomRule":return{kind:l,library:"$webresource:",functionName:""};case"ValueRule":return{kind:l,field:"",value:""};case"SkuRule":return{kind:l,sku:"Online"};case"OrRule":return{kind:l,groups:[[{kind:"FormStateRule",state:"Existing"}],[{kind:"FormStateRule",state:"Create"}]]};case"FeatureControlRule":return{kind:l,featureControlBit:"",expectedValue:!0};case"OrganizationSettingRule":return{kind:l,setting:"IsSharepointEnabled"};case"EntityPrivilegeRule":return{kind:l,privilegeType:"Read",privilegeDepth:"Basic"};case"EntityPropertyRule":return{kind:l,propertyName:"IsCustomizable",propertyValue:!0};case"RecordPrivilegeRule":return{kind:l,privilegeType:"Read"};case"RelationshipTypeRule":return{kind:l,appliesTo:"SelectedEntity"};case"MiscellaneousPrivilegeRule":return{kind:l,privilegeName:"ExportToExcel"};case"FormEntityContextRule":return{kind:l,entityName:""};case"PageRule":return{kind:l,address:""};case"CrmOfflineAccessStateRule":return{kind:l,state:"Online"};case"CrmOutlookClientTypeRule":return{kind:l,type:"CrmForOutlook"};case"CrmOutlookClientVersionRule":return{kind:l,major:15,minor:0,build:0,revision:0};case"DeviceTypeRule":return{kind:l,type:"Web"};case"OptionSetRule":return{kind:l,optionSet:"",stateCode:"",objectTypeCode:""};case"OutlookItemTrackingRule":return{kind:l,trackedInCrm:!0};case"OutlookRenderTypeRule":return{kind:l,type:"Web"};case"OutlookVersionRule":return{kind:l,version:"2010"};case"HideForTabletExperienceRule":return{kind:l};case"ReferencingAttributeRequiredRule":return{kind:l};default:return{kind:l}}}const J=({onSelect:l,container:c,insideOr:d=!1})=>{const h=fe(),[u,E]=F.useState(""),T=ie.map(v=>({...v,kinds:v.kinds.filter(j=>{if(c&&!te(j,c,d)||d&&j==="OrRule")return!1;const N=V[j]??j;return!u||N.toLowerCase().includes(u.toLowerCase())||j.toLowerCase().includes(u.toLowerCase())})})).filter(v=>v.kinds.length>0);return e.jsxs("div",{className:h.root,children:[e.jsx(f,{size:100,style:{color:s.colorNeutralForeground3},children:"Quick action rules are OOB references and should be bound by ID (for example, Mscrm.ShowOnQuickAction), not created as custom step kinds."}),e.jsx(m,{className:h.search,placeholder:"Search rule kinds…",value:u,onChange:(v,j)=>E(j.value)}),T.map(v=>e.jsxs("div",{className:h.group,children:[e.jsx(f,{size:100,weight:"semibold",className:h.groupLabel,children:v.label}),v.kinds.map(j=>e.jsx(k,{appearance:"subtle",className:h.kindButton,onClick:()=>l(Ce(j)),children:V[j]??j},j))]},v.label))]})},Se=L({step:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS,padding:s.spacingVerticalS,border:`1px solid ${s.colorNeutralStroke2}`,borderRadius:s.borderRadiusMedium,backgroundColor:s.colorNeutralBackground2},header:{display:"flex",alignItems:"center",justifyContent:"space-between"},kindBadge:{flexShrink:0},fields:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS},row:{display:"flex",gap:s.spacingHorizontalS,alignItems:"flex-end",flexWrap:"wrap"},nested:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS,paddingLeft:s.spacingHorizontalM,borderLeft:`2px solid ${s.colorBrandStroke2}`},nestedToolbar:{display:"flex",alignItems:"center",gap:s.spacingHorizontalXS},pickerSurface:{minWidth:"300px",maxHeight:"50vh",overflowY:"auto",padding:s.spacingVerticalS}}),G=["Create","Read","Write","Delete","Assign","Share","Append","AppendTo"],W=["None","Basic","Local","Deep","Global"],Ee=["DuplicateDetectionEnabled","GridFiltersEnabled","HasStateCode","IsConnectionsEnabled","MailMergeEnabled","WorksWithQueue","HasActivities","IsActivity","HasNotes","IsCustomizable","IsActivityParty","HasEmailAddresses","IsChildEntity","IsImportable","IsEnabledForCharts","IsBusinessProcessEnabled","HasFeedback","IsBPFEntity"],Te=["ExportToExcel","MailMerge","GoOffline","OfflineSynchronize","PublishReports"],Z=({step:l,onChange:c,onRemove:d,container:h})=>{const u=Se(),[E,T]=re.useState(null),v=l.kind!=="OrRule"&&l.kind!=="RawRule",j=v?l.invertResult:void 0,N=v?l.default:void 0,r=a=>{c({...l,...a})},$=a=>{if(!a.trim())return;const n=parseInt(a,10);return Number.isNaN(n)?void 0:n},A=()=>{switch(l.kind){case"CommandClientTypeRule":return e.jsx(t,{label:"Type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"Modern",children:"Modern (Unified Interface: web, tablets and phones)"}),e.jsx("option",{value:"Refresh",children:"Refresh (legacy updated web client)"}),e.jsx("option",{value:"Legacy",children:"Legacy (classic ribbon + Outlook list views)"})]})});case"CrmClientTypeRule":return e.jsx(t,{label:"Type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"Web",children:"Web"}),e.jsx("option",{value:"Outlook",children:"Outlook"})]})});case"FormStateRule":return e.jsx(t,{label:"State",children:e.jsx(p,{value:l.state,onChange:(a,n)=>r({state:n.value}),children:["Create","Existing","ReadOnly","Disabled","BulkEdit"].map(a=>e.jsx("option",{value:a,children:a},a))})});case"FormTypeRule":return e.jsx(t,{label:"Type",children:e.jsx(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:["Main","Preview","AppointmentBook","Dashboard","Quick","QuickCreate","Card","MainInteractionCentric"].map(a=>e.jsx("option",{value:a,children:a},a))})});case"SelectionCountRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Minimum",children:e.jsx(m,{type:"number",value:String(l.minimum??""),onChange:(a,n)=>r({minimum:$(n.value)}),style:{width:"80px"}})}),e.jsx(t,{label:"Maximum",children:e.jsx(m,{type:"number",value:String(l.maximum??""),onChange:(a,n)=>r({maximum:$(n.value)}),style:{width:"80px"}})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"}),e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})]})})]});case"EntityRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Entity name",children:e.jsx(m,{value:l.entityName??"",onChange:(a,n)=>r({entityName:n.value||void 0})})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"}),e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})]})}),e.jsx(t,{label:"Context",children:e.jsxs(p,{value:l.context??"",onChange:(a,n)=>r({context:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"Form",children:"Form"}),e.jsx("option",{value:"HomePageGrid",children:"HomePageGrid"}),e.jsx("option",{value:"SubGridStandard",children:"SubGridStandard"}),e.jsx("option",{value:"SubGridAssociated",children:"SubGridAssociated"})]})})]});case"FormEntityContextRule":return e.jsx(t,{label:"Entity name",children:e.jsx(m,{value:l.entityName,onChange:(a,n)=>r({entityName:n.value})})});case"CustomRule":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Library ($webresource:)",children:e.jsx(m,{value:l.library,onChange:(a,n)=>r({library:n.value}),placeholder:"$webresource:..."})}),e.jsx(t,{label:"Function name",children:e.jsx(m,{value:l.functionName,onChange:(a,n)=>r({functionName:n.value})})})]}),e.jsx(t,{label:"Parameters",children:e.jsx(he,{params:l.params??[],onChange:a=>r({params:a.length?a:void 0})})}),e.jsx(f,{size:100,style:{color:s.colorNeutralForeground3},children:"Async support: on Unified Interface, custom rules can return Promise<boolean>; unresolved promises default to false after 10 seconds."})]});case"CrmOfflineAccessStateRule":return e.jsx(t,{label:"State",children:e.jsxs(p,{value:l.state,onChange:(a,n)=>r({state:n.value}),children:[e.jsx("option",{value:"Online",children:"Online"}),e.jsx("option",{value:"Offline",children:"Offline"})]})});case"CrmOutlookClientTypeRule":return e.jsx(t,{label:"Type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"CrmForOutlook",children:"CrmForOutlook"}),e.jsx("option",{value:"CrmForOutlookOfflineAccess",children:"CrmForOutlookOfflineAccess"})]})});case"CrmOutlookClientVersionRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Major",children:e.jsx(m,{type:"number",value:String(l.major),onChange:(a,n)=>r({major:$(n.value)??l.major}),style:{width:"84px"}})}),e.jsx(t,{label:"Minor",children:e.jsx(m,{type:"number",value:String(l.minor??""),onChange:(a,n)=>r({minor:$(n.value)}),style:{width:"84px"}})}),e.jsx(t,{label:"Build",children:e.jsx(m,{type:"number",value:String(l.build??""),onChange:(a,n)=>r({build:$(n.value)}),style:{width:"84px"}})}),e.jsx(t,{label:"Revision",children:e.jsx(m,{type:"number",value:String(l.revision??""),onChange:(a,n)=>r({revision:$(n.value)}),style:{width:"84px"}})})]});case"DeviceTypeRule":return e.jsx(t,{label:"Device type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"None",children:"None"}),e.jsx("option",{value:"Phone",children:"Phone"}),e.jsx("option",{value:"Tablet",children:"Tablet"}),e.jsx("option",{value:"Web",children:"Web"}),e.jsx("option",{value:"Outlook",children:"Outlook"}),e.jsx("option",{value:"InteractionCentric",children:"InteractionCentric"})]})});case"EntityPrivilegeRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Entity (optional)",children:e.jsx(m,{value:l.entityName??"",onChange:(a,n)=>r({entityName:n.value||void 0})})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"}),e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})]})}),e.jsx(t,{label:"Privilege",children:e.jsx(p,{value:l.privilegeType,onChange:(a,n)=>r({privilegeType:n.value}),children:G.map(a=>e.jsx("option",{value:a,children:a},a))})}),e.jsx(t,{label:"Depth",children:e.jsx(p,{value:l.privilegeDepth,onChange:(a,n)=>r({privilegeDepth:n.value}),children:W.map(a=>e.jsx("option",{value:a,children:a},a))})})]});case"EntityPropertyRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Entity (optional)",children:e.jsx(m,{value:l.entityName??"",onChange:(a,n)=>r({entityName:n.value||void 0})})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"}),e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})]})}),e.jsx(t,{label:"Property",children:e.jsx(p,{value:l.propertyName,onChange:(a,n)=>r({propertyName:n.value}),children:Ee.map(a=>e.jsx("option",{value:a,children:a},a))})}),e.jsx(w,{label:"Property value",checked:l.propertyValue,onChange:(a,n)=>r({propertyValue:n.checked===!0})})]});case"ValueRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Field",children:e.jsx(m,{value:l.field,onChange:(a,n)=>r({field:n.value})})}),e.jsx(t,{label:"Value",children:e.jsx(m,{value:l.value,onChange:(a,n)=>r({value:n.value})})})]});case"OrRule":{const a=g=>c({...l,groups:g.filter(R=>R.length>0)}),n=(g,R)=>e.jsxs(q,{open:E===g,onOpenChange:(x,o)=>T(o.open?g:null),children:[e.jsx(Q,{children:e.jsx(k,{icon:e.jsx(X,{}),appearance:"secondary",size:"small",children:R})}),e.jsx(Y,{className:u.pickerSurface,children:e.jsx(J,{container:h,insideOr:!0,onSelect:x=>{a(g==="new"?[...l.groups,[x]]:l.groups.map((o,b)=>b===g?[...o,x]:o)),T(null)}})})]});return e.jsxs("div",{className:u.nested,children:[l.groups.map((g,R)=>e.jsxs("div",{className:u.nested,children:[e.jsxs(f,{size:100,weight:"semibold",children:[R===0?"Either":"Or",g.length>1?" (all of)":""]}),g.map((x,o)=>e.jsx(Z,{step:x,container:h,onChange:b=>a(l.groups.map((C,_)=>_===R?C.map((I,M)=>M===o?b:I):C)),onRemove:()=>a(l.groups.map((b,C)=>C===R?b.filter((_,I)=>I!==o):b))},`${R}-${o}-${x.kind}`)),e.jsx("div",{className:u.nestedToolbar,children:n(R,"And…")})]},R)),e.jsxs("div",{className:u.nestedToolbar,children:[n("new","Add Or branch"),e.jsx(f,{size:100,style:{color:s.colorNeutralForeground3},children:"An OrRule needs at least two branches."})]})]})}case"FeatureControlRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Feature control bit",children:e.jsx(m,{value:l.featureControlBit,onChange:(a,n)=>r({featureControlBit:n.value})})}),e.jsx(w,{label:"Expected value",checked:l.expectedValue,onChange:(a,n)=>r({expectedValue:n.checked===!0})})]});case"RawRule":return e.jsxs(e.Fragment,{children:[e.jsx(f,{size:100,style:{color:s.colorNeutralForeground3},children:"Command Bar Studio doesn't edit this rule; it is kept exactly as loaded."}),e.jsx("pre",{style:{margin:0,whiteSpace:"pre-wrap",fontSize:"11px"},children:l.xml})]});case"SkuRule":return e.jsx(t,{label:"SKU",children:e.jsxs(p,{value:l.sku,onChange:(a,n)=>r({sku:n.value}),children:[e.jsx("option",{value:"Online",children:"Online"}),e.jsx("option",{value:"OnPremise",children:"OnPremise"}),e.jsx("option",{value:"Spla",children:"Spla"})]})});case"OrganizationSettingRule":return e.jsx(t,{label:"Setting",children:e.jsx(p,{value:l.setting,onChange:(a,n)=>r({setting:n.value}),children:["IsSharepointEnabled","IsSOPIntegrationEnabled","IsFiscalCalendarDefined","IsReadFormModeDefined","IsBPFEntityCustomizationFeatureEnabled"].map(a=>e.jsx("option",{value:a,children:a},a))})});case"MiscellaneousPrivilegeRule":return e.jsxs("div",{className:u.row,children:[e.jsxs(t,{label:"Privilege name",children:[e.jsx(m,{value:l.privilegeName,onChange:(a,n)=>r({privilegeName:n.value}),placeholder:"ExportToExcel",list:"misc-privilege-suggestions"}),e.jsx("datalist",{id:"misc-privilege-suggestions",children:Te.map(a=>e.jsx("option",{value:a},a))})]}),e.jsx(t,{label:"Depth (optional)",children:e.jsxs(p,{value:l.privilegeDepth??"",onChange:(a,n)=>r({privilegeDepth:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),W.map(a=>e.jsx("option",{value:a,children:a},a))]})})]});case"OptionSetRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Option set",children:e.jsx(m,{value:l.optionSet,onChange:(a,n)=>r({optionSet:n.value})})}),e.jsx(t,{label:"State code",children:e.jsx(m,{value:l.stateCode,onChange:(a,n)=>r({stateCode:n.value})})}),e.jsx(t,{label:"Object type code",children:e.jsx(m,{value:l.objectTypeCode,onChange:(a,n)=>r({objectTypeCode:n.value})})})]});case"OutlookItemTrackingRule":return e.jsxs("div",{className:u.row,children:[e.jsx(w,{label:"Tracked in CRM",checked:l.trackedInCrm,onChange:(a,n)=>r({trackedInCrm:n.checked===!0})}),e.jsx(t,{label:"Applies To",children:e.jsx(p,{value:l.appliesTo??"PrimaryEntity",onChange:(a,n)=>r({appliesTo:n.value}),children:e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"})})})]});case"OutlookRenderTypeRule":return e.jsx(t,{label:"Render type",children:e.jsxs(p,{value:l.type,onChange:(a,n)=>r({type:n.value}),children:[e.jsx("option",{value:"Web",children:"Web"}),e.jsx("option",{value:"Outlook",children:"Outlook"})]})});case"OutlookVersionRule":return e.jsx(t,{label:"Outlook version",children:e.jsxs(p,{value:l.version,onChange:(a,n)=>r({version:n.value}),children:[e.jsx("option",{value:"2003",children:"2003"}),e.jsx("option",{value:"2007",children:"2007"}),e.jsx("option",{value:"2010",children:"2010"})]})});case"PageRule":return e.jsx(t,{label:"Address pattern",children:e.jsx(m,{value:l.address,onChange:(a,n)=>r({address:n.value}),placeholder:"main.aspx"})});case"RecordPrivilegeRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Privilege",children:e.jsx(p,{value:l.privilegeType,onChange:(a,n)=>r({privilegeType:n.value}),children:G.map(a=>e.jsx("option",{value:a,children:a},a))})}),e.jsx(t,{label:"Applies To",children:e.jsxs(p,{value:l.appliesTo??"",onChange:(a,n)=>r({appliesTo:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Default"}),e.jsx("option",{value:"PrimaryEntity",children:"PrimaryEntity"})]})})]});case"RelationshipTypeRule":return e.jsxs("div",{className:u.row,children:[e.jsx(t,{label:"Applies To",children:e.jsx(p,{value:l.appliesTo,disabled:!0,children:e.jsx("option",{value:"SelectedEntity",children:"SelectedEntity"})})}),e.jsx(t,{label:"Relationship type",children:e.jsxs(p,{value:l.relationshipType??"",onChange:(a,n)=>r({relationshipType:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"OneToMany",children:"OneToMany"}),e.jsx("option",{value:"ManyToMany",children:"ManyToMany"}),e.jsx("option",{value:"NoRelationship",children:"NoRelationship"})]})}),e.jsx(w,{label:"Allow custom relationship",checked:l.allowCustomRelationship===!0,onChange:(a,n)=>r({allowCustomRelationship:n.checked===!0})}),e.jsx(w,{label:"Allow system relationship",checked:l.allowSystemRelationship===!0,onChange:(a,n)=>r({allowSystemRelationship:n.checked===!0})})]});default:return e.jsxs(f,{size:200,italic:!0,style:{color:s.colorNeutralForeground3},children:[l.kind," — no additional parameters"]})}};return e.jsxs("div",{className:u.step,role:"listitem",children:[e.jsxs("div",{className:u.header,children:[e.jsx(K,{appearance:"outline",size:"small",className:u.kindBadge,children:V[l.kind]??l.kind}),e.jsx(k,{appearance:"subtle",icon:e.jsx(U,{}),size:"small",onClick:d,"aria-label":`Remove ${l.kind} step`})]}),e.jsxs("div",{className:u.fields,children:[A(),e.jsx("div",{className:u.row,children:v&&e.jsxs(e.Fragment,{children:[e.jsx(t,{label:"Default",title:"Value the rule returns when it cannot be evaluated.",children:e.jsxs(p,{value:N===void 0?"":String(N),onChange:(a,n)=>r({default:n.value===""?void 0:n.value==="true"}),children:[e.jsx("option",{value:"",children:"(not set)"}),e.jsx("option",{value:"true",children:"true"}),e.jsx("option",{value:"false",children:"false"})]})}),e.jsx(w,{label:"Invert result",checked:j===!0,title:"Reverse the evaluated result.",onChange:(a,n)=>r({invertResult:n.checked===!0?!0:void 0})})]})})]})]})};function Ne(l){return l.length===0?"No steps defined — a rule needs at least one before it can be published.":l.map(B).join(" AND ")}function B(l){const c="invertResult"in l&&l.invertResult?"NOT ":"";switch(l.kind){case"SelectionCountRule":{const d=l.minimum!==void 0?`at least ${l.minimum}`:null,h=l.maximum!==void 0?`at most ${l.maximum}`:null,u=[d,h].filter(Boolean).join(" and "),E=l.appliesTo?` (${l.appliesTo})`:"";return`${c}Selection count is ${u}${E}`}case"EntityRule":{const d=l.entityName??"any entity",h=l.context?` in ${l.context} context`:"",u=l.appliesTo?` (${l.appliesTo})`:"";return`${c}Entity is "${d}"${h}${u}`}case"FormStateRule":return`${c}Form state is "${l.state}"`;case"CommandClientTypeRule":return`${c}Client type is "${l.type}" (${$e(l.type)})`;case"CrmClientTypeRule":return`${c}CRM client type is "${l.type}"`;case"CustomRule":return`${c}Custom rule: ${l.functionName}() from ${l.library}`;case"OrRule":return`(${l.groups.map(h=>h.length===1?B(h[0]):`(${h.map(B).join(" AND ")})`).join(" OR ")})`;case"FeatureControlRule":return`${c}Feature "${l.featureControlBit}" is ${l.expectedValue?"on":"off"}`;case"RawRule":return`${l.tagName} (kept as XML)`;case"MiscellaneousPrivilegeRule":{const d=l.privilegeDepth?` at ${l.privilegeDepth} depth`:"";return`${c}User has "${l.privilegeName}" privilege${d}`}case"EntityPrivilegeRule":{const d=l.entityName?` on "${l.entityName}"`:"",h=l.appliesTo?` (${l.appliesTo})`:"";return`${c}User has ${l.privilegeType} privilege${d} at ${l.privilegeDepth} depth${h}`}case"EntityPropertyRule":{const d=l.entityName?` for "${l.entityName}"`:"";return`${c}Entity property "${l.propertyName}" is ${l.propertyValue}${d}`}case"FormTypeRule":return`${c}Form type is "${l.type}"`;case"FormEntityContextRule":return`${c}Form entity context is "${l.entityName}"`;case"ValueRule":return`${c}Field "${l.field}" equals "${l.value}"`;case"SkuRule":return`${c}SKU is "${l.sku}"`;case"HideForTabletExperienceRule":return`${c}Hide for tablet experience`;case"OrganizationSettingRule":return`${c}Organization setting "${l.setting}" is enabled`;case"PageRule":return`${c}Page address matches "${l.address}"`;case"RecordPrivilegeRule":{const d=l.appliesTo?` (${l.appliesTo})`:"";return`${c}User has ${l.privilegeType} privilege on current record${d}`}case"RelationshipTypeRule":{const d=l.relationshipType??"any";return`${c}Relationship type is "${d}" (${l.appliesTo})`}case"ReferencingAttributeRequiredRule":return`${c}Referencing attribute is required`;case"OutlookItemTrackingRule":return`${c}Outlook item is ${l.trackedInCrm?"":"not "}tracked in CRM`;case"OutlookRenderTypeRule":return`${c}Outlook render type is "${l.type}"`;case"OutlookVersionRule":return`${c}Outlook version is "${l.version}"`;case"CrmOfflineAccessStateRule":return`${c}CRM offline state is "${l.state}"`;case"CrmOutlookClientTypeRule":return`${c}CRM Outlook client type is "${l.type}"`;case"CrmOutlookClientVersionRule":return`${c}CRM Outlook client version is ${l.major}.${l.minor??0}+`;case"DeviceTypeRule":return`${c}Device type is "${l.type}"`;case"OptionSetRule":return`${c}Option set "${l.optionSet}" state code is "${l.stateCode}"`;default:return"Unknown rule step"}}function $e(l){switch(l){case"Modern":return"Unified Interface";case"Refresh":return"legacy updated web client";case"Legacy":return"Classic ribbon / Outlook list views";default:return l}}const Oe=L({drawer:{width:"560px",maxWidth:"90vw"},body:{display:"flex",flexDirection:"column",gap:s.spacingVerticalS,padding:s.spacingVerticalM,overflowY:"auto"},header:{display:"flex",alignItems:"center",gap:s.spacingHorizontalS},stepsList:{display:"flex",flexDirection:"column",gap:s.spacingVerticalXS,listStyle:"none",padding:0,margin:0},summary:{padding:s.spacingVerticalS,backgroundColor:s.colorNeutralBackground3,borderRadius:s.borderRadiusMedium,fontStyle:"italic",color:s.colorNeutralForeground2,fontSize:s.fontSizeBase200},addRow:{display:"flex",gap:s.spacingHorizontalS},pickerPopover:{maxHeight:"60vh",overflowY:"auto",minWidth:"320px",padding:s.spacingVerticalM},usedBy:{color:s.colorNeutralForeground3,fontSize:s.fontSizeBase200},ruleIdRow:{display:"flex",alignItems:"flex-end",gap:s.spacingHorizontalS},ruleIdInput:{fontFamily:s.fontFamilyMonospace},error:{color:s.colorPaletteRedForeground1,fontSize:s.fontSizeBase100},sortableItem:{listStyle:"none"},sortableInner:{display:"flex",alignItems:"flex-start",gap:s.spacingHorizontalS},dragHandle:{marginTop:s.spacingVerticalS,cursor:"grab"}}),ke=[],Ve=()=>{const l=Oe(),c=P(i=>i.ruleEditorOpen),d=P(i=>i.ruleEditorId),h=P(i=>i.ruleEditorKind),u=P(i=>i.closeRuleEditor),E=P(i=>i.openRuleEditor),T=O(i=>i.enableRules),v=O(i=>i.displayRules),j=O(i=>i.commands),N=O(i=>i.upsertEnableRule),r=O(i=>i.upsertDisplayRule),$=O(i=>i.renameEnableRuleId),A=O(i=>i.renameDisplayRuleId),[a,n]=F.useState(!1),[g,R]=F.useState(""),x=h==="enable",o=x?T.find(i=>i.id===d):v.find(i=>i.id===d);F.useEffect(()=>{o&&R(o.id)},[o]);const b=me(`${h}:${o?.id??""}`,o?.steps??ke),C=b.keys,_=j.filter(i=>x?i.enableRules.includes(d??""):i.displayRules.includes(d??"")).length,I=(i,y)=>{if(!o)return;const S=[...o.steps];S[i]=y,b.update(),x?N({...o,steps:S}):r({...o,steps:S})},M=i=>{if(!o)return;const y=o.steps.filter((S,D)=>D!==i);b.remove(i),x?N({...o,steps:y}):r({...o,steps:y})},ee=i=>{if(!o)return;const y=[...o.steps,i];b.add(),x?N({...o,steps:y}):r({...o,steps:y}),n(!1)},le=i=>{if(!o||!i.over||i.active.id===i.over.id)return;const y=C.indexOf(String(i.active.id)),S=C.indexOf(String(i.over.id));if(y<0||S<0)return;const D=ge(o.steps,y,S);b.move(y,S),x?N({...o,steps:D}):r({...o,steps:D})};if(!o)return null;const ne=Ne(o.steps),ae=(x?T:v).some(i=>i.id===g.trim()&&i.id!==o.id),z=g.trim()?/\s/.test(g)?"Rule ID cannot contain whitespace.":ae?"A rule with this ID already exists.":"":"Rule ID is required.";return e.jsxs(se,{position:"end",open:c,onOpenChange:()=>u(),className:l.drawer,children:[e.jsx(oe,{children:e.jsx(ce,{action:e.jsx(k,{appearance:"subtle",icon:e.jsx(U,{}),onClick:u,"aria-label":"Close rule editor"}),children:e.jsxs("div",{className:l.header,children:[e.jsx(K,{appearance:"filled",color:x?"success":"informative",size:"small",children:x?"Enable":"Display"}),e.jsx(f,{size:400,weight:"semibold",style:{fontFamily:s.fontFamilyMonospace},children:o.id})]})})}),e.jsxs(ue,{className:l.body,children:[e.jsxs(f,{className:l.usedBy,children:["Used by ",_," command(s)"]}),e.jsxs("div",{className:l.ruleIdRow,children:[e.jsx(m,{className:l.ruleIdInput,value:g,onChange:(i,y)=>R(y.value),"aria-label":"Rule ID"}),e.jsx(k,{appearance:"secondary",size:"small",disabled:!g.trim()||!!z||g===o.id,onClick:()=>{const i=g.trim();(x?$(o.id,i):A(o.id,i))&&E(i,x?"enable":"display")},children:"Apply ID change"})]}),z&&e.jsx(f,{className:l.error,children:z}),x&&e.jsx(de,{intent:"warning",children:e.jsx(pe,{children:"Enable rules have a restricted set of allowed step types. Display-only rule kinds are disabled."})}),e.jsx(H,{children:"Steps (ALL must pass)"}),e.jsx(xe,{collisionDetection:ye,onDragEnd:le,children:e.jsx(ve,{items:C,strategy:je,children:e.jsxs("ol",{className:l.stepsList,role:"list","aria-label":"Rule steps",children:[o.steps.map((i,y)=>e.jsx(we,{id:C[y],styles:l,children:e.jsx(Z,{step:i,onChange:S=>I(y,S),onRemove:()=>M(y),container:x?"enable":"display"})},C[y])),o.steps.length===0&&e.jsx(f,{italic:!0,style:{color:s.colorNeutralForeground3},children:"No steps yet. A rule needs at least one step: add one before you publish, or remove the rule from its commands."})]})})}),e.jsxs(q,{open:a,onOpenChange:(i,y)=>n(y.open),children:[e.jsx(Q,{children:e.jsx(k,{icon:e.jsx(X,{}),appearance:"secondary",onClick:()=>n(!0),children:"Add step"})}),e.jsx(Y,{className:l.pickerPopover,children:e.jsx(J,{onSelect:ee,container:x?"enable":"display"})})]}),e.jsx(H,{children:"Plain-English summary"}),e.jsx("div",{className:l.summary,role:"note","aria-label":"Rule summary",children:ne})]})]})};function we({id:l,children:c,styles:d}){const{attributes:h,listeners:u,setNodeRef:E,setActivatorNodeRef:T,transform:v,transition:j}=Re({id:l});return e.jsx("li",{ref:E,className:d.sortableItem,style:{transform:be.Transform.toString(v),transition:j},children:e.jsxs("div",{className:d.sortableInner,children:[e.jsx(k,{ref:T,appearance:"subtle",size:"small",className:d.dragHandle,...h,...u,"aria-label":"Drag to reorder step",children:"Drag"}),e.jsx("div",{style:{flex:1},children:c})]})})}export{Ve as RuleEditorPanel,Ve as default};
@@ -1 +0,0 @@
1
- import{y as e,h as O,co as I,cq as C,z as $}from"./fluent-icons-BqJj6rDi.js";import{a as M,R as X}from"./monaco-BIO15LCS.js";import{a as k,ab as H,u as q}from"./index-Di2_5czx.js";import{ai as A,aj as P,ak as U,aa as G,d as c,al as Y,b as x,t as l,a7 as R,B,F as p,S as j,I as L}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const Z=$({drawer:{width:"600px",maxWidth:"95vw"},body:{display:"flex",flexDirection:"column",gap:l.spacingHorizontalM,padding:l.spacingHorizontalM,overflowY:"auto"},stepRow:{display:"flex",flexDirection:"column",gap:l.spacingHorizontalXS,padding:l.spacingHorizontalS,border:`1px solid ${l.colorNeutralStroke2}`,borderRadius:l.borderRadiusMedium,backgroundColor:l.colorNeutralBackground2},stepHeader:{display:"flex",alignItems:"center",gap:l.spacingHorizontalS},stepFields:{display:"flex",gap:l.spacingHorizontalS,flexWrap:"wrap",alignItems:"flex-end"},sectionLabel:{color:l.colorNeutralForeground3,textTransform:"uppercase",fontSize:l.fontSizeBase100,letterSpacing:"0.5px",fontWeight:l.fontWeightSemibold},warningNote:{backgroundColor:l.colorStatusWarningBackground1,borderRadius:l.borderRadiusMedium,padding:`${l.spacingHorizontalXS} ${l.spacingHorizontalS}`,fontSize:l.fontSizeBase100}}),D=["Large","LargeLarge","LargeMedium","LargeSmall","MediumLarge","MediumMedium","MediumSmall","SmallMedium","SmallSmall","Popup"],ae=()=>{const o=Z(),b=k(a=>a.scalingEditorOpen),S=k(a=>a.closeScalingEditor),y=H(a=>a.location),u=H(a=>a.tabId),_=q(a=>a.ribbons),E=q(a=>a.setScaling),v=_[y],r=v.tabs.find(a=>a.id===u),h=u?v.scalingByTab?.[u]:void 0,[w,g]=M.useState([]),[N,m]=M.useState([]);X.useEffect(()=>{if(!(!b||!r)){if(h){g([...h.maxSizes]),m([...h.scales]);return}g([{id:`MaxSize.${r.id}.1`,groupId:r.groups[0]?.id??"",size:"Large",sequence:10}]),m([{id:`Scale.${r.id}.1`,groupId:r.groups[0]?.id??"",size:"SmallSmall",sequence:200}])}},[b,r,h]);const d=r?.groups??[],F=()=>{g(a=>[...a,{id:`MaxSize.${a.length+1}`,groupId:d[0]?.id??"",size:"Large",sequence:(a.length+1)*10}])},T=()=>{m(a=>[...a,{id:`Scale.${a.length+1}`,groupId:d[0]?.id??"",size:"SmallSmall",sequence:200+(a.length+1)*10}])},z=(a,i)=>{g(s=>s.map((n,t)=>t===a?{...n,...i}:n))},f=(a,i)=>{m(s=>s.map((n,t)=>t===a?{...n,...i}:n))},W=()=>{E(y,u,{tabId:u,maxSizes:w,scales:N}),S()};return e.jsxs(A,{className:o.drawer,open:b,position:"end",onOpenChange:(a,i)=>!i.open&&S(),children:[e.jsx(P,{children:e.jsx(U,{action:e.jsx(c,{appearance:"subtle",icon:e.jsx(O,{}),onClick:S,"aria-label":"Close"}),children:e.jsx(G,{children:"Scaling Editor"})})}),e.jsx(Y,{children:e.jsxs("div",{className:o.body,children:[e.jsxs("div",{className:o.warningNote,children:["⚠ ",e.jsx("strong",{children:"Scaling applies ONLY to the Classic ribbon"})," — forms NOT updated to Unified Interface, and Dynamics 365 for Outlook list views. The modern command bar (Unified Interface) ignores all MaxSize and Scale definitions entirely."]}),r&&e.jsxs(x,{size:200,style:{color:l.colorNeutralForeground3},children:["Tab: ",e.jsx("strong",{children:r.label})," (",r.id,")"]}),e.jsx(R,{}),e.jsxs("div",{children:[e.jsx(x,{className:o.sectionLabel,children:"MaxSize (largest size, shown first)"}),e.jsx(x,{size:100,style:{color:l.colorNeutralForeground3,display:"block",marginBottom:l.spacingHorizontalS},children:"Sequence numbers must be lower than all Scale step sequence numbers."}),w.map((a,i)=>e.jsxs("div",{className:o.stepRow,style:{marginBottom:l.spacingHorizontalXS},children:[e.jsxs("div",{className:o.stepHeader,children:[e.jsxs(B,{appearance:"tint",color:"brand",size:"small",children:["MaxSize ",i+1]}),e.jsx("div",{style:{flex:1}}),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(I,{}),onClick:()=>g(s=>s.filter((n,t)=>t!==i))})]}),e.jsxs("div",{className:o.stepFields,children:[e.jsx(p,{label:"Group",style:{minWidth:"160px"},children:e.jsxs(j,{size:"small",value:a.groupId,onChange:(s,n)=>z(i,{groupId:n.value}),children:[d.length===0&&e.jsx("option",{value:"",children:"— no groups —"}),d.map(s=>e.jsx("option",{value:s.id,children:s.label||s.id},s.id))]})}),e.jsx(p,{label:"Size",style:{minWidth:"140px"},children:e.jsx(j,{size:"small",value:a.size,onChange:(s,n)=>z(i,{size:n.value}),children:D.map(s=>e.jsx("option",{value:s,children:s},s))})}),e.jsx(p,{label:"Sequence",style:{width:"80px"},children:e.jsx(L,{size:"small",type:"number",value:String(a.sequence),onChange:(s,n)=>z(i,{sequence:parseInt(n.value,10)||0})})})]})]},i)),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(C,{}),onClick:F,children:"Add MaxSize"})]}),e.jsx(R,{}),e.jsxs("div",{children:[e.jsx(x,{className:o.sectionLabel,children:"Scale steps (collapse order — top-down)"}),e.jsx(x,{size:100,style:{color:l.colorNeutralForeground3,display:"block",marginBottom:l.spacingHorizontalS},children:"Scale elements are applied in document order (top-down when shrinking, bottom-up when growing). Sequence numbers must be higher than all MaxSize sequence numbers."}),N.map((a,i)=>e.jsxs("div",{className:o.stepRow,style:{marginBottom:l.spacingHorizontalXS},children:[e.jsxs("div",{className:o.stepHeader,children:[e.jsxs(B,{appearance:"tint",color:"informative",size:"small",children:["Scale ",i+1]}),e.jsx("div",{style:{flex:1}}),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(I,{}),onClick:()=>m(s=>s.filter((n,t)=>t!==i))})]}),e.jsxs("div",{className:o.stepFields,children:[e.jsx(p,{label:"Group",style:{minWidth:"160px"},children:e.jsxs(j,{size:"small",value:a.groupId,onChange:(s,n)=>f(i,{groupId:n.value}),children:[d.length===0&&e.jsx("option",{value:"",children:"— no groups —"}),d.map(s=>e.jsx("option",{value:s.id,children:s.label||s.id},s.id))]})}),e.jsx(p,{label:"Size",style:{minWidth:"140px"},children:e.jsx(j,{size:"small",value:a.size,onChange:(s,n)=>f(i,{size:n.value}),children:D.map(s=>e.jsx("option",{value:s,children:s},s))})}),e.jsx(p,{label:"Sequence",style:{width:"80px"},children:e.jsx(L,{size:"small",type:"number",value:String(a.sequence),onChange:(s,n)=>f(i,{sequence:parseInt(n.value,10)||0})})})]})]},i)),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(C,{}),onClick:T,children:"Add Scale step"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:l.spacingHorizontalS,paddingTop:l.spacingHorizontalS},children:[e.jsx(c,{appearance:"secondary",onClick:S,children:"Cancel"}),e.jsx(c,{appearance:"primary",onClick:W,children:"Save scaling"})]})]})})]})};export{ae as ScalingEditorPanel,ae as default};
@@ -1 +0,0 @@
1
- import{y as e,h as $,co as q,cq as L,z as U}from"./fluent-icons-BqJj6rDi.js";import{a as k,R as V}from"./monaco-BIO15LCS.js";import{a as D,ab as H,u as f,aC as X}from"./index-Di2_5czx.js";import{ai as Y,aj as J,ak as K,aa as Q,d as m,al as Z,M as R,f as w,b as c,t as s,B as ee,F as h,S,I as P}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";function A(r){return(r??[]).flatMap(b=>b.rules)}function E(){return{kind:"EntityRule",appliesTo:"PrimaryEntity",context:"HomePageGrid"}}function F(){return{kind:"PageRule",address:""}}const ae=U({drawer:{width:"560px",maxWidth:"95vw"},body:{display:"flex",flexDirection:"column",gap:s.spacingHorizontalM,padding:s.spacingHorizontalM,overflowY:"auto"},ruleRow:{display:"flex",flexDirection:"column",gap:s.spacingHorizontalXS,padding:s.spacingHorizontalS,border:`1px solid ${s.colorNeutralStroke2}`,borderRadius:s.borderRadiusMedium,backgroundColor:s.colorNeutralBackground2},ruleHeader:{display:"flex",alignItems:"center",gap:s.spacingHorizontalS},stepFields:{display:"flex",gap:s.spacingHorizontalS,alignItems:"flex-end",flexWrap:"wrap"}}),oe=()=>{const r=ae(),b=D(a=>a.tabDisplayRulesOpen),j=D(a=>a.closeTabDisplayRules),x=H(a=>a.location),g=H(a=>a.tabId),I=f(a=>a.ribbons),B=f(a=>a.setTabDisplayRules),z=I[x],i=z.tabs.find(a=>a.id===g),u=x==="Application",C=f(a=>!a.baseline[x]?.tabs.some(l=>l.id===g)),N=f(a=>X(a,x)),o=!!i&&!C&&N!==void 0&&!N.includes(g),[p,v]=k.useState(()=>A(i?.tabDisplayRules)),[T,y]=k.useState(null);V.useEffect(()=>{b&&(y(null),v(A(i?.tabDisplayRules)))},[b,i]);const d=(a,l)=>{v(t=>t.map((n,W)=>W===a?l:n))},M=()=>{v(a=>[...a,u?F():E()])},_=a=>{v(l=>l.filter((t,n)=>n!==a))},G=()=>{if(!i){y("No active tab selected.");return}for(const[a,l]of p.entries()){if(l.kind==="PageRule"&&!u){y(`Step ${a+1}: a page rule is only valid on application ribbon tabs.`);return}if(l.kind==="PageRule"&&!l.address.trim()){y(`Step ${a+1}: enter the page address.`);return}}y(null),B(x,g,p.length>0?[{tabCommand:i.commandId??"",rules:p}]:[]),j()},O=a=>[...new Set([z.entityLogicalName,a.entityName].filter(l=>!!l))];return e.jsxs(Y,{className:r.drawer,open:b,position:"end",onOpenChange:(a,l)=>!l.open&&j(),children:[e.jsx(J,{children:e.jsx(K,{action:e.jsx(m,{appearance:"subtle",icon:e.jsx($,{}),onClick:j,"aria-label":"Close"}),children:e.jsx(Q,{children:"Tab Display Rules"})})}),e.jsx(Z,{children:e.jsxs("div",{className:r.body,children:[T&&e.jsx(R,{intent:"error",children:e.jsx(w,{children:T})}),e.jsx(R,{intent:"info",children:e.jsx(w,{children:e.jsxs(c,{size:200,children:["Tabs are ",e.jsx("strong",{children:"hidden by default"}),". A tab's display rule says where it's shown, and is bound to the tab's Command."]})})}),i&&e.jsxs("div",{children:[e.jsxs(c,{size:200,style:{color:s.colorNeutralForeground3},children:["Tab: ",e.jsx("strong",{children:i.label})," (",i.id,")"]}),i.commandId&&e.jsxs(c,{size:200,style:{color:s.colorNeutralForeground3,display:"block"},children:["Command ID:"," ",e.jsx("code",{style:{fontFamily:s.fontFamilyMonospace},children:i.commandId})]})]}),o&&e.jsx(R,{intent:"warning",children:e.jsx(w,{children:e.jsx(c,{size:200,children:"This tab isn't added by your customizations, so its display rule can't be changed here."})})}),p.length===0&&e.jsx(c,{style:{color:s.colorNeutralForeground3,textAlign:"center"},children:o?"This tab has no display rule of its own.":C&&!u?"No steps: when you publish, this new tab gets the default rule for its location (this table, where the tab is).":"No steps: this tab will be hidden."}),p.length>0&&e.jsxs("div",{className:r.ruleRow,children:[e.jsxs("div",{className:r.ruleHeader,children:[e.jsx(ee,{appearance:"outline",size:"small",children:"Display rule"}),e.jsx(c,{size:200,style:{color:s.colorNeutralForeground3},children:"The tab shows where any step matches."})]}),p.map((a,l)=>e.jsxs("div",{className:r.stepFields,children:[e.jsx(h,{label:"Type",style:{minWidth:"140px"},children:e.jsxs(S,{size:"small",value:a.kind,disabled:o,onChange:(t,n)=>{n.value==="PageRule"?d(l,F()):d(l,E())},children:[e.jsx("option",{value:"EntityRule",children:"Entity Rule"}),u&&e.jsx("option",{value:"PageRule",children:"Page Rule"})]})}),a.kind==="EntityRule"&&e.jsxs(e.Fragment,{children:[e.jsx(h,{label:"Applies to",style:{minWidth:"130px"},children:e.jsxs(S,{size:"small",value:a.appliesTo??"",disabled:o,onChange:(t,n)=>d(l,{...a,appliesTo:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"PrimaryEntity",children:"Primary entity"}),e.jsx("option",{value:"SelectedEntity",children:"Selected entity"})]})}),e.jsx(h,{label:"Context",style:{minWidth:"160px"},children:e.jsxs(S,{size:"small",value:a.context??"",disabled:o,onChange:(t,n)=>d(l,{...a,context:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),e.jsx("option",{value:"Form",children:"Form"}),e.jsx("option",{value:"HomePageGrid",children:"Home Page Grid"}),e.jsx("option",{value:"SubGridStandard",children:"SubGrid Standard"}),e.jsx("option",{value:"SubGridAssociated",children:"SubGrid Associated"})]})}),u?e.jsx(h,{label:"Table (optional)",children:e.jsx(P,{size:"small",value:a.entityName??"",disabled:o,onChange:(t,n)=>d(l,{...a,entityName:n.value||void 0}),placeholder:"any"})}):e.jsx(h,{label:"Table",children:e.jsxs(S,{size:"small",value:a.entityName??"",disabled:o,onChange:(t,n)=>d(l,{...a,entityName:n.value||void 0}),children:[e.jsx("option",{value:"",children:"Any"}),O(a).map(t=>e.jsx("option",{value:t,children:t},t))]})})]}),a.kind==="PageRule"&&e.jsx(h,{label:"Address pattern",style:{flex:1},children:e.jsx(P,{size:"small",value:a.address,disabled:o,onChange:(t,n)=>d(l,{...a,address:n.value}),placeholder:"https://…"})}),e.jsx(m,{appearance:"subtle",size:"small",icon:e.jsx(q,{}),disabled:o,onClick:()=>_(l),"aria-label":"Remove step"})]},l))]}),e.jsx(m,{appearance:"subtle",icon:e.jsx(L,{}),onClick:M,disabled:o||!i,children:"Add step"}),e.jsx(c,{size:100,style:{color:s.colorNeutralForeground3},children:u?"Entity rules and page rules are both valid on application ribbon tabs.":"A table's tabs take entity rules only."}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:s.spacingHorizontalS,paddingTop:s.spacingHorizontalS},children:[e.jsx(m,{appearance:"secondary",onClick:j,children:"Cancel"}),e.jsx(m,{appearance:"primary",onClick:G,disabled:o,children:"Save rules"})]})]})})]})};export{oe as TabDisplayRulesPanel,oe as default};
@@ -1 +0,0 @@
1
- import{y as e,h as D,co as M,cq as L,z as $}from"./fluent-icons-BqJj6rDi.js";import{a as n,R as A}from"./monaco-BIO15LCS.js";import{a as k}from"./index-Di2_5czx.js";import{D as F,i as I,k as _,j as X,aa as T,d as c,l as H,F as u,I as j,a1 as O,b as i,t as l,S as V,m as E}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const q=$({surface:{width:"720px",maxWidth:"95vw",maxHeight:"84vh",height:"84vh"},body:{display:"flex",flexDirection:"column",gap:l.spacingHorizontalM,overflowY:"auto"},paramRow:{display:"flex",alignItems:"flex-end",gap:l.spacingHorizontalS},urlPreview:{fontFamily:l.fontFamilyMonospace,fontSize:l.fontSizeBase200,backgroundColor:l.colorNeutralBackground3,padding:`${l.spacingVerticalXS} ${l.spacingHorizontalS}`,borderRadius:l.borderRadiusMedium,wordBreak:"break-all",border:`1px solid ${l.colorNeutralStroke2}`},passParamsTable:{display:"grid",gridTemplateColumns:"120px 1fr",gap:`${l.spacingVerticalXS} ${l.spacingHorizontalS}`,fontSize:l.fontSizeBase200},warnNote:{backgroundColor:l.colorStatusWarningBackground1,borderRadius:l.borderRadiusMedium,padding:`${l.spacingVerticalXS} ${l.spacingHorizontalS}`,fontSize:l.fontSizeBase100}}),f=[{key:"typename",desc:"Logical name of the table"},{key:"type",desc:"Entity type code (integer — may vary between orgs)"},{key:"id",desc:"GUID of the primary record"},{key:"orgname",desc:"Unique organization name"},{key:"userlcid",desc:"User's language LCID"},{key:"orglcid",desc:"Organization's base language LCID"}],W=[{label:"New tab (Navigate)",value:"0"},{label:"Dialog",value:"1"},{label:"Popup",value:"2"}],Z=()=>{const r=q(),S=k(a=>a.urlComposerOpen),d=k(a=>a.closeUrlComposer),[t,z]=n.useState("https://"),[m,C]=n.useState(!1),[w,R]=n.useState("0"),[h,g]=n.useState([]),x=n.useMemo(()=>{const a=[...h].filter(s=>s.key.trim()).map(s=>`${encodeURIComponent(s.key)}={${s.value||s.key}}`);return m&&f.forEach(s=>{a.push(`${s.key}={${s.key}}`)}),a.length>0?`${t}?${a.join("&")}`:t},[t,m,h]),U=n.useMemo(()=>x.replace(/&/g,"&amp;"),[x]),N=()=>{g(a=>[...a,{key:"",value:""}])},P=a=>{g(s=>s.filter((p,o)=>o!==a))},b=(a,s,p)=>{g(o=>o.map((v,B)=>B===a?{...v,[s]:p}:v))},y=t.startsWith("https://");return e.jsx(F,{open:S,onOpenChange:(a,s)=>!s.open&&d(),children:e.jsx(I,{className:r.surface,children:e.jsxs(_,{style:{height:"100%"},children:[e.jsx(X,{action:e.jsx(c,{appearance:"subtle",icon:e.jsx(D,{}),onClick:d,"aria-label":"Close"}),children:e.jsx(T,{children:"URL Action Composer"})}),e.jsxs(H,{className:r.body,children:[e.jsx(u,{label:"Base URL",required:!0,validationState:y?"none":"error",validationMessage:y?void 0:"URL must start with https://",children:e.jsx(j,{value:t,onChange:(a,s)=>z(s.value),placeholder:"https://contoso.com/page"})}),e.jsxs("div",{className:r.warnNote,children:["⚠ Ampersands in URLs must be escaped as ",e.jsx("code",{children:"&amp;"})," in XML. CBS handles this automatically when generating XML."]}),e.jsx(O,{label:"PassParams — append standard record context parameters",checked:m,onChange:(a,s)=>C(s.checked)}),m&&e.jsxs("div",{children:[e.jsx(i,{size:200,weight:"semibold",children:"Standard PassParams:"}),e.jsx("div",{className:r.passParamsTable,children:f.map(a=>e.jsxs(A.Fragment,{children:[e.jsx("code",{style:{fontFamily:l.fontFamilyMonospace,fontSize:l.fontSizeBase200},children:a.key}),e.jsx(i,{size:100,style:{color:l.colorNeutralForeground3},children:a.desc})]},a.key))}),e.jsxs(i,{size:100,style:{color:l.colorStatusWarningForeground1,marginTop:l.spacingVerticalXS,display:"block"},children:["Note: Use ",e.jsx("code",{children:"typename"})," instead of ",e.jsx("code",{children:"type"})," for reliability — type codes can differ between environments."]})]}),e.jsxs("div",{children:[e.jsx(i,{weight:"semibold",size:200,children:"Custom query parameters"}),e.jsxs(i,{size:100,style:{color:l.colorNeutralForeground3,display:"block",marginBottom:l.spacingVerticalXS},children:["Each parameter becomes a querystring key=value pair. Use CRM tokens like"," ",e.jsx("code",{children:"{id}"}),"."]}),h.map((a,s)=>e.jsxs("div",{className:r.paramRow,style:{marginBottom:l.spacingHorizontalXS},children:[e.jsx(u,{label:"Key",style:{flex:1},children:e.jsx(j,{size:"small",value:a.key,onChange:(p,o)=>b(s,"key",o.value),placeholder:"paramName"})}),e.jsx(u,{label:"Value / token",style:{flex:1},children:e.jsx(j,{size:"small",value:a.value,onChange:(p,o)=>b(s,"value",o.value),placeholder:"static value or {id}"})}),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(M,{}),onClick:()=>P(s),"aria-label":"Remove parameter",style:{marginBottom:"4px"}})]},s)),e.jsx(c,{appearance:"subtle",size:"small",icon:e.jsx(L,{}),onClick:N,children:"Add parameter"})]}),e.jsx(u,{label:"Open in",children:e.jsx(V,{value:w,onChange:(a,s)=>R(s.value),children:W.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})}),e.jsxs("div",{children:[e.jsx(i,{size:200,weight:"semibold",style:{display:"block",marginBottom:"4px"},children:"URL preview (tokens shown literally):"}),e.jsx("div",{className:r.urlPreview,children:x})]}),e.jsxs("div",{children:[e.jsxs(i,{size:200,weight:"semibold",style:{display:"block",marginBottom:"4px"},children:["XML-encoded URL (",e.jsx("code",{children:"&"})," → ",e.jsx("code",{children:"&amp;"}),"):"]}),e.jsx("div",{className:r.urlPreview,children:U})]})]}),e.jsxs(E,{children:[e.jsx(c,{appearance:"secondary",onClick:d,children:"Cancel"}),e.jsx(c,{appearance:"primary",disabled:!y,onClick:d,children:"Apply URL"})]})]})})})};export{Z as UrlComposerModal,Z as default};
@@ -1 +0,0 @@
1
- import{y as s,h as se,E as le,ba as ae,z as oe,bm as D,c_ as S,L as b}from"./fluent-icons-BqJj6rDi.js";import{a as T,Z as re,l as U,aD as ne,aE as te,aF as _,aG as ie,w as z,E as ce,j as de,ax as ue,P as ge,k as xe}from"./index-Di2_5czx.js";import{a as t}from"./monaco-BIO15LCS.js";import{u as pe}from"./useReplaceWebResourceConfirm-BUWBVNSC.js";import{a0 as B,D as he,i as me,k as fe,j as je,aa as Se,d as y,l as be,I as ye,S as we,an as ve,M as G,f as P,b as i,t as a,a2 as Ce,a3 as Re,m as ke}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const Ne=oe({surface:{width:"780px",maxWidth:"95vw",height:"80vh",maxHeight:"80vh"},body:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden",gap:a.spacingHorizontalS},toolbar:{display:"flex",alignItems:"center",gap:a.spacingHorizontalS,flexShrink:0},grid:{flex:1,overflow:"hidden"},gridWrap:{height:"100%"},gridRow:{display:"flex",alignItems:"center",gap:a.spacingHorizontalS,padding:`${a.spacingVerticalXS} ${a.spacingHorizontalS}`,cursor:"pointer",borderRadius:a.borderRadiusMedium,":hover":{backgroundColor:a.colorNeutralBackground3}},gridRowSelected:{backgroundColor:a.colorBrandBackground2},gridHeader:{display:"flex",alignItems:"center",gap:a.spacingHorizontalS,padding:`${a.spacingVerticalXS} ${a.spacingHorizontalS}`,borderBottom:`1px solid ${a.colorNeutralStroke2}`,flexShrink:0},col1:{width:"24px",flexShrink:0},col2:{width:"32px",flexShrink:0},col3:{flex:1,overflow:"hidden"},col4:{width:"60px",flexShrink:0,textAlign:"right"},col5:{width:"100px",flexShrink:0,color:a.colorNeutralForeground3},nameCell:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},descCell:{fontSize:a.fontSizeBase100,color:a.colorNeutralForeground3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),ze={js:s.jsx(b,{}),ts:s.jsx(b,{}),css:s.jsx(b,{}),html:s.jsx(b,{}),svg:s.jsx(S,{}),png:s.jsx(S,{}),gif:s.jsx(S,{}),jpg:s.jsx(S,{}),xml:s.jsx(D,{}),resx:s.jsx(D,{})};function w(x){return x.split(".").pop()?.toLowerCase()??""}const Be=[{label:"All types",value:"all"},{label:".js",value:"js"},{label:".html",value:"html"},{label:".svg",value:"svg"},{label:".png",value:"png"},{label:".css",value:"css"},{label:".xml",value:"xml"},{label:".resx",value:"resx"}],Me=({onSelect:x})=>{const n=Ne(),E=pe(),v=T(e=>e.webResourceBrowserOpen),u=T(e=>e.closeWebResourceBrowser),A=re(e=>e.publisherPrefix),F=t.useRef(null),[I,W]=t.useState([]),[C,p]=t.useState(!1),[H,M]=t.useState(!1),[$,g]=t.useState(null),[O,R]=t.useState(null),[k,X]=t.useState(""),[h,V]=t.useState("all"),[N,Y]=t.useState(!0),[m,L]=t.useState(null),f=t.useMemo(()=>{const e=k.toLowerCase();return I.filter(l=>{const o=w(l.name),r=e===""||l.name.toLowerCase().includes(e)||(l.description??"").toLowerCase().includes(e),c=h==="all"||o===h,j=!N||l.isCustom;return r&&c&&j})},[I,k,h,N]),d=f.find(e=>e.id===m)??null,q=[B({columnId:"type",renderHeaderCell:()=>s.jsx(i,{size:100,style:{color:a.colorNeutralForeground3},children:"Type"}),renderCell:e=>{const l=w(e.name),o=ze[l]??s.jsx(D,{});return s.jsx("div",{className:n.col2,style:{color:a.colorNeutralForeground3},children:o})}}),B({columnId:"name",renderHeaderCell:()=>s.jsx(i,{size:100,style:{color:a.colorNeutralForeground3},children:"Name"}),renderCell:e=>s.jsxs("div",{className:n.col3,children:[s.jsx("div",{className:n.nameCell,children:s.jsx(i,{style:{fontFamily:a.fontFamilyMonospace,fontSize:a.fontSizeBase200},children:e.name})}),e.description&&s.jsx("div",{className:n.descCell,children:e.description})]})}),B({columnId:"modified",renderHeaderCell:()=>s.jsx(i,{size:100,style:{color:a.colorNeutralForeground3},children:"Modified"}),renderCell:e=>s.jsx("div",{className:n.col5,children:s.jsx(i,{size:100,children:e.modifiedOn?new Date(e.modifiedOn).toLocaleDateString():"—"})})})];t.useEffect(()=>{v&&(p(!0),g(null),R(null),U().then(e=>W(e)).catch(e=>g(e instanceof Error?e.message:String(e))).finally(()=>p(!1)))},[v]);const Z=async()=>{p(!0),g(null);try{W(await U())}catch(e){g(e instanceof Error?e.message:String(e))}finally{p(!1)}},J=e=>new Promise((l,o)=>{const r=new FileReader;r.onerror=()=>o(r.error??new Error("Unable to read file")),r.onload=()=>{const c=String(r.result??"");l(c.includes(",")?c.split(",")[1]??"":c)},r.readAsDataURL(e)}),K=e=>{const l=w(e.name);return`${A||"new"}_/${l==="js"||l==="css"||l==="html"||l==="xml"?"scripts":l==="svg"||l==="png"?"icons":"webresources"}/${e.name}`},Q=async e=>{const l=xe();M(!0),R(null);try{const o=await J(e),r=w(e.name),c={html:1,css:2,js:3,xml:4,png:5,jpg:6,gif:7,xsl:9,ico:10,svg:11,resx:12}[r]??4,j=await de(K(e),o,c,{displayName:e.name,guard:l,onExisting:E.onExisting});await Z(),R([j.solutionWarning,j.publishWarning].filter(Boolean).join(" ")||null)}catch(o){if(o instanceof ue)return;const r=o instanceof Error?o.message:String(o);g(r),ge.getState().logError("webresource",`Upload of ${e.name} failed: ${r}`)}finally{M(!1)}},ee=()=>{d&&(z.invoke(d),x?.(d),u())};return s.jsxs(s.Fragment,{children:[E.dialog,s.jsx(he,{open:v,onOpenChange:(e,l)=>{l.open||(z.clear(),u())},children:s.jsx(me,{className:n.surface,children:s.jsxs(fe,{style:{height:"100%"},children:[s.jsx(je,{action:s.jsx(y,{appearance:"subtle",icon:s.jsx(se,{}),onClick:u,"aria-label":"Close"}),children:s.jsx(Se,{children:"Web Resource Browser"})}),s.jsxs(be,{className:n.body,children:[s.jsx("input",{ref:F,type:"file",accept:".js,.html,.svg,.png,.css,.xml,.resx,.jpg,.gif,.ico,.xsl",style:{display:"none"},onChange:e=>{const l=e.target.files?.[0];e.currentTarget.value="",l&&Q(l)}}),s.jsxs("div",{className:n.toolbar,children:[s.jsx(ye,{contentBefore:s.jsx(le,{}),placeholder:"Search by name…",value:k,onChange:(e,l)=>X(l.value),size:"small",style:{flex:1}}),s.jsx(we,{size:"small",value:h,onChange:(e,l)=>V(l.value),style:{width:"100px"},children:Be.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(ve,{label:"Custom only",checked:N,onChange:(e,l)=>Y(l.checked===!0)})]}),$&&s.jsx(G,{intent:"error",children:s.jsx(P,{children:$})}),O&&s.jsx(G,{intent:"warning",children:s.jsx(P,{children:O})}),s.jsxs("div",{className:n.grid,children:[C&&s.jsx(i,{style:{color:a.colorNeutralForeground3,padding:a.spacingHorizontalM},children:"Loading web resources…"}),!C&&f.length===0&&s.jsx(i,{style:{color:a.colorNeutralForeground3,padding:a.spacingHorizontalM,textAlign:"center"},children:"No web resources found."}),!C&&f.length>0&&s.jsxs(ne,{className:n.gridWrap,items:f,columns:q,getRowId:e=>e.id,focusMode:"composite",selectionMode:"single",subtleSelection:!0,selectedItems:m?new Set([m]):new Set,onSelectionChange:(e,l)=>{const o=[...l.selectedItems][0];L(o??null)},children:[s.jsx(te,{children:s.jsx(_,{children:({renderHeaderCell:e})=>s.jsx(Ce,{children:e()})})}),s.jsx(ie,{itemSize:56,height:360,listProps:{width:"100%"},children:({item:e,rowId:l},o)=>s.jsx(_,{style:o,className:`${n.gridRow} ${e.id===m?n.gridRowSelected:""}`,onDoubleClick:()=>{L(e.id),z.invoke(e),x?.(e),u()},children:({renderCell:r})=>s.jsx(Re,{children:r(e)})},l)})]})]}),d&&s.jsx("div",{style:{padding:a.spacingHorizontalXS,backgroundColor:a.colorNeutralBackground3,borderRadius:a.borderRadiusMedium,flexShrink:0},children:s.jsxs(i,{size:200,style:{fontFamily:a.fontFamilyMonospace},children:["$webresource:",d.name]})})]}),s.jsxs(ke,{fluid:!0,children:[s.jsx(y,{appearance:"subtle",icon:s.jsx(ae,{}),disabled:H,onClick:()=>F.current?.click(),children:H?"Uploading…":"Upload"}),s.jsx(ce,{prefix:"Uploads to"}),s.jsx("div",{style:{flex:1}}),s.jsx(y,{appearance:"secondary",onClick:u,children:"Cancel"}),s.jsx(y,{appearance:"primary",disabled:!d,onClick:ee,children:"Select"})]})]})})})]})};export{Me as WebResourceBrowser,Me as default};
@@ -1,2 +0,0 @@
1
- import{y as t,X as H,h as O,ci as V,bc as z,d5 as G,ba as U,z as W}from"./fluent-icons-BqJj6rDi.js";import{a as s}from"./monaco-BIO15LCS.js";import{u as h,a as v,l as _,g as K,c as Q,s as Z}from"./index-Di2_5czx.js";import{M as q}from"./MonacoEditor-uzfuRCpJ.js";import{ai as J,aj as Y,ak as ee,t as d,d as ne,al as te,M as j,f as $,ac as re,ad as ae,am as y}from"./fluent-ui-QADO660t.js";import"./dnd-Cq8OftAq.js";const oe=["Add","AddCircle","Alert","AppFolder","Archive","ArrowClockwise","ArrowCounterclockwise","ArrowDown","ArrowExport","ArrowImport","ArrowLeft","ArrowRight","ArrowSync","ArrowUp","Attach","Beaker","Bookmark","Bug","Building","Calculator","CalendarLtr","CalendarMonth","Call","Camera","Cart","Chart","Checkmark","CheckmarkCircle","Circle","ClipboardTask","Clock","Cloud","Code","CodeBlock","Comment","ContactCard","Copy","CreditCard","Crown","Cube","CursorClick","DataBarVertical","Delete","Diamond","Document","DocumentCopy","DocumentEdit","DocumentText","Download","Edit","Emoji","ErrorCircle","Eye","EyeOff","Filter","Flag","Flow","FolderOpen","Globe","Grid","Group","Heart","Home","Image","Info","Key","Library","Link","List","Location","Lock","Mail","Map","MegaphoneLoud","Money","MoreCircle","MoreHorizontal","Note","NoteEdit","NumberCircle1","Open","Organization","Pause","People","PeopleCommunity","Person","PersonAdd","PersonSearch","Phone","Play","Plug","Print","Question","Refresh","Rename","Save","Search","Send","Settings","Share","Shield","ShoppingBag","Sparkle","Star","StarEmphasis","Stop","Table","Tag","TaskList","TextBulletList","TextDescription","ThumbLike","Timer","ToggleLeft","ToggleRight","Tool","Translate","Umbrella","Unlock","Upload","Video","Warning","Wrench"];function A(r,g){const b=[];return b.push(r.languages.registerCompletionItemProvider("xml",{triggerCharacters:[":","$"],provideCompletionItems(l,n){const a=l.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});if(!a.includes("$LocLabels:"))return{suggestions:[]};const C=a.lastIndexOf("$LocLabels:")+11,c=a.slice(C),u={startLineNumber:n.lineNumber,startColumn:n.column-c.length,endLineNumber:n.lineNumber,endColumn:n.column};return{suggestions:h.getState().locLabels.map(m=>({label:m.id,kind:r.languages.CompletionItemKind.Reference,insertText:m.id,range:u,detail:"LocLabel reference"}))}}})),b.push(r.languages.registerCompletionItemProvider("xml",{triggerCharacters:[":","$"],provideCompletionItems(l,n){const a=l.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});if(!a.includes("$webresource:"))return{suggestions:[]};const C=a.lastIndexOf("$webresource:")+13,c=a.slice(C),u={startLineNumber:n.lineNumber,startColumn:n.column-c.length,endLineNumber:n.lineNumber,endColumn:n.column};return{suggestions:g().map(m=>({label:m,kind:r.languages.CompletionItemKind.File,insertText:m,range:u,detail:"Web resource"}))}}})),b.push(r.languages.registerCompletionItemProvider("xml",{triggerCharacters:['"'],provideCompletionItems(l,n){const a=l.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});if(!/Command\s*=\s*"[^"]*$/.test(a))return{suggestions:[]};const c=a.match(/Command\s*=\s*"([^"]*)$/)?.[1]??"",u={startLineNumber:n.lineNumber,startColumn:n.column-c.length,endLineNumber:n.lineNumber,endColumn:n.column};return{suggestions:h.getState().commands.map(m=>({label:m.id,kind:r.languages.CompletionItemKind.Function,insertText:m.id,range:u,detail:"CommandDefinition"}))}}})),b.push(r.languages.registerCompletionItemProvider("xml",{triggerCharacters:['"'],provideCompletionItems(l,n){const a=l.getValueInRange({startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});if(!/ModernImage\s*=\s*"[^"]*$/.test(a))return{suggestions:[]};const c=a.match(/ModernImage\s*=\s*"([^"]*)$/)?.[1]??"",u={startLineNumber:n.lineNumber,startColumn:n.column-c.length,endLineNumber:n.lineNumber,endColumn:n.column};return{suggestions:oe.map(i=>({label:i,kind:r.languages.CompletionItemKind.Color,insertText:i,range:u,detail:"Fluent icon (ModernImage)",documentation:`Renders the ${i}_20_Regular Fluent icon`}))}}})),b}function I(r){r.forEach(g=>g.dispose())}const se=W({drawer:{width:"960px",maxWidth:"90vw"},body:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden",padding:0},infoBar:{flexShrink:0,margin:`${d.spacingVerticalS} ${d.spacingHorizontalM}`},tabRow:{flexShrink:0,padding:`0 ${d.spacingHorizontalM}`},toolbar:{flexShrink:0,display:"flex",alignItems:"center",gap:d.spacingHorizontalS,padding:`${d.spacingVerticalXS} ${d.spacingHorizontalM}`,borderTop:`1px solid ${d.colorNeutralStroke2}`,borderBottom:`1px solid ${d.colorNeutralStroke2}`},editorContainer:{flex:1,minHeight:0,overflow:"hidden"}}),le=[{label:"Home Grid",value:"HomepageGrid"},{label:"Sub Grid",value:"SubGrid"},{label:"Form",value:"Form"},{label:"Application",value:"Application"}],Ce=()=>{const r=se(),g=v(e=>e.xmlDrawerOpen),b=v(e=>e.closeXmlDrawer),l=h(e=>e.ribbons),n=h(e=>e.baseline),a=h(e=>e.commands),C=h(e=>e.displayRules),c=h(e=>e.enableRules),u=h(e=>e.locLabels),N=v(e=>e.openImportXml),[i,m]=s.useState("HomepageGrid"),[S,p]=s.useState(null),[E,T]=s.useState(!1),f=s.useRef(0);s.useEffect(()=>{f.current++,p(null)},[i,g]);const[w,D]=s.useState([]),M=s.useRef(null),R=s.useRef(null),x=s.useRef([]);s.useEffect(()=>{g&&_().then(e=>D(e.map(o=>o.name))).catch(()=>D([]))},[g]),s.useEffect(()=>()=>{I(x.current),x.current=[]},[]);const X=s.useCallback((e,o)=>{M.current=e,R.current=o,I(x.current),x.current=A(o,()=>w)},[w]);s.useEffect(()=>{R.current&&(I(x.current),x.current=A(R.current,()=>w))},[w]);const B=()=>{M.current?.getAction("editor.action.formatDocument")?.run()},k=s.useCallback(e=>{try{return`<?xml version="1.0" encoding="utf-8"?>
2
- ${K({location:e,current:l[e],baseline:n[e],commands:a,displayRules:C,enableRules:c,locLabels:u,entityLogicalName:l[e].entityLogicalName})}`}catch(o){return`<!-- Error generating XML: ${String(o)} -->`}},[l,n,a,C,c,u])(i);s.useEffect(()=>{f.current++,p(null)},[k]);const F=async()=>{const e=f.current,o=await Q(k);e===f.current&&p(o.ok?{intent:"success",text:"Copied the XML to the clipboard."}:{intent:"error",text:`Couldn't copy (${o.error}). Click in the XML, press Ctrl+A, then Ctrl+C.`})},P=async()=>{const e=f.current,o=`RibbonDiffXml_${i}.xml`;T(!0),p(null);try{const L=await Z(o,k,[{name:"XML",extensions:["xml"]}]);if(e!==f.current)return;L.ok&&L.path?p({intent:"success",text:`Saved to ${L.path}.`}):L.ok?p({intent:"success",text:`Started downloading ${o}. If no file appears, use Copy.`}):L.canceled?p(null):p({intent:"error",text:`Couldn't save the file (${L.error}). Use Copy instead.`})}finally{T(!1)}};return t.jsxs(J,{position:"end",open:g,onOpenChange:()=>b(),className:r.drawer,children:[t.jsx(Y,{children:t.jsxs(ee,{action:t.jsx(ne,{appearance:"subtle",icon:t.jsx(O,{}),onClick:b,"aria-label":"Close XML drawer"}),children:[t.jsx(H,{style:{marginRight:d.spacingHorizontalS}}),"RibbonDiffXml"]})}),t.jsxs(te,{className:r.body,children:[t.jsx(j,{className:r.infoBar,intent:"info",children:t.jsxs($,{children:["This is the ",t.jsx("strong",{children:"RibbonDiffXml"})," that will be packaged into your solution ZIP and imported into Dataverse. It contains only the delta (your changes), not the full ribbon."]})}),t.jsx("div",{className:r.tabRow,children:t.jsx(re,{selectedValue:i,onTabSelect:(e,o)=>m(o.value),children:le.map(e=>t.jsx(ae,{value:e.value,children:e.label},e.value))})}),t.jsxs("div",{className:r.toolbar,children:[t.jsx(y,{icon:t.jsx(V,{}),onClick:()=>{F()},children:"Copy"}),t.jsx(y,{icon:t.jsx(z,{}),disabled:E,onClick:()=>{P()},children:"Download"}),t.jsx(y,{icon:t.jsx(G,{}),onClick:B,children:"Format XML"}),t.jsx(y,{icon:t.jsx(U,{}),onClick:()=>N(k),children:"Import this XML"})]}),S&&t.jsx(j,{intent:S.intent,className:r.infoBar,role:"status",children:t.jsx($,{children:S.text})}),t.jsx("div",{className:r.editorContainer,children:t.jsx(q,{language:"xml",value:k,readOnly:!0,height:"100%",onMount:X})})]})]})};export{Ce as XmlDrawer,Ce as default};
@@ -1 +0,0 @@
1
- const e={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},t={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};export{e as conf,t as language};
@@ -1 +0,0 @@
1
- const n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},s=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],o=e=>e.charAt(0).toUpperCase()+e.substr(1);let t=[];s.forEach(e=>{t.push(e),t.push(e.toUpperCase()),t.push(o(e))});const i={defaultToken:"",tokenPostfix:".apex",keywords:t,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};export{n as conf,i as language};
@@ -1 +0,0 @@
1
- const e={comments:{lineComment:"#"}},t={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};export{e as conf,t as language};
@@ -1 +0,0 @@
1
- const e={comments:{lineComment:"REM"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*(::\\s*|REM\\s+)#region"),end:new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")}}},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".bat",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"}],keywords:/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,symbols:/[=><!~?&|+\-*\/\^;\.,]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^(\s*)(rem(?:\s.*|))$/,["","comment"]],[/(\@?)(@keywords)(?!\w)/,[{token:"keyword"},{token:"keyword.$2"}]],[/[ \t\r\n]+/,""],[/setlocal(?!\w)/,"keyword.tag-setlocal"],[/endlocal(?!\w)/,"keyword.tag-setlocal"],[/[a-zA-Z_]\w*/,""],[/:\w*/,"metatag"],[/%[^%]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]*[0-9a-fA-F]/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],string:[[/[^\\"'%]+/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/%[\w ]+%/,"variable"],[/%%[\w]+(?!\w)/,"variable"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/$/,"string","@popall"]]}};export{e as conf,s as language};
@@ -1,2 +0,0 @@
1
- const n=e=>`\\b${e}\\b`,t="[_a-zA-Z]",o="[_a-zA-Z0-9]",i=n(`${t}${o}*`),r=["targetScope","resource","module","param","var","output","for","in","if","existing"],s=["true","false","null"],c="[ \\t\\r\\n]",a="[0-9]+",g={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:"'''",close:"'''"}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:"'''",close:"'''",notIn:["string","comment"]}],autoCloseBefore:`:.,=}])'
2
- `,indentationRules:{increaseIndentPattern:new RegExp("^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"),decreaseIndentPattern:new RegExp("^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$")}},l={defaultToken:"",tokenPostfix:".bicep",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],symbols:/[=><!~?:&|+\-*/^%]+/,keywords:r,namedLiterals:s,escapes:"\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)",tokenizer:{root:[{include:"@expression"},{include:"@whitespace"}],stringVerbatim:[{regex:"(|'|'')[^']",action:{token:"string"}},{regex:"'''",action:{token:"string.quote",next:"@pop"}}],stringLiteral:[{regex:"\\${",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"[^\\\\'$]+",action:{token:"string"}},{regex:"@escapes",action:{token:"string.escape"}},{regex:"\\\\.",action:{token:"string.escape.invalid"}},{regex:"'",action:{token:"string",next:"@pop"}}],bracketCounting:[{regex:"{",action:{token:"delimiter.bracket",next:"@bracketCounting"}},{regex:"}",action:{token:"delimiter.bracket",next:"@pop"}},{include:"expression"}],comment:[{regex:"[^\\*]+",action:{token:"comment"}},{regex:"\\*\\/",action:{token:"comment",next:"@pop"}},{regex:"[\\/*]",action:{token:"comment"}}],whitespace:[{regex:c},{regex:"\\/\\*",action:{token:"comment",next:"@comment"}},{regex:"\\/\\/.*$",action:{token:"comment"}}],expression:[{regex:"'''",action:{token:"string.quote",next:"@stringVerbatim"}},{regex:"'",action:{token:"string.quote",next:"@stringLiteral"}},{regex:a,action:{token:"number"}},{regex:i,action:{cases:{"@keywords":{token:"keyword"},"@namedLiterals":{token:"keyword"},"@default":{token:"identifier"}}}}]}};export{g as conf,l as language};
@@ -1 +0,0 @@
1
- const e={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}]},o={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","assert","block","Bytes","case","Crypto","Current","else","failwith","false","for","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","record","Set","set","sender","skip","source","String","then","to","true","type","with"],typeKeywords:["int","unit","string","tz","nat","bool"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-","&&","||"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};export{e as conf,o as language};
@@ -1 +0,0 @@
1
- const e={comments:{lineComment:";;"},brackets:[["[","]"],["(",")"],["{","}"]],autoClosingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}],surroundingPairs:[{open:"[",close:"]"},{open:'"',close:'"'},{open:"(",close:")"},{open:"{",close:"}"}]},t={defaultToken:"",ignoreCase:!0,tokenPostfix:".clj",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"}],constants:["true","false","nil"],numbers:/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,characters:/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,escapes:/^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,qualifiedSymbols:/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,specialForms:[".","catch","def","do","if","monitor-enter","monitor-exit","new","quote","recur","set!","throw","try","var"],coreSymbols:["*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","StackTraceElement->vec","Throwable->map","accessor","aclone","add-classpath","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","cast","cat","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-data","ex-info","extend","extend-protocol","extend-type","extenders","extends?","false?","ffirst","file-seq","filter","filterv","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","letfn","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","newline","next","nfirst","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","rand","rand-int","rand-nth","random-sample","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-watch","repeat","repeatedly","replace","replicate","require","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq?","seqable?","seque","sequence","sequential?","set","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","test","the-ns","thread-bound?","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true?","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-proxy","uri?","use","uuid?","val","vals","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"],tokenizer:{root:[{include:"@whitespace"},[/@numbers/,"number"],[/@characters/,"string"],{include:"@string"},[/[()\[\]{}]/,"@brackets"],[/\/#"(?:\.|(?:")|[^"\n])*"\/g/,"regexp"],[/[#'@^`~]/,"meta"],[/@qualifiedSymbols/,{cases:{"^:.+$":"constant","@specialForms":"keyword","@coreSymbols":"keyword","@constants":"constant","@default":"identifier"}}]],whitespace:[[/[\s,]+/,"white"],[/;.*$/,"comment"],[/\(comment\b/,"comment","@comment"]],comment:[[/\(/,"comment","@push"],[/\)/,"comment","@pop"],[/[^()]/,"comment"]],string:[[/"/,"string","@multiLineString"]],multiLineString:[[/"/,"string","@popall"],[/@escapes/,"string.escape"],[/./,"string"]]}};export{e as conf,t as language};
@@ -1 +0,0 @@
1
- const e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},t={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=><!~?&%|+\-*\/\^\.,\:]+/,escapes:/\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@[a-zA-Z_]\w*/,"variable.predefined"],[/[a-zA-Z_]\w*/,{cases:{this:"variable.predefined","@keywords":{token:"keyword.$0"},"@default":""}}],[/[ \t\r\n]+/,""],[/###/,"comment","@comment"],[/#.*$/,"comment"],["///",{token:"regexp",next:"@hereregexp"}],[/^(\s*)(@regEx)/,["","regexp"]],[/(\()(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\,)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\=)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\:)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\[)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\!)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\&)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\|)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\?)(\s*)(@regEx)/,["delimiter","","regexp"]],[/(\{)(\s*)(@regEx)/,["@brackets","","regexp"]],[/(\;)(\s*)(@regEx)/,["","","regexp"]],[/}/,{cases:{"$S2==interpolatedstring":{token:"string",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/@symbols/,"delimiter"],[/\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d+\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F]+/,"number.hex"],[/0[0-7]+(?!\d)/,"number.octal"],[/\d+/,"number"],[/[,.]/,"delimiter"],[/"""/,"string",'@herestring."""'],[/'''/,"string","@herestring.'''"],[/"/,{cases:{"@eos":"string","@default":{token:"string",next:'@string."'}}}],[/'/,{cases:{"@eos":"string","@default":{token:"string",next:"@string.'"}}}]],string:[[/[^"'\#\\]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/\./,"string.escape.invalid"],[/#{/,{cases:{'$S2=="':{token:"string",next:"root.interpolatedstring"},"@default":"string"}}],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/#/,"string"]],herestring:[[/("""|''')/,{cases:{"$1==$S2":{token:"string",next:"@pop"},"@default":"string"}}],[/[^#\\'"]+/,"string"],[/['"]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/#{/,{token:"string.quote",next:"root.interpolatedstring"}],[/#/,"string"]],comment:[[/[^#]+/,"comment"],[/###/,"comment","@pop"],[/#/,"comment"]],hereregexp:[[/[^\\\/#]+/,"regexp"],[/\\./,"regexp"],[/#.*$/,"comment"],["///[igm]*",{token:"regexp",next:"@pop"}],[/\//,"regexp"]]}};export{e as conf,t as language};
@@ -1 +0,0 @@
1
- const e={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},n={defaultToken:"",tokenPostfix:".cpp",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m512","__m512d","__m512i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[0abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,integersuffix:/([uU](ll|LL|l|L)|(ll|LL|l|L)?[uU]?)/,floatsuffix:/[fFlL]?/,encoding:/u|u8|U|L/,tokenizer:{root:[[/@encoding?R\"(?:([^ ()\\\t]*))\(/,{token:"string.raw.begin",next:"@raw.$1"}],[/[a-zA-Z_]\w*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/^\s*#\s*include/,{token:"keyword.directive.include",next:"@include"}],[/^\s*#\s*\w+/,"keyword.directive"],{include:"@whitespace"},[/\[\s*\[/,{token:"annotation",next:"@annotation"}],[/[{}()<>\[\]]/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*\\$/,"comment","@linecomment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],linecomment:[[/.*[^\\]$/,"comment","@pop"],[/[^]+/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],raw:[[/[^)]+/,"string.raw"],[/\)$S2\"/,{token:"string.raw.end",next:"@pop"}],[/\)/,"string.raw"]],annotation:[{include:"@whitespace"},[/using|alignas/,"keyword"],[/[a-zA-Z0-9_]+/,"annotation"],[/[,:]/,"delimiter"],[/[()]/,"@brackets"],[/\]\s*\]/,{token:"annotation",next:"@pop"}]],include:[[/(\s*)(<)([^<>]*)(>)/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]],[/(\s*)(")([^"]*)(")/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]]]}};export{e as conf,n as language};
@@ -1 +0,0 @@
1
- const e={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},t={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/\@?[a-zA-Z_]\w*/,{cases:{"@namespaceFollows":{token:"keyword.$0",next:"@namespace"},"@keywords":{token:"keyword.$0",next:"@qualified"},"@default":{token:"identifier",next:"@qualified"}}}],{include:"@whitespace"},[/}/,{cases:{"$S2==interpolatedstring":{token:"string.quote",next:"@pop"},"$S2==litinterpstring":{token:"string.quote",next:"@pop"},"@default":"@brackets"}}],[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}};export{e as conf,t as language};