@sentio/ui-dashboard 0.3.11 → 0.3.12

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/index.mjs CHANGED
@@ -7924,6 +7924,64 @@ var ImportPanelDialog = ({
7924
7924
  }
7925
7925
  );
7926
7926
  };
7927
+
7928
+ // src/dashboard/ExportDashboardDialog.tsx
7929
+ import { BaseDialog as BaseDialog4, Button as Button7, CopyButton as CopyButton4, useDarkMode as useDarkMode2 } from "@sentio/ui-core";
7930
+ import MonacoEditor from "@monaco-editor/react";
7931
+ import { LuDownload } from "react-icons/lu";
7932
+ import { jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
7933
+ function ExportDashboardDialog({
7934
+ open,
7935
+ onClose,
7936
+ dashboardId,
7937
+ json,
7938
+ onBeforeMount
7939
+ }) {
7940
+ const isDarkMode = useDarkMode2();
7941
+ return /* @__PURE__ */ jsx49(
7942
+ BaseDialog4,
7943
+ {
7944
+ title: "Export dashboard JSON",
7945
+ open,
7946
+ onClose,
7947
+ onCancel: onClose,
7948
+ cancelText: "Close",
7949
+ footerBorder: false,
7950
+ extraButtons: /* @__PURE__ */ jsx49("div", { className: "absolute left-4 inline-flex", children: /* @__PURE__ */ jsx49(
7951
+ "a",
7952
+ {
7953
+ download: dashboardId ? `dashboard-${dashboardId}.json` : "dashboard.json",
7954
+ href: "data:text/json;charset=utf-8," + encodeURIComponent(json),
7955
+ children: /* @__PURE__ */ jsx49(Button7, { role: "text", icon: /* @__PURE__ */ jsx49(LuDownload, {}), children: "Save to a file" })
7956
+ }
7957
+ ) }),
7958
+ children: /* @__PURE__ */ jsx49("form", { className: "relative", children: /* @__PURE__ */ jsxs39("div", { className: "px-[18px] py-4", children: [
7959
+ /* @__PURE__ */ jsx49(
7960
+ "div",
7961
+ {
7962
+ className: "absolute right-10 top-8 z-10",
7963
+ onClick: (evt) => evt.preventDefault(),
7964
+ children: /* @__PURE__ */ jsx49(CopyButton4, { text: json, size: 16 })
7965
+ }
7966
+ ),
7967
+ /* @__PURE__ */ jsx49("div", { className: "focus-within:border-primary-300 h-[324px] overflow-hidden rounded-sm border", children: /* @__PURE__ */ jsx49(
7968
+ MonacoEditor,
7969
+ {
7970
+ value: json,
7971
+ theme: isDarkMode ? "sentio-dark" : "sentio",
7972
+ language: "json",
7973
+ beforeMount: onBeforeMount,
7974
+ options: {
7975
+ readOnly: true,
7976
+ minimap: { enabled: false },
7977
+ lineNumbers: "off"
7978
+ }
7979
+ }
7980
+ ) })
7981
+ ] }) })
7982
+ }
7983
+ );
7984
+ }
7927
7985
  export {
7928
7986
  AggregateInput,
7929
7987
  AreaIcon_default as AreaIcon,
@@ -7944,6 +8002,7 @@ export {
7944
8002
  ErrorChart,
7945
8003
  EventsFunctionCategories,
7946
8004
  EventsFunctionMap,
8005
+ ExportDashboardDialog,
7947
8006
  FunctionInput,
7948
8007
  FunctionMap,
7949
8008
  FunctionsCategories,