@perses-dev/dashboards 0.54.0-beta.9 → 0.54.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +1 -1
- package/dist/cjs/context/VariableProvider/VariableProvider.js +1 -0
- package/dist/components/GridLayout/GridLayout.d.ts +1 -1
- package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
- package/dist/components/GridLayout/GridLayout.js.map +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts +1 -1
- package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
- package/dist/components/GridLayout/GridTitle.js.map +1 -1
- package/dist/components/GridLayout/Row.d.ts +1 -1
- package/dist/components/GridLayout/Row.d.ts.map +1 -1
- package/dist/components/GridLayout/Row.js.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js +1 -1
- package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js +1 -1
- package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -1
- package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.d.ts +2 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.d.ts.map +1 -1
- package/dist/components/PanelDrawer/PanelQueriesSharedControls.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +2 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts +2 -1
- package/dist/context/DashboardProvider/panel-group-slice.d.ts.map +1 -1
- package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
- package/dist/context/DashboardProvider/view-panel-slice.js.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.d.ts.map +1 -1
- package/dist/context/VariableProvider/VariableProvider.js +1 -0
- package/dist/context/VariableProvider/VariableProvider.js.map +1 -1
- package/dist/context/useDashboard.d.ts.map +1 -1
- package/dist/context/useDashboard.js.map +1 -1
- package/dist/model/PanelGroupDefinition.d.ts +1 -1
- package/dist/model/PanelGroupDefinition.d.ts.map +1 -1
- package/dist/model/PanelGroupDefinition.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDashboard.d.ts","sourceRoot":"","sources":["../../src/context/useDashboard.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAkB,aAAa,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"useDashboard.d.ts","sourceRoot":"","sources":["../../src/context/useDashboard.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAkB,aAAa,EAAE,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAQvD,KAAK,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,EAAE,aAAa,GAAG;QAAE,GAAG,CAAC,EAAE,cAAc,CAAA;KAAE,CAAA;CAAE,CAAC;AAC1G,wBAAgB,YAAY,IAAI;IAC9B,SAAS,EAAE,aAAa,CAAC;IACzB,YAAY,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC9D,CAmGA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/useDashboard.tsx"],"sourcesContent":["// Copyright 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 { createPanelRef, DashboardSpec, DurationString, GridDefinition
|
|
1
|
+
{"version":3,"sources":["../../src/context/useDashboard.tsx"],"sourcesContent":["// Copyright 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 { createPanelRef, DashboardSpec, DurationString, GridDefinition } from '@perses-dev/spec';\nimport { DashboardResource } from '@perses-dev/client';\nimport { PanelGroupId } from '@perses-dev/plugin-system';\nimport { PanelGroupDefinition } from '../model';\n\nimport { useDashboardStore } from './DashboardProvider';\nimport { useVariableDefinitionActions, useVariableDefinitions } from './VariableProvider';\nimport { useAnnotationActions, useAnnotationSpecs } from './AnnotationProvider';\n\ntype DashboardType = Omit<DashboardResource, 'spec'> & { spec: DashboardSpec & { ttl?: DurationString } };\nexport function useDashboard(): {\n dashboard: DashboardType;\n setDashboard: (dashboardResource: DashboardResource) => void;\n} {\n const {\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard: setDashboardResource,\n kind,\n metadata,\n display,\n timezone,\n duration,\n refreshInterval,\n datasources,\n links,\n ttl,\n } = useDashboardStore(\n ({\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard,\n kind,\n metadata,\n timezone,\n display,\n duration,\n refreshInterval,\n datasources,\n links,\n ttl,\n }) => ({\n panels,\n panelGroups,\n panelGroupOrder,\n setDashboard,\n kind,\n metadata,\n timezone,\n display,\n duration,\n refreshInterval,\n datasources,\n links,\n ttl,\n })\n );\n const { setVariableDefinitions } = useVariableDefinitionActions();\n const { setAnnotationSpecs } = useAnnotationActions();\n const variables = useVariableDefinitions();\n const annotations = useAnnotationSpecs();\n const layouts = convertPanelGroupsToLayouts(panelGroups, panelGroupOrder);\n\n const dashboard: DashboardType =\n kind === 'Dashboard'\n ? {\n kind,\n metadata,\n spec: {\n display,\n panels,\n layouts,\n variables,\n annotations,\n duration,\n timezone,\n refreshInterval,\n datasources,\n links,\n },\n }\n : {\n kind,\n metadata,\n spec: {\n display,\n panels,\n layouts,\n variables,\n annotations,\n duration,\n refreshInterval,\n datasources,\n links,\n ttl,\n },\n };\n\n const setDashboard = (dashboardResource: DashboardResource): void => {\n setVariableDefinitions(dashboardResource.spec.variables);\n if (dashboardResource.spec.annotations) {\n setAnnotationSpecs(dashboardResource.spec.annotations);\n }\n setDashboardResource(dashboardResource);\n };\n\n return {\n dashboard,\n setDashboard,\n };\n}\n\nfunction convertPanelGroupsToLayouts(\n panelGroups: Record<number, PanelGroupDefinition>,\n panelGroupOrder: PanelGroupId[]\n): GridDefinition[] {\n const layouts: GridDefinition[] = [];\n panelGroupOrder.map((groupOrderId) => {\n const group = panelGroups[groupOrderId];\n if (group === undefined) {\n throw new Error('panel group not found');\n }\n const { title, isCollapsed, repeatVariable, itemLayouts, itemPanelKeys } = group;\n let display = undefined;\n if (title || isCollapsed !== undefined) {\n display = {\n title: title ?? '',\n collapse: {\n open: !isCollapsed,\n },\n };\n }\n const layout: GridDefinition = {\n kind: 'Grid',\n spec: {\n display,\n items: itemLayouts.map((layout) => {\n const panelKey = itemPanelKeys[layout.i];\n if (panelKey === undefined) {\n throw new Error(`Missing panel key of layout ${layout.i}`);\n }\n return {\n x: layout.x,\n y: layout.y,\n width: layout.w,\n height: layout.h,\n content: createPanelRef(panelKey),\n };\n }),\n repeatVariable: repeatVariable,\n },\n };\n layouts.push(layout);\n });\n\n return layouts;\n}\n"],"names":["createPanelRef","useDashboardStore","useVariableDefinitionActions","useVariableDefinitions","useAnnotationActions","useAnnotationSpecs","useDashboard","panels","panelGroups","panelGroupOrder","setDashboard","setDashboardResource","kind","metadata","display","timezone","duration","refreshInterval","datasources","links","ttl","setVariableDefinitions","setAnnotationSpecs","variables","annotations","layouts","convertPanelGroupsToLayouts","dashboard","spec","dashboardResource","map","groupOrderId","group","undefined","Error","title","isCollapsed","repeatVariable","itemLayouts","itemPanelKeys","collapse","open","layout","items","panelKey","i","x","y","width","w","height","h","content","push"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,cAAc,QAAuD,mBAAmB;AAKjG,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,4BAA4B,EAAEC,sBAAsB,QAAQ,qBAAqB;AAC1F,SAASC,oBAAoB,EAAEC,kBAAkB,QAAQ,uBAAuB;AAGhF,OAAO,SAASC;IAId,MAAM,EACJC,MAAM,EACNC,WAAW,EACXC,eAAe,EACfC,cAAcC,oBAAoB,EAClCC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,QAA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EAAEC,cAAc,EAAEC,WAAW,EAAEC,aAAa,EAAE,GAAGP;QAC3E,IAAIlB,UAAUmB;QACd,IAAIE,SAASC,gBAAgBH,WAAW;YACtCnB,UAAU;gBACRqB,OAAOA,SAAS;gBAChBK,UAAU;oBACRC,MAAM,CAACL;gBACT;YACF;QACF;QACA,MAAMM,SAAyB;YAC7B9B,MAAM;YACNgB,MAAM;gBACJd;gBACA6B,OAAOL,YAAYR,GAAG,CAAC,CAACY;oBACtB,MAAME,WAAWL,aAAa,CAACG,OAAOG,CAAC,CAAC;oBACxC,IAAID,aAAaX,WAAW;wBAC1B,MAAM,IAAIC,MAAM,CAAC,4BAA4B,EAAEQ,OAAOG,CAAC,EAAE;oBAC3D;oBACA,OAAO;wBACLC,GAAGJ,OAAOI,CAAC;wBACXC,GAAGL,OAAOK,CAAC;wBACXC,OAAON,OAAOO,CAAC;wBACfC,QAAQR,OAAOS,CAAC;wBAChBC,SAASpD,eAAe4C;oBAC1B;gBACF;gBACAP,gBAAgBA;YAClB;QACF;QACAZ,QAAQ4B,IAAI,CAACX;IACf;IAEA,OAAOjB;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelGroupDefinition.d.ts","sourceRoot":"","sources":["../../src/model/PanelGroupDefinition.ts"],"names":[],"mappings":"AAaA,
|
|
1
|
+
{"version":3,"file":"PanelGroupDefinition.d.ts","sourceRoot":"","sources":["../../src/model/PanelGroupDefinition.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,CAAC,EAAE,sBAAsB,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,YAAY,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,YAAY,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,aAAa,EAAE,MAAM,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAE3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/PanelGroupDefinition.ts"],"sourcesContent":["// Copyright 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\
|
|
1
|
+
{"version":3,"sources":["../../src/model/PanelGroupDefinition.ts"],"sourcesContent":["// Copyright 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 { PanelGroupId } from '@perses-dev/plugin-system';\n/**\n * Panel Group Item Layout ID type. String identifier for items within a panel group.\n */\nexport type PanelGroupItemLayoutId = string;\n\n/**\n * Uniquely identifies an item in a PanelGroup.\n */\nexport interface PanelGroupItemId {\n panelGroupId: PanelGroupId;\n panelGroupItemLayoutId: PanelGroupItemLayoutId;\n repeatVariable?: [string, string]; // Optional, used for repeated panel groups. Variable name and value.\n}\n\n/**\n * Base layout properties for positioning and sizing items in a grid.\n * This is a framework-agnostic representation that can be used with various grid systems.\n */\nexport interface BaseLayout {\n /**\n * Item identifier\n */\n i: string;\n /**\n * X position in grid units\n */\n x: number;\n /**\n * Y position in grid units\n */\n y: number;\n /**\n * Width in grid units\n */\n w: number;\n /**\n * Height in grid units\n */\n h: number;\n}\n\nexport interface PanelGroupItemLayout extends BaseLayout {\n i: PanelGroupItemLayoutId;\n}\n\n/**\n * Definition of a panel group, containing layout and panel information.\n */\nexport interface PanelGroupDefinition {\n id: PanelGroupId;\n isCollapsed: boolean;\n title?: string;\n repeatedOriginId?: PanelGroupId; // ID of the original panel group from which this repeated group is derived\n repeatVariable?: string; // Optional, used for repeated panel groups\n itemLayouts: PanelGroupItemLayout[];\n itemPanelKeys: Record<PanelGroupItemLayoutId, string>;\n}\n\n/**\n * Check if two PanelGroupItemId are equal\n */\nexport function isPanelGroupItemIdEqual(a?: PanelGroupItemId, b?: PanelGroupItemId): boolean {\n return a?.panelGroupId === b?.panelGroupId && a?.panelGroupItemLayoutId === b?.panelGroupItemLayoutId;\n}\n"],"names":["isPanelGroupItemIdEqual","a","b","panelGroupId","panelGroupItemLayoutId"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA6DjC;;CAEC,GACD,OAAO,SAASA,wBAAwBC,CAAoB,EAAEC,CAAoB;IAChF,OAAOD,GAAGE,iBAAiBD,GAAGC,gBAAgBF,GAAGG,2BAA2BF,GAAGE;AACjF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/dashboards",
|
|
3
|
-
"version": "0.54.0-
|
|
3
|
+
"version": "0.54.0-rc.0",
|
|
4
4
|
"description": "The dashboards feature in Perses",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"lint:fix": "eslint --fix src --ext .ts,.tsx"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@perses-dev/components": "0.54.0-
|
|
33
|
-
"@perses-dev/plugin-system": "0.54.0-
|
|
34
|
-
"@perses-dev/spec": "0.2.0-beta.
|
|
35
|
-
"@perses-dev/client": "0.54.0-
|
|
32
|
+
"@perses-dev/components": "0.54.0-rc.0",
|
|
33
|
+
"@perses-dev/plugin-system": "0.54.0-rc.0",
|
|
34
|
+
"@perses-dev/spec": "0.2.0-beta.9",
|
|
35
|
+
"@perses-dev/client": "0.54.0-rc.0",
|
|
36
36
|
"@tanstack/hotkeys": "^0.8.0",
|
|
37
37
|
"@tanstack/react-hotkeys": "^0.9.1",
|
|
38
38
|
"immer": "^10.1.1",
|