@ocelescope/core 0.10.1 → 0.11.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.
Files changed (40) hide show
  1. package/README.md +2 -2
  2. package/dist/ActivityPicker-CtFSu1YR.js +31 -0
  3. package/dist/{AreaChart-DoD3LM50.js → AreaChart-BSwN1fMp.js} +6 -6
  4. package/dist/AttributePicker-Cq7luTEi.js +94 -0
  5. package/dist/{BarChart-Cixo5Okd.js → BarChart-CyMePf1z.js} +6 -6
  6. package/dist/E2ORelationPicker-C8EmrbFx.js +45 -0
  7. package/dist/EventAttributePicker-BgEdydek.js +26 -0
  8. package/dist/EventPicker-D5uNOTw1.js +38 -0
  9. package/dist/HistogramChart-CJwvvDUu.js +86 -0
  10. package/dist/{LineChart-CVz-dkJI.js → LineChart-Cbxnm338.js} +6 -6
  11. package/dist/O2ORelationPicker-CryAxxUo.js +43 -0
  12. package/dist/ObjectAttributePicker-D_I3LQsY.js +26 -0
  13. package/dist/ObjectPicker-D-ksQveT.js +38 -0
  14. package/dist/ObjectTypePicker-Bw8Fsktx.js +45 -0
  15. package/dist/{OcelChart-DvGTjJXo.js → OcelChart-DJNM5peW.js} +3 -4
  16. package/dist/OptionPicker-DQ-WYFQZ.js +344 -0
  17. package/dist/{PieChart-DBiASngC.js → PieChart-BmMoI0TY.js} +6 -6
  18. package/dist/{ScatterChart-jIQOjQes.js → ScatterChart-CASPRlZU.js} +6 -6
  19. package/dist/{SqlChart-bwDArK2l.js → SqlChart-cxKpWkyh.js} +34 -35
  20. package/dist/{SunburstChart-D6FhYBHI.js → SunburstChart-Ddx9EaL-.js} +5 -5
  21. package/dist/attributeOptions-COiWnKUS.js +36 -0
  22. package/dist/{cartesian-5TPNWjl_.js → cartesian-CtdS2iZb.js} +2 -3
  23. package/dist/index.d.ts +228 -209
  24. package/dist/index.js +83 -172
  25. package/dist/relationOptions-hEEsEQrx.js +32 -0
  26. package/dist/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-D8jQpDG7.js} +1 -2
  27. package/dist/{series-BBXVjHHY.js → series-Bx0HVnSy.js} +2 -3
  28. package/dist/style.css +630 -745
  29. package/dist/{Plot-CxHHyXot.js → useChart-BK4pjGal.js} +29 -5
  30. package/dist/{useCurrentOCEL-BeBa7K0g.js → useCurrentOCEL-BUH5XGje.js} +2 -4
  31. package/dist/useOcelId-BEC6_yRa.js +8 -0
  32. package/dist/{useOcelQuery-D1QM-Zgv.js → useOcelQuery-6vtgZNzz.js} +2 -3
  33. package/dist/useSearch-CdXjjv-a.js +18 -0
  34. package/package.json +25 -26
  35. package/dist/ActivityPicker-DbrGeiC_.js +0 -18
  36. package/dist/EventAttributePicker-Cf2vVKv5.js +0 -27
  37. package/dist/NamePicker-Be-qmr1x.js +0 -43
  38. package/dist/ObjectAttributePicker-CL43EsYt.js +0 -27
  39. package/dist/ObjectTypePicker-CKmszS0y.js +0 -18
  40. package/dist/useOcelId-BSU0-Srk.js +0 -6
package/dist/index.js CHANGED
@@ -1,8 +1,7 @@
1
- import { t as useCurrentOcel } from "./useCurrentOCEL-BeBa7K0g.js";
2
- import { t as useOcelId } from "./useOcelId-BSU0-Srk.js";
3
- import { t as useOcelQuery } from "./useOcelQuery-D1QM-Zgv.js";
1
+ import { t as useCurrentOcel } from "./useCurrentOCEL-BUH5XGje.js";
2
+ import { t as useOcelQuery } from "./useOcelQuery-6vtgZNzz.js";
4
3
  import { ActionIcon, Anchor, AppShell, Box, Burger, Button, Center, ColorSchemeScript, CopyButton, Divider, Group, LoadingOverlay, MantineProvider, Modal, MultiSelect, NavLink, Select, Stack, Table, Text, ThemeIcon, Tooltip, UnstyledButton, createTheme, mantineHtmlProps, useMantineTheme } from "@mantine/core";
5
- import { getDownloadFlatLogQueryKey, getDownloadOCELQueryKey, getDownloadResourceAsPnmlQueryKey, getDownloadResourceQueryKey, getDownloadVariantFlatLogQueryKey, useActivities, useAggregatedAttributes, useAttributeNames, useE2o, useE2oCombinations, useEventAttributes, useEventIds, useGetDefaultOcel, useGetOcels, useImportDefaultOcel, useLogout, useO2o, useO2oCombinations, useObjectAttributes, useObjectIds, useObjectTypes, useUpload } from "@ocelescope/api-base";
4
+ import { getDownloadFlatLogQueryKey, getDownloadOCELQueryKey, getDownloadResourceAsPnmlQueryKey, getDownloadResourceQueryKey, getDownloadVariantFlatLogQueryKey, useActivities, useAggregatedAttributes, useAttributeNames, useE2o, useE2oCombinations, useEventAttributes, useGetDefaultOcel, useGetOcels, useImportDefaultOcel, useLogout, useO2o, useO2oCombinations, useObjectAttributes, useObjectTypes, useUpload } from "@ocelescope/api-base";
6
5
  import { HydrationBoundary, QueryClient, QueryClientProvider, keepPreviousData, useQueryClient } from "@tanstack/react-query";
