@flexkit/explorer 0.0.6 → 0.0.8

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/README.md CHANGED
@@ -39,7 +39,7 @@ npm install @flexkit/explorer
39
39
 
40
40
  ```ts
41
41
  // `flexkit.config.ts`:
42
- import { defineConfig } from '@flexkit/studio/ssr';
42
+ import { defineConfig } from '@flexkit/studio';
43
43
  import { Explorer } from '@flexkit/explorer';
44
44
 
45
45
  export default defineConfig({
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import {SquarePlay,ChevronsRight,ChevronsLeft}from'lucide-react';import {useMemo,useState,useRef,useEffect,Children,useCallback,Fragment as Fragment$1}from'react';import {createGraphiQLFetcher}from'@graphiql/toolkit';import {useConfig}from'@flexkit/studio';import {GraphiQLProvider,useEditorContext,useExecutionContext,useSchemaContext,useStorageContext,usePluginContext,useCopyQuery,useMergeQuery,usePrettifyEditors,useTheme,ToolbarButton,PrettifyIcon,MergeIcon,CopyIcon,Tooltip,UnStyledButton,PlusIcon,ReloadIcon,KeyboardShortcutIcon,SettingsIcon,Tabs as Tabs$1,Tab,QueryEditor,ExecuteButton,VariableEditor,Spinner,ResponseEditor,Dialog,ButtonGroup,Button as Button$1,isMacOs}from'@graphiql/react';import {ResizablePanelGroup,ResizablePanel,Tabs,TabsList,TabsTrigger,Tooltip as Tooltip$1,TooltipTrigger,Button,TooltipContent,Separator,TabsContent,ScrollArea,ScrollBar,ResizableHandle}from'@flexkit/studio/ui';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import'@graphiql/react/dist/style.css';function f({dangerouslyAssumeSchemaIsValid:t,confirmCloseTab:r,defaultQuery:i,defaultTabs:s,externalFragments:h,fetcher:u,getDefaultFieldNames:n,headers:d,inputValueDeprecation:P,introspectionQueryName:k,maxHistoryLength:p,onEditOperationName:M,onSchemaChange:B,onTabChange:w,onTogglePluginVisibility:W,operationName:m,plugins:Q,query:x,response:y,schema:T,schemaDescription:L,shouldPersistHeaders:G,storage:I,validationRules:O,variables:H,visiblePlugin:_,defaultHeaders:A,...v}){if(typeof u!="function")throw new TypeError("The `GraphiQL` component requires a `fetcher` function to be passed as prop.");return jsx(GraphiQLProvider,{getDefaultFieldNames:n,dangerouslyAssumeSchemaIsValid:t,defaultQuery:i,defaultHeaders:A,defaultTabs:s,externalFragments:h,fetcher:u,headers:d,inputValueDeprecation:P,introspectionQueryName:k,maxHistoryLength:p,onEditOperationName:M,onSchemaChange:B,onTabChange:w,onTogglePluginVisibility:W,plugins:Q,visiblePlugin:_,operationName:m,query:x,response:y,schema:T,schemaDescription:L,shouldPersistHeaders:G,storage:I,validationRules:O,variables:H,children:jsx(tt,{confirmCloseTab:r,showPersistHeadersSettings:G!==false,disableTabs:v.disableTabs??false,forcedTheme:v.forcedTheme,...v})})}f.Toolbar=Z;f.Footer=ee;var et=["light","dark","system"],q="graphiql-session-tab-";function tt(t){t.isHeadersEditorEnabled??true;let i=useEditorContext({nonNull:true}),s=useExecutionContext({nonNull:true}),h=useSchemaContext({nonNull:true}),u=useStorageContext(),n=usePluginContext(),[d,P]=useState(false),k=useRef(null),p=useMemo(()=>t.forcedTheme&&et.includes(t.forcedTheme)?t.forcedTheme:void 0,[t.forcedTheme]),M=useCopyQuery({onCopyQuery:t.onCopyQuery}),B=useMergeQuery(),w=usePrettifyEditors(),{theme:W,setTheme:m}=useTheme(t.defaultTheme);useEffect(()=>{p==="system"?m(null):(p==="light"||p==="dark")&&m(p);},[p,m]),useEffect(()=>{n?.setVisiblePlugin(n.plugins[0]);},[n]);let [Q,x]=useState(null),[y,T]=useState(null),L=Children.toArray(t.children),G=L.find(a=>Y(a,f.Toolbar))??jsxs(Fragment,{children:[jsx(ToolbarButton,{onClick:w,label:"Prettify query (Shift-Ctrl-P)",children:jsx(PrettifyIcon,{className:"ex-w-6 ex-h-6 ex-block","aria-hidden":"true"})}),jsx(ToolbarButton,{onClick:B,label:"Merge fragments into query (Shift-Ctrl-M)",children:jsx(MergeIcon,{className:"ex-w-6 ex-h-6 ex-block","aria-hidden":"true"})}),jsx(ToolbarButton,{onClick:M,label:"Copy query (Shift-Ctrl-C)",children:jsx(CopyIcon,{className:"ex-w-6 ex-h-6 ex-block","aria-hidden":"true"})}),t.toolbar?.additionalContent,t.toolbar?.additionalComponent&&jsx(t.toolbar.additionalComponent,{})]}),I=L.find(a=>Y(a,f.Footer)),O=useCallback(()=>{try{u?.clear(),T("success");}catch{T("error");}},[u]),H=useCallback(a=>{i.setShouldPersistHeaders(a.currentTarget.dataset.value==="true");},[i]);useCallback(a=>{let l=a.currentTarget.dataset.theme;m(l||null);},[m]);let A=()=>{i.addTab();},v=()=>{h.introspect();},oe=a=>{i.moveTab(a);},X=useCallback(a=>{x(a.currentTarget.dataset.value);},[]),ie=useCallback(a=>{let l=n,b=Number(a.currentTarget.dataset.index);if(!l)return;let C=l.plugins.find((ct,ue)=>b===ue)??null;if(C===l.visiblePlugin){l.setVisiblePlugin(null);return}l.setVisiblePlugin(C);},[n]),le=useCallback(a=>{a||x(null);},[]),re=useCallback(a=>{a||(x(null),T(null));},[]),ne=jsx(Tooltip,{label:"Add tab",children:jsx(UnStyledButton,{type:"button",className:"graphiql-tab-add",onClick:A,"aria-label":"Add tab",children:jsx(PlusIcon,{"aria-hidden":"true"})})}),se=t.className?` ${t.className}`:"",z=t.confirmCloseTab,de=useCallback(async a=>{let l=a.currentTarget.previousSibling,b=Number(l.id.replace(q,""));(!z||await z(b))&&(i.activeTabIndex===b&&s.stop(),i.closeTab(b));},[z,i,s]),ce=useCallback(a=>{let l=Number(a.currentTarget.id.replace(q,""));s.stop(),i.changeTab(l);},[i,s]);return jsx(Tooltip.Provider,{children:jsxs("div",{className:`graphiql-container${se}`,children:[jsxs(ResizablePanelGroup,{autoSaveId:"explorer",direction:"horizontal",className:"ex-h-full ex-max-h-full",children:[jsxs(ResizablePanel,{collapsible:true,collapsedSize:3,minSize:10,onCollapse:()=>{P(true);},onExpand:()=>{P(false);},ref:k,children:[jsx("div",{className:"ex-flex ex-w-full ex-h-full ex-pb-6",children:jsxs(Tabs,{className:"ex-w-full",defaultValue:n?.plugins[0].title,children:[jsxs("div",{className:`ex-flex ex-items-center ex-py-1 ${d?"":"ex-px-3"}`,children:[jsx(TabsList,{className:d?"ex-hidden":"",children:n?.plugins.map((a,l)=>{let C=`${a===n.visiblePlugin?"Hide":"Show"} ${a.title}`;return jsx(TabsTrigger,{"aria-label":C,className:"ex-text-muted-foreground","data-index":l,onClick:ie,value:a.title,children:jsx(a.icon,{"aria-hidden":"true"})},a.title)})}),jsxs(Tooltip$1,{children:[jsx(TooltipTrigger,{asChild:true,children:jsx(Button,{className:d?"ex-ml-1.5":"ex-ml-auto",onClick:()=>{let a=k.current;d?a?.expand():a?.collapse();},size:"icon",variant:"ghost",children:d?jsxs(Fragment,{children:[jsx(ChevronsRight,{className:"ex-w-4 ex-h-4"}),jsx("span",{className:"ex-sr-only",children:"Expand"})]}):jsxs(Fragment,{children:[jsx(ChevronsLeft,{className:"ex-w-4 ex-h-4"}),jsx("span",{className:"ex-sr-only",children:"Collapse"})]})})}),jsx(TooltipContent,{children:d?"Expand":"Collapse"})]})]}),d?null:jsx(Separator,{}),n?.plugins.map(a=>jsx(TabsContent,{className:`ex-flex ex-w-full ex-max-h-full ex-mt-0 ${d?"ex-hidden":""}`,value:a.title,children:jsxs(ScrollArea,{className:"ex-flex ex-w-full ex-max-h-full ex-overflow-auto ex-px-6 ex-pt-3 ex-pb-6 ex-mb-3 [&>div>div]:!ex-block",children:[jsx(a.content,{}),jsx(ScrollBar,{orientation:"horizontal"})]})},a.title))]})}),jsx(Tooltip,{label:"Re-fetch GraphQL schema",children:jsx(UnStyledButton,{type:"button",disabled:h.isFetching,onClick:v,"aria-label":"Re-fetch GraphQL schema",children:jsx(ReloadIcon,{className:h.isFetching?"graphiql-spin":"","aria-hidden":"true"})})}),jsx(Tooltip,{label:"Open short keys dialog",children:jsx(UnStyledButton,{type:"button","data-value":"short-keys",onClick:X,"aria-label":"Open short keys dialog",children:jsx(KeyboardShortcutIcon,{"aria-hidden":"true"})})}),jsx(Tooltip,{label:"Open settings dialog",children:jsx(UnStyledButton,{type:"button","data-value":"settings",onClick:X,"aria-label":"Open settings dialog",children:jsx(SettingsIcon,{"aria-hidden":"true"})})})]}),jsx(ResizableHandle,{className:"hover:ex-bg-blue-500 ex-transition-colors",withHandle:true}),jsx(ResizablePanel,{className:"ex-bg-muted",defaultSize:48,children:jsxs("div",{className:"ex-flex ex-flex-col ex-h-full",children:[jsxs("div",{className:"ex-flex ex-items-center ex-py-1 ex-px-4 ex-gap-6 ex-bg-muted",children:[!t.disableTabs&&jsx(Tabs$1,{"aria-label":"Select active operation",className:"!ex-p-1 ex-bg-muted ex-rounded-md",onReorder:oe,values:i.tabs,children:i.tabs.length>0&&jsx(Fragment,{children:i.tabs.map((a,l)=>jsxs(Tab,{isActive:l===i.activeTabIndex,value:a,children:[jsx(Tab.Button,{"aria-controls":"graphiql-session",id:`${q}${l.toString()}`,onClick:ce,children:a.title}),jsx(Tab.Close,{onClick:de})]},a.id))})}),ne]}),jsx("div",{role:"tabpanel",id:"graphiql-session",className:"graphiql-session","aria-labelledby":`${q}${i.activeTabIndex}`,children:jsx("div",{className:`graphiql-editors${i.tabs.length===1?" full-height":""}`,children:jsxs(ResizablePanelGroup,{direction:"vertical",children:[jsxs(ResizablePanel,{className:"ex-flex ex-w-full ex-gap-x-4 ex-px-4 ex-py-2",defaultSize:80,children:[jsx(QueryEditor,{editorTheme:t.editorTheme,keyMap:t.keyMap,onCopyQuery:t.onCopyQuery,onEdit:t.onEditQuery,readOnly:t.readOnly}),jsxs("div",{className:"graphiql-toolbar",role:"toolbar","aria-label":"Editor Commands",children:[jsx(ExecuteButton,{}),G]})]}),jsx(ResizableHandle,{className:"hover:ex-bg-blue-500 ex-transition-colors",withHandle:true}),jsxs(ResizablePanel,{className:"ex-bg-muted ex-px-4 ex-pt-2",defaultSize:20,children:[jsx("div",{className:"ex-text-sm ex-font-medium ex-text-muted-foreground",children:"Variables"}),jsx(VariableEditor,{editorTheme:t.editorTheme,isHidden:false,keyMap:t.keyMap,onEdit:t.onEditVariables,readOnly:t.readOnly})]})]})})})]})}),jsx(ResizableHandle,{className:"hover:ex-bg-blue-500 ex-transition-colors",withHandle:true}),jsx(ResizablePanel,{className:"ex-px-5 ex-pt-10 ex-relative",defaultSize:30,children:jsxs("div",{className:"graphiql-response ex-h-full",children:[s.isFetching?jsx(Spinner,{}):null,jsx(ResponseEditor,{editorTheme:t.editorTheme,responseTooltip:t.responseTooltip,keyMap:t.keyMap}),I]})})]}),jsxs(Dialog,{open:Q==="short-keys",onOpenChange:le,children:[jsxs("div",{className:"graphiql-dialog-header",children:[jsx(Dialog.Title,{className:"graphiql-dialog-title",children:"Short Keys"}),jsx(Dialog.Close,{})]}),jsx("div",{className:"graphiql-dialog-section",children:jsx(ot,{keyMap:t.keyMap||"sublime"})})]}),jsxs(Dialog,{open:Q==="settings",onOpenChange:re,children:[jsxs("div",{className:"graphiql-dialog-header",children:[jsx(Dialog.Title,{className:"graphiql-dialog-title",children:"Settings"}),jsx(Dialog.Close,{})]}),t.showPersistHeadersSettings?jsxs("div",{className:"graphiql-dialog-section",children:[jsxs("div",{children:[jsx("div",{className:"graphiql-dialog-section-title",children:"Persist headers"}),jsxs("div",{className:"graphiql-dialog-section-caption",children:["Save headers upon reloading."," ",jsx("span",{className:"graphiql-warning-text",children:"Only enable if you trust this device."})]})]}),jsxs(ButtonGroup,{children:[jsx(Button$1,{type:"button",id:"enable-persist-headers",className:i.shouldPersistHeaders?"active":"","data-value":"true",onClick:H,children:"On"}),jsx(Button$1,{type:"button",id:"disable-persist-headers",className:i.shouldPersistHeaders?"":"active",onClick:H,children:"Off"})]})]}):null,u?jsxs("div",{className:"graphiql-dialog-section",children:[jsxs("div",{children:[jsx("div",{className:"graphiql-dialog-section-title",children:"Clear storage"}),jsx("div",{className:"graphiql-dialog-section-caption",children:"Remove all locally stored data and start fresh."})]}),jsx(Button$1,{type:"button",state:y||void 0,disabled:y==="success",onClick:O,children:{success:"Cleared data",error:"Failed"}[y]||"Clear data"})]}):null]})]})})}var K=isMacOs?"\u2318":"Ctrl",at=Object.entries({"Search in editor":[K,"F"],"Search in documentation":[K,"K"],"Execute query":[K,"Enter"],"Prettify editors":["Ctrl","Shift","P"],"Merge fragments definitions into operation definition":["Ctrl","Shift","M"],"Copy query":["Ctrl","Shift","C"],"Re-fetch schema using introspection":["Ctrl","Shift","R"]});function ot({keyMap:t}){return jsxs("div",{children:[jsxs("table",{className:"graphiql-table",children:[jsx("thead",{children:jsxs("tr",{children:[jsx("th",{children:"Short Key"}),jsx("th",{children:"Function"})]})}),jsx("tbody",{children:at.map(([r,i])=>jsxs("tr",{children:[jsx("td",{children:i.map((s,h,u)=>jsxs(Fragment$1,{children:[jsx("code",{className:"graphiql-key",children:s}),h!==u.length-1&&" + "]},s))}),jsx("td",{children:r})]},r))})]}),jsxs("p",{children:["The editors use"," ",jsx("a",{href:"https://codemirror.net/5/doc/manual.html#keymaps",target:"_blank",rel:"noopener noreferrer",children:"CodeMirror Key Maps"})," ","that add more short keys. This instance of Graph",jsx("em",{children:"i"}),"QL uses ",jsx("code",{children:t}),"."]})]})}function Z(t){return jsx(Fragment,{children:t.children})}Z.displayName="GraphiQLToolbar";function ee(t){return jsx("div",{className:"graphiql-footer",children:t.children})}ee.displayName="GraphiQLFooter";function Y(t,r){return t?.type?.displayName&&t.type.displayName===r.displayName?true:t.type===r}function te(){let{currentProjectId:t}=useConfig(),r=`/api/flexkit/${t}/graphql`,i=useMemo(()=>createGraphiQLFetcher({url:r}),[r]);return jsx(f,{fetcher:i,forcedTheme:"light"})}function Gt(){return {name:"flexkit.explorer",contributes:{apps:[{name:"explorer",icon:jsx(SquarePlay,{strokeWidth:1.5}),title:"Explorer",component:jsx(te,{}),routes:[]}]}}}
2
- export{Gt as Explorer};//# sourceMappingURL=index.js.map
1
+ import'./index.css';import {SquarePlay,ChevronsRight,ChevronsLeft}from'lucide-react';import {useMemo,useState,useRef,useEffect,Children,useCallback,Fragment as Fragment$1}from'react';import {createGraphiQLFetcher}from'@graphiql/toolkit';import {useConfig}from'@flexkit/studio';import {GraphiQLProvider,useEditorContext,useExecutionContext,useSchemaContext,useStorageContext,usePluginContext,useCopyQuery,useMergeQuery,usePrettifyEditors,useTheme,ToolbarButton,PrettifyIcon,MergeIcon,CopyIcon,Tooltip,UnStyledButton,PlusIcon,ReloadIcon,KeyboardShortcutIcon,SettingsIcon,Tabs as Tabs$1,Tab,QueryEditor,ExecuteButton,VariableEditor,Spinner,ResponseEditor,Dialog,ButtonGroup,Button as Button$1,isMacOs}from'@graphiql/react';import {HISTORY_PLUGIN,HistoryContextProvider}from'@graphiql/plugin-history';import {ResizablePanelGroup,ResizablePanel,Tabs,TabsList,TabsTrigger,Tooltip as Tooltip$1,TooltipTrigger,Button,TooltipContent,Separator,TabsContent,ScrollArea,ScrollBar,ResizableHandle}from'@flexkit/studio/ui';import {jsx,Fragment,jsxs}from'react/jsx-runtime';import'@graphiql/react/style.css';import'@graphiql/plugin-history/style.css';function g({dangerouslyAssumeSchemaIsValid:t,confirmCloseTab:i,defaultQuery:l,defaultTabs:n,externalFragments:u,fetcher:r,getDefaultFieldNames:d,headers:E,inputValueDeprecation:k,introspectionQueryName:p,maxHistoryLength:w,onEditOperationName:B,onSchemaChange:O,onTabChange:f,onTogglePluginVisibility:Q,operationName:x,plugins:h,query:y,response:L,schema:I,schemaDescription:A,shouldPersistHeaders:R,storage:G,validationRules:z,variables:V,visiblePlugin:F,defaultHeaders:H,...T}){if(typeof r!="function")throw new TypeError("The `GraphiQL` component requires a `fetcher` function to be passed as prop.");let U=useMemo(()=>{let v=h??[];return v.some(D=>D.title===HISTORY_PLUGIN.title)?v:[HISTORY_PLUGIN,...v]},[h]);return jsx(GraphiQLProvider,{getDefaultFieldNames:d,dangerouslyAssumeSchemaIsValid:t,defaultQuery:l,defaultHeaders:H,defaultTabs:n,externalFragments:u,fetcher:r,headers:E,inputValueDeprecation:k,introspectionQueryName:p,onEditOperationName:B,onSchemaChange:O,onTabChange:f,onTogglePluginVisibility:Q,plugins:U,visiblePlugin:F,operationName:x,query:y,response:L,schema:I,schemaDescription:A,shouldPersistHeaders:R,storage:G,validationRules:z,variables:V,children:jsx(HistoryContextProvider,{maxHistoryLength:w,children:jsx(et,{confirmCloseTab:i,showPersistHeadersSettings:R!==false,disableTabs:T.disableTabs??false,forcedTheme:T.forcedTheme,...T})})})}g.Toolbar=oe;g.Footer=ie;var Ze=["light","dark","system"],M="graphiql-session-tab-";function et(t){let i=useEditorContext({nonNull:true}),l=useExecutionContext({nonNull:true}),n=useSchemaContext({nonNull:true}),u=useStorageContext(),r=usePluginContext(),[d,E]=useState(false),k=useRef(null),p=useMemo(()=>t.forcedTheme&&Ze.includes(t.forcedTheme)?t.forcedTheme:void 0,[t.forcedTheme]),w=useCopyQuery({onCopyQuery:t.onCopyQuery}),B=useMergeQuery(),O=usePrettifyEditors(),{setTheme:f}=useTheme(t.defaultTheme);useEffect(()=>{p==="system"?f(null):(p==="light"||p==="dark")&&f(p);},[p,f]),useEffect(()=>{r?.setVisiblePlugin(r.plugins[0]);},[r]);let[Q,x]=useState(null),[h,y]=useState(null),L=Children.toArray(t.children),I=L.find(a=>te(a,g.Toolbar))??jsxs(Fragment,{children:[jsx(ToolbarButton,{onClick:O,label:"Prettify query (Shift-Ctrl-P)",children:jsx(PrettifyIcon,{className:"ex-w-6 ex-h-6 ex-block","aria-hidden":"true"})}),jsx(ToolbarButton,{onClick:B,label:"Merge fragments into query (Shift-Ctrl-M)",children:jsx(MergeIcon,{className:"ex-w-6 ex-h-6 ex-block","aria-hidden":"true"})}),jsx(ToolbarButton,{onClick:w,label:"Copy query (Shift-Ctrl-C)",children:jsx(CopyIcon,{className:"ex-w-6 ex-h-6 ex-block","aria-hidden":"true"})}),t.toolbar?.additionalContent,t.toolbar?.additionalComponent&&jsx(t.toolbar.additionalComponent,{})]}),A=L.find(a=>te(a,g.Footer)),R=useCallback(()=>{try{u?.clear(),y("success");}catch{y("error");}},[u]),G=useCallback(a=>{i.setShouldPersistHeaders(a.currentTarget.dataset.value==="true");},[i]),z=()=>{i.addTab();},V=()=>{n.introspect();},F=a=>{i.moveTab(a);},H=useCallback(a=>{x(a.currentTarget.dataset.value);},[]),T=useCallback(a=>{let s=r,m=Number(a.currentTarget.dataset.index);if(!s)return;let C=s.plugins.find((dt,ce)=>m===ce)??null;if(C===s.visiblePlugin){s.setVisiblePlugin(null);return}s.setVisiblePlugin(C);},[r]),U=useCallback(a=>{a||x(null);},[]),v=useCallback(a=>{a||(x(null),y(null));},[]),D=jsx(Tooltip,{label:"Add tab",children:jsx(UnStyledButton,{type:"button",className:"graphiql-tab-add",onClick:z,"aria-label":"Add tab",children:jsx(PlusIcon,{"aria-hidden":"true"})})}),re=t.className?` ${t.className}`:"",$=t.confirmCloseTab,se=useCallback(async a=>{let s=a.currentTarget.previousSibling,m=Number(s.id.replace(M,""));(!$||await $(m))&&(i.activeTabIndex===m&&l.stop(),i.closeTab(m));},[$,i,l]),de=useCallback(a=>{let s=Number(a.currentTarget.id.replace(M,""));l.stop(),i.changeTab(s);},[i,l]);return jsx(Tooltip.Provider,{children:jsxs("div",{className:`graphiql-container${re}`,children:[jsxs(ResizablePanelGroup,{autoSaveId:"explorer",direction:"horizontal",className:"ex-h-full ex-max-h-full",children:[jsxs(ResizablePanel,{collapsible:true,collapsedSize:3,minSize:10,onCollapse:()=>{E(true);},onExpand:()=>{E(false);},ref:k,children:[jsx("div",{className:"ex-flex ex-w-full ex-h-full ex-pb-6",children:jsxs(Tabs,{className:"ex-w-full",defaultValue:r?.plugins[0].title,children:[jsxs("div",{className:`ex-flex ex-items-center ex-py-1 ${d?"":"ex-px-3"}`,children:[jsx(TabsList,{className:d?"ex-hidden":"",children:r?.plugins.map((a,s)=>{let C=`${a===r.visiblePlugin?"Hide":"Show"} ${a.title}`;return jsx(TabsTrigger,{"aria-label":C,className:"ex-text-muted-foreground","data-index":s,onClick:T,value:a.title,children:jsx(a.icon,{"aria-hidden":"true"})},a.title)})}),jsxs(Tooltip$1,{children:[jsx(TooltipTrigger,{asChild:true,children:jsx(Button,{className:d?"ex-ml-1.5":"ex-ml-auto",onClick:()=>{let a=k.current;d?a?.expand():a?.collapse();},size:"icon",variant:"ghost",children:d?jsxs(Fragment,{children:[jsx(ChevronsRight,{className:"ex-w-4 ex-h-4"}),jsx("span",{className:"ex-sr-only",children:"Expand"})]}):jsxs(Fragment,{children:[jsx(ChevronsLeft,{className:"ex-w-4 ex-h-4"}),jsx("span",{className:"ex-sr-only",children:"Collapse"})]})})}),jsx(TooltipContent,{children:d?"Expand":"Collapse"})]})]}),d?null:jsx(Separator,{}),r?.plugins.map(a=>jsx(TabsContent,{className:`ex-flex ex-w-full ex-max-h-full ex-mt-0 ${d?"ex-hidden":""}`,value:a.title,children:jsxs(ScrollArea,{className:"ex-flex ex-w-full ex-max-h-full ex-overflow-auto ex-px-6 ex-pt-3 ex-pb-6 ex-mb-3 [&>div>div]:!ex-block",children:[jsx(a.content,{}),jsx(ScrollBar,{orientation:"horizontal"})]})},a.title))]})}),jsx(Tooltip,{label:"Re-fetch GraphQL schema",children:jsx(UnStyledButton,{type:"button",disabled:n.isFetching,onClick:V,"aria-label":"Re-fetch GraphQL schema",children:jsx(ReloadIcon,{className:n.isFetching?"graphiql-spin":"","aria-hidden":"true"})})}),jsx(Tooltip,{label:"Open short keys dialog",children:jsx(UnStyledButton,{type:"button","data-value":"short-keys",onClick:H,"aria-label":"Open short keys dialog",children:jsx(KeyboardShortcutIcon,{"aria-hidden":"true"})})}),jsx(Tooltip,{label:"Open settings dialog",children:jsx(UnStyledButton,{type:"button","data-value":"settings",onClick:H,"aria-label":"Open settings dialog",children:jsx(SettingsIcon,{"aria-hidden":"true"})})})]}),jsx(ResizableHandle,{className:"hover:ex-bg-blue-500 ex-transition-colors",withHandle:true}),jsx(ResizablePanel,{className:"ex-bg-muted",defaultSize:48,children:jsxs("div",{className:"ex-flex ex-flex-col ex-h-full",children:[jsxs("div",{className:"ex-flex ex-items-center ex-py-1 ex-px-4 ex-gap-6 ex-bg-muted",children:[!t.disableTabs&&jsx(Tabs$1,{"aria-label":"Select active operation",className:"!ex-p-1 ex-bg-muted ex-rounded-md",onReorder:F,values:i.tabs,children:i.tabs.length>0&&jsx(Fragment,{children:i.tabs.map((a,s)=>jsxs(Tab,{isActive:s===i.activeTabIndex,value:a,children:[jsx(Tab.Button,{"aria-controls":"graphiql-session",id:`${M}${s.toString()}`,onClick:de,children:a.title}),jsx(Tab.Close,{onClick:se})]},a.id))})}),D]}),jsx("div",{role:"tabpanel",id:"graphiql-session",className:"graphiql-session","aria-labelledby":`${M}${i.activeTabIndex}`,children:jsx("div",{className:`graphiql-editors${i.tabs.length===1?" full-height":""}`,children:jsxs(ResizablePanelGroup,{direction:"vertical",children:[jsxs(ResizablePanel,{className:"ex-flex ex-w-full ex-gap-x-4 ex-px-4 ex-py-2",defaultSize:80,children:[jsx(QueryEditor,{editorTheme:t.editorTheme,keyMap:t.keyMap,onCopyQuery:t.onCopyQuery,onEdit:t.onEditQuery,readOnly:t.readOnly}),jsxs("div",{className:"graphiql-toolbar",role:"toolbar","aria-label":"Editor Commands",children:[jsx(ExecuteButton,{}),I]})]}),jsx(ResizableHandle,{className:"hover:ex-bg-blue-500 ex-transition-colors",withHandle:true}),jsxs(ResizablePanel,{className:"ex-bg-muted ex-px-4 ex-pt-2",defaultSize:20,children:[jsx("div",{className:"ex-text-sm ex-font-medium ex-text-muted-foreground",children:"Variables"}),jsx(VariableEditor,{editorTheme:t.editorTheme,isHidden:false,keyMap:t.keyMap,onEdit:t.onEditVariables,readOnly:t.readOnly})]})]})})})]})}),jsx(ResizableHandle,{className:"hover:ex-bg-blue-500 ex-transition-colors",withHandle:true}),jsx(ResizablePanel,{className:"ex-px-5 ex-pt-10 ex-relative",defaultSize:30,children:jsxs("div",{className:"graphiql-response ex-h-full",children:[l.isFetching?jsx(Spinner,{}):null,jsx(ResponseEditor,{editorTheme:t.editorTheme,responseTooltip:t.responseTooltip,keyMap:t.keyMap}),A]})})]}),jsxs(Dialog,{open:Q==="short-keys",onOpenChange:U,children:[jsxs("div",{className:"graphiql-dialog-header",children:[jsx(Dialog.Title,{className:"graphiql-dialog-title",children:"Short Keys"}),jsx(Dialog.Close,{})]}),jsx("div",{className:"graphiql-dialog-section",children:jsx(at,{keyMap:t.keyMap||"sublime"})})]}),jsxs(Dialog,{open:Q==="settings",onOpenChange:v,children:[jsxs("div",{className:"graphiql-dialog-header",children:[jsx(Dialog.Title,{className:"graphiql-dialog-title",children:"Settings"}),jsx(Dialog.Close,{})]}),t.showPersistHeadersSettings?jsxs("div",{className:"graphiql-dialog-section",children:[jsxs("div",{children:[jsx("div",{className:"graphiql-dialog-section-title",children:"Persist headers"}),jsxs("div",{className:"graphiql-dialog-section-caption",children:["Save headers upon reloading."," ",jsx("span",{className:"graphiql-warning-text",children:"Only enable if you trust this device."})]})]}),jsxs(ButtonGroup,{children:[jsx(Button$1,{type:"button",id:"enable-persist-headers",className:i.shouldPersistHeaders?"active":"","data-value":"true",onClick:G,children:"On"}),jsx(Button$1,{type:"button",id:"disable-persist-headers",className:i.shouldPersistHeaders?"":"active",onClick:G,children:"Off"})]})]}):null,u?jsxs("div",{className:"graphiql-dialog-section",children:[jsxs("div",{children:[jsx("div",{className:"graphiql-dialog-section-title",children:"Clear storage"}),jsx("div",{className:"graphiql-dialog-section-caption",children:"Remove all locally stored data and start fresh."})]}),jsx(Button$1,{type:"button",state:h||void 0,disabled:h==="success",onClick:R,children:{success:"Cleared data",error:"Failed"}[h]||"Clear data"})]}):null]})]})})}var J=isMacOs?"\u2318":"Ctrl",tt=Object.entries({"Search in editor":[J,"F"],"Search in documentation":[J,"K"],"Execute query":[J,"Enter"],"Prettify editors":["Ctrl","Shift","P"],"Merge fragments definitions into operation definition":["Ctrl","Shift","M"],"Copy query":["Ctrl","Shift","C"],"Re-fetch schema using introspection":["Ctrl","Shift","R"]});function at({keyMap:t}){return jsxs("div",{children:[jsxs("table",{className:"graphiql-table",children:[jsx("thead",{children:jsxs("tr",{children:[jsx("th",{children:"Short Key"}),jsx("th",{children:"Function"})]})}),jsx("tbody",{children:tt.map(([i,l])=>jsxs("tr",{children:[jsx("td",{children:l.map((n,u,r)=>jsxs(Fragment$1,{children:[jsx("code",{className:"graphiql-key",children:n}),u!==r.length-1&&" + "]},n))}),jsx("td",{children:i})]},i))})]}),jsxs("p",{children:["The editors use"," ",jsx("a",{href:"https://codemirror.net/5/doc/manual.html#keymaps",target:"_blank",rel:"noopener noreferrer",children:"CodeMirror Key Maps"})," ","that add more short keys. This instance of Graph",jsx("em",{children:"i"}),"QL uses ",jsx("code",{children:t}),"."]})]})}function oe(t){return jsx(Fragment,{children:t.children})}oe.displayName="GraphiQLToolbar";function ie(t){return jsx("div",{className:"graphiql-footer",children:t.children})}ie.displayName="GraphiQLFooter";function te(t,i){let l=typeof t=="object"&&t!==null?t:null;if(!l)return false;let n=l.type;return typeof n=="object"&&n!==null&&"displayName"in n&&typeof n.displayName=="string"&&n.displayName===i.displayName?true:l.type===i}function le(){let{currentProjectId:t}=useConfig(),i=`/api/flexkit/${t}/graphql`,l=useMemo(()=>createGraphiQLFetcher({url:i}),[i]);return jsx(g,{fetcher:l,forcedTheme:"light"})}function kt(){return {name:"flexkit.explorer",contributes:{apps:[{name:"explorer",icon:jsx(SquarePlay,{strokeWidth:1.5}),title:"Explorer",component:jsx(le,{}),routes:[]}]}}}
2
+ export{kt as Explorer};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/graphiql.tsx","../src/root.tsx","../src/index.tsx"],"names":["GraphiQL","dangerouslyAssumeSchemaIsValid","confirmCloseTab","defaultQuery","defaultTabs","externalFragments","fetcher","getDefaultFieldNames","headers","inputValueDeprecation","introspectionQueryName","maxHistoryLength","onEditOperationName","onSchemaChange","onTabChange","onTogglePluginVisibility","operationName","plugins","query","response","schema","schemaDescription","shouldPersistHeaders","storage","validationRules","variables","visiblePlugin","defaultHeaders","props","jsx","GraphiQLProvider","GraphiQLInterface","GraphiQLToolbar","GraphiQLFooter","THEMES","TAB_CLASS_PREFIX","editorContext","useEditorContext","executionContext","useExecutionContext","schemaContext","useSchemaContext","storageContext","useStorageContext","pluginContext","usePluginContext","isSidebarCollapsed","setIsSidebarCollapsed","useState","sidebarPanel","useRef","forcedTheme","useMemo","copy","useCopyQuery","merge","useMergeQuery","prettify","usePrettifyEditors","theme","setTheme","useTheme","useEffect","showDialog","setShowDialog","clearStorageStatus","setClearStorageStatus","children","Children","toolbar","child","isChildComponentType","jsxs","Fragment","ToolbarButton","PrettifyIcon","MergeIcon","CopyIcon","footer","handleClearData","useCallback","handlePersistHeaders","event","selectedTheme","handleAddTab","handleRefetchSchema","handleReorder","newOrder","handleShowDialog","handlePluginClick","context","pluginIndex","plugin","_","index","handleOpenShortKeysDialog","isOpen","handleOpenSettingsDialog","addTab","GraphiQLTooltip","UnStyledButton","PlusIcon","className","confirmClose","handleTabClose","tabButton","handleTabClick","ResizablePanelGroup","ResizablePanel","Tabs","TabsList","label","TabsTrigger","Tooltip","TooltipTrigger","Button","panel","ChevronsRight","ChevronsLeft","TooltipContent","Separator","TabsContent","ScrollArea","ScrollBar","ReloadIcon","KeyboardShortcutIcon","SettingsIcon","ResizableHandle","GraphiQlTabs","tab","GraphiQlTab","QueryEditor","ExecuteButton","VariableEditor","Spinner","ResponseEditor","Dialog","ShortKeys","ButtonGroup","GraphiQLButton","modifier","isMacOs","SHORT_KEYS","keyMap","title","keys","key","array","component","Root","currentProjectId","useConfig","url","createGraphiQLFetcher","Explorer","SquarePlayIcon"],"mappings":"w+BA+FO,SAASA,CAAAA,CAAS,CACvB,8BAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,YAAAC,CAAAA,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A,CACP,SAAA,CAAW9H,GAAAA,CAACwH,EAAAA,CAAA,EAAK,CAAA,CACjB,MAAA,CAAQ,EACV,CACF,CACF,CACF,CACF","file":"index.js","sourcesContent":["import { Children, Fragment, useCallback, useState, useEffect, useMemo, useRef } from 'react';\nimport type { ComponentType, MouseEventHandler, PropsWithChildren, ReactNode, ReactElement } from 'react';\nimport {\n Button as GraphiQLButton,\n ButtonGroup,\n ChevronDownIcon,\n ChevronUpIcon,\n CopyIcon,\n Dialog,\n ExecuteButton,\n GraphiQLProvider,\n HeaderEditor,\n KeyboardShortcutIcon,\n MergeIcon,\n PlusIcon,\n PrettifyIcon,\n QueryEditor,\n ReloadIcon,\n ResponseEditor,\n SettingsIcon,\n Spinner,\n Tabs as GraphiQlTabs,\n Tab as GraphiQlTab,\n ToolbarButton,\n Tooltip as GraphiQLTooltip,\n UnStyledButton,\n useCopyQuery,\n useDragResize,\n useEditorContext,\n useExecutionContext,\n useMergeQuery,\n usePluginContext,\n usePrettifyEditors,\n useSchemaContext,\n useStorageContext,\n useTheme,\n VariableEditor,\n isMacOs,\n} from '@graphiql/react';\nimport type {\n GraphiQLProviderProps,\n Theme,\n UseHeaderEditorArgs,\n UseQueryEditorArgs,\n UseResponseEditorArgs,\n UseVariableEditorArgs,\n WriteableEditorProps,\n} from '@graphiql/react';\nimport { ChevronsLeft, ChevronsRight } from 'lucide-react';\nimport {\n Button,\n ResizableHandle,\n ResizablePanel,\n ResizablePanelGroup,\n ScrollArea,\n ScrollBar,\n Separator,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@flexkit/studio/ui';\nimport type { ImperativePanelHandle } from '@flexkit/studio/ui';\nimport type { TabState } from './types';\n\nexport type GraphiQLToolbarConfig = {\n /**\n * This content will be rendered after the built-in buttons of the toolbar.\n * Note that this will not apply if you provide a completely custom toolbar\n * (by passing `GraphiQL.Toolbar` as child to the `GraphiQL` component).\n */\n additionalContent?: React.ReactNode;\n\n /**\n * same as above, except a component with access to context\n */\n additionalComponent?: React.JSXElementConstructor<unknown>;\n};\n\n/**\n * API docs for this live here:\n *\n * https://graphiql-test.netlify.app/typedoc/modules/graphiql.html#graphiqlprops\n */\nexport type GraphiQLProps = Omit<GraphiQLProviderProps, 'children'> & GraphiQLInterfaceProps;\n\n/**\n * The top-level React component for GraphiQL, intended to encompass the entire\n * browser viewport.\n *\n * @see https://github.com/graphql/graphiql#usage\n */\nexport function GraphiQL({\n dangerouslyAssumeSchemaIsValid,\n confirmCloseTab,\n defaultQuery,\n defaultTabs,\n externalFragments,\n fetcher,\n getDefaultFieldNames,\n headers,\n inputValueDeprecation,\n introspectionQueryName,\n maxHistoryLength,\n onEditOperationName,\n onSchemaChange,\n onTabChange,\n onTogglePluginVisibility,\n operationName,\n plugins,\n query,\n response,\n schema,\n schemaDescription,\n shouldPersistHeaders,\n storage,\n validationRules,\n variables,\n visiblePlugin,\n defaultHeaders,\n ...props\n}: GraphiQLProps): ReactElement {\n // Ensure props are correct\n if (typeof fetcher !== 'function') {\n throw new TypeError('The `GraphiQL` component requires a `fetcher` function to be passed as prop.');\n }\n\n return (\n <GraphiQLProvider\n getDefaultFieldNames={getDefaultFieldNames}\n dangerouslyAssumeSchemaIsValid={dangerouslyAssumeSchemaIsValid}\n defaultQuery={defaultQuery}\n defaultHeaders={defaultHeaders}\n defaultTabs={defaultTabs}\n externalFragments={externalFragments}\n fetcher={fetcher}\n headers={headers}\n inputValueDeprecation={inputValueDeprecation}\n introspectionQueryName={introspectionQueryName}\n maxHistoryLength={maxHistoryLength}\n onEditOperationName={onEditOperationName}\n onSchemaChange={onSchemaChange}\n onTabChange={onTabChange}\n onTogglePluginVisibility={onTogglePluginVisibility}\n plugins={plugins}\n visiblePlugin={visiblePlugin}\n operationName={operationName}\n query={query}\n response={response}\n schema={schema}\n schemaDescription={schemaDescription}\n shouldPersistHeaders={shouldPersistHeaders}\n storage={storage}\n validationRules={validationRules}\n variables={variables}\n >\n <GraphiQLInterface\n confirmCloseTab={confirmCloseTab}\n showPersistHeadersSettings={shouldPersistHeaders !== false}\n disableTabs={props.disableTabs ?? false}\n forcedTheme={props.forcedTheme}\n {...props}\n />\n </GraphiQLProvider>\n );\n}\n\n// Export main windows/panes to be used separately if desired.\nGraphiQL.Toolbar = GraphiQLToolbar;\nGraphiQL.Footer = GraphiQLFooter;\n\ntype AddSuffix<Obj extends { [key: string]: unknown }, Suffix extends string> = {\n [Key in keyof Obj as `${string & Key}${Suffix}`]: Obj[Key];\n};\n\nexport type GraphiQLInterfaceProps = WriteableEditorProps &\n AddSuffix<Pick<UseQueryEditorArgs, 'onEdit'>, 'Query'> &\n Pick<UseQueryEditorArgs, 'onCopyQuery'> &\n AddSuffix<Pick<UseVariableEditorArgs, 'onEdit'>, 'Variables'> &\n AddSuffix<Pick<UseHeaderEditorArgs, 'onEdit'>, 'Headers'> &\n Pick<UseResponseEditorArgs, 'responseTooltip'> & {\n children?: ReactNode;\n /**\n * Set the default state for the editor tools.\n * - `false` hides the editor tools\n * - `true` shows the editor tools\n * - `'variables'` specifically shows the variables editor\n * - `'headers'` specifically shows the headers editor\n * By default the editor tools are initially shown when at least one of the\n * editors has contents.\n */\n defaultEditorToolsVisibility?: boolean | 'variables' | 'headers';\n /**\n * Toggle if the headers editor should be shown inside the editor tools.\n */\n isHeadersEditorEnabled?: boolean;\n /**\n * An object that allows configuration of the toolbar next to the query\n * editor.\n */\n toolbar?: GraphiQLToolbarConfig;\n /**\n * Indicates if settings for persisting headers should appear in the\n * settings modal.\n */\n showPersistHeadersSettings?: boolean;\n defaultTheme?: Theme;\n disableTabs?: boolean;\n /**\n * `forcedTheme` allows enforcement of a specific theme for GraphiQL.\n * This is useful when you want to make sure that GraphiQL is always\n * rendered with a specific theme.\n */\n forcedTheme?: (typeof THEMES)[number];\n /**\n * Additional class names which will be appended to the container element.\n */\n className?: string;\n /**\n * When the user clicks a close tab button, this function is invoked with\n * the index of the tab that is about to be closed. It can return a promise\n * that should resolve to `true` (meaning the tab may be closed) or `false`\n * (meaning the tab may not be closed).\n */\n confirmCloseTab?: (index: number) => Promise<boolean> | boolean;\n };\n\nconst THEMES = ['light', 'dark', 'system'] as const;\n\nconst TAB_CLASS_PREFIX = 'graphiql-session-tab-';\n\nexport function GraphiQLInterface(props: GraphiQLInterfaceProps): ReactElement {\n const isHeadersEditorEnabled = props.isHeadersEditorEnabled ?? true;\n const editorContext = useEditorContext({ nonNull: true });\n const executionContext = useExecutionContext({ nonNull: true });\n const schemaContext = useSchemaContext({ nonNull: true });\n const storageContext = useStorageContext();\n const pluginContext = usePluginContext();\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(false);\n const sidebarPanel = useRef<ImperativePanelHandle>(null);\n const forcedTheme = useMemo(\n () => (props.forcedTheme && THEMES.includes(props.forcedTheme) ? props.forcedTheme : undefined),\n [props.forcedTheme]\n );\n\n const copy = useCopyQuery({ onCopyQuery: props.onCopyQuery });\n const merge = useMergeQuery();\n const prettify = usePrettifyEditors();\n\n const { theme, setTheme } = useTheme(props.defaultTheme);\n\n useEffect(() => {\n if (forcedTheme === 'system') {\n setTheme(null);\n } else if (forcedTheme === 'light' || forcedTheme === 'dark') {\n setTheme(forcedTheme);\n }\n }, [forcedTheme, setTheme]);\n\n useEffect(() => {\n pluginContext?.setVisiblePlugin(pluginContext.plugins[0]);\n }, [pluginContext]);\n\n const [showDialog, setShowDialog] = useState<'settings' | 'short-keys' | null>(null);\n const [clearStorageStatus, setClearStorageStatus] = useState<'success' | 'error' | null>(null);\n\n const children = Children.toArray(props.children);\n\n const toolbar = children.find((child) => isChildComponentType(child, GraphiQL.Toolbar)) ?? (\n <>\n <ToolbarButton onClick={prettify} label=\"Prettify query (Shift-Ctrl-P)\">\n <PrettifyIcon className=\"ex-w-6 ex-h-6 ex-block\" aria-hidden=\"true\" />\n </ToolbarButton>\n <ToolbarButton onClick={merge} label=\"Merge fragments into query (Shift-Ctrl-M)\">\n <MergeIcon className=\"ex-w-6 ex-h-6 ex-block\" aria-hidden=\"true\" />\n </ToolbarButton>\n <ToolbarButton onClick={copy} label=\"Copy query (Shift-Ctrl-C)\">\n <CopyIcon className=\"ex-w-6 ex-h-6 ex-block\" aria-hidden=\"true\" />\n </ToolbarButton>\n {props.toolbar?.additionalContent}\n {props.toolbar?.additionalComponent && <props.toolbar.additionalComponent />}\n </>\n );\n\n const footer = children.find((child) => isChildComponentType(child, GraphiQL.Footer));\n\n const handleClearData = useCallback(() => {\n try {\n storageContext?.clear();\n setClearStorageStatus('success');\n } catch {\n setClearStorageStatus('error');\n }\n }, [storageContext]);\n\n const handlePersistHeaders: MouseEventHandler<HTMLButtonElement> = useCallback(\n (event) => {\n editorContext.setShouldPersistHeaders(event.currentTarget.dataset.value === 'true');\n },\n [editorContext]\n );\n\n const handleChangeTheme: MouseEventHandler<HTMLButtonElement> = useCallback(\n (event) => {\n const selectedTheme = event.currentTarget.dataset.theme as 'light' | 'dark' | undefined;\n setTheme(selectedTheme || null);\n },\n [setTheme]\n );\n\n const handleAddTab = (): void => {\n editorContext.addTab();\n };\n const handleRefetchSchema = (): void => {\n schemaContext.introspect();\n };\n const handleReorder = (newOrder: TabState[]): void => {\n editorContext.moveTab(newOrder);\n };\n\n const handleShowDialog: MouseEventHandler<HTMLButtonElement> = useCallback((event) => {\n setShowDialog(event.currentTarget.dataset.value as 'short-keys' | 'settings');\n }, []);\n\n const handlePluginClick: MouseEventHandler<HTMLButtonElement> = useCallback(\n (event) => {\n const context = pluginContext;\n const pluginIndex = Number(event.currentTarget.dataset.index);\n\n if (!context) return;\n\n const plugin = context.plugins.find((_, index) => pluginIndex === index) ?? null;\n const isVisible = plugin === context.visiblePlugin;\n\n if (isVisible) {\n context.setVisiblePlugin(null);\n\n return;\n }\n\n context.setVisiblePlugin(plugin);\n },\n [pluginContext]\n );\n\n const handleOpenShortKeysDialog = useCallback((isOpen: boolean) => {\n if (!isOpen) {\n setShowDialog(null);\n }\n }, []);\n\n const handleOpenSettingsDialog = useCallback((isOpen: boolean) => {\n if (!isOpen) {\n setShowDialog(null);\n setClearStorageStatus(null);\n }\n }, []);\n\n const addTab = (\n <GraphiQLTooltip label=\"Add tab\">\n <UnStyledButton type=\"button\" className=\"graphiql-tab-add\" onClick={handleAddTab} aria-label=\"Add tab\">\n <PlusIcon aria-hidden=\"true\" />\n </UnStyledButton>\n </GraphiQLTooltip>\n );\n\n const className = props.className ? ` ${props.className}` : '';\n const confirmClose = props.confirmCloseTab;\n\n const handleTabClose: MouseEventHandler<HTMLButtonElement> = useCallback(\n async (event) => {\n const tabButton = event.currentTarget.previousSibling as HTMLButtonElement;\n const index = Number(tabButton.id.replace(TAB_CLASS_PREFIX, ''));\n\n /** TODO:\n * Move everything after into `editorContext.closeTab` once zustand will be used instead of\n * React context, since now we can't use execution context inside editor context, since editor\n * context is used in execution context.\n */\n const shouldCloseTab = confirmClose ? await confirmClose(index) : true;\n\n if (!shouldCloseTab) {\n return;\n }\n\n if (editorContext.activeTabIndex === index) {\n executionContext.stop();\n }\n editorContext.closeTab(index);\n },\n [confirmClose, editorContext, executionContext]\n );\n\n const handleTabClick: MouseEventHandler<HTMLButtonElement> = useCallback(\n (event) => {\n const index = Number(event.currentTarget.id.replace(TAB_CLASS_PREFIX, ''));\n /** TODO:\n * Move everything after into `editorContext.changeTab` once zustand will be used instead of\n * React context, since now we can't use execution context inside editor context, since editor\n * context is used in execution context.\n */\n executionContext.stop();\n editorContext.changeTab(index);\n },\n [editorContext, executionContext]\n );\n\n return (\n <GraphiQLTooltip.Provider>\n <div className={`graphiql-container${className}`}>\n <ResizablePanelGroup autoSaveId=\"explorer\" direction=\"horizontal\" className=\"ex-h-full ex-max-h-full\">\n <ResizablePanel\n collapsible\n collapsedSize={3}\n minSize={10}\n onCollapse={() => {\n setIsSidebarCollapsed(true);\n }}\n onExpand={() => {\n setIsSidebarCollapsed(false);\n }}\n ref={sidebarPanel}\n >\n <div className=\"ex-flex ex-w-full ex-h-full ex-pb-6\">\n <Tabs className=\"ex-w-full\" defaultValue={pluginContext?.plugins[0].title}>\n <div className={`ex-flex ex-items-center ex-py-1 ${isSidebarCollapsed ? '' : 'ex-px-3'}`}>\n <TabsList className={isSidebarCollapsed ? 'ex-hidden' : ''}>\n {pluginContext?.plugins.map((plugin, index) => {\n const isVisible = plugin === pluginContext.visiblePlugin;\n const label = `${isVisible ? 'Hide' : 'Show'} ${plugin.title}`;\n return (\n <TabsTrigger\n aria-label={label}\n className=\"ex-text-muted-foreground\"\n data-index={index}\n key={plugin.title}\n onClick={handlePluginClick}\n value={plugin.title}\n >\n <plugin.icon aria-hidden=\"true\" />\n </TabsTrigger>\n );\n })}\n </TabsList>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n className={isSidebarCollapsed ? 'ex-ml-1.5' : 'ex-ml-auto'}\n onClick={() => {\n const panel = sidebarPanel.current;\n\n isSidebarCollapsed ? panel?.expand() : panel?.collapse();\n }}\n size=\"icon\"\n variant=\"ghost\"\n >\n {isSidebarCollapsed ? (\n <>\n <ChevronsRight className=\"ex-w-4 ex-h-4\" />\n <span className=\"ex-sr-only\">Expand</span>\n </>\n ) : (\n <>\n <ChevronsLeft className=\"ex-w-4 ex-h-4\" />\n <span className=\"ex-sr-only\">Collapse</span>\n </>\n )}\n </Button>\n </TooltipTrigger>\n <TooltipContent>{isSidebarCollapsed ? 'Expand' : 'Collapse'}</TooltipContent>\n </Tooltip>\n </div>\n {isSidebarCollapsed ? null : <Separator />}\n {pluginContext?.plugins.map((plugin) => (\n <TabsContent\n className={`ex-flex ex-w-full ex-max-h-full ex-mt-0 ${isSidebarCollapsed ? 'ex-hidden' : ''}`}\n key={plugin.title}\n value={plugin.title}\n >\n <ScrollArea className=\"ex-flex ex-w-full ex-max-h-full ex-overflow-auto ex-px-6 ex-pt-3 ex-pb-6 ex-mb-3 [&>div>div]:!ex-block\">\n <plugin.content />\n <ScrollBar orientation=\"horizontal\" />\n </ScrollArea>\n </TabsContent>\n ))}\n </Tabs>\n </div>\n <GraphiQLTooltip label=\"Re-fetch GraphQL schema\">\n <UnStyledButton\n type=\"button\"\n disabled={schemaContext.isFetching}\n onClick={handleRefetchSchema}\n aria-label=\"Re-fetch GraphQL schema\"\n >\n <ReloadIcon className={schemaContext.isFetching ? 'graphiql-spin' : ''} aria-hidden=\"true\" />\n </UnStyledButton>\n </GraphiQLTooltip>\n <GraphiQLTooltip label=\"Open short keys dialog\">\n <UnStyledButton\n type=\"button\"\n data-value=\"short-keys\"\n onClick={handleShowDialog}\n aria-label=\"Open short keys dialog\"\n >\n <KeyboardShortcutIcon aria-hidden=\"true\" />\n </UnStyledButton>\n </GraphiQLTooltip>\n <GraphiQLTooltip label=\"Open settings dialog\">\n <UnStyledButton\n type=\"button\"\n data-value=\"settings\"\n onClick={handleShowDialog}\n aria-label=\"Open settings dialog\"\n >\n <SettingsIcon aria-hidden=\"true\" />\n </UnStyledButton>\n </GraphiQLTooltip>\n </ResizablePanel>\n\n <ResizableHandle className=\"hover:ex-bg-blue-500 ex-transition-colors\" withHandle />\n {/* Center column */}\n <ResizablePanel className=\"ex-bg-muted\" defaultSize={48}>\n <div className=\"ex-flex ex-flex-col ex-h-full\">\n <div className=\"ex-flex ex-items-center ex-py-1 ex-px-4 ex-gap-6 ex-bg-muted\">\n {!props.disableTabs && (\n <GraphiQlTabs\n aria-label=\"Select active operation\"\n className=\"!ex-p-1 ex-bg-muted ex-rounded-md\"\n onReorder={handleReorder}\n values={editorContext.tabs}\n >\n {editorContext.tabs.length > 0 && (\n <>\n {editorContext.tabs.map((tab, index) => (\n <GraphiQlTab isActive={index === editorContext.activeTabIndex} key={tab.id} value={tab}>\n <GraphiQlTab.Button\n aria-controls=\"graphiql-session\"\n id={`${TAB_CLASS_PREFIX}${index.toString()}`}\n onClick={handleTabClick}\n >\n {tab.title}\n </GraphiQlTab.Button>\n <GraphiQlTab.Close onClick={handleTabClose} />\n </GraphiQlTab>\n ))}\n </>\n )}\n </GraphiQlTabs>\n )}\n {addTab}\n </div>\n\n {/* Query editor */}\n <div\n role=\"tabpanel\"\n id=\"graphiql-session\" // used by aria-controls=\"graphiql-session\"\n className=\"graphiql-session\"\n aria-labelledby={`${TAB_CLASS_PREFIX}${editorContext.activeTabIndex}`}\n >\n <div className={`graphiql-editors${editorContext.tabs.length === 1 ? ' full-height' : ''}`}>\n <ResizablePanelGroup direction=\"vertical\">\n <ResizablePanel className=\"ex-flex ex-w-full ex-gap-x-4 ex-px-4 ex-py-2\" defaultSize={80}>\n <QueryEditor\n editorTheme={props.editorTheme}\n keyMap={props.keyMap}\n onCopyQuery={props.onCopyQuery}\n onEdit={props.onEditQuery}\n readOnly={props.readOnly}\n />\n <div className=\"graphiql-toolbar\" role=\"toolbar\" aria-label=\"Editor Commands\">\n <ExecuteButton />\n {toolbar}\n </div>\n </ResizablePanel>\n <ResizableHandle className=\"hover:ex-bg-blue-500 ex-transition-colors\" withHandle />\n <ResizablePanel className=\"ex-bg-muted ex-px-4 ex-pt-2\" defaultSize={20}>\n <div className=\"ex-text-sm ex-font-medium ex-text-muted-foreground\">Variables</div>\n <VariableEditor\n editorTheme={props.editorTheme}\n isHidden={false}\n keyMap={props.keyMap}\n onEdit={props.onEditVariables}\n readOnly={props.readOnly}\n />\n </ResizablePanel>\n </ResizablePanelGroup>\n </div>\n </div>\n </div>\n </ResizablePanel>\n <ResizableHandle className=\"hover:ex-bg-blue-500 ex-transition-colors\" withHandle />\n <ResizablePanel className=\"ex-px-5 ex-pt-10 ex-relative\" defaultSize={30}>\n <div className=\"graphiql-response ex-h-full\">\n {executionContext.isFetching ? <Spinner /> : null}\n <ResponseEditor\n editorTheme={props.editorTheme}\n responseTooltip={props.responseTooltip}\n keyMap={props.keyMap}\n />\n {footer}\n </div>\n </ResizablePanel>\n </ResizablePanelGroup>\n <Dialog open={showDialog === 'short-keys'} onOpenChange={handleOpenShortKeysDialog}>\n <div className=\"graphiql-dialog-header\">\n <Dialog.Title className=\"graphiql-dialog-title\">Short Keys</Dialog.Title>\n <Dialog.Close />\n </div>\n <div className=\"graphiql-dialog-section\">\n <ShortKeys keyMap={props.keyMap || 'sublime'} />\n </div>\n </Dialog>\n <Dialog open={showDialog === 'settings'} onOpenChange={handleOpenSettingsDialog}>\n <div className=\"graphiql-dialog-header\">\n <Dialog.Title className=\"graphiql-dialog-title\">Settings</Dialog.Title>\n <Dialog.Close />\n </div>\n {props.showPersistHeadersSettings ? (\n <div className=\"graphiql-dialog-section\">\n <div>\n <div className=\"graphiql-dialog-section-title\">Persist headers</div>\n <div className=\"graphiql-dialog-section-caption\">\n Save headers upon reloading.{' '}\n <span className=\"graphiql-warning-text\">Only enable if you trust this device.</span>\n </div>\n </div>\n <ButtonGroup>\n <GraphiQLButton\n type=\"button\"\n id=\"enable-persist-headers\"\n className={editorContext.shouldPersistHeaders ? 'active' : ''}\n data-value=\"true\"\n onClick={handlePersistHeaders}\n >\n On\n </GraphiQLButton>\n <GraphiQLButton\n type=\"button\"\n id=\"disable-persist-headers\"\n className={editorContext.shouldPersistHeaders ? '' : 'active'}\n onClick={handlePersistHeaders}\n >\n Off\n </GraphiQLButton>\n </ButtonGroup>\n </div>\n ) : null}\n\n {storageContext ? (\n <div className=\"graphiql-dialog-section\">\n <div>\n <div className=\"graphiql-dialog-section-title\">Clear storage</div>\n <div className=\"graphiql-dialog-section-caption\">Remove all locally stored data and start fresh.</div>\n </div>\n <GraphiQLButton\n type=\"button\"\n state={clearStorageStatus || undefined}\n disabled={clearStorageStatus === 'success'}\n onClick={handleClearData}\n >\n {{\n success: 'Cleared data',\n error: 'Failed',\n }[clearStorageStatus!] || 'Clear data'}\n </GraphiQLButton>\n </div>\n ) : null}\n </Dialog>\n </div>\n </GraphiQLTooltip.Provider>\n );\n}\n\nconst modifier = isMacOs ? '⌘' : 'Ctrl';\n\nconst SHORT_KEYS = Object.entries({\n 'Search in editor': [modifier, 'F'],\n 'Search in documentation': [modifier, 'K'],\n 'Execute query': [modifier, 'Enter'],\n 'Prettify editors': ['Ctrl', 'Shift', 'P'],\n 'Merge fragments definitions into operation definition': ['Ctrl', 'Shift', 'M'],\n 'Copy query': ['Ctrl', 'Shift', 'C'],\n 'Re-fetch schema using introspection': ['Ctrl', 'Shift', 'R'],\n});\n\nfunction ShortKeys({ keyMap }: { keyMap: string }): ReactElement {\n return (\n <div>\n <table className=\"graphiql-table\">\n <thead>\n <tr>\n <th>Short Key</th>\n <th>Function</th>\n </tr>\n </thead>\n <tbody>\n {SHORT_KEYS.map(([title, keys]) => (\n <tr key={title}>\n <td>\n {keys.map((key, index, array) => (\n <Fragment key={key}>\n <code className=\"graphiql-key\">{key}</code>\n {index !== array.length - 1 && ' + '}\n </Fragment>\n ))}\n </td>\n <td>{title}</td>\n </tr>\n ))}\n </tbody>\n </table>\n <p>\n The editors use{' '}\n <a href=\"https://codemirror.net/5/doc/manual.html#keymaps\" target=\"_blank\" rel=\"noopener noreferrer\">\n CodeMirror Key Maps\n </a>{' '}\n that add more short keys. This instance of Graph<em>i</em>QL uses <code>{keyMap}</code>.\n </p>\n </div>\n );\n}\n\n// Configure the UI by providing this Component as a child of GraphiQL.\nfunction GraphiQLToolbar<TProps>(props: PropsWithChildren<TProps>): ReactElement {\n return <>{props.children}</>;\n}\n\nGraphiQLToolbar.displayName = 'GraphiQLToolbar';\n\n// Configure the UI by providing this Component as a child of GraphiQL.\nfunction GraphiQLFooter<TProps>(props: PropsWithChildren<TProps>): ReactElement {\n return <div className=\"graphiql-footer\">{props.children}</div>;\n}\n\nGraphiQLFooter.displayName = 'GraphiQLFooter';\n\n// Determines if the React child is of the same type of the provided React component\nfunction isChildComponentType<T extends ComponentType>(child: any, component: T): child is T {\n if (child?.type?.displayName && child.type.displayName === component.displayName) {\n return true;\n }\n\n return child.type === component;\n}\n","'use client';\n\nimport { useMemo } from 'react';\nimport { createGraphiQLFetcher } from '@graphiql/toolkit';\nimport { useConfig } from '@flexkit/studio';\nimport { GraphiQL } from './components/graphiql';\nimport '@graphiql/react/dist/style.css';\n\nexport function Root(): JSX.Element {\n const { currentProjectId } = useConfig();\n const url = `/api/flexkit/${currentProjectId}/graphql`;\n const fetcher = useMemo(() => createGraphiQLFetcher({ url }), [url]);\n\n return <GraphiQL fetcher={fetcher} forcedTheme=\"light\" />;\n}\n","import { SquarePlay as SquarePlayIcon } from 'lucide-react';\nimport type { PluginOptions } from '@flexkit/studio';\nimport { Root } from './root';\n\nexport function Explorer(): PluginOptions {\n return {\n name: 'flexkit.explorer',\n contributes: {\n apps: [\n {\n name: 'explorer',\n icon: <SquarePlayIcon strokeWidth={1.5} />,\n title: 'Explorer',\n component: <Root />,\n routes: [],\n },\n ],\n },\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/components/graphiql.tsx","../src/root.tsx","../src/index.tsx"],"names":["GraphiQL","dangerouslyAssumeSchemaIsValid","confirmCloseTab","defaultQuery","defaultTabs","externalFragments","fetcher","getDefaultFieldNames","headers","inputValueDeprecation","introspectionQueryName","maxHistoryLength","onEditOperationName","onSchemaChange","onTabChange","onTogglePluginVisibility","operationName","plugins","query","response","schema","schemaDescription","shouldPersistHeaders","storage","validationRules","variables","visiblePlugin","defaultHeaders","props","mergedPlugins","useMemo","userPlugins","plugin","HISTORY_PLUGIN","jsx","GraphiQLProvider","HistoryContextProvider","GraphiQLInterface","GraphiQLToolbar","GraphiQLFooter","THEMES","TAB_CLASS_PREFIX","editorContext","useEditorContext","executionContext","useExecutionContext","schemaContext","useSchemaContext","storageContext","useStorageContext","pluginContext","usePluginContext","isSidebarCollapsed","setIsSidebarCollapsed","useState","sidebarPanel","useRef","forcedTheme","copy","useCopyQuery","merge","useMergeQuery","prettify","usePrettifyEditors","setTheme","useTheme","useEffect","showDialog","setShowDialog","clearStorageStatus","setClearStorageStatus","children","Children","toolbar","child","isChildComponentType","jsxs","Fragment","ToolbarButton","PrettifyIcon","MergeIcon","CopyIcon","footer","handleClearData","useCallback","handlePersistHeaders","event","handleAddTab","handleRefetchSchema","handleReorder","newOrder","handleShowDialog","handlePluginClick","context","pluginIndex","_","index","handleOpenShortKeysDialog","isOpen","handleOpenSettingsDialog","addTab","GraphiQLTooltip","UnStyledButton","PlusIcon","className","confirmClose","handleTabClose","tabButton","handleTabClick","ResizablePanelGroup","ResizablePanel","Tabs","TabsList","label","TabsTrigger","Tooltip","TooltipTrigger","Button","panel","ChevronsRight","ChevronsLeft","TooltipContent","Separator","TabsContent","ScrollArea","ScrollBar","ReloadIcon","KeyboardShortcutIcon","SettingsIcon","ResizableHandle","GraphiQlTabs","tab","GraphiQlTab","QueryEditor","ExecuteButton","VariableEditor","Spinner","ResponseEditor","Dialog","ShortKeys","ButtonGroup","GraphiQLButton","modifier","isMacOs","SHORT_KEYS","keyMap","title","keys","key","array","component","element","childType","Root","currentProjectId","useConfig","url","createGraphiQLFetcher","Explorer","SquarePlayIcon"],"mappings":"+mCA2GO,SAASA,CAAAA,CAAS,CACvB,8BAAA,CAAAC,CAAAA,CACA,gBAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,qBAAA,CAAAC,CAAAA,CACA,sBAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,mBAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,wBAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,EACA,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,iBAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAg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,CAAM5H,GAAAA,CAAC6H,UAAAA,CAAA,CAAe,WAAA,CAAa,GAAA,CAAK,CAAA,CACxC,KAAA,CAAO,UAAA,CACP,SAAA,CAAW7H,GAAAA,CAACuH,EAAAA,CAAA,EAAK,CAAA,CACjB,MAAA,CAAQ,EACV,CACF,CACF,CACF,CACF","file":"index.js","sourcesContent":["import { Children, Fragment, useCallback, useState, useEffect, useMemo, useRef } from 'react';\nimport type {\n ComponentProps,\n ComponentType,\n MouseEventHandler,\n PropsWithChildren,\n ReactNode,\n ReactElement,\n} from 'react';\nimport {\n Button as GraphiQLButton,\n ButtonGroup,\n CopyIcon,\n Dialog,\n ExecuteButton,\n GraphiQLProvider,\n KeyboardShortcutIcon,\n MergeIcon,\n PlusIcon,\n PrettifyIcon,\n QueryEditor,\n ReloadIcon,\n ResponseEditor,\n SettingsIcon,\n Spinner,\n Tabs as GraphiQlTabs,\n Tab as GraphiQlTab,\n ToolbarButton,\n Tooltip as GraphiQLTooltip,\n UnStyledButton,\n useCopyQuery,\n useEditorContext,\n useExecutionContext,\n useMergeQuery,\n usePluginContext,\n usePrettifyEditors,\n useSchemaContext,\n useStorageContext,\n useTheme,\n VariableEditor,\n isMacOs,\n} from '@graphiql/react';\nimport type {\n Theme,\n UseHeaderEditorArgs,\n UseQueryEditorArgs,\n UseResponseEditorArgs,\n UseVariableEditorArgs,\n WriteableEditorProps,\n} from '@graphiql/react';\nimport { HISTORY_PLUGIN, HistoryContextProvider } from '@graphiql/plugin-history';\nimport { ChevronsLeft, ChevronsRight } from 'lucide-react';\nimport {\n Button,\n ResizableHandle,\n ResizablePanel,\n ResizablePanelGroup,\n ScrollArea,\n ScrollBar,\n Separator,\n Tabs,\n TabsContent,\n TabsList,\n TabsTrigger,\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@flexkit/studio/ui';\nimport type { ImperativePanelHandle } from '@flexkit/studio/ui';\nimport type { TabState } from './types';\n\nexport type GraphiQLToolbarConfig = {\n /**\n * This content will be rendered after the built-in buttons of the toolbar.\n * Note that this will not apply if you provide a completely custom toolbar\n * (by passing `GraphiQL.Toolbar` as child to the `GraphiQL` component).\n */\n additionalContent?: React.ReactNode;\n\n /**\n * same as above, except a component with access to context\n */\n additionalComponent?: React.JSXElementConstructor<unknown>;\n};\n\n/**\n * API docs for this live here:\n *\n * https://graphiql-test.netlify.app/typedoc/modules/graphiql.html#graphiqlprops\n */\nexport type GraphiQLProps = Omit<ComponentProps<typeof GraphiQLProvider>, 'children'> &\n GraphiQLInterfaceProps & {\n /**\n * The maximum number of executed operations to store in history.\n *\n * GraphiQL v0.31 extracted the history functionality into `@graphiql/plugin-history`,\n * so this is no longer a prop on `@graphiql/react`'s `GraphiQLProvider`.\n */\n maxHistoryLength?: number;\n };\n\n/**\n * The top-level React component for GraphiQL, intended to encompass the entire\n * browser viewport.\n *\n * @see https://github.com/graphql/graphiql#usage\n */\nexport function GraphiQL({\n dangerouslyAssumeSchemaIsValid,\n confirmCloseTab,\n defaultQuery,\n defaultTabs,\n externalFragments,\n fetcher,\n getDefaultFieldNames,\n headers,\n inputValueDeprecation,\n introspectionQueryName,\n maxHistoryLength,\n onEditOperationName,\n onSchemaChange,\n onTabChange,\n onTogglePluginVisibility,\n operationName,\n plugins,\n query,\n response,\n schema,\n schemaDescription,\n shouldPersistHeaders,\n storage,\n validationRules,\n variables,\n visiblePlugin,\n defaultHeaders,\n ...props\n}: GraphiQLProps): ReactElement {\n // Ensure props are correct\n if (typeof fetcher !== 'function') {\n throw new TypeError('The `GraphiQL` component requires a `fetcher` function to be passed as prop.');\n }\n\n const mergedPlugins = useMemo(() => {\n const userPlugins = plugins ?? [];\n\n if (userPlugins.some((plugin) => plugin.title === HISTORY_PLUGIN.title)) {\n return userPlugins;\n }\n\n return [HISTORY_PLUGIN, ...userPlugins];\n }, [plugins]);\n\n return (\n <GraphiQLProvider\n getDefaultFieldNames={getDefaultFieldNames}\n dangerouslyAssumeSchemaIsValid={dangerouslyAssumeSchemaIsValid}\n defaultQuery={defaultQuery}\n defaultHeaders={defaultHeaders}\n defaultTabs={defaultTabs}\n externalFragments={externalFragments}\n fetcher={fetcher}\n headers={headers}\n inputValueDeprecation={inputValueDeprecation}\n introspectionQueryName={introspectionQueryName}\n onEditOperationName={onEditOperationName}\n onSchemaChange={onSchemaChange}\n onTabChange={onTabChange}\n onTogglePluginVisibility={onTogglePluginVisibility}\n plugins={mergedPlugins}\n visiblePlugin={visiblePlugin}\n operationName={operationName}\n query={query}\n response={response}\n schema={schema}\n schemaDescription={schemaDescription}\n shouldPersistHeaders={shouldPersistHeaders}\n storage={storage}\n validationRules={validationRules}\n variables={variables}\n >\n <HistoryContextProvider maxHistoryLength={maxHistoryLength}>\n <GraphiQLInterface\n confirmCloseTab={confirmCloseTab}\n showPersistHeadersSettings={shouldPersistHeaders !== false}\n disableTabs={props.disableTabs ?? false}\n forcedTheme={props.forcedTheme}\n {...props}\n />\n </HistoryContextProvider>\n </GraphiQLProvider>\n );\n}\n\n// Export main windows/panes to be used separately if desired.\nGraphiQL.Toolbar = GraphiQLToolbar;\nGraphiQL.Footer = GraphiQLFooter;\n\ntype AddSuffix<Obj extends { [key: string]: unknown }, Suffix extends string> = {\n [Key in keyof Obj as `${string & Key}${Suffix}`]: Obj[Key];\n};\n\nexport type GraphiQLInterfaceProps = WriteableEditorProps &\n AddSuffix<Pick<UseQueryEditorArgs, 'onEdit'>, 'Query'> &\n Pick<UseQueryEditorArgs, 'onCopyQuery'> &\n AddSuffix<Pick<UseVariableEditorArgs, 'onEdit'>, 'Variables'> &\n AddSuffix<Pick<UseHeaderEditorArgs, 'onEdit'>, 'Headers'> &\n Pick<UseResponseEditorArgs, 'responseTooltip'> & {\n children?: ReactNode;\n /**\n * Set the default state for the editor tools.\n * - `false` hides the editor tools\n * - `true` shows the editor tools\n * - `'variables'` specifically shows the variables editor\n * - `'headers'` specifically shows the headers editor\n * By default the editor tools are initially shown when at least one of the\n * editors has contents.\n */\n defaultEditorToolsVisibility?: boolean | 'variables' | 'headers';\n /**\n * Toggle if the headers editor should be shown inside the editor tools.\n */\n isHeadersEditorEnabled?: boolean;\n /**\n * An object that allows configuration of the toolbar next to the query\n * editor.\n */\n toolbar?: GraphiQLToolbarConfig;\n /**\n * Indicates if settings for persisting headers should appear in the\n * settings modal.\n */\n showPersistHeadersSettings?: boolean;\n defaultTheme?: Theme;\n disableTabs?: boolean;\n /**\n * `forcedTheme` allows enforcement of a specific theme for GraphiQL.\n * This is useful when you want to make sure that GraphiQL is always\n * rendered with a specific theme.\n */\n forcedTheme?: (typeof THEMES)[number];\n /**\n * Additional class names which will be appended to the container element.\n */\n className?: string;\n /**\n * When the user clicks a close tab button, this function is invoked with\n * the index of the tab that is about to be closed. It can return a promise\n * that should resolve to `true` (meaning the tab may be closed) or `false`\n * (meaning the tab may not be closed).\n */\n confirmCloseTab?: (index: number) => Promise<boolean> | boolean;\n };\n\nconst THEMES = ['light', 'dark', 'system'] as const;\n\nconst TAB_CLASS_PREFIX = 'graphiql-session-tab-';\n\nexport function GraphiQLInterface(props: GraphiQLInterfaceProps): ReactElement {\n const editorContext = useEditorContext({ nonNull: true });\n const executionContext = useExecutionContext({ nonNull: true });\n const schemaContext = useSchemaContext({ nonNull: true });\n const storageContext = useStorageContext();\n const pluginContext = usePluginContext();\n const [isSidebarCollapsed, setIsSidebarCollapsed] = useState(false);\n const sidebarPanel = useRef<ImperativePanelHandle>(null);\n const forcedTheme = useMemo(\n () => (props.forcedTheme && THEMES.includes(props.forcedTheme) ? props.forcedTheme : undefined),\n [props.forcedTheme]\n );\n\n const copy = useCopyQuery({ onCopyQuery: props.onCopyQuery });\n const merge = useMergeQuery();\n const prettify = usePrettifyEditors();\n\n const { setTheme } = useTheme(props.defaultTheme);\n\n useEffect(() => {\n if (forcedTheme === 'system') {\n setTheme(null);\n } else if (forcedTheme === 'light' || forcedTheme === 'dark') {\n setTheme(forcedTheme);\n }\n }, [forcedTheme, setTheme]);\n\n useEffect(() => {\n pluginContext?.setVisiblePlugin(pluginContext.plugins[0]);\n }, [pluginContext]);\n\n const [showDialog, setShowDialog] = useState<'settings' | 'short-keys' | null>(null);\n const [clearStorageStatus, setClearStorageStatus] = useState<'success' | 'error' | null>(null);\n\n const children = Children.toArray(props.children);\n\n const toolbar = children.find((child) => isChildComponentType(child, GraphiQL.Toolbar)) ?? (\n <>\n <ToolbarButton onClick={prettify} label=\"Prettify query (Shift-Ctrl-P)\">\n <PrettifyIcon className=\"ex-w-6 ex-h-6 ex-block\" aria-hidden=\"true\" />\n </ToolbarButton>\n <ToolbarButton onClick={merge} label=\"Merge fragments into query (Shift-Ctrl-M)\">\n <MergeIcon className=\"ex-w-6 ex-h-6 ex-block\" aria-hidden=\"true\" />\n </ToolbarButton>\n <ToolbarButton onClick={copy} label=\"Copy query (Shift-Ctrl-C)\">\n <CopyIcon className=\"ex-w-6 ex-h-6 ex-block\" aria-hidden=\"true\" />\n </ToolbarButton>\n {props.toolbar?.additionalContent}\n {props.toolbar?.additionalComponent && <props.toolbar.additionalComponent />}\n </>\n );\n\n const footer = children.find((child) => isChildComponentType(child, GraphiQL.Footer));\n\n const handleClearData = useCallback(() => {\n try {\n storageContext?.clear();\n setClearStorageStatus('success');\n } catch {\n setClearStorageStatus('error');\n }\n }, [storageContext]);\n\n const handlePersistHeaders: MouseEventHandler<HTMLButtonElement> = useCallback(\n (event) => {\n editorContext.setShouldPersistHeaders(event.currentTarget.dataset.value === 'true');\n },\n [editorContext]\n );\n\n const handleAddTab = (): void => {\n editorContext.addTab();\n };\n const handleRefetchSchema = (): void => {\n schemaContext.introspect();\n };\n const handleReorder = (newOrder: TabState[]): void => {\n editorContext.moveTab(newOrder);\n };\n\n const handleShowDialog: MouseEventHandler<HTMLButtonElement> = useCallback((event) => {\n setShowDialog(event.currentTarget.dataset.value as 'short-keys' | 'settings');\n }, []);\n\n const handlePluginClick: MouseEventHandler<HTMLButtonElement> = useCallback(\n (event) => {\n const context = pluginContext;\n const pluginIndex = Number(event.currentTarget.dataset.index);\n\n if (!context) return;\n\n const plugin = context.plugins.find((_, index) => pluginIndex === index) ?? null;\n const isVisible = plugin === context.visiblePlugin;\n\n if (isVisible) {\n context.setVisiblePlugin(null);\n\n return;\n }\n\n context.setVisiblePlugin(plugin);\n },\n [pluginContext]\n );\n\n const handleOpenShortKeysDialog = useCallback((isOpen: boolean) => {\n if (!isOpen) {\n setShowDialog(null);\n }\n }, []);\n\n const handleOpenSettingsDialog = useCallback((isOpen: boolean) => {\n if (!isOpen) {\n setShowDialog(null);\n setClearStorageStatus(null);\n }\n }, []);\n\n const addTab = (\n <GraphiQLTooltip label=\"Add tab\">\n <UnStyledButton type=\"button\" className=\"graphiql-tab-add\" onClick={handleAddTab} aria-label=\"Add tab\">\n <PlusIcon aria-hidden=\"true\" />\n </UnStyledButton>\n </GraphiQLTooltip>\n );\n\n const className = props.className ? ` ${props.className}` : '';\n const confirmClose = props.confirmCloseTab;\n\n const handleTabClose: MouseEventHandler<HTMLButtonElement> = useCallback(\n async (event) => {\n const tabButton = event.currentTarget.previousSibling as HTMLButtonElement;\n const index = Number(tabButton.id.replace(TAB_CLASS_PREFIX, ''));\n\n /** TODO:\n * Move everything after into `editorContext.closeTab` once zustand will be used instead of\n * React context, since now we can't use execution context inside editor context, since editor\n * context is used in execution context.\n */\n const shouldCloseTab = confirmClose ? await confirmClose(index) : true;\n\n if (!shouldCloseTab) {\n return;\n }\n\n if (editorContext.activeTabIndex === index) {\n executionContext.stop();\n }\n editorContext.closeTab(index);\n },\n [confirmClose, editorContext, executionContext]\n );\n\n const handleTabClick: MouseEventHandler<HTMLButtonElement> = useCallback(\n (event) => {\n const index = Number(event.currentTarget.id.replace(TAB_CLASS_PREFIX, ''));\n /** TODO:\n * Move everything after into `editorContext.changeTab` once zustand will be used instead of\n * React context, since now we can't use execution context inside editor context, since editor\n * context is used in execution context.\n */\n executionContext.stop();\n editorContext.changeTab(index);\n },\n [editorContext, executionContext]\n );\n\n return (\n <GraphiQLTooltip.Provider>\n <div className={`graphiql-container${className}`}>\n <ResizablePanelGroup autoSaveId=\"explorer\" direction=\"horizontal\" className=\"ex-h-full ex-max-h-full\">\n <ResizablePanel\n collapsible\n collapsedSize={3}\n minSize={10}\n onCollapse={() => {\n setIsSidebarCollapsed(true);\n }}\n onExpand={() => {\n setIsSidebarCollapsed(false);\n }}\n ref={sidebarPanel}\n >\n <div className=\"ex-flex ex-w-full ex-h-full ex-pb-6\">\n <Tabs className=\"ex-w-full\" defaultValue={pluginContext?.plugins[0].title}>\n <div className={`ex-flex ex-items-center ex-py-1 ${isSidebarCollapsed ? '' : 'ex-px-3'}`}>\n <TabsList className={isSidebarCollapsed ? 'ex-hidden' : ''}>\n {pluginContext?.plugins.map((plugin, index) => {\n const isVisible = plugin === pluginContext.visiblePlugin;\n const label = `${isVisible ? 'Hide' : 'Show'} ${plugin.title}`;\n return (\n <TabsTrigger\n aria-label={label}\n className=\"ex-text-muted-foreground\"\n data-index={index}\n key={plugin.title}\n onClick={handlePluginClick}\n value={plugin.title}\n >\n <plugin.icon aria-hidden=\"true\" />\n </TabsTrigger>\n );\n })}\n </TabsList>\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n className={isSidebarCollapsed ? 'ex-ml-1.5' : 'ex-ml-auto'}\n onClick={() => {\n const panel = sidebarPanel.current;\n\n isSidebarCollapsed ? panel?.expand() : panel?.collapse();\n }}\n size=\"icon\"\n variant=\"ghost\"\n >\n {isSidebarCollapsed ? (\n <>\n <ChevronsRight className=\"ex-w-4 ex-h-4\" />\n <span className=\"ex-sr-only\">Expand</span>\n </>\n ) : (\n <>\n <ChevronsLeft className=\"ex-w-4 ex-h-4\" />\n <span className=\"ex-sr-only\">Collapse</span>\n </>\n )}\n </Button>\n </TooltipTrigger>\n <TooltipContent>{isSidebarCollapsed ? 'Expand' : 'Collapse'}</TooltipContent>\n </Tooltip>\n </div>\n {isSidebarCollapsed ? null : <Separator />}\n {pluginContext?.plugins.map((plugin) => (\n <TabsContent\n className={`ex-flex ex-w-full ex-max-h-full ex-mt-0 ${isSidebarCollapsed ? 'ex-hidden' : ''}`}\n key={plugin.title}\n value={plugin.title}\n >\n <ScrollArea className=\"ex-flex ex-w-full ex-max-h-full ex-overflow-auto ex-px-6 ex-pt-3 ex-pb-6 ex-mb-3 [&>div>div]:!ex-block\">\n <plugin.content />\n <ScrollBar orientation=\"horizontal\" />\n </ScrollArea>\n </TabsContent>\n ))}\n </Tabs>\n </div>\n <GraphiQLTooltip label=\"Re-fetch GraphQL schema\">\n <UnStyledButton\n type=\"button\"\n disabled={schemaContext.isFetching}\n onClick={handleRefetchSchema}\n aria-label=\"Re-fetch GraphQL schema\"\n >\n <ReloadIcon className={schemaContext.isFetching ? 'graphiql-spin' : ''} aria-hidden=\"true\" />\n </UnStyledButton>\n </GraphiQLTooltip>\n <GraphiQLTooltip label=\"Open short keys dialog\">\n <UnStyledButton\n type=\"button\"\n data-value=\"short-keys\"\n onClick={handleShowDialog}\n aria-label=\"Open short keys dialog\"\n >\n <KeyboardShortcutIcon aria-hidden=\"true\" />\n </UnStyledButton>\n </GraphiQLTooltip>\n <GraphiQLTooltip label=\"Open settings dialog\">\n <UnStyledButton\n type=\"button\"\n data-value=\"settings\"\n onClick={handleShowDialog}\n aria-label=\"Open settings dialog\"\n >\n <SettingsIcon aria-hidden=\"true\" />\n </UnStyledButton>\n </GraphiQLTooltip>\n </ResizablePanel>\n\n <ResizableHandle className=\"hover:ex-bg-blue-500 ex-transition-colors\" withHandle />\n {/* Center column */}\n <ResizablePanel className=\"ex-bg-muted\" defaultSize={48}>\n <div className=\"ex-flex ex-flex-col ex-h-full\">\n <div className=\"ex-flex ex-items-center ex-py-1 ex-px-4 ex-gap-6 ex-bg-muted\">\n {!props.disableTabs && (\n <GraphiQlTabs\n aria-label=\"Select active operation\"\n className=\"!ex-p-1 ex-bg-muted ex-rounded-md\"\n onReorder={handleReorder}\n values={editorContext.tabs}\n >\n {editorContext.tabs.length > 0 && (\n <>\n {editorContext.tabs.map((tab, index) => (\n <GraphiQlTab isActive={index === editorContext.activeTabIndex} key={tab.id} value={tab}>\n <GraphiQlTab.Button\n aria-controls=\"graphiql-session\"\n id={`${TAB_CLASS_PREFIX}${index.toString()}`}\n onClick={handleTabClick}\n >\n {tab.title}\n </GraphiQlTab.Button>\n <GraphiQlTab.Close onClick={handleTabClose} />\n </GraphiQlTab>\n ))}\n </>\n )}\n </GraphiQlTabs>\n )}\n {addTab}\n </div>\n\n {/* Query editor */}\n <div\n role=\"tabpanel\"\n id=\"graphiql-session\" // used by aria-controls=\"graphiql-session\"\n className=\"graphiql-session\"\n aria-labelledby={`${TAB_CLASS_PREFIX}${editorContext.activeTabIndex}`}\n >\n <div className={`graphiql-editors${editorContext.tabs.length === 1 ? ' full-height' : ''}`}>\n <ResizablePanelGroup direction=\"vertical\">\n <ResizablePanel className=\"ex-flex ex-w-full ex-gap-x-4 ex-px-4 ex-py-2\" defaultSize={80}>\n <QueryEditor\n editorTheme={props.editorTheme}\n keyMap={props.keyMap}\n onCopyQuery={props.onCopyQuery}\n onEdit={props.onEditQuery}\n readOnly={props.readOnly}\n />\n <div className=\"graphiql-toolbar\" role=\"toolbar\" aria-label=\"Editor Commands\">\n <ExecuteButton />\n {toolbar}\n </div>\n </ResizablePanel>\n <ResizableHandle className=\"hover:ex-bg-blue-500 ex-transition-colors\" withHandle />\n <ResizablePanel className=\"ex-bg-muted ex-px-4 ex-pt-2\" defaultSize={20}>\n <div className=\"ex-text-sm ex-font-medium ex-text-muted-foreground\">Variables</div>\n <VariableEditor\n editorTheme={props.editorTheme}\n isHidden={false}\n keyMap={props.keyMap}\n onEdit={props.onEditVariables}\n readOnly={props.readOnly}\n />\n </ResizablePanel>\n </ResizablePanelGroup>\n </div>\n </div>\n </div>\n </ResizablePanel>\n <ResizableHandle className=\"hover:ex-bg-blue-500 ex-transition-colors\" withHandle />\n <ResizablePanel className=\"ex-px-5 ex-pt-10 ex-relative\" defaultSize={30}>\n <div className=\"graphiql-response ex-h-full\">\n {executionContext.isFetching ? <Spinner /> : null}\n <ResponseEditor\n editorTheme={props.editorTheme}\n responseTooltip={props.responseTooltip}\n keyMap={props.keyMap}\n />\n {footer}\n </div>\n </ResizablePanel>\n </ResizablePanelGroup>\n <Dialog open={showDialog === 'short-keys'} onOpenChange={handleOpenShortKeysDialog}>\n <div className=\"graphiql-dialog-header\">\n <Dialog.Title className=\"graphiql-dialog-title\">Short Keys</Dialog.Title>\n <Dialog.Close />\n </div>\n <div className=\"graphiql-dialog-section\">\n <ShortKeys keyMap={props.keyMap || 'sublime'} />\n </div>\n </Dialog>\n <Dialog open={showDialog === 'settings'} onOpenChange={handleOpenSettingsDialog}>\n <div className=\"graphiql-dialog-header\">\n <Dialog.Title className=\"graphiql-dialog-title\">Settings</Dialog.Title>\n <Dialog.Close />\n </div>\n {props.showPersistHeadersSettings ? (\n <div className=\"graphiql-dialog-section\">\n <div>\n <div className=\"graphiql-dialog-section-title\">Persist headers</div>\n <div className=\"graphiql-dialog-section-caption\">\n Save headers upon reloading.{' '}\n <span className=\"graphiql-warning-text\">Only enable if you trust this device.</span>\n </div>\n </div>\n <ButtonGroup>\n <GraphiQLButton\n type=\"button\"\n id=\"enable-persist-headers\"\n className={editorContext.shouldPersistHeaders ? 'active' : ''}\n data-value=\"true\"\n onClick={handlePersistHeaders}\n >\n On\n </GraphiQLButton>\n <GraphiQLButton\n type=\"button\"\n id=\"disable-persist-headers\"\n className={editorContext.shouldPersistHeaders ? '' : 'active'}\n onClick={handlePersistHeaders}\n >\n Off\n </GraphiQLButton>\n </ButtonGroup>\n </div>\n ) : null}\n\n {storageContext ? (\n <div className=\"graphiql-dialog-section\">\n <div>\n <div className=\"graphiql-dialog-section-title\">Clear storage</div>\n <div className=\"graphiql-dialog-section-caption\">Remove all locally stored data and start fresh.</div>\n </div>\n <GraphiQLButton\n type=\"button\"\n state={clearStorageStatus || undefined}\n disabled={clearStorageStatus === 'success'}\n onClick={handleClearData}\n >\n {{\n success: 'Cleared data',\n error: 'Failed',\n }[clearStorageStatus!] || 'Clear data'}\n </GraphiQLButton>\n </div>\n ) : null}\n </Dialog>\n </div>\n </GraphiQLTooltip.Provider>\n );\n}\n\nconst modifier = isMacOs ? '⌘' : 'Ctrl';\n\nconst SHORT_KEYS = Object.entries({\n 'Search in editor': [modifier, 'F'],\n 'Search in documentation': [modifier, 'K'],\n 'Execute query': [modifier, 'Enter'],\n 'Prettify editors': ['Ctrl', 'Shift', 'P'],\n 'Merge fragments definitions into operation definition': ['Ctrl', 'Shift', 'M'],\n 'Copy query': ['Ctrl', 'Shift', 'C'],\n 'Re-fetch schema using introspection': ['Ctrl', 'Shift', 'R'],\n});\n\nfunction ShortKeys({ keyMap }: { keyMap: string }): ReactElement {\n return (\n <div>\n <table className=\"graphiql-table\">\n <thead>\n <tr>\n <th>Short Key</th>\n <th>Function</th>\n </tr>\n </thead>\n <tbody>\n {SHORT_KEYS.map(([title, keys]) => (\n <tr key={title}>\n <td>\n {keys.map((key, index, array) => (\n <Fragment key={key}>\n <code className=\"graphiql-key\">{key}</code>\n {index !== array.length - 1 && ' + '}\n </Fragment>\n ))}\n </td>\n <td>{title}</td>\n </tr>\n ))}\n </tbody>\n </table>\n <p>\n The editors use{' '}\n <a href=\"https://codemirror.net/5/doc/manual.html#keymaps\" target=\"_blank\" rel=\"noopener noreferrer\">\n CodeMirror Key Maps\n </a>{' '}\n that add more short keys. This instance of Graph<em>i</em>QL uses <code>{keyMap}</code>.\n </p>\n </div>\n );\n}\n\n// Configure the UI by providing this Component as a child of GraphiQL.\nfunction GraphiQLToolbar<TProps>(props: PropsWithChildren<TProps>): ReactElement {\n return <>{props.children}</>;\n}\n\nGraphiQLToolbar.displayName = 'GraphiQLToolbar';\n\n// Configure the UI by providing this Component as a child of GraphiQL.\nfunction GraphiQLFooter<TProps>(props: PropsWithChildren<TProps>): ReactElement {\n return <div className=\"graphiql-footer\">{props.children}</div>;\n}\n\nGraphiQLFooter.displayName = 'GraphiQLFooter';\n\n// Determines if the React child is of the same type of the provided React component\nfunction isChildComponentType<T extends ComponentType>(\n child: ReactNode,\n component: T\n): child is ReactElement<unknown, T> {\n const element = typeof child === 'object' && child !== null ? (child as ReactElement) : null;\n\n if (!element) {\n return false;\n }\n\n const childType = element.type as unknown;\n\n if (\n typeof childType === 'object' &&\n childType !== null &&\n 'displayName' in childType &&\n typeof (childType as { displayName?: unknown }).displayName === 'string' &&\n (childType as { displayName: string }).displayName === component.displayName\n ) {\n return true;\n }\n\n return element.type === component;\n}\n","'use client';\n\nimport { useMemo } from 'react';\nimport { createGraphiQLFetcher } from '@graphiql/toolkit';\nimport { useConfig } from '@flexkit/studio';\nimport { GraphiQL } from './components/graphiql';\nimport '@graphiql/react/style.css';\nimport '@graphiql/plugin-history/style.css';\n\nexport function Root(): JSX.Element {\n const { currentProjectId } = useConfig();\n const url = `/api/flexkit/${currentProjectId}/graphql`;\n const fetcher = useMemo(() => createGraphiQLFetcher({ url }), [url]);\n\n return <GraphiQL fetcher={fetcher} forcedTheme=\"light\" />;\n}\n","import { SquarePlay as SquarePlayIcon } from 'lucide-react';\nimport type { PluginOptions } from '@flexkit/studio';\nimport { Root } from './root';\n\nexport function Explorer(): PluginOptions {\n return {\n name: 'flexkit.explorer',\n contributes: {\n apps: [\n {\n name: 'explorer',\n icon: <SquarePlayIcon strokeWidth={1.5} />,\n title: 'Explorer',\n component: <Root />,\n routes: [],\n },\n ],\n },\n };\n}\n"]}
package/package.json CHANGED
@@ -1,10 +1,19 @@
1
1
  {
2
2
  "name": "@flexkit/explorer",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
+ "description": "Flexkit plugin for running and debugging GraphQL queries in a graphical interactive in-browser GraphQL IDE",
5
+ "keywords": [
6
+ "flexkit",
7
+ "studio",
8
+ "react",
9
+ "node",
10
+ "graphql",
11
+ "flexkit-plugin"
12
+ ],
4
13
  "type": "module",
5
14
  "main": "./dist/index.js",
6
15
  "style": "dist/index.css",
7
- "module": "./dist/index.mjs",
16
+ "module": "./dist/index.js",
8
17
  "types": "./dist/index.d.ts",
9
18
  "license": "MIT",
10
19
  "repository": {
@@ -25,7 +34,9 @@
25
34
  ]
26
35
  }
27
36
  },
28
- "sideEffects": false,
37
+ "sideEffects": [
38
+ "**/*.css"
39
+ ],
29
40
  "files": [
30
41
  "dist/**"
31
42
  ],
@@ -39,32 +50,33 @@
39
50
  "react": "^18.2.0",
40
51
  "react-dom": "^18.2.0",
41
52
  "tailwindcss": "3.4.10",
42
- "tsup": "8.5.0",
53
+ "tsup": "8.5.1",
43
54
  "typescript": "^5.3.3",
44
- "@flexkit/studio": "0.0.6",
45
55
  "eslint-config-custom": "0.0.0",
46
56
  "tailwind-config": "0.0.1",
47
- "tsconfig": "0.0.0"
57
+ "tsconfig": "0.0.0",
58
+ "@flexkit/studio": "0.0.8"
48
59
  },
49
60
  "dependencies": {
50
- "@graphiql/react": "0.26.2",
51
- "@graphiql/toolkit": "0.11.0",
61
+ "@graphiql/plugin-history": "0.0.1",
62
+ "@graphiql/react": "0.31.0",
63
+ "@graphiql/toolkit": "0.11.3",
52
64
  "graphql-ws": "5.14.2",
53
- "lucide-react": "0.544.0",
65
+ "lucide-react": "0.555.0",
54
66
  "ramda": "^0.29.1",
55
67
  "swr": "^2.2.4"
56
68
  },
57
69
  "peerDependencies": {
58
70
  "react": "^18.0.0 || ^19.0.0",
59
71
  "react-dom": "^18.0.0 || ^19.0.0",
60
- "@flexkit/studio": "0.0.6"
72
+ "@flexkit/studio": "0.0.8"
61
73
  },
62
74
  "publishConfig": {
63
75
  "access": "public"
64
76
  },
65
77
  "scripts": {
66
- "build": "tsup src/index.tsx --format esm --dts --external react && tailwindcss -i ./src/styles.css -o dist/index.css",
67
- "dev": "tsup src/index.tsx --format esm --watch --dts --external react && tailwindcss -i ./src/styles.css -o ./dist/index.css --watch",
78
+ "build": "tailwindcss -i ./src/styles.css -o dist/index.css && tsup src/index.tsx --format esm --dts --external react",
79
+ "dev": "tailwindcss -i ./src/styles.css -o ./dist/index.css --watch & tsup src/index.tsx --format esm --watch --dts --external react",
68
80
  "lint": "eslint \"src/**/*.ts*\"",
69
81
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
70
82
  }