@grafana/plugin-ui 0.12.0 → 0.12.1
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.
|
@@ -7,7 +7,7 @@ function useLatestCallback(callback) {
|
|
|
7
7
|
});
|
|
8
8
|
const hasCallback = Boolean(callback);
|
|
9
9
|
return useMemo(
|
|
10
|
-
() => hasCallback ? (...args) => ref.current(...args) : undefined,
|
|
10
|
+
() => hasCallback ? ((...args) => ref.current(...args)) : undefined,
|
|
11
11
|
[hasCallback]
|
|
12
12
|
);
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLatestCallback.js","sources":["../../../../../src/components/SQLEditor/hooks/useLatestCallback.ts"],"sourcesContent":["import { useRef, useEffect, useMemo } from 'react';\n\n/**\n * Returns a stable callback that always calls the latest version of the provided callback.\n * Useful for avoiding stale closures in imperative APIs like Monaco editor callbacks.\n *\n * @param callback The callback function that may change between renders (can be undefined)\n * @returns A stable callback reference that always calls the latest version, or undefined if no callback provided\n */\nexport function useLatestCallback<T extends (...args: any[]) => unknown>(callback: T | undefined): T | undefined {\n const ref = useRef(callback);\n\n useEffect(() => {\n ref.current = callback;\n });\n\n const hasCallback = Boolean(callback);\n\n return useMemo(\n () => (hasCallback ? (((...args: Parameters<T>) => ref.current!(...args)) as T) : undefined),\n [hasCallback]\n );\n}\n"],"names":[],"mappings":";;AASO,SAAS,kBAAyD,QAAwC,EAAA;AAC/G,EAAM,MAAA,GAAA,GAAM,OAAO,QAAQ,CAAA;AAE3B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,GAAA,CAAI,OAAU,GAAA,QAAA;AAAA,GACf,CAAA;AAED,EAAM,MAAA,WAAA,GAAc,QAAQ,QAAQ,CAAA;AAEpC,EAAO,OAAA,OAAA;AAAA,IACL,MAAO,
|
|
1
|
+
{"version":3,"file":"useLatestCallback.js","sources":["../../../../../src/components/SQLEditor/hooks/useLatestCallback.ts"],"sourcesContent":["import { useRef, useEffect, useMemo } from 'react';\n\n/**\n * Returns a stable callback that always calls the latest version of the provided callback.\n * Useful for avoiding stale closures in imperative APIs like Monaco editor callbacks.\n *\n * @param callback The callback function that may change between renders (can be undefined)\n * @returns A stable callback reference that always calls the latest version, or undefined if no callback provided\n */\nexport function useLatestCallback<T extends (...args: any[]) => unknown>(callback: T | undefined): T | undefined {\n const ref = useRef(callback);\n\n useEffect(() => {\n ref.current = callback;\n });\n\n const hasCallback = Boolean(callback);\n\n return useMemo(\n () => (hasCallback ? (((...args: Parameters<T>) => ref.current!(...args)) as T) : undefined),\n [hasCallback]\n );\n}\n"],"names":[],"mappings":";;AASO,SAAS,kBAAyD,QAAwC,EAAA;AAC/G,EAAM,MAAA,GAAA,GAAM,OAAO,QAAQ,CAAA;AAE3B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,GAAA,CAAI,OAAU,GAAA,QAAA;AAAA,GACf,CAAA;AAED,EAAM,MAAA,WAAA,GAAc,QAAQ,QAAQ,CAAA;AAEpC,EAAO,OAAA,OAAA;AAAA,IACL,MAAO,eAAgB,CAAI,GAAA,IAAA,KAAwB,IAAI,OAAS,CAAA,GAAG,IAAI,CAAW,IAAA,SAAA;AAAA,IAClF,CAAC,WAAW;AAAA,GACd;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-ui",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@github.com/grafana/plugin-ui.git"
|
|
@@ -127,7 +127,8 @@
|
|
|
127
127
|
],
|
|
128
128
|
"resolutions": {
|
|
129
129
|
"prismjs": "^1.30.0",
|
|
130
|
-
"uplot": "^1.6.31"
|
|
130
|
+
"uplot": "^1.6.31",
|
|
131
|
+
"glob": "10.5.0"
|
|
131
132
|
},
|
|
132
133
|
"packageManager": "yarn@4.6.0"
|
|
133
134
|
}
|