@perses-dev/explore 0.52.0-beta.2 → 0.52.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/components/ExploreManager/ExploreManager.js.map +1 -0
  2. package/dist/components/ExploreManager/ExplorerManagerProvider.js.map +1 -0
  3. package/dist/components/ExploreManager/ExplorerManagerProviderWithQueryParams.js.map +1 -0
  4. package/dist/components/ExploreManager/index.js.map +1 -0
  5. package/dist/components/ExploreManager/query-params.js.map +1 -0
  6. package/dist/components/ExploreToolbar/ExploreToolbar.js.map +1 -0
  7. package/dist/components/ExploreToolbar/index.js.map +1 -0
  8. package/dist/components/index.js.map +1 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/test/setup-tests.js.map +1 -0
  11. package/dist/views/ViewExplore/ViewExplore.js.map +1 -0
  12. package/dist/views/ViewExplore/ViewExploreApp.js.map +1 -0
  13. package/dist/views/ViewExplore/index.js.map +1 -0
  14. package/dist/views/index.js.map +1 -0
  15. package/package.json +8 -8
  16. package/dist/src/components/ExploreManager/ExploreManager.js.map +0 -1
  17. package/dist/src/components/ExploreManager/ExplorerManagerProvider.js.map +0 -1
  18. package/dist/src/components/ExploreManager/ExplorerManagerProviderWithQueryParams.js.map +0 -1
  19. package/dist/src/components/ExploreManager/index.js.map +0 -1
  20. package/dist/src/components/ExploreManager/query-params.js.map +0 -1
  21. package/dist/src/components/ExploreToolbar/ExploreToolbar.js.map +0 -1
  22. package/dist/src/components/ExploreToolbar/index.js.map +0 -1
  23. package/dist/src/components/index.js.map +0 -1
  24. package/dist/src/index.js.map +0 -1
  25. package/dist/src/test/setup-tests.js.map +0 -1
  26. package/dist/src/views/ViewExplore/ViewExplore.js.map +0 -1
  27. package/dist/src/views/ViewExplore/ViewExploreApp.js.map +0 -1
  28. package/dist/src/views/ViewExplore/index.js.map +0 -1
  29. package/dist/src/views/index.js.map +0 -1
  30. /package/dist/cjs/{src/components → components}/ExploreManager/ExploreManager.js +0 -0
  31. /package/dist/cjs/{src/components → components}/ExploreManager/ExplorerManagerProvider.js +0 -0
  32. /package/dist/cjs/{src/components → components}/ExploreManager/ExplorerManagerProviderWithQueryParams.js +0 -0
  33. /package/dist/cjs/{src/components → components}/ExploreManager/index.js +0 -0
  34. /package/dist/cjs/{src/components → components}/ExploreManager/query-params.js +0 -0
  35. /package/dist/cjs/{src/components → components}/ExploreToolbar/ExploreToolbar.js +0 -0
  36. /package/dist/cjs/{src/components → components}/ExploreToolbar/index.js +0 -0
  37. /package/dist/cjs/{src/components → components}/index.js +0 -0
  38. /package/dist/cjs/{src/index.js → index.js} +0 -0
  39. /package/dist/cjs/{src/test → test}/setup-tests.js +0 -0
  40. /package/dist/cjs/{src/views → views}/ViewExplore/ViewExplore.js +0 -0
  41. /package/dist/cjs/{src/views → views}/ViewExplore/ViewExploreApp.js +0 -0
  42. /package/dist/cjs/{src/views → views}/ViewExplore/index.js +0 -0
  43. /package/dist/cjs/{src/views → views}/index.js +0 -0
  44. /package/dist/{src/components → components}/ExploreManager/ExploreManager.js +0 -0
  45. /package/dist/{src/components → components}/ExploreManager/ExplorerManagerProvider.js +0 -0
  46. /package/dist/{src/components → components}/ExploreManager/ExplorerManagerProviderWithQueryParams.js +0 -0
  47. /package/dist/{src/components → components}/ExploreManager/index.js +0 -0
  48. /package/dist/{src/components → components}/ExploreManager/query-params.js +0 -0
  49. /package/dist/{src/components → components}/ExploreToolbar/ExploreToolbar.js +0 -0
  50. /package/dist/{src/components → components}/ExploreToolbar/index.js +0 -0
  51. /package/dist/{src/components → components}/index.js +0 -0
  52. /package/dist/{src/index.js → index.js} +0 -0
  53. /package/dist/{src/test → test}/setup-tests.js +0 -0
  54. /package/dist/{src/views → views}/ViewExplore/ViewExplore.js +0 -0
  55. /package/dist/{src/views → views}/ViewExplore/ViewExploreApp.js +0 -0
  56. /package/dist/{src/views → views}/ViewExplore/index.js +0 -0
  57. /package/dist/{src/views → views}/index.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ExploreManager/ExploreManager.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, Button, Card, Stack, Tab, Tabs, useMediaQuery } from '@mui/material';\nimport { PluginLoaderComponent, useListPluginMetadata } from '@perses-dev/plugin-system';\nimport { ReactElement, ReactNode, useEffect, useMemo, useState } from 'react';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport ChevronLeft from 'mdi-material-ui/ChevronLeft';\nimport { ExploreToolbar } from '../ExploreToolbar';\nimport { useExplorerManagerContext } from './ExplorerManagerProvider';\n\nexport interface ExploreManagerProps {\n exploreTitleComponent?: ReactNode;\n}\n\nexport function ExploreManager(props: ExploreManagerProps): ReactElement {\n const { exploreTitleComponent } = props;\n const { explorer, setExplorer } = useExplorerManagerContext();\n\n const plugins = useListPluginMetadata(['Explore']);\n\n const isSmallScreen = useMediaQuery('(max-width: 768px)');\n const [isCollapsed, setIsCollapsed] = useState<boolean>(false);\n\n const explorerPluginsMap = useMemo(\n () =>\n Object.fromEntries(plugins.data?.map((plugin) => [`${plugin.module.name}-${plugin.spec.name}`, plugin]) ?? []),\n [plugins.data]\n );\n\n useEffect(() => {\n const plugins = Object.keys(explorerPluginsMap);\n if (!explorer && plugins?.[0]) {\n setExplorer(plugins[0]);\n }\n }, [explorerPluginsMap, explorer, setExplorer]);\n\n const currentPlugin = explorer ? explorerPluginsMap[explorer] : undefined;\n\n if (!explorer) {\n return <div>No explorer plugin available</div>;\n }\n\n return (\n <Stack sx={{ width: '100%' }} px={2} pb={2} pt={1.5} gap={1}>\n <ExploreToolbar exploreTitleComponent={exploreTitleComponent} />\n\n <Stack direction={isSmallScreen ? 'column' : 'row'} gap={2} sx={{ width: '100%' }}>\n <Stack\n sx={{\n borderRight: isSmallScreen ? 0 : 1,\n borderBottom: isSmallScreen ? 1 : 0,\n borderColor: 'divider',\n minWidth: isCollapsed ? 15 : 100,\n }}\n >\n <Box sx={{ position: 'relative', height: 30, display: isSmallScreen ? 'none' : undefined }} test-id=\"qdqwd\">\n <Button\n title={isCollapsed ? 'Expand explorer tabs' : 'Collapse explorer tabs'}\n aria-label={isCollapsed ? 'Expand explorer tabs' : 'Collapse explorer tabs'}\n variant=\"text\"\n sx={{\n position: 'absolute',\n right: -15,\n zIndex: 1,\n padding: 0.5,\n minWidth: 'auto',\n backgroundColor: (theme) => theme.palette.background.default,\n }}\n onClick={() => setIsCollapsed(!isCollapsed)}\n >\n {isCollapsed ? <ChevronRight /> : <ChevronLeft />}\n </Button>\n </Box>\n\n <Tabs\n orientation={isSmallScreen ? 'horizontal' : 'vertical'}\n value={explorer}\n onChange={(_, state) => setExplorer(state)}\n variant={isSmallScreen ? 'fullWidth' : 'scrollable'}\n sx={{\n display: isCollapsed ? 'none' : 'flex',\n }}\n >\n {plugins.data\n ?.sort((a, b) => a.spec.display.name.localeCompare(b.spec.display.name))\n .map((plugin) => (\n <Tab\n key={`${plugin.module.name}-${plugin.spec.name}`}\n value={`${plugin.module.name}-${plugin.spec.name}`}\n label={plugin.spec.display.name}\n sx={{\n padding: 0.5,\n }}\n />\n ))}\n </Tabs>\n </Stack>\n <Card sx={{ padding: '10px', width: '100%' }}>\n {currentPlugin && (\n <PluginLoaderComponent\n key={`${currentPlugin.module.name}-${currentPlugin.spec.name}`}\n plugin={{\n name: currentPlugin.spec.name,\n moduleName: currentPlugin.module.name,\n }}\n />\n )}\n </Card>\n </Stack>\n </Stack>\n );\n}\n"],"names":["Box","Button","Card","Stack","Tab","Tabs","useMediaQuery","PluginLoaderComponent","useListPluginMetadata","useEffect","useMemo","useState","ChevronRight","ChevronLeft","ExploreToolbar","useExplorerManagerContext","ExploreManager","props","exploreTitleComponent","explorer","setExplorer","plugins","isSmallScreen","isCollapsed","setIsCollapsed","explorerPluginsMap","Object","fromEntries","data","map","plugin","module","name","spec","keys","currentPlugin","undefined","div","sx","width","px","pb","pt","gap","direction","borderRight","borderBottom","borderColor","minWidth","position","height","display","test-id","title","aria-label","variant","right","zIndex","padding","backgroundColor","theme","palette","background","default","onClick","orientation","value","onChange","_","state","sort","a","b","localeCompare","label","moduleName"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ExploreManager/ExplorerManagerProvider.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createContext, ReactElement, ReactNode, useContext, useState } from 'react';\n\ninterface ExplorerState<T> {\n explorer?: string;\n data: T;\n // tab: number;\n // queries: QueryDefinition[];\n}\n\ninterface ExplorerManagerContextType<T> {\n /** observability signal, for example metrics or traces */\n explorer?: string;\n data: T;\n setExplorer: (explorer: string) => void;\n setData: (data: T) => void;\n}\n\nconst ExplorerManagerContext = createContext<ExplorerManagerContextType<unknown> | undefined>(undefined);\n\ninterface ExplorerManagerProviderProps {\n children: ReactNode;\n store?: [ExplorerState<unknown>, (state: ExplorerState<unknown>) => void];\n}\n\nexport function ExplorerManagerProvider({\n children,\n store: externalStore,\n}: ExplorerManagerProviderProps): ReactElement {\n // cache the state of currently not rendered explore UIs\n const [explorerStateCache, setExplorerStateCache] = useState<\n Record<string, Omit<ExplorerState<unknown>, 'explorer'>>\n >({});\n // local store in case external store is not provided by prop\n const localStore = useState<ExplorerState<unknown>>({ explorer: undefined, data: {} });\n // use store provided by 'store' prop if available, otherwise use local store\n const [explorerState, setExplorerState] = externalStore ? externalStore : localStore;\n const { explorer, data } = explorerState;\n\n function setExplorer(newExplorer: string): void {\n if (explorer) {\n // store current explorer state\n explorerStateCache[explorer] = { data };\n setExplorerStateCache(explorerStateCache);\n }\n\n // restore previous explorer state (if any)\n const state = explorerStateCache[newExplorer] ?? { data: {} };\n setExplorerState({ explorer: newExplorer, data: state.data });\n }\n\n function setData(newData: unknown): void {\n setExplorerState({ explorer, data: newData });\n }\n\n return (\n <ExplorerManagerContext.Provider value={{ explorer, data, setExplorer, setData }}>\n {children}\n </ExplorerManagerContext.Provider>\n );\n}\n\nexport function useExplorerManagerContext<T>(): ExplorerManagerContextType<T> {\n const ctx = useContext(ExplorerManagerContext);\n if (ctx === undefined) {\n throw new Error('No ExplorerManagerContext found. Did you forget a Provider?');\n }\n return ctx as ExplorerManagerContextType<T>;\n}\n"],"names":["createContext","useContext","useState","ExplorerManagerContext","undefined","ExplorerManagerProvider","children","store","externalStore","explorerStateCache","setExplorerStateCache","localStore","explorer","data","explorerState","setExplorerState","setExplorer","newExplorer","state","setData","newData","Provider","value","useExplorerManagerContext","ctx","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,aAAa,EAA2BC,UAAU,EAAEC,QAAQ,QAAQ,QAAQ;AAiBrF,MAAMC,uCAAyBH,cAA+DI;AAO9F,OAAO,SAASC,wBAAwB,EACtCC,QAAQ,EACRC,OAAOC,aAAa,EACS;IAC7B,wDAAwD;IACxD,MAAM,CAACC,oBAAoBC,sBAAsB,GAAGR,SAElD,CAAC;IACH,6DAA6D;IAC7D,MAAMS,aAAaT,SAAiC;QAAEU,UAAUR;QAAWS,MAAM,CAAC;IAAE;IACpF,6EAA6E;IAC7E,MAAM,CAACC,eAAeC,iBAAiB,GAAGP,gBAAgBA,gBAAgBG;IAC1E,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC;IAE3B,SAASE,YAAYC,WAAmB;QACtC,IAAIL,UAAU;YACZ,+BAA+B;YAC/BH,kBAAkB,CAACG,SAAS,GAAG;gBAAEC;YAAK;YACtCH,sBAAsBD;QACxB;QAEA,2CAA2C;QAC3C,MAAMS,QAAQT,kBAAkB,CAACQ,YAAY,IAAI;YAAEJ,MAAM,CAAC;QAAE;QAC5DE,iBAAiB;YAAEH,UAAUK;YAAaJ,MAAMK,MAAML,IAAI;QAAC;IAC7D;IAEA,SAASM,QAAQC,OAAgB;QAC/BL,iBAAiB;YAAEH;YAAUC,MAAMO;QAAQ;IAC7C;IAEA,qBACE,KAACjB,uBAAuBkB,QAAQ;QAACC,OAAO;YAAEV;YAAUC;YAAMG;YAAaG;QAAQ;kBAC5Eb;;AAGP;AAEA,OAAO,SAASiB;IACd,MAAMC,MAAMvB,WAAWE;IACvB,IAAIqB,QAAQpB,WAAW;QACrB,MAAM,IAAIqB,MAAM;IAClB;IACA,OAAOD;AACT"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ExploreManager/ExplorerManagerProviderWithQueryParams.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React, { ReactElement, ReactNode } from 'react';\n\nimport { JsonParam, StringParam, useQueryParams, withDefault } from 'use-query-params';\nimport { ExplorerManagerProvider } from './ExplorerManagerProvider';\n\nconst exploreQueryConfig = {\n explorer: withDefault(StringParam, undefined),\n data: withDefault(JsonParam, {}),\n};\n\ninterface ExplorerManagerProviderWithQueryParamsProps {\n children: ReactNode;\n}\n\nexport function ExplorerManagerProviderWithQueryParams({\n children,\n}: ExplorerManagerProviderWithQueryParamsProps): ReactElement {\n const [queryParams, setQueryParams] = useQueryParams(exploreQueryConfig);\n\n return <ExplorerManagerProvider store={[queryParams, setQueryParams]}>{children}</ExplorerManagerProvider>;\n}\n"],"names":["React","JsonParam","StringParam","useQueryParams","withDefault","ExplorerManagerProvider","exploreQueryConfig","explorer","undefined","data","ExplorerManagerProviderWithQueryParams","children","queryParams","setQueryParams","store"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,OAAOA,WAAwC,QAAQ;AAEvD,SAASC,SAAS,EAAEC,WAAW,EAAEC,cAAc,EAAEC,WAAW,QAAQ,mBAAmB;AACvF,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE,MAAMC,qBAAqB;IACzBC,UAAUH,YAAYF,aAAaM;IACnCC,MAAML,YAAYH,WAAW,CAAC;AAChC;AAMA,OAAO,SAASS,uCAAuC,EACrDC,QAAQ,EACoC;IAC5C,MAAM,CAACC,aAAaC,eAAe,GAAGV,eAAeG;IAErD,qBAAO,KAACD;QAAwBS,OAAO;YAACF;YAAaC;SAAe;kBAAGF;;AACzE"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ExploreManager/index.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ExploreManager';\nexport * from './ExplorerManagerProvider';\nexport * from './query-params';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB;AACjC,cAAc,4BAA4B;AAC1C,cAAc,iBAAiB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ExploreManager/query-params.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { encodeQueryParams, JsonParam, StringParam, useQueryParams } from 'use-query-params';\nimport { TimeRangeParam } from '@perses-dev/plugin-system';\nimport { stringify } from 'qs';\n\nexport const explorerQueryConfig = {\n refresh: TimeRangeParam,\n start: TimeRangeParam,\n end: TimeRangeParam,\n explorer: StringParam,\n data: JsonParam,\n};\n\ninterface ExplorerQueryData {\n refresh?: Date;\n start?: Date;\n end?: Date;\n explorer?: string;\n data?: Record<string, unknown>;\n}\n\n// Provide a query string for the explorer page using the given inputs, but also including any existing query params\nexport function useExplorerQueryParams(inputs: ExplorerQueryData): string {\n const [query] = useQueryParams(explorerQueryConfig, { updateType: 'replaceIn' });\n return stringify(encodeQueryParams(explorerQueryConfig, { ...query, ...inputs }));\n}\n"],"names":["encodeQueryParams","JsonParam","StringParam","useQueryParams","TimeRangeParam","stringify","explorerQueryConfig","refresh","start","end","explorer","data","useExplorerQueryParams","inputs","query","updateType"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,iBAAiB,EAAEC,SAAS,EAAEC,WAAW,EAAEC,cAAc,QAAQ,mBAAmB;AAC7F,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,SAAS,QAAQ,KAAK;AAE/B,OAAO,MAAMC,sBAAsB;IACjCC,SAASH;IACTI,OAAOJ;IACPK,KAAKL;IACLM,UAAUR;IACVS,MAAMV;AACR,EAAE;AAUF,oHAAoH;AACpH,OAAO,SAASW,uBAAuBC,MAAyB;IAC9D,MAAM,CAACC,MAAM,GAAGX,eAAeG,qBAAqB;QAAES,YAAY;IAAY;IAC9E,OAAOV,UAAUL,kBAAkBM,qBAAqB;QAAE,GAAGQ,KAAK;QAAE,GAAGD,MAAM;IAAC;AAChF"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ExploreToolbar/ExploreToolbar.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, Box, useTheme, useMediaQuery } from '@mui/material';\nimport { TimeRangeControls } from '@perses-dev/plugin-system';\nimport React, { ReactElement } from 'react';\n\nexport interface ExploreToolbarProps {\n exploreTitleComponent?: React.ReactNode;\n}\n\nexport const ExploreToolbar = (props: ExploreToolbarProps): ReactElement => {\n const { exploreTitleComponent } = props;\n\n const isBiggerThanLg = useMediaQuery(useTheme().breakpoints.up('lg'));\n\n const testId = 'explore-toolbar';\n\n return (\n <Stack data-testid={testId}>\n <Box sx={{ display: 'flex', width: '100%' }}>\n {exploreTitleComponent}\n <Stack\n direction=\"row\"\n spacing={1}\n ml=\"auto\"\n flexWrap={isBiggerThanLg ? 'nowrap' : 'wrap-reverse'}\n justifyContent=\"end\"\n >\n <TimeRangeControls />\n </Stack>\n </Box>\n </Stack>\n );\n};\n"],"names":["Stack","Box","useTheme","useMediaQuery","TimeRangeControls","React","ExploreToolbar","props","exploreTitleComponent","isBiggerThanLg","breakpoints","up","testId","data-testid","sx","display","width","direction","spacing","ml","flexWrap","justifyContent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,KAAK,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,gBAAgB;AACpE,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,OAAOC,WAA6B,QAAQ;AAM5C,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,qBAAqB,EAAE,GAAGD;IAElC,MAAME,iBAAiBN,cAAcD,WAAWQ,WAAW,CAACC,EAAE,CAAC;IAE/D,MAAMC,SAAS;IAEf,qBACE,KAACZ;QAAMa,eAAaD;kBAClB,cAAA,MAACX;YAAIa,IAAI;gBAAEC,SAAS;gBAAQC,OAAO;YAAO;;gBACvCR;8BACD,KAACR;oBACCiB,WAAU;oBACVC,SAAS;oBACTC,IAAG;oBACHC,UAAUX,iBAAiB,WAAW;oBACtCY,gBAAe;8BAEf,cAAA,KAACjB;;;;;AAKX,EAAE"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ExploreToolbar/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ExploreToolbar';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ExploreManager';\nexport * from './ExploreToolbar';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB;AACjC,cAAc,mBAAmB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './views';\nexport * from './components';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,UAAU;AACxB,cAAc,eAAe"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/test/setup-tests.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { defaultFallbackInView } from 'react-intersection-observer';\n\n// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n\n// Tell react-intersection-observer that everything should be considered in-view for tests (see package documentation\n// for other options)\ndefaultFallbackInView(true);\n"],"names":["defaultFallbackInView","jest","mock"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,qBAAqB,QAAQ,8BAA8B;AAEpE,iCAAiC;AACjC,OAAO,0CAA0C;AAEjD,iFAAiF;AACjFC,KAAKC,IAAI,CAAC;AAEV,qHAAqH;AACrH,qBAAqB;AACrBF,sBAAsB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/views/ViewExplore/ViewExplore.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport {\n TimeRangeProviderWithQueryParams,\n useInitialRefreshInterval,\n useInitialTimeRange,\n} from '@perses-dev/plugin-system';\nimport { DEFAULT_DASHBOARD_DURATION, DEFAULT_REFRESH_INTERVAL } from '@perses-dev/core';\nimport { ErrorAlert, ErrorBoundary, combineSx } from '@perses-dev/components';\nimport {\n DatasourceStoreProviderProps,\n VariableProviderProps,\n DatasourceStoreProvider,\n VariableProvider,\n} from '@perses-dev/dashboards';\nimport React, { ReactElement } from 'react';\nimport { ViewExploreApp } from './ViewExploreApp';\n\nexport interface ViewExploreProps extends Omit<BoxProps, 'children'> {\n datasourceApi: DatasourceStoreProviderProps['datasourceApi'];\n externalVariableDefinitions?: VariableProviderProps['externalVariableDefinitions'];\n exploreTitleComponent?: React.ReactNode;\n}\n\nexport function ViewExplore(props: ViewExploreProps): ReactElement {\n const { datasourceApi, externalVariableDefinitions, sx, exploreTitleComponent, ...others } = props;\n\n const initialTimeRange = useInitialTimeRange(DEFAULT_DASHBOARD_DURATION);\n const initialRefreshInterval = useInitialRefreshInterval(DEFAULT_REFRESH_INTERVAL);\n\n return (\n <DatasourceStoreProvider datasourceApi={datasourceApi}>\n <TimeRangeProviderWithQueryParams\n initialTimeRange={initialTimeRange}\n initialRefreshInterval={initialRefreshInterval}\n >\n <VariableProvider externalVariableDefinitions={externalVariableDefinitions}>\n <Box\n sx={combineSx(\n {\n display: 'flex',\n width: '100%',\n height: '100%',\n position: 'relative',\n overflow: 'hidden',\n },\n sx\n )}\n {...others}\n >\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <ViewExploreApp exploreTitleComponent={exploreTitleComponent} />\n </ErrorBoundary>\n </Box>\n </VariableProvider>\n </TimeRangeProviderWithQueryParams>\n </DatasourceStoreProvider>\n );\n}\n"],"names":["Box","TimeRangeProviderWithQueryParams","useInitialRefreshInterval","useInitialTimeRange","DEFAULT_DASHBOARD_DURATION","DEFAULT_REFRESH_INTERVAL","ErrorAlert","ErrorBoundary","combineSx","DatasourceStoreProvider","VariableProvider","React","ViewExploreApp","ViewExplore","props","datasourceApi","externalVariableDefinitions","sx","exploreTitleComponent","others","initialTimeRange","initialRefreshInterval","display","width","height","position","overflow","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;AAC9C,SACEC,gCAAgC,EAChCC,yBAAyB,EACzBC,mBAAmB,QACd,4BAA4B;AACnC,SAASC,0BAA0B,EAAEC,wBAAwB,QAAQ,mBAAmB;AACxF,SAASC,UAAU,EAAEC,aAAa,EAAEC,SAAS,QAAQ,yBAAyB;AAC9E,SAGEC,uBAAuB,EACvBC,gBAAgB,QACX,yBAAyB;AAChC,OAAOC,WAA6B,QAAQ;AAC5C,SAASC,cAAc,QAAQ,mBAAmB;AAQlD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,aAAa,EAAEC,2BAA2B,EAAEC,EAAE,EAAEC,qBAAqB,EAAE,GAAGC,QAAQ,GAAGL;IAE7F,MAAMM,mBAAmBjB,oBAAoBC;IAC7C,MAAMiB,yBAAyBnB,0BAA0BG;IAEzD,qBACE,KAACI;QAAwBM,eAAeA;kBACtC,cAAA,KAACd;YACCmB,kBAAkBA;YAClBC,wBAAwBA;sBAExB,cAAA,KAACX;gBAAiBM,6BAA6BA;0BAC7C,cAAA,KAAChB;oBACCiB,IAAIT,UACF;wBACEc,SAAS;wBACTC,OAAO;wBACPC,QAAQ;wBACRC,UAAU;wBACVC,UAAU;oBACZ,GACAT;oBAED,GAAGE,MAAM;8BAEV,cAAA,KAACZ;wBAAcoB,mBAAmBrB;kCAChC,cAAA,KAACM;4BAAeM,uBAAuBA;;;;;;;AAOrD"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/views/ViewExplore/ViewExploreApp.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { ChartsProvider, useChartsTheme } from '@perses-dev/components';\nimport { ReactElement, ReactNode } from 'react';\nimport { ExploreManager } from '../../components';\nimport { ExplorerManagerProviderWithQueryParams } from '../../components/ExploreManager/ExplorerManagerProviderWithQueryParams';\n\nexport interface ViewAppProps {\n exploreTitleComponent?: ReactNode;\n}\n\nexport function ViewExploreApp(props: ViewAppProps): ReactElement {\n const { exploreTitleComponent } = props;\n\n const chartsTheme = useChartsTheme();\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n overflowX: 'hidden',\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <ChartsProvider chartsTheme={chartsTheme} enablePinning={false}>\n <ExplorerManagerProviderWithQueryParams>\n <ExploreManager exploreTitleComponent={exploreTitleComponent} />\n </ExplorerManagerProviderWithQueryParams>\n </ChartsProvider>\n </Box>\n );\n}\n"],"names":["Box","ChartsProvider","useChartsTheme","ExploreManager","ExplorerManagerProviderWithQueryParams","ViewExploreApp","props","exploreTitleComponent","chartsTheme","sx","flexGrow","overflowX","overflowY","display","flexDirection","enablePinning"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,EAAEC,cAAc,QAAQ,yBAAyB;AAExE,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,sCAAsC,QAAQ,yEAAyE;AAMhI,OAAO,SAASC,eAAeC,KAAmB;IAChD,MAAM,EAAEC,qBAAqB,EAAE,GAAGD;IAElC,MAAME,cAAcN;IAEpB,qBACE,KAACF;QACCS,IAAI;YACFC,UAAU;YACVC,WAAW;YACXC,WAAW;YACXC,SAAS;YACTC,eAAe;QACjB;kBAEA,cAAA,KAACb;YAAeO,aAAaA;YAAaO,eAAe;sBACvD,cAAA,KAACX;0BACC,cAAA,KAACD;oBAAeI,uBAAuBA;;;;;AAKjD"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/views/ViewExplore/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ViewExplore';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,gBAAgB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/views/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ViewExplore';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,gBAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/explore",
3
- "version": "0.52.0-beta.2",
3
+ "version": "0.52.0-beta.3",
4
4
  "description": "The explore feature in Perses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -18,8 +18,8 @@
18
18
  "scripts": {
19
19
  "clean": "rimraf dist/",
20
20
  "build": "concurrently \"npm:build:*\"",
21
- "build:cjs": "swc ./src -d dist/cjs --config-file ../.cjs.swcrc",
22
- "build:esm": "swc ./src -d dist --config-file ../.swcrc",
21
+ "build:cjs": "swc ./src -d dist/cjs --strip-leading-paths --config-file ../.cjs.swcrc",
22
+ "build:esm": "swc ./src -d dist --strip-leading-paths --config-file ../.swcrc",
23
23
  "build:types": "tsc --project tsconfig.build.json",
24
24
  "type-check": "tsc --noEmit",
25
25
  "start": "concurrently -P \"npm:build:* -- {*}\" -- --watch",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@nexucis/fuzzy": "^0.5.1",
31
- "@perses-dev/components": "0.52.0-beta.2",
32
- "@perses-dev/core": "0.52.0-beta.2",
33
- "@perses-dev/dashboards": "0.52.0-beta.2",
34
- "@perses-dev/plugin-system": "0.52.0-beta.2",
31
+ "@perses-dev/components": "0.52.0-beta.3",
32
+ "@perses-dev/core": "0.52.0-beta.3",
33
+ "@perses-dev/dashboards": "0.52.0-beta.3",
34
+ "@perses-dev/plugin-system": "0.52.0-beta.3",
35
35
  "@types/react-grid-layout": "^1.3.2",
36
36
  "date-fns": "^4.1.0",
37
37
  "immer": "^10.1.1",
@@ -47,7 +47,7 @@
47
47
  "zustand": "^4.3.3"
48
48
  },
49
49
  "devDependencies": {
50
- "@perses-dev/internal-utils": "0.52.0-beta.2",
50
+ "@perses-dev/internal-utils": "0.52.0-beta.3",
51
51
  "history": "^5.3.0",
52
52
  "intersection-observer": "^0.12.2",
53
53
  "react-router-dom": "^6.11.0"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/ExploreManager/ExploreManager.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, Button, Card, Stack, Tab, Tabs, useMediaQuery } from '@mui/material';\nimport { PluginLoaderComponent, useListPluginMetadata } from '@perses-dev/plugin-system';\nimport { ReactElement, ReactNode, useEffect, useMemo, useState } from 'react';\nimport ChevronRight from 'mdi-material-ui/ChevronRight';\nimport ChevronLeft from 'mdi-material-ui/ChevronLeft';\nimport { ExploreToolbar } from '../ExploreToolbar';\nimport { useExplorerManagerContext } from './ExplorerManagerProvider';\n\nexport interface ExploreManagerProps {\n exploreTitleComponent?: ReactNode;\n}\n\nexport function ExploreManager(props: ExploreManagerProps): ReactElement {\n const { exploreTitleComponent } = props;\n const { explorer, setExplorer } = useExplorerManagerContext();\n\n const plugins = useListPluginMetadata(['Explore']);\n\n const isSmallScreen = useMediaQuery('(max-width: 768px)');\n const [isCollapsed, setIsCollapsed] = useState<boolean>(false);\n\n const explorerPluginsMap = useMemo(\n () =>\n Object.fromEntries(plugins.data?.map((plugin) => [`${plugin.module.name}-${plugin.spec.name}`, plugin]) ?? []),\n [plugins.data]\n );\n\n useEffect(() => {\n const plugins = Object.keys(explorerPluginsMap);\n if (!explorer && plugins?.[0]) {\n setExplorer(plugins[0]);\n }\n }, [explorerPluginsMap, explorer, setExplorer]);\n\n const currentPlugin = explorer ? explorerPluginsMap[explorer] : undefined;\n\n if (!explorer) {\n return <div>No explorer plugin available</div>;\n }\n\n return (\n <Stack sx={{ width: '100%' }} px={2} pb={2} pt={1.5} gap={1}>\n <ExploreToolbar exploreTitleComponent={exploreTitleComponent} />\n\n <Stack direction={isSmallScreen ? 'column' : 'row'} gap={2} sx={{ width: '100%' }}>\n <Stack\n sx={{\n borderRight: isSmallScreen ? 0 : 1,\n borderBottom: isSmallScreen ? 1 : 0,\n borderColor: 'divider',\n minWidth: isCollapsed ? 15 : 100,\n }}\n >\n <Box sx={{ position: 'relative', height: 30, display: isSmallScreen ? 'none' : undefined }} test-id=\"qdqwd\">\n <Button\n title={isCollapsed ? 'Expand explorer tabs' : 'Collapse explorer tabs'}\n aria-label={isCollapsed ? 'Expand explorer tabs' : 'Collapse explorer tabs'}\n variant=\"text\"\n sx={{\n position: 'absolute',\n right: -15,\n zIndex: 1,\n padding: 0.5,\n minWidth: 'auto',\n backgroundColor: (theme) => theme.palette.background.default,\n }}\n onClick={() => setIsCollapsed(!isCollapsed)}\n >\n {isCollapsed ? <ChevronRight /> : <ChevronLeft />}\n </Button>\n </Box>\n\n <Tabs\n orientation={isSmallScreen ? 'horizontal' : 'vertical'}\n value={explorer}\n onChange={(_, state) => setExplorer(state)}\n variant={isSmallScreen ? 'fullWidth' : 'scrollable'}\n sx={{\n display: isCollapsed ? 'none' : 'flex',\n }}\n >\n {plugins.data\n ?.sort((a, b) => a.spec.display.name.localeCompare(b.spec.display.name))\n .map((plugin) => (\n <Tab\n key={`${plugin.module.name}-${plugin.spec.name}`}\n value={`${plugin.module.name}-${plugin.spec.name}`}\n label={plugin.spec.display.name}\n sx={{\n padding: 0.5,\n }}\n />\n ))}\n </Tabs>\n </Stack>\n <Card sx={{ padding: '10px', width: '100%' }}>\n {currentPlugin && (\n <PluginLoaderComponent\n key={`${currentPlugin.module.name}-${currentPlugin.spec.name}`}\n plugin={{\n name: currentPlugin.spec.name,\n moduleName: currentPlugin.module.name,\n }}\n />\n )}\n </Card>\n </Stack>\n </Stack>\n );\n}\n"],"names":["Box","Button","Card","Stack","Tab","Tabs","useMediaQuery","PluginLoaderComponent","useListPluginMetadata","useEffect","useMemo","useState","ChevronRight","ChevronLeft","ExploreToolbar","useExplorerManagerContext","ExploreManager","props","exploreTitleComponent","explorer","setExplorer","plugins","isSmallScreen","isCollapsed","setIsCollapsed","explorerPluginsMap","Object","fromEntries","data","map","plugin","module","name","spec","keys","currentPlugin","undefined","div","sx","width","px","pb","pt","gap","direction","borderRight","borderBottom","borderColor","minWidth","position","height","display","test-id","title","aria-label","variant","right","zIndex","padding","backgroundColor","theme","palette","background","default","onClick","orientation","value","onChange","_","state","sort","a","b","localeCompare","label","moduleName"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/ExploreManager/ExplorerManagerProvider.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createContext, ReactElement, ReactNode, useContext, useState } from 'react';\n\ninterface ExplorerState<T> {\n explorer?: string;\n data: T;\n // tab: number;\n // queries: QueryDefinition[];\n}\n\ninterface ExplorerManagerContextType<T> {\n /** observability signal, for example metrics or traces */\n explorer?: string;\n data: T;\n setExplorer: (explorer: string) => void;\n setData: (data: T) => void;\n}\n\nconst ExplorerManagerContext = createContext<ExplorerManagerContextType<unknown> | undefined>(undefined);\n\ninterface ExplorerManagerProviderProps {\n children: ReactNode;\n store?: [ExplorerState<unknown>, (state: ExplorerState<unknown>) => void];\n}\n\nexport function ExplorerManagerProvider({\n children,\n store: externalStore,\n}: ExplorerManagerProviderProps): ReactElement {\n // cache the state of currently not rendered explore UIs\n const [explorerStateCache, setExplorerStateCache] = useState<\n Record<string, Omit<ExplorerState<unknown>, 'explorer'>>\n >({});\n // local store in case external store is not provided by prop\n const localStore = useState<ExplorerState<unknown>>({ explorer: undefined, data: {} });\n // use store provided by 'store' prop if available, otherwise use local store\n const [explorerState, setExplorerState] = externalStore ? externalStore : localStore;\n const { explorer, data } = explorerState;\n\n function setExplorer(newExplorer: string): void {\n if (explorer) {\n // store current explorer state\n explorerStateCache[explorer] = { data };\n setExplorerStateCache(explorerStateCache);\n }\n\n // restore previous explorer state (if any)\n const state = explorerStateCache[newExplorer] ?? { data: {} };\n setExplorerState({ explorer: newExplorer, data: state.data });\n }\n\n function setData(newData: unknown): void {\n setExplorerState({ explorer, data: newData });\n }\n\n return (\n <ExplorerManagerContext.Provider value={{ explorer, data, setExplorer, setData }}>\n {children}\n </ExplorerManagerContext.Provider>\n );\n}\n\nexport function useExplorerManagerContext<T>(): ExplorerManagerContextType<T> {\n const ctx = useContext(ExplorerManagerContext);\n if (ctx === undefined) {\n throw new Error('No ExplorerManagerContext found. Did you forget a Provider?');\n }\n return ctx as ExplorerManagerContextType<T>;\n}\n"],"names":["createContext","useContext","useState","ExplorerManagerContext","undefined","ExplorerManagerProvider","children","store","externalStore","explorerStateCache","setExplorerStateCache","localStore","explorer","data","explorerState","setExplorerState","setExplorer","newExplorer","state","setData","newData","Provider","value","useExplorerManagerContext","ctx","Error"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,aAAa,EAA2BC,UAAU,EAAEC,QAAQ,QAAQ,QAAQ;AAiBrF,MAAMC,uCAAyBH,cAA+DI;AAO9F,OAAO,SAASC,wBAAwB,EACtCC,QAAQ,EACRC,OAAOC,aAAa,EACS;IAC7B,wDAAwD;IACxD,MAAM,CAACC,oBAAoBC,sBAAsB,GAAGR,SAElD,CAAC;IACH,6DAA6D;IAC7D,MAAMS,aAAaT,SAAiC;QAAEU,UAAUR;QAAWS,MAAM,CAAC;IAAE;IACpF,6EAA6E;IAC7E,MAAM,CAACC,eAAeC,iBAAiB,GAAGP,gBAAgBA,gBAAgBG;IAC1E,MAAM,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGC;IAE3B,SAASE,YAAYC,WAAmB;QACtC,IAAIL,UAAU;YACZ,+BAA+B;YAC/BH,kBAAkB,CAACG,SAAS,GAAG;gBAAEC;YAAK;YACtCH,sBAAsBD;QACxB;QAEA,2CAA2C;QAC3C,MAAMS,QAAQT,kBAAkB,CAACQ,YAAY,IAAI;YAAEJ,MAAM,CAAC;QAAE;QAC5DE,iBAAiB;YAAEH,UAAUK;YAAaJ,MAAMK,MAAML,IAAI;QAAC;IAC7D;IAEA,SAASM,QAAQC,OAAgB;QAC/BL,iBAAiB;YAAEH;YAAUC,MAAMO;QAAQ;IAC7C;IAEA,qBACE,KAACjB,uBAAuBkB,QAAQ;QAACC,OAAO;YAAEV;YAAUC;YAAMG;YAAaG;QAAQ;kBAC5Eb;;AAGP;AAEA,OAAO,SAASiB;IACd,MAAMC,MAAMvB,WAAWE;IACvB,IAAIqB,QAAQpB,WAAW;QACrB,MAAM,IAAIqB,MAAM;IAClB;IACA,OAAOD;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/ExploreManager/ExplorerManagerProviderWithQueryParams.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport React, { ReactElement, ReactNode } from 'react';\n\nimport { JsonParam, StringParam, useQueryParams, withDefault } from 'use-query-params';\nimport { ExplorerManagerProvider } from './ExplorerManagerProvider';\n\nconst exploreQueryConfig = {\n explorer: withDefault(StringParam, undefined),\n data: withDefault(JsonParam, {}),\n};\n\ninterface ExplorerManagerProviderWithQueryParamsProps {\n children: ReactNode;\n}\n\nexport function ExplorerManagerProviderWithQueryParams({\n children,\n}: ExplorerManagerProviderWithQueryParamsProps): ReactElement {\n const [queryParams, setQueryParams] = useQueryParams(exploreQueryConfig);\n\n return <ExplorerManagerProvider store={[queryParams, setQueryParams]}>{children}</ExplorerManagerProvider>;\n}\n"],"names":["React","JsonParam","StringParam","useQueryParams","withDefault","ExplorerManagerProvider","exploreQueryConfig","explorer","undefined","data","ExplorerManagerProviderWithQueryParams","children","queryParams","setQueryParams","store"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,OAAOA,WAAwC,QAAQ;AAEvD,SAASC,SAAS,EAAEC,WAAW,EAAEC,cAAc,EAAEC,WAAW,QAAQ,mBAAmB;AACvF,SAASC,uBAAuB,QAAQ,4BAA4B;AAEpE,MAAMC,qBAAqB;IACzBC,UAAUH,YAAYF,aAAaM;IACnCC,MAAML,YAAYH,WAAW,CAAC;AAChC;AAMA,OAAO,SAASS,uCAAuC,EACrDC,QAAQ,EACoC;IAC5C,MAAM,CAACC,aAAaC,eAAe,GAAGV,eAAeG;IAErD,qBAAO,KAACD;QAAwBS,OAAO;YAACF;YAAaC;SAAe;kBAAGF;;AACzE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/ExploreManager/index.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ExploreManager';\nexport * from './ExplorerManagerProvider';\nexport * from './query-params';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB;AACjC,cAAc,4BAA4B;AAC1C,cAAc,iBAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/ExploreManager/query-params.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { encodeQueryParams, JsonParam, StringParam, useQueryParams } from 'use-query-params';\nimport { TimeRangeParam } from '@perses-dev/plugin-system';\nimport { stringify } from 'qs';\n\nexport const explorerQueryConfig = {\n refresh: TimeRangeParam,\n start: TimeRangeParam,\n end: TimeRangeParam,\n explorer: StringParam,\n data: JsonParam,\n};\n\ninterface ExplorerQueryData {\n refresh?: Date;\n start?: Date;\n end?: Date;\n explorer?: string;\n data?: Record<string, unknown>;\n}\n\n// Provide a query string for the explorer page using the given inputs, but also including any existing query params\nexport function useExplorerQueryParams(inputs: ExplorerQueryData): string {\n const [query] = useQueryParams(explorerQueryConfig, { updateType: 'replaceIn' });\n return stringify(encodeQueryParams(explorerQueryConfig, { ...query, ...inputs }));\n}\n"],"names":["encodeQueryParams","JsonParam","StringParam","useQueryParams","TimeRangeParam","stringify","explorerQueryConfig","refresh","start","end","explorer","data","useExplorerQueryParams","inputs","query","updateType"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,iBAAiB,EAAEC,SAAS,EAAEC,WAAW,EAAEC,cAAc,QAAQ,mBAAmB;AAC7F,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,SAAS,QAAQ,KAAK;AAE/B,OAAO,MAAMC,sBAAsB;IACjCC,SAASH;IACTI,OAAOJ;IACPK,KAAKL;IACLM,UAAUR;IACVS,MAAMV;AACR,EAAE;AAUF,oHAAoH;AACpH,OAAO,SAASW,uBAAuBC,MAAyB;IAC9D,MAAM,CAACC,MAAM,GAAGX,eAAeG,qBAAqB;QAAES,YAAY;IAAY;IAC9E,OAAOV,UAAUL,kBAAkBM,qBAAqB;QAAE,GAAGQ,KAAK;QAAE,GAAGD,MAAM;IAAC;AAChF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/ExploreToolbar/ExploreToolbar.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Stack, Box, useTheme, useMediaQuery } from '@mui/material';\nimport { TimeRangeControls } from '@perses-dev/plugin-system';\nimport React, { ReactElement } from 'react';\n\nexport interface ExploreToolbarProps {\n exploreTitleComponent?: React.ReactNode;\n}\n\nexport const ExploreToolbar = (props: ExploreToolbarProps): ReactElement => {\n const { exploreTitleComponent } = props;\n\n const isBiggerThanLg = useMediaQuery(useTheme().breakpoints.up('lg'));\n\n const testId = 'explore-toolbar';\n\n return (\n <Stack data-testid={testId}>\n <Box sx={{ display: 'flex', width: '100%' }}>\n {exploreTitleComponent}\n <Stack\n direction=\"row\"\n spacing={1}\n ml=\"auto\"\n flexWrap={isBiggerThanLg ? 'nowrap' : 'wrap-reverse'}\n justifyContent=\"end\"\n >\n <TimeRangeControls />\n </Stack>\n </Box>\n </Stack>\n );\n};\n"],"names":["Stack","Box","useTheme","useMediaQuery","TimeRangeControls","React","ExploreToolbar","props","exploreTitleComponent","isBiggerThanLg","breakpoints","up","testId","data-testid","sx","display","width","direction","spacing","ml","flexWrap","justifyContent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,KAAK,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,aAAa,QAAQ,gBAAgB;AACpE,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,OAAOC,WAA6B,QAAQ;AAM5C,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,qBAAqB,EAAE,GAAGD;IAElC,MAAME,iBAAiBN,cAAcD,WAAWQ,WAAW,CAACC,EAAE,CAAC;IAE/D,MAAMC,SAAS;IAEf,qBACE,KAACZ;QAAMa,eAAaD;kBAClB,cAAA,MAACX;YAAIa,IAAI;gBAAEC,SAAS;gBAAQC,OAAO;YAAO;;gBACvCR;8BACD,KAACR;oBACCiB,WAAU;oBACVC,SAAS;oBACTC,IAAG;oBACHC,UAAUX,iBAAiB,WAAW;oBACtCY,gBAAe;8BAEf,cAAA,KAACjB;;;;;AAKX,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/components/ExploreToolbar/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ExploreToolbar';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/index.ts"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ExploreManager';\nexport * from './ExploreToolbar';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,mBAAmB;AACjC,cAAc,mBAAmB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './views';\nexport * from './components';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,UAAU;AACxB,cAAc,eAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/test/setup-tests.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { defaultFallbackInView } from 'react-intersection-observer';\n\n// Add testing library assertions\nimport '@testing-library/jest-dom/extend-expect';\n\n// Always mock e-charts during tests since we don't have a proper canvas in jsdom\njest.mock('echarts/core');\n\n// Tell react-intersection-observer that everything should be considered in-view for tests (see package documentation\n// for other options)\ndefaultFallbackInView(true);\n"],"names":["defaultFallbackInView","jest","mock"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,qBAAqB,QAAQ,8BAA8B;AAEpE,iCAAiC;AACjC,OAAO,0CAA0C;AAEjD,iFAAiF;AACjFC,KAAKC,IAAI,CAAC;AAEV,qHAAqH;AACrH,qBAAqB;AACrBF,sBAAsB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/views/ViewExplore/ViewExplore.tsx"],"sourcesContent":["// Copyright 2024 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, BoxProps } from '@mui/material';\nimport {\n TimeRangeProviderWithQueryParams,\n useInitialRefreshInterval,\n useInitialTimeRange,\n} from '@perses-dev/plugin-system';\nimport { DEFAULT_DASHBOARD_DURATION, DEFAULT_REFRESH_INTERVAL } from '@perses-dev/core';\nimport { ErrorAlert, ErrorBoundary, combineSx } from '@perses-dev/components';\nimport {\n DatasourceStoreProviderProps,\n VariableProviderProps,\n DatasourceStoreProvider,\n VariableProvider,\n} from '@perses-dev/dashboards';\nimport React, { ReactElement } from 'react';\nimport { ViewExploreApp } from './ViewExploreApp';\n\nexport interface ViewExploreProps extends Omit<BoxProps, 'children'> {\n datasourceApi: DatasourceStoreProviderProps['datasourceApi'];\n externalVariableDefinitions?: VariableProviderProps['externalVariableDefinitions'];\n exploreTitleComponent?: React.ReactNode;\n}\n\nexport function ViewExplore(props: ViewExploreProps): ReactElement {\n const { datasourceApi, externalVariableDefinitions, sx, exploreTitleComponent, ...others } = props;\n\n const initialTimeRange = useInitialTimeRange(DEFAULT_DASHBOARD_DURATION);\n const initialRefreshInterval = useInitialRefreshInterval(DEFAULT_REFRESH_INTERVAL);\n\n return (\n <DatasourceStoreProvider datasourceApi={datasourceApi}>\n <TimeRangeProviderWithQueryParams\n initialTimeRange={initialTimeRange}\n initialRefreshInterval={initialRefreshInterval}\n >\n <VariableProvider externalVariableDefinitions={externalVariableDefinitions}>\n <Box\n sx={combineSx(\n {\n display: 'flex',\n width: '100%',\n height: '100%',\n position: 'relative',\n overflow: 'hidden',\n },\n sx\n )}\n {...others}\n >\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <ViewExploreApp exploreTitleComponent={exploreTitleComponent} />\n </ErrorBoundary>\n </Box>\n </VariableProvider>\n </TimeRangeProviderWithQueryParams>\n </DatasourceStoreProvider>\n );\n}\n"],"names":["Box","TimeRangeProviderWithQueryParams","useInitialRefreshInterval","useInitialTimeRange","DEFAULT_DASHBOARD_DURATION","DEFAULT_REFRESH_INTERVAL","ErrorAlert","ErrorBoundary","combineSx","DatasourceStoreProvider","VariableProvider","React","ViewExploreApp","ViewExplore","props","datasourceApi","externalVariableDefinitions","sx","exploreTitleComponent","others","initialTimeRange","initialRefreshInterval","display","width","height","position","overflow","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAkB,gBAAgB;AAC9C,SACEC,gCAAgC,EAChCC,yBAAyB,EACzBC,mBAAmB,QACd,4BAA4B;AACnC,SAASC,0BAA0B,EAAEC,wBAAwB,QAAQ,mBAAmB;AACxF,SAASC,UAAU,EAAEC,aAAa,EAAEC,SAAS,QAAQ,yBAAyB;AAC9E,SAGEC,uBAAuB,EACvBC,gBAAgB,QACX,yBAAyB;AAChC,OAAOC,WAA6B,QAAQ;AAC5C,SAASC,cAAc,QAAQ,mBAAmB;AAQlD,OAAO,SAASC,YAAYC,KAAuB;IACjD,MAAM,EAAEC,aAAa,EAAEC,2BAA2B,EAAEC,EAAE,EAAEC,qBAAqB,EAAE,GAAGC,QAAQ,GAAGL;IAE7F,MAAMM,mBAAmBjB,oBAAoBC;IAC7C,MAAMiB,yBAAyBnB,0BAA0BG;IAEzD,qBACE,KAACI;QAAwBM,eAAeA;kBACtC,cAAA,KAACd;YACCmB,kBAAkBA;YAClBC,wBAAwBA;sBAExB,cAAA,KAACX;gBAAiBM,6BAA6BA;0BAC7C,cAAA,KAAChB;oBACCiB,IAAIT,UACF;wBACEc,SAAS;wBACTC,OAAO;wBACPC,QAAQ;wBACRC,UAAU;wBACVC,UAAU;oBACZ,GACAT;oBAED,GAAGE,MAAM;8BAEV,cAAA,KAACZ;wBAAcoB,mBAAmBrB;kCAChC,cAAA,KAACM;4BAAeM,uBAAuBA;;;;;;;AAOrD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/views/ViewExplore/ViewExploreApp.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box } from '@mui/material';\nimport { ChartsProvider, useChartsTheme } from '@perses-dev/components';\nimport { ReactElement, ReactNode } from 'react';\nimport { ExploreManager } from '../../components';\nimport { ExplorerManagerProviderWithQueryParams } from '../../components/ExploreManager/ExplorerManagerProviderWithQueryParams';\n\nexport interface ViewAppProps {\n exploreTitleComponent?: ReactNode;\n}\n\nexport function ViewExploreApp(props: ViewAppProps): ReactElement {\n const { exploreTitleComponent } = props;\n\n const chartsTheme = useChartsTheme();\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n overflowX: 'hidden',\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <ChartsProvider chartsTheme={chartsTheme} enablePinning={false}>\n <ExplorerManagerProviderWithQueryParams>\n <ExploreManager exploreTitleComponent={exploreTitleComponent} />\n </ExplorerManagerProviderWithQueryParams>\n </ChartsProvider>\n </Box>\n );\n}\n"],"names":["Box","ChartsProvider","useChartsTheme","ExploreManager","ExplorerManagerProviderWithQueryParams","ViewExploreApp","props","exploreTitleComponent","chartsTheme","sx","flexGrow","overflowX","overflowY","display","flexDirection","enablePinning"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,GAAG,QAAQ,gBAAgB;AACpC,SAASC,cAAc,EAAEC,cAAc,QAAQ,yBAAyB;AAExE,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,sCAAsC,QAAQ,yEAAyE;AAMhI,OAAO,SAASC,eAAeC,KAAmB;IAChD,MAAM,EAAEC,qBAAqB,EAAE,GAAGD;IAElC,MAAME,cAAcN;IAEpB,qBACE,KAACF;QACCS,IAAI;YACFC,UAAU;YACVC,WAAW;YACXC,WAAW;YACXC,SAAS;YACTC,eAAe;QACjB;kBAEA,cAAA,KAACb;YAAeO,aAAaA;YAAaO,eAAe;sBACvD,cAAA,KAACX;0BACC,cAAA,KAACD;oBAAeI,uBAAuBA;;;;;AAKjD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/views/ViewExplore/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ViewExplore';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,gBAAgB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/views/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './ViewExplore';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,gBAAgB"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes