@e-llm-studio/citation 0.0.85 → 0.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/CodeCitation/CodeCitation.js +1 -1
- package/dist/cjs/utils/themeManager.js +2 -0
- package/dist/cjs/utils/themeManager.js.map +1 -0
- package/dist/features/CodeCitation/CodeCitation.js +1 -1
- package/dist/types/src/features/CodeCitation/CodeCitation.d.ts.map +1 -1
- package/dist/types/src/utils/themeManager.d.ts +13 -0
- package/dist/types/src/utils/themeManager.d.ts.map +1 -0
- package/dist/utils/themeManager.js +2 -0
- package/dist/utils/themeManager.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),t=require("react/jsx-runtime"),n=require("react"),i=require("./CodeCitation.module.css.js"),a=require("./_components/CodeEditor.js"),s=require("../../utils/codeCitations.utils.js"),o=require("./_components/ThemeToggle.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),t=require("react/jsx-runtime"),n=require("react"),i=require("./CodeCitation.module.css.js"),a=require("./_components/CodeEditor.js"),s=require("../../utils/codeCitations.utils.js"),o=require("./_components/ThemeToggle.js"),r=require("./_components/CodeCitationPopup.js"),l=require("./_components/HighlightedCodeDetails.js"),d=require("../../node_modules/axios/lib/axios.js"),u=require("./_components/Spinner.js"),c=require("../../constants/diagnosticStylesBySeverity.js"),g=require("../../utils/themeManager.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=h(n);exports.default=function(h){var m=h.baseUrlForCodeRetrieval,p=h.assistantName,x=h.organizationName,S=h.userId,v=h.taskId,_=h.repoUrl,I=h.inLineCitation,C=h.citationTitle,y=h.filename,j=h.filepath,b=h.citationContainerTitle,F=h.showThemeToggle,T=h.customCode,k=h.isDarkModeEnabled,D=h.chevronUpComponent,P=h.chevronDownComponent,w=h.isHighlightingEnabled,E=h.FileDetailsComponent,L=h.additionalCallbackForPillButton,H=h.CustomCodeRenderComponent,q=h.fileSummarySectionTitle,M=h.showFullscreenIcon,B=h.showFileSummaryIButton,N=h.editorHeight,W=h.editorWidth,z=h.styles,V=void 0===z?{}:z,R=h.diagnostics,J=h.diagnosticStylesBySeverity,U=h.datasource,A=void 0===U?"codebase":U,O=h.externalFilesData,Y=h.startIndex,G=h.endIndex,K=n.useRef(!1),Q=s.getLanguageFromFileName(y),X=n.useState(!1),Z=X[0],$=X[1],ee=n.useState((function(){return g.themeManager.getTheme(k)})),te=ee[0],ne=ee[1];n.useEffect((function(){return g.themeManager.subscribe(ne)}),[]);var ie=n.useState(!1),ae=ie[0],se=ie[1],oe=n.useState(!1),re=oe[0],le=oe[1],de=n.useState(!1),ue=de[0],ce=de[1],ge=n.useState(!1),he=ge[0],fe=ge[1],me=n.useState(null),pe=me[0],xe=me[1],Se=n.useState(""),ve=Se[0],_e=Se[1],Ie=n.useState(""),Ce=Ie[0],ye=Ie[1],je=n.useState({startIndex:-1,endIndex:-1}),be=je[0],Fe=je[1],Te=n.useState({}),ke=Te[0],De=Te[1],Pe=n.useState(!1),we=Pe[0],Ee=Pe[1],Le=n.useState(!1),He=Le[0],qe=Le[1],Me=n.useState({startIndex:-1,endIndex:-1}),Be=Me[0],Ne=Me[1],We=n.useState({startIndex:-1,endIndex:-1}),ze=We[0],Ve=We[1],Re=f.default.useMemo((function(){return e.__assign(e.__assign({},c.DEFAULT_DIAGNOSTIC_STYLES_BY_SEVERITY),J)}),[J]);n.useEffect((function(){Ve({startIndex:null!=Y?Y:-1,endIndex:null!=G?G:-1})}),[Y,G]),n.useEffect((function(){O&&T&&(xe(O),K.current=!0)}),[O,T]),n.useEffect((function(){if("undefined"!=typeof window&&!K.current){K.current=!0;var t=new URL(j,"http://example.com"),n=t.searchParams,i=void 0!==Y?Y:n.has("startLine")?Number(n.get("startLine")):-1,a=void 0!==G?G:n.has("endLine")?Number(n.get("endLine")):-1;Ve({startIndex:i,endIndex:a}),Fe({startIndex:i,endIndex:a}),Ne({startIndex:i,endIndex:a}),t.searchParams.delete("startLine"),t.searchParams.delete("endLine"),t.searchParams.delete("validation");var s=t.pathname+t.search,o=null==s?void 0:s.replace(/^\//,"");ye(o),console.log("Params going to API:",{file_path:o,assistant_name:p,organization_name:x,user_id:S,task_id:v,chunks_search:!1,technical_details_only:!0,repo_url:_});T||we||e.__awaiter(void 0,void 0,void 0,(function(){var t,n,i,a,s,r;return e.__generator(this,(function(l){switch(l.label){case 0:qe(!1),Ee(!0),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,d.default.get("".concat(m,"/analyzer/get_file_details"),{params:e.__assign({file_path:String(o),assistant_name:String(p),organization_name:String(x),user_id:String(S),task_id:String(v),repo_url:String(_),chunks_search:!1,technical_details_only:!0},"codebase"!==A&&{datasource:A})})];case 2:return t=l.sent(),n=(null==t?void 0:t.data[0])||(null==t?void 0:t.data),!pe&&n&&(xe(n),Object.keys(null==t?void 0:t.data)&&(i=(null===(r=null===(s=null==t?void 0:t.data)||void 0===s?void 0:s[0])||void 0===r?void 0:r.content)||(null==t?void 0:t.data.content),_e(i))),Ee(!1),[2,t.data];case 3:return a=l.sent(),qe(!0),console.error("Error in retrieving file details: ",a),[3,4];case 4:return Ee(!1),[2]}}))}))}}),[]);return t.jsxs(t.Fragment,{children:[t.jsxs("span",e.__assign({onClick:function(e){return function(e){e.preventDefault(),e.stopPropagation(),L&&L(),$((function(e){return!e})),se((function(e){return!e}))}(e)},className:i.default.pillButton,style:V.pillButton},{children:[t.jsx("span",e.__assign({style:V.citationTitle},{children:C})),I&&(Z?D:P)]})),(!I||re)&&t.jsx(r.default,{open:ae,onClose:function(){Ve({startIndex:null==Be?void 0:Be.startIndex,endIndex:null==Be?void 0:Be.endIndex}),le(!1),se(!1),Fe({startIndex:-1,endIndex:-1}),De({})},title:C,customStyles:{popupContainer:{width:"100vw",height:"100vh",borderRadius:"0.75rem",fontFamily:"Plus Jakarta Sans, sans-serif"},popupTitleContainer:{color:"#d63384",fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"700"},topLeftTitle:{backgroundColor:"#f9f9f9",fontFamily:"Plus Jakarta Sans, sans-serif",fontSize:"1rem",fontWeight:"bold",padding:"5px",margin:"0px"},bottomLeftTitle:{backgroundColor:"#f9f9f9",fontFamily:"Plus Jakarta Sans, sans-serif",fontSize:"1rem",fontWeight:"bold",padding:"5px",margin:"0px"}},editorChildren:t.jsx(a.default,{startIndex:null==ze?void 0:ze.startIndex,endIndex:null==ze?void 0:ze.endIndex,language:Q,editorHeight:N,editorWidth:W,code:T||ve,isHighlightingEnabled:w,isDarkModeEnabled:te,highlightCodeStatsLine:be,setHighlightCodeStatsLine:Fe,highlightCodeStatsVariable:ke,setHighlightCodeStatsVariable:De,isExpanded:Z,highlightIndexes:ze,diagnostics:R,diagnosticStylesBySeverity:Re}),fileDetails:pe,setHighlightIndexes:Ve,highlightCodeStatsLine:be,setHighlightCodeStatsLine:Fe,highlightCodeStatsVariable:ke,setHighlightCodeStatsVariable:De,filepath:Ce,datasource:A}),I&&Z&&t.jsx("div",e.__assign({className:i.default.citationWrapper,style:V.citationWrapper},{children:t.jsxs("div",e.__assign({className:i.default.citationContent,style:V.citationContent},{children:[!ue&&b?t.jsxs("div",e.__assign({className:i.default.citationContainerTitle,style:V.citationContainerTitle},{children:[t.jsx("span",{children:b}),F?t.jsx(o.default,{darkMode:te,onToggle:function(e){return function(e){e.stopPropagation(),e.preventDefault(),g.themeManager.setTheme(!te)}(e)},toggleFullscreen:function(e){e.stopPropagation(),e.preventDefault(),se(!0),le(!0)},handleOpenFileDetailSection:function(e){e.stopPropagation(),e.preventDefault(),fe(!0)},showFullscreenIcon:M,showFileSummaryIButton:B}):t.jsx(t.Fragment,{})]})):t.jsx(t.Fragment,{}),t.jsxs("div",e.__assign({style:{zIndex:-1e3,color:"#000",overflow:"hidden",display:"flex",flexDirection:"column",height:N,width:W,fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[!ue&&!he&&H,we?t.jsx(u.default,{}):t.jsx(t.Fragment,{}),He?t.jsx("div",e.__assign({style:{height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",color:"#242424"}},{children:"Something went wrong"})):t.jsx(t.Fragment,{}),!ue&&!he&&!H&&!we&&!He&&t.jsx(a.default,{startIndex:null==ze?void 0:ze.startIndex,endIndex:null==ze?void 0:ze.endIndex,language:Q,editorHeight:N,editorWidth:W,code:null!=T?T:ve,isHighlightingEnabled:w,isDarkModeEnabled:te,openHighlightedCodeDetails:function(){ce(!0)},highlightCodeStatsVariable:ke,setHighlightCodeStatsVariable:De,isExpanded:Z,highlightIndexes:ze,diagnostics:R,diagnosticStylesBySeverity:Re}),he&&t.jsx(l.default,{FileDetailsComponent:E,fileSummarySectionTitle:q,isDarkMode:te,editorHeight:N,editorWidth:W,code:null==pe?void 0:pe.content.split("\n").slice((null==ze?void 0:ze.startIndex)-1,null==ze?void 0:ze.endIndex).join("\n"),language:Q,onClose:function(e){e.stopPropagation(),e.preventDefault(),fe(!1)},summary:null==pe?void 0:pe.summary,filepath:Ce,citationTitle:C})]}))]}))}))]})};
|
|
2
2
|
//# sourceMappingURL=CodeCitation.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=new(function(){function e(){this.listeners=new Set,this.isDarkTheme=!0,this.isInitialized=!1}return e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.setTheme=function(e){this.isDarkTheme=e,this.listeners.forEach((function(t){return t(e)}))},e.prototype.getTheme=function(e){return this.isInitialized||void 0===e||(this.setTheme(e),this.isInitialized=!0),this.isDarkTheme},e}());exports.themeManager=e;
|
|
2
|
+
//# sourceMappingURL=themeManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeManager.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as t,__generator as n}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as i,Fragment as o,jsx as a}from"react/jsx-runtime";import
|
|
1
|
+
import{__assign as e,__awaiter as t,__generator as n}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as i,Fragment as o,jsx as a}from"react/jsx-runtime";import r,{useRef as l,useState as s,useEffect as d}from"react";import c from"./CodeCitation.module.css.js";import u from"./_components/CodeEditor.js";import{getLanguageFromFileName as h}from"../../utils/codeCitations.utils.js";import g from"./_components/ThemeToggle.js";import m from"./_components/CodeCitationPopup.js";import p from"./_components/HighlightedCodeDetails.js";import f from"../../node_modules/axios/lib/axios.js";import v from"./_components/Spinner.js";import{DEFAULT_DIAGNOSTIC_STYLES_BY_SEVERITY as x}from"../../constants/diagnosticStylesBySeverity.js";import{themeManager as I}from"../../utils/themeManager.js";var C=function(C){var y=C.baseUrlForCodeRetrieval,S=C.assistantName,b=C.organizationName,_=C.userId,k=C.taskId,D=C.repoUrl,P=C.inLineCitation,T=C.citationTitle,w=C.filename,j=C.filepath,F=C.citationContainerTitle,H=C.showThemeToggle,L=C.customCode,E=C.isDarkModeEnabled,B=C.chevronUpComponent,W=C.chevronDownComponent,N=C.isHighlightingEnabled,z=C.FileDetailsComponent,M=C.additionalCallbackForPillButton,V=C.CustomCodeRenderComponent,J=C.fileSummarySectionTitle,R=C.showFullscreenIcon,U=C.showFileSummaryIButton,A=C.editorHeight,O=C.editorWidth,q=C.styles,G=void 0===q?{}:q,K=C.diagnostics,Q=C.diagnosticStylesBySeverity,X=C.datasource,Y=void 0===X?"codebase":X,Z=C.externalFilesData,$=C.startIndex,ee=C.endIndex,te=l(!1),ne=h(w),ie=s(!1),oe=ie[0],ae=ie[1],re=s((function(){return I.getTheme(E)})),le=re[0],se=re[1];d((function(){return I.subscribe(se)}),[]);var de=s(!1),ce=de[0],ue=de[1],he=s(!1),ge=he[0],me=he[1],pe=s(!1),fe=pe[0],ve=pe[1],xe=s(!1),Ie=xe[0],Ce=xe[1],ye=s(null),Se=ye[0],be=ye[1],_e=s(""),ke=_e[0],De=_e[1],Pe=s(""),Te=Pe[0],we=Pe[1],je=s({startIndex:-1,endIndex:-1}),Fe=je[0],He=je[1],Le=s({}),Ee=Le[0],Be=Le[1],We=s(!1),Ne=We[0],ze=We[1],Me=s(!1),Ve=Me[0],Je=Me[1],Re=s({startIndex:-1,endIndex:-1}),Ue=Re[0],Ae=Re[1],Oe=s({startIndex:-1,endIndex:-1}),qe=Oe[0],Ge=Oe[1],Ke=r.useMemo((function(){return e(e({},x),Q)}),[Q]);d((function(){Ge({startIndex:null!=$?$:-1,endIndex:null!=ee?ee:-1})}),[$,ee]),d((function(){Z&&L&&(be(Z),te.current=!0)}),[Z,L]),d((function(){if("undefined"!=typeof window&&!te.current){te.current=!0;var i=new URL(j,"http://example.com"),o=i.searchParams,a=void 0!==$?$:o.has("startLine")?Number(o.get("startLine")):-1,r=void 0!==ee?ee:o.has("endLine")?Number(o.get("endLine")):-1;Ge({startIndex:a,endIndex:r}),He({startIndex:a,endIndex:r}),Ae({startIndex:a,endIndex:r}),i.searchParams.delete("startLine"),i.searchParams.delete("endLine"),i.searchParams.delete("validation");var l=i.pathname+i.search,s=null==l?void 0:l.replace(/^\//,"");we(s),console.log("Params going to API:",{file_path:s,assistant_name:S,organization_name:b,user_id:_,task_id:k,chunks_search:!1,technical_details_only:!0,repo_url:D});L||Ne||t(void 0,void 0,void 0,(function(){var t,i,o,a,r,l;return n(this,(function(n){switch(n.label){case 0:Je(!1),ze(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,f.get("".concat(y,"/analyzer/get_file_details"),{params:e({file_path:String(s),assistant_name:String(S),organization_name:String(b),user_id:String(_),task_id:String(k),repo_url:String(D),chunks_search:!1,technical_details_only:!0},"codebase"!==Y&&{datasource:Y})})];case 2:return t=n.sent(),i=(null==t?void 0:t.data[0])||(null==t?void 0:t.data),!Se&&i&&(be(i),Object.keys(null==t?void 0:t.data)&&(o=(null===(l=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r[0])||void 0===l?void 0:l.content)||(null==t?void 0:t.data.content),De(o))),ze(!1),[2,t.data];case 3:return a=n.sent(),Je(!0),console.error("Error in retrieving file details: ",a),[3,4];case 4:return ze(!1),[2]}}))}))}}),[]);return i(o,{children:[i("span",e({onClick:function(e){return function(e){e.preventDefault(),e.stopPropagation(),M&&M(),ae((function(e){return!e})),ue((function(e){return!e}))}(e)},className:c.pillButton,style:G.pillButton},{children:[a("span",e({style:G.citationTitle},{children:T})),P&&(oe?B:W)]})),(!P||ge)&&a(m,{open:ce,onClose:function(){Ge({startIndex:null==Ue?void 0:Ue.startIndex,endIndex:null==Ue?void 0:Ue.endIndex}),me(!1),ue(!1),He({startIndex:-1,endIndex:-1}),Be({})},title:T,customStyles:{popupContainer:{width:"100vw",height:"100vh",borderRadius:"0.75rem",fontFamily:"Plus Jakarta Sans, sans-serif"},popupTitleContainer:{color:"#d63384",fontFamily:"Plus Jakarta Sans, sans-serif",position:"relative",textAlign:"left",fontWeight:"700"},topLeftTitle:{backgroundColor:"#f9f9f9",fontFamily:"Plus Jakarta Sans, sans-serif",fontSize:"1rem",fontWeight:"bold",padding:"5px",margin:"0px"},bottomLeftTitle:{backgroundColor:"#f9f9f9",fontFamily:"Plus Jakarta Sans, sans-serif",fontSize:"1rem",fontWeight:"bold",padding:"5px",margin:"0px"}},editorChildren:a(u,{startIndex:null==qe?void 0:qe.startIndex,endIndex:null==qe?void 0:qe.endIndex,language:ne,editorHeight:A,editorWidth:O,code:L||ke,isHighlightingEnabled:N,isDarkModeEnabled:le,highlightCodeStatsLine:Fe,setHighlightCodeStatsLine:He,highlightCodeStatsVariable:Ee,setHighlightCodeStatsVariable:Be,isExpanded:oe,highlightIndexes:qe,diagnostics:K,diagnosticStylesBySeverity:Ke}),fileDetails:Se,setHighlightIndexes:Ge,highlightCodeStatsLine:Fe,setHighlightCodeStatsLine:He,highlightCodeStatsVariable:Ee,setHighlightCodeStatsVariable:Be,filepath:Te,datasource:Y}),P&&oe&&a("div",e({className:c.citationWrapper,style:G.citationWrapper},{children:i("div",e({className:c.citationContent,style:G.citationContent},{children:[!fe&&F?i("div",e({className:c.citationContainerTitle,style:G.citationContainerTitle},{children:[a("span",{children:F}),H?a(g,{darkMode:le,onToggle:function(e){return function(e){e.stopPropagation(),e.preventDefault(),I.setTheme(!le)}(e)},toggleFullscreen:function(e){e.stopPropagation(),e.preventDefault(),ue(!0),me(!0)},handleOpenFileDetailSection:function(e){e.stopPropagation(),e.preventDefault(),Ce(!0)},showFullscreenIcon:R,showFileSummaryIButton:U}):a(o,{})]})):a(o,{}),i("div",e({style:{zIndex:-1e3,color:"#000",overflow:"hidden",display:"flex",flexDirection:"column",height:A,width:O,fontFamily:"Plus Jakarta Sans, sans-serif"}},{children:[!fe&&!Ie&&V,a(Ne?v:o,{}),Ve?a("div",e({style:{height:"100%",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",color:"#242424"}},{children:"Something went wrong"})):a(o,{}),!fe&&!Ie&&!V&&!Ne&&!Ve&&a(u,{startIndex:null==qe?void 0:qe.startIndex,endIndex:null==qe?void 0:qe.endIndex,language:ne,editorHeight:A,editorWidth:O,code:null!=L?L:ke,isHighlightingEnabled:N,isDarkModeEnabled:le,openHighlightedCodeDetails:function(){ve(!0)},highlightCodeStatsVariable:Ee,setHighlightCodeStatsVariable:Be,isExpanded:oe,highlightIndexes:qe,diagnostics:K,diagnosticStylesBySeverity:Ke}),Ie&&a(p,{FileDetailsComponent:z,fileSummarySectionTitle:J,isDarkMode:le,editorHeight:A,editorWidth:O,code:null==Se?void 0:Se.content.split("\n").slice((null==qe?void 0:qe.startIndex)-1,null==qe?void 0:qe.endIndex).join("\n"),language:ne,onClose:function(e){e.stopPropagation(),e.preventDefault(),Ce(!1)},summary:null==Se?void 0:Se.summary,filepath:Te,citationTitle:T})]}))]}))}))]})};export{C as default};
|
|
2
2
|
//# sourceMappingURL=CodeCitation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeCitation.d.ts","sourceRoot":"","sources":["../../../../../src/features/CodeCitation/CodeCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoB,aAAa,EAAa,MAAM,OAAO,CAAC;AAS1E,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeCitation.d.ts","sourceRoot":"","sources":["../../../../../src/features/CodeCitation/CodeCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAoB,aAAa,EAAa,MAAM,OAAO,CAAC;AAS1E,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAIhH,UAAU,iBAAiB;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,2BAA2B,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9C,yBAAyB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5C,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACrC,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,yBAAyB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5C,sBAAsB,CAAC,EAAE,GAAG,CAAC;IAC7B,+BAA+B,CAAC,EAAE,GAAG,CAAC;IACtC,uBAAuB,EAAE,MAAM,CAAA;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,0BAA0B,CAAC,EAAE,2BAA2B,CAAC;IACzD,MAAM,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,eAAe,CAAC,EAAE,aAAa,CAAC;QAChC,sBAAsB,CAAC,EAAE,aAAa,CAAC;KAC1C,CAAC;IACF,UAAU,CAAC,EAAE,IAAI,GAAG,UAAU,CAAC;IAC/B,iBAAiB,CAAC,EAAE,qBAAqB,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8R7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type ThemeCallback = (isDarkTheme: boolean) => void;
|
|
2
|
+
declare class ThemeManager {
|
|
3
|
+
private listeners;
|
|
4
|
+
private isDarkTheme;
|
|
5
|
+
private isInitialized;
|
|
6
|
+
constructor();
|
|
7
|
+
subscribe(callback: ThemeCallback): () => void;
|
|
8
|
+
setTheme(isDarkTheme: boolean): void;
|
|
9
|
+
getTheme(initialTheme?: boolean): boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const themeManager: ThemeManager;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=themeManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeManager.d.ts","sourceRoot":"","sources":["../../../../src/utils/themeManager.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;AAEpD,cAAM,YAAY;IACd,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,aAAa,CAAU;;IAQ/B,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,IAAI;IAK9C,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI;IAKpC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO;CAS5C;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=new(function(){function e(){this.listeners=new Set,this.isDarkTheme=!0,this.isInitialized=!1}return e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.setTheme=function(e){this.isDarkTheme=e,this.listeners.forEach((function(t){return t(e)}))},e.prototype.getTheme=function(e){return this.isInitialized||void 0===e||(this.setTheme(e),this.isInitialized=!0),this.isDarkTheme},e}());export{e as themeManager};
|
|
2
|
+
//# sourceMappingURL=themeManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeManager.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|