@grafana/scenes 4.26.3--canary.765.9399849393.0 → 4.26.3

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/scenes",
3
- "version": "4.26.3--canary.765.9399849393.0",
3
+ "version": "4.26.3",
4
4
  "description": "Grafana framework for building dynamic dashboards",
5
5
  "author": "Grafana Labs",
6
6
  "license": "AGPL-3.0-only",
@@ -37,7 +37,7 @@
37
37
  "url": "https://github.com/grafana/scenes/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@grafana/e2e-selectors": "^10.4.1",
40
+ "@grafana/e2e-selectors": "^11.0.0",
41
41
  "@leeoniya/ufuzzy": "^1.0.14",
42
42
  "react-grid-layout": "1.3.4",
43
43
  "react-use": "17.4.0",
@@ -113,5 +113,5 @@
113
113
  "prettier --write"
114
114
  ]
115
115
  },
116
- "gitHead": "10313d3051a912b9ac313b3e0f6a144ae7454912"
116
+ "gitHead": "9347662143ac0aa9c9542d6feb6f4e7bd93856b7"
117
117
  }
@@ -1,12 +0,0 @@
1
- import { useUrlSync } from './useUrlSync.js';
2
-
3
- function UrlSyncContextProvider({ children, scene }) {
4
- const isInitialized = useUrlSync(scene);
5
- if (!isInitialized) {
6
- return null;
7
- }
8
- return children;
9
- }
10
-
11
- export { UrlSyncContextProvider };
12
- //# sourceMappingURL=UrlSyncContextProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UrlSyncContextProvider.js","sources":["../../../src/services/UrlSyncContextProvider.ts"],"sourcesContent":["import { SceneObject } from '../core/types';\nimport { useUrlSync } from './useUrlSync';\n\nexport interface UrlSyncContextProviderProps {\n scene: SceneObject;\n children: React.ReactNode;\n}\n\n/**\n * Right now this is actually not defining a context, but think it might in the future (with UrlSyncManager as the context value)\n */\n\nexport function UrlSyncContextProvider({ children, scene }: UrlSyncContextProviderProps) {\n const isInitialized = useUrlSync(scene);\n\n if (!isInitialized) {\n return null;\n }\n\n return children;\n}\n"],"names":[],"mappings":";;AAYO,SAAS,sBAAuB,CAAA,EAAE,QAAU,EAAA,KAAA,EAAsC,EAAA;AACvF,EAAM,MAAA,aAAA,GAAgB,WAAW,KAAK,CAAA,CAAA;AAEtC,EAAA,IAAI,CAAC,aAAe,EAAA;AAClB,IAAO,OAAA,IAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,QAAA,CAAA;AACT;;;;"}
@@ -1,27 +0,0 @@
1
- import { useState, useEffect } from 'react';
2
- import { useLocation } from 'react-router-dom';
3
- import { getUrlSyncManager } from './UrlSyncManager.js';
4
- import { locationService } from '@grafana/runtime';
5
-
6
- function useUrlSync(sceneRoot) {
7
- const urlSyncManager = getUrlSyncManager();
8
- const location = useLocation();
9
- const [isInitialized, setIsInitialized] = useState(false);
10
- useEffect(() => {
11
- urlSyncManager.initSync(sceneRoot);
12
- setIsInitialized(true);
13
- return () => urlSyncManager.cleanUp(sceneRoot);
14
- }, [sceneRoot, urlSyncManager]);
15
- useEffect(() => {
16
- const latestLocation = locationService.getLocation();
17
- const locationToHandle = latestLocation !== location ? latestLocation : location;
18
- if (latestLocation !== location) {
19
- console.log("latestLocation different from location");
20
- }
21
- urlSyncManager.handleNewLocation(locationToHandle);
22
- }, [sceneRoot, urlSyncManager, location]);
23
- return isInitialized;
24
- }
25
-
26
- export { useUrlSync };
27
- //# sourceMappingURL=useUrlSync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useUrlSync.js","sources":["../../../src/services/useUrlSync.ts"],"sourcesContent":["import { SceneObject } from '../core/types';\nimport { useEffect, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { getUrlSyncManager } from './UrlSyncManager';\nimport { locationService } from '@grafana/runtime';\n\nexport function useUrlSync(sceneRoot: SceneObject): boolean {\n const urlSyncManager = getUrlSyncManager();\n const location = useLocation();\n const [isInitialized, setIsInitialized] = useState(false);\n\n useEffect(() => {\n urlSyncManager.initSync(sceneRoot);\n setIsInitialized(true);\n return () => urlSyncManager.cleanUp(sceneRoot);\n }, [sceneRoot, urlSyncManager]);\n\n useEffect(() => {\n // Use latest location, as by the time this effect runs, the location might have changed again\n const latestLocation = locationService.getLocation();\n const locationToHandle = latestLocation !== location ? latestLocation : location;\n\n if (latestLocation !== location) {\n console.log('latestLocation different from location');\n }\n\n urlSyncManager.handleNewLocation(locationToHandle);\n }, [sceneRoot, urlSyncManager, location]);\n\n return isInitialized;\n}\n\nexport interface UrlSyncContextProviderProps {\n scene: SceneObject;\n children: React.ReactNode;\n}\n"],"names":[],"mappings":";;;;;AAMO,SAAS,WAAW,SAAiC,EAAA;AAC1D,EAAA,MAAM,iBAAiB,iBAAkB,EAAA,CAAA;AACzC,EAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAExD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,cAAA,CAAe,SAAS,SAAS,CAAA,CAAA;AACjC,IAAA,gBAAA,CAAiB,IAAI,CAAA,CAAA;AACrB,IAAO,OAAA,MAAM,cAAe,CAAA,OAAA,CAAQ,SAAS,CAAA,CAAA;AAAA,GAC5C,EAAA,CAAC,SAAW,EAAA,cAAc,CAAC,CAAA,CAAA;AAE9B,EAAA,SAAA,CAAU,MAAM;AAEd,IAAM,MAAA,cAAA,GAAiB,gBAAgB,WAAY,EAAA,CAAA;AACnD,IAAM,MAAA,gBAAA,GAAmB,cAAmB,KAAA,QAAA,GAAW,cAAiB,GAAA,QAAA,CAAA;AAExE,IAAA,IAAI,mBAAmB,QAAU,EAAA;AAC/B,MAAA,OAAA,CAAQ,IAAI,wCAAwC,CAAA,CAAA;AAAA,KACtD;AAEA,IAAA,cAAA,CAAe,kBAAkB,gBAAgB,CAAA,CAAA;AAAA,GAChD,EAAA,CAAC,SAAW,EAAA,cAAA,EAAgB,QAAQ,CAAC,CAAA,CAAA;AAExC,EAAO,OAAA,aAAA,CAAA;AACT;;;;"}