@carto/ps-react-ui 5.0.0-widgets.4 → 5.0.0-widgets.6
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/{error-DGzuzmn1.js → error-G3sy6lw3.js} +2 -2
- package/dist/{error-DGzuzmn1.js.map → error-G3sy6lw3.js.map} +1 -1
- package/dist/{no-data-BBAoT1vK.js → no-data-DfkC_Kc_.js} +2 -2
- package/dist/{no-data-BBAoT1vK.js.map → no-data-DfkC_Kc_.js.map} +1 -1
- package/dist/note-Clng2ej6.js +124 -0
- package/dist/note-Clng2ej6.js.map +1 -0
- package/dist/{row-C_m1ovHv.js → row-B9hTUitn.js} +2 -2
- package/dist/{row-C_m1ovHv.js.map → row-B9hTUitn.js.map} +1 -1
- package/dist/{series-6xp-KQ0S.js → series-DojKkd_o.js} +3 -3
- package/dist/{series-6xp-KQ0S.js.map → series-DojKkd_o.js.map} +1 -1
- package/dist/types/widgets/category/config.d.ts +1 -0
- package/dist/types/widgets/category/types.d.ts +1 -0
- package/dist/types/widgets/echart/types.d.ts +1 -0
- package/dist/types/widgets/index.d.ts +2 -0
- package/dist/types/widgets/stores/types.d.ts +0 -75
- package/dist/types/widgets/subheader/index.d.ts +2 -2
- package/dist/types/widgets/subheader/subheader.d.ts +2 -2
- package/dist/types/widgets/subheader/types.d.ts +1 -1
- package/dist/types/widgets/table/hooks/use-pagination.d.ts +1 -7
- package/dist/types/widgets/table/hooks/use-selection.d.ts +0 -2
- package/dist/types/widgets/table/hooks/use-sort.d.ts +1 -7
- package/dist/types/widgets/table/types.d.ts +16 -5
- package/dist/widget-store-Dd7_sWZT.js +132 -0
- package/dist/widget-store-Dd7_sWZT.js.map +1 -0
- package/dist/widgets/actions.js +23 -22
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +8 -7
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +135 -128
- package/dist/widgets/category.js.map +1 -1
- package/dist/widgets/echart.js +1 -1
- package/dist/widgets/error.js +1 -1
- package/dist/widgets/formula.js +19 -18
- package/dist/widgets/formula.js.map +1 -1
- package/dist/widgets/histogram.js +54 -53
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/markdown.js +1 -1
- package/dist/widgets/no-data.js +1 -1
- package/dist/widgets/note.js +2 -121
- package/dist/widgets/note.js.map +1 -1
- package/dist/widgets/pie.js +8 -7
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/range.js +2 -2
- package/dist/widgets/root.js +1 -1
- package/dist/widgets/scatterplot.js +8 -7
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/skeleton-loader.js +1 -1
- package/dist/widgets/spread.js +20 -19
- package/dist/widgets/spread.js.map +1 -1
- package/dist/widgets/stores.js +1 -1
- package/dist/widgets/subheader.js +5 -5
- package/dist/widgets/subheader.js.map +1 -1
- package/dist/widgets/table.js +499 -488
- package/dist/widgets/table.js.map +1 -1
- package/dist/widgets/timeseries.js +8 -7
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/wrapper.js +1 -1
- package/dist/widgets.js +6 -4
- package/dist/widgets.js.map +1 -1
- package/package.json +1 -1
- package/dist/widget-store-DNyVElxd.js +0 -190
- package/dist/widget-store-DNyVElxd.js.map +0 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { create as f } from "zustand";
|
|
2
|
+
const u = /* @__PURE__ */ new Map(), w = f()((c, T) => ({
|
|
3
|
+
// State
|
|
4
|
+
widgets: {},
|
|
5
|
+
// Actions
|
|
6
|
+
setWidget: (e, t) => c((o) => {
|
|
7
|
+
const r = o.widgets[e] ?? {};
|
|
8
|
+
return {
|
|
9
|
+
widgets: {
|
|
10
|
+
...o.widgets,
|
|
11
|
+
[e]: {
|
|
12
|
+
...r,
|
|
13
|
+
...t,
|
|
14
|
+
id: e
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}),
|
|
19
|
+
removeWidget: (e) => c((t) => {
|
|
20
|
+
const o = {
|
|
21
|
+
...t.widgets
|
|
22
|
+
};
|
|
23
|
+
return delete o[e], {
|
|
24
|
+
widgets: o
|
|
25
|
+
};
|
|
26
|
+
}),
|
|
27
|
+
clearWidgets: () => c({
|
|
28
|
+
widgets: {}
|
|
29
|
+
}),
|
|
30
|
+
getWidget: (e) => T().widgets[e],
|
|
31
|
+
registerTool: (e, t) => c((o) => {
|
|
32
|
+
const r = o.widgets[e] ?? {}, l = (r.registeredTools ?? []).filter((g) => g.id !== t.id);
|
|
33
|
+
return {
|
|
34
|
+
widgets: {
|
|
35
|
+
...o.widgets,
|
|
36
|
+
[e]: {
|
|
37
|
+
...r,
|
|
38
|
+
id: e,
|
|
39
|
+
registeredTools: [...l, t]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}),
|
|
44
|
+
unregisterTool: (e, t) => c((o) => {
|
|
45
|
+
const r = o.widgets[e];
|
|
46
|
+
if (!r) return o;
|
|
47
|
+
const l = (r.registeredTools ?? []).filter((g) => g.id !== t);
|
|
48
|
+
return {
|
|
49
|
+
widgets: {
|
|
50
|
+
...o.widgets,
|
|
51
|
+
[e]: {
|
|
52
|
+
...r,
|
|
53
|
+
registeredTools: l
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}),
|
|
58
|
+
updateToolConfig: (e, t, o) => c((r) => {
|
|
59
|
+
const i = r.widgets[e];
|
|
60
|
+
if (!i) return r;
|
|
61
|
+
const g = (i.registeredTools ?? []).map((n) => n.id === t ? {
|
|
62
|
+
...n,
|
|
63
|
+
config: {
|
|
64
|
+
...n.config,
|
|
65
|
+
...o
|
|
66
|
+
}
|
|
67
|
+
} : n);
|
|
68
|
+
return {
|
|
69
|
+
widgets: {
|
|
70
|
+
...r.widgets,
|
|
71
|
+
[e]: {
|
|
72
|
+
...i,
|
|
73
|
+
registeredTools: g
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}),
|
|
78
|
+
setToolEnabled: (e, t, o) => c((r) => {
|
|
79
|
+
const i = r.widgets[e];
|
|
80
|
+
if (!i) return r;
|
|
81
|
+
const g = (i.registeredTools ?? []).map((n) => n.id === t ? {
|
|
82
|
+
...n,
|
|
83
|
+
enabled: o
|
|
84
|
+
} : n);
|
|
85
|
+
return {
|
|
86
|
+
widgets: {
|
|
87
|
+
...r.widgets,
|
|
88
|
+
[e]: {
|
|
89
|
+
...i,
|
|
90
|
+
registeredTools: g
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}),
|
|
95
|
+
executeToolPipeline: async (e, t) => {
|
|
96
|
+
const o = T().widgets[e];
|
|
97
|
+
if (!o) return;
|
|
98
|
+
const r = (u.get(e) ?? 0) + 1;
|
|
99
|
+
u.set(e, r);
|
|
100
|
+
const i = o, l = /* @__PURE__ */ new Set();
|
|
101
|
+
for (const s of i.registeredTools ?? [])
|
|
102
|
+
s.enabled && s.disables && s.disables.forEach((d) => l.add(d));
|
|
103
|
+
const g = [...i.registeredTools ?? []].filter((s) => s.enabled && !l.has(s.id)).sort((s, d) => s.order - d.order);
|
|
104
|
+
let n = t;
|
|
105
|
+
for (const s of g) {
|
|
106
|
+
if (u.get(e) !== r)
|
|
107
|
+
return;
|
|
108
|
+
try {
|
|
109
|
+
const d = s.fn(n, s.config);
|
|
110
|
+
n = d instanceof Promise ? await d : d;
|
|
111
|
+
} catch (d) {
|
|
112
|
+
console.error(`Tool ${s.id} failed for widget ${e}:`, d);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
u.get(e) === r && (c((s) => {
|
|
116
|
+
const d = s.widgets[e];
|
|
117
|
+
return d ? {
|
|
118
|
+
widgets: {
|
|
119
|
+
...s.widgets,
|
|
120
|
+
[e]: {
|
|
121
|
+
...d,
|
|
122
|
+
data: n
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
} : s;
|
|
126
|
+
}), u.get(e) === r && u.delete(e));
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
129
|
+
export {
|
|
130
|
+
w as u
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=widget-store-Dd7_sWZT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-store-Dd7_sWZT.js","sources":["../src/widgets/stores/widget-store.ts"],"sourcesContent":["import { create } from 'zustand'\nimport type { WidgetState, WidgetStore, ToolRegistration } from './types'\n\n// Track active pipeline executions for cancellation\nconst activePipelines = new Map<string, number>()\n\n/**\n * Zustand store for managing widget state across the application.\n *\n * This store provides centralized state management for all widget UI components\n *\n * @example\n * ```tsx\n * // Import the store\n * import { useWidgetStore } from '@carto/ps-react-ui/widgets'\n *\n * // Use in a component\n * function MyWidget() {\n * const setWidget = useWidgetStore((state) => state.setWidget)\n * const widget = useWidgetStore((state) => state.widgets['my-widget'])\n *\n * useEffect(() => {\n * setWidget({\n * id: 'my-widget',\n * type: 'formula',\n * title: 'Total Sales',\n * isLoading: false,\n * visible: true,\n * data: { value: 1000, prefix: '$' }\n * })\n * }, [setWidget])\n *\n * return <div>{widget?.data?.value}</div>\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Get widgets by type\n * const getWidgetsByType = useWidgetStore((state) => state.getWidgetsByType)\n * const formulaWidgets = getWidgetsByType('formula')\n * ```\n */\nexport const useWidgetStore = create<WidgetStore>()((set, get) => ({\n // State\n widgets: {},\n\n // Actions\n setWidget: (id, widget) =>\n set((state) => {\n const current =\n state.widgets[id] ?? ({} as WidgetStore['widgets'][string])\n return {\n widgets: {\n ...state.widgets,\n [id]: {\n ...current,\n ...widget,\n id,\n },\n },\n }\n }),\n\n removeWidget: (id) =>\n set((state) => {\n const widgets = { ...state.widgets }\n\n delete widgets[id]\n\n return { widgets }\n }),\n\n clearWidgets: () =>\n set({\n widgets: {},\n }),\n\n getWidget: <T extends WidgetState>(id: string) => {\n return get().widgets[id] as T | undefined\n },\n\n registerTool: (widgetId: string, tool: ToolRegistration) =>\n set((state) => {\n const current = state.widgets[widgetId] ?? ({} as WidgetState)\n const registeredTools = current.registeredTools ?? []\n\n // Remove existing tool with same id if present\n const filteredTools = registeredTools.filter(\n (t: ToolRegistration) => t.id !== tool.id,\n )\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...current,\n id: widgetId,\n registeredTools: [...filteredTools, tool],\n },\n },\n }\n }),\n\n unregisterTool: (widgetId: string, toolId: string) =>\n set((state) => {\n const current = state.widgets[widgetId]\n if (!current) return state\n\n const registeredTools = current.registeredTools ?? []\n const filteredTools = registeredTools.filter(\n (t: ToolRegistration) => t.id !== toolId,\n )\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...current,\n registeredTools: filteredTools,\n },\n },\n }\n }),\n\n updateToolConfig: (\n widgetId: string,\n toolId: string,\n config: Record<string, unknown>,\n ) =>\n set((state) => {\n const current = state.widgets[widgetId]\n if (!current) return state\n\n const registeredTools = current.registeredTools ?? []\n const updatedTools = registeredTools.map((tool: ToolRegistration) =>\n tool.id === toolId\n ? {\n ...tool,\n config: { ...tool.config, ...config },\n }\n : tool,\n )\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...current,\n registeredTools: updatedTools,\n },\n },\n }\n }),\n\n setToolEnabled: (widgetId: string, toolId: string, enabled: boolean) =>\n set((state) => {\n const current = state.widgets[widgetId]\n if (!current) return state\n\n const registeredTools = current.registeredTools ?? []\n const updatedTools = registeredTools.map((tool: ToolRegistration) =>\n tool.id === toolId ? { ...tool, enabled } : tool,\n )\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...current,\n registeredTools: updatedTools,\n },\n },\n }\n }),\n\n executeToolPipeline: async (widgetId: string, sourceData: unknown) => {\n const widget = get().widgets[widgetId]\n if (!widget) return\n\n // Cancel any in-progress pipeline for this widget\n const currentExecution = (activePipelines.get(widgetId) ?? 0) + 1\n activePipelines.set(widgetId, currentExecution)\n\n const widgetWithTools = widget\n\n // Build set of tool IDs that should be disabled\n const disabledToolIds = new Set<string>()\n for (const tool of widgetWithTools.registeredTools ?? []) {\n if (tool.enabled && tool.disables) {\n tool.disables.forEach((id) => disabledToolIds.add(id))\n }\n }\n\n // Sort tools by order and filter enabled only, excluding disabled tools\n const sortedTools = [...(widgetWithTools.registeredTools ?? [])]\n .filter((tool) => tool.enabled && !disabledToolIds.has(tool.id))\n .sort((a, b) => a.order - b.order)\n\n // Execute pipeline - handle both sync and async tools\n let transformedData = sourceData\n for (const tool of sortedTools) {\n // Check if this execution was cancelled\n if (activePipelines.get(widgetId) !== currentExecution) {\n return\n }\n\n try {\n // Call tool function (may return Promise or direct value)\n const result = tool.fn(transformedData, tool.config)\n\n // Await if Promise, otherwise use directly\n transformedData = result instanceof Promise ? await result : result\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(`Tool ${tool.id} failed for widget ${widgetId}:`, error)\n // Continue with current data to prevent one tool from breaking all\n }\n }\n\n // Final check before updating store (in case cancelled during async operation)\n if (activePipelines.get(widgetId) !== currentExecution) {\n return\n }\n\n // Single store update with final transformed data\n set((state) => {\n const currentWidget = state.widgets[widgetId]\n if (!currentWidget) return state\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...currentWidget,\n data: transformedData,\n },\n },\n }\n })\n\n // Clean up tracking\n if (activePipelines.get(widgetId) === currentExecution) {\n activePipelines.delete(widgetId)\n }\n },\n}))\n"],"names":["activePipelines","Map","useWidgetStore","create","set","get","widgets","setWidget","id","widget","state","current","removeWidget","clearWidgets","getWidget","registerTool","widgetId","tool","filteredTools","registeredTools","filter","t","unregisterTool","toolId","updateToolConfig","config","updatedTools","map","setToolEnabled","enabled","executeToolPipeline","sourceData","currentExecution","widgetWithTools","disabledToolIds","Set","disables","forEach","add","sortedTools","has","sort","a","b","order","transformedData","result","fn","Promise","error","console","currentWidget","data","delete"],"mappings":";AAIA,MAAMA,wBAAsBC,IAAAA,GAuCfC,IAAiBC,EAAAA,EAAsB,CAACC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MAAU;AACb,YAAMyC,IAAgBzC,EAAMJ,QAAQU,CAAQ;AAC5C,aAAKmC,IAEE;AAAA,QACL7C,SAAS;AAAA,UACP,GAAGI,EAAMJ;AAAAA,UACT,CAACU,CAAQ,GAAG;AAAA,YACV,GAAGmC;AAAAA,YACHC,MAAMP;AAAAA,UAAAA;AAAAA,QACR;AAAA,MACF,IATyBnC;AAAAA,IAW7B,CAAC,GAGGV,EAAgBK,IAAIW,CAAQ,MAAMgB,KACpChC,EAAgBqD,OAAOrC,CAAQ;AAAA,EAEnC;AACF,EAAE;"}
|
package/dist/widgets/actions.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as g, jsxs as X, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import { c as K } from "react/compiler-runtime";
|
|
3
3
|
import { IconButton as q, DialogContent as Se, Typography as ve, DialogTitle as Ie, Dialog as Ce, CircularProgress as _e, MenuItem as ge, ListItemIcon as Te, ListItemText as pe, Menu as he, useTheme as ke, Box as ye, TextField as xe, InputAdornment as de, SvgIcon as Ee } from "@mui/material";
|
|
4
|
-
import { u as O } from "../widget-store-
|
|
4
|
+
import { u as O } from "../widget-store-Dd7_sWZT.js";
|
|
5
5
|
import { FullscreenOutlined as Le, Close as we, FileDownloadOutlined as ze, PercentOutlined as $e, SubdirectoryArrowLeftOutlined as We, ZoomInOutlined as De, CheckBoxOutlined as Oe, SearchOutlined as be, ClearOutlined as Re } from "@mui/icons-material";
|
|
6
6
|
import { useShallow as Q } from "zustand/shallow";
|
|
7
7
|
import { useState as re, useEffect as j, useRef as se } from "react";
|
|
8
|
-
import
|
|
8
|
+
import "react-markdown";
|
|
9
|
+
import { a as il, d as rl } from "../exports-Cr43OCul.js";
|
|
9
10
|
import "../lasso-tool-CYn3ivf-.js";
|
|
10
11
|
import "../cjs-D9ro6BXv.js";
|
|
11
12
|
import { T as ee } from "../tooltip-BDnrRKrp.js";
|
|
@@ -30,7 +31,7 @@ const fe = {
|
|
|
30
31
|
}) => l(1)
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
|
-
function
|
|
34
|
+
function Yt(l) {
|
|
34
35
|
const e = K(46), {
|
|
35
36
|
id: t,
|
|
36
37
|
labels: L,
|
|
@@ -115,7 +116,7 @@ function Kt(l) {
|
|
|
115
116
|
function qe(l) {
|
|
116
117
|
return l.setWidget;
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function qt(l) {
|
|
119
120
|
const e = K(35), {
|
|
120
121
|
id: t,
|
|
121
122
|
items: L,
|
|
@@ -208,7 +209,7 @@ function Qe(l, e) {
|
|
|
208
209
|
}));
|
|
209
210
|
}
|
|
210
211
|
const ie = "relative-data";
|
|
211
|
-
function
|
|
212
|
+
function Jt(l) {
|
|
212
213
|
const e = K(35), {
|
|
213
214
|
id: t,
|
|
214
215
|
order: L,
|
|
@@ -284,7 +285,7 @@ const me = {
|
|
|
284
285
|
}
|
|
285
286
|
}
|
|
286
287
|
};
|
|
287
|
-
function
|
|
288
|
+
function Qt(l) {
|
|
288
289
|
const e = K(59), {
|
|
289
290
|
id: t,
|
|
290
291
|
defaultZoom: L,
|
|
@@ -380,7 +381,7 @@ const rt = () => {
|
|
|
380
381
|
let e;
|
|
381
382
|
return l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ g("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ g("path", { d: "M4 20V8H8V20H4ZM9 20V13H13V20H9ZM16 20V4H20V20H16Z", fill: "currentColor" }) }), l[0] = e) : e = l[0], e;
|
|
382
383
|
};
|
|
383
|
-
function
|
|
384
|
+
function Xt(l) {
|
|
384
385
|
const e = K(30), {
|
|
385
386
|
id: t,
|
|
386
387
|
defaultIsStacked: L,
|
|
@@ -456,7 +457,7 @@ function dt(l) {
|
|
|
456
457
|
return l.setWidget;
|
|
457
458
|
}
|
|
458
459
|
const le = "lock-selection";
|
|
459
|
-
function
|
|
460
|
+
function el(l) {
|
|
460
461
|
const e = K(37), {
|
|
461
462
|
id: t,
|
|
462
463
|
selectedItems: L,
|
|
@@ -537,7 +538,7 @@ function bt(l, e) {
|
|
|
537
538
|
}));
|
|
538
539
|
}
|
|
539
540
|
const te = "searcher", St = 300;
|
|
540
|
-
function
|
|
541
|
+
function tl(l) {
|
|
541
542
|
const e = K(49), {
|
|
542
543
|
id: t,
|
|
543
544
|
filterFn: L,
|
|
@@ -640,7 +641,7 @@ const kt = (l, e) => {
|
|
|
640
641
|
const t = e.toLowerCase();
|
|
641
642
|
return Promise.resolve(l.map((L) => L.filter((S) => Object.values(S).some((v) => typeof v == "string" && v.toLowerCase().includes(t)))));
|
|
642
643
|
};
|
|
643
|
-
function
|
|
644
|
+
function ll(l) {
|
|
644
645
|
const e = K(23), {
|
|
645
646
|
id: t,
|
|
646
647
|
defaultEnabled: L,
|
|
@@ -724,7 +725,7 @@ function Lt(l) {
|
|
|
724
725
|
function wt(l) {
|
|
725
726
|
return `2px solid ${l.palette.primary.main}`;
|
|
726
727
|
}
|
|
727
|
-
function
|
|
728
|
+
function nl(l) {
|
|
728
729
|
const e = K(42), {
|
|
729
730
|
id: t,
|
|
730
731
|
labels: L,
|
|
@@ -811,19 +812,19 @@ function Wt(l) {
|
|
|
811
812
|
return l.setWidget;
|
|
812
813
|
}
|
|
813
814
|
export {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
815
|
+
nl as ChangeColumn,
|
|
816
|
+
qt as Download,
|
|
817
|
+
Yt as FullScreen,
|
|
817
818
|
le as LOCK_SELECTION_TOOL_ID,
|
|
818
|
-
|
|
819
|
+
el as LockSelection,
|
|
819
820
|
ie as RELATIVE_DATA_TOOL_ID,
|
|
820
|
-
|
|
821
|
+
Jt as RelativeData,
|
|
821
822
|
te as SEARCHER_TOOL_ID,
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
823
|
+
tl as Searcher,
|
|
824
|
+
ll as SearcherToggle,
|
|
825
|
+
Xt as StackToggle,
|
|
826
|
+
Qt as ZoomToggle,
|
|
827
|
+
il as downloadToCSV,
|
|
828
|
+
rl as downloadToPNG
|
|
828
829
|
};
|
|
829
830
|
//# sourceMappingURL=actions.js.map
|