@grafana/scenes 6.30.0--canary.1215.16990223204.0 → 6.30.0--canary.1215.16990949623.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/esm/utils/pathId.js +3 -3
- package/dist/esm/utils/pathId.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/esm/utils/pathId.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LocalValueVariable } from '../variables/variants/LocalValueVariable.js';
|
|
2
2
|
|
|
3
3
|
const PATH_ID_SEPARATOR = "$";
|
|
4
|
-
function buildPathIdFor(
|
|
5
|
-
let pathId =
|
|
4
|
+
function buildPathIdFor(panel) {
|
|
5
|
+
let pathId = `panel-${panel.getLegacyPanelId()}`;
|
|
6
6
|
let lastName;
|
|
7
|
-
let currentObj =
|
|
7
|
+
let currentObj = panel;
|
|
8
8
|
while (currentObj) {
|
|
9
9
|
const variables = currentObj.state.$variables;
|
|
10
10
|
if (variables) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathId.js","sources":["../../../src/utils/pathId.ts"],"sourcesContent":["import { SceneObject } from '../core/types';\nimport { LocalValueVariable } from '../variables/variants/LocalValueVariable';\n\nexport const PATH_ID_SEPARATOR = '$';\n\n/**\n * Returns a unique path for a given VizPanel based on the panels peristance id and any local variable value contexts.\n * This is used to create a unique URL key identifiers for panels and repeated panels.\n */\nexport function buildPathIdFor(
|
|
1
|
+
{"version":3,"file":"pathId.js","sources":["../../../src/utils/pathId.ts"],"sourcesContent":["import { VizPanel } from '../components/VizPanel/VizPanel';\nimport { SceneObject } from '../core/types';\nimport { LocalValueVariable } from '../variables/variants/LocalValueVariable';\n\nexport const PATH_ID_SEPARATOR = '$';\n\n/**\n * Returns a unique path for a given VizPanel based on the panels peristance id and any local variable value contexts.\n * This is used to create a unique URL key identifiers for panels and repeated panels.\n */\nexport function buildPathIdFor(panel: VizPanel): string {\n let pathId = `panel-${panel.getLegacyPanelId()}`;\n let lastName: string | undefined;\n let currentObj: SceneObject | undefined = panel;\n\n while (currentObj) {\n const variables = currentObj.state.$variables;\n if (variables) {\n variables.state.variables.forEach((variable) => {\n if (variable.state.name === lastName) {\n // Skip if the variable name is the same as the last one\n // This happens as the source row has a local variable value and the child repeats\n return;\n }\n\n if (variable instanceof LocalValueVariable) {\n pathId = `${variable.state.value}${PATH_ID_SEPARATOR}${pathId}`;\n lastName = variable.state.name;\n }\n });\n }\n\n currentObj = currentObj.parent;\n }\n\n return pathId;\n}\n"],"names":[],"mappings":";;AAIO,MAAM,iBAAoB,GAAA;AAM1B,SAAS,eAAe,KAAyB,EAAA;AACtD,EAAA,IAAI,MAAS,GAAA,CAAA,MAAA,EAAS,KAAM,CAAA,gBAAA,EAAkB,CAAA,CAAA;AAC9C,EAAI,IAAA,QAAA;AACJ,EAAA,IAAI,UAAsC,GAAA,KAAA;AAE1C,EAAA,OAAO,UAAY,EAAA;AACjB,IAAM,MAAA,SAAA,GAAY,WAAW,KAAM,CAAA,UAAA;AACnC,IAAA,IAAI,SAAW,EAAA;AACb,MAAA,SAAA,CAAU,KAAM,CAAA,SAAA,CAAU,OAAQ,CAAA,CAAC,QAAa,KAAA;AAC9C,QAAI,IAAA,QAAA,CAAS,KAAM,CAAA,IAAA,KAAS,QAAU,EAAA;AAGpC,UAAA;AAAA;AAGF,QAAA,IAAI,oBAAoB,kBAAoB,EAAA;AAC1C,UAAA,MAAA,GAAS,GAAG,QAAS,CAAA,KAAA,CAAM,KAAK,CAAG,EAAA,iBAAiB,GAAG,MAAM,CAAA,CAAA;AAC7D,UAAA,QAAA,GAAW,SAAS,KAAM,CAAA,IAAA;AAAA;AAC5B,OACD,CAAA;AAAA;AAGH,IAAA,UAAA,GAAa,UAAW,CAAA,MAAA;AAAA;AAG1B,EAAO,OAAA,MAAA;AACT;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -812,7 +812,7 @@ declare const PATH_ID_SEPARATOR = "$";
|
|
|
812
812
|
* Returns a unique path for a given VizPanel based on the panels peristance id and any local variable value contexts.
|
|
813
813
|
* This is used to create a unique URL key identifiers for panels and repeated panels.
|
|
814
814
|
*/
|
|
815
|
-
declare function buildPathIdFor(
|
|
815
|
+
declare function buildPathIdFor(panel: VizPanel): string;
|
|
816
816
|
|
|
817
817
|
declare function isRepeatCloneOrChildOf(scene: SceneObject): boolean;
|
|
818
818
|
|
|
@@ -2600,7 +2600,7 @@ interface SceneReactObjectState<TProps = {}> extends SceneObjectState {
|
|
|
2600
2600
|
* A utility object that can be used to render any React component or ReactNode
|
|
2601
2601
|
*/
|
|
2602
2602
|
declare class SceneReactObject<TProps = {}> extends SceneObjectBase<SceneReactObjectState<TProps>> {
|
|
2603
|
-
static Component: ({ model }: SceneComponentProps<SceneReactObject>) => string | number | true | React__default.
|
|
2603
|
+
static Component: ({ model }: SceneComponentProps<SceneReactObject>) => string | number | true | Iterable<React__default.ReactNode> | React__default.JSX.Element | null;
|
|
2604
2604
|
}
|
|
2605
2605
|
|
|
2606
2606
|
type StandardFieldConfigInterface<T, C, Prefix extends string> = {
|
package/dist/index.js
CHANGED
|
@@ -8039,10 +8039,10 @@ class LocalValueVariable extends SceneObjectBase {
|
|
|
8039
8039
|
}
|
|
8040
8040
|
|
|
8041
8041
|
const PATH_ID_SEPARATOR = "$";
|
|
8042
|
-
function buildPathIdFor(
|
|
8043
|
-
let pathId =
|
|
8042
|
+
function buildPathIdFor(panel) {
|
|
8043
|
+
let pathId = `panel-${panel.getLegacyPanelId()}`;
|
|
8044
8044
|
let lastName;
|
|
8045
|
-
let currentObj =
|
|
8045
|
+
let currentObj = panel;
|
|
8046
8046
|
while (currentObj) {
|
|
8047
8047
|
const variables = currentObj.state.$variables;
|
|
8048
8048
|
if (variables) {
|