7
6
  import { BookOpenIcon, BugIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, ContainerIcon, DownloadIcon, FilterIcon, GlobeIcon, HelpCircleIcon, LightbulbIcon, LogOutIcon, MailIcon, PackageIcon, PackagePlusIcon, PuzzleIcon, TriangleAlertIcon, UploadIcon, XIcon } from "lucide-react";
8
7
  import { DataTable } from "mantine-datatable";
@@ -10,6 +9,7 @@ import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, use
10
9
  import dayjs from "dayjs";
11
10
  import isBetween from "dayjs/plugin/isBetween.js";
12
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+ import clsx from "clsx";
13
13
  import dynamic from "next/dynamic.js";
14
14
  import { Dropzone } from "@mantine/dropzone";
15
15
  import { Readable } from "node:stream";
@@ -17,7 +17,7 @@ import z from "zod";
17
17
  import { Notifications, showNotification } from "@mantine/notifications";
18
18
  import { Theme } from "@r4pm/components/ui";
19
19
  import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
20
- import { useDebouncedValue, useDisclosure } from "@mantine/hooks";
20
+ import { useDisclosure } from "@mantine/hooks";
21
21
  import { env as env$1, useSessionStore } from "@ocelescope/api-client";
22
22
  import Link from "next/link.js";
23
23
  import { useRouter } from "next/router.js";
@@ -25,11 +25,10 @@ import { Head, Html, Main, NextScript } from "next/document.js";
25
25
  import { parse } from "content-disposition-attachment";
26
26
  import FileSaver from "file-saver";
27
27
  import qs from "qs";
28
- //#region src/lib/dayjs.ts
28
+ // src/lib/dayjs.ts
29
29
  dayjs.extend(isBetween);
30
30
  const formatDateTime = (dateString) => dayjs(dateString).format("YYYY-MM-DD HH:mm");
