@digi-frontend/dgate-api-documentation 1.0.90 → 1.0.91

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.
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12.9487 26.5443H8.0487C3.48703 26.5443 1.45703 24.5143 1.45703 19.9526V15.0526C1.45703 10.4909 3.48703 8.46094 8.0487 8.46094H12.9487C17.5104 8.46094 19.5404 10.4909 19.5404 15.0526V19.9526C19.5404 24.5143 17.5104 26.5443 12.9487 26.5443ZM8.0487 10.2109C4.43203 10.2109 3.20703 11.4359 3.20703 15.0526V19.9526C3.20703 23.5693 4.43203 24.7943 8.0487 24.7943H12.9487C16.5654 24.7943 17.7904 23.5693 17.7904 19.9526V15.0526C17.7904 11.4359 16.5654 10.2109 12.9487 10.2109H8.0487V10.2109Z" fill="#616874"/>
3
+ <path d="M19.9526 19.5404H18.6693C18.1909 19.5404 17.7943 19.1437 17.7943 18.6654V15.0487C17.7943 11.432 16.5693 10.207 12.9526 10.207H9.33594C8.8576 10.207 8.46094 9.81037 8.46094 9.33203V8.0487C8.46094 3.48703 10.4909 1.45703 15.0526 1.45703H19.9526C24.5143 1.45703 26.5443 3.48703 26.5443 8.0487V12.9487C26.5443 17.5104 24.5143 19.5404 19.9526 19.5404ZM19.5443 17.7904H19.9526C23.5693 17.7904 24.7943 16.5654 24.7943 12.9487V8.0487C24.7943 4.43203 23.5693 3.20703 19.9526 3.20703H15.0526C11.4359 3.20703 10.2109 4.43203 10.2109 8.0487V8.45703H12.9526C17.5143 8.45703 19.5443 10.487 19.5443 15.0487V17.7904Z" fill="#616874"/>
4
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_6817_4615)">
3
+ <path d="M13.9973 8.39927C14.814 8.39927 15.6306 8.71427 16.249 9.3326L23.8556 16.9393C24.194 17.2776 24.194 17.8376 23.8556 18.1759C23.5173 18.5143 22.9573 18.5143 22.619 18.1759L15.0123 10.5693C14.4523 10.0093 13.5423 10.0093 12.9823 10.5693L5.37563 18.1759C5.03729 18.5143 4.47729 18.5143 4.13896 18.1759C3.80062 17.8376 3.80062 17.2776 4.13896 16.9393L11.7456 9.3326C12.364 8.71427 13.1806 8.39927 13.9973 8.39927Z" fill="#616874"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_6817_4615">
7
+ <rect width="28" height="28" fill="white" transform="translate(28 28) rotate(-180)"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.0027 19.6007C13.186 19.6007 12.3694 19.2857 11.751 18.6674L4.14437 11.0607C3.80604 10.7224 3.80604 10.1624 4.14437 9.82406C4.48271 9.48573 5.04271 9.48573 5.38104 9.82406L12.9877 17.4307C13.5477 17.9907 14.4577 17.9907 15.0177 17.4307L22.6244 9.82406C22.9627 9.48573 23.5227 9.48573 23.861 9.82406C24.1994 10.1624 24.1994 10.7224 23.861 11.0607L16.2544 18.6674C15.636 19.2857 14.8194 19.6007 14.0027 19.6007Z" fill="#616874"/>
3
+ </svg>
@@ -0,0 +1,2 @@
1
+ var a="d318fe83a89fd75b.svg";export{a as default};
2
+ //# sourceMappingURL=arrow-down.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow-down.svg.js","sources":["../../../../src/assets/icons/arrow-down.svg"],"sourcesContent":["export default \"d318fe83a89fd75b.svg\""],"names":["arrowDown"],"mappings":"AAAA,IAAeA,EAAA"}
@@ -0,0 +1,2 @@
1
+ var a="ce94023947952cc6.svg";export{a as default};
2
+ //# sourceMappingURL=arrow-up.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow-up.svg.js","sources":["../../../../src/assets/icons/arrow-up.svg"],"sourcesContent":["export default \"ce94023947952cc6.svg\""],"names":["arrowUp"],"mappings":"AAAA,IAAeA,EAAA"}
@@ -0,0 +1,2 @@
1
+ var e="6ec653b209606e22.svg";export{e as default};
2
+ //# sourceMappingURL=newCopyIcon.svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"newCopyIcon.svg.js","sources":["../../../../src/assets/icons/newCopyIcon.svg"],"sourcesContent":["export default \"6ec653b209606e22.svg\""],"names":["newCopyIcon"],"mappings":"AAAA,IAAeA,EAAA"}
@@ -1,2 +1,2 @@
1
- import{j as e}from"../../../../../_virtual/jsx-runtime.js";import s from"../../../../components/SVGLoader/SVGLoader.js";import i from"../../../../assets/icons/CopySticker.svg.js";import t from"../../../../assets/icons/arrowRightGray.svg.js";import{useSectionToggle as a,SectionEnum as n}from"../../../../context/SectionToggleContext.js";const r=({data:r,setActiveItemData:d,setActiveType:l,onProductNavigate:o,apis:c})=>{var p,m;const{toggleSection:v}=a();return e.jsxs("div",{className:"api-details-page",children:[e.jsx("h2",{className:"welcome",children:"Welcome to"}),e.jsx("h1",{className:"api-title",children:null==r?void 0:r.title}),e.jsxs("p",{className:"api-version",children:["API Version: ",e.jsx("span",{children:null==r?void 0:r.version})]}),e.jsxs("div",{className:"custom-url-input",children:[e.jsx("label",{className:"input-label",children:"API Base URL"}),e.jsxs("div",{className:"input-wrapper",children:[e.jsx("input",{type:"text",value:r&&r.servers&&r.servers.length>0?null===(p=r.servers[0])||void 0===p?void 0:p.url:"-",readOnly:!0}),e.jsx("span",{className:"icon",onClick:()=>{var e;return navigator.clipboard.writeText(`${r&&r.servers&&r.servers.length>0?null===(e=r.servers[0])||void 0===e?void 0:e.url:"-"}`)},children:e.jsx(s,{src:i})})]})]}),e.jsx("p",{className:"api-desc",children:`${r.description||"No Description"}`}),o&&e.jsxs("div",{className:"api-product-tag",children:["Product with this API"," ",e.jsx("span",{className:"product-tag",role:"button",tabIndex:-1,onClick:()=>o(r.associatedProduct.productId),children:r.associatedProduct.name})]}),e.jsx("h3",{className:"section-title",children:"Endpoints"}),Object.entries(null==r?void 0:r.tags).map((([i,a])=>e.jsxs("div",{className:"endpoint-group",children:[e.jsx("h4",{className:"tag-title",children:i}),e.jsx("div",{className:"endpoint-list",children:a.map(((a,o)=>{var c,p,m;return e.jsxs("div",{className:"endpoint-card",onClick:()=>(e=>{d(Object.assign(Object.assign({},e),{api:Object.assign({id:r.apiSpecId,title:r.title,description:r.description,version:r.version},r)})),l("ENDPOINT"),Object.entries((null==r?void 0:r.tags)||{}).findIndex((([,s])=>s.some((s=>s.id===e.id))));const s=Object.entries(r.tags).sort((([e],[s])=>"default"===e?1:"default"===s?-1:e.localeCompare(s))).findIndex((([s,i])=>i.find((s=>s.id===e.id))));v(r.apiSpecId,[{type:n.API_SECTION,setTo:!0},{type:n.ENDPOINTS_SECTION,setTo:!0},{type:n.TAG_SECTION,setTo:!0,index:s},{type:n.RESOURCE,setTo:!0,id:e.id}],{resetOthers:!0,filterKeys:[n.OVERVIEW]})})(a),children:[e.jsxs("div",{children:[e.jsxs("div",{className:"endpoint-card-header",children:[e.jsx("span",{className:`method-label ${a.method.toLowerCase()}`,children:a.method}),e.jsx("div",{className:"title-wrapper",children:e.jsxs("h5",{children:[(a.summary||"Endpoint Name").slice(0,40),(null!==(p=null===(c=a.summary)||void 0===c?void 0:c.length)&&void 0!==p?p:0)>40&&"..."]})})]}),e.jsxs("div",{className:"endpoint-meta",children:[e.jsx("p",{children:a.path}),e.jsx("p",{className:"description",children:null!==(m=a.description)&&void 0!==m?m:"No Description "})]})]}),e.jsx("div",{className:"endpoint-arrow",children:e.jsx(s,{src:t})})]},`${i}-${o}`)}))})]},i))),(null===(m=r.apiVersions)||void 0===m?void 0:m.length)>0&&e.jsxs("div",{className:"versions-section",children:[e.jsx("h4",{children:"API Versions"}),e.jsx("div",{className:"version-list",children:r.apiVersions.map(((s,i)=>{var t;return e.jsx("button",{className:"version-btn",onClick:()=>(e=>{if(e.apiSpecId===r.apiSpecId)return void l("OVERVIEW");const s=r.apiVersions.find((s=>s.apiSpecId===e.apiSpecId));if(!s)return;const i=c.find((e=>e.apiSpecId===s.apiSpecId));d(i),l("OVERVIEW"),v(i.apiSpecId,[{type:n.API_SECTION,setTo:!0},{type:n.OVERVIEW,setTo:!0}],{resetOthers:!0,filterKeys:[n.OVERVIEW,n.API_SECTION,n.ENDPOINTS_SECTION,n.TAG_SECTION]})})(s),children:(null===(t=s.metaData)||void 0===t?void 0:t.version)||"N/A"},i)}))})]})]})};export{r as OverviewPage};
1
+ import{j as s}from"../../../../../_virtual/jsx-runtime.js";import e from"../../../../components/SVGLoader/SVGLoader.js";import i from"../../../../assets/icons/arrowRightGray.svg.js";import n from"../../../../assets/icons/arrow-down.svg.js";import t from"../../../../assets/icons/newCopyIcon.svg.js";import a from"../../../../assets/icons/arrow-up.svg.js";import{useSectionToggle as r,SectionEnum as l}from"../../../../context/SectionToggleContext.js";import{useState as o,useEffect as d}from"react";const c=({data:c,setActiveItemData:p,setActiveType:m,onProductNavigate:v,apis:h})=>{var j,u,x,N;const{toggleSection:I}=r(),[g,O]=o((null===(u=null===(j=null==c?void 0:c.servers)||void 0===j?void 0:j[0])||void 0===u?void 0:u.url)||""),[E,S]=o(!1);d((()=>{var s,e;O((null===(e=null===(s=null==c?void 0:c.servers)||void 0===s?void 0:s[0])||void 0===e?void 0:e.url)||"")}),[c]);return s.jsxs("div",{className:"api-details-page",children:[s.jsx("h2",{className:"welcome",children:"Welcome to"}),s.jsx("h1",{className:"api-title",children:null==c?void 0:c.title}),s.jsxs("p",{className:"api-version",children:["API Version: ",s.jsx("span",{children:null==c?void 0:c.version})]}),s.jsxs("div",{className:"custom-url-input",children:[s.jsx("label",{className:"input-label",children:"API Base URL"}),s.jsxs("div",{className:"url-container",children:[s.jsxs("div",{className:"typeDdl",onClick:()=>S((s=>!s)),children:[s.jsx("span",{className:"url-text",children:g||"-"}),s.jsxs("div",{className:"icon-container",children:[s.jsx("span",{className:"icon",role:"button",tabIndex:0,onClick:s=>{s.stopPropagation(),navigator.clipboard.writeText(g)},children:0!==g.length&&s.jsx(e,{src:t})}),0!==g.length&&s.jsx(e,{src:E?a:n})]})]}),E&&0!==g.length&&s.jsx("div",{className:"urlList",children:null===(x=null==c?void 0:c.servers)||void 0===x?void 0:x.map(((e,i)=>s.jsxs("div",{className:"url-item",onClick:()=>{O(e.url),S(!1)},children:[s.jsx("input",{type:"radio",name:"api-method",checked:g===e.url,readOnly:!0}),s.jsx("span",{children:e.url})]},i)))})]})]}),s.jsx("p",{className:"api-desc",children:`${c.description||"No Description"}`}),v&&s.jsxs("div",{className:"api-product-tag",children:["Product with this API"," ",s.jsx("span",{className:"product-tag",role:"button",tabIndex:-1,onClick:()=>v(c.associatedProduct.productId),children:c.associatedProduct.name})]}),s.jsx("h3",{className:"section-title",children:"Endpoints"}),Object.entries(null==c?void 0:c.tags).map((([n,t])=>s.jsxs("div",{className:"endpoint-group",children:[s.jsx("h4",{className:"tag-title",children:n}),s.jsx("div",{className:"endpoint-list",children:t.map(((t,a)=>{var r,o,d;return s.jsxs("div",{className:"endpoint-card",onClick:()=>(s=>{p(Object.assign(Object.assign({},s),{api:Object.assign({id:c.apiSpecId,title:c.title,description:c.description,version:c.version},c)})),m("ENDPOINT"),Object.entries((null==c?void 0:c.tags)||{}).findIndex((([,e])=>e.some((e=>e.id===s.id))));const e=Object.entries(c.tags).sort((([s],[e])=>"default"===s?1:"default"===e?-1:s.localeCompare(e))).findIndex((([e,i])=>i.find((e=>e.id===s.id))));I(c.apiSpecId,[{type:l.API_SECTION,setTo:!0},{type:l.ENDPOINTS_SECTION,setTo:!0},{type:l.TAG_SECTION,setTo:!0,index:e},{type:l.RESOURCE,setTo:!0,id:s.id}],{resetOthers:!0,filterKeys:[l.OVERVIEW]})})(t),children:[s.jsxs("div",{children:[s.jsxs("div",{className:"endpoint-card-header",children:[s.jsx("span",{className:`method-label ${t.method.toLowerCase()}`,children:t.method}),s.jsx("div",{className:"title-wrapper",children:s.jsxs("h5",{children:[(t.summary||"Endpoint Name").slice(0,40),(null!==(o=null===(r=t.summary)||void 0===r?void 0:r.length)&&void 0!==o?o:0)>40&&"..."]})})]}),s.jsxs("div",{className:"endpoint-meta",children:[s.jsx("p",{children:t.path}),s.jsx("p",{className:"description",children:null!==(d=t.description)&&void 0!==d?d:"No Description "})]})]}),s.jsx("div",{className:"endpoint-arrow",children:s.jsx(e,{src:i})})]},`${n}-${a}`)}))})]},n))),(null===(N=c.apiVersions)||void 0===N?void 0:N.length)>0&&s.jsxs("div",{className:"versions-section",children:[s.jsx("h4",{children:"API Versions"}),s.jsx("div",{className:"version-list",children:c.apiVersions.map(((e,i)=>{var n;return s.jsx("button",{className:"version-btn",onClick:()=>(s=>{if(s.apiSpecId===c.apiSpecId)return void m("OVERVIEW");const e=c.apiVersions.find((e=>e.apiSpecId===s.apiSpecId));if(!e)return;const i=h.find((s=>s.apiSpecId===e.apiSpecId));p(i),m("OVERVIEW"),I(i.apiSpecId,[{type:l.API_SECTION,setTo:!0},{type:l.OVERVIEW,setTo:!0}],{resetOthers:!0,filterKeys:[l.OVERVIEW,l.API_SECTION,l.ENDPOINTS_SECTION,l.TAG_SECTION]})})(e),children:(null===(n=e.metaData)||void 0===n?void 0:n.version)||"N/A"},i)}))})]})]})};export{c as OverviewPage};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../src/layout/docsComponents/DocsContent/OverviewPage/index.tsx"],"sourcesContent":["import './style.scss'\nimport SVGLoader from '../../../../components/SVGLoader/SVGLoader'\nimport { arrowRightGray, CopySticker } from '../../../../assets/icons/index'\nimport { EndpointData, OverviewData } from 'src/layout/docsLayout'\nimport { SectionEnum, useSectionToggle } from '../../../../../src/context/SectionToggleContext'\n\nexport const OverviewPage = ({\n data,\n setActiveItemData,\n setActiveType,\n onProductNavigate,\n apis,\n}: {\n data: OverviewData\n setActiveItemData: React.Dispatch<React.SetStateAction<OverviewData | EndpointData>>\n setActiveType: React.Dispatch<React.SetStateAction<'OVERVIEW' | 'ENDPOINT'>>\n onProductNavigate?: (productId: number) => void\n apis: OverviewData[]\n}) => {\n const { toggleSection } = useSectionToggle()\n\n const handleVersionClick = (verObj) => {\n if (verObj.apiSpecId === data.apiSpecId) {\n setActiveType('OVERVIEW')\n return\n }\n\n const matchedVersion = data.apiVersions.find((v) => v.apiSpecId === verObj.apiSpecId)\n\n if (!matchedVersion) {\n return\n }\n\n const matchedApi = apis.find((api) => api.apiSpecId === matchedVersion.apiSpecId)\n setActiveItemData(matchedApi)\n\n setActiveType('OVERVIEW')\n toggleSection(\n matchedApi.apiSpecId,\n [\n { type: SectionEnum.API_SECTION, setTo: true },\n { type: SectionEnum.OVERVIEW, setTo: true },\n ],\n {\n resetOthers: true,\n filterKeys: [\n SectionEnum.OVERVIEW,\n SectionEnum.API_SECTION,\n SectionEnum.ENDPOINTS_SECTION,\n SectionEnum.TAG_SECTION,\n ],\n }\n )\n }\n\n const handleClick = (endpoint) => {\n setActiveItemData({\n ...endpoint,\n api: {\n id: data.apiSpecId,\n title: data.title,\n description: data.description,\n version: data.version,\n ...data,\n },\n })\n setActiveType('ENDPOINT')\n const tagEntries = Object.entries(data?.tags || {})\n const sectionIndex = tagEntries.findIndex(([, endpoints]) =>\n endpoints.some((e) => e.id === endpoint.id)\n )\n\n const tagSectionIndex = Object.entries(data.tags)\n .sort(([a], [b]) => (a === 'default' ? 1 : b === 'default' ? -1 : a.localeCompare(b)))\n .findIndex(([_, tagData]) => tagData.find((t) => t.id === endpoint.id))\n\n toggleSection(\n data.apiSpecId,\n [\n { type: SectionEnum.API_SECTION, setTo: true },\n { type: SectionEnum.ENDPOINTS_SECTION, setTo: true },\n { type: SectionEnum.TAG_SECTION, setTo: true, index: tagSectionIndex },\n { type: SectionEnum.RESOURCE, setTo: true, id: endpoint.id },\n ],\n { resetOthers: true, filterKeys: [SectionEnum.OVERVIEW] }\n )\n }\n\n return (\n <div className=\"api-details-page\">\n <h2 className=\"welcome\">Welcome to</h2>\n <h1 className=\"api-title\">{data?.title}</h1>\n <p className=\"api-version\">\n API Version: <span>{data?.version}</span>\n </p>\n\n <div className=\"custom-url-input\">\n <label className=\"input-label\">API Base URL</label>\n <div className=\"input-wrapper\">\n <input\n type=\"text\"\n value={!!data && !!data.servers && data.servers.length > 0 ? data.servers[0]?.url : '-'}\n readOnly\n />\n <span\n className=\"icon\"\n onClick={() =>\n navigator.clipboard.writeText(\n `${\n !!data && !!data.servers && data.servers.length > 0 ? data.servers[0]?.url : '-'\n }`\n )\n }\n >\n <SVGLoader src={CopySticker} />\n </span>\n </div>\n </div>\n\n <p className=\"api-desc\">{`${data.description || 'No Description'}`}</p>\n {onProductNavigate && (\n <div className=\"api-product-tag\">\n Product with this API{' '}\n <span\n className=\"product-tag\"\n role=\"button\"\n tabIndex={-1}\n onClick={() => onProductNavigate(data.associatedProduct.productId)}\n >\n {data.associatedProduct.name}\n </span>\n </div>\n )}\n\n <h3 className=\"section-title\">Endpoints</h3>\n\n {Object.entries(data?.tags).map(([tag, endpoints]) => (\n <div className=\"endpoint-group\" key={tag}>\n <h4 className=\"tag-title\">{tag}</h4>\n <div className=\"endpoint-list\">\n {endpoints.map((endpoint, idx) => (\n <div\n className=\"endpoint-card\"\n onClick={() => handleClick(endpoint)}\n key={`${tag}-${idx}`}\n >\n <div>\n <div className=\"endpoint-card-header\">\n <span className={`method-label ${endpoint.method.toLowerCase()}`}>\n {endpoint.method}\n </span>\n <div className=\"title-wrapper\">\n <h5>\n {(endpoint.summary || 'Endpoint Name').slice(0, 40)}\n {(endpoint.summary?.length ?? 0) > 40 && '...'}\n </h5>\n </div>\n </div>\n <div className=\"endpoint-meta\">\n <p>{endpoint.path}</p>\n <p className=\"description\">{endpoint.description ?? 'No Description '}</p>\n </div>\n </div>\n\n <div className=\"endpoint-arrow\">\n <SVGLoader src={arrowRightGray} />\n </div>\n </div>\n ))}\n </div>\n </div>\n ))}\n\n {data.apiVersions?.length > 0 && (\n <div className=\"versions-section\">\n <h4>API Versions</h4>\n <div className=\"version-list\">\n {data.apiVersions.map((verObj, index) => (\n <button\n key={index}\n className=\"version-btn\"\n onClick={() => handleVersionClick(verObj)}\n >\n {verObj.metaData?.version || 'N/A'}\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n}\n"],"names":["OverviewPage","data","setActiveItemData","setActiveType","onProductNavigate","apis","toggleSection","useSectionToggle","_jsxs","className","_jsx","children","title","version","jsxs","jsx","type","value","servers","length","_a","url","readOnly","onClick","navigator","clipboard","writeText","SVGLoader","src","CopySticker","description","role","tabIndex","associatedProduct","productId","name","Object","entries","tags","map","tag","endpoints","endpoint","idx","assign","api","id","apiSpecId","findIndex","some","e","tagSectionIndex","sort","a","b","localeCompare","_","tagData","find","t","SectionEnum","API_SECTION","setTo","ENDPOINTS_SECTION","TAG_SECTION","index","RESOURCE","resetOthers","filterKeys","OVERVIEW","handleClick","method","toLowerCase","summary","slice","_b","path","_c","arrowRightGray","apiVersions","verObj","matchedVersion","v","matchedApi","handleVersionClick","metaData"],"mappings":"iVAMa,MAAAA,EAAe,EAC1BC,OACAC,oBACAC,gBACAC,oBACAC,mBAQA,MAAMC,cAAEA,GAAkBC,IAqE1B,OACEC,OAAK,MAAA,CAAAC,UAAU,6BACbC,EAAAA,IAAI,KAAA,CAAAD,UAAU,UAAyBE,SAAA,eACvCD,YAAID,UAAU,YAAWE,SAAEV,aAAA,EAAAA,EAAMW,QACjCJ,YAAGC,UAAU,cAAaE,SAAA,CAAA,gBACXD,MAAO,OAAA,CAAAC,SAAAV,aAAI,EAAJA,EAAMY,aAG5BL,EAAAM,KAAA,MAAA,CAAKL,UAAU,mBAAkBE,SAAA,CAC/BD,MAAO,QAAA,CAAAD,UAAU,cAAkCE,SAAA,iBACnDH,EAAAA,KAAK,MAAA,CAAAC,UAAU,gBAAeE,SAAA,CAC5BD,EACEK,IAAA,QAAA,CAAAC,KAAK,O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I+B,EAASkC,OACblE,EAAAK,IAAA,IAAA,CAAGN,UAAU,cAAaE,SAA0B,QAAxBkE,EAAAnC,EAASZ,mBAAe,IAAA+C,EAAAA,EAAA,0BAIxDnE,EAAKK,IAAA,MAAA,CAAAN,UAAU,iBACbE,SAAAD,EAAAA,IAACiB,EAAS,CAACC,IAAKkD,QArBb,GAAGtC,KAAOG,YAPcH,MAoCpB,QAAlBmC,EAAA1E,EAAK8E,mBAAa,IAAAJ,OAAA,EAAAA,EAAAxD,QAAS,GAC1BX,EAAAA,KAAK,MAAA,CAAAC,UAAU,6BACbC,EAAqBK,IAAA,KAAA,CAAAJ,SAAA,iBACrBD,aAAKD,UAAU,eACZE,SAAAV,EAAK8E,YAAYxC,KAAI,CAACyC,EAAQf,WAAU,OACvCvD,MAAA,SAAA,CAEED,UAAU,cACVc,QAAS,IAhKI,CAACyD,IAC1B,GAAIA,EAAOjC,YAAc9C,EAAK8C,UAE5B,YADA5C,EAAc,YAIhB,MAAM8E,EAAiBhF,EAAK8E,YAAYrB,MAAMwB,GAAMA,EAAEnC,YAAciC,EAAOjC,YAE3E,IAAKkC,EACH,OAGF,MAAME,EAAa9E,EAAKqD,MAAMb,GAAQA,EAAIE,YAAckC,EAAelC,YACvE7C,EAAkBiF,GAElBhF,EAAc,YACdG,EACE6E,EAAWpC,UACX,CACE,CAAE/B,KAAM4C,EAAYC,YAAaC,OAAO,GACxC,CAAE9C,KAAM4C,EAAYS,SAAUP,OAAO,IAEvC,CACEK,aAAa,EACbC,WAAY,CACVR,EAAYS,SACZT,EAAYC,YACZD,EAAYG,kBACZH,EAAYI,gBAoISoB,CAAmBJ,GAAOrE,UAEzB,QAAfS,EAAA4D,EAAOK,gBAAQ,IAAAjE,OAAA,EAAAA,EAAEP,UAAW,OAJxBoD"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../src/layout/docsComponents/DocsContent/OverviewPage/index.tsx"],"sourcesContent":["import './style.scss'\nimport SVGLoader from '../../../../components/SVGLoader/SVGLoader'\nimport {\n arrowDown,\n arrowRightGray,\n arrowUp,\n newCopyIcon,\n} from '../../../../assets/icons/index'\nimport { EndpointData, OverviewData } from 'src/layout/docsLayout'\nimport { SectionEnum, useSectionToggle } from '../../../../../src/context/SectionToggleContext'\nimport React, { useEffect, useState } from 'react'\n\nexport const OverviewPage = ({\n data,\n setActiveItemData,\n setActiveType,\n onProductNavigate,\n apis,\n}: {\n data: OverviewData\n setActiveItemData: React.Dispatch<React.SetStateAction<OverviewData | EndpointData>>\n setActiveType: React.Dispatch<React.SetStateAction<'OVERVIEW' | 'ENDPOINT'>>\n onProductNavigate?: (productId: number) => void\n apis: OverviewData[]\n}) => {\n const { toggleSection } = useSectionToggle()\n const [selectedUrl, setSelectedUrl] = useState(data?.servers?.[0]?.url || '')\n const [isUrlDropdownOpen, setIsUrlDropdownOpen] = useState<boolean>(false)\n\n useEffect(() => {\n setSelectedUrl(data?.servers?.[0]?.url || '')\n }, [data])\n const handleVersionClick = (verObj) => {\n if (verObj.apiSpecId === data.apiSpecId) {\n setActiveType('OVERVIEW')\n return\n }\n\n const matchedVersion = data.apiVersions.find((v) => v.apiSpecId === verObj.apiSpecId)\n\n if (!matchedVersion) {\n return\n }\n\n const matchedApi = apis.find((api) => api.apiSpecId === matchedVersion.apiSpecId)\n setActiveItemData(matchedApi)\n\n setActiveType('OVERVIEW')\n toggleSection(\n matchedApi.apiSpecId,\n [\n { type: SectionEnum.API_SECTION, setTo: true },\n { type: SectionEnum.OVERVIEW, setTo: true },\n ],\n {\n resetOthers: true,\n filterKeys: [\n SectionEnum.OVERVIEW,\n SectionEnum.API_SECTION,\n SectionEnum.ENDPOINTS_SECTION,\n SectionEnum.TAG_SECTION,\n ],\n }\n )\n }\n\n const handleClick = (endpoint) => {\n setActiveItemData({\n ...endpoint,\n api: {\n id: data.apiSpecId,\n title: data.title,\n description: data.description,\n version: data.version,\n ...data,\n },\n })\n setActiveType('ENDPOINT')\n const tagEntries = Object.entries(data?.tags || {})\n const sectionIndex = tagEntries.findIndex(([, endpoints]) =>\n endpoints.some((e) => e.id === endpoint.id)\n )\n\n const tagSectionIndex = Object.entries(data.tags)\n .sort(([a], [b]) => (a === 'default' ? 1 : b === 'default' ? -1 : a.localeCompare(b)))\n .findIndex(([_, tagData]) => tagData.find((t) => t.id === endpoint.id))\n\n toggleSection(\n data.apiSpecId,\n [\n { type: SectionEnum.API_SECTION, setTo: true },\n { type: SectionEnum.ENDPOINTS_SECTION, setTo: true },\n { type: SectionEnum.TAG_SECTION, setTo: true, index: tagSectionIndex },\n { type: SectionEnum.RESOURCE, setTo: true, id: endpoint.id },\n ],\n { resetOthers: true, filterKeys: [SectionEnum.OVERVIEW] }\n )\n }\n\n return (\n <div className=\"api-details-page\">\n <h2 className=\"welcome\">Welcome to</h2>\n <h1 className=\"api-title\">{data?.title}</h1>\n <p className=\"api-version\">\n API Version: <span>{data?.version}</span>\n </p>\n\n <div className=\"custom-url-input\">\n <label className=\"input-label\">API Base URL</label>\n <div className=\"url-container\">\n <div className=\"typeDdl\" onClick={() => setIsUrlDropdownOpen((prev) => !prev)}>\n <span className=\"url-text\">{selectedUrl || '-'}</span>\n <div className=\"icon-container\">\n <span\n className=\"icon\"\n role=\"button\"\n tabIndex={0}\n onClick={(e) => {\n e.stopPropagation()\n navigator.clipboard.writeText(selectedUrl)\n }}\n >\n {selectedUrl.length !== 0 && <SVGLoader src={newCopyIcon} />}\n </span>\n {selectedUrl.length !== 0 && (\n <SVGLoader src={!isUrlDropdownOpen ? arrowDown : arrowUp} />\n )}\n </div>\n </div>\n {isUrlDropdownOpen && selectedUrl.length !== 0 && (\n <div className=\"urlList\">\n {data?.servers?.map((server, index) => (\n <div\n key={index}\n className=\"url-item\"\n onClick={() => {\n setSelectedUrl(server.url)\n setIsUrlDropdownOpen(false)\n }}\n >\n <input\n type=\"radio\"\n name=\"api-method\"\n checked={selectedUrl === server.url}\n readOnly\n />\n <span>{server.url}</span>\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n\n <p className=\"api-desc\">{`${data.description || 'No Description'}`}</p>\n {onProductNavigate && (\n <div className=\"api-product-tag\">\n Product with this API{' '}\n <span\n className=\"product-tag\"\n role=\"button\"\n tabIndex={-1}\n onClick={() => onProductNavigate(data.associatedProduct.productId)}\n >\n {data.associatedProduct.name}\n </span>\n </div>\n )}\n\n <h3 className=\"section-title\">Endpoints</h3>\n\n {Object.entries(data?.tags).map(([tag, endpoints]) => (\n <div className=\"endpoint-group\" key={tag}>\n <h4 className=\"tag-title\">{tag}</h4>\n <div className=\"endpoint-list\">\n {endpoints.map((endpoint, idx) => (\n <div\n className=\"endpoint-card\"\n onClick={() => handleClick(endpoint)}\n key={`${tag}-${idx}`}\n >\n <div>\n <div className=\"endpoint-card-header\">\n <span className={`method-label ${endpoint.method.toLowerCase()}`}>\n {endpoint.method}\n </span>\n <div className=\"title-wrapper\">\n <h5>\n {(endpoint.summary || 'Endpoint Name').slice(0, 40)}\n {(endpoint.summary?.length ?? 0) > 40 && '...'}\n </h5>\n </div>\n </div>\n <div className=\"endpoint-meta\">\n <p>{endpoint.path}</p>\n <p className=\"description\">{endpoint.description ?? 'No Description '}</p>\n </div>\n </div>\n\n <div className=\"endpoint-arrow\">\n <SVGLoader src={arrowRightGray} />\n </div>\n </div>\n ))}\n </div>\n </div>\n ))}\n\n {data.apiVersions?.length > 0 && (\n <div className=\"versions-section\">\n <h4>API Versions</h4>\n <div className=\"version-list\">\n {data.apiVersions.map((verObj, index) => (\n <button\n key={index}\n className=\"version-btn\"\n onClick={() => handleVersionClick(verObj)}\n >\n {verObj.metaData?.version || 'N/A'}\n </button>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n}\n"],"names":["OverviewPage","data","setActiveItemData","setActiveType","onProductNavigate","apis","toggleSection","useSectionToggle","selectedUrl","setSelectedUrl","useState","_b","_a","servers","url","isUrlDropdownOpen","setIsUrlDropdownOpen","useEffect","_jsxs","className","_jsx","children","title","version","onClick","prev","jsx","role","tabIndex","e","stopPropagation","navigator","clipboard","writeText","length","SVGLoader","src","newCopyIcon","arrowUp","arrowDown","_c","map","server","index","type","name","checked","readOnly","description","associatedProduct","productId","Object","entries","tags","tag","endpoints","endpoint","idx","jsxs","assign","api","id","apiSpecId","findIndex","some","tagSectionIndex","sort","a","b","localeCompare","_","tagData","find","t","SectionEnum","API_SECTION","setTo","ENDPOINTS_SECTION","TAG_SECTION","RESOURCE","resetOthers","filterKeys","OVERVIEW","handleClick","method","toLowerCase","summary","slice","path","arrowRightGray","_d","apiVersions","verObj","matchedVersion","v","matchedApi","handleVersionClick","metaData"],"mappings":"mfAYa,MAAAA,EAAe,EAC1BC,OACAC,oBACAC,gBACAC,oBACAC,uBAQA,MAAMC,cAAEA,GAAkBC,KACnBC,EAAaC,GAAkBC,GAA2B,QAAlBC,EAAgB,QAAhBC,EAAAX,aAAA,EAAAA,EAAMY,eAAU,IAAAD,OAAA,EAAAA,EAAA,UAAE,IAAAD,OAAA,EAAAA,EAAEG,MAAO,KACnEC,EAAmBC,GAAwBN,GAAkB,GAEpEO,GAAU,aACRR,GAAiC,QAAlBE,EAAa,UAAbV,aAAA,EAAAA,EAAMY,eAAO,IAAAD,OAAA,EAAAA,EAAG,UAAE,IAAAD,OAAA,EAAAA,EAAEG,MAAO,MACzC,CAACb,IAoEJ,OACEiB,OAAK,MAAA,CAAAC,UAAU,6BACbC,EAAAA,IAAI,KAAA,CAAAD,UAAU,UAAyBE,SAAA,eACvCD,YAAID,UAAU,YAAWE,SAAEpB,aAAI,EAAJA,EAAMqB,QACjCJ,EAAAA,KAAA,IAAA,CAAGC,UAAU,cACEE,SAAA,CAAA,gBAAAD,EAAAA,IAAA,OAAA,CAAAC,SAAOpB,aAAA,EAAAA,EAAMsB,aAG5BL,OAAK,MAAA,CAAAC,UAAU,mBACbE,SAAA,CAAAD,EAAAA,IAAA,QAAA,CAAOD,UAAU,cAAaE,SAAA,iBAC9BH,OAAA,MAAA,CAAKC,UAAU,gBACbE,SAAA,CAAAH,EAAAA,KA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AAMZ,GAAQA,EAAIE,YAAc+B,EAAe/B,YACvE5D,EAAkB6F,GAElB5F,EAAc,YACdG,EACEyF,EAAWjC,UACX,CACE,CAAElB,KAAM8B,EAAYC,YAAaC,OAAO,GACxC,CAAEhC,KAAM8B,EAAYQ,SAAUN,OAAO,IAEvC,CACEI,aAAa,EACbC,WAAY,CACVP,EAAYQ,SACZR,EAAYC,YACZD,EAAYG,kBACZH,EAAYI,gBA4JSkB,CAAmBJ,GAAOvE,UAEzB,QAAfT,EAAAgF,EAAOK,gBAAQ,IAAArF,OAAA,EAAAA,EAAEW,UAAW,OAJxBoB"}
package/dist/styles.css CHANGED
@@ -1960,28 +1960,63 @@ div.endBtnIcon {
1960
1960
  font-weight: 600;
1961
1961
  color: #4d4f5c;
1962
1962
  }
1963
- .api-details-page .custom-url-input .input-wrapper {
1963
+ .api-details-page .custom-url-input .url-container {
1964
+ position: relative;
1965
+ }
1966
+ .api-details-page .custom-url-input .typeDdl {
1967
+ cursor: pointer;
1964
1968
  display: flex;
1965
1969
  align-items: center;
1970
+ justify-content: space-between;
1971
+ width: 100%;
1966
1972
  background-color: #edf1fb;
1967
- border: 1px solid #fff;
1973
+ border: 0.0625rem solid #fff;
1968
1974
  border-radius: 0.375rem;
1969
- padding: 0 0.75rem;
1975
+ padding: 0.5rem 1rem;
1970
1976
  }
1971
- .api-details-page .custom-url-input .input-wrapper input {
1977
+ .api-details-page .custom-url-input .url-text {
1972
1978
  flex: 1;
1973
- padding: 0.5rem 0.5rem;
1979
+ padding-right: 0.75rem;
1974
1980
  border: none;
1975
1981
  background: transparent;
1976
1982
  line-height: 1.75rem;
1977
- letter-spacing: 0px;
1983
+ letter-spacing: 0;
1978
1984
  font-size: 1.125rem;
1979
1985
  font-weight: 400;
1980
1986
  opacity: 0.5;
1981
1987
  color: #000000;
1982
1988
  }
1983
- .api-details-page .custom-url-input .input-wrapper input:focus {
1984
- outline: none;
1989
+ .api-details-page .custom-url-input .icon-container {
1990
+ display: flex;
1991
+ align-items: center;
1992
+ gap: 0.75rem;
1993
+ }
1994
+ .api-details-page .custom-url-input .icon-container .icon {
1995
+ display: inline-block;
1996
+ width: 1.75rem;
1997
+ height: 1.75rem;
1998
+ }
1999
+ .api-details-page .custom-url-input .urlList {
2000
+ position: absolute;
2001
+ top: 100%;
2002
+ left: 0;
2003
+ width: 100%;
2004
+ z-index: 10;
2005
+ background: white;
2006
+ border: 1px solid #ccc;
2007
+ border-radius: 6px;
2008
+ max-height: 200px;
2009
+ overflow-y: auto;
2010
+ }
2011
+ .api-details-page .custom-url-input .url-item {
2012
+ padding: 0.5rem 1rem;
2013
+ display: flex;
2014
+ align-items: center;
2015
+ gap: 0.5rem;
2016
+ cursor: pointer;
2017
+ }
2018
+ .api-details-page .custom-url-input .url-item:hover {
2019
+ background-color: #f5f5f5;
1985
2020
  }
1986
2021
  .api-details-page .custom-url-input .input-wrapper .icon {
1987
2022
  cursor: pointer;
@@ -22,3 +22,6 @@ export { default as PlusIcon } from './Plus.svg';
22
22
  export { default as PlusSquare } from './PlusSquare.svg';
23
23
  export { default as RequestOption } from './RequestOption.svg';
24
24
  export { default as ArrowBack } from './ArrowBack.svg';
25
+ export { default as arrowDown } from './arrow-down.svg';
26
+ export { default as newCopyIcon } from './newCopyIcon.svg';
27
+ export { default as arrowUp } from './arrow-up.svg';
@@ -1,5 +1,6 @@
1
1
  import './style.scss';
2
2
  import { EndpointData, OverviewData } from 'src/layout/docsLayout';
3
+ import React from 'react';
3
4
  export declare const OverviewPage: ({ data, setActiveItemData, setActiveType, onProductNavigate, apis, }: {
4
5
  data: OverviewData;
5
6
  setActiveItemData: React.Dispatch<React.SetStateAction<OverviewData | EndpointData>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digi-frontend/dgate-api-documentation",
3
- "version": "1.0.90",
3
+ "version": "1.0.91",
4
4
  "main": "dist/src/index.js",
5
5
  "module": "dist/src/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -0,0 +1,3 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14.0027 19.6007C13.186 19.6007 12.3694 19.2857 11.751 18.6674L4.14437 11.0607C3.80604 10.7224 3.80604 10.1624 4.14437 9.82406C4.48271 9.48573 5.04271 9.48573 5.38104 9.82406L12.9877 17.4307C13.5477 17.9907 14.4577 17.9907 15.0177 17.4307L22.6244 9.82406C22.9627 9.48573 23.5227 9.48573 23.861 9.82406C24.1994 10.1624 24.1994 10.7224 23.861 11.0607L16.2544 18.6674C15.636 19.2857 14.8194 19.6007 14.0027 19.6007Z" fill="#616874"/>
3
+ </svg>
@@ -0,0 +1,10 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_6817_4615)">
3
+ <path d="M13.9973 8.39927C14.814 8.39927 15.6306 8.71427 16.249 9.3326L23.8556 16.9393C24.194 17.2776 24.194 17.8376 23.8556 18.1759C23.5173 18.5143 22.9573 18.5143 22.619 18.1759L15.0123 10.5693C14.4523 10.0093 13.5423 10.0093 12.9823 10.5693L5.37563 18.1759C5.03729 18.5143 4.47729 18.5143 4.13896 18.1759C3.80062 17.8376 3.80062 17.2776 4.13896 16.9393L11.7456 9.3326C12.364 8.71427 13.1806 8.39927 13.9973 8.39927Z" fill="#616874"/>
4
+ </g>
5
+ <defs>
6
+ <clipPath id="clip0_6817_4615">
7
+ <rect width="28" height="28" fill="white" transform="translate(28 28) rotate(-180)"/>
8
+ </clipPath>
9
+ </defs>
10
+ </svg>
@@ -22,3 +22,6 @@ export { default as PlusIcon } from './Plus.svg'
22
22
  export { default as PlusSquare } from './PlusSquare.svg'
23
23
  export { default as RequestOption } from './RequestOption.svg'
24
24
  export { default as ArrowBack } from './ArrowBack.svg'
25
+ export { default as arrowDown } from './arrow-down.svg'
26
+ export { default as newCopyIcon } from './newCopyIcon.svg'
27
+ export { default as arrowUp } from './arrow-up.svg'
@@ -0,0 +1,4 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12.9487 26.5443H8.0487C3.48703 26.5443 1.45703 24.5143 1.45703 19.9526V15.0526C1.45703 10.4909 3.48703 8.46094 8.0487 8.46094H12.9487C17.5104 8.46094 19.5404 10.4909 19.5404 15.0526V19.9526C19.5404 24.5143 17.5104 26.5443 12.9487 26.5443ZM8.0487 10.2109C4.43203 10.2109 3.20703 11.4359 3.20703 15.0526V19.9526C3.20703 23.5693 4.43203 24.7943 8.0487 24.7943H12.9487C16.5654 24.7943 17.7904 23.5693 17.7904 19.9526V15.0526C17.7904 11.4359 16.5654 10.2109 12.9487 10.2109H8.0487V10.2109Z" fill="#616874"/>
3
+ <path d="M19.9526 19.5404H18.6693C18.1909 19.5404 17.7943 19.1437 17.7943 18.6654V15.0487C17.7943 11.432 16.5693 10.207 12.9526 10.207H9.33594C8.8576 10.207 8.46094 9.81037 8.46094 9.33203V8.0487C8.46094 3.48703 10.4909 1.45703 15.0526 1.45703H19.9526C24.5143 1.45703 26.5443 3.48703 26.5443 8.0487V12.9487C26.5443 17.5104 24.5143 19.5404 19.9526 19.5404ZM19.5443 17.7904H19.9526C23.5693 17.7904 24.7943 16.5654 24.7943 12.9487V8.0487C24.7943 4.43203 23.5693 3.20703 19.9526 3.20703H15.0526C11.4359 3.20703 10.2109 4.43203 10.2109 8.0487V8.45703H12.9526C17.5143 8.45703 19.5443 10.487 19.5443 15.0487V17.7904Z" fill="#616874"/>
4
+ </svg>
@@ -1,8 +1,14 @@
1
1
  import './style.scss'
2
2
  import SVGLoader from '../../../../components/SVGLoader/SVGLoader'
3
- import { arrowRightGray, CopySticker } from '../../../../assets/icons/index'
3
+ import {
4
+ arrowDown,
5
+ arrowRightGray,
6
+ arrowUp,
7
+ newCopyIcon,
8
+ } from '../../../../assets/icons/index'
4
9
  import { EndpointData, OverviewData } from 'src/layout/docsLayout'
5
10
  import { SectionEnum, useSectionToggle } from '../../../../../src/context/SectionToggleContext'
11
+ import React, { useEffect, useState } from 'react'
6
12
 
7
13
  export const OverviewPage = ({
8
14
  data,
@@ -18,7 +24,12 @@ export const OverviewPage = ({
18
24
  apis: OverviewData[]
19
25
  }) => {
20
26
  const { toggleSection } = useSectionToggle()
27
+ const [selectedUrl, setSelectedUrl] = useState(data?.servers?.[0]?.url || '')
28
+ const [isUrlDropdownOpen, setIsUrlDropdownOpen] = useState<boolean>(false)
21
29
 
30
+ useEffect(() => {
31
+ setSelectedUrl(data?.servers?.[0]?.url || '')
32
+ }, [data])
22
33
  const handleVersionClick = (verObj) => {
23
34
  if (verObj.apiSpecId === data.apiSpecId) {
24
35
  setActiveType('OVERVIEW')
@@ -96,24 +107,48 @@ export const OverviewPage = ({
96
107
 
97
108
  <div className="custom-url-input">
98
109
  <label className="input-label">API Base URL</label>
99
- <div className="input-wrapper">
100
- <input
101
- type="text"
102
- value={!!data && !!data.servers && data.servers.length > 0 ? data.servers[0]?.url : '-'}
103
- readOnly
104
- />
105
- <span
106
- className="icon"
107
- onClick={() =>
108
- navigator.clipboard.writeText(
109
- `${
110
- !!data && !!data.servers && data.servers.length > 0 ? data.servers[0]?.url : '-'
111
- }`
112
- )
113
- }
114
- >
115
- <SVGLoader src={CopySticker} />
116
- </span>
110
+ <div className="url-container">
111
+ <div className="typeDdl" onClick={() => setIsUrlDropdownOpen((prev) => !prev)}>
112
+ <span className="url-text">{selectedUrl || '-'}</span>
113
+ <div className="icon-container">
114
+ <span
115
+ className="icon"
116
+ role="button"
117
+ tabIndex={0}
118
+ onClick={(e) => {
119
+ e.stopPropagation()
120
+ navigator.clipboard.writeText(selectedUrl)
121
+ }}
122
+ >
123
+ {selectedUrl.length !== 0 && <SVGLoader src={newCopyIcon} />}
124
+ </span>
125
+ {selectedUrl.length !== 0 && (
126
+ <SVGLoader src={!isUrlDropdownOpen ? arrowDown : arrowUp} />
127
+ )}
128
+ </div>
129
+ </div>
130
+ {isUrlDropdownOpen && selectedUrl.length !== 0 && (
131
+ <div className="urlList">
132
+ {data?.servers?.map((server, index) => (
133
+ <div
134
+ key={index}
135
+ className="url-item"
136
+ onClick={() => {
137
+ setSelectedUrl(server.url)
138
+ setIsUrlDropdownOpen(false)
139
+ }}
140
+ >
141
+ <input
142
+ type="radio"
143
+ name="api-method"
144
+ checked={selectedUrl === server.url}
145
+ readOnly
146
+ />
147
+ <span>{server.url}</span>
148
+ </div>
149
+ ))}
150
+ </div>
151
+ )}
117
152
  </div>
118
153
  </div>
119
154
 
@@ -38,32 +38,69 @@
38
38
  color: #4d4f5c;
39
39
  }
40
40
 
41
- .input-wrapper {
41
+ .url-container {
42
+ position: relative;
43
+ }
44
+
45
+ .typeDdl {
46
+ cursor: pointer;
42
47
  display: flex;
43
48
  align-items: center;
49
+ justify-content: space-between;
50
+ width: 100%;
44
51
  background-color: #edf1fb;
45
- border: 1px solid #fff;
52
+ border: 0.0625rem solid #fff;
46
53
  border-radius: 0.375rem;
47
- padding: 0 0.75rem;
48
-
49
- input {
50
- flex: 1;
51
- padding: 0.5rem 0.5rem;
52
- border: none;
53
- background: transparent;
54
- line-height: 1.75rem;
55
- letter-spacing: 0px;
56
- font-size: 1.125rem;
57
- font-weight: 400;
58
- opacity: 0.5;
54
+ padding: 0.5rem 1rem;
55
+ }
56
+ .url-text {
57
+ flex: 1;
58
+ padding-right: 0.75rem;
59
+ border: none;
60
+ background: transparent;
61
+ line-height: 1.75rem;
62
+ letter-spacing: 0;
63
+ font-size: 1.125rem;
64
+ font-weight: 400;
65
+ opacity: 0.5;
66
+ color: #000000;
67
+ }
68
+ .icon-container {
69
+ display: flex;
70
+ align-items: center;
71
+ gap: 0.75rem;
72
+ .icon {
73
+ display: inline-block;
74
+ width: 1.75rem;
75
+ height: 1.75rem;
76
+ }
77
+ }
59
78
 
60
- color: #000000;
79
+ .urlList {
80
+ position: absolute;
81
+ top: 100%;
82
+ left: 0;
83
+ width: 100%;
84
+ z-index: 10;
85
+ background: white;
86
+ border: 1px solid #ccc;
87
+ border-radius: 6px;
88
+ max-height: 200px;
89
+ overflow-y: auto;
90
+ }
61
91
 
62
- &:focus {
63
- outline: none;
64
- }
92
+ .url-item {
93
+ padding: 0.5rem 1rem;
94
+ display: flex;
95
+ align-items: center;
96
+ gap: 0.5rem;
97
+ cursor: pointer;
98
+ &:hover {
99
+ background-color: #f5f5f5;
65
100
  }
101
+ }
66
102
 
103
+ .input-wrapper {
67
104
  .icon {
68
105
  cursor: pointer;
69
106
  color: #4d75d9;
package/variables.txt CHANGED
@@ -1 +1 @@
1
- export APP_VERSION=1.0.89
1
+ export APP_VERSION=1.0.90