31
- //#endregion
32
- //#region src/lib/attributes.ts
31
+ // src/lib/attributes.ts
33
32
  const formatAttributeValue = (type, value) => {
34
33
  switch (type) {
35
34
  case "int": return value.toLocaleString("en-US");
@@ -38,8 +37,7 @@ const formatAttributeValue = (type, value) => {
38
37
  default: return value;
39
38
  }
40
39
  };
41
- //#endregion
42
- //#region src/components/AttributeTable.tsx
40
+ // src/components/AttributeTable.tsx
43
41
  const PAGE_SIZE$1 = 10;
44
42
  const COLUMN_WIDTHS$1 = {
45
43
  selector: 30,
@@ -49,12 +47,13 @@ const COLUMN_WIDTHS$1 = {
49
47
  range: 200,
50
48
  distinctValues: 120
51
49
  };
52
- const SubAttributeTable = ({ ocelId, entityType = "objects", attributeName, entityNames, hideRange = false, hideValues = false, ocelVersion, extraColumns = [] }) => {
50
+ const SubAttributeTable = ({ ocelId, entityType = "objects", attributeName, entityNames, hideRange = false, hideValues = false, ocelVersion, viewId, extraColumns = [] }) => {
53
51
  const isEvent = entityType === "events";
54
52
  const { data, isFetching } = (isEvent ? useEventAttributes : useObjectAttributes)(ocelId, {
55
53
  attribute_names: [attributeName],
56
54
  names: entityNames,
57
- ocel_version: ocelVersion
55
+ ocel_version: ocelVersion,
56
+ view_id: viewId
58
57
  }, { query: { placeholderData: keepPreviousData } });
59
58
  const columns = useMemo(() => [
60
59
  {
@@ -109,15 +108,19 @@ const SubAttributeTable = ({ ocelId, entityType = "objects", attributeName, enti
109
108
  }
110
109
  });
111
110
  };
112
- const AttributesTable = ({ ocelId, entityType = "objects", extraColumns = [], hideRange = false, hideValues = false, subTableExtraColumns, ocelVersion, alwaysExpandable = false, visibleAttributes, height, className, style }) => {
111
+ const AttributesTable = ({ ocelId, entityType = "objects", extraColumns = [], hideRange = false, hideValues = false, subTableExtraColumns, ocelVersion, viewId, alwaysExpandable = false, visibleAttributes, height, className, style }) => {
113
112
  const isEvent = entityType === "events";
114
113
  const [currentPage, setCurrentPage] = useState(1);
115
114
  const { data: attributeNames } = useAttributeNames(ocelId, {
116
115
  entity_type: entityType,
117
- ocel_version: ocelVersion
116
+ ocel_version: ocelVersion,
117
+ view_id: viewId
118
118
  });
119
119
  const [filteredAttributes, setFilteredAttributes] = useState([]);
120
- const { data: entityNames } = (isEvent ? useActivities : useObjectTypes)(ocelId, { ocel_version: ocelVersion });
120
+ const { data: entityNames } = (isEvent ? useActivities : useObjectTypes)(ocelId, {
121
+ ocel_version: ocelVersion,
122
+ view_id: viewId
123
+ });
121
124
  const [filteredEntityNames, setFilteredEntityNames] = useState([]);
122
125
  const isConstrained = visibleAttributes !== void 0;
123
126
  const attributeNameOptions = useMemo(() => {
@@ -142,6 +145,7 @@ const AttributesTable = ({ ocelId, entityType = "objects", extraColumns = [], hi
142
145
  page: currentPage,
143
146
  page_size: PAGE_SIZE$1,
144
147
  ocel_version: ocelVersion,
148
+ view_id: viewId,
145
149
  ...effectiveAttributeNames.length > 0 && { attribute_names: effectiveAttributeNames },
146
150
  ...filteredEntityNames.length > 0 && { entity_names: filteredEntityNames }
147
151
  }, { query: {
@@ -258,13 +262,13 @@ const AttributesTable = ({ ocelId, entityType = "objects", extraColumns = [], hi
258
262
  hideRange,
259
263
  hideValues,
260
264
  ocelVersion,
265
+ viewId,
261
266
  ...filteredEntityNames.length > 0 && { entityNames: filteredEntityNames }
262
267
  })
263
268
  }
264
269
  });
265
270
  };
266
- //#endregion
267
- //#region src/components/BarList/BarList.module.css
271
+ // src/components/BarList/BarList.module.css
268
272
  var BarList_module_default = {
269
273
  "bar": "uf8oba_bar",
270
274
  "barCell": "uf8oba_barCell",
@@ -277,9 +281,8 @@ var BarList_module_default = {
277
281
  "scrollArea": "uf8oba_scrollArea",
278
282
  "toggleRow": "uf8oba_toggleRow"
279
283
  };
280
- //#endregion
281
- //#region src/components/BarList/BarList.tsx
282
- const BarList = ({ data, labelHeader, valueHeader = "Frequency", maxVisibleItems = 8 }) => {
284
+ // src/components/BarList/BarList.tsx
285
+ const BarList = ({ data, labelHeader, valueHeader = "Frequency", maxVisibleItems = 8, className, style }) => {
283
286
  const [expanded, setExpanded] = useState(false);
284
287
  const entries = useMemo(() => Object.entries(data).sort((a, b) => b[1] - a[1]), [data]);
285
288
  const max = useMemo(() => Math.max(0, ...entries.map(([, c]) => c)), [entries]);
@@ -297,7 +300,8 @@ const BarList = ({ data, labelHeader, valueHeader = "Frequency", maxVisibleItems
297
300
  maxVisibleItems
298
301
  ]);
299
302
  return /* @__PURE__ */ jsxs("div", {
300
- className: BarList_module_default.container,
303
+ className: clsx(BarList_module_default.container, className),
304
+ style,
301
305
  children: [/* @__PURE__ */ jsx("div", {
302
306
  ref: scrollRef,
303
307
  className: BarList_module_default.scrollArea,
@@ -362,19 +366,18 @@ const BarList = ({ data, labelHeader, valueHeader = "Frequency", maxVisibleItems
362
366
  })]
363
367
  });
364
368
  };
365
- //#endregion
366
- //#region src/components/charts/index.tsx
369
+ // src/components/charts/index.tsx
367
370
  const browserOnly = (load) => dynamic(load, { ssr: false });
368
- const BarChart = browserOnly(() => import("./BarChart-Cixo5Okd.js").then((n) => n.n).then((module) => module.BarChart));
369
- const LineChart = browserOnly(() => import("./LineChart-CVz-dkJI.js").then((n) => n.n).then((module) => module.LineChart));
370
- const AreaChart = browserOnly(() => import("./AreaChart-DoD3LM50.js").then((n) => n.n).then((module) => module.AreaChart));
371
- const ScatterChart = browserOnly(() => import("./ScatterChart-jIQOjQes.js").then((n) => n.n).then((module) => module.ScatterChart));
372
- const PieChart = browserOnly(() => import("./PieChart-DBiASngC.js").then((n) => n.n).then((module) => module.PieChart));
373
- const SunburstChart = browserOnly(() => import("./SunburstChart-D6FhYBHI.js").then((n) => n.n).then((module) => module.SunburstChart));
374
- const SqlChart = browserOnly(() => import("./SqlChart-bwDArK2l.js").then((module) => module.SqlChart));
375
- const OcelChart = browserOnly(() => import("./OcelChart-DvGTjJXo.js").then((module) => module.OcelChart));
376
- //#endregion
377
- //#region src/components/Dropzone/Dropzone.module.css
371
+ const BarChart = browserOnly(() => import("./BarChart-CyMePf1z.js").then((n) => n.n).then((module) => module.BarChart));
372
+ const HistogramChart = browserOnly(() => import("./HistogramChart-CJwvvDUu.js").then((n) => n.n).then((module) => module.HistogramChart));
373
+ const LineChart = browserOnly(() => import("./LineChart-Cbxnm338.js").then((n) => n.n).then((module) => module.LineChart));
374
+ const AreaChart = browserOnly(() => import("./AreaChart-BSwN1fMp.js").then((n) => n.n).then((module) => module.AreaChart));
375
+ const ScatterChart = browserOnly(() => import("./ScatterChart-CASPRlZU.js").then((n) => n.n).then((module) => module.ScatterChart));
376
+ const PieChart = browserOnly(() => import("./PieChart-BmMoI0TY.js").then((n) => n.n).then((module) => module.PieChart));
377
+ const SunburstChart = browserOnly(() => import("./SunburstChart-Ddx9EaL-.js").then((n) => n.n).then((module) => module.SunburstChart));
378
+ const SqlChart = browserOnly(() => import("./SqlChart-cxKpWkyh.js").then((module) => module.SqlChart));
379
+ const OcelChart = browserOnly(() => import("./OcelChart-DJNM5peW.js").then((module) => module.OcelChart));
380
+ // src/components/Dropzone/Dropzone.module.css
378
381
  var Dropzone_module_default = {
379
382
  "control": "IgW5Wa_control",
380
383
  "description": "IgW5Wa_description",
@@ -382,8 +385,7 @@ var Dropzone_module_default = {
382
385
  "icon": "IgW5Wa_icon",
383
386
  "wrapper": "IgW5Wa_wrapper"
384
387
  };
385
- //#endregion
386
- //#region src/components/Dropzone/Dropzone.tsx
388
+ // src/components/Dropzone/Dropzone.tsx
387
389
  const FileDropzone = ({ onUpload, accept, content }) => {
388
390
  const theme = useMantineTheme();
389
391
  const openRef = useRef(null);
@@ -441,8 +443,7 @@ const FileDropzone = ({ onUpload, accept, content }) => {
441
443
  })]
442
444
  });
443
445
  };
444
- //#endregion
445
- //#region src/hooks/useInvalidate.ts
446
+ // src/hooks/useInvalidate.ts
446
447
  const ROUTE_PATH = {
447
448
  ocels: "modules/ocel/",
448
449
  resources: "resources",
@@ -454,8 +455,7 @@ const useInvalidate = () => {
454
455
  const queryClient = useQueryClient();
455
456
  return async (routeNames) => await queryClient.invalidateQueries({ predicate: (query) => typeof query.queryKey[0] === "string" && routeNames.some((route) => query.queryKey[0].includes(`/${ROUTE_PATH[route]}`)) });
456
457
  };
457
- //#endregion
458
- //#region src/components/Dropzone/FullScreenUpload.tsx
458
+ // src/components/Dropzone/FullScreenUpload.tsx
459
459
  const defaultLabel = `Drag'n'drop your ${[
460
460
  "OCELs",
461
461
  "Plugins",
@@ -527,8 +527,7 @@ const FullScreenUpload = ({ onSuccess, accept, label = defaultLabel, active = tr
527
527
  })
528
528
  })] });
529
529
  };
530
- //#endregion
531
- //#region src/components/EventHandler.ts
530
+ // src/components/EventHandler.ts
532
531
  const apiBase = process.env.EXTERNAL_API_BASE_URL ?? "http://localhost:8000";
533
532
  const sseHandler = async (req, res) => {
534
533
  const session_id = req.query.sessionId;
@@ -550,6 +549,10 @@ const sseHandler = async (req, res) => {
550
549
  });
551
550
  const webStream = backendRes.body;
552
551
  const nodeStream = Readable.fromWeb(webStream);
552
+ nodeStream.on("error", (err) => {
553
+ if (!controller.signal.aborted) console.error("SSE stream error:", err);
554
+ res.end();
555
+ });
553
556
  nodeStream.pipe(res);
554
557
  res.on("close", () => {
555
558
  console.log("Client disconnected");
@@ -599,8 +602,7 @@ const env = z.object({
599
602
  NEXT_PUBLIC_REQUEST_ENVIRONMENT_URL: process.env.NEXT_PUBLIC_REQUEST_ENVIRONMENT_URL,
600
603
  NEXT_PUBLIC_CONTACT_EMAIL: process.env.NEXT_PUBLIC_CONTACT_EMAIL
601
604
  });
602
- //#endregion
603
- //#region src/components/HelpModal/HelpModal.tsx
605
+ // src/components/HelpModal/HelpModal.tsx
604
606
  const HelpLink = ({ icon: Icon, label, href }) => /* @__PURE__ */ jsx(Anchor, {
605
607
  href,
606
608
  target: "_blank",
@@ -675,8 +677,7 @@ const HelpModal = ({ visible, onClose }) => {
675
677
  })
676
678
  });
677
679
  };
678
- //#endregion
679
- //#region src/components/ModulePage.tsx
680
+ // src/components/ModulePage.tsx
680
681
  const createModulesPage = (config) => {
681
682
  const { modules = [] } = config;
682
683
  const getStaticPaths = async () => {
@@ -705,8 +706,7 @@ const createModulesPage = (config) => {
705
706
  ModulePage
706
707
  };
707
708
  };
708
- //#endregion
709
- //#region src/components/OcelSelect/OcelSelect.tsx
709
+ // src/components/OcelSelect/OcelSelect.tsx
710
710
  const iconProps = {
711
711
  color: "currentColor",
712
712
  opacity: .6,
@@ -773,8 +773,7 @@ const CurrentOcelSelect = () => {
773
773
  }
774
774
  });
775
775
  };
776
- //#endregion
777
- //#region src/components/UploadSection/UploadSection.tsx
776
+ // src/components/UploadSection/UploadSection.tsx
778
777
  const DefaultOcels = ({ onSuccess, setIsPending }) => {
779
778
  const { data: ocels = [] } = useGetDefaultOcel({});
780
779
  const invalidate = useInvalidate();
@@ -859,8 +858,7 @@ const UploadSection = ({ onSuccess }) => {
859
858
  ]
860
859
  });
861
860
  };
862
- //#endregion
863
- //#region src/components/UploadModal/UploadModal.tsx
861
+ // src/components/UploadModal/UploadModal.tsx
864
862
  const UploadModal = ({ visible, onClose }) => {
865
863
  return /* @__PURE__ */ jsx(Modal, {
866
864
  title: /* @__PURE__ */ jsx(Text, {
@@ -873,8 +871,7 @@ const UploadModal = ({ visible, onClose }) => {
873
871
  children: /* @__PURE__ */ jsx(UploadSection, { onSuccess: onClose })
874
872
  });
875
873
  };
876
- //#endregion
877
- //#region src/hooks/useModulePath.ts
874
+ // src/hooks/useModulePath.ts
878
875
  const useModulePath = (config) => {
879
876
  const { slug } = useRouter().query;
880
877
  const [moduleName, routeName] = [slug?.[0], slug?.[1]];
@@ -887,16 +884,14 @@ const useModulePath = (config) => {
887
884
  };
888
885
  }, [moduleName, routeName]);
889
886
  };
890
- //#endregion
891
- //#region src/lib/getModuleRoute.ts
887
+ // src/lib/getModuleRoute.ts
892
888
  const getModuleRoute = ({ moduleName, routeName, query }) => {
893
889
  return {
894
890
  pathname: `/${moduleName}${routeName ? `/${routeName}` : ""}`,
895
891
  ...query && { query: { ...query } }
896
892
  };
897
893
  };
898
- //#endregion
899
- //#region src/components/AppShell/AppShell.module.css
894
+ // src/components/AppShell/AppShell.module.css
900
895
  var AppShell_module_default = {
901
896
  "button": "rZS5FG_button",
902
897
  "buttonIcon": "rZS5FG_buttonIcon",
@@ -909,8 +904,7 @@ var AppShell_module_default = {
909
904
  "links": "rZS5FG_links",
910
905
  "navbar": "rZS5FG_navbar"
911
906
  };
912
- //#endregion
913
- //#region src/components/AppShell/components/NavBar.tsx
907
+ // src/components/AppShell/components/NavBar.tsx
914
908
  const LogoutButton = () => {
915
909
  const [isModalOpen, setIsModalOpen] = useState(false);
916
910
  const queryClient = useQueryClient();
@@ -1025,8 +1019,7 @@ const NavBar = ({ config }) => {
1025
1019
  })
1026
1020
  });
1027
1021
  };
1028
- //#endregion
1029
- //#region src/components/AppShell/components/OcelescopeLogo.tsx
1022
+ // src/components/AppShell/components/OcelescopeLogo.tsx
1030
1023
  const OcelescopeLogo = ({ size = 32 }) => /* @__PURE__ */ jsxs("svg", {
1031
1024
  width: size,
1032
1025
  height: size * 32 / 40,
@@ -1081,8 +1074,7 @@ const OcelescopeLogo = ({ size = 32 }) => /* @__PURE__ */ jsxs("svg", {
1081
1074
  })
1082
1075
  ]
1083
1076
  });
1084
- //#endregion
1085
- //#region src/components/AppShell/AppShell.tsx
1077
+ // src/components/AppShell/AppShell.tsx
1086
1078
  const AppShell$1 = ({ config, children }) => {
1087
1079
  const [mobileOpened, { toggle: toggleMobile }] = useDisclosure(true);
1088
1080
  const [desktopOpened, { toggle: toggleDesktop }] = useDisclosure(true);
@@ -1164,8 +1156,7 @@ const AppShell$1 = ({ config, children }) => {
1164
1156
  ]
1165
1157
  });
1166
1158
  };
1167
- //#endregion
1168
- //#region src/lib/sse.ts
1159
+ // src/lib/sse.ts
1169
1160
  const OCELLink = z.object({
1170
1161
  type: z.literal("ocel"),
1171
1162
  ocel_id: z.string()
@@ -1217,8 +1208,7 @@ const ServerEventMessage = z.discriminatedUnion("type", [
1217
1208
  InvalidationRequest,
1218
1209
  ErrorNotification
1219
1210
  ]);
1220
- //#endregion
1221
- //#region src/components/SSEWrapper.tsx
1211
+ // src/components/SSEWrapper.tsx
1222
1212
  const NotificationColorMap = {
1223
1213
  warning: "yellow",
1224
1214
  info: "blue",
@@ -1287,8 +1277,7 @@ const SSEWrapper = () => {
1287
1277
  }, [sessionId, invalidate]);
1288
1278
  return null;
1289
1279
  };
1290
- //#endregion
1291
- //#region src/components/OcelescopeApp.tsx
1280
+ // src/components/OcelescopeApp.tsx
1292
1281
  const theme = createTheme({ fontWeights: { medium: "500" } });
1293
1282
  const OcelescopeApp = (config) => ({ Component, pageProps }) => {
1294
1283
  const [client] = useState(() => new QueryClient());
@@ -1310,8 +1299,7 @@ const OcelescopeApp = (config) => ({ Component, pageProps }) => {
1310
1299
  }), /* @__PURE__ */ jsx(ReactQueryDevtools, {})]
1311
1300
  });
1312
1301
  };
1313
- //#endregion
1314
- //#region src/components/OcelescopeDocument.tsx
1302
+ // src/components/OcelescopeDocument.tsx
1315
1303
  const OcelescopeDocument = () => {
1316
1304
  return /* @__PURE__ */ jsxs(Html, {
1317
1305
  lang: "en",
@@ -1323,97 +1311,19 @@ const OcelescopeDocument = () => {
1323
1311
  })] }), /* @__PURE__ */ jsxs("body", { children: [/* @__PURE__ */ jsx(Main, {}), /* @__PURE__ */ jsx(NextScript, {})] })]
1324
1312
  });
1325
1313
  };
1326
- //#endregion
1327
- //#region src/components/pickers/IdPicker.tsx
1328
- /**
1329
- * Picking ids by typing.
1330
- *
1331
- * Presentational: a log holds far more events and objects than a list can
1332
- * show, so the caller decides which ids a search turns up.
1333
- */
1334
- const IdPicker = ({ ids, label, placeholder = "Search…", search, onSearch, loading = false, emptyText, disabled, ...selection }) => {
1335
- const picked = selection.multiple ? [...selection.value] : selection.value ? [selection.value] : [];
1336
- const shared = {
1337
- size: "xs",
1338
- label,
1339
- placeholder,
1340
- searchable: true,
1341
- disabled,
1342
- data: [.../* @__PURE__ */ new Set([...ids, ...picked])],
1343
- searchValue: search,
1344
- onSearchChange: onSearch,
1345
- nothingFoundMessage: emptyText ?? (loading ? "Searching…" : "Nothing found")
1346
- };
1347
- return selection.multiple ? /* @__PURE__ */ jsx(MultiSelect, {
1348
- ...shared,
1349
- value: picked,
1350
- onChange: selection.onChange,
1351
- clearable: true
1352
- }) : /* @__PURE__ */ jsx(Select, {
1353
- ...shared,
1354
- value: picked[0] ?? null,
1355
- onChange: (next) => selection.onChange(next ?? void 0)
1356
- });
1357
- };
1358
- //#endregion
1359
- //#region src/components/pickers/internal/useSearch.ts
1360
- /** What the reader has typed, slowed to one request per pause in typing. */
1361
- const useSearch = () => {
1362
- const [search, setSearch] = useState("");
1363
- const [debounced] = useDebouncedValue(search, 300);
1364
- return {
1365
- search,
1366
- setSearch,
1367
- debounced: debounced || void 0
1368
- };
1369
- };
1370
- //#endregion
1371
- //#region src/components/pickers/EventPicker.tsx
1372
- /** Events of the log, found by typing part of an id. */
1373
- const EventPicker = ({ ocelId, ocelVersion = "filtered", limit = 50, ...picker }) => {
1374
- const id = useOcelId(ocelId);
1375
- const { search, setSearch, debounced } = useSearch();
1376
- const { data, isPending } = useEventIds(id, {
1377
- search: debounced,
1378
- size: limit,
1379
- ocel_version: ocelVersion
1380
- }, { query: { enabled: id != null } });
1381
- return /* @__PURE__ */ jsx(IdPicker, {
1382
- ids: data?.response ?? [],
1383
- search,
1384
- onSearch: setSearch,
1385
- loading: isPending,
1386
- ...picker
1387
- });
1388
- };
1389
- //#endregion
1390
- //#region src/components/pickers/ObjectPicker.tsx
1391
- /** Objects of the log, found by typing part of an id. */
1392
- const ObjectPicker = ({ ocelId, ocelVersion = "filtered", limit = 50, ...picker }) => {
1393
- const id = useOcelId(ocelId);
1394
- const { search, setSearch, debounced } = useSearch();
1395
- const { data, isPending } = useObjectIds(id, {
1396
- search: debounced,
1397
- size: limit,
1398
- ocel_version: ocelVersion
1399
- }, { query: { enabled: id != null } });
1400
- return /* @__PURE__ */ jsx(IdPicker, {
1401
- ids: data?.response ?? [],
1402
- search,
1403
- onSearch: setSearch,
1404
- loading: isPending,
1405
- ...picker
1406
- });
1407
- };
1408
- //#endregion
1409
- //#region src/components/pickers/index.tsx
1410
- const NamePicker = dynamic(() => import("./NamePicker-Be-qmr1x.js").then((module) => module.NamePicker), { ssr: false });
1411
- const ActivityPicker = dynamic(() => import("./ActivityPicker-DbrGeiC_.js").then((module) => module.ActivityPicker), { ssr: false });
1412
- const ObjectTypePicker = dynamic(() => import("./ObjectTypePicker-CKmszS0y.js").then((module) => module.ObjectTypePicker), { ssr: false });
1413
- const EventAttributePicker = dynamic(() => import("./EventAttributePicker-Cf2vVKv5.js").then((module) => module.EventAttributePicker), { ssr: false });
1414
- const ObjectAttributePicker = dynamic(() => import("./ObjectAttributePicker-CL43EsYt.js").then((module) => module.ObjectAttributePicker), { ssr: false });
1415
- //#endregion
1416
- //#region src/components/RelationTable.tsx
1314
+ // src/components/Pickers/index.tsx
1315
+ const clientOnly = (load) => dynamic(load, { ssr: false });
1316
+ const OptionPicker = clientOnly(() => import("./OptionPicker-DQ-WYFQZ.js").then((m) => m.OptionPicker));
1317
+ const ActivityPicker = clientOnly(() => import("./ActivityPicker-CtFSu1YR.js").then((m) => m.ActivityPicker));
1318
+ const ObjectTypePicker = clientOnly(() => import("./ObjectTypePicker-Bw8Fsktx.js").then((m) => m.ObjectTypePicker));
1319
+ const EventPicker = clientOnly(() => import("./EventPicker-D5uNOTw1.js").then((m) => m.EventPicker));
1320
+ const ObjectPicker = clientOnly(() => import("./ObjectPicker-D-ksQveT.js").then((m) => m.ObjectPicker));
1321
+ const EventAttributePicker = clientOnly(() => import("./EventAttributePicker-BgEdydek.js").then((m) => m.EventAttributePicker));
1322
+ const ObjectAttributePicker = clientOnly(() => import("./ObjectAttributePicker-D_I3LQsY.js").then((m) => m.ObjectAttributePicker));
1323
+ const AttributePicker = clientOnly(() => import("./AttributePicker-Cq7luTEi.js").then((m) => m.AttributePicker));
1324
+ const E2ORelationPicker = clientOnly(() => import("./E2ORelationPicker-C8EmrbFx.js").then((m) => m.E2ORelationPicker));
1325
+ const O2ORelationPicker = clientOnly(() => import("./O2ORelationPicker-CryAxxUo.js").then((m) => m.O2ORelationPicker));
1326
+ // src/components/RelationTable.tsx
1417
1327
  const PAGE_SIZE = 10;
1418
1328
  const COLUMN_WIDTHS = {
1419
1329
  selector: 30,
@@ -1424,13 +1334,14 @@ const COLUMN_WIDTHS = {
1424
1334
  total: 120
1425
1335
  };
1426
1336
  const relationId = ({ source, target }) => `${source} ${target}`;
1427
- const SubRelationTable = ({ ocelId, relationType, direction, source, target, hideRange = false, hideTotal = false, ocelVersion, extraColumns = [] }) => {
1337
+ const SubRelationTable = ({ ocelId, relationType, direction, source, target, hideRange = false, hideTotal = false, ocelVersion, viewId, extraColumns = [] }) => {
1428
1338
  const { data, isFetching } = (relationType === "e2o" ? useE2o : useO2o)(ocelId, {
1429
1339
  direction,
1430
1340
  source_types: [source],
1431
1341
  target_types: [target],
1432
1342
  with_qualifier: true,
1433
- ocel_version: ocelVersion
1343
+ ocel_version: ocelVersion,
1344
+ view_id: viewId
1434
1345
  }, { query: { placeholderData: keepPreviousData } });
1435
1346
  const columns = useMemo(() => [
1436
1347
  {
@@ -1487,13 +1398,14 @@ const SubRelationTable = ({ ocelId, relationType, direction, source, target, hid
1487
1398
  }
1488
1399
  });
1489
1400
  };
1490
- const RelationTable = ({ ocelId, relationType = "o2o", direction = "source", extraColumns = [], subTableExtraColumns, hideRange = false, hideTotal = false, ocelVersion, visibleRelations, height, className, style }) => {
1401
+ const RelationTable = ({ ocelId, relationType = "o2o", direction = "source", extraColumns = [], subTableExtraColumns, hideRange = false, hideTotal = false, ocelVersion, viewId, visibleRelations, height, className, style }) => {
1491
1402
  const isE2O = relationType === "e2o";
1492
1403
  const isSource = direction === "source";
1493
1404
  const [currentPage, setCurrentPage] = useState(1);
1494
1405
  const { data: combinations = [] } = (isE2O ? useE2oCombinations : useO2oCombinations)(ocelId, {
1495
1406
  direction,
1496
- ocel_version: ocelVersion
1407
+ ocel_version: ocelVersion,
1408
+ view_id: viewId
1497
1409
  });
1498
1410
  const sourceOptions = useMemo(() => Array.from(new Set(combinations.map(({ source }) => source))), [combinations]);
1499
1411
  const targetOptions = useMemo(() => Array.from(new Set(combinations.map(({ target }) => target))), [combinations]);
@@ -1531,6 +1443,7 @@ const RelationTable = ({ ocelId, relationType = "o2o", direction = "source", ext
1531
1443
  page_size: PAGE_SIZE,
1532
1444
  with_qualifier: false,
1533
1445
  ocel_version: ocelVersion,
1446
+ view_id: viewId,
1534
1447
  ...effectiveSources.length > 0 && { source_types: effectiveSources },
1535
1448
  ...effectiveTargets.length > 0 && { target_types: effectiveTargets },
1536
1449
  ...filteredQualifiers.length > 0 && { qualifiers: filteredQualifiers }
@@ -1664,13 +1577,13 @@ const RelationTable = ({ ocelId, relationType = "o2o", direction = "source", ext
1664
1577
  hideRange,
1665
1578
  hideTotal,
1666
1579
  ocelVersion,
1580
+ viewId,
1667
1581
  extraColumns: subTableExtraColumns
1668
1582
  })
1669
1583
  }
1670
1584
  });
1671
1585
  };
1672
- //#endregion
1673
- //#region src/hooks/useDownload.ts
1586
+ // src/hooks/useDownload.ts
1674
1587
  const useDownloadFile = () => {
1675
1588
  const { sessionId } = useSessionStore();
1676
1589
  const downloadFile = async (path) => {
@@ -1708,9 +1621,7 @@ const useDownloadFlatOCEL = useDownloadFromServer(getDownloadFlatLogQueryKey);
1708
1621
  const useDownloadVariantFlatLog = useDownloadFromServer(getDownloadVariantFlatLogQueryKey);
1709
1622
  const useDownloadResource = useDownloadFromServer(getDownloadResourceQueryKey);
1710
1623
  const useDownloadResourceAsPnml = useDownloadFromServer(getDownloadResourceAsPnmlQueryKey);
1711
- //#endregion
1712
- //#region src/lib/config.ts
1624
+ // src/lib/config.ts
1713
1625
  const defineModule = (def) => def;
1714
1626
  const defineModuleRoute = (def) => def;
1715
- //#endregion
1716
- export { ActivityPicker, AreaChart, AttributesTable, BarChart, BarList, EventAttributePicker, EventPicker, FileDropzone, FullScreenUpload, HelpModal, IdPicker, LineChart, NamePicker, ObjectAttributePicker, ObjectPicker, ObjectTypePicker, OcelChart, OcelSelect, OcelescopeApp, OcelescopeDocument, PieChart, RelationTable, ScatterChart, SqlChart, SunburstChart, UploadModal, UploadSection, createModulesPage, defineModule, defineModuleRoute, env, formatAttributeValue, getModuleRoute, sseHandler, useCurrentOcel, useDownloadFile, useDownloadFlatOCEL, useDownloadOCEL, useDownloadResource, useDownloadResourceAsPnml, useDownloadVariantFlatLog, useInvalidate, useOcelQuery };
1627
+ export { ActivityPicker, AreaChart, AttributePicker, AttributesTable, BarChart, BarList, E2ORelationPicker, EventAttributePicker, EventPicker, FileDropzone, FullScreenUpload, HelpModal, HistogramChart, LineChart, O2ORelationPicker, ObjectAttributePicker, ObjectPicker, ObjectTypePicker, OcelChart, OcelSelect, OcelescopeApp, OcelescopeDocument, OptionPicker, PieChart, RelationTable, ScatterChart, SqlChart, SunburstChart, UploadModal, UploadSection, createModulesPage, defineModule, defineModuleRoute, env, formatAttributeValue, getModuleRoute, sseHandler, useCurrentOcel, useDownloadFile, useDownloadFlatOCEL, useDownloadOCEL, useDownloadResource, useDownloadResourceAsPnml, useDownloadVariantFlatLog, useInvalidate, useOcelQuery };
@@ -0,0 +1,32 @@
1
+ // src/components/Pickers/internal/relationOptions.ts
2
+ const relationId = (relation) => JSON.stringify([
3
+ relation.source,
4
+ relation.target,
5
+ relation.qualifier
6
+ ]);
7
+ const relationLabel = (relation) => relation.qualifier ? `${relation.target} · ${relation.qualifier}` : relation.target;
8
+ /**
9
+ * Rows of the E2O or O2O endpoint as options: one per target type and
10
+ * qualifier, counted by how many relations there are. Grouped by source
11
+ * unless the picker is narrowed to one.
12
+ */
13
+ const relationOptions = ({ rows, source, unit, sourceColor, targetColor }) => rows.filter((row) => source === void 0 || row.source === source).map((row) => {
14
+ const relation = {
15
+ source: row.source,
16
+ target: row.target,
17
+ qualifier: row.qualifier
18
+ };
19
+ const perSource = row.min_count === row.max_count ? `${row.min_count}` : `${row.min_count}–${row.max_count}`;
20
+ return {
21
+ value: relation,
22
+ label: relationLabel(relation),
23
+ description: `${perSource} per ${unit}`,
24
+ count: row.sum,
25
+ color: targetColor(row.target),
26
+ group: source === void 0 ? {
27
+ label: row.source,
28
+ color: sourceColor(row.source)
29
+ } : void 0
30
+ };
31
+ });
32
+ export { relationLabel as n, relationOptions as r, relationId as t };
@@ -1,4 +1,4 @@
1
- //#region \0rolldown/runtime.js
1
+ // \0rolldown/runtime.js
2
2
  var __defProp = Object.defineProperty;
3
3
  var __exportAll = (all, no_symbols) => {
4
4
  let target = {};
@@ -9,5 +9,4 @@ var __exportAll = (all, no_symbols) => {
9
9
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
10
  return target;
11
11
  };
12
- //#endregion
13
12
  export { __exportAll as t };
@@ -1,5 +1,5 @@
1
- import { a as plotted, i as measureOf, r as label } from "./Plot-CxHHyXot.js";
2
- //#region src/components/charts/internal/series.ts
1
+ import { a as measureOf, i as label, o as plotted } from "./useChart-BK4pjGal.js";
2
+ // src/components/charts/internal/series.ts
3
3
  /**
4
4
  * The rows as traces: one per value of the `series` column, or one per measure
5
5
  * when there is no series column.
@@ -28,5 +28,4 @@ const paint = (series, colorOf, alone) => {
28
28
  if (!colorOf) return void 0;
29
29
  return alone ? series.labels.map(colorOf) : colorOf(series.name);
30
30
  };
31
- //#endregion
32
31
  export { toSeries as n, paint as